From df92273c8412b87d7fe86b4547d08c66cf2ed5c2 Mon Sep 17 00:00:00 2001 From: wushin Date: Wed, 18 Jun 2014 10:02:03 -0500 Subject: Moving GM/Dev utilities off of botcheck Allows botcheck to become a permanent prison --- world/map/npc/017-9/_import.txt | 1 + world/map/npc/017-9/announcements.txt | 175 +++++++++++++++++++++++++++++++ world/map/npc/annuals/fathertime.txt | 2 +- world/map/npc/annuals/xmas/debug.txt | 2 +- world/map/npc/botcheck/_import.txt | 1 - world/map/npc/botcheck/announcements.txt | 175 ------------------------------- world/map/npc/botcheck/mapflags.txt | 1 + world/map/npc/functions/debug.txt | 2 +- world/map/npc/functions/ferry.txt | 2 +- world/map/npc/functions/travelers.txt | 2 +- world/map/npc/items/unequipcb.txt | 2 +- 11 files changed, 183 insertions(+), 182 deletions(-) create mode 100644 world/map/npc/017-9/announcements.txt delete mode 100644 world/map/npc/botcheck/announcements.txt (limited to 'world/map') diff --git a/world/map/npc/017-9/_import.txt b/world/map/npc/017-9/_import.txt index 69c67d6f..4e650df8 100644 --- a/world/map/npc/017-9/_import.txt +++ b/world/map/npc/017-9/_import.txt @@ -3,4 +3,5 @@ map: 017-9.gat npc: npc/017-9/_mobs.txt npc: npc/017-9/_warps.txt +npc: npc/017-9/announcements.txt npc: npc/017-9/mapflags.txt diff --git a/world/map/npc/017-9/announcements.txt b/world/map/npc/017-9/announcements.txt new file mode 100644 index 00000000..585fbc28 --- /dev/null +++ b/world/map/npc/017-9/announcements.txt @@ -0,0 +1,175 @@ +//############################################################################ +//# # +//# GM scheduled broadcasts # +//# # +//############################################################################ + +// $@GMSA_STATUS values: +// 0: Broadcasts not running +// 1: Broadcasts running +// $@GMSA_NAME$: the GM/Admin who created the broadcast, if any +// $@GMSA_MSG$: the message to be broadcasted +// $@GMSA_MAX: the number of times the broadcast will be performed, if > 0 +// $@GMSA_TICK: broadcast the message every $@GMSA_TICK hours +// $@GMSA_CURRENT_TICK: internal counter incremented every hour + +017-9.gat,26,24,0|script|Stone Board|145, +{ + if (getgmlevel() < 60) + goto L_Close; + + if ($@GMSA_STATUS) + goto L_InfoBroadcast; + goto L_PrepareBroadcast; + +L_InfoBroadcast: + set @next_broadcast_ts, (3600000*($@GMSA_TICK - $@GMSA_CURRENT_TICK) - getnpctimer(0))/1000; + set @next_broadcast_h, @next_broadcast_ts/3600; + set @next_broadcast_m, (@next_broadcast_ts - @next_broadcast_h*3600)/60; + + mes "[GM Scheduled Broadcasts Board]"; + mes $@GMSA_NAME$ + " scheduled the current message, every " + $@GMSA_TICK + " hour(s):"; + mes $@GMSA_MSG$; + next; + if (@next_broadcast_h > 0) + mes "The next broadcast will happen in " + @next_broadcast_h + " hour(s) and " + @next_broadcast_m + " minute(s)."; + if (@next_broadcast_h == 0) + mes "The next broadcast will happen in " + @next_broadcast_m + " minute(s)."; + next; + + set @next_broadcast_ts, 0; + set @next_broadcast_h, 0; + set @next_broadcast_m, 0; + + mes "What do you want to do?"; + menu + "Nothing.", L_Close, + "Nothing but... what is this?", L_Help, + "Stop broadcasting.", L_StopBroadcast, + "Trigger manually the current broadcast.", L_ManualBroadcast; + +L_PrepareBroadcast: + callsub S_Help; + next; + mes "There is no broadcast scheduled."; + mes "Do you want to create one?"; + menu + "No.", L_Close, + "Yes.", L_CreateBroadcast; + +L_CreateBroadcast: + mes "[GM Scheduled Broadcasts Board]"; + mes "Enter the message to broadcast:"; + input $@GMSA_MSG$; + if ($@GMSA_MSG$ == "") + goto L_InvalidBroadcastMessage; + + next; + mes "[GM Scheduled Broadcasts Board]"; + mes "The message will be broadcasted every X hour(s). Enter X:"; + input $@GMSA_TICK; + if ($@GMSA_TICK < 1) + goto L_InvalidBroadcastTick; + + next; + mes "[GM Scheduled Broadcasts Board]"; + mes "If you want the message to be broadcasted a limited number of times, enter its value. Keep 0 otherwise:"; + input $@GMSA_MAX; + + next; + mes "[GM Scheduled Broadcasts Board]"; + if ($@GMSA_MAX == 0) + mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s):"; + if ($@GMSA_MAX > 0) + mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s), up to " + $@GMSA_MAX + " times:"; + mes $@GMSA_MSG$; + next; + mes "Is this correct?"; + menu + "No. I'll retry.", L_CreateBroadcast, + "No", L_Close, + "Yes. Broadcast this. (the first broadcast will happen in " + $@GMSA_TICK + " hour(s).)", L_StartBroadcast, + "Yes. Broadcast this, and make an extra broadcast right now.", L_StartBroadcast2; + +L_InvalidBroadcastMessage: + mes "[GM Scheduled Broadcasts Board]"; + mes "The message can't be empty. Please retry."; + goto L_CreateBroadcast; + +L_InvalidBroadcastTick: + mes "[GM Scheduled Broadcasts Board]"; + mes "You obviously can't repeat a message every 0 hours. Please retry."; + goto L_CreateBroadcast; + +L_Help: + callsub S_Help; + goto L_Close; + +S_Help: + mes "[GM Scheduled Broadcasts Board]"; + mes "This board allows a GM to schedule a message to be broadcast every X hours."; + mes "Only one broadcast can be scheduled at a time."; + return; + +S_PerformBroadcast: + announce $@GMSA_MSG$, 0; + return; + +L_ManualBroadcast: + callsub S_PerformBroadcast; + mes "Done."; + goto L_Close; + +L_StopBroadcast: + callsub S_StopBroadcast; + mes "Done."; + goto L_Close; + +S_StopBroadcast: + stopnpctimer; + setnpctimer 0; + set $@GMSA_STATUS, 0; + set $@GMSA_NAME$, ""; + set $@GMSA_MSG$, ""; + set $@GMSA_TICK, 0; + set $@GMSA_MAX, 0; + set $@GMSA_CURRENT_TICK, 0; + return; + +L_StartBroadcast2: + if ($@GMSA_STATUS == 1) + goto L_Abort; + callsub S_PerformBroadcast; + goto L_StartBroadcast; + +L_StartBroadcast: + if ($@GMSA_STATUS == 1) + goto L_Abort; + set $@GMSA_STATUS, 1; + set $@GMSA_NAME$, strcharinfo(0); + set $@GMSA_CURRENT_TICK, 0; + initnpctimer; + mes "Done."; + goto L_Close; + +L_Abort: + mes "[GM Scheduled Broadcasts Board]"; + mes $@GMSA_NAME$ + " has created a scheduled broadcast just before you, hence yours will abort."; + goto L_Close; + +L_Close: + close; + +OnTimer3600000: + set $@GMSA_CURRENT_TICK, $@GMSA_CURRENT_TICK + 1; + setnpctimer 0; + if ($@GMSA_CURRENT_TICK != $@GMSA_TICK) + end; + callsub S_PerformBroadcast; + set $@GMSA_CURRENT_TICK, 0; + set $@GMSA_MAX, $@GMSA_MAX - 1; + if ($@GMSA_MAX != 0) + end; + callsub S_StopBroadcast; + end; +} diff --git a/world/map/npc/annuals/fathertime.txt b/world/map/npc/annuals/fathertime.txt index bedf23f6..40af55ff 100644 --- a/world/map/npc/annuals/fathertime.txt +++ b/world/map/npc/annuals/fathertime.txt @@ -1,7 +1,7 @@ // Annual Timer // One timer to check to enable all holiday events -botcheck.gat,26,28,0|script|#HolidayConfig|-1, +017-9.gat,26,28,0|script|#HolidayConfig|-1, { end; diff --git a/world/map/npc/annuals/xmas/debug.txt b/world/map/npc/annuals/xmas/debug.txt index d51f57ac..38bbdf15 100644 --- a/world/map/npc/annuals/xmas/debug.txt +++ b/world/map/npc/annuals/xmas/debug.txt @@ -228,7 +228,7 @@ L_End: } -botcheck.gat,26,28,0|script|XmasDebug#5|105, +017-9.gat,31,24,0|script|XmasDebug#5|105, { if(getgmlevel() < 40) goto L_End; diff --git a/world/map/npc/botcheck/_import.txt b/world/map/npc/botcheck/_import.txt index affc86ce..d2a6a9e1 100644 --- a/world/map/npc/botcheck/_import.txt +++ b/world/map/npc/botcheck/_import.txt @@ -3,5 +3,4 @@ map: botcheck.gat npc: npc/botcheck/_mobs.txt npc: npc/botcheck/_warps.txt -npc: npc/botcheck/announcements.txt npc: npc/botcheck/mapflags.txt diff --git a/world/map/npc/botcheck/announcements.txt b/world/map/npc/botcheck/announcements.txt deleted file mode 100644 index cb7a5f8f..00000000 --- a/world/map/npc/botcheck/announcements.txt +++ /dev/null @@ -1,175 +0,0 @@ -//############################################################################ -//# # -//# GM scheduled broadcasts # -//# # -//############################################################################ - -// $@GMSA_STATUS values: -// 0: Broadcasts not running -// 1: Broadcasts running -// $@GMSA_NAME$: the GM/Admin who created the broadcast, if any -// $@GMSA_MSG$: the message to be broadcasted -// $@GMSA_MAX: the number of times the broadcast will be performed, if > 0 -// $@GMSA_TICK: broadcast the message every $@GMSA_TICK hours -// $@GMSA_CURRENT_TICK: internal counter incremented every hour - -botcheck.gat,49,29,0|script|Stone Board|348, -{ - if (getgmlevel() < 60) - goto L_Close; - - if ($@GMSA_STATUS) - goto L_InfoBroadcast; - goto L_PrepareBroadcast; - -L_InfoBroadcast: - set @next_broadcast_ts, (3600000*($@GMSA_TICK - $@GMSA_CURRENT_TICK) - getnpctimer(0))/1000; - set @next_broadcast_h, @next_broadcast_ts/3600; - set @next_broadcast_m, (@next_broadcast_ts - @next_broadcast_h*3600)/60; - - mes "[GM Scheduled Broadcasts Board]"; - mes $@GMSA_NAME$ + " scheduled the current message, every " + $@GMSA_TICK + " hour(s):"; - mes $@GMSA_MSG$; - next; - if (@next_broadcast_h > 0) - mes "The next broadcast will happen in " + @next_broadcast_h + " hour(s) and " + @next_broadcast_m + " minute(s)."; - if (@next_broadcast_h == 0) - mes "The next broadcast will happen in " + @next_broadcast_m + " minute(s)."; - next; - - set @next_broadcast_ts, 0; - set @next_broadcast_h, 0; - set @next_broadcast_m, 0; - - mes "What do you want to do?"; - menu - "Nothing.", L_Close, - "Nothing but... what is this?", L_Help, - "Stop broadcasting.", L_StopBroadcast, - "Trigger manually the current broadcast.", L_ManualBroadcast; - -L_PrepareBroadcast: - callsub S_Help; - next; - mes "There is no broadcast scheduled."; - mes "Do you want to create one?"; - menu - "No.", L_Close, - "Yes.", L_CreateBroadcast; - -L_CreateBroadcast: - mes "[GM Scheduled Broadcasts Board]"; - mes "Enter the message to broadcast:"; - input $@GMSA_MSG$; - if ($@GMSA_MSG$ == "") - goto L_InvalidBroadcastMessage; - - next; - mes "[GM Scheduled Broadcasts Board]"; - mes "The message will be broadcasted every X hour(s). Enter X:"; - input $@GMSA_TICK; - if ($@GMSA_TICK < 1) - goto L_InvalidBroadcastTick; - - next; - mes "[GM Scheduled Broadcasts Board]"; - mes "If you want the message to be broadcasted a limited number of times, enter its value. Keep 0 otherwise:"; - input $@GMSA_MAX; - - next; - mes "[GM Scheduled Broadcasts Board]"; - if ($@GMSA_MAX == 0) - mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s):"; - if ($@GMSA_MAX > 0) - mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s), up to " + $@GMSA_MAX + " times:"; - mes $@GMSA_MSG$; - next; - mes "Is this correct?"; - menu - "No. I'll retry.", L_CreateBroadcast, - "No", L_Close, - "Yes. Broadcast this. (the first broadcast will happen in " + $@GMSA_TICK + " hour(s).)", L_StartBroadcast, - "Yes. Broadcast this, and make an extra broadcast right now.", L_StartBroadcast2; - -L_InvalidBroadcastMessage: - mes "[GM Scheduled Broadcasts Board]"; - mes "The message can't be empty. Please retry."; - goto L_CreateBroadcast; - -L_InvalidBroadcastTick: - mes "[GM Scheduled Broadcasts Board]"; - mes "You obviously can't repeat a message every 0 hours. Please retry."; - goto L_CreateBroadcast; - -L_Help: - callsub S_Help; - goto L_Close; - -S_Help: - mes "[GM Scheduled Broadcasts Board]"; - mes "This board allows a GM to schedule a message to be broadcast every X hours."; - mes "Only one broadcast can be scheduled at a time."; - return; - -S_PerformBroadcast: - announce $@GMSA_MSG$, 0; - return; - -L_ManualBroadcast: - callsub S_PerformBroadcast; - mes "Done."; - goto L_Close; - -L_StopBroadcast: - callsub S_StopBroadcast; - mes "Done."; - goto L_Close; - -S_StopBroadcast: - stopnpctimer; - setnpctimer 0; - set $@GMSA_STATUS, 0; - set $@GMSA_NAME$, ""; - set $@GMSA_MSG$, ""; - set $@GMSA_TICK, 0; - set $@GMSA_MAX, 0; - set $@GMSA_CURRENT_TICK, 0; - return; - -L_StartBroadcast2: - if ($@GMSA_STATUS == 1) - goto L_Abort; - callsub S_PerformBroadcast; - goto L_StartBroadcast; - -L_StartBroadcast: - if ($@GMSA_STATUS == 1) - goto L_Abort; - set $@GMSA_STATUS, 1; - set $@GMSA_NAME$, strcharinfo(0); - set $@GMSA_CURRENT_TICK, 0; - initnpctimer; - mes "Done."; - goto L_Close; - -L_Abort: - mes "[GM Scheduled Broadcasts Board]"; - mes $@GMSA_NAME$ + " has created a scheduled broadcast just before you, hence yours will abort."; - goto L_Close; - -L_Close: - close; - -OnTimer3600000: - set $@GMSA_CURRENT_TICK, $@GMSA_CURRENT_TICK + 1; - setnpctimer 0; - if ($@GMSA_CURRENT_TICK != $@GMSA_TICK) - end; - callsub S_PerformBroadcast; - set $@GMSA_CURRENT_TICK, 0; - set $@GMSA_MAX, $@GMSA_MAX - 1; - if ($@GMSA_MAX != 0) - end; - callsub S_StopBroadcast; - end; -} diff --git a/world/map/npc/botcheck/mapflags.txt b/world/map/npc/botcheck/mapflags.txt index b4dbac8a..cce971d6 100644 --- a/world/map/npc/botcheck/mapflags.txt +++ b/world/map/npc/botcheck/mapflags.txt @@ -1 +1,2 @@ botcheck.gat|mapflag|resave|botcheck.gat,37,37 +botcheck.gat|mapflag|nosave|botcheck.gat,37,37 diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt index 9918cbaf..b4a66314 100755 --- a/world/map/npc/functions/debug.txt +++ b/world/map/npc/functions/debug.txt @@ -956,7 +956,7 @@ OnInit: end; } -botcheck.gat,50,28,0|script|Debug4|154, +017-9.gat,21,24,0|script|Debug4|154, { callfunc "Debug"; end; diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt index 271a2e39..c2e92271 100644 --- a/world/map/npc/functions/ferry.txt +++ b/world/map/npc/functions/ferry.txt @@ -1,6 +1,6 @@ // The ferry system -botcheck.gat,27,28,0|script|#FerryConfig|-1, +017-9.gat,27,28,0|script|#FerryConfig|-1, { end; diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt index 7aa0d4b1..e455eb74 100644 --- a/world/map/npc/functions/travelers.txt +++ b/world/map/npc/functions/travelers.txt @@ -6,7 +6,7 @@ // Costs Zeny // Contains all warp points to find -botcheck.gat,27,28,0|script|#TravelConfig|-1, +017-9.gat,27,28,0|script|#TravelConfig|-1, { end; diff --git a/world/map/npc/items/unequipcb.txt b/world/map/npc/items/unequipcb.txt index 10080990..5db24bd4 100644 --- a/world/map/npc/items/unequipcb.txt +++ b/world/map/npc/items/unequipcb.txt @@ -2,7 +2,7 @@ // on any map because of the -1s at the end. // Note: the client (I think) has a display bug if this is called // during the intial connection's equip hook -botcheck.gat,0,0,0|script|UnequipCB|-1,-1,-1 +017-9.gat,0,0,0|script|UnequipCB|-1,-1,-1 { end; -- cgit v1.2.3-60-g2f50