From 7898cc8496d8911125efab48b3dd892c48670a4c Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Sun, 26 Aug 2012 10:57:12 +0200 Subject: Rename global variables to contain the NPC name to ensure uniqueness. --- world/map/npc/009-6/brodomir.txt | 70 +++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/world/map/npc/009-6/brodomir.txt b/world/map/npc/009-6/brodomir.txt index d7b8895d..3d9d6b35 100644 --- a/world/map/npc/009-6/brodomir.txt +++ b/world/map/npc/009-6/brodomir.txt @@ -4,10 +4,19 @@ // CAVE: this script requires a patch by o11c that makes it possible for // getareausers to check if players are alive or dead. +// Global Variables: +// $@BRODOMIR_PVP_STATUS: +// 1 if players are waiting to be warped into the fight cave +// 2 if fight is in progress +// $@BRODOMIR_START_TIME: +// time when the players will be warped into the fight cave +// $@BRODOMIR_PLAYERS: number of players taking part in the event + + 009-6.gat,36,40,0|script|Brodomir|116,{ - if ($@PVP_STATUS == 2) + if ($@BRODOMIR_PVP_STATUS == 2) goto L_Alreadystarted; - if ($@PVP_STATUS == 1) + if ($@BRODOMIR_PVP_STATUS == 1) goto L_Wait; mes "[Brodomir]"; mes "\"Hi Warrior.\""; @@ -15,8 +24,7 @@ menu "Yes of course! Don't you remember me?", L_Shorttalk, "No, who are you?", L_Longtalk, - "I don't want to know you!", -; - close; + "I don't want to know you!", L_Close; L_Longtalk: mes "[Brodomir]"; @@ -50,10 +58,10 @@ L_Menu: L_Exit: mes "[Brodomir]"; mes "\"Okay, you can come back anytime.\""; - close; + goto L_Close; L_Pay: - if ($@PVP_STATUS == 1) + if ($@BRODOMIR_PVP_STATUS == 1) goto L_Wait; if (getareausers("009-6.gat", 20, 20, 80, 80, 1) < 3) goto L_NotEnoughPlayers; @@ -62,43 +70,43 @@ L_Pay: L_Go: set Zeny, Zeny - 5000; - set $@PVP_STATUS, 1; - mapannounce "009-6.gat", "In 5 minutes I will bring you all to the PvP cave. If there are less than 3 Players here the event will not start.", 0; + set $@BRODOMIR_PVP_STATUS, 1; + mapannounce "009-6.gat", "In 5 minutes I will bring you all to the PvP cave. If there are less than 3 players here the event will not start.", 0; mes "[Brodomir]"; - mes "\"In 5 minutes I will bring you all to the PvP cave. If there are less than 3 Players here the event will not start and your money will be lost.\""; - set $@ANNOUNCE_TIME, gettimetick(2) + 300; + mes "\"In 5 minutes I will bring you all to the PvP cave. If there are less than 3 players here the event will not start and your money will be lost.\""; + set $@BRODOMIR_START_TIME, gettimetick(2) + 300; initnpctimer; - close; + goto L_Close; L_Wait: - set $@seconds, ($@ANNOUNCE_TIME - gettimetick(2)); + set $@brodomir_seconds, ($@BRODOMIR_START_TIME - gettimetick(2)); mes "[Brodomir]"; - if ($@seconds/60 == 0) - mes "\"Just a little longer. I will bring you there in " + $@seconds + " seconds.\""; - if ($@seconds/60 > 0) - mes "\"Just a little longer. I will bring you there in " + $@seconds/60 + " minute(s).\""; - close; + if ($@brodomir_seconds/60 == 0) + mes "\"Just a little longer. I will bring you there in " + $@brodomir_seconds + " seconds.\""; + if ($@brodomir_seconds/60 > 0) + mes "\"Just a little longer. I will bring you there in " + $@brodomir_seconds/60 + " minute(s).\""; + goto L_Close; OnTimer5000: setnpctimer 0; - if ($@PVP_STATUS > 1) + if ($@BRODOMIR_PVP_STATUS > 1) goto L_Check; - if (gettimetick(2) >= $@ANNOUNCE_TIME) + if (gettimetick(2) >= $@BRODOMIR_START_TIME) goto L_Warp; end; L_Warp: if (getareausers("009-6.gat", 20, 20, 80, 80, 1) < 3) goto L_Warpfail; - set $@PVP_STATUS, $@PVP_STATUS + 1; - set $@PRICE, getareausers("009-6.gat", 20, 20, 80, 80, 1); + set $@BRODOMIR_PVP_STATUS, $@BRODOMIR_PVP_STATUS + 1; + set $@BRODOMIR_PLAYERS, getareausers("009-6.gat", 20, 20, 80, 80, 1); mapwarp "009-6.gat", "009-5.gat", 0, 0; mapannounce "009-5.gat", "PvP On!", 0; pvpon "009-5.gat"; end; L_Warpfail: - mapannounce "009-6.gat", "There are not enough Players around to start!", 0; + mapannounce "009-6.gat", "There are not enough players around to start!", 0; goto L_Cleanup; L_Check: @@ -111,7 +119,8 @@ onReward: if (isdead()) end; message strcharinfo(0), "Congratulations you won!"; - set Zeny, Zeny + (5000 + 150 * $@PRICE); + set Zeny, Zeny + (5000 + 150 * $@BRODOMIR_PLAYERS); + set $@BRODOMIR_PLAYERS, 0; end; L_End: @@ -121,24 +130,25 @@ L_End: L_NotEnoughPlayers: mes "[Brodomir]"; mes "\"There aren't enough players here to start.\""; - close; + goto L_Close; L_Alreadystarted: mes "[Brodomir]"; mes "\"Please wait until the cave is clear again.\""; - close; + goto L_Close; L_NotEnoughMoney: mes "[Brodomir]"; mes "\"You don't have enough money.\""; - close; + goto L_Close; L_Cleanup: - pvpoff "009-5.gat"; - set $@PVP_STATUS , 0; - set $@ANNOUNCE_TIME, 0; + pvpoff "009-5.gat"; + set $@BRODOMIR_PVP_STATUS , 0; + set $@BRODOMIR_START_TIME, 0; stopnpctimer; end; - +L_Close: + close; } -- cgit v1.2.3-70-g09d2