From 4e279bcf145eac9ebf49b95a702a1fc62680a10a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 13 Jul 2018 23:01:44 -0300 Subject: Introduce #parum and the Magic Experience System. If you re-cast something, no Mana Exp Points are gained. Only pseudo-magic skills count. --- npc/config/magic.txt | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'npc/config/magic.txt') 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 -- cgit v1.2.3-70-g09d2