From 5362f0739c124be81a8724a8759e20ef4d07e1aa Mon Sep 17 00:00:00 2001 From: coffee Date: Sat, 3 Sep 2011 10:03:13 -0300 Subject: Reviews the way the script checks for a rid attached. --- world/map/npc/025-3/barriers.txt | 182 ++++++++++-------------------------- world/map/npc/025-4/battlecaves.txt | 68 +++++++++++--- 2 files changed, 104 insertions(+), 146 deletions(-) (limited to 'world/map') diff --git a/world/map/npc/025-3/barriers.txt b/world/map/npc/025-3/barriers.txt index 28148ab0..7c13d7c0 100644 --- a/world/map/npc/025-3/barriers.txt +++ b/world/map/npc/025-3/barriers.txt @@ -41,11 +41,10 @@ L_Block: OnTimer5000: if ($@battlecave1 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave1fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave1fighter$)); + if (attachrid(getcharid(3,$@cave1fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 26, 63, 60, 97) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave1fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE1) @@ -56,7 +55,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave1fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave1start) < 60) set $@cave1start, $@cave1start + 60; @@ -82,10 +80,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 78, 129; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -93,25 +87,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave1fighter$)); warp "025-3.gat", 78, 129; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave1fighter$)); warp "025-3.gat", 78, 129; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave1fighter$)); + if (attachrid(getcharid(3,$@cave1fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 78, 129; callsub S_Cleaning; end; @@ -164,11 +156,10 @@ L_Block: OnTimer5000: if ($@battlecave2 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave2fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave2fighter$)); + if (attachrid(getcharid(3,$@cave2fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 97, 62, 126, 96) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave2fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE2) @@ -179,7 +170,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave2fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave2start) < 60) set $@cave2start, $@cave2start + 60; @@ -205,10 +195,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 53, 109; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -216,25 +202,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave2fighter$)); warp "025-3.gat", 53, 109; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave2fighter$)); warp "025-3.gat", 53, 109; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave2fighter$)); + if (attachrid(getcharid(3,$@cave2fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 53, 109; callsub S_Cleaning; end; @@ -286,11 +270,10 @@ L_Block: OnTimer5000: if ($@battlecave3 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave3fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave3fighter$)); + if (attachrid(getcharid(3,$@cave3fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 150, 84, 177, 117) < 1) - goto L_Ranaway; + goto OnNoRid; if (cavefights & BATTLE_CAVE3) goto L_Win; if (PC_DIE_COUNTER > $@cave3fighterdeaths) @@ -301,7 +284,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave3fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave3start) < 60) set $@cave3start, $@cave3start + 60; @@ -327,10 +309,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 71, 85; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -338,25 +316,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave3fighter$)); warp "025-3.gat", 71, 85; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave3fighter$)); warp "025-3.gat", 71, 85; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave3fighter$)); + if (attachrid(getcharid(3,$@cave3fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 71, 85; callsub S_Cleaning; end; @@ -408,11 +384,10 @@ L_Block: OnTimer5000: if ($@battlecave4 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave4fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave4fighter$)); + if (attachrid(getcharid(3,$@cave4fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 28, 124, 57, 156) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave4fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE4) @@ -423,7 +398,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave4fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave4start) < 60) set $@cave4start, $@cave4start + 60; @@ -449,10 +423,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 80, 85; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -460,25 +430,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave4fighter$)); warp "025-3.gat", 80, 85; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave4fighter$)); warp "025-3.gat", 80, 85; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave4fighter$)); + if (attachrid(getcharid(3,$@cave4fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 80, 85; callsub S_Cleaning; end; @@ -530,11 +498,10 @@ L_Block: OnTimer5000: if ($@battlecave5 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave5fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave5fighter$)); + if (attachrid(getcharid(3,$@cave5fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 91, 131, 124, 160) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave5fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE5) @@ -545,7 +512,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave5fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave5start) < 60) set $@cave5start, $@cave5start + 60; @@ -571,10 +537,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 71, 32; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -582,25 +544,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave5fighter$)); warp "025-3.gat", 71, 32; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave5fighter$)); warp "025-3.gat", 71, 32; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave5fighter$)); + if (attachrid(getcharid(3,$@cave5fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 71, 32; callsub S_Cleaning; end; @@ -652,11 +612,10 @@ L_Block: OnTimer5000: if ($@battlecave6 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave6fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave6fighter$)); + if (attachrid(getcharid(3,$@cave6fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 153, 143, 178, 174) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave6fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE6) @@ -667,7 +626,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave6fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave6start) < 60) set $@cave6start, $@cave6start + 60; @@ -693,10 +651,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 128, 37; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -704,25 +658,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave6fighter$)); warp "025-3.gat", 128, 37; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave6fighter$)); warp "025-3.gat", 128, 37; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave6fighter$)); + if (attachrid(getcharid(3,$@cave6fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 128, 37; callsub S_Cleaning; end; @@ -774,11 +726,10 @@ L_Block: OnTimer5000: if ($@battlecave7 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave7fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave7fighter$)); + if (attachrid(getcharid(3,$@cave7fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 27, 185, 61, 219) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave7fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE7) @@ -789,7 +740,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave7fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave7start) < 60) set $@cave7start, $@cave7start + 60; @@ -815,10 +765,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 70, 59; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -826,25 +772,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave7fighter$)); warp "025-3.gat", 70, 59; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave7fighter$)); warp "025-3.gat", 70, 59; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave7fighter$)); + if (attachrid(getcharid(3,$@cave7fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 70, 59; callsub S_Cleaning; end; @@ -896,11 +840,10 @@ L_Block: OnTimer5000: if ($@battlecave8 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave8fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave8fighter$)); + if (attachrid(getcharid(3,$@cave8fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 90, 193, 119, 216) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave8fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE8) @@ -911,7 +854,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave8fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave8start) < 60) set $@cave8start, $@cave8start + 60; @@ -937,10 +879,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 138, 94; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -948,25 +886,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave8fighter$)); warp "025-3.gat", 138, 94; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave8fighter$)); warp "025-3.gat", 138, 94; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave8fighter$)); + if (attachrid(getcharid(3,$@cave8fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 138, 94; callsub S_Cleaning; end; @@ -1019,11 +955,10 @@ L_Block: OnTimer5000: if ($@battlecave9 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave9fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave9fighter$)); + if (attachrid(getcharid(3,$@cave9fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 144, 192, 173, 226) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave9fighterdeaths) goto L_CleaningDead; if (cavefights & BATTLE_CAVE9) @@ -1034,7 +969,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave9fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave9start) < 60) set $@cave9start, $@cave9start + 60; @@ -1060,10 +994,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-3.gat", 138, 158; message strcharinfo(0), "You can't stand the foul air inside the cave and run away!"; @@ -1071,25 +1001,23 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave9fighter$)); warp "025-3.gat", 138, 158; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave9fighter$)); warp "025-3.gat", 138, 158; message strcharinfo(0), "You were not strong enough to eliminate this power source."; callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave9fighter$)); + if (attachrid(getcharid(3,$@cave9fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 138, 158; callsub S_Cleaning; end; @@ -1162,11 +1090,10 @@ L_AlreadyHelped: OnTimer5000: if ($@battlecave10 == 0) goto L_AlreadyClean; - if (isloggedin(getcharid(3,$@cave10fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$))==0) + goto OnNoRid; if (getareausers("025-4.gat", 142, 24, 172, 48) < 1) - goto L_Ranaway; + goto OnNoRid; if (PC_DIE_COUNTER > $@cave10fighterdeaths) goto L_CleaningDead; if (Rossy_Quest == 16) @@ -1177,7 +1104,6 @@ OnTimer5000: end; L_Win: - attachrid(getcharid(3,$@cave10fighter$)); message strcharinfo(0), "It is getting harder to breathe inside this cave... You feel like you are almost passing out."; if ((gettimetick(2) - $@cave10start) < 60) set $@cave10start, $@cave10start + 60; @@ -1204,10 +1130,6 @@ S_Cleaning: setnpctimer 0; return; -L_Ranaway: - callsub S_Cleaning; - end; - L_BadAir: warp "025-4.gat", 93, 33; message strcharinfo(0), "You can't stand the foul air inside the cave and run as fast as you can to save Julia!"; @@ -1215,14 +1137,12 @@ L_BadAir: end; L_Cleaning: - attachrid(getcharid(3,$@cave10fighter$)); warp "025-3.gat", 77, 168; message strcharinfo(0), "You took too much time to eliminate this source of energy... If you stay one more second in this cave you won't be able to breathe...."; callsub S_Cleaning; end; L_CleaningDead: - attachrid(getcharid(3,$@cave10fighter$)); warp "025-3.gat", 77, 168; if ($@wave_cave10 < 5) message strcharinfo(0), "You were not strong enough to eliminate this power source."; @@ -1231,18 +1151,18 @@ L_CleaningDead: callsub S_Cleaning; end; -L_CleaningNorid: +OnNoRid: callsub S_Cleaning; end; OnGetout: - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$)) == 0) goto OnNoRid; warp "025-3.gat", 77, 168; callsub S_Cleaning; end; OnWin: - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$)) == 0) goto OnNoRid; warp "025-4.gat", 93, 33; callsub S_Cleaning; end; diff --git a/world/map/npc/025-4/battlecaves.txt b/world/map/npc/025-4/battlecaves.txt index 89a16305..5b6d50fd 100644 --- a/world/map/npc/025-4/battlecaves.txt +++ b/world/map/npc/025-4/battlecaves.txt @@ -36,10 +36,14 @@ L_Summon: set $@cave1_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave1::OnNoRid"; + end; + L_Done: set $@wave_cave1, $@wave_cave1 + 1; set $@cave1_kills, 0; - attachrid(getcharid(3,$@cave1fighter$)); + if (attachrid(getcharid(3,$@cave1fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -188,10 +192,14 @@ L_Summon: set $@cave2_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave2::OnNoRid"; + end; + L_Done: set $@wave_cave2, $@wave_cave2 + 1; set $@cave2_kills, 0; - attachrid(getcharid(3,$@cave2fighter$)); + if (attachrid(getcharid(3,$@cave2fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -266,10 +274,14 @@ L_Summon: set $@cave3_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave3::OnNoRid"; + end; + L_Done: set $@wave_cave3, $@wave_cave3 + 1; set $@cave3_kills, 0; - attachrid(getcharid(3,$@cave3fighter$)); + if (attachrid(getcharid(3,$@cave3fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -345,10 +357,14 @@ L_Summon: set $@cave4_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave4::OnNoRid"; + end; + L_Done: set $@wave_cave4, $@wave_cave4 + 1; set $@cave4_kills, 0; - attachrid(getcharid(3,$@cave4fighter$)); + if (attachrid(getcharid(3,$@cave4fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -427,10 +443,14 @@ L_Summon: set $@cave5_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave5::OnNoRid"; + end; + L_Done: set $@wave_cave5, $@wave_cave5 + 1; set $@cave5_kills, 0; - attachrid(getcharid(3,$@cave5fighter$)); + if (attachrid(getcharid(3,$@cave5fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -509,10 +529,14 @@ L_Summon: set $@cave6_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave6::OnNoRid"; + end; + L_Done: set $@wave_cave6, $@wave_cave6 + 1; set $@cave6_kills, 0; - attachrid(getcharid(3,$@cave6fighter$)); + if (attachrid(getcharid(3,$@cave6fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -591,10 +615,14 @@ L_Summon: set $@cave7_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave7::OnNoRid"; + end; + L_Done: set $@wave_cave7, $@wave_cave7 + 1; set $@cave7_kills, 0; - attachrid(getcharid(3,$@cave7fighter$)); + if (attachrid(getcharid(3,$@cave7fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -675,10 +703,14 @@ L_Summon: set $@cave8_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave8::OnNoRid"; + end; + L_Done: set $@wave_cave8, $@wave_cave8 + 1; set $@cave8_kills, 0; - attachrid(getcharid(3,$@cave8fighter$)); + if (attachrid(getcharid(3,$@cave8fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -759,10 +791,14 @@ L_Summon: set $@cave9_loop, 0; end; +L_Abort: + donpcevent "#WarpBattleCave9::OnNoRid"; + end; + L_Done: set $@wave_cave9, $@wave_cave9 + 1; set $@cave9_kills, 0; - attachrid(getcharid(3,$@cave9fighter$)); + if (attachrid(getcharid(3,$@cave9fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -840,16 +876,20 @@ L_Summon: end; L_SummonBoss: - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$)) == 0) goto L_Abort; areamonster "025-4.gat",142, 24, 172, 48,"",$@BOSS,1,"#StartBossCaveFight::OnBossDeath"; stopnpctimer; setnpctimer 0; end; +L_Abort: + donpcevent "#WarpBattleCave10::OnNoRid"; + end; + L_Done: set $@wave_cave10, $@wave_cave10 + 1; set $@cave10_kills, 0; - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$)) == 0) goto L_Abort; // Here you can define the messages to be shown for the players on the beginning of each wave. // Remember to adjust the number of conditionals according to the number of waves. @@ -884,9 +924,7 @@ L_CleaningNorid: end; OnTimer4000: - if (isloggedin(getcharid(3,$@cave10fighter$))==0) - goto L_CleaningNorid; - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$)) == 0) goto L_Abort; set @boss, @boss + 1; if (@boss == 1) message strcharinfo(0), "You feel something strange... Looks like something terrible is about to show up in this cave."; @@ -902,7 +940,7 @@ OnMonsterDeath: end; OnBossDeath: - attachrid(getcharid(3,$@cave10fighter$)); + if (attachrid(getcharid(3,$@cave10fighter$)) == 0) goto L_Abort; message strcharinfo(0), "What a harsh battle... You should hurry and save Julia!"; set Rossy_Quest, 16; getexp 100000, 0; -- cgit v1.2.3-60-g2f50