summaryrefslogtreecommitdiff
path: root/npc/004-2
diff options
context:
space:
mode:
authorjesusalva <cpntb1@ymail.com>2018-02-18 17:15:44 -0300
committerjesusalva <cpntb1@ymail.com>2018-02-18 17:15:44 -0300
commitb494d616f267467ead9d28882499d7a9c7a6a7f7 (patch)
tree20c599abaaf91cabac6a0b0f0aea6e3d82a64972 /npc/004-2
parentaa35e37b4ce2725938b5fe6af8357dfef8a0162b (diff)
downloadserverdata-b494d616f267467ead9d28882499d7a9c7a6a7f7.tar.gz
serverdata-b494d616f267467ead9d28882499d7a9c7a6a7f7.tar.bz2
serverdata-b494d616f267467ead9d28882499d7a9c7a6a7f7.tar.xz
serverdata-b494d616f267467ead9d28882499d7a9c7a6a7f7.zip
Battlegrounds not working as expected, highlight @4144 for help
Diffstat (limited to 'npc/004-2')
-rw-r--r--npc/004-2/_import.txt1
-rw-r--r--npc/004-2/bgmaster.txt120
2 files changed, 121 insertions, 0 deletions
diff --git a/npc/004-2/_import.txt b/npc/004-2/_import.txt
index 741f8a548..bc0ba945d 100644
--- a/npc/004-2/_import.txt
+++ b/npc/004-2/_import.txt
@@ -1,4 +1,5 @@
// Map 004-2: Desert Mountains
// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/004-2/bgmaster.txt",
"npc/004-2/_mobs.txt",
"npc/004-2/_warps.txt",
diff --git a/npc/004-2/bgmaster.txt b/npc/004-2/bgmaster.txt
new file mode 100644
index 000000000..f5ed8cf56
--- /dev/null
+++ b/npc/004-2/bgmaster.txt
@@ -0,0 +1,120 @@
+// TMW2 Scripts.
+// Author:
+// Jesusalva
+
+004-2,29,23,0 script BGMaster NPC_FEMALE,{
+ mesn;
+ if ($@BattleOn) goto L_Busy;
+ mesq l("Hello, lets bg masterize this.");
+ mes "";
+ menu
+ l("Init!"), L_Init,
+ l("Join team 1."), L_T1,
+ l("Join team 2."), L_T2;
+
+L_T1:
+ mesn;
+ if (bg_join_team($@FK_Team1))
+ goto L_SuccessJoin;
+ mes "An error happened.";
+ goto L_Close;
+
+L_T2:
+ mesn;
+ if (bg_join_team($@FK_Team1))
+ goto L_SuccessJoin;
+ mes "An error happened.";
+ goto L_Close;
+
+L_SuccessJoin:
+ mesq l("Done!");
+ close;
+
+L_Init:
+ $@BattleOn=1;
+ mesn;
+ next;
+ //for
+ bg_warp $@FK_Team1, "testbg", 13, 4;
+ bg_warp $@FK_Team2, "testbg", 13, 26;
+ mesn;
+ next;
+ //setbgteam $@FK_Team1, 1;
+ //setbgteam $@FK_Team2, 2;
+ //mesn;
+ //next;
+ mapannounce("testbg", "May the fight begin!", bc_map);
+ mesn;
+ next;
+ $@FKing_T1 = bg_monster($@FK_Team1, "testbg", 1, 1, "OldFallen", 1079, "BGMaster::OnVictor2");
+ $@FKing_T2 = bg_monster($@FK_Team2, "testbg", 13, 28, "OldFallen2", 1080, "BGMaster::OnVictor1");
+ mesn;
+ next;
+ initnpctimer();
+ close;
+
+L_Close:
+ close;
+
+L_Busy:
+ mesq l("Sorry, registration period is over.");
+ close;
+
+OnPcQuit:
+ warp "002-4", 0, 0;
+ bg_leave();
+ end;
+
+OnPcDeath:
+ warp "002-4", 0, 0;
+ bg_leave();
+ end;
+
+OnTimer30000:
+ 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");
+ stopnpctimer();
+ initnpctimer();
+ end;
+
+OnSkip:
+ end;
+
+OnVictor1:
+ stopnpctimer();
+ announce "Team 1 raises victorious!", bc_all;
+ bg_warp $@FK_Team1, "004-2", 29, 23;
+ bg_warp $@FK_Team2, "004-2", 29, 23;
+ bg_destroy($@FK_Team1);
+ bg_destroy($@FK_Team2);
+ $@BattleOn=0;
+ end;
+
+OnVictor2:
+ stopnpctimer();
+ announce "Team 2 raises victorious!", bc_all;
+ bg_warp $@FK_Team1, "004-2", 29, 23;
+ bg_warp $@FK_Team2, "004-2", 29, 23;
+ bg_destroy($@FK_Team1);
+ bg_destroy($@FK_Team2);
+ $@BattleOn=0;
+ end;
+
+OnInit:
+ .@npcId = getnpcid(0, .name$);
+ setunitdata(.@npcId, UDT_HEADTOP, 1322); // Dress
+ setunitdata(.@npcId, UDT_HEADMIDDLE, 2204); // Not needed
+ setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
+ setunitdata(.@npcId, UDT_WEAPON, 3501);
+ setunitdata(.@npcId, UDT_HAIRSTYLE, 12);
+ setunitdata(.@npcId, UDT_HAIRCOLOR, 5);
+ npcsit;
+
+ $@FK_Team1=waitingroom2bg("testbg", 13, 4, "BGMaster::OnPcQuit", "BGMaster::OnPcDeath");
+ $@FK_Team2=waitingroom2bg("testbg", 13, 26, "BGMaster::OnPcQuit", "BGMaster::OnPcDeath");
+
+ .sex = G_FEMALE;
+ .distance = 5;
+ end;
+}