From ac5bacc159519ec4292821c29d95c901bf1233de Mon Sep 17 00:00:00 2001 From: Coffee Date: Sat, 9 Jul 2011 18:12:40 -0300 Subject: Changes Rossy quest according to jenalya's suggestions and other fixes. --- world/map/npc/025-3/barriers.txt | 573 +++++++++++++++++++++++++++++------- world/map/npc/025-4/battlecaves.txt | 167 +++-------- 2 files changed, 510 insertions(+), 230 deletions(-) diff --git a/world/map/npc/025-3/barriers.txt b/world/map/npc/025-3/barriers.txt index 22879eb5..8b57bee1 100644 --- a/world/map/npc/025-3/barriers.txt +++ b/world/map/npc/025-3/barriers.txt @@ -5,8 +5,7 @@ 025-3.gat,78,127,0 script #WarpBattleCave1 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 26, 63, 60, 97) >= 1) goto L_SomeoneInside; - if ($@timercontrol1 != 0) goto L_Wait; + if (getareausers("025-4.gat", 26, 63, 60, 97) >= 1 || $@battlecave1 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE1) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -24,18 +23,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave1fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone1 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone1, 1; end; L_Block: @@ -45,24 +38,50 @@ L_Block: OnTimer5000: if ($@battlecave1 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave1fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 26, 63, 60, 97) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave1fighter$)); + if (cavefights & BATTLE_CAVE1) goto L_Win; + if (getareausers("025-4.gat", 26, 63, 60, 97) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave1start >= $@CAVE1_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave1fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave1fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave1start) < 60) set $@cave1start, $@cave1start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave1_timer, $@cave1_timer + 5; + if ($@cave1_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave1, 0; set $@cave1_kills, 0; set $@cave1start, 0; set $@cave1fighter$, ""; set $@cave1fighterdeaths$, 0; + set $@battlecave1, 0; killmonster "025-4.gat", "#StartCaveFight1::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave1, 0; + set $@cave1_kills, 0; + set $@cave1start, 0; + set $@cave1fighter$, ""; + set $@cave1fighterdeaths$, 0; + set $@battlecave1, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave1fighter$)); warp "025-3.gat", 78, 129; @@ -72,6 +91,7 @@ L_Cleaning: set $@cave1start, 0; set $@cave1fighter$, ""; set $@cave1fighterdeaths$, 0; + set $@battlecave1, 0; killmonster "025-4.gat", "#StartCaveFight1::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -86,6 +106,7 @@ L_CleaningDead: set $@cave1start, 0; set $@cave1fighter$, ""; set $@cave1fighterdeaths$, 0; + set $@battlecave1, 0; killmonster "025-4.gat", "#StartCaveFight1::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -97,13 +118,26 @@ L_CleaningNorid: set $@cave1start, 0; set $@cave1fighter$, ""; set $@cave1fighterdeaths$, 0; + set $@battlecave1, 0; killmonster "025-4.gat", "#StartCaveFight1::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave1fighter$)); + warp "025-3.gat", 78, 129; + set $@wave_cave1, 0; + set $@cave1_kills, 0; + set $@cave1start, 0; + set $@cave1fighter$, ""; + set $@cave1fighterdeaths$, 0; + set $@battlecave1, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol1, 0; stopnpctimer; setnpctimer 0; end; @@ -115,8 +149,7 @@ L_AlreadyClean: 025-3.gat,53,107,0 script #WarpBattleCave2 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 97, 62, 126, 96) >= 1) goto L_SomeoneInside; - if ($@timercontrol2 != 0) goto L_Wait; + if (getareausers("025-4.gat", 97, 62, 126, 96) >= 1 || $@battlecave2 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE2) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -134,18 +167,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave2fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone2 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone2, 1; end; L_Block: @@ -155,24 +182,50 @@ L_Block: OnTimer5000: if ($@battlecave2 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave2fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 97, 62, 126, 96) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave2fighter$)); + if (cavefights & BATTLE_CAVE2) goto L_Win; + if (getareausers("025-4.gat", 97, 62, 126, 96) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave2start >= $@CAVE2_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave2fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave2fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave2start) < 60) set $@cave2start, $@cave2start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave2_timer, $@cave2_timer + 5; + if ($@cave2_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave2, 0; set $@cave2_kills, 0; set $@cave2start, 0; set $@cave2fighter$, ""; set $@cave2fighterdeaths$, 0; + set $@battlecave2, 0; killmonster "025-4.gat", "#StartCaveFight2::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave1, 0; + set $@cave2_kills, 0; + set $@cave2start, 0; + set $@cave2fighter$, ""; + set $@cave2fighterdeaths$, 0; + set $@battlecave2, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave2fighter$)); warp "025-3.gat", 53, 109; @@ -182,6 +235,7 @@ L_Cleaning: set $@cave2start, 0; set $@cave2fighter$, ""; set $@cave2fighterdeaths$, 0; + set $@battlecave2, 0; killmonster "025-4.gat", "#StartCaveFight2::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -196,6 +250,7 @@ L_CleaningDead: set $@cave2start, 0; set $@cave2fighter$, ""; set $@cave2fighterdeaths$, 0; + set $@battlecave2, 0; killmonster "025-4.gat", "#StartCaveFight2::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -207,13 +262,26 @@ L_CleaningNorid: set $@cave2start, 0; set $@cave2fighter$, ""; set $@cave2fighterdeaths$, 0; + set $@battlecave2, 0; killmonster "025-4.gat", "#StartCaveFight2::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave2fighter$)); + warp "025-3.gat", 53, 109; + set $@wave_cave2, 0; + set $@cave2_kills, 0; + set $@cave2start, 0; + set $@cave2fighter$, ""; + set $@cave2fighterdeaths$, 0; + set $@battlecave2, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol2, 0; stopnpctimer; setnpctimer 0; end; @@ -224,8 +292,7 @@ L_AlreadyClean: 025-3.gat,71,83,0 script #WarpBattleCave3 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 150, 84, 177, 117) >= 1) goto L_SomeoneInside; - if ($@timercontrol3 != 0) goto L_Wait; + if (getareausers("025-4.gat", 150, 84, 177, 117) >= 1 || $@battlecave3 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE3) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -243,18 +310,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave3fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone3 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone3, 1; end; L_Block: @@ -264,24 +325,50 @@ L_Block: OnTimer5000: if ($@battlecave3 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave3fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 150, 84, 177, 117) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave3fighter$)); + if (cavefights & BATTLE_CAVE3) goto L_Win; + if (getareausers("025-4.gat", 150, 84, 177, 117) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave3start >= $@CAVE3_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave3fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave3fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave3start) < 60) set $@cave3start, $@cave3start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave3_timer, $@cave3_timer + 5; + if ($@cave3_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave3, 0; set $@cave3_kills, 0; set $@cave3start, 0; set $@cave3fighter$, ""; set $@cave3fighterdeaths$, 0; + set $@battlecave3, 0; killmonster "025-4.gat", "#StartCaveFight3::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave3, 0; + set $@cave3_kills, 0; + set $@cave3start, 0; + set $@cave3fighter$, ""; + set $@cave3fighterdeaths$, 0; + set $@battlecave3, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave3fighter$)); warp "025-3.gat", 71, 85; @@ -291,6 +378,7 @@ L_Cleaning: set $@cave3start, 0; set $@cave3fighter$, ""; set $@cave3fighterdeaths$, 0; + set $@battlecave3, 0; killmonster "025-4.gat", "#StartCaveFight3::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -305,6 +393,7 @@ L_CleaningDead: set $@cave3start, 0; set $@cave3fighter$, ""; set $@cave3fighterdeaths$, 0; + set $@battlecave3, 0; killmonster "025-4.gat", "#StartCaveFight3::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -316,13 +405,26 @@ L_CleaningNorid: set $@cave3start, 0; set $@cave3fighter$, ""; set $@cave3fighterdeaths$, 0; + set $@battlecave3, 0; killmonster "025-4.gat", "#StartCaveFight3::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave3fighter$)); + warp "025-3.gat", 71, 85; + set $@wave_cave3, 0; + set $@cave3_kills, 0; + set $@cave3start, 0; + set $@cave3fighter$, ""; + set $@cave3fighterdeaths$, 0; + set $@battlecave3, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol3, 0; stopnpctimer; setnpctimer 0; end; @@ -333,8 +435,7 @@ L_AlreadyClean: 025-3.gat,80,83,0 script #WarpBattleCave4 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 28, 124, 57, 156) >= 1) goto L_SomeoneInside; - if ($@timercontrol4 != 0) goto L_Wait; + if (getareausers("025-4.gat", 28, 124, 57, 156) >= 1 || $@battlecave4 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE4) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -352,18 +453,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave4fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone4 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone4, 1; end; L_Block: @@ -373,24 +468,50 @@ L_Block: OnTimer5000: if ($@battlecave4 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave4fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 28, 124, 57, 156) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave4fighter$)); + if (cavefights & BATTLE_CAVE4) goto L_Win; + if (getareausers("025-4.gat", 28, 124, 57, 156) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave4start >= $@CAVE4_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave4fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave4fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave4start) < 60) set $@cave4start, $@cave4start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave4_timer, $@cave4_timer + 5; + if ($@cave4_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave4, 0; set $@cave4_kills, 0; set $@cave4start, 0; set $@cave4fighter$, ""; set $@cave4fighterdeaths$, 0; + set $@battlecave4, 0; killmonster "025-4.gat", "#StartCaveFight4::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave4, 0; + set $@cave4_kills, 0; + set $@cave4start, 0; + set $@cave4fighter$, ""; + set $@cave4fighterdeaths$, 0; + set $@battlecave4, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave4fighter$)); warp "025-3.gat", 80, 85; @@ -400,6 +521,7 @@ L_Cleaning: set $@cave4start, 0; set $@cave4fighter$, ""; set $@cave4fighterdeaths$, 0; + set $@battlecave4, 0; killmonster "025-4.gat", "#StartCaveFight4::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -414,6 +536,7 @@ L_CleaningDead: set $@cave4start, 0; set $@cave4fighter$, ""; set $@cave4fighterdeaths$, 0; + set $@battlecave4, 0; killmonster "025-4.gat", "#StartCaveFight4::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -425,13 +548,26 @@ L_CleaningNorid: set $@cave4start, 0; set $@cave4fighter$, ""; set $@cave4fighterdeaths$, 0; + set $@battlecave4, 0; killmonster "025-4.gat", "#StartCaveFight4::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave4fighter$)); + warp "025-3.gat", 80, 85; + set $@wave_cave4, 0; + set $@cave4_kills, 0; + set $@cave4start, 0; + set $@cave4fighter$, ""; + set $@cave4fighterdeaths$, 0; + set $@battlecave4, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol4, 0; stopnpctimer; setnpctimer 0; end; @@ -442,8 +578,7 @@ L_AlreadyClean: 025-3.gat,71,30,0 script #WarpBattleCave5 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 91, 131, 124, 160) >= 1) goto L_SomeoneInside; - if ($@timercontrol5 != 0) goto L_Wait; + if (getareausers("025-4.gat", 91, 131, 124, 160) >= 1 || $@battlecave5 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE5) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -461,18 +596,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave5fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone5 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone5, 1; end; L_Block: @@ -482,24 +611,50 @@ L_Block: OnTimer5000: if ($@battlecave5 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave5fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 91, 131, 124, 160) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave5fighter$)); + if (cavefights & BATTLE_CAVE5) goto L_Win; + if (getareausers("025-4.gat", 91, 131, 124, 160) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave5start >= $@CAVE5_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave5fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave5fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave5start) < 60) set $@cave5start, $@cave5start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave5_timer, $@cave5_timer + 5; + if ($@cave5_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave5, 0; set $@cave5_kills, 0; set $@cave5start, 0; set $@cave5fighter$, ""; set $@cave5fighterdeaths$, 0; + set $@battlecave5, 0; killmonster "025-4.gat", "#StartCaveFight5::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave5, 0; + set $@cave5_kills, 0; + set $@cave5start, 0; + set $@cave5fighter$, ""; + set $@cave5fighterdeaths$, 0; + set $@battlecave5, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave5fighter$)); warp "025-3.gat", 71, 32; @@ -509,6 +664,7 @@ L_Cleaning: set $@cave5start, 0; set $@cave5fighter$, ""; set $@cave5fighterdeaths$, 0; + set $@battlecave5, 0; killmonster "025-4.gat", "#StartCaveFight5::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -523,6 +679,7 @@ L_CleaningDead: set $@cave5start, 0; set $@cave5fighter$, ""; set $@cave5fighterdeaths$, 0; + set $@battlecave5, 0; killmonster "025-4.gat", "#StartCaveFight5::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -534,13 +691,26 @@ L_CleaningNorid: set $@cave5start, 0; set $@cave5fighter$, ""; set $@cave5fighterdeaths$, 0; + set $@battlecave5, 0; killmonster "025-4.gat", "#StartCaveFight5::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave5fighter$)); + warp "025-3.gat", 71, 32; + set $@wave_cave5, 0; + set $@cave5_kills, 0; + set $@cave5start, 0; + set $@cave5fighter$, ""; + set $@cave5fighterdeaths$, 0; + set $@battlecave5, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol5, 0; stopnpctimer; setnpctimer 0; end; @@ -551,8 +721,7 @@ L_AlreadyClean: 025-3.gat,128,35,0 script #WarpBattleCave6 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 153, 143, 178, 174) >= 1) goto L_SomeoneInside; - if ($@timercontrol6 != 0) goto L_Wait; + if (getareausers("025-4.gat", 153, 143, 178, 174) >= 1 || $@battlecave6 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE6) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -570,18 +739,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave6fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone6 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone6, 1; end; L_Block: @@ -591,24 +754,50 @@ L_Block: OnTimer5000: if ($@battlecave6 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave6fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 153, 143, 178, 174) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave6fighter$)); + if (cavefights & BATTLE_CAVE6) goto L_Win; + if (getareausers("025-4.gat", 153, 143, 178, 174) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave6start >= $@CAVE6_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave6fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave6fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave6start) < 60) set $@cave6start, $@cave6start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave6_timer, $@cave6_timer + 5; + if ($@cave6_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave6, 0; set $@cave6_kills, 0; set $@cave6start, 0; set $@cave6fighter$, ""; set $@cave6fighterdeaths$, 0; + set $@battlecave6, 0; killmonster "025-4.gat", "#StartCaveFight6::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave6, 0; + set $@cave6_kills, 0; + set $@cave6start, 0; + set $@cave6fighter$, ""; + set $@cave6fighterdeaths$, 0; + set $@battlecave6, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave6fighter$)); warp "025-3.gat", 128, 37; @@ -618,6 +807,7 @@ L_Cleaning: set $@cave6start, 0; set $@cave6fighter$, ""; set $@cave6fighterdeaths$, 0; + set $@battlecave6, 0; killmonster "025-4.gat", "#StartCaveFight6::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -632,6 +822,7 @@ L_CleaningDead: set $@cave6start, 0; set $@cave6fighter$, ""; set $@cave6fighterdeaths$, 0; + set $@battlecave6, 0; killmonster "025-4.gat", "#StartCaveFight6::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -643,13 +834,26 @@ L_CleaningNorid: set $@cave6start, 0; set $@cave6fighter$, ""; set $@cave6fighterdeaths$, 0; + set $@battlecave6, 0; killmonster "025-4.gat", "#StartCaveFight6::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave6fighter$)); + warp "025-3.gat", 128, 37; + set $@wave_cave6, 0; + set $@cave6_kills, 0; + set $@cave6start, 0; + set $@cave6fighter$, ""; + set $@cave6fighterdeaths$, 0; + set $@battlecave6, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol6, 0; stopnpctimer; setnpctimer 0; end; @@ -660,8 +864,7 @@ L_AlreadyClean: 025-3.gat,70,57,0 script #WarpBattleCave7 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 27, 185, 61, 219) >= 1) goto L_SomeoneInside; - if ($@timercontrol7 != 0) goto L_Wait; + if (getareausers("025-4.gat", 27, 185, 61, 219) >= 1 || $@battlecave7 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE7) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -679,18 +882,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave7fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone7 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone7, 1; end; L_Block: @@ -700,24 +897,50 @@ L_Block: OnTimer5000: if ($@battlecave7 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave7fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 27, 185, 61, 219) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave7fighter$)); + if (cavefights & BATTLE_CAVE7) goto L_Win; + if (getareausers("025-4.gat", 27, 185, 61, 219) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave7start >= $@CAVE7_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave7fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave7fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave7start) < 60) set $@cave7start, $@cave7start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave7_timer, $@cave7_timer + 5; + if ($@cave7_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave7, 0; set $@cave7_kills, 0; set $@cave7start, 0; set $@cave7fighter$, ""; set $@cave7fighterdeaths$, 0; + set $@battlecave7, 0; killmonster "025-4.gat", "#StartCaveFight7::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave7, 0; + set $@cave7_kills, 0; + set $@cave7start, 0; + set $@cave7fighter$, ""; + set $@cave7fighterdeaths$, 0; + set $@battlecave7, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave7fighter$)); warp "025-3.gat", 70, 59; @@ -727,6 +950,7 @@ L_Cleaning: set $@cave7start, 0; set $@cave7fighter$, ""; set $@cave7fighterdeaths$, 0; + set $@battlecave7, 0; killmonster "025-4.gat", "#StartCaveFight7::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -741,6 +965,7 @@ L_CleaningDead: set $@cave7start, 0; set $@cave7fighter$, ""; set $@cave7fighterdeaths$, 0; + set $@battlecave7, 0; killmonster "025-4.gat", "#StartCaveFight7::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -752,13 +977,26 @@ L_CleaningNorid: set $@cave7start, 0; set $@cave7fighter$, ""; set $@cave7fighterdeaths$, 0; + set $@battlecave7, 0; killmonster "025-4.gat", "#StartCaveFight7::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave7fighter$)); + warp "025-3.gat", 70, 59; + set $@wave_cave7, 0; + set $@cave7_kills, 0; + set $@cave7start, 0; + set $@cave7fighter$, ""; + set $@cave7fighterdeaths$, 0; + set $@battlecave7, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol7, 0; stopnpctimer; setnpctimer 0; end; @@ -769,8 +1007,7 @@ L_AlreadyClean: 025-3.gat,138,92,0 script #WarpBattleCave8 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 90, 193, 119, 216) >= 1) goto L_SomeoneInside; - if ($@timercontrol8 != 0) goto L_Wait; + if (getareausers("025-4.gat", 90, 193, 119, 216) >= 1 || $@battlecave8 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE8) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -788,18 +1025,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave8fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone8 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone8, 1; end; L_Block: @@ -809,24 +1040,50 @@ L_Block: OnTimer5000: if ($@battlecave8 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave8fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 90, 193, 119, 216) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave8fighter$)); + if (cavefights & BATTLE_CAVE8) goto L_Win; + if (getareausers("025-4.gat", 90, 193, 119, 216) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave8start >= $@CAVE8_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave8fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave8fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave8start) < 60) set $@cave8start, $@cave8start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave8_timer, $@cave8_timer + 5; + if ($@cave8_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave8, 0; set $@cave8_kills, 0; set $@cave8start, 0; set $@cave8fighter$, ""; set $@cave8fighterdeaths$, 0; + set $@battlecave8, 0; killmonster "025-4.gat", "#StartCaveFight8::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave8, 0; + set $@cave8_kills, 0; + set $@cave8start, 0; + set $@cave8fighter$, ""; + set $@cave8fighterdeaths$, 0; + set $@battlecave8, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave8fighter$)); warp "025-3.gat", 138, 94; @@ -836,6 +1093,7 @@ L_Cleaning: set $@cave8start, 0; set $@cave8fighter$, ""; set $@cave8fighterdeaths$, 0; + set $@battlecave8, 0; killmonster "025-4.gat", "#StartCaveFight8::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -850,6 +1108,7 @@ L_CleaningDead: set $@cave8start, 0; set $@cave8fighter$, ""; set $@cave8fighterdeaths$, 0; + set $@battlecave8, 0; killmonster "025-4.gat", "#StartCaveFight8::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -861,13 +1120,26 @@ L_CleaningNorid: set $@cave8start, 0; set $@cave8fighter$, ""; set $@cave8fighterdeaths$, 0; + set $@battlecave8, 0; killmonster "025-4.gat", "#StartCaveFight8::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave8fighter$)); + warp "025-3.gat", 138, 94; + set $@wave_cave8, 0; + set $@cave8_kills, 0; + set $@cave8start, 0; + set $@cave8fighter$, ""; + set $@cave8fighterdeaths$, 0; + set $@battlecave8, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol8, 0; stopnpctimer; setnpctimer 0; end; @@ -878,8 +1150,7 @@ L_AlreadyClean: 025-3.gat,138,160,0 script #WarpBattleCave9 45,1,1,{ if (Rossy_Quest >= 16 || FLAGS & FLAG_ROSSI_COMPLETED) goto L_AlreadyHelped; - if (getareausers("025-4.gat", 144, 192, 173, 226) >= 1) goto L_SomeoneInside; - if ($@timercontrol9 != 0) goto L_Wait; + if (getareausers("025-4.gat", 144, 192, 173, 226) >= 1 || $@battlecave9 == 1) goto L_SomeoneInside; if (cavefights & BATTLE_CAVE9) goto L_AlreadyDone; if (Rossy_Quest < 15) goto L_Block; @@ -897,18 +1168,12 @@ L_SomeoneInside: message strcharinfo(0), $@cave9fighter$ + " is already inside. The cave seems to be blocked."; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_AlreadyDone: - message strcharinfo(0), "I already defeated the monsters in this cave."; + message strcharinfo(0), "I already eliminated this source of energy."; end; L_AlreadyHelped: - if (@juliadone9 == 1) end; message strcharinfo(0), "There is nothing more than dead monster corpses in this cave."; - set @juliadone9, 1; end; L_Block: @@ -918,24 +1183,50 @@ L_Block: OnTimer5000: if ($@battlecave9 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave9fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 144, 192, 173, 226) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave9fighter$)); + if (cavefights & BATTLE_CAVE9) goto L_Win; + if (getareausers("025-4.gat", 144, 192, 173, 226) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave9start >= $@CAVE9_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave9fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave9fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave9start) < 60) set $@cave9start, $@cave9start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave9_timer, $@cave9_timer + 5; + if ($@cave9_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave9, 0; set $@cave9_kills, 0; set $@cave9start, 0; set $@cave9fighter$, ""; set $@cave9fighterdeaths$, 0; + set $@battlecave9, 0; killmonster "025-4.gat", "#StartCaveFight9::OnMonsterDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave9, 0; + set $@cave9_kills, 0; + set $@cave9start, 0; + set $@cave9fighter$, ""; + set $@cave9fighterdeaths$, 0; + set $@battlecave9, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave9fighter$)); warp "025-3.gat", 138, 158; @@ -945,6 +1236,7 @@ L_Cleaning: set $@cave9start, 0; set $@cave9fighter$, ""; set $@cave9fighterdeaths$, 0; + set $@battlecave9, 0; killmonster "025-4.gat", "#StartCaveFight9::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -959,6 +1251,7 @@ L_CleaningDead: set $@cave9start, 0; set $@cave9fighter$, ""; set $@cave9fighterdeaths$, 0; + set $@battlecave9, 0; killmonster "025-4.gat", "#StartCaveFight9::OnMonsterDeath"; stopnpctimer; setnpctimer 0; @@ -970,13 +1263,26 @@ L_CleaningNorid: set $@cave9start, 0; set $@cave9fighter$, ""; set $@cave9fighterdeaths$, 0; + set $@battlecave9, 0; killmonster "025-4.gat", "#StartCaveFight9::OnMonsterDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave9fighter$)); + warp "025-3.gat", 138, 158; + set $@wave_cave9, 0; + set $@cave9_kills, 0; + set $@cave9start, 0; + set $@cave9fighter$, ""; + set $@cave9fighterdeaths$, 0; + set $@battlecave9, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol9, 0; stopnpctimer; setnpctimer 0; end; @@ -998,8 +1304,7 @@ L_AlreadyClean: if (cavefights & BATTLE_CAVE8) set @barrier_force, @barrier_force + 1; if (cavefights & BATTLE_CAVE9) set @barrier_force, @barrier_force + 1; if (@barrier_force != 0) goto L_Hurt; - if (getareausers("025-4.gat", 142, 24, 172, 48) >= 1) goto L_SomeoneInside; - if ($@timercontrol10 != 0) goto L_Wait; + if (getareausers("025-4.gat", 142, 24, 172, 48) >= 1 || $@battlecave10 == 1) goto L_SomeoneInside; if (@barrier_force == 0) goto L_StartFight; end; @@ -1009,13 +1314,9 @@ L_Hurt: warp "025-3.gat", 77, 164; end; -L_Wait: - message strcharinfo(0), "Someone just got out of the cave, but it is still blocked. I should try to enter again."; - end; - L_StartFight: message strcharinfo(0), "You go through the magic barrier without problems... you can hear screams that seem to be very close."; - set $@battlebosscave, 1; + set $@battlecave10, 1; warp "025-4.gat", 157, 44; set $@cave10fighter$, strcharinfo(0); set $@cave10fighterdeaths, PC_DIE_COUNTER; @@ -1033,27 +1334,53 @@ L_AlreadyHelped: end; OnTimer5000: - if ($@battlebosscave == 0) goto L_AlreadyClean; + if ($@battlecave10 == 0) goto L_AlreadyClean; if (isloggedin(getcharid(3,$@cave10fighter$))==0) goto L_CleaningNorid; - if (getareausers("025-4.gat", 142, 24, 172, 48) < 1) goto L_Ranaway; attachrid(getcharid(3,$@cave10fighter$)); + if (Rossy_Quest == 16) goto L_Win; + if (getareausers("025-4.gat", 142, 24, 172, 48) < 1) goto L_Ranaway; if (gettimetick(2) - $@cave10start >= $@CAVE10_TIME) goto L_Cleaning; if (PC_DIE_COUNTER > $@cave10fighterdeaths) goto L_CleaningDead; setnpctimer 0; end; +L_Win: + attachrid(getcharid(3,$@cave10fighter$)); + message strcharinfo(0), "It is getting more and more difficult to breathe inside this cave... You feel like you are almost passing out."; + if ((gettimetick(2) - $@cave10start) < 60) set $@cave10start, $@cave10start + 60; + if (Hp - (MaxHp*5)/100 <= 0) goto L_BadAir; + percentheal -5, 0; + set $@cave10_timer, $@cave10_timer + 5; + if ($@cave10_timer >= 60) goto L_BadAir; + setnpctimer 0; + end; + L_Ranaway: set $@wave_cave10, 0; set $@cave10_kills, 0; set $@cave10start, 0; set $@cave10fighter$, ""; set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; killmonster "025-4.gat", "#StartBossCaveFight::OnMonsterDeath"; killmonster "025-4.gat", "#StartBossCaveFight::OnBossDeath"; stopnpctimer; setnpctimer 0; 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!"; + set $@wave_cave10, 0; + set $@cave10_kills, 0; + set $@cave10start, 0; + set $@cave10fighter$, ""; + set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; + stopnpctimer; + setnpctimer 0; + end; + L_Cleaning: attachrid(getcharid(3,$@cave10fighter$)); warp "025-3.gat", 77, 168; @@ -1063,6 +1390,7 @@ L_Cleaning: set $@cave10start, 0; set $@cave10fighter$, ""; set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; killmonster "025-4.gat", "#StartBossCaveFight::OnMonsterDeath"; killmonster "025-4.gat", "#StartBossCaveFight::OnBossDeath"; stopnpctimer; @@ -1079,6 +1407,7 @@ L_CleaningDead: set $@cave10start, 0; set $@cave10fighter$, ""; set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; killmonster "025-4.gat", "#StartBossCaveFight::OnMonsterDeath"; killmonster "025-4.gat", "#StartBossCaveFight::OnBossDeath"; stopnpctimer; @@ -1091,14 +1420,40 @@ L_CleaningNorid: set $@cave10start, 0; set $@cave10fighter$, ""; set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; killmonster "025-4.gat", "#StartBossCaveFight::OnMonsterDeath"; killmonster "025-4.gat", "#StartBossCaveFight::OnBossDeath"; stopnpctimer; setnpctimer 0; end; +OnGetout: + attachrid(getcharid(3,$@cave10fighter$)); + warp "025-3.gat", 77, 168; + set $@wave_cave10, 0; + set $@cave10_kills, 0; + set $@cave10start, 0; + set $@cave10fighter$, ""; + set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; + stopnpctimer; + setnpctimer 0; + end; + +OnWin: + attachrid(getcharid(3,$@cave10fighter$)); + warp "025-4.gat", 93, 33; + set $@wave_cave10, 0; + set $@cave10_kills, 0; + set $@cave10start, 0; + set $@cave10fighter$, ""; + set $@cave10fighterdeaths$, 0; + set $@battlecave10, 0; + stopnpctimer; + setnpctimer 0; + end; + L_AlreadyClean: - set $@timercontrol10, 0; stopnpctimer; setnpctimer 0; end; diff --git a/world/map/npc/025-4/battlecaves.txt b/world/map/npc/025-4/battlecaves.txt index 68efd60e..238977b4 100644 --- a/world/map/npc/025-4/battlecaves.txt +++ b/world/map/npc/025-4/battlecaves.txt @@ -2,7 +2,7 @@ // --------------------------------- Cave 1 ----------------------------------- -025-4.gat,42,80,0 script #StartCaveFight1 324,{ +025-4.gat,41,85,0 script #StartCaveFight1 324,{ if ($@wave_cave1 != 0 && $@cave1fighter$ == strcharinfo(0)) end; if ($@wave_cave1 != 0 && $@cave1fighter$ != strcharinfo(0)) goto L_Cheat; if (Rossy_Quest < 15) goto L_Cheat; @@ -39,12 +39,10 @@ L_Done: if ($@wave_cave1 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave1 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave1 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave1 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave1 < $@CAVE1_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE1); - warp "025-3.gat", 78, 129; - goto L_Cleaning; end; L_Cleaning: @@ -85,17 +83,12 @@ onInit: // --------------------- Cave 1 Checker ---------------------------- 025-4.gat,41,97,0 script #CheckCaveFight1 45,1,1,{ - if ($@wave_cave1 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave1 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE1 || $@wave_cave1 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 78, 130; - set $@battlecave1, 0; - set $@cave1fighter$, ""; - set $@cave1fighterdeaths, 0; - set $@cave1start, 0; - set $@timercontrol1, 1; + donpcevent "#WarpBattleCave1::OnGetout"; end; } @@ -140,12 +133,10 @@ L_Done: if ($@wave_cave2 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave2 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave2 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave2 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave2 < $@CAVE2_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE2); - warp "025-3.gat", 53, 109; - goto L_Cleaning; end; L_Cleaning: @@ -186,17 +177,12 @@ onInit: // --------------------- Cave 2 Checker ---------------------------- 025-4.gat,110,96,0 script #CheckCaveFight2 45,1,1,{ - if ($@wave_cave2 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave2 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE2 || $@wave_cave2 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 53, 110; - set $@battlecave2, 0; - set $@cave2fighter$, ""; - set $@cave2fighterdeaths, 0; - set $@cave2start, 0; - set $@timercontrol2, 1; + donpcevent "#WarpBattleCave2::OnGetout"; end; } @@ -239,12 +225,10 @@ L_Done: if ($@wave_cave3 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave3 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave3 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave3 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave3 < $@CAVE3_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE3); - warp "025-3.gat", 71, 85; - goto L_Cleaning; end; L_Cleaning: @@ -285,17 +269,12 @@ onInit: // --------------------- Cave 3 Checker ---------------------------- 025-4.gat,168,117,0 script #CheckCaveFight3 45,1,1,{ - if ($@wave_cave3 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave3 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE3 || $@wave_cave3 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 71, 85; - set $@battlecave3, 0; - set $@cave3fighter$, ""; - set $@cave3fighterdeaths, 0; - set $@cave3start, 0; - set $@timercontrol3, 1; + donpcevent "#WarpBattleCave3::OnGetout"; end; } @@ -337,12 +316,10 @@ L_Done: if ($@wave_cave4 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave4 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave4 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave4 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave4 < $@CAVE4_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE4); - warp "025-3.gat", 80, 85; - goto L_Cleaning; end; L_Cleaning: @@ -383,17 +360,12 @@ onInit: // --------------------- Cave 4 Checker ---------------------------- 025-4.gat,32,156,0 script #CheckCaveFight4 45,1,1,{ - if ($@wave_cave4 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave4 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE4 || $@wave_cave4 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 80, 85; - set $@battlecave4, 0; - set $@cave4fighter$, ""; - set $@cave4fighterdeaths, 0; - set $@cave4start, 0; - set $@timercontrol4, 1; + donpcevent "#WarpBattleCave4::OnGetout"; end; } @@ -436,12 +408,10 @@ L_Done: if ($@wave_cave5 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave5 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave5 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave5 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave5 < $@CAVE5_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE5); - warp "025-3.gat", 71, 32; - goto L_Cleaning; end; L_Cleaning: @@ -482,17 +452,12 @@ onInit: // --------------------- Cave 5 Checker ---------------------------- 025-4.gat,100,160,0 script #CheckCaveFight5 45,1,1,{ - if ($@wave_cave5 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave5 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE5 || $@wave_cave5 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 71, 33; - set $@battlecave5, 0; - set $@cave5fighter$, ""; - set $@cave5fighterdeaths, 0; - set $@cave5start, 0; - set $@timercontrol5, 1; + donpcevent "#WarpBattleCave5::OnGetout"; end; } @@ -535,12 +500,10 @@ L_Done: if ($@wave_cave6 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave6 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave6 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave6 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave6 < $@CAVE6_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE6); - warp "025-3.gat", 128, 37; - goto L_Cleaning; end; L_Cleaning: @@ -581,17 +544,12 @@ onInit: // --------------------- Cave 6 Checker ---------------------------- 025-4.gat,159,174,0 script #CheckCaveFight6 45,1,1,{ - if ($@wave_cave6 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave6 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE6 || $@wave_cave6 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 128, 38; - set $@battlecave6, 0; - set $@cave6fighter$, ""; - set $@cave6fighterdeaths, 0; - set $@cave6start, 0; - set $@timercontrol6, 1; + donpcevent "#WarpBattleCave6::OnGetout"; end; } @@ -635,12 +593,10 @@ L_Done: if ($@wave_cave7 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave7 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave7 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave7 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave7 < $@CAVE7_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE7); - warp "025-3.gat", 70, 59; - goto L_Cleaning; end; L_Cleaning: @@ -681,17 +637,12 @@ onInit: // --------------------- Cave 7 Checker ---------------------------- 025-4.gat,42,219,0 script #CheckCaveFight7 45,1,1,{ - if ($@wave_cave7 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave7 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE7 || $@wave_cave7 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 70, 60; - set $@battlecave7, 0; - set $@cave7fighter$, ""; - set $@cave7fighterdeaths, 0; - set $@cave7start, 0; - set $@timercontrol7, 1; + donpcevent "#WarpBattleCave7::OnGetout"; end; } @@ -735,12 +686,10 @@ L_Done: if ($@wave_cave8 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave8 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave8 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave8 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave8 < $@CAVE8_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE8); - warp "025-3.gat", 138, 94; - goto L_Cleaning; end; L_Cleaning: @@ -781,17 +730,12 @@ onInit: // --------------------- Cave 8 Checker ---------------------------- 025-4.gat,105,216,0 script #CheckCaveFight8 45,1,1,{ - if ($@wave_cave8 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave8 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE8 || $@wave_cave8 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 138, 95; - set $@battlecave8, 0; - set $@cave8fighter$, ""; - set $@cave8fighterdeaths, 0; - set $@cave8start, 0; - set $@timercontrol8, 1; + donpcevent "#WarpBattleCave8::OnGetout"; end; } @@ -834,12 +778,10 @@ L_Done: if ($@wave_cave9 == 1) message strcharinfo(0), "Oh no, more monsters?!"; if ($@wave_cave9 == 2) message strcharinfo(0), "I can't give up now!"; - if ($@wave_cave9 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation, as if you are being lifted from the ground... When you open your eyes, you are outside of the cave."; + if ($@wave_cave9 == 3) message strcharinfo(0), "As soon as you kill the last monster, your vision blacks out and you feel a strange sensation... Maybe it is not healthy to stay in this cave."; if ($@wave_cave9 < $@CAVE9_WAVES) goto L_Summon; set cavefights, (cavefights ^ BATTLE_CAVE9); - warp "025-3.gat", 138, 158; - goto L_Cleaning; end; L_Cleaning: @@ -880,17 +822,12 @@ onInit: // --------------------- Cave 9 Checker ---------------------------- 025-4.gat,157,226,0 script #CheckCaveFight9 45,1,1,{ - if ($@wave_cave9 != 0) message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; - if ($@wave_cave9 == 0) goto L_Done; + if (cavefights & BATTLE_CAVE9 || $@wave_cave9 == 0) goto L_Done; + message strcharinfo(0), "You can't get out! Seems like a barrier was created when the energy transmuted itself into monsters."; end; L_Done: - warp "025-3.gat", 138, 158; - set $@battlecave9, 0; - set $@cave9fighter$, ""; - set $@cave9fighterdeaths, 0; - set $@cave9start, 0; - set $@timercontrol9, 1; + donpcevent "#WarpBattleCave9::OnGetout"; end; } @@ -899,7 +836,7 @@ L_Done: 025-4.gat,157,30,0 script #StartBossCaveFight 325,{ if ($@wave_cave10 != 0) end; if (Rossy_Quest >= 16) end; - if ($@battlebosscave == 1 && cavefights & BATTLE_CAVE1 && cavefights & BATTLE_CAVE2 && cavefights & BATTLE_CAVE3 && cavefights & BATTLE_CAVE4 && cavefights & BATTLE_CAVE5 && cavefights & BATTLE_CAVE6 && cavefights & BATTLE_CAVE7 && cavefights & BATTLE_CAVE8 && cavefights & BATTLE_CAVE9 && Rossy_Quest == 15) goto L_Start; + if ($@battlecave10 == 1 && cavefights & BATTLE_CAVE1 && cavefights & BATTLE_CAVE2 && cavefights & BATTLE_CAVE3 && cavefights & BATTLE_CAVE4 && cavefights & BATTLE_CAVE5 && cavefights & BATTLE_CAVE6 && cavefights & BATTLE_CAVE7 && cavefights & BATTLE_CAVE8 && cavefights & BATTLE_CAVE9 && Rossy_Quest == 15) goto L_Start; message strcharinfo(0), "You shouldn't be here, you cheater."; percentheal -100, 0; end; @@ -952,7 +889,7 @@ L_Cleaning: set $@cave10start, 0; set $@cave10fighter$, ""; set $@cave10fighterdeaths$, 0; - set $@battlebosscave, 0; + set $@battlecave10, 0; killmonster "025-4.gat", "#StartBossCaveFight::OnMonsterDeath"; killmonster "025-4.gat", "#StartBossCaveFight::OnBossDeath"; end; @@ -965,7 +902,7 @@ L_CleaningNorid: set $@cave10start, 0; set $@cave10fighter$, ""; set $@cave10fighterdeaths$, 0; - set $@battlebosscave, 0; + set $@battlecave10, 0; killmonster "025-4.gat", "#StartBossCaveFight::OnMonsterDeath"; killmonster "025-4.gat", "#StartBossCaveFight::OnBossDeath"; end; @@ -986,15 +923,8 @@ OnMonsterDeath: OnBossDeath: attachrid(getcharid(3,$@cave10fighter$)); - set $@wave_cave10, 0; - set $@cave10_kills, 0; - set $@cave10start, 0; - set $@cave10fighter$, ""; - set $@cave10fighterdeaths$, 0; - set $@battlebosscave, 0; - message strcharinfo(0), "What a harsh battle! You lose no time and run to the door before more monsters start to appear."; + message strcharinfo(0), "What a harsh battle... You should hurry and save Julia!"; set Rossy_Quest, 16; - warp "025-4.gat", 93, 33; end; L_Close: @@ -1023,7 +953,8 @@ onInit: 025-4.gat,157,48,0 script #CheckCaveFightBoss 45,1,1,{ if (Rossy_Quest >= 17) goto L_Done; if (Rossy_Quest == 16) goto L_Julia; - if (Rossy_Quest < 16) goto L_Out; + if (Rossy_Quest < 16 && $@wave_cave10 == 0) goto L_Out; + if (Rossy_Quest < 16 && $@wave_cave10 != 0) goto L_Julia; end; L_Julia: @@ -1035,13 +966,7 @@ L_Done: end; L_Out: - if ($@wave_cave10 != 0) goto L_Julia; - set $@battlebosscave, 0; - set $@cave10fighter$, ""; - set $@cave10fighterdeaths, 0; - set $@cave10start, 0; - set $@timercontrol10, 1; - warp "025-3.gat", 77, 168; + donpcevent "#WarpBossCave::OnGetout"; end; } @@ -1054,7 +979,7 @@ L_Out: end; L_Done: - warp "025-4.gat", 93, 33; + donpcevent "#WarpBossCave::OnWin"; end; } @@ -1072,7 +997,7 @@ L_Cheat: end; L_Done: - message strcharinfo(0), "As you go back to the cave you close your eyes, terrified of the bloody battle you just fought in this place, and feel your way to the entrance of the cave."; + message strcharinfo(0), "As you go back to the cave you close your eyes, terrified of the bloody battle you just fought in this place, and feel your way back to the entrance of the cave."; warp "025-3.gat", 77, 168; end; -- cgit v1.2.3-70-g09d2