summaryrefslogtreecommitdiff
path: root/npc/battleground/kvm/kvm03.txt
blob: 279a0b5fe113657e6a60ecbe862ad430d5a49d61 (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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
//===== Hercules Script ======================================
// BattleGround System - KvM 60-80
//===== By: ==================================================
//= ???, L0ne_W0lf
//===== Current Version: =====================================
//= 1.3
//===== Description: =========================================
//= [Official Conversion]
//= Kreiger Von Midgard Battleground for levels 60 to 80
//= - Winning Team: 2 points
//= - Losing Team: 1 point
//===== Additional Comments: =================================
//= 1.0 First Version.
//= 1.1 Updated using official Aegis files. [L0ne_W0lf]
//= 1.2 Upated some announces and dialogs from iRO.
//=     Changed how the scoreboard works slightly.
//=     Removed the areapercentheals, and minor things.
//= 1.3 Fixed wrong names for disablenpc/enablenpc. [Ai4rei]
//============================================================

// Waiting Room NPCs
//============================================================
bat_room,225,226,5	script	KVM Waiting Room#a3::KvM03R_Guillaume	4_M_KY_KNT,{
	end;

OnInit:
	waitingroom "Battle Station 5 Players",6,"KvM03_BG::OnGuillaumeJoin",1;
	end;

OnEnterBG:
	$@KvM03BG_id1 = waitingroom2bg("bat_c03",52,129,"KvM03_BG::OnGuillaumeQuit","KvM03_BG::OnGuillaumeDie");
	end;
}

bat_room,225,220,0	warp	#kvm701	2,2,bat_room,154,150

bat_room,225,205,3	script	KVM Waiting Room#b3::KvM03R_Croix	4_M_CRU_KNT,{
	end;

OnInit:
	waitingroom "Battle Station 5 Players",6,"KvM03_BG::OnCroixJoin",1;
	end;

OnEnterBG:
	$@KvM03BG_id2 = waitingroom2bg("bat_c03",147,55,"KvM03_BG::OnCroixQuit","KvM03_BG::OnCroixDie");
	end;
}

bat_room,225,211,0	warp	#kvm702	2,2,bat_room,154,150

// Starting Line
//============================================================
-	script	KVM03::CellEffect3	-1,{
	end;

OnKvM03One:
	specialeffect EF_CHANGECOLD;
	end;

OnKvM03Two:
	specialeffect EF_CHANGEPOISON;
	end;
}

bat_c03,54,124,3	duplicate(CellEffect3)	#RedcellA1-3	HIDDEN_WARP_NPC
bat_c03,55,124,3	duplicate(CellEffect3)	#RedcellA2-3	HIDDEN_WARP_NPC
bat_c03,56,124,3	duplicate(CellEffect3)	#RedcellA3-3	HIDDEN_WARP_NPC
bat_c03,57,124,3	duplicate(CellEffect3)	#RedcellA4-3	HIDDEN_WARP_NPC
bat_c03,57,125,3	duplicate(CellEffect3)	#RedcellA5-3	HIDDEN_WARP_NPC
bat_c03,57,126,3	duplicate(CellEffect3)	#RedcellA6-3	HIDDEN_WARP_NPC
bat_c03,57,127,3	duplicate(CellEffect3)	#RedcellA7-3	HIDDEN_WARP_NPC

bat_c03,145,59,3	duplicate(CellEffect3)	#RedcellB1-3	HIDDEN_WARP_NPC
bat_c03,144,59,3	duplicate(CellEffect3)	#RedcellB2-3	HIDDEN_WARP_NPC
bat_c03,143,59,3	duplicate(CellEffect3)	#RedcellB3-3	HIDDEN_WARP_NPC
bat_c03,142,59,3	duplicate(CellEffect3)	#RedcellB4-3	HIDDEN_WARP_NPC
bat_c03,142,56,3	duplicate(CellEffect3)	#RedcellB5-3	HIDDEN_WARP_NPC
bat_c03,142,57,3	duplicate(CellEffect3)	#RedcellB6-3	HIDDEN_WARP_NPC
bat_c03,142,58,3	duplicate(CellEffect3)	#RedcellB7-3	HIDDEN_WARP_NPC

bat_c03,54,128,3	script	#A_camp_start03	HIDDEN_WARP_NPC,4,4,{
	end;

OnInit:
	disablenpc "#A_camp_start03";
	end;

OnEnable:
	enablenpc "#A_camp_start03";
	end;

OnDisable:
	disablenpc "#A_camp_start03";
	end;

OnTouch:
	Bat_Team = 1;
	setquest 6025;
	end;
}

bat_c03,146,56,3	script	#B_camp_start03	HIDDEN_WARP_NPC,4,4,{
	end;

OnInit:
	disablenpc "#B_camp_start03";
	end;

OnEnable:
	enablenpc "#B_camp_start03";
	end;

OnDisable:
	disablenpc "#B_camp_start03";
	end;

OnTouch:
	Bat_Team = 2;
	setquest 6025;
	end;
}

// Battleground Engine
//============================================================
-	script	KvM03_BG	-1,{
	end;

OnInit:
	setwall "bat_c03",54,122,6,7,0,"batc03wall_a";
	setwall "bat_c03",55,122,5,7,0,"batc03wall_b";
	setwall "bat_c03",140,56,6,7,0,"batc03wall_c";
	setwall "bat_c03",140,57,5,7,0,"batc03wall_d";
	disablenpc "KVM Officer#KVM03A";
	disablenpc "KVM Officer#KVM03B";
	end;

OnGuillaumeJoin:
OnCroixJoin:
	donpcevent "KvM03_BG::OnReadyCheck";
	end;

OnGuillaumeQuit:
	//BG_Delay_Tick = gettimetick(2) + 1200;
OnGuillaumeDie:
	if ($@KvM03BG == 2) {
		--.Guillaume_Count;
		bg_updatescore "bat_c03",.Guillaume_Count,.Croix_Count;
		if( .Guillaume_Count < 1 ) donpcevent "KvM03_BG::OnCroixWin";
		else {
			mapannounce "bat_c03", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
			mapannounce "bat_c03", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
		}
	}
	end;

OnCroixQuit:
	//BG_Delay_Tick = gettimetick(2) + 1200;
OnCroixDie:
	if ($@KvM03BG == 2) {
		--.Croix_Count;
		bg_updatescore "bat_c03",.Guillaume_Count,.Croix_Count;
		if( .Croix_Count < 1 ) donpcevent "KvM03_BG::OnGuillaumeWin";
		else {
			mapannounce "bat_c03", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
			mapannounce "bat_c03", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
		}
	}
	end;

OnReadyCheck:
	if( $@KvM03BG )
		end;
	.@Guillaume = getwaitingroomstate(0,"KvM03R_Guillaume");
	.@Croix = getwaitingroomstate(0,"KvM03R_Croix");

	if( .@Guillaume < 5 || .@Croix < 5 )
		end;

	$@KvM03BG = 1; // Starting
	donpcevent "KvM03R_Croix::OnEnterBG";
	donpcevent "KvM03R_Guillaume::OnEnterBG";
	donpcevent "KvM03_BG::OnStart";
	end;

OnStart:
	disablenpc "KVM Officer#KVM03A";
	disablenpc "KVM Officer#KVM03B";
	$@KvM01BG_Victory = 0;
	// Warp Teams
	bg_warp $@KvM03BG_id1,"bat_c03",53,128;
	bg_warp $@KvM03BG_id2,"bat_c03",146,55;
	initnpctimer;
	end;

OnTimer1000:
	mapannounce "bat_c03", "In 1 minute, KVM will start.",bc_map,"0x00ff00";
	end;

OnTimer3000:
	mapannounce "bat_c03", "The maximum time for a KVM battle is 5 minutes.",bc_map,"0x00ff00";
	end;

OnTimer6000:
	mapannounce "bat_c03", "Please prepare for the KVM battle.",bc_map,"0x00ff00";
	mapannounce "bat_c03", "You can buff your people.",bc_map,"0x00ff00";
	donpcevent "#A_camp_start03::OnEnable";
	donpcevent "#B_camp_start03::OnEnable";
	end;

OnTimer13000:
	donpcevent "#A_camp_start03::OnDisable";
	donpcevent "#B_camp_start03::OnDisable";
	end;

OnTimer30000:
	mapannounce "bat_c03", "30 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
	end;

OnTimer45000:
	mapannounce "bat_c03", "15 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
	donpcevent "::OnKvM01One";
	end;

OnTimer50000:
	mapannounce "bat_c03", "10 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
	donpcevent "::OnKvM01Two";
	end;

OnTimer55000:
	mapannounce "bat_c03", "5 seconds remaining to start KVM battle.",bc_map,"0x00ff00";
	donpcevent "::OnKvM01One";
	end;

OnTimer59000:
	mapannounce "bat_c03", "KVM is now commencing.",bc_map,"0x00ff00";
	donpcevent "::OnKvM01Two";
	end;

OnTimer61000:
	// Team Members
	.Guillaume_Count = bg_get_data($@KvM03BG_id1, 0);
	.Croix_Count = bg_get_data($@KvM03BG_id2, 0);
	if( .Guillaume_Count < 5 || .Croix_Count < 5 )
	{
		$@KvM03BG_Victory = 3;
		$@KvM03BG = 3;
		mapannounce "bat_c03","There are not enough players to start the battle",1,0xC0C0C0;
		stopnpctimer;
		donpcevent "KvM03_BG::OnStop";
		end;
	}
	$@KvM03BG = 2; // Playing
	bg_warp $@KvM03BG_id1,"bat_c03",62,119;
	bg_warp $@KvM03BG_id2,"bat_c03",137,64;
	end;

OnTimer300000:
	mapannounce "bat_c03", "1 minute remaining to finish the KVM battle.",bc_map,"0x00ff00";
	end;

OnTimer330000:
	mapannounce "bat_c03", "30 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
	end;

OnTimer345000:
	mapannounce "bat_c03", "15 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
	end;

OnTimer350000:
	mapannounce "bat_c03", "10 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
	end;

OnTimer355000:
	mapannounce "bat_c03", "5 seconds remaining to finish the KVM battle.",bc_map,"0x00ff00";
	end;

OnTimer360000:
	mapannounce "bat_c03", "KVM has ended.",bc_map,"0x00ff00";
	if( .Croix_Count > .Guillaume_Count )
		donpcevent "KvM03_BG::OnCroixWin";
	else if( .Croix_Count < .Guillaume_Count )
		donpcevent "KvM03_BG::OnGuillaumeWin";
	else
	{ // Draw Game
		$@KvM03BG = 3;
		$@KvM03BG_Victory = 3;
		mapannounce "bat_c03", "The number of Guillaumes is "+.Guillaume_Count+".",bc_map,"0x00ff00";
		mapannounce "bat_c03", "The number of Croixes is "+.Croix_Count+".",bc_map,"0x00ff00";
		mapannounce "bat_c03", "This battle has ended in a draw.",bc_map,"0x00ff00";
		donpcevent "KvM03_BG::OnStop";
	}
	end;

OnGuillaumeWin:
	$@KvM03BG = 3;
	$@KvM03BG_Victory = 1;
	mapannounce "bat_c03", "Guillaume wins!",bc_map,"0x00ff00";
	mapannounce "bat_c03", "Congratulations to Guillaume members.",bc_map,"0x00ff00";
	mapannounce "bat_c03", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
	donpcevent "KvM03_BG::OnStop";
	end;

OnCroixWin:
	$@KvM03BG = 3;
	$@KvM03BG_Victory = 2;
	mapannounce "bat_c03", "Croix wins!",bc_map,"0x00ff00";
	mapannounce "bat_c03", "Congratulations to Croix members.",bc_map,"0x00ff00";
	mapannounce "bat_c03", "Everyone will be moved to the start point.",bc_map,"0x00ff00";
	donpcevent "KvM03_BG::OnStop";
	end;

OnStop:
	stopnpctimer;
	enablenpc "KVM Officer#KVM03A";
	enablenpc "KVM Officer#KVM03B";
	// Warp Teams
	bg_warp $@KvM03BG_id1,"bat_c03",53,128;
	bg_warp $@KvM03BG_id2,"bat_c03",146,55;
	donpcevent "KvM03_BG_Out::OnBegin";
	end;

OnReset:
	.Croix_Count = 0;
	.Guillaume_Count = 0;
	$@KvM03BG_Victory = 0;
	if( $@KvM03BG_id1 ) { bg_destroy $@KvM03BG_id1; $@KvM03BG_id1 = 0; }
	if( $@KvM03BG_id2 ) { bg_destroy $@KvM03BG_id2; $@KvM03BG_id2 = 0; }
	disablenpc "KVM Officer#KVM03A";
	disablenpc "KVM Officer#KVM03B";
	mapwarp "bat_c03","bat_room",154,150;
	maprespawnguildid "bat_c03",0,3; // Just in case someone else
	bg_updatescore "bat_c03",5,5;
	$@KvM03BG = 0;
	donpcevent "KvM03_BG::OnReadyCheck"; // Maybe a game is ready to start
	end;
}

-	script	KvM03_BG_Out	-1,{
	end;

OnBegin:
	initnpctimer;
	end;

OnTimer1000:
	mapannounce "bat_c03", "Please apply with the Officer to acquire KVM points.",bc_map,"0x00ff00";
	end;

OnTimer3000:
	mapannounce "bat_c03", "The Officer will grant you the points for 30 seconds.",bc_map,"0x00ff00";
	mapannounce "bat_c03", "In 30 seconds, the Officer will be sent away.",bc_map,"0x00ff00";
	end;

OnTimer5000:
	mapannounce "bat_c03", "Unless you talk to the Officer, you cannot gain the points.",bc_map,"0x00ff00";
	mapannounce "bat_c03", "Please be careful.",bc_map,"0x00ff00";
	end;

OnTimer55000:
	mapannounce "bat_c03", "You will be sent back.",bc_map,"0x00ff00";
	end;

OnTimer60000:
	stopnpctimer;
	donpcevent "KvM03_BG::OnReset";
	end;
}

// Battleground rewards
//============================================================
bat_c03,51,130,5	script	KVM Officer#KVM03A	4_M_KY_HEAD,{
	if( $@KvM01BG_Victory )
	{
		if( $@KvM03BG_Victory == Bat_Team )
		{ // Victory
			kvm_point += 2;
			mes "[KVM Officer]";
			mes "Good Game.";
			mes "May the glory of KVM be with you.";
			mes "You aquire the winning points: 2";
			close2;
		} else {
			++kvm_point;
			mes "[KVM Officer]";
			mes "I am so sorry.";
			mes "I wish you better luck next time.";
			mes "You aquire the losing points: 1";
			close2;
		}
		bg_leave;
		Bat_Team = 0;
		warp "bat_room",154,150;
		end;
	}
	end;
}

bat_c03,148,53,1	script	KVM Officer#KVM03B	4_M_CRU_HEAD,{
	if( $@KvM01BG_Victory )
	{
		if( $@KvM03BG_Victory == Bat_Team )
		{ // Victory
			kvm_point +=2;
			mes "[KVM Officer]";
			mes "Good Game.";
			mes "May the glory of KVM be with you.";
			mes "You aquire the winning points: 2";
			close2;
		} else {
			++kvm_point;
			mes "[KVM Officer]";
			mes "I am so sorry.";
			mes "I wish you better luck next time.";
			mes "You aquire the losing points: 1";
			close2;
		}
		bg_leave;
		Bat_Team = 0;
		warp "bat_room",154,150;
		end;
	}
	end;
}