summaryrefslogtreecommitdiff
path: root/npc/001-1/bgmaster.txt
blob: b24996411bbc16e3518d3cc92b6849f9bd4f9577 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
// TMW2 Scripts.
// Author:
//  Jesusalva

// Original File

001-1,96,37,0	script	Cassia	NPC_FEMALE,{
    mesn;
    /*
    //if ($@BattleOn) goto L_Busy;
    mesq l("Hello! I am @@, currently in charge of the Desert Pass.", .name$);
    next;
    atcommand("@time");
    mesq l("The Fallen Kings challenge ownership of this pass at ##B08:00##b, ##B16:00##b and ##B00:00##b.");
    next;
    mesq l("Right click on one of their representatives, and choose to join a \'Chat\' when it is close of the time!");
    next;
    mesq l("Just as a warning, main chat will change. Use it to discuss the strategy!");
    if (!getgmlevel()) goto L_Close;
    mes "";
    menu
        l("Join team 1."), L_T1,
        l("Join team 2."), L_T2;
    */
    if ($@BGMaster1) goto L_Busy;
    if (getgmlevel()) goto L_Control;

L_Intro:
    mesq l("Hello! I am Cassia, Ambassator. During the Monster War outbreak, Frostia and Halinarzo felt.");
    next;
    mesq l("To train their soldiers, they frequently face one against other in duels. Adventurers are welcome to join their drills.");
    next;
    mesq l("To join a drill, right click on one of the lieutenants and join their Battle Stations. The drill can last up to 10 minutes.");
    next;
    mesq l("The sides accept only one adventurer. You'll also lose access to General Chat upon joining, and will have to use #world.");
    next;
    mesq l("Be sure to have a friend before joining, or you may have to logout in order to be able to move again!");
    close;

L_Close:
    close;

L_Busy:
    if ($@BGMaster1 == 2) {
        mesq l("The soldiers are resting at the moment.");
    } else {
        mesq l("People are challenging now.");
    }
    close;

L_Control:
    menu
        l("Introduce"), L_Intro,
        l("Enable BG"), L_On,
        l("Disable BG"), L_Off;

L_On:
    enablenpc "Lt. Randy";
    enablenpc "Lt. Gerry";
    mapannounce "001-1", "Frostia and Halinarzo are now on a spar!", bc_map;
    mes "Event enabled.";
    close;

L_Off:
    disablenpc "Lt. Randy";
    disablenpc "Lt. Gerry";
    mes "Event disabled.";
    close;

OnPcQuit:
    warp "002-4", 0, 0;
    bg_leave();
    end;

OnPcDeath:
    warp "002-4", 0, 0;
    bg_leave();
    end;

OnTimer60000:
    if (getmapusers("001-2") < 2 || .BGC > 10) goto L_Cancel;

	mapannounce("001-2", "Reinforcements raise!", bc_map);
	$@FKing_T1 = bg_monster($@FK_Team1, "001-2", 125, 38, "FallenGuard1", 1081, "Cassia::OnSkip");
	$@FKing_T2 = bg_monster($@FK_Team2, "001-2",124, 213, "FallenGuard2", 1082, "Cassia::OnSkip");
    .BGC+=1;
	stopnpctimer();
	initnpctimer();
    end;

// Arena Cooldown (every 8 hours) (CET time)
OnClock0000:
OnClock0800:
OnClock1600:
    if ($@BGMaster1 == 2) $@BGMaster1=0;
    end;

OnSkip:
    end;

L_Skip:
    end;

L_RestartTimer:
	stopnpctimer();
	initnpctimer();
    end;

L_Cancel:
	stopnpctimer();
    announce "The Fallen Kings Duel ended in a draw!", bc_all;
    killmonsterall "001-2";

    mapwarp "001-2", "001-1", 235, 27;
    bg_destroy($@FK_Team1);
    bg_destroy($@FK_Team2);
    $@BGMaster1=2;
    end;

OnVictor1:
    if (!$@BGMaster1) goto L_Skip;
	stopnpctimer();
    announce "Team 1 raises victorious at the Fallen Kings Duel!", bc_all; // TODO: Give players a reward
    killmonsterall "001-2";

    mapwarp "001-2", "001-1", 117, 72;
    bg_destroy($@FK_Team1);
    bg_destroy($@FK_Team2);
    $@BGMaster1=2;
    end;

OnVictor2:
    if (!$@BGMaster1) goto L_Skip;
	stopnpctimer();
    announce "Team 2 raises victorious at the Fallen Kings Duel!", bc_all;
    killmonsterall "001-2";

    mapwarp "001-2", "001-1", 117, 72;
    bg_destroy($@FK_Team1);
    bg_destroy($@FK_Team2);
    $@BGMaster1=2;
    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;

    .sex = G_FEMALE;
    .distance = 7;
    /*
    // This script is TODO
    if (!debug) {
        disablenpc "Cassia";
    }*/
    end;

OnDoEvent:
    .BGC=0;
	mapannounce("001-2", "May the fight begin!", bc_map);
	$@FKing_T1 = bg_monster($@FK_Team1, "001-2", 125, 38, "FallenKing1", 1079, "Cassia::OnVictor2");
	$@FKing_T2 = bg_monster($@FK_Team2, "001-2", 124, 213, "FallenKing2", 1080, "Cassia::OnVictor1");
	initnpctimer();
    end;
}



























































001-1,94,36,0	script	Lt. Randy	NPC_ELF,{
    hello;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1312); // Light armor
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2212); // Pants
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 7);

	waitingroom("Battle Station", 2, "start#bat_a02::OnReadyCheck", 1);

    disablenpc("Lt. Randy");
	end;

OnEnterBG:
	$@FK_Team1 = waitingroom2bg("001-2",126, 38,"start#bat_a02::OnSide1Quit","");
	end;
}

001-1,98,36,0	script	Lt. Gerry	NPC_ELF,{
    hello;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1311); // Terranite armor
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2212); // Pants
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 7);

	waitingroom("Battle Station", 2, "start#bat_a02::OnReadyCheck", 1);

    disablenpc("Lt. Gerry");
	end;

OnEnterBG:
	$@FK_Team2 = waitingroom2bg("001-2",124,213,"start#bat_a02::OnSide2Quit","");
	end;
}

//== Tierra Gorge Battleground Engine ======================
001-2,0,0,3	script	start#bat_a02	NPC_HIDDEN,{
OnInit:
	//mapwarp "bat_a02","bat_room",154,150;
	end;

OnEnable:
	end;

OnSide1Quit:
OnSide2Quit:
	bg_leave;
	end;

OnReadyCheck:
	if( $@BGMaster1 )
		end;
	.@Guillaume = getwaitingroomstate(0,"Lt. Randy");
	.@Croix = getwaitingroomstate(0,"Lt. Gerry");
	if( !.@Guillaume && !.@Croix ) {
		donpcevent "#bat_a02_timer::OnStop";
		end;
	}
	else if( .@Guillaume < 1 || .@Croix < 1 )
		end;
	$@BGMaster1 = 1;
	donpcevent "Lt. Randy::OnEnterBG";
	donpcevent "Lt. Gerry::OnEnterBG";
	donpcevent "Cassia::OnDoEvent";
	bg_warp $@FK_Team1,"001-2",126,38;
	bg_warp $@FK_Team2,"001-2",125,213;
	//initnpctimer;
	end;
}