summaryrefslogblamecommitdiff
path: root/npc/battleground/tierra/tierra01.txt
blob: 6795a2300364552e884c29648bb0d8f32f464919 (plain) (tree)
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
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954













































                                                                                                  
       




















































































                                                                                             
                                                   

































































                                                                                                                                              
                                                      




















                                                                                                                                                                                                   
                                                      



























































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                
//===== eAthena Script ======================================= 
// BattleGround System - Tierra Gorge
//===== By: ================================================== 
//= L0ne_W0lf
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= eAthena 1.0
//===== Description: ========================================= 
//= [AEGIS Conversion]
//= Tierra Gorge Battleground.
//= - Winning Team: 3 badges
//= - Losing Team: 1 badge
//===== Additional Comments: ================================= 
//= 1.0 First Version.
//============================================================

// Waiting Room NPCs
//============================================================
bat_room,57,227,5	script	Lieutenant Kalos	418,{
	end;

OnInit:
	waitingroom "Battle Station",10,"start#bat_a01::OnReadyCheck",1;
	end;

OnEnterBG:
	set $@TierraBG1_id1, waitingroom2bg("bat_a01",50,374,"start#bat_a01::OnGuillaumeQuit","");
	end;
}

bat_room,58,204,1	script	Lieutenant Eyor	414,{
	end;

OnInit:
	waitingroom "Battle Station",10,"start#bat_a01::OnReadyCheck",1;
	end;

OnEnterBG:
	set $@TierraBG1_id2, waitingroom2bg("bat_a01",42,16,"start#bat_a01::OnCroixQuit","");
	end;
}

bat_room,1,151,3	script	#bat_a01_timer	844,{
	end;

onInit:
OnEnable:
	initnpctimer;
	end;

OnStop:
	stopnpctimer;
	end;

OnTimer1000:
	stopnpctimer;
	initnpctimer;
	set .@chk_bat_a01,getmapusers("bat_a01");
	if (.@chk_bat_a01 < 1) {
		set $@TierraBG1,0; set $@TierraBG1_Victory, 0;
		if( $@TierraBG1_id1 ) { bg_destroy $@TierraBG1_id1; set $@TierraBG1_id1, 0; }
		if( $@TierraBG1_id2 ) { bg_destroy $@TierraBG1_id2; set $@TierraBG1_id2, 0; }
		donpcevent "start#bat_a01::OnReadyCheck";
	}
	end;
}

bat_a01,352,342,0	script	#bat_a01_quest_a	-1,5,5,{
	end;

OnTouch:
	if (checkquest(2069) < 0)
		setquest 2069;
	end;
}

bat_a01,353,52,0	script	#bat_a01_quest_b	-1,5,5,{
	end;

OnTouch:
	if (checkquest(2069) < 0)
		setquest 2069;
	end;
}

bat_room,57,220,0	warp	back_bgroom01a	1,1,bat_room,154,150
bat_room,57,211,0	warp	back_bgroom01b	1,1,bat_room,154,150

// Tierra Gorge Battleground Engine
//============================================================
bat_a01,15,15,3	script	start#bat_a01	844,{
OnInit:
	mapwarp "bat_a01","bat_room",154,150;
	end;

OnEnable:
	donpcevent "OBJ#bat_a01_a::Onkill";
	donpcevent "OBJ#bat_a01_a::OnEnable";
	donpcevent "OBJ#bat_a01_b::Onkill";
	donpcevent "OBJ#bat_a01_b::OnEnable";
	donpcevent "barricade#bat_a01_a::Onkill";
	donpcevent "barricade#bat_a01_a::OnEnable";
	donpcevent "barricade#bat_a01_b::Onkill";
	donpcevent "barricade#bat_a01_b::OnEnable";
	donpcevent "OBJ#bat_a01_n::Onkill";
	donpcevent "OBJ#bat_a01_n::OnEnable";
	donpcevent "NOBJ_mob#bat_a01_a::Onkill";
	donpcevent "NOBJ_mob#bat_a01_b::Onkill";
	donpcevent "Battle Therapist#a01_a::OnEnable";
	donpcevent "Battle Therapist#a01_b::OnEnable";
	donpcevent "countdown#bat_a01::OnEnable";
	disablenpc "Guillaume Blacksmith#a01";
	disablenpc "Croix Blacksmith#bat_a01";
	disablenpc "Guillaume Vintenar#a01_a";
	disablenpc "Croix Vintenar#a01_b";
	end;

OnGuillaumeQuit:
OnCroixQuit:
	bg_leave;
	end;

OnReadyCheck:
	if( $@TierraBG1 )
		end;
	set .@Guillaume, getwaitingroomstate(0,"Lieutenant Kalos");
	set .@Croix, getwaitingroomstate(0,"Lieutenant Eyor");
	if( !.@Guillaume && !.@Croix ) {
		donpcevent "#bat_a01_timer::OnStop";
		end;
	}
	else if( .@Guillaume < 10 || .@Croix < 10 )
		end;
	set $@TierraBG1,1;
	donpcevent "Lieutenant Kalos::OnEnterBG";
	donpcevent "Lieutenant Eyor::OnEnterBG";
	donpcevent "start#bat_a01::onEnable";
	bg_warp $@TierraBG1_id1,"bat_a01",352,342;
	bg_warp $@TierraBG1_id2,"bat_a01",353,52;
	initnpctimer;
	end;

OnTimer10000:
	stopnpctimer;
	donpcevent "#bat_a01_timer::OnEnable";
	end;
}

bat_a01,15,16,3	script	OBJ#bat_a01_a	844,{
OnEnable:
	bg_monster $@TierraBG1_id1,"bat_a01",177,345,"Food Storage",1909,"OBJ#bat_a01_a::OnMyMobDead";
	end;

Onkill:
	killmonster "bat_a01","OBJ#bat_a01_a::OnMyMobDead";
	end;

OnMyMobDead:
	if (mobcount("bat_a01","OBJ#bat_a01_a::OnMyMobDead") < 1) {
		donpcevent "Battle Therapist#a01_a::OnStop";
		donpcevent "Battle Therapist#a01_b::OnStop";
		set $@TierraBG1_Victory, 2;
		enablenpc "Guillaume Vintenar#a01_a";
		enablenpc "Croix Vintenar#a01_b";
		mapannounce "bat_a01", "Croix Vintenar Swandery: We destroyed Guillaume's Food Storage. We won that! Wow!",bc_map,"0xFFCE00";
		bg_warp $@TierraBG1_id1,"bat_a01",50,374;
		bg_warp $@TierraBG1_id2,"bat_a01",42,16;
	}
	end;
}

bat_a01,15,17,3	script	OBJ#bat_a01_b	844,{
OnEnable:
	bg_monster $@TierraBG1_id2,"bat_a01",167,50,"Food Depot",1910,"OBJ#bat_a01_b::OnMyMobDead";
	end;

Onkill:
	killmonster "bat_a01","OBJ#bat_a01_b::OnMyMobDead";
	end;

OnMyMobDead:
	if (mobcount("bat_a01","OBJ#bat_a01_b::OnMyMobDead") < 1) {
		donpcevent "Battle Therapist#a01_a::OnStop";
		donpcevent "Battle Therapist#a01_b::OnStop";
		set $@TierraBG1_Victory, 1;
		enablenpc "Guillaume Vintenar#a01_a";
		enablenpc "Croix Vintenar#a01_b";
		mapannounce "bat_a01", "Guillaume Vintenar Axl Rose : We destroyed Croix's Food Storage. We won that! Wow!",bc_map,"0xFFCE00";
		bg_warp $@TierraBG1_id1,"bat_a01",50,374;
		bg_warp $@TierraBG1_id2,"bat_a01",42,16;
	}
	end;
}

bat_a01,15,18,3	script	barricade#bat_a01_a	844,{
OnEnable:
	for( set .@i,185; .@i < 202; set .@i,.@i+1 )
		bg_monster $@TierraBG1_id1,"bat_a01",.@i,266,"Barricade",1906,"barricade#bat_a01_a::OnMyMobDead";
	setwall "bat_a01",185,265,16,6,1,"bat_a01_c1";
	end;

Onkill:
	killmonster "bat_a01","barricade#bat_a01_a::OnMyMobDead";
	delwall "bat_a01_c1";
	end;

OnMyMobDead:
	if (mobcount("bat_a01","barricade#bat_a01_a::OnMyMobDead") < 17) {
		killmonster "bat_a01","barricade#bat_a01_a::OnMyMobDead";
		delwall "bat_a01_c1";
		enablenpc "Guillaume Blacksmith#a01";
		mapannounce "bat_a01", "Guillaume Vintenar Axl Rose : The Barricade in the valley has been destroyed! Where's the Blacksmith? We need to rebuild the Barricade!",bc_map,"0xFFCE00";
	}
	end;
}

bat_a01,15,19,3	script	barricade#bat_a01_b	844,{
OnEnable:
	for( set .@i,169; .@i < 186; set .@i,.@i+1 )
		bg_monster $@TierraBG1_id2,"bat_a01",.@i,129,"Barricade",1906,"barricade#bat_a01_b::OnMyMobDead";
	setwall "bat_a01",169,130,16,6,1,"bat_a01_g1";
	end;

Onkill:
	killmonster "bat_a01","barricade#bat_a01_b::OnMyMobDead";
	delwall "bat_a01_g1";
	end;

OnMyMobDead:
	if (mobcount("bat_a01","barricade#bat_a01_b::OnMyMobDead") < 17) {
		killmonster "bat_a01","barricade#bat_a01_b::OnMyMobDead";
		delwall "bat_a01_g1";
		enablenpc "Croix Blacksmith#bat_a01";
		mapannounce "bat_a01", "Croix Vintenar Swandery : The Barricade in the valley has been destroyed! Where's the Blacksmith? We need to rebuild the Barricade!",bc_map,"0xFFCE00";
	}
	end;
}

bat_a01,15,20,3	script	OBJ#bat_a01_n	844,{
OnEnable:
	monster "bat_a01",273,203,"Neutrality Flag",1911,1,"OBJ#bat_a01_n::OnMyMobDead";
	end;

Onkill:
	killmonster "bat_a01","OBJ#bat_a01_n::OnMyMobDead";
	end;

OnMyMobDead:
	if (mobcount("bat_a01","OBJ#bat_a01_n::OnMyMobDead") < 17) {
		bg_team_setxy getcharid(4),56,212;
		if (getcharid(4) == $@TierraBG1_id1) {
			donpcevent "NOBJ_mob#bat_a01_a::OnEnable";
			mapannounce "bat_a01", "Guillaume captured a Neutrality Flag, so they have an advantage.",bc_map,"0xFFCE00";
		}
		else {
			donpcevent "NOBJ_mob#bat_a01_b::OnEnable";
			mapannounce "bat_a01", "Croix captured a Neutrality Flag, so they have an advantage.",bc_map,"0xFFCE00";
		}
	}
	end;
}

bat_a01,15,21,3	script	NOBJ_mob#bat_a01_a	844,{
OnEnable:
	donpcevent "NOBJ_mob#bat_a01_b::Onkill";
	bg_monster $@TierraBG1_id1,"bat_a01",272,204,"Guillaume Camp Guardian",1949,"NOBJ_mob#bat_a01_a::OnMyMobDead";
	bg_monster $@TierraBG1_id1,"bat_a01",272,213,"Guillaume Camp Guardian",1949,"NOBJ_mob#bat_a01_a::OnMyMobDead";
	bg_monster $@TierraBG1_id1,"bat_a01",273,197,"Guillaume Camp Guardian",1950,"NOBJ_mob#bat_a01_a::OnMyMobDead";
	end;

Onkill:
	killmonster "bat_a01","NOBJ_mob#bat_a01_a::OnMyMobDead";
	end;

OnMyMobDead:
	end;
}

bat_a01,15,22,3	script	NOBJ_mob#bat_a01_b	844,{
OnEnable:
	donpcevent "NOBJ_mob#bat_a01_a::Onkill";
	bg_monster $@TierraBG1_id2,"bat_a01",272,204,"Croix Camp Guardian",1949,"NOBJ_mob#bat_a01_a::OnMyMobDead";
	bg_monster $@TierraBG1_id2,"bat_a01",272,213,"Croix Camp Guardian",1949,"NOBJ_mob#bat_a01_a::OnMyMobDead";
	bg_monster $@TierraBG1_id2,"bat_a01",273,197,"Croix Camp Guardian",1950,"NOBJ_mob#bat_a01_a::OnMyMobDead";
	end;

Onkill:
	killmonster "bat_a01","NOBJ_mob#bat_a01_b::OnMyMobDead";
	end;

OnMyMobDead:
	end;
}

bat_a01,185,270,1	script	Guillaume Blacksmith#a01	851,{
	if (getcharid(4) == $@TierraBG1_id1) {
		mes "[Guillaume Blacksmith]";
		mes "We are in urgency! The Barricade has been destroyed!";
		mes "We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000";
		mes "We have it all except for the 50 Stones!";
		next;
		switch(select("Repair.:Leave it.")) {
		case 1:
			if (countitem(7049) > 49) {
				mes "[Guillaume Blacksmith]";
				mes "You brought enough stones! Let's go and repair.";
				next;
				mes "..";
				next;
				mes "....";
				next;
				mes "......";
				next;
				mes "........";
				next;
				mes "..........";
				next;
				mes "............";
				next;
				mes "..............";
				next;
				mes "[Guillaume Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage.";
				next;
				mes "[Guillaume Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade.";
				next;
				mes "[Guillaume Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade, then add Rough Elunium to make it stronger.";
				next;
				mes "[Guillaume Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade, then add Rough Elunium to make it stronger. Now decorate with Metal Fragments.";
				next;
				mes "[Guillaume Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade, then add Rough Elunium to make it stronger. Decorate with Metal Fragments, and plait stones with Sinew of Bear!";
				next;
				mes "..............";
				mes "..............";
				mes "..............";
				mes "..............";
				mes "..............";
				next;
				specialeffect EF_REPAIRWEAPON;
				mes "[Guillaume Blacksmith]";
				mes "Wow! It's done.";
				mes "We are relieved.";
				delitem 7049,50; //Stone
				donpcevent "barricade#bat_a01_a::OnEnable";
				close2;
				disablenpc "Guillaume Blacksmith#a01";
				end;
			}
			else {
				mes "[Guillaume Blacksmith]";
				mes "You don't have enough Stones!";
				next;
				mes "[Guillaume Blacksmith]";
				mes "^3131FFWe need 50 Stones.^000000";
				mes "We are busy, so please hurry.";
				close;
			}
		case 2:
			mes "[Guillaume Blacksmith]";
			mes "There are enemies coming! Let's evacuate from here!";
			close;
		}
	}
	else {
		mes "[Guillaume Blacksmith]";
		mes "There the enemy is coming!";
		close;
	}

OnInit:
	disablenpc "Guillaume Blacksmith#a01";
	end;
}

bat_a01,170,121,5	script	Croix Blacksmith#bat_a01	851,{
	if (getcharid(4) == $@TierraBG1_id2) {
		mes "[Croix Blacksmith]";
		mes "We are in urgency! The Barricade has been destroyed!";
		mes "We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000";
		mes "We have it all except for the 50 Stones!";
		next;
		switch(select("Repair.:Leave it.")) {
		case 1:
			if (countitem(7049) > 49) {
				mes "[Croix Blacksmith]";
				mes "You brought enough stones! Let's go and repair.";
				next;
				mes "..";
				next;
				mes "....";
				next;
				mes "......";
				next;
				mes "........";
				next;
				mes "..........";
				next;
				mes "............";
				next;
				mes "..............";
				next;
				mes "[Croix Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage.";
				next;
				mes "[Croix Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade.";
				next;
				mes "[Croix Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade, then add Rough Elunium to make it stronger.";
				next;
				mes "[Croix Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade, then add Rough Elunium to make it stronger. Now decorate with Metal Fragments.";
				next;
				mes "[Croix Blacksmith]";
				mes "Combine Stones and Gold in the proper percentage and shape the Barricade, then add Rough Elunium to make it stronger. Decorate with Metal Fragments, and plait stones with Sinew of Bear!";
				next;
				mes "..............";
				mes "..............";
				mes "..............";
				mes "..............";
				mes "..............";
				next;
				specialeffect EF_REPAIRWEAPON;
				mes "[Croix Blacksmith]";
				mes "Wow! It's done.";
				mes "We are relieved.";
				delitem 7049,50; //Stone
				donpcevent "barricade#bat_a01_b::OnEnable";
				close2;
				disablenpc "Croix Blacksmith#bat_a01";
				end;
			}
			else {
				mes "[Croix Blacksmith]";
				mes "You don't have enough Stones!";
				next;
				mes "[Croix Blacksmith]";
				mes "^3131FFWe need 50 Stone.^000000";
				mes "We are busy, so please hurry.";
				close;
			}
		case 2:
			mes "[Croix Blacksmith]";
			mes "There are enemies coming! Let's evacuate from here!";
			close;
		}
	}
	else {
		mes "[Croix Blacksmith]";
		mes "There, the enemy is coming!";
		close;
	}

OnInit:
	disablenpc "Croix Blacksmith#bat_a01";
	end;
}

bat_a01,53,377,3	script	Battle Therapist#a01_a	95,{
	specialeffect2 EF_HEAL;
	mes "[Battle Therapist]";
	mes "Just close your eyes,";
	mes "and take a deep breath.";
	mes "You can be free from pain.";
	close;
	end;

OnInit:
	initnpctimer;
	end;

OnEnable:
	stopnpctimer;
	initnpctimer;
	enablenpc "Battle Therapist#a01_a";
	end;

Onstop:
	disablenpc "bat_a01_rp1_a_warp";
	disablenpc "Battle Therapist#a01_a";
	stopnpctimer;
	end;

OnTimer25000:
	specialeffect EF_SANCTUARY;
	enablenpc "bat_a01_rp1_a_warp";
	end;

OnTimer26000:
	disablenpc "bat_a01_rp1_a_warp";
	end;

OnTimer26500:
	donpcevent "Battle Therapist#a01_a::OnEnable";
	end;
}

bat_a01,51,375,0	script	bat_a01_rp1_a_warp	-1,10,10,{
OnInit:
	disablenpc "bat_a01_rp1_a_warp";
	end;

OnTouch_:
	percentheal 100,100;
	warp "bat_a01",352,342;
	end;
}

bat_a01,45,19,3	script	Battle Therapist#a01_b	95,{
	specialeffect2 EF_HEAL;
	mes "[Battle Therapist]";
	mes "Just close your eyes,";
	mes "and take a deep breath.";
	mes "You can be free from pain.";
	close;
	end;

OnInit:
	initnpctimer;
	end;

OnEnable:
	stopnpctimer;
	initnpctimer;
	enablenpc "Battle Therapist#a01_b";
	end;

Onstop:
	disablenpc "bat_a01_rp1_b_warp";
	disablenpc "Battle Therapist#a01_b";
	stopnpctimer;
	end;

OnTimer25000:
	specialeffect EF_SANCTUARY;
	enablenpc "bat_a01_rp1_b_warp";
	end;

OnTimer26000:
	disablenpc "bat_a01_rp1_b_warp";
	end;

OnTimer26500:
	donpcevent "Battle Therapist#a01_b::OnEnable";
	end;
}

bat_a01,43,17,0	script	bat_a01_rp1_b_warp	-1,10,10,{
OnInit:
	disablenpc "bat_a01_rp1_b_warp";
	end;

OnTouch:
	percentheal 100,100;
	warp "bat_a01",353,52;
	end;
}

bat_a01,60,216,3	script	Valley Ghost#bat_a01_n	950,{
	specialeffect2 EF_HEAL;
	mes "[Valley Ghost]";
	mes "Boo...Boo...";
	close;

OnInit:
	initnpctimer;
	end;

OnEnable:
	stopnpctimer;
	initnpctimer;
	end;

OnTimer25000:
	specialeffect EF_SANCTUARY;
	enablenpc "bat_a01_rp1_n_warp";
	end;

OnTimer26000:
	disablenpc "bat_a01_rp1_n_warp";
	end;

OnTimer26500:
	donpcevent "Valley Ghost#bat_a01_n::OnEnable";
	end;
}

bat_a01,55,213,0	script	bat_a01_rp1_n_warp	-1,10,10,{
OnInit:
	disablenpc "bat_a01_rp1_n_warp";
	end;

OnTouch:
	percentheal 100,100;
	warp "bat_a01",301,209;
	end;
}

bat_a01,194,267,0	script	barri_warp_up#bat_a01_a	-1,7,0,{
OnTouch:
	if (getcharid(4) == $@TierraBG1_id1)
		warp "bat_a01",194,261;
	end;
}

bat_a01,194,265,0	script	barri_warp_down#bat_a01a	-1,7,0,{
OnTouch:
	if (getcharid(4) == $@TierraBG1_id1) 
		warp "bat_a01",194,270;
	end;
}

bat_a01,177,130,0	script	barri_warp_up#bat_a01_b	-1,7,0,{
OnTouch:
	if (getcharid(4) == $@TierraBG1_id2)
		warp "bat_a01",178,125;
	end;
}

bat_a01,177,128,0	script	barri_warp_down#bat_a01b	-1,7,0,{
OnTouch:
	if (getcharid(4) == $@TierraBG1_id2)
		warp "bat_a01",178,134;
	end;
}

bat_a01,352,342,0	script	A_CODE#bat_a01	-1,5,5,{
OnTouch:
	set .@chk_bfquest,checkquest(2069);
	if ((.@chk_bfquest == 0) || (.@chk_bfquest == 1))
		setquest 2069;
	end;
}

bat_a01,353,52,0	script	B_CODE#bat_a01	-1,5,5,{
OnTouch:
	set .@chk_bfquest,checkquest(2069);
	if ((.@chk_bfquest == 0) || (.@chk_bfquest == 1))
		setquest 2069;
	end;
}

bat_a01,169,227,0	script	underladd#bat_a01_1	45,1,1,{
OnTouch_:
	warp "bat_a01",178,228;
	end;
}

bat_a01,208,164,0	script	underladd#bat_a01_2	45,1,1,{
OnTouch_:
	warp "bat_a01",200,171;
	end;
}

bat_a01,171,309,3	script	Guillaume Camp#flag1	973,{ end; }
bat_a01,149,310,3	script	Guillaume Camp#flag2	973,{ end; }
bat_a01,119,336,3	script	Guillaume Camp#flag3	973,{ end; }
bat_a01,118,357,3	script	Guillaume Camp#flag4	973,{ end; }
bat_a01,150,380,3	script	Guillaume Camp#flag5	973,{ end; }
bat_a01,173,380,3	script	Guillaume Camp#flag6	973,{ end; }
bat_a01,210,344,3	script	Guillaume Camp#flag7	973,{ end; }
bat_a01,350,325,3	script	Guillaume Camp#flag8	973,{ end; }
bat_a01,358,325,3	script	Guillaume Camp#flag9	973,{ end; }

bat_a01,138,12,3	script	Croix Camp#flag1	974,{ end; }
bat_a01,108,36,3	script	Croix Camp#flag2	974,{ end; }
bat_a01,108,63,3	script	Croix Camp#flag3	974,{ end; }
bat_a01,136,87,3	script	Croix Camp#flag4	974,{ end; }
bat_a01,167,86,3	script	Croix Camp#flag5	974,{ end; }
bat_a01,199,49,3	script	Croix Camp#flag6	974,{ end; }
bat_a01,168,16,3	script	Croix Camp#flag7	974,{ end; }
bat_a01,357,74,3	script	Croix Camp#flag8	974,{ end; }
bat_a01,348,74,3	script	Croix Camp#flag9	974,{ end; }

bat_a01,53,377,3	script	Guillaume Vintenar#a01_a	419,{
	if (getcharid(4) == $@TierraBG1_id1) {
		if ($@TierraBG1_Victory == 1) {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 2) {
				mes "[Axl Rose]";
				mes "Blessed Guillaume!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,3; //BF_Badge1
			}
			else {
				mes "[Axl Rose]";
				mes "Blessed Guillaume!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
		else {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 0) {
				mes "[Axl Rose]";
				mes "You lost, but you're dedicated to this battle.";
				mes "This is a reward for your great dedication by Guillaume Marollo!";
				mes "Just take this defeat as a lesson, and next time you will definitely win.";
				close2;
				getitem 7828,1; //BF_Badge1
			}
			else {
				mes "[Axl Rose]";
				mes "You lost, but you're dedicated to this battle.";
				mes "This is a reward for your great dedication by Guillaume Marollo!";
				mes "Just take this defeat as a lesson, and next time you will definitely win.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
	}
	else {
		if ($@TierraBG1_Victory == 2) {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 0) {
				mes "[Axl Rose]";
				mes "You lost, but you're dedicated to this battle.";
				mes "This is a reward for your great dedication by Guillaume Marollo!";
				mes "Just take this defeat as a lesson, and next time you will definitely win.";
				close2;
				getitem 7828,1; //BF_Badge1
			}
			else {
				mes "[Axl Rose]";
				mes "You lost, but you're dedicated to this battle.";
				mes "This is a reward for your great dedication by Guillaume Marollo!";
				mes "Just take this defeat as a lesson, and next time you will definitely win.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
		else {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 2) {
				mes "[Axl Rose]";
				mes "Blessed Guillaume!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,3; //BF_Badge1
			}
			else {
				mes "[Axl Rose]";
				mes "Blessed Guillaume!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign of victory.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
	}
	bg_leave;
	warp "bat_room",154,150;
	end;

OnInit:
	disablenpc "Guillaume Vintenar#a01_a";
	end;
}

bat_a01,45,19,3	script	Croix Vintenar#a01_b	415,{
	if (getcharid(4) == $@TierraBG1_id2) {
		if ($@TierraBG1_Victory == 2) {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 2) {
				mes "[Swandery]";
				mes "Blessed Croix!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,3; //BF_Badge1
			}
			else {
				mes "[Swandery]";
				mes "Blessed Croix!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
		else {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 0) {
				mes "[Swandery]";
				mes "Oh, "+strcharinfo(0)+" Don't be sad.";
				mes "Even though we didn't win, we did our best.";
				mes "This is a Royal gift from Croix, and please don't forget this battle. We will win the next one.";
				close2;
				getitem 7828,1; //BF_Badge1
			}
			else {
				mes "[Swandery]";
				mes "Oh, "+strcharinfo(0)+" Don't be sad.";
				mes "Even though we didn't win, we did our best.";
				mes "This is a Royal gift from Croix, and please don't forget this battle. We will win the next one.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
	}
	else {
		if ($@TierraBG1_Victory == 1) {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 0) {
				mes "[Swandery]";
				mes "Oh, "+strcharinfo(0)+" Don't be sad.";
				mes "Even though we didn't win, we did our best.";
				mes "This is a Royal gift from Croix, and please don't forget this battle. We will win the next one.";
				close2;
				getitem 7828,1; //BF_Badge1
			}
			else {
				mes "[Swandery]";
				mes "Oh, "+strcharinfo(0)+" Don't be sad.";
				mes "Even though we didn't win, we did our best.";
				mes "This is a Royal gift from Croix, and please don't forget this battle. We will win the next one.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
		else {
			set .@your_medal,countitem(7828);
			set .@medal_gap, 500 - .@your_medal;
			if (.@medal_gap > 2) {
				mes "[Swandery]";
				mes "Blessed Croix!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,3; //BF_Badge1
			}
			else {
				mes "[Swandery]";
				mes "Blessed Croix!";
				mes "Let's enjoy our glorious victory!";
				mes ""+strcharinfo(0)+", it's a sign reflecting victory.";
				close2;
				getitem 7828,.@medal_gap; //BF_Badge1
			}
		}
	}
	bg_leave;
	warp "bat_room",154,150;
	end;

OnInit:
	disablenpc "Croix Vintenar#a01_b";
	end;
}

bat_a01,1,5,3	script	countdown#bat_a01	844,{
OnEnable:
	initnpctimer;
	end;

Onstop:
	stopnpctimer;
	end;

OnTimer7000:
	mapannounce "bat_a01", "Guillaume Vintenar Axl Rose : Let's attack to burn down Croix's Food Depot!",bc_map,"0xFF9900";
	end;

OnTimer8000:
	mapannounce "bat_a01", "Croix Vintenar Swandery : Master of Valhalla! Let us be gifted with unfailing faith and courage!",bc_map,"0xFF99CC";
	end;

OnTimer1800000:
	mapannounce "bat_a01", "Marollo VII : Guillaume Marollo, Croix Marollo! Marollo followers!",bc_map,"0x99CC00";
	end;

OnTimer1803000:
	mapannounce "bat_a01", "Marollo VII : Both camps are competitive, so no camp would be destroyed easily. That means the Marollo kingdoms will never be defeated!",bc_map,"0x99CC00";
	end;

OnTimer1808000:
	mapannounce "bat_a01", "Marollo VII : I think we'd better terminate the battle, and call it a draw.",bc_map,"0x99CC00";
	end;

OnTimer1822000:
	mapannounce "bat_a01", "Marollo VII : Hold your royalty and faith for a moment, and let's settle up the battle of Tierra Gorge.",bc_map,"0x99CC00";
	end;

OnTimer1825000:
	mapannounce "bat_a01", "Axl Rose, Swandery : Yes sir.",bc_map,"0x99CC00";
	end;

OnTimer1830000:
	mapwarp "bat_a01","bat_room",154,150;
	donpcevent "countdown#bat_a01::Onstop";
	end;
}

/*
bat_a01,351,75,3	script	Croix Camp Soldier#bat_a01_guide	934,{
	mes "Loading...";
	close;
}

bat_a01,356,326,3	script	Guillaume Camp Soldier#bat_a01_guide	934,{
	mes "Loading...";
	close;
}
*/

/*
bat_a01,1,1,3	script	Release all#a01	81,{
	input .@input,0,2000;
	if (.@input == 0) {
		mes "Cancelled.";
		close;
	}
	else if (.@input == 1854) {
		mes "May I help you?";
		next;
		switch(select("Release all.:Cancel.")) {
		case 1:
			mes "Bye.";
			close2;
			mapwarp "bat_a01","bat_room",154,150;
			end;
		case 2:
			mes "Cancelled.";
		}
	}
}
*/

bat_a01	mapflag	battleground
bat_a01	mapflag	nomemo
bat_a01	mapflag	nosave	SavePoint
bat_a01	mapflag	noteleport
bat_a01	mapflag	nowarp
bat_a01	mapflag	nowarpto
bat_a01	mapflag	noreturn
bat_a01	mapflag	nobranch
bat_a01	mapflag	nopenalty