summaryrefslogtreecommitdiff
path: root/world/map/npc/magic/level2-shear.txt
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-18 15:26:33 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-18 15:26:33 -0400
commit91fe3711fcacdfe83794b4347595e56e90e9d3a7 (patch)
tree771e06363fe2e7609847a0a63a2e499632d3d7a2 /world/map/npc/magic/level2-shear.txt
parenta895a9fb39002e18487a9c19d7c7ea5215a6afb8 (diff)
downloadserverdata-91fe3711fcacdfe83794b4347595e56e90e9d3a7.tar.gz
serverdata-91fe3711fcacdfe83794b4347595e56e90e9d3a7.tar.bz2
serverdata-91fe3711fcacdfe83794b4347595e56e90e9d3a7.tar.xz
serverdata-91fe3711fcacdfe83794b4347595e56e90e9d3a7.zip
give a free recast when spell attack conditions fails
Diffstat (limited to 'world/map/npc/magic/level2-shear.txt')
-rw-r--r--world/map/npc/magic/level2-shear.txt23
1 files changed, 16 insertions, 7 deletions
diff --git a/world/map/npc/magic/level2-shear.txt b/world/map/npc/magic/level2-shear.txt
index c76b1093..af825727 100644
--- a/world/map/npc/magic/level2-shear.txt
+++ b/world/map/npc/magic/level2-shear.txt
@@ -9,18 +9,19 @@
callfunc "adjust_spellpower";
set Sp, Sp - 23;
misceffect FX_MAGIC_GREEN, strcharinfo(0);
- set .@delay, (((200 - Agi) * 2000) / 200);
- overrideattack 1, .@delay, 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack";
+ setarray @chipchipspell[0],
+ @spellpower,
+ (((200 - Agi) * 2000) / 200); //delay
+ overrideattack 1, @chipchipspell[1], 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack";
callfunc "magic_exp";
- set @chipchip_sp, @spellpower;
end;
OnAttack:
- if (isloggedin(@target_id)) end; // can not shear a player
- if (sc_check(SC_SHEARED, @target_id)) end; // mob already sheared
- if (target(BL_ID, @target_id, 22) != 22) end; // 0x10 | 0x02 | 0x04
+ if (isloggedin(@target_id)) goto L_FreeRecast; // can not shear a player
+ if (sc_check(SC_SHEARED, @target_id)) goto L_FreeRecast; // mob already sheared
+ if (target(BL_ID, @target_id, 22) != 22) goto L_FreeRecast; // 0x10 | 0x02 | 0x04
sc_start SC_SHEARED, 600000, 0, @target_id;
- set .@score, rand(1000 - rand(@chipchip_sp));
+ set .@score, rand(1000 - rand(@chipchipspell[0]));
set .@id, get(Class, @target_id); // get the mob ID
if (.@id == 1020 && .@score < 300) set .@item$, "WhiteFur"; // Fluffy
@@ -41,6 +42,14 @@ OnAttack:
callfunc "QuestSagathaHappy";
end;
+L_FreeRecast:
+ addtimer 0, strnpcinfo(0) + "::OnSetRecast"; // we can't do it while already overridden, until it reaches a script terminator
+ end;
+
+OnSetRecast:
+ overrideattack 1, @chipchipspell[1], 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack";
+ end;
+
OnInit:
set .school, SKILL_MAGIC_NATURE;
set .invocation$, chr(MAGIC_SYMBOL) + "chipchip"; // used in npcs that refer to this spell