diff options
author | Vincent Petithory <vincent.petithory@gmail.com> | 2013-05-28 22:02:35 +0200 |
---|---|---|
committer | Vincent Petithory <vincent.petithory@gmail.com> | 2013-06-10 01:14:09 +0200 |
commit | eeb7705b43dbc6101c4e75972a62a9cb05bbd15b (patch) | |
tree | 3a0e11ecc4ae78a2943c6229802b7bcd69793f87 /world/map/npc/botcheck/announcements.txt | |
parent | 0cb94e13d7aad1a759a2a8a1e26dc2036b7e9965 (diff) | |
download | serverdata-eeb7705b43dbc6101c4e75972a62a9cb05bbd15b.tar.gz serverdata-eeb7705b43dbc6101c4e75972a62a9cb05bbd15b.tar.bz2 serverdata-eeb7705b43dbc6101c4e75972a62a9cb05bbd15b.tar.xz serverdata-eeb7705b43dbc6101c4e75972a62a9cb05bbd15b.zip |
GM broadcasts NPC: add an optional max times to broadcast a message
Diffstat (limited to 'world/map/npc/botcheck/announcements.txt')
-rw-r--r-- | world/map/npc/botcheck/announcements.txt | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/world/map/npc/botcheck/announcements.txt b/world/map/npc/botcheck/announcements.txt index 9ddf6ca6..d975984d 100644 --- a/world/map/npc/botcheck/announcements.txt +++ b/world/map/npc/botcheck/announcements.txt @@ -8,6 +8,7 @@ // 0: Broadcasts not running // 1: Broadcasts running // $@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 @@ -72,7 +73,15 @@ L_CreateBroadcast: next; mes "[GM Scheduled Broadcasts Board]"; - mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s):"; + 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?"; @@ -80,7 +89,7 @@ L_CreateBroadcast: "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 a broadcast right now.", L_StartBroadcast2; + "Yes. Broadcast this, and make an extra broadcast right now.", L_StartBroadcast2; L_InvalidBroadcastMessage: mes "[GM Scheduled Broadcasts Board]"; @@ -112,14 +121,19 @@ L_ManualBroadcast: goto L_Close; L_StopBroadcast: + callsub S_StopBroadcast; + mes "Done."; + goto L_Close; + +S_StopBroadcast: stopnpctimer; setnpctimer 0; set $@GMSA_STATUS, 0; set $@GMSA_MSG$, ""; set $@GMSA_TICK, 0; + set $@GMSA_MAX, 0; set $@GMSA_CURRENT_TICK, 0; - mes "Done."; - goto L_Close; + return; L_StartBroadcast2: if ($@GMSA_STATUS == 1) @@ -140,8 +154,6 @@ L_Abort: goto L_Close; L_Close: - set @gmsa_msg$, ""; - set @gmsa_tick, 0; close; OnTimer3600000: @@ -151,6 +163,9 @@ OnTimer3600000: end; callsub S_PerformBroadcast; set $@GMSA_CURRENT_TICK, 0; + set $@GMSA_MAX, $@GMSA_MAX - 1; + if ($@GMSA_MAX == 0) + callsub S_StopBroadcast; end; }
\ No newline at end of file |