summaryrefslogtreecommitdiff
path: root/npc/magic/level2-happy-curse.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/level2-happy-curse.txt')
-rw-r--r--npc/magic/level2-happy-curse.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/npc/magic/level2-happy-curse.txt b/npc/magic/level2-happy-curse.txt
new file mode 100644
index 00000000..1e1096a1
--- /dev/null
+++ b/npc/magic/level2-happy-curse.txt
@@ -0,0 +1,32 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_JOYPLIM (Level 1)
+// School: General 2
+
+function script SK_Joyplim {
+ if (getarg(0, true))
+ delitem GingerBreadMan, 1;
+
+ .@b=(BL_PC | BL_PET | BL_MER | BL_HOM); // | BL_MOB
+ .@r=3+cap_value(getskilllv(SKILL_MAGIC)+(@skillLv/2), 1, 12); // Your radius
+ .@s=AdjustSpellpower(100); // Your magical stamina
+ .@c=cap_value(11-@skillLv, 1, 10)*2; // MATK stamina cost per char
+ .@e=(getskilllv(SKILL_MAGIC_DARK) ? E_EVIL : E_HAPPY); // Emote
+
+ getmapxy(.@m$, .@x, .@y, 0);
+
+ // TODO: Maybe put this loop in a timer, etc? But... Do we want to?
+ .@c=getunits(.@b, .@mbs, false, .@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ unitemote(.@mbs[.@i], E_HAPPY);
+ // Stamina cost
+ .@s-=.@c;
+ if (.@s < 0)
+ break;
+ }
+ specialeffect(FX_MAGIC_JOY_CAST, AREA, getcharid(3));
+ GetManaExp(@skillId, 2);
+ return;
+}
+