summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-01 20:30:10 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-01 20:30:10 -0400
commit1ceff5730e102c64e25769580615af3e4bf0d280 (patch)
tree578616b3d03aeebbb8bdff19dd213d3f9ea1fb68
parentb5dd782fc8080ca5e8b3ca1bb835582820872138 (diff)
parent4725e8849e62b84f75385b6699def6bfd6f5dcb7 (diff)
downloadserverdata-1ceff5730e102c64e25769580615af3e4bf0d280.tar.gz
serverdata-1ceff5730e102c64e25769580615af3e4bf0d280.tar.bz2
serverdata-1ceff5730e102c64e25769580615af3e4bf0d280.tar.xz
serverdata-1ceff5730e102c64e25769580615af3e4bf0d280.zip
Merge pull request #497 from mekolat/override
add discharge spell
-rw-r--r--world/map/npc/magic/_import.txt2
-rw-r--r--world/map/npc/magic/level0-antiprotect.txt26
-rw-r--r--world/map/npc/magic/level0-discharge.txt18
-rw-r--r--world/map/npc/magic/level0-wand.txt68
-rw-r--r--world/map/npc/magic/level1-flare-dart.txt9
-rw-r--r--world/map/npc/magic/level1-magic-blade.txt9
-rw-r--r--world/map/npc/magic/level2-lightning-strike.txt9
-rw-r--r--world/map/npc/magic/level2-magic-knuckles.txt9
-rw-r--r--world/map/npc/magic/level2-protect.txt6
-rw-r--r--world/map/npc/magic/level2-shear.txt14
-rw-r--r--world/map/npc/magic/level2-toxic-dart.txt9
11 files changed, 139 insertions, 40 deletions
diff --git a/world/map/npc/magic/_import.txt b/world/map/npc/magic/_import.txt
index 2ef595af..e5d40947 100644
--- a/world/map/npc/magic/_import.txt
+++ b/world/map/npc/magic/_import.txt
@@ -1,4 +1,6 @@
npc: npc/magic/_procedures.txt
+npc: npc/magic/level0-antiprotect.txt
+npc: npc/magic/level0-discharge.txt
npc: npc/magic/level0-wand.txt
npc: npc/magic/level1-aggravate.txt
npc: npc/magic/level1-experience.txt
diff --git a/world/map/npc/magic/level0-antiprotect.txt b/world/map/npc/magic/level0-antiprotect.txt
new file mode 100644
index 00000000..8e9b700c
--- /dev/null
+++ b/world/map/npc/magic/level0-antiprotect.txt
@@ -0,0 +1,26 @@
+-|script|antiprotect|32767
+{
+ if(call("magic_checks")) end;
+ callfunc "magic_exp";
+
+ if (@antiprotect)
+ goto L_Disable;
+
+ sc_end SC_PHYS_SHIELD;
+ message strcharinfo(0), "Shield : You are now protected against betsanc until you cast detsanc again or logout.";
+ set @antiprotect, 1;
+ end;
+
+L_Disable:
+ message strcharinfo(0), "Shield : You are no longer protected against betsanc.";
+ set @antiprotect, 0;
+ end;
+
+OnInit:
+ set .school, SKILL_MAGIC_NATURE;
+ set .invocation$, chr(MAGIC_SYMBOL) + "detsanc"; // used in npcs that refer to this spell
+ void call("magic_register");
+ set .level, 0;
+ set .exp_gain, 0;
+ end;
+}
diff --git a/world/map/npc/magic/level0-discharge.txt b/world/map/npc/magic/level0-discharge.txt
new file mode 100644
index 00000000..7b2cfa8c
--- /dev/null
+++ b/world/map/npc/magic/level0-discharge.txt
@@ -0,0 +1,18 @@
+-|script|discharge spell|32767
+{
+ if(call("magic_checks")) end;
+ callfunc "magic_exp";
+
+ // tell the spells they were discharged
+ // XXX: maybe we could make it do area damage when you discharge (release your energy all of a sudden)
+ addtimer 0, "::OnDischarge"; // seeks OnDischarge in ALL npcs
+ end;
+
+OnInit:
+ set .school, SKILL_MAGIC;
+ set .invocation$, chr(MAGIC_SYMBOL) + "discharge"; // used in npcs that refer to this spell
+ void call("magic_register");
+ set .level, 0;
+ set .exp_gain, 0;
+ end;
+}
diff --git a/world/map/npc/magic/level0-wand.txt b/world/map/npc/magic/level0-wand.txt
index 07fbb025..00934806 100644
--- a/world/map/npc/magic/level0-wand.txt
+++ b/world/map/npc/magic/level0-wand.txt
@@ -1,62 +1,70 @@
-|script|spell-wand|32767
{
if(call("magic_checks")) goto L_Failed;
- callsub S_CheckWand;
- if(@WandAttack != 1) goto L_Failed;
+ set @wandspell[0], 0; // reset state
+ callfunc "adjust_spellpower";
+ callsub S_Loop; // set up wand
+ if(@wandspell[0] < 1) goto L_Failed;
// here we install
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 500, "Magic Timer::OnClear"; // set the new debuff
- callfunc "adjust_spellpower";
misceffect FX_MAGIC_GENERIC, strcharinfo(0);
- set .@delay, (((200 - Agi) * 1200) / 200);
- overrideattack (@Wand + (@spellpower / 10)), .@delay, 3, ATTACK_ICON_GENERIC, @WandID, strnpcinfo(0)+"::OnAttack";
+
callfunc "magic_exp";
+ goto L_FreeRecast;
+
+L_FreeRecast:
+ if (@wandspell[4] > 0)
+ addtimer 0, strnpcinfo(0) + "::OnSetRecast";
end;
-OnAttack:
- callsub S_CheckWand;
- if(@WandAttack != 1) goto L_Failed;
- if(target(BL_ID, @target_id, 22) != 22) goto L_Failed; // 0x02 | 0x04 | 0x10
- set Sp, (Sp - @WandCost);
- set @damage, (@Wand * (@spellpower / 3));
- void call("elt_damage", @damage,@damage,ELT_NEUTRAL,ELT_NEUTRAL,FX_MAGIC_RED);
+OnDischarge:
+ if (@wandspell[4] < 1) end;
+ set @wandspell[4], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
end;
-S_CheckWand:
- set @Wand, 0;
- set @wand_loop, 0;
- goto S_Loop;
+OnSetRecast:
+ overrideattack @wandspell[3], 3, ATTACK_ICON_GENERIC, @wandspell[0], strnpcinfo(0)+"::OnAttack";
+ end;
+
+OnAttack:
+ if(target(BL_ID, @target_id, 22) != 22) goto L_FreeRecast; // 0x02 | 0x04 | 0x10
+ if (Sp < @wandspell[1]) goto L_LowSp;
+ set Sp, (Sp - @wandspell[1]);
+ void call("elt_damage", @wandspell[2],@wandspell[2],ELT_NEUTRAL,ELT_NEUTRAL,FX_MAGIC_RED);
+ set @wandspell[4], @wandspell[4] - 1;
+ goto L_FreeRecast;
S_Loop:
- if ((getequipid(equip_hand1) == .Wands[@wand_loop]) || (getequipid(equip_hand2) == .Wands[@wand_loop]))
+ if ((getequipid(equip_hand1) == .Wands[.@wand_loop]) || (getequipid(equip_hand2) == .Wands[.@wand_loop]))
goto S_SetWand;
- set @wand_loop, (@wand_loop + 1);
- if (@wand_loop >= getarraysize(.Wands))
+ set .@wand_loop, (.@wand_loop + 1);
+ if (.@wand_loop >= getarraysize(.Wands))
goto S_NoWand;
goto S_Loop;
S_SetWand:
- set @Wand, .WandsPwr[@wand_loop];
- set @WandID, .WandsAnim[@wand_loop];
+ set .@pwr, .WandsPwr[.@wand_loop];
if (QL_MORGAN == 2)
set QL_MORGAN, 3;
- set @WandCost, (@Wand * (BaseLevel / 15) + 2);
- set @WandAttack, 0;
- if (Sp < @WandCost)
- goto S_LowSp;
- set @WandAttack, 1; // everything is fine
+ setarray @wandspell[0],
+ .WandsAnim[.@wand_loop], // wand anim/id
+ (.@pwr * (BaseLevel / 15) + 2), // wand cost
+ (.@pwr * (@spellpower / 3)), // wand dmg
+ (((200 - Agi) * 1200) / 200), //delay
+ (.@pwr + (@spellpower / 10)); // charges
return;
S_NoWand:
message strcharinfo(0), "Wand : ##3##BYou need a wand Equipped!";
- set @WandAttack, 0;
return;
-S_LowSp:
+L_LowSp:
message strcharinfo(0), "Wand : ##3##BOut of Mana";
- set @WandAttack, 0;
- return;
+ end;
L_Failed:
//misceffect FX_ELECTRICITY_RED, strcharinfo(0); // XXX: do we show an effect on fail?
diff --git a/world/map/npc/magic/level1-flare-dart.txt b/world/map/npc/magic/level1-flare-dart.txt
index 6c0ef303..0f70637f 100644
--- a/world/map/npc/magic/level1-flare-dart.txt
+++ b/world/map/npc/magic/level1-flare-dart.txt
@@ -31,8 +31,15 @@ L_FreeRecast:
addtimer 0, strnpcinfo(0) + "::OnSetRecast";
end;
+OnDischarge:
+ if (@flarspell[2] < 1) end;
+ set @flarspell[2], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
+ end;
+
OnSetRecast:
- overrideattack 1, @flarspell[3], 4, ATTACK_ICON_GENERIC, 34, strnpcinfo(0)+"::OnAttack";
+ overrideattack @flarspell[3], 4, ATTACK_ICON_GENERIC, 34, strnpcinfo(0)+"::OnAttack";
end;
OnInit:
diff --git a/world/map/npc/magic/level1-magic-blade.txt b/world/map/npc/magic/level1-magic-blade.txt
index ad39c244..851f8dea 100644
--- a/world/map/npc/magic/level1-magic-blade.txt
+++ b/world/map/npc/magic/level1-magic-blade.txt
@@ -23,6 +23,13 @@
callfunc "magic_exp";
goto L_FreeRecast;
+OnDischarge:
+ if (@chizaspell[2] < 1) end;
+ set @chizaspell[2], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
+ end;
+
OnAttack:
if (target(BL_ID, @target_id, 22) != 22) goto L_FreeRecast; // 0x10 | 0x02 | 0x04
void call("melee_damage", @chizaspell[4], @target_id, (@chizaspell[0] + rand(@chizaspell[1] + 5)));
@@ -35,7 +42,7 @@ L_FreeRecast:
end;
OnSetRecast:
- overrideattack 1, @chizaspell[3], 1, ATTACK_ICON_GENERIC, 30, strnpcinfo(0)+"::OnAttack";
+ overrideattack @chizaspell[3], 1, ATTACK_ICON_GENERIC, 30, strnpcinfo(0)+"::OnAttack";
end;
OnInit:
diff --git a/world/map/npc/magic/level2-lightning-strike.txt b/world/map/npc/magic/level2-lightning-strike.txt
index cf30a627..2baa2d33 100644
--- a/world/map/npc/magic/level2-lightning-strike.txt
+++ b/world/map/npc/magic/level2-lightning-strike.txt
@@ -41,8 +41,15 @@ L_FreeRecast:
addtimer 0, strnpcinfo(0) + "::OnSetRecast";
end;
+OnDischarge:
+ if (@ingravspell[2] < 1) end;
+ set @ingravspell[2], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
+ end;
+
OnSetRecast:
- overrideattack 1, @ingravspell[3], 8, ATTACK_ICON_GENERIC, 31, strnpcinfo(0)+"::OnAttack";
+ overrideattack @ingravspell[3], 8, ATTACK_ICON_GENERIC, 31, strnpcinfo(0)+"::OnAttack";
end;
OnNpc:
diff --git a/world/map/npc/magic/level2-magic-knuckles.txt b/world/map/npc/magic/level2-magic-knuckles.txt
index 0984a7fd..d309804b 100644
--- a/world/map/npc/magic/level2-magic-knuckles.txt
+++ b/world/map/npc/magic/level2-magic-knuckles.txt
@@ -31,8 +31,15 @@ L_FreeRecast:
addtimer 0, strnpcinfo(0) + "::OnSetRecast";
end;
+OnDischarge:
+ if (@upmarmuspell[1] < 1) end;
+ set @upmarmuspell[1], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
+ end;
+
OnSetRecast:
- overrideattack 1, @upmarmuspell[2], 1, ATTACK_ICON_GENERIC, 34, strnpcinfo(0)+"::OnAttack";
+ overrideattack @upmarmuspell[2], 1, ATTACK_ICON_GENERIC, 34, strnpcinfo(0)+"::OnAttack";
end;
OnInit:
diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt
index a3096ad7..db11105f 100644
--- a/world/map/npc/magic/level2-protect.txt
+++ b/world/map/npc/magic/level2-protect.txt
@@ -5,7 +5,7 @@
set .@level, getskilllv(.school);
if (.@level < .level) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
- if (.@level <= 3 && countitem("HardSpike") >= 1) delitem "HardSpike", 1;
+ if (.@level <= 3 && countitem("HardSpike") < 1) end;
elif (.@level <= 3) end;
set @target_id, getcharid(3, @args$);
if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id))
@@ -17,6 +17,9 @@
if (attachrid(@betsanc_caster) != 1) end;
if (@target_hat == 888) end; // FIXME: this whole 5 line block could be done with only one line if we modify getequipid
+ if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID;
+ if (get(@antiprotect, @target_id) > 0) end;
+ delitem "HardSpike", 1;
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 1500, "Magic Timer::OnClear"; // set the new debuff
callfunc "adjust_spellpower";
@@ -24,7 +27,6 @@
misceffect FX_MAGIC_GREEN, strcharinfo(0);
callfunc "magic_exp";
- if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID;
if (BL_ID == @target_id) set @args$, strcharinfo(0);
misceffect FX_MAGIC_SHIELD, @args$;
set .@time, (@spellpower*1000)+5000;
diff --git a/world/map/npc/magic/level2-shear.txt b/world/map/npc/magic/level2-shear.txt
index af825727..f65119c3 100644
--- a/world/map/npc/magic/level2-shear.txt
+++ b/world/map/npc/magic/level2-shear.txt
@@ -12,9 +12,8 @@
setarray @chipchipspell[0],
@spellpower,
(((200 - Agi) * 2000) / 200); //delay
- overrideattack 1, @chipchipspell[1], 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack";
callfunc "magic_exp";
- end;
+ goto L_FreeRecast;
OnAttack:
if (isloggedin(@target_id)) goto L_FreeRecast; // can not shear a player
@@ -23,6 +22,7 @@ OnAttack:
sc_start SC_SHEARED, 600000, 0, @target_id;
set .@score, rand(1000 - rand(@chipchipspell[0]));
set .@id, get(Class, @target_id); // get the mob ID
+ set @chipchipspell[2], 0;
if (.@id == 1020 && .@score < 300) set .@item$, "WhiteFur"; // Fluffy
elif (.@id == 1027 && .@score < 300) set .@item$, "WhiteFur"; // EasterFluffy
@@ -43,11 +43,19 @@ OnAttack:
end;
L_FreeRecast:
+ set @chipchipspell[2], 1;
addtimer 0, strnpcinfo(0) + "::OnSetRecast"; // we can't do it while already overridden, until it reaches a script terminator
end;
+OnDischarge:
+ if (@chipchipspell[2] < 1) end;
+ set @chipchipspell[2], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
+ end;
+
OnSetRecast:
- overrideattack 1, @chipchipspell[1], 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack";
+ overrideattack @chipchipspell[1], 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack";
end;
OnInit:
diff --git a/world/map/npc/magic/level2-toxic-dart.txt b/world/map/npc/magic/level2-toxic-dart.txt
index 357ae32b..c30eaa00 100644
--- a/world/map/npc/magic/level2-toxic-dart.txt
+++ b/world/map/npc/magic/level2-toxic-dart.txt
@@ -37,8 +37,15 @@ L_FreeRecast:
addtimer 0, strnpcinfo(0) + "::OnSetRecast";
end;
+OnDischarge:
+ if (@phlexspell[3] < 1) end;
+ set @phlexspell[3], 0;
+ misceffect FX_FIRE_BURST, strcharinfo(0);
+ overrideattack;
+ end;
+
OnSetRecast:
- overrideattack 1, @phlexspell[2], 4, ATTACK_ICON_GENERIC, 31, strnpcinfo(0)+"::OnAttack";
+ overrideattack @phlexspell[2], 4, ATTACK_ICON_GENERIC, 31, strnpcinfo(0)+"::OnAttack";
end;
OnInit: