summaryrefslogtreecommitdiff
path: root/npc/magic
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic')
-rw-r--r--npc/magic/config.txt5
-rw-r--r--npc/magic/final.txt16
-rw-r--r--npc/magic/level1-summon-maggots.txt15
-rw-r--r--npc/magic/level2-arrow-hail.txt44
-rw-r--r--npc/magic/level2-happy-curse.txt30
5 files changed, 92 insertions, 18 deletions
diff --git a/npc/magic/config.txt b/npc/magic/config.txt
index 2cede16a..a179982c 100644
--- a/npc/magic/config.txt
+++ b/npc/magic/config.txt
@@ -160,13 +160,14 @@ function script SK_summon {
.@amt=getarg(1);
.@mex=getarg(2, 1);
.@sum=getarg(3, true);
+ .@lvl=getskilllv(SKILL_MAGIC);
if ($@GM_OVERRIDE || debug) debugmes "Skill "+@skillId+" Lv "+@skillLv;
- if (ispcdead())
+ if (ispcdead() || !.@lvl || !@skillLv)
return;
if (rand2(10) < abizit()) {
// Summon Magic (with magic level bonus)
- SummonMagic(@skillId, .@mob, .@amt, MAGIC_LVL+@skillLv-1, @skillLv, .@sum);
+ SummonMagic(@skillId, .@mob, .@amt, .@lvl+@skillLv-1, @skillLv, .@sum);
} else if (rand2(10) < abizit()) {
// Re-roll
dispbottom l("You cannot complete the casting correctly!");
diff --git a/npc/magic/final.txt b/npc/magic/final.txt
index e22aa6e7..a4de3bc8 100644
--- a/npc/magic/final.txt
+++ b/npc/magic/final.txt
@@ -82,14 +82,6 @@ function script HUB_SkillInvoke {
////////////////////////////////
/* XXX: Fire Class
// (May burn targets for damage over time)
- case TMW2_FIREBALL:
- .@PW=140+(10*@skillLv);
- .@RG=2+(@skillLv/5);
- // 22% chance, 2.5s
- areaharm(@skillTarget, .@RG, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
- sc_start SC_BLOODING, 2500, 1, 4200, SCFLAG_NONE, @skillTarget;
- GetManaExp(TMW2_FIREBALL, 2);
- break;
case TMW2_ARMAGEDDON:
.@PW=140+(10*@skillLv);
.@RG=5+(@skillLv/5);
@@ -137,14 +129,6 @@ function script HUB_SkillInvoke {
GetManaExp(@skillId, 1);
break;
////////////////////////////////
- // XXX: Physical Class (Archery)
- case TMW2_ARROWSHOWER:
- .@PW=150+(10*@skillLv);
- .@dmg=AdjustAttackpower(.@PW);
- .@RG=1+(@skillLv/3);
- areaharm(@skillTarget, .@RG, .@dmg, HARM_PHYS, Ele_Neutral);
- GetManaExp(@skillId, 1);
- break;
// Summons which never fail
case TMW2_ZARKOR:
SummonMagic(@skillId, CaveMaggot, 2, @skillLv);
diff --git a/npc/magic/level1-summon-maggots.txt b/npc/magic/level1-summon-maggots.txt
new file mode 100644
index 00000000..7ca9f74d
--- /dev/null
+++ b/npc/magic/level1-summon-maggots.txt
@@ -0,0 +1,15 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_KALMURK (Level 1)
+// School: Astral 1
+
+function script SK_Kalmurk {
+ delitem Root, 1;
+ delitem .@it, 1;
+ specialeffect(FX_MAGIC_MAGGOT_CAST, AREA, getcharid(3));
+ sleep2(cap_value(5400-AdjustSpellpower(100)-@skillLv*400, 500, 5000));
+ SK_summon(Maggot, 2, 1);
+ return;
+}
+
diff --git a/npc/magic/level2-arrow-hail.txt b/npc/magic/level2-arrow-hail.txt
new file mode 100644
index 00000000..217f7fb0
--- /dev/null
+++ b/npc/magic/level2-arrow-hail.txt
@@ -0,0 +1,44 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_FRILLYAR (Level 1)
+// School: War 2
+
+function script SK_Frillyar {
+ // Additional check for ammo
+ .@it=getequipid(EQI_AMMO);
+ if (.@it < 1) {
+ dispbottom l("Please equip your ammo first!");
+ return;
+ }
+ if (countitem(.@it) < 15) {
+ dispbottom l("You need at least %d %s to use this spell!",
+ 15, getitemname(.@it));
+ return;
+ }
+ // Delete items
+ delitem(SulphurPowder, 1);
+ delitem(.@it, 15);
+ // Proccess attack power
+ .@RG=4+(@skillLv/2);
+ .@PW=90+(10*@skillLv);
+ .@PW+=getiteminfo(.@it, ITEMINFO_ATK);
+ // Weather modifiers
+ if ("#WeatherCore"::weather(MASK_RAIN))
+ .@PW-=10;
+ if ("#WeatherCore"::weather(MASK_SANDSTORM))
+ .@PW-=10;
+ if ("#WeatherCore"::weather(MASK_SNOW))
+ .@PW-=10;
+ // Effective magic code
+ .@dmg=AdjustSpellpower(.@PW);
+ .@dmg+=getiteminfo(.@it, ITEMINFO_ATK);
+ specialeffect(FX_MAGIC_AHAIL_CAST, AREA, @skillTarget);
+ areaharm(@skillTarget, .@RG, .@dmg, HARM_PHYS, Ele_Neutral);
+ harm(@skillTarget, .@dmg/20, HARM_MAGI, Ele_Holy);
+ specialeffect(FX_ARROW_HAIL, AREA, @skillTarget);
+ GetManaExp(@skillId, 2);
+ return;
+}
+
+
diff --git a/npc/magic/level2-happy-curse.txt b/npc/magic/level2-happy-curse.txt
new file mode 100644
index 00000000..08987293
--- /dev/null
+++ b/npc/magic/level2-happy-curse.txt
@@ -0,0 +1,30 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_JOYPLIM (Level 1)
+// School: General 2
+
+function script SK_Joyplim {
+ 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;
+}
+