summaryrefslogtreecommitdiff
path: root/npc/config/magic.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/config/magic.txt')
-rw-r--r--npc/config/magic.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/npc/config/magic.txt b/npc/config/magic.txt
new file mode 100644
index 000000000..0ec8dd99b
--- /dev/null
+++ b/npc/config/magic.txt
@@ -0,0 +1,48 @@
+// TMW2 script
+// Author: Jesusalva <admin@tmw2.org>
+//
+// Magic Script Core Functions
+//
+// Used for our pseudo-magic.
+// These are only helpers, you can add more restrictions and effects freely.
+
+// SkillID, Mana, MobID{, MP per level, Script}
+function script SummonMagic {
+ .@sk=getarg(0);
+ .@mp=getarg(1);
+ .@id=getarg(2);
+ .@scr$=getarg(4,"Cassia::OnSkip");
+
+ // PRE EXECUTION
+ // Check Skill
+ if (getskilllv(.@sk) < 1)
+ end;
+
+ // Load mana cost
+ .@amp=getarg(3,0);
+ .@mp=.@mp+getskilllv(.@sk)*.@amp-.@amp;
+
+ // Check mana
+ if (readparam(Sp) < .@mp) {
+ dispbottom l("Insufficient mana: @@/@@.", readparam(Sp), .@mp);
+ end;
+ }
+
+
+ // EXECUTION
+ // Apply costs
+ heal 0, 0-.@mp;
+
+ // Cause effect
+ getmapxy(.@map$,.@x,.@y,0);
+ monster(.@map$, .@x, .@y, "Summoned Monster", .@id, getskilllv(.@sk), .@scr, Size_Medium, 1);
+ dispbottom l("All monsters summoned!");
+ /* AI Options
+ 0 = none (default)
+ 1 = attack/friendly
+ 2 = sphere (Alchemist skill)
+ 3 = flora (Alchemist skill)
+ 4 = zanzou (Kagerou/Oboro skill)
+ */
+
+}