From 3cd3c27ee4bb6becc8ee6445f1dc7d04b9cf9832 Mon Sep 17 00:00:00 2001 From: jesusalva Date: Sun, 18 Feb 2018 18:22:39 -0300 Subject: Make /gm work by adding a binding to @wgm. Edit bgmaster to understand properly how it works - Needs to right-click, clever. --- npc/004-2/bgmaster.txt | 21 ++++++++++++++++++--- npc/commands/wgm.txt | 30 ++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 npc/commands/wgm.txt diff --git a/npc/004-2/bgmaster.txt b/npc/004-2/bgmaster.txt index f5ed8cf56..92db75bb9 100644 --- a/npc/004-2/bgmaster.txt +++ b/npc/004-2/bgmaster.txt @@ -4,11 +4,11 @@ 004-2,29,23,0 script BGMaster NPC_FEMALE,{ mesn; - if ($@BattleOn) goto L_Busy; + //if ($@BattleOn) goto L_Busy; mesq l("Hello, lets bg masterize this."); mes ""; menu - l("Init!"), L_Init, + rif(!$@BattleOn, l("Init!")), L_Init, l("Join team 1."), L_T1, l("Join team 2."), L_T2; @@ -28,11 +28,14 @@ L_T2: L_SuccessJoin: mesq l("Done!"); + next; + warp "testbg", 0, 0; close; L_Init: $@BattleOn=1; - mesn; + mesq str( bg_get_data($@FK_Team1, 0) ); + mesq str( bg_get_data($@FK_Team2, 0) ); next; //for bg_warp $@FK_Team1, "testbg", 13, 4; @@ -71,6 +74,7 @@ OnPcDeath: end; OnTimer30000: + if (getmapusers("testbg") < 2) goto L_RestartTimer; mapannounce("testbg", "Reinforcements raise!", bc_map); $@FKing_T1 = bg_monster($@FK_Team1, "testbg", 1, 1, "FallenGuard1", 1081, "BGMaster::OnSkip"); $@FKing_T2 = bg_monster($@FK_Team2, "testbg", 13, 28, "FallenGuard2", 1082, "BGMaster::OnSkip"); @@ -81,7 +85,16 @@ OnTimer30000: OnSkip: end; +L_Skip: + end; + +L_RestartTimer: + stopnpctimer(); + initnpctimer(); + end; + OnVictor1: + if (!$@BattleOn) goto L_Skip; stopnpctimer(); announce "Team 1 raises victorious!", bc_all; bg_warp $@FK_Team1, "004-2", 29, 23; @@ -92,6 +105,7 @@ OnVictor1: end; OnVictor2: + if (!$@BattleOn) goto L_Skip; stopnpctimer(); announce "Team 2 raises victorious!", bc_all; bg_warp $@FK_Team1, "004-2", 29, 23; @@ -111,6 +125,7 @@ OnInit: setunitdata(.@npcId, UDT_HAIRCOLOR, 5); npcsit; + waitingroom("Hello World", 30); $@FK_Team1=waitingroom2bg("testbg", 13, 4, "BGMaster::OnPcQuit", "BGMaster::OnPcDeath"); $@FK_Team2=waitingroom2bg("testbg", 13, 26, "BGMaster::OnPcQuit", "BGMaster::OnPcDeath"); diff --git a/npc/commands/wgm.txt b/npc/commands/wgm.txt new file mode 100644 index 000000000..f356305f4 --- /dev/null +++ b/npc/commands/wgm.txt @@ -0,0 +1,30 @@ +// @wgm atcommand +// Request help +// +// group lv: 0 +// group char lv: 0 +// log: True +// +// usage: +// @wgm Help +// + +- script @wgm 32767,{ + end; + +OnCall: + .@request$ = strtoupper(strip(.@atcmd_parameters$[0])); // sanitize + .@map$ = ""; + .@x = 0; + .@y = 0; + + if (.@map$ == "") + { + .@map$ = .@atcmd_parameters$[0]; + } + + atcommand("@request "+.@map$); + +OnInit: + bindatcmd "wgm", "@wgm::OnCall", 0, 0, 1; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index b3606271f..468f39d03 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -103,6 +103,7 @@ "npc/commands/debug.txt", "npc/commands/super-menu.txt", "npc/commands/magic.txt", +"npc/commands/wgm.txt", // config script "npc/config/hairstyle_config.txt", -- cgit v1.2.3-70-g09d2