diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-07-13 23:01:44 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-07-13 23:01:44 -0300 |
commit | 4e279bcf145eac9ebf49b95a702a1fc62680a10a (patch) | |
tree | fb085715c09413446aab0a08e05e476a5503b2b2 /npc/config | |
parent | bcbf02427b21c6d3fb35fb9bb91a3660e4cef5f5 (diff) | |
download | serverdata-4e279bcf145eac9ebf49b95a702a1fc62680a10a.tar.gz serverdata-4e279bcf145eac9ebf49b95a702a1fc62680a10a.tar.bz2 serverdata-4e279bcf145eac9ebf49b95a702a1fc62680a10a.tar.xz serverdata-4e279bcf145eac9ebf49b95a702a1fc62680a10a.zip |
Introduce #parum and the Magic Experience System.
If you re-cast something, no Mana Exp Points are gained.
Only pseudo-magic skills count.
Diffstat (limited to 'npc/config')
-rw-r--r-- | npc/config/magic.txt | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/npc/config/magic.txt b/npc/config/magic.txt index 1617bfeff..587b2f081 100644 --- a/npc/config/magic.txt +++ b/npc/config/magic.txt @@ -5,24 +5,30 @@ // // Used for our pseudo-magic. // These are only helpers, you can add more restrictions and effects freely. +// Important Variables: MAGIC_EXP, LAST_SKILL -// SkillID, Mana, MobID{, MP per level, MobPerSkillLevel=2} -function script SummonMagic { +// SkillID, EXP Points +function script GetManaExp { .@sk=getarg(0); - .@mp=getarg(1); - .@id=getarg(2); - .@adj=getarg(4,2); - - if (.@adj < 1) { - debugmes "\033[31mInvalid MobPerSkillLevel for SummonMagic (.@adj): "+.@adj+"\033[0m"; - dispbottom l("Invalid parameter specified, blame saulc."); + .@pt=getarg(1); + if (LAST_SKILL == .@sk) end; - } + LAST_SKILL=.@sk; + MAGIC_EXP=MAGIC_EXP+.@pt; + end; +} +// SkillID, Mana{, MP per level} +function script MagicCheck { // PRE EXECUTION + // Load Variables + .@sk=getarg(0); + .@mp=getarg(1); + .@amp=getarg(2,0); + // Check Skill if (getskilllv(.@sk) < 1) - end; + return 0; // Load mana cost .@amp=getarg(3,0); @@ -31,9 +37,28 @@ function script SummonMagic { // Check mana if (readparam(Sp) < .@mp) { dispbottom l("Insufficient mana: @@/@@.", readparam(Sp), .@mp); + return 0; + } + return 1; +} + +// SkillID, Mana, MobID{, MP per level, MobPerSkillLevel=2} +function script SummonMagic { + .@sk=getarg(0); + .@mp=getarg(1); + .@id=getarg(2); + .@adj=getarg(4,2); + + if (.@adj < 1) { + debugmes "\033[31mInvalid MobPerSkillLevel for SummonMagic (.@adj): "+.@adj+"\033[0m"; + dispbottom l("Invalid parameter specified, blame saulc."); end; } + // PRE EXECUTION + if (!MagicCheck(.@sk, .@mp, .@amp)) + end; + // EXECUTION // Apply costs |