summaryrefslogtreecommitdiff
path: root/npc/other/poring_war.txt
blob: 8605c159513022b7835171cea4c949ee56ba4214 (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
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
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
//===== rAthena Script ======================================= 
//= Poring War
//===== By: ================================================== 
//= Kisuka
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= [Aegis Conversion]
//= Poring War
//===== Additional Comments: ================================= 
//= 1.0 First version. [Kisuka][5511]
//= 1.1 Fixed some typos/bugs. [CalciumKid]
//============================================================

// Poring War Recruiter
//============================================================
prt_fild08,159,371,3	script	Poring War Recruiter#wop	909,{
	mes "[Poring]";
	mes "!!!!!";
	mes "Whoa-! Humans, ring~!!";
	mes "Gotta hide, hide, right~!";
	mes "They're tempting us with Jellopy! Don't be fooled!";
	next;
	mes "[Poring]";
	mes "Hwak!!";
	mes "Ring, Ring~ What's wrong with you people..?";
	mes "Hey.. Hey, there. Hu.. Humans...";
	mes "Poring..";
	next;
	mes "[Poring]";
	mes "I.. I've got some interesting work for ya.. Would you be interested?";
	mes "We.. we porings need lots and lots of brave human worriers, ring~.";
	next;
	switch(select("Alright, I'm with you!:What's that?:Ignore")) {
	case 1:
		if (Zeny > 499) {
			mes "[Poring]";
			mes "Oh, and there's an entrance fee of 500 zeny, ring.";
			mes "Have a good time, ring.";
			delitem 7773,countitem(7773);
			set Zeny,Zeny-500;
			close2;
			warp "poring_w01",112,138;
			end;
		}else{
			mes "[Poring]";
			mes "Oh, and there's an entrance fee of 500 zeny, ring.";
			mes "...........";
			mes "Hey, that's life, ring. We need zeny too you know~!";
			close;
		}
	case 2:
		mes "[Poring]";
		mes "That's.. because there's been a.. slight confliction in our.. Ring Society..";
		mes "So we've got to.............have a battle to settle this problem..";
		mes "You'll see when you get there!";
		close;
	case 3:
		mes "[Poring]";
		mes "Huhhhh! Hu.. Humans are so cold and cruel!!!";
		close;
	}
}

// Poring Vending Machine
//============================================================
poring_w01,100,97,3	script	Poring Vending Machine#w	909,{
	if (checkweight(714,3) == 0) {
		mes "- You are carrying too much items in order to use the Vending Machine. -";
		close;
	}
	mes "It's a vending machine. You can use Poring Coints to purchase.";
	next;
	if(select("Purchase.:Read the descriptions of goods.") == 1) {
		mes "You need Poring Coins to purchase items.";
		mes "You cannot use any zeny.";
		mes "Item name - Price Poring Coin(P.Co)";
		next;
		switch(select("Marvelous Medal - 4 P.Co:Union of Tribe - 20 P.Co:Poring Box - 30 P.Co:Next")) {
		case 1:
			callsub S_PoringVending,7515,4;
		case 2:
			callsub S_PoringVending,658,20;
		case 3:
			callsub S_PoringVending,12109,30;
		case 4:
			mes "This is a special item.";
			mes "Item name - Poring Coin(P.Co)";
			next;
			switch(select("Wild Rose - 15 P.Co:Doppelganger - 20 P.Co:Egnigem Cenia - 20 P.Co:Collection Item")) {
			case 1:
				callsub S_PoringVending,12300,15;
			case 2:
				callsub S_PoringVending,12301,20;
			case 3:
				callsub S_PoringVending,12302,20;
			case 4:
				mes "Figures of 1st Job Class Characters including Novice are finally on sale!";
				mes "Figures except for Novice are all ^4d4dffCharacter bound items^000000.";
				mes "Please be aware before you make a purchase~";
				mes "Item name - Poring Coin(P.Co)";
				next;
				switch(select("Novice Figure - 50 P.Co:Swordman Figure - 100 P.Co:Thief Figure - 100 P.Co:Merchant Figure - 100 P.Co:Acolyte Figure - 100 P.Co:Mage Figure - 100 P.Co:Archer Figure - 100 P.Co:Random Draw - 50 P.Co:Cancel")) {
				case 1:
					callsub S_PoringVending,2765,50;
				case 2:
					callsub S_PoringVending,2766,100;
				case 3:
					callsub S_PoringVending,2770,100;
				case 4:
					callsub S_PoringVending,2771,100;
				case 5:
					callsub S_PoringVending,2767,100;
				case 6:
					callsub S_PoringVending,2768,100;
				case 7:
					callsub S_PoringVending,2769,100;
				case 8:
					mes "You have chosen Random Draw.";
					mes "1 of 7 diffeent kinds of figures will be selected.";
					next;
					if(select("Draw:Cancel") == 1) {
						if(countitem(7539) >= 50) {
							mes "Insert the Poring coin and pull the lever.";
							mes "Click~ The item came out of the mouth of the Poring with a rumbling sound.";
							mes "What could it be?";
							next;
							switch(rand(1,17)) {
							case 5: set .@Random_Figure,2766; break; // Swordman_Figure
							case 6: set .@Random_Figure,2767; break; // Acolyte_Figure
							case 8: set .@Random_Figure,2770; break; // Thief_Figure
							case 11: set .@Random_Figure,2771; break; // Merchant_Figure
							case 13: set .@Random_Figure,2769; break; // Archer_Figure
							case 14: set .@Random_Figure,2768; break; // Mage_Figure
							default: set .@Random_Figure,2765; break; // Novice_Figure
							}
							mes "A nice " + getitemname(.@Random_Figure) + ".";
							delitem 7539,50; // Poring_Coin
							getitem .@Random_Figure,1;
							close;
						}else{
							mes "Not enough coins.";
							close;
						}
					}
					mes "["+strcharinfo(0)+"]";
					mes "... Maybe next time...";
					close;
				case 9:
					mes "["+strcharinfo(0)+"]";
					mes "... Maybe next time...";
					close;
				}
			}
		}
	}
	mes "Selling Item List";
	mes "====================";
	mes "[Marvelous Medal]";
	mes " : A medal made of special metal only produced in Hugel.";
	mes " ";
	mes "[Union of Tribe]";
	mes " : A statue with the image of a strong union of Tribes. People believe watching this statue actually helps strengthen the relationships between Tribes.";
	mes " ";
	mes "[Poring Box]";
	mes " : A box wrapped with Poring patterned wrapping paper. Something's inside.";
	mes " ";
	mes "[Wild Rose]";
	mes " : Your friend Wild Rose will come and help you.";
	mes " ";
	mes "[Mr. Doppel]";
	mes " : A young nobe, Doppelganger will come and help you.";
	mes " ";
	mes "[Egnigem Cenia]";
	mes " : A beautiful girl, Egnigem Cenia from Somatology Laboratory, is going to come and help you.";
	mes " ";
	mes "[Novice Figure]";
	mes " : A fine figure of a Novice. Can be equiped as an '^4d4dffaccessory^000000'.";
	mes " HP + 70, extra effect of HP + 30 when equipped by a Novices.";
	mes " ";
	mes "[Swordman Figure]";
	mes " : A nice figure of a Swordman. Can be equipped as an '^4d4dffaccessory^000000'.";
	mes " VIT + 1, extra effect of DEF + 2 when equipped by Swordman classes.";
	mes " ";
	mes "[Merchant Figure]";
	mes " : A fine figure of a Merchant. Can be equipped as an '^4d4dffaccessory^000000'.";
	mes " STR + 1, extra effect of CRI + 5 when equipped by Merchant classes.";
	mes " ";
	mes "[Thief Figure]";
	mes " : A fine Figure of a Thief. Can be equipped as an '^4d4dffaccessory^000000'.";
	mes " AGI + 1, extra effectASPD + 3% when equipped by Thief classes.";
	mes " ";
	mes "[Mage Figure]";
	mes " : A fine figure of a Mage. Can be equipped as an '^4d4dffaccessory^000000'.";
	mes " INT + 1, an extra SP Recovery increase by 5% when equipped by Mage classes.";
	mes " ";
	mes "[Acolyte Figure]";
	mes " : A fine figure of an Acolyte. Can be equipped as an '^4d4dffaccessory^000000'.";
	mes " INT + 1, extra effct of SP + 50 when equipped by Acolyte classes.";
	mes " ";
	mes "[Archer Figure]";
	mes " : A fine figure of an Archer. Can be equipped as an '^4d4dffaccessory^000000'.";
	mes " DEX + 1, extra effct of ATK + 10 when equipped by Archer classes.";
	close;
	end;

S_PoringVending:
	if(countitem(7539) >= getarg(1)) {
		mes "Click~ The item came out of the mouth of the Poring with a rumbling sound.";
		delitem 7539,getarg(1); // Poring_Coin
		getitem getarg(0),1;
	}else{
		mes "Not enough coins.";
	}
	close;
}

// Information
//============================================================
poring_w01,96,97,3	script	Sweet Devi#wop	738,{
	if (MaxWeight-Weight < 2000 || checkweight(1201,1) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	mes "[Deviruchi]";
	mes "Oh, Another Human Warrior!";
	mes "How come so many humans want to join our Poring War these days?";
	next;
	mes "[Deviruchi]";
	mes "Well, whatever, as long as I make money out of it~";
	mes "Ok, Warriors-! Hahaha How badly have I wanted to shout it out~!!";
	next;
	mes "[Deviruchi]";
	mes "You, brave warrior, are you ready to join the holy battle of Angeling and Deviling?";
	next;
	mes "[Deviruchi]";
	mes "Hehehee, I feel kinda shy now.";
	mes "Anyway, human. Do you want to join our Poring War?";
	next;
	switch(select("Am I qualified to join?:How do I join the war?:Cancel:Let me out of here, please!")) {
	case 1:
		mes "[Deviruchi]";
		mes "No racial discrimination! Anyone can join if they're willing to fight.";
		mes "But the weird thing is that you humans who used to be our greatest enemies are now our participants.";
		next;
		mes "[Deviruchi]";
		mes "If you really want to fight in the war or whatever.. the Team recruiter's right there.";
		mes "Also, it's totally up to you which team you want to fight for~";
		close;
	case 2:
		mes "[Deviruchi]";
		mes "It's simple. You see that Team recruiting room?";
		mes "Each team is composed of 5 people. As soon as 5 members are collected, the battle starts.";
		mes "You win if you kill the other team's Porings.";
		next;
		mes "[Deviruchi]";
		mes "This also means that the battle needs the total of 10 members.";
		next;
		mes "[Deviruchi]";
		mes "When all 10 members are collected, those participants get to choose a team. Each team then should have 5 members who are in the SAME party.";
		next;
		mes "[Deviruchi]";
		mes "So, finally, half of the members joins the Angeling Team";
		mes "and the other half joins the Deviling Team.";
		next;
		mes "[Deviruchi]";
		mes "If you're a member of the Angeling Team, your goal is to kill the Devilings at the other team's base and vice versa.";
		next;
		mes "[Deviruchi]";
		mes "Each team should try killing both Porings in the other team's base. After killing one Poring, you have a limited time to kill the other Poring. Otherwise, the one you killed will come back alive.";
		next;
		mes "[Deviruchi]";
		mes "It's sort of like a capture the flag game but with Porings instead. Understood?";
		mes "And you need to make sure you know who's in which party.";
		close;
	case 3:
		mes "[" + strcharinfo(0) + "]";
		mes "hmm, I see.";
		close;
	case 4:
		mes "[Deviruchi]";
		mes "Oh, Alright. I can help.";
		mes "I'll send you back to your savepoint.";
		close2;
		if(WoP_SaveMap$ != "") {
			savepoint WoP_SaveMap$,WoP_SaveMap_X,WoP_SaveMap_Y;
			set WoP_SaveMap$,"";
			set WoP_SaveMap_X,0;
			set WoP_SaveMap_Y,0;
		}
		warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
		end;
	}

OnPCLogoutEvent:
	getmapxy .@map$,.@x,.@y,0;
	if (.@map$ == "poring_w02") {
		if(WoP_SaveMap$ != "") {
			savepoint WoP_SaveMap$,WoP_SaveMap_X,WoP_SaveMap_Y;
			set WoP_SaveMap$,"";
			set WoP_SaveMap_X,0;
			set WoP_SaveMap_Y,0;
		}
		delitem 7773,countitem(7773);
		set wop_team,0;
	}
	end;

OnPCDieEvent:
	getmapxy .@map$,.@x,.@y,0;
	if (.@map$ == "poring_w02" && wop_team) {
		if(getsavepoint(0) != "poring_w02" && WoP_SaveMap$ == "") {
			set WoP_SaveMap$,getsavepoint(0);
			set WoP_SaveMap_X,getsavepoint(1);
			set WoP_SaveMap_Y,getsavepoint(2);
		}
		if (wop_team == 1) {
			savepoint "poring_w02",rand(44,51),rand(76,87);
		}
		if (wop_team == 2) {
			savepoint "poring_w02",rand(146,153),rand(76,87);
		}
	}
	end;

OnPCKillEvent:
	getmapxy .@map$,.@x,.@y,0;
	if (.@map$ == "poring_w02" && wop_team) {
		getnameditem 7773,rid2name(killedrid);
	}
	end;

OnInit:
	removemapflag "poring_w02",mf_partylock;
	removemapflag "poring_w02",mf_pvp;
	removemapflag "poring_w02",mf_pvp_noguild;
	removemapflag "poring_w02",mf_pvp_nocalcrank;
	set $@wop_teamcount,0;
	set $@wop_deadcount_a,0;
	set $@wop_deadcount_d,0;
	set $@wop_team_a,0;
	set $@wop_team_d,0;
	set $@wop_doorcount_a,0;
	set $@wop_doorcount_d,0;
	end;
}

// Poring Registers
//============================================================
poring_w01,91,97,3	script	Poring#wop_door_all	1002,{
	end;
	
OnInit:
	waitingroom "[Recruiting 10 Battle Participants]",10,"Poring#wop_door_all::OnStartArena",10,500,9,99;
	enablewaitingroomevent;
	end;

OnStartArena:
	warpwaitingpc "poring_w01",101,70;
	donpcevent "#wop_warp_rtry::OnReady";
	disablewaitingroomevent;
	end;

OnEnable:
	enablewaitingroomevent;
	end;

OnDisable:
	disablewaitingroomevent;
	end;
}

poring_w01,91,68,5	script	Poring#wop_door_a	1002,{
	end;

OnInit:
	waitingroom "[Angeling Team Recruiter]",5,"Poring#wop_door_a::OnStartArena",5,0,9,99;
	enablewaitingroomevent;
	end;

OnStartArena:
	warpwaitingpc "poring_w02",26,175;
	disablewaitingroomevent;
	if($@wop_teamcount == 0) {
		set $@wop_teamcount,1;
		donpcevent "Poring#wop_door_d::OnDevilingStart";
		donpcevent "#wop_warp_rtry::OnStop";
	}
	else if($@wop_teamcount == 1) {
		donpcevent "#wop_master::OnStart";
		donpcevent "Poring#wop_door_d::OnStop";
		stopnpctimer;
	}
	end;

OnEnable:
	enablewaitingroomevent;
	end;

OnDisable:
	disablewaitingroomevent;
	end;

OnAngelingStart:
	initnpctimer;
	end;

OnStop:
	stopnpctimer;
	end;

OnTimer1000:
	mapannounce "poring_w01","The greatest battle of all time, the recruitment for the Deviling Team is over, ring!",0,0xf08080;
	end;

OnTimer4000:
	mapannounce "poring_w01","Join the proud Angeling Team with angel wings!!",0,0xf08080;
	end;

OnTimer8000:
	mapannounce "poring_w01","You got one minute to join the Angeling Team. The battle will be cancelled in 1 minute if not ready!!",0,0xf08080;
	donpcevent "#wop_master::OnAngelingWarn";
	end;

OnTimer13000:
	mapannounce "poring_w01","This is the time to join the great Angeling Team, ring!",0,0xf08080;
	end;

OnTimer20000:
	mapannounce "poring_w01","This battle is the proud of the porings! Ring! Join the Angeling Team!!",0,0xf08080;
	end;

OnTimer30000:
	mapannounce "poring_w01","We don't have much time, ring. Don't let the Devilings contaminate you!",0,0xf08080;
	end;

OnTimer40000:
	mapannounce "poring_w01","Come! Join us!",0,0xf08080;
	end;

OnTimer50000:
	mapannounce "poring_w01","What a pitty! I can't believe that brave warriors are missing!",0,0xf08080;
	end;

OnTimer55000:
	mapannounce "poring_w01","Deviling: You can't leave us waiting for ever!! We're going to cancel the battle, ring!",0,0x33FF66;
	end;

OnTimer55100:
	donpcevent "Poring#wop_door_a::OnDisable";
	donpcevent "Poring#wop_door_d::OnDisable";
	donpcevent "Poring#wop_door_all::OnDisable";
	set $@wop_teamcount,0;
	donpcevent "#wop_master::OnAngelingEnd";
	donpcevent "#wop_warp_rtry::OnEnable";
	end;

OnTimer58000:
	mapannounce "poring_w01","...There is nothing we can do, ring... Lets cheer for the next one, ring.",0,0xf08080;
	donpcevent "#wop_master::OnReset";
	stopnpctimer;
	end;
}

poring_w01,112,68,3	script	Poring#wop_door_d	1002,{
	end;

OnInit:
	waitingroom "[Deviling Team Recruiter]",5,"Poring#wop_door_d::OnStartArena",5,0,9,99;
	enablewaitingroomevent;
	end;

OnStartArena:
	warpwaitingpc "poring_w02",170,175;
	disablewaitingroomevent;
	if($@wop_teamcount == 0) {
		set $@wop_teamcount,1;
		donpcevent "Poring#wop_door_a::OnAngelingStart";
		donpcevent "#wop_warp_rtry::OnStop";
	}
	else if($@wop_teamcount == 1) {
		donpcevent "#wop_master::OnStart";
		donpcevent "Poring#wop_door_a::OnStop";
		stopnpctimer;
	}
	end;

OnEnable:
	enablewaitingroomevent;
	end;

OnDisable:
	disablewaitingroomevent;
	end;

OnDevilingStart:
	initnpctimer;
	end;

OnStop:
	stopnpctimer;
	end;

OnTimer1000:
	mapannounce "poring_w01","No more good people, the recruitment for the Angeling Team is over, ring!",0,0x33FF66;
	end;

OnTimer4000:
	mapannounce "poring_w01","Nice members of the Deviling Team! Lets gather, ring!!",0,0x33FF66;
	end;

OnTimer8000:
	mapannounce "poring_w01","The battle will be cancelled if the members aren't recruited in one minute!!",0,0x33FF66;
	donpcevent "#wop_master::OnDevilingWarn";
	end;

OnTimer13000:
	mapannounce "poring_w01","This is the time to join the brave Deviling Team, ring!",0,0x33FF66;
	end;

OnTimer20000:
	mapannounce "poring_w01","D,E,V,I,L,I,N,G! Deviling Team! Come and join us!",0,0x33FF66;
	end;

OnTimer30000:
	mapannounce "poring_w01","There ain't much time left, ring! If you wish to became a member of Deviling Team, Come and Join!",0,0x33FF66;
	end;

OnTimer40000:
	mapannounce "poring_w01","D,E,V,I,L,I,N,G! Deviling Team! Come and Join us!!",0,0x33FF66;
	end;

OnTimer50000:
	mapannounce "poring_w01","What a pitty! I can't believe there aren't enough players!",0,0x33FF66;
	end;

OnTimer55000:
	mapannounce "poring_w01","Angeling: We got no time to wait, stupid Deviling! The battle has been cancelled, ring!",0,0xf08080;
	end;

OnTimer55100:
	donpcevent "Poring#wop_door_a::OnDisable";
	donpcevent "Poring#wop_door_d::OnDisable";
	donpcevent "Poring#wop_door_all::OnDisable";

	set $@wop_teamcount,0;
	donpcevent "#wop_master::OnDevilingEnd";
	donpcevent "#wop_warp_rtry::OnEnable";
	end;

OnTimer58000:
	mapannounce "poring_w01","...Ughhhhhh... Tell me that isn't happening, ring! Right, Be ready for the next one, ring!!",0,0x33FF66;
	donpcevent "#wop_master::OnReset";
	stopnpctimer;
	end;
}

poring_w01,103,70,0	script	#wop_warp_rtry	139,13,13,{
	end;

OnInit:
	disablenpc "#wop_warp_rtry";
	end;

OnEnable:
	enablenpc "#wop_warp_rtry";
	end;

OnDisable:
	disablenpc "#wop_warp_rtry";
	end;

OnReady:
	initnpctimer;
	end;

OnStop:
	stopnpctimer;
	end;

OnTouch:
	warp "poring_w01",112,138;
	end;

OnTimer3000:
	mapannounce "poring_w01","Porings: I am giving you 1 minute. Choose your team, ring!",0,0xf08080;
	end;

OnTimer33000:
	mapannounce "poring_w01","Porings: 30 seconds left! Come on, Choose a team now, ring?!!",0,0xf08080;
	end;

OnTimer58000:
	mapannounce "poring_w01","Porings: You sure you're a warrior?!!! I'm disappointed, ring!",0,0xf08080;
	end;

OnTimer60000:
	mapannounce "poring_w01","The battle has been canceled since not all teams are full!!",0,0xf08080;
	end;

OnTimer61000:
	enablenpc "#wop_warp_rtry";
	end;

OnTimer65000:
	disablenpc "#wop_warp_rtry";
	donpcevent "#wop_master::OnReset";
	stopnpctimer;
	end;
}

// Mr. Doppel
//============================================================
poring_w02,26,181,3	script	Mr. Doppel#wop_team_a	739,{
	if (checkweight(714,3) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	set .@a_tname$,getpartyname($@wop_team_a);
	set .@pname$,getpartyname(getcharid(1));
	if($@wop_team_a != 0 && $@wop_team_a == getcharid(1)) {
		mes "[Mr. Doppel]";
		mes "So, everyone joined the party?";
		mes "The name of the party is... " + .@pname$ + ", right?";
		mes "I'll transfer you to the battle staging area.";
		next;
		switch(select("No! Wait!:Go to the staging area.")) {
		case 1:
			mes "[Mr. Doppel]";
			mes "What is it now?";
			mes "Can't you have a little more consideration?";
			mes "You don't have much time. Decide now!";
			next;
			mes "[Mr. Doppel]";
			mes "If you don't get there in time, you won't make it to the battle.";
			close;
		case 2:
			if((getpartyleader(getcharid(1),2) == getcharid(0))) {
				mes "[Mr. Doppel]";
				mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
				next;
				switch(select("Very well. I'll be the last.:I am the last. Send me to the battlefield.")) {
				case 1:
					mes "[Mr. Doppel]";
					mes "First, make sure all the members are in your party.";
					close;
				case 2:
					mes "[Mr. Doppel]";
					mes "Very well. Nice you have done everything on time.";
					delitem 7773,countitem(7773);
					close2;
					set wop_team,0;
					warp "poring_w02",44,82;
					end;
				}
			}
			else {
				mes "[Mr. Doppel]";
				mes "Right. I'm gonna send you to the battle staging area.";
				mes "Wait for all the other party members there.";
				delitem 7773,countitem(7773);
				close2;
				set wop_team,0;
				warp "poring_w02",44,82;
				end;
			}
		}
	}
	else {
		if((getpartyleader(getcharid(1),2) == getcharid(0))) {
			if($@wop_team_a == 0) {
				mes "[Mr. Doppel]";
				mes "So, you are the party leader of Angeling Team.";
				mes "Are you sure all the members are in your party?";
				mes "First, lets register your party name, after, we'll check the members.";
				next;
				mes "[Mr. Doppel]";
				mes "Lets see... The name of the party is...";
				mes " ";
				mes "^4d4dff " + .@pname$ + " ^000000";
				mes " ";
				mes "Right? That is the name you wish?";
				next;
				switch(select("No! You're wrong.:Yes. I would like to register that name.:Cancel")) {
				case 1:
					mes "[Mr. Doppel]";
					mes "Hey, I don't have all day! Make your mind and register as fast as you can.";
					mes "Don't forget to let all the members join the party. Only the members of a registered party can join the battle.";
					close;
				case 2:
					mes "[Mr. Doppel]";
					mes "So, I'll register your party name as - " +.@pname$ + " -.";
					mes "Now, Tell your ^4d4dffmembers to confirm your party^000000.";
					mes "I'll send you to the battlefield as soon as I confirm your party.";
					set $@wop_team_a,getcharid(1);
					mapannounce "poring_w02","The registration of the Angeling Team has been confirmed. The party members must confirm their team with Mr. Doppel.",0,0x33FF66;
					close;
				case 3:
					mes "[Mr. Doppel]";
					mes "The clock is ticking. Make up your mind and register as soon as you can.";
					close;
				}
			}
			else {
				mes "[Mr. Doppel]";
				mes "So, you are the leader of the party.";
				mes "Haven't you finished the party registration yet?";
				mes "You must stay on the one that has been registered!";
				next;
				mes "[Mr. Doppel]";
				mes "The name of the party is ";
				mes " " + .@a_tname$ + " ";
				mes "Please, confirm.";
				close;
			}
		}
		else {
			mes "[Mr. Doppel]";
			mes "If you aren't a registered member of the party, you can't join the battle.";
			next;
			mes "[Mr. Doppel]";
			mes "I'll check again and, after the registeration of the party name, you'll be sent to the battlefield.";
			mes "We must stay together as a party, since this is a team game. Otherwise, we'll have problems.";
			close;
		}
	}

OnInit:
	disablenpc "Mr. Doppel#wop_team_a";
	end;

OnEnable:
	enablenpc "Mr. Doppel#wop_team_a";
	end;

OnDisable:
	disablenpc "Mr. Doppel#wop_team_a";
	end;
}

poring_w02,170,181,3	script	Mr. Doppel#wop_team_d	739,{
	if (checkweight(714,3) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	set .@d_tname$,getpartyname($@wop_team_d);
	set .@pname$,getpartyname(getcharid(1));
	if($@wop_team_d != 0 && $@wop_team_d == getcharid(1)) {
		mes "[Mr. Doppel]";
		mes "So, everyone joined the party?";
		mes "The name of the party is... " + .@pname$ + ", right?";
		mes "I'll transfer you to the battle staging area.";
		next;
		switch(select("No! Wait!:Go to the staging area.")) {
		case 1:
			mes "[Mr. Doppel]";
			mes "What is it now?";
			mes "Can't you have a little more consideration?";
			mes "You don't have much time. Decide now!";
			next;
			mes "[Mr. Doppel]";
			mes "If you don't get there in time, you won't make it to the battle.";
			close;
		case 2:
			if((getpartyleader(getcharid(1),2) == getcharid(0))) {
				mes "[Mr. Doppel]";
				mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
				next;
				switch(select("Very well. I'll be the last.:I am the last. Send me to the battlefield.")) {
				case 1:
					mes "[Mr. Doppel]";
					mes "First, make sure all the members are in your party.";
					close;
				case 2:
					mes "[Mr. Doppel]";
					mes "Very well. Nice you have done everything on time.";
					delitem 7773,countitem(7773);
					close2;
					set wop_team,0;
					warp "poring_w02",153,82;
					end;
				}
			}else{
				mes "[Mr. Doppel]";
				mes "Right. I'm gonna send you to the battle staging area.";
				mes "Wait for all the other party members there.";
				delitem 7773,countitem(7773);
				close2;
				set wop_team,0;
				warp "poring_w02",153,82;
				end;
			}
		}
	}else{
		if((getpartyleader(getcharid(1),2) == getcharid(0))) {
			if($@wop_team_d == 0) {
				mes "[Mr. Doppel]";
				mes "So, you are the party leader of Deviling Team.";
				mes "Are you sure all the members are in your party?";
				mes "First, lets register your party name, after, we'll check the members.";
				next;
				mes "[Mr. Doppel]";
				mes "Lets see... The name of the party is...";
				mes " ";
				mes "^4d4dff " + .@pname$ + " ^000000";
				mes " ";
				mes "Right? That is the name you wish?";
				next;
				switch(select("No! You're wrong.:Yes. I would like to register that name.:Cancel")) {
				case 1:
					mes "[Mr. Doppel]";
					mes "Hey, I don't have all day! Make your mind and register as fast as you can.";
					mes "Don't forget to let all the members join the party. Only the members of a registered party can join the battle.";
					close;
				case 2:
					mes "[Mr. Doppel]";
					mes "So, I'll register your party name as - " + .@pname$ + " -.";
					mes "Now, Tell your ^4d4dffmembers to confirm your party^000000.";
					mes "I'll send you to the battlefield as soon as I confirm your party.";
					set $@wop_team_d,getcharid(1);
					mapannounce "poring_w02","The registration of the Deviling Team has been confirmed. The party members must confirm their team with Mr. Doppel.",0,0x33FF66;
					close;
				case 3:
					mes "[Mr. Doppel]";
					mes "The clock is ticking. Make up your mind and register as soon as you can.";
					close;
				}
			}else{
				mes "[Mr. Doppel]";
				mes "So, you are the leader of the party.";
				mes "Haven't you finished the party registration yet?";
				mes "You must stay on the one that has been registered!";
				next;
				mes "[Mr. Doppel]";
				mes "The name of the party is ";
				mes " " + .@d_tname$ + " ";
				mes "Please, confirm.";
				close;
			}
		}else{
			mes "[Mr. Doppel]";
			mes "If you aren't a registered member of the party, you can't join the battle.";
			next;
			mes "[Mr. Doppel]";
			mes "I'll check again and, after the registeration of the party name, you'll be sent to the battlefield.";
			mes "We must stay together as a party, since this is a team game. Otherwise, we'll have problems.";
			close;
		}
	}

OnInit:
	disablenpc "Mr. Doppel#wop_team_d";
	end;

OnEnable:
	enablenpc "Mr. Doppel#wop_team_d";
	end;

OnDisable:
	disablenpc "Mr. Doppel#wop_team_d";
	end;
}

poring_w02,1,1,0	script	#wop_master	-1,{
	end;

OnReset:
	removemapflag "poring_w02",mf_partylock;
	removemapflag "poring_w02",mf_pvp;
	removemapflag "poring_w02",mf_pvp_noguild;
	removemapflag "poring_w02",mf_pvp_nocalcrank;
	mapwarp "poring_w02","poring_w01",112,138;
	donpcevent "#wop_angellium1::OnReset";
	donpcevent "#wop_angellium2::OnReset";
	donpcevent "#wop_devillium1::OnReset";
	donpcevent "#wop_devillium2::OnReset";
	set $@wop_team_a,0;
	set $@wop_team_d,0;
	set $@wop_deadcount_a,0;
	set $@wop_deadcount_d,0;
	set $@wop_teamcount,0;
	set $@wop_doorcount_a,0;
	set $@wop_doorcount_d,0;
	donpcevent "#wop_warp_a::OnDisable";
	donpcevent "#wop_warp_d::OnDisable";
	donpcevent "#wop_warp_rtry::OnDisable";
	donpcevent "Poring#wop_door_a::OnEnable";
	donpcevent "Poring#wop_door_d::OnEnable";
	donpcevent "Poring#wop_door_all::OnEnable";
	stopnpctimer;
	end;

Onstart:
	initnpctimer;
	end;

OnAngelingWarn:
	mapannounce "poring_w02","Deviling Team Recruitment is complete. The battle will be canceled automatically if the Angeling Team Recruitment isn't ready in 1 minute.",0,0xf08080;
	end;

OnDevilingWarn:
	mapannounce "poring_w02","Angeling Team Recruitment is complete. The battle will be canceled automatically if the Deviling Team Recruitment isn't ready in 1 minute.",0,0xf08080;
	end;

OnDevilingEnd:
	mapannounce "poring_w02","Deviling Team Recruitment failed. The battle will be canceled shortly.",0,0xf08080;
	end;

OnAngelingEnd:
	mapannounce "poring_w02","Angeling Team Recruitment failed. The battle will be canceled shortly.",0,0xf08080;
	end;

OnStop:
	stopnpctimer;
	end;

OnAngelingWin:
	removemapflag "poring_w02",mf_partylock;
	removemapflag "poring_w02",mf_pvp;
	removemapflag "poring_w02",mf_pvp_noguild;
	removemapflag "poring_w02",mf_pvp_nocalcrank;
	mapannounce "poring_w02","Mr. Doppel: Angeling Team of party " + getpartyname($@wop_team_a) + " won the battle!",0,0xf08080;
	donpcevent "Deviruchi#wop_endmaster::OnEnable";
	stopnpctimer;
	end;

OnDevilingWin:
	removemapflag "poring_w02",mf_partylock;
	removemapflag "poring_w02",mf_pvp;
	removemapflag "poring_w02",mf_pvp_noguild;
	removemapflag "poring_w02",mf_pvp_nocalcrank;
	mapannounce "poring_w02","Mr. Doppel: Deviling Team of party " + getpartyname($@wop_team_d) + " won the battle!",0,0xf08080;
	donpcevent "Deviruchi#wop_endmaster::OnEnable";
	stopnpctimer;
	end;

OnTimer5000:
	mapannounce "poring_w02","Mr. Doppel: Welcome to all the warriors that have come to fight the battle.",0,0xf08080;
	donpcevent "Mr. Doppel#wop_team_a::OnEnable";
	donpcevent "Mr. Doppel#wop_team_d::OnEnable";
	end;

OnTimer8000:
	mapannounce "poring_w02","Mr. Doppel: Each member of the team must join the group, and the leader will register their team name.",0,0xf08080;
	end;

OnTimer12000:
	mapannounce "poring_w02","Mr. Doppel: You have 50 seconds. Join the group, register it's name and go to the battlefield.",0,0xf08080;
	end;

OnTimer32000:
	mapannounce "poring_w02","Mr. Doppel: You still have 30 seconds. Join the group, register it's name and go to the battlefield.",0,0xf08080;
	end;

OnTimer62000:
	mapannounce "poring_w02","Mr. Doppel: Time is up. The rules will be explained shortly before the battle.",0,0xf08080;
	end;

OnTimer70000:
	mapannounce "poring_w02","Mr. Doppel: All ready? Let me explain the battle rules.",0,0xf08080;
	end;

OnTimer75000:
	mapannounce "poring_w02","Mr. Doppel: The Angeling Team has to protect 2 Angelings on their bases and, at the same time, eliminate the Devilings on their Deviling Team bases, and vice-versa.",0,0xf08080;
	end;

OnTimer80000:
	mapannounce "poring_w02","Mr. Doppel: Your team wins if you eliminate the 2 monsters of the enemy team. The rules are as simple as that.",0,0xf08080;
	end;

OnTimer85000:
	mapannounce "poring_w02","Mr. Doppel: But the Angelings or the Devilings return to life after a certain period of time, so it's important to eliminate the other Poring quickly, after you have eliminated the first.",0,0xf08080;
	end;

OnTimer90000:
	mapannounce "poring_w02","Mr. Doppel: Also know that those Porings are furious and will attack everybody, it doesnt matter to what team they belong.",0,0xf08080;
	end;

OnTimer95000:
	mapannounce "poring_w02","Mr. Doppel: Basically, the Porings are natural enemies of the humans, so the attack is innevitable, even if both are on the same team.",0,0xf08080;
	end;

OnTimer100000:
	mapannounce "poring_w02","Mr. Doppel: In certain areas, you will need War Badges that are obtained by eliminating members of the other team. Alright, lets begin!",0,0xf08080;
	setmapflag "poring_w02",mf_partylock;
	setmapflag "poring_w02",mf_pvp;
	setmapflag "poring_w02",mf_pvp_noguild;
	setmapflag "poring_w02",mf_pvp_nocalcrank;
	donpcevent "#wop_warp_a::OnEnable";
	donpcevent "#wop_warp_d::OnEnable";
	donpcevent "#wop_angellium1::OnAngelingSpawn";
	donpcevent "#wop_angellium2::OnAngelingSpawn";
	donpcevent "#wop_devillium1::OnDevilingSpawn";
	donpcevent "#wop_devillium2::OnDevilingSpawn";
	end;

OnTimer700000:
	mapannounce "poring_w02","Mr. Doppel: Time is up. Soon, you will be teleported to the Winners Stage.",0,0xf08080;
	removemapflag "poring_w02",mf_partylock;
	removemapflag "poring_w02",mf_pvp;
	removemapflag "poring_w02",mf_pvp_noguild;
	removemapflag "poring_w02",mf_pvp_nocalcrank;
	donpcevent "#wop_angellium1::OnReset";
	donpcevent "#wop_angellium2::OnReset";
	donpcevent "#wop_devillium1::OnReset";
	donpcevent "#wop_devillium2::OnReset";
	end;

OnTimer703000:
	donpcevent "Deviruchi#wop_endmaster::OnEnable";
	stopnpctimer;
	end;
}

poring_w02,51,82,0	script	#wop_warp_a	139,1,1,{
	end;

OnInit:
	disablenpc "#wop_warp_a";
	end;

OnEnable:
	enablenpc "#wop_warp_a";
	specialeffect EF_MAPPILLAR2,AREA,"#wop_warp_a";
	end;

OnDisable:
	disablenpc "#wop_warp_a";
	end;

OnTouch:
	set wop_team,1;
	warp "poring_w02",57,82;
	end;
}

poring_w02,146,82,0	script	#wop_warp_d	139,1,1,{
	end;

OnInit:
	disablenpc "#wop_warp_d";
	end;

OnEnable:
	enablenpc "#wop_warp_d";
	specialeffect EF_MAPPILLAR2,AREA,"#wop_warp_d";
	end;

OnDisable:
	disablenpc "#wop_warp_d";
	end;

OnTouch:
	set wop_team,2;
	warp "poring_w02",140,82;
	end;
}

// Poring Spawn
//============================================================
poring_w02,80,82,0	script	#wop_angellium1	-1,{
	end;

OnReset:
	killmonster "poring_w02","#wop_angellium1::OnMyMobDead";
	stopnpctimer;
	end;

OnAngelingSpawn:
	monster "poring_w02",80,82,"Angeling",1766,1,"#wop_angellium1::OnMyMobDead";
	end;

OnMyMobDead:
	set $@wop_deadcount_a,$@wop_deadcount_a + 1;
	if($@wop_deadcount_a == 1) {
		mapannounce "poring_w02","Mr. Doppel: The Angeling on the 1st base has been killed! 1 point lost!!",0,0x00ff00;
		initnpctimer;
	}
	else {
		donpcevent "#wop_angellium1::OnReset";
		donpcevent "#wop_angellium2::OnReset";
		donpcevent "#wop_devillium1::OnReset";
		donpcevent "#wop_devillium2::OnReset";
		donpcevent "#wop_master::OnDevilingWin";
	}
	end;

OnTimer120000:
	set $@wop_deadcount_a,$@wop_deadcount_a - 1;
	donpcevent "#wop_angellium1::OnAngelingSpawn";
	mapannounce "poring_w02","Mr. Doppel: The Angeling on the 1st base has been revived! 1 point gained!!",0,0x00ff00;
	stopnpctimer;
}

poring_w02,98,41,0	script	#wop_angellium2	-1,{
	end;

OnReset:
	killmonster "poring_w02","#wop_angellium2::OnMyMobDead";
	stopnpctimer;
	end;

OnAngelingSpawn:
	monster "poring_w02",98,41,"Angeling",1766,1,"#wop_angellium2::OnMyMobDead";
	end;

OnMyMobDead:
	set $@wop_deadcount_a,$@wop_deadcount_a + 1;
	if($@wop_deadcount_a == 1) {
		mapannounce "poring_w02","Mr. Doppel: The Angeling on the 2nd base has been killed! 1 point lost!!",0,0x00ff00;
		initnpctimer;
	}
	else {
		donpcevent "#wop_angellium1::OnReset";
		donpcevent "#wop_angellium2::OnReset";
		donpcevent "#wop_devillium1::OnReset";
		donpcevent "#wop_devillium2::OnReset";
		donpcevent "#wop_master::OnDevilingWin";
	}
	end;

OnTimer120000:
	set $@wop_deadcount_a,$@wop_deadcount_a - 1;
	donpcevent "#wop_angellium2::OnAngelingSpawn";
	mapannounce "poring_w02","Mr. Doppel: The Angeling on the 2nd base has been revived! 1 point gained!!",0,0x00ff00;
	stopnpctimer;
	end;
}

poring_w02,116,82,0	script	#wop_devillium1	-1,{
	end;

OnReset:
	killmonster "poring_w02","#wop_devillium1::OnMyMobDead";
	stopnpctimer;
	end;

OnDevilingSpawn:
	monster "poring_w02",116,82,"Deviling",1767,1,"#wop_devillium1::OnMyMobDead";
	end;

OnMyMobDead:
	set $@wop_deadcount_d,$@wop_deadcount_d + 1;
	if($@wop_deadcount_d == 1) {
		mapannounce "poring_w02","Mr. Doppel: The Deviling on the 1st base has been killed! 1 point lost!!",0,0x00ff00;
		initnpctimer;
	}
	else {
		donpcevent "#wop_devillium1::OnReset";
		donpcevent "#wop_devillium2::OnReset";
		donpcevent "#wop_devillium1::OnReset";
		donpcevent "#wop_devillium2::OnReset";
		donpcevent "#wop_master::OnAngelingWin";
	}
	end;

OnTimer120000:
	set $@wop_deadcount_d,$@wop_deadcount_d - 1;
	donpcevent "#wop_devillium1::OndevilingSpawn";
	mapannounce "poring_w02","Mr. Doppel: The Deviling on the 1st base has been revived! 1 point gained!!",0,0x00ff00;
	stopnpctimer;
	end;
}

poring_w02,98,124,0	script	#wop_devillium2	-1,{
	end;

OnReset:
	killmonster "poring_w02","#wop_devillium2::OnMyMobDead";
	stopnpctimer;
	end;

OndevilingSpawn:
	monster "poring_w02",98,124,"Deviling",1767,1,"#wop_devillium2::OnMyMobDead";
	end;

OnMyMobDead:
	set $@wop_deadcount_d,$@wop_deadcount_d + 1;
	if($@wop_deadcount_d == 1) {
		mapannounce "poring_w02","Mr. Doppel: The deviling on the 2nd base has been killed! 1 point lost!!",0,0x00ff00;
		initnpctimer;
	}
	else {
		donpcevent "#wop_devillium1::OnReset";
		donpcevent "#wop_devillium2::OnReset";
		donpcevent "#wop_devillium1::OnReset";
		donpcevent "#wop_devillium2::OnReset";
		donpcevent "#wop_master::OnAngelingWin";
	}
	end;

OnTimer120000:
	set $@wop_deadcount_d,$@wop_deadcount_d - 1;
	donpcevent "#wop_devillium2::OndevilingSpawn";
	mapannounce "poring_w02","Mr. Doppel: The deviling on the 2nd base has been revived! 1 point gained!!",0,0x00ff00;
	stopnpctimer;
}

// Deviruchi
//============================================================
poring_w02,99,201,3	script	Deviruchi#wop_endmaster	738,{
	if (MaxWeight-Weight < 2000 || checkweight(1201,1) == 0) {
		mes "- Wait a minute !! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please try again -";
		mes "- after you loose some weight. -";
		close;
	}
	set .@a_point,$@wop_deadcount_a;
	set .@d_point,$@wop_deadcount_d;
	if(getcharid(1) == $@wop_team_a) {
		if(.@a_point < .@d_point) {
			mes "[Devi]";
			mes "Good work!";
			mes "Thanks to you, we increased our chances of victory.";
			mes "Please, accept these Poring Coins as a sign of our appreciation.";
			next;
			if(wop_team == 1) {
				mes "[Devi]";
				mes "Goodbye, my human friend.";
				close2;
				getitem 7539,3; // Poring_Coin
				warp "prt_fild08",150,370;
				end;
			}
			else {
				mes "[Devi]";
				mes "Wait a minute, you look suspicious!!";
				mes "Ah, I got it! You are on the side of the Devilings?!";
				mes "You are spying on us!";
				mes "I will never forgive you!";
				close2;
				percentheal 99,0;
				warp "prt_fild08",150,370;
				end;
			}
		}
		else if(.@a_point == .@d_point) {
			mes "[Devi]";
			mes "You did the best you could.";
			mes "I' ts a shame the battle was tied...";
			mes "Even so, thanks for coming to fight for us. Please, accept this Poring Coin.";
			next;
			if(wop_team == 1) {
				mes "[Devi]";
				mes "Goodbye, my human friend.";
				close2;
				getitem 7539,1; // Poring_Coin
				warp "prt_fild08",150,370;
				end;
			}
			else {
				mes "[Devi]";
				mes "Wait a minute, you look suspicious!!";
				mes "Ah, I got it! You are on the side of the Devilings?!";
				mes "You are spying on us!";
				mes "It must have been you that made us tie the battle!!";
				mes "I will never forgive you!";
				close2;
				percentheal 99,0;
				warp "prt_fild08",150,370;
				end;
			}
		}
		else {
			if(wop_team == 1) {
				mes "[Devi]";
				mes "Well, I guess we had bad luck...";
				mes "I cant give you anything, since we lost and everything...";
				next;
				mes "[Devi]";
				mes "Goodbye, my human friend.";
				close2;
				warp "prt_fild08",150,370;
				end;
			}
			else {
				mes "[Devi]";
				mes "Wait a minute... There is a traitor here!";
				mes "Ah, I got it! You are on the side of the Devilings?!";
				mes "You are spying on us, Angelings!";
				next;
				mes "[Devi]";
				mes "You should be ashamed!";
				close2;
				percentheal 99,0;
				warp "prt_fild08",150,370;
				end;
			}
		}
	}
	else if(getcharid(1) == $@wop_team_d) {
		if (.@a_point > .@d_point) {
			mes "[Devi]";
			mes "Good work!";
			mes "Thanks to you, we increased our chances of victory.";
			mes "Please, accept these Poring Coins as a sign of our appreciation.";
			next;
			if (wop_team == 2) {
				mes "[Devi]";
				mes "Goodbye, my human friend.";
				close2;
				getitem 7539,3; // Poring_Coin
				warp "prt_fild08",150,370;
				end;
			}
			else {
				mes "[Devi]";
				mes "Wait a minute, you look suspicious!!";
				mes "Ah, I got it! You are on the side of the Angelings?!";
				mes "You are spying on us!!";
				mes "I will never forgive you!";
				close2;
				percentheal 99,0;
				warp "prt_fild08",150,370;
				end;
			}
		}
		else if(.@a_point == .@d_point) {
			mes "[Devi]";
			mes "You did the best you could.";
			mes "It's a shame the battle was tied...";
			mes "Even so, thanks for coming to fight for us. Please, accept this Poring Coin.";
			next;
			if(wop_team == 2) {
				mes "[Devi]";
				mes "Goodbye, my human friend.";
				close2;
				getitem 7539,1; // Poring_Coin
				warp "prt_fild08",150,370;
				end;
			}
			else {
				mes "[Devi]";
				mes "Wait a minute, you look suspicious!!";
				mes "Ah, I got it! You are on the side of the Angelings?!";
				mes "You are spying on us!";
				mes "It must have been you that made us tie the battle!!";
				mes "I will never forgive you!";
				close2;
				percentheal 99,0;
				warp "prt_fild08",150,370;
				end;
			}
		}
		else {
			if(wop_team == 2) {
				mes "[Devi]";
				mes "Well, I guess we had bad luck...";
				mes "I cant give you anything, since we lost and everything...";
				next;
				mes "[Devi]";
				mes "I will allow you to return to your human world.";
				close2;
				warp "prt_fild08",150,370;
				end;
			}
			else {
				mes "[Devi]";
				mes "Wait a minute, you look suspicious!!";
				mes "Ah, I got it! You are on the side of the Angelings?!";
				mes "You are spying on us, Devilings!";
				next;
				mes "[Devi]";
				mes "You should be ashamed!";
				close2;
				percentheal 99,0;
				warp "prt_fild08",150,370;
				end;
			}
		}
	}
	else {
		mes "[Devi]";
		mes "This is weird...Your party name ain't registered.";
		mes "Im sorry, but rules are rules. I can't help you if your party ain't registered.";
		close;
	}
OnInit:
	disablenpc "Deviruchi#wop_endmaster";
	end;

OnEnable:
	enablenpc "Deviruchi#wop_endmaster";
	initnpctimer;
	end;

OnDisable:
	disablenpc "Deviruchi#wop_endmaster";
	end;

OnTimer3000:
	mapwarp "poring_w02","poring_w02",99,196;
	end;

OnTimer5000:
	mapannounce "poring_w02","Mr. Doppel: Allow me to offer a souvenir to the humans that fought bravely for the Porings! Please, speak to Devi.",0,0x00ff00;
	end;

OnTimer65000:
	mapannounce "poring_w02","Mr. Doppel: Time is up! Let me teleport you.",0,0x00ff00;
	end;

OnTimer68000:
	mapwarp "poring_w02","poring_w01",112,138;
	end;

OnTimer68100:
	donpcevent "#wop_master::OnStop";
	donpcevent "#wop_devillium1::OnReset";
	donpcevent "#wop_devillium2::OnReset";
	donpcevent "#wop_angellium1::OnReset";
	donpcevent "#wop_angellium2::OnReset";
	set $@wop_team_a,0;
	set $@wop_team_d,0;
	set $@wop_deadcount_a,0;
	set $@wop_deadcount_d,0;
	set $@wop_teamcount,0;
	set $@wop_doorcount_a,0;
	set $@wop_doorcount_d,0;
	donpcevent "#wop_warp_a::OnDisable";
	donpcevent "#wop_warp_d::OnDisable";
	donpcevent "Mr. Doppel#wop_team_a::OnDisable";
	donpcevent "Mr. Doppel#wop_team_d::OnDisable";
	donpcevent "#wop_warp_rtry::OnDisable";
	donpcevent "Poring#wop_door_a::OnReset";
	donpcevent "Poring#wop_door_d::OnReset";
	donpcevent "Poring#wop_door_all::OnReset";
	stopnpctimer;
	end;
}

// Gate Guardian
//============================================================
poring_w02,99,52,0	script	Angeling Guardian#wop_da	111,{
	cutin "wop_emb0" + $@wop_doorcount_a,1;
	if($@wop_doorcount_a < 4) {
		if (wop_team == 2) {
			mes "There is a device to equip the War Badges.";
			mes "I can see the empty slots to equip the Badges.";
			next;
			switch(select("Equip War Badge.:Cancel.")) {
			case 1:
				if(countitem(7773)) {
					if($@wop_doorcount_a < 4) {
						mes "War Badge equipped.";
						delitem 7773,1; // War_Badge
						set $@wop_doorcount_a,$@wop_doorcount_a + 1;
						cutin "wop_emb0" + $@wop_doorcount_a,1;
						if($@wop_doorcount_a == 4) {
							next;
							mes "Gate Activated.";
							donpcevent "#aroom_ingate_wop::OnEnable";
							donpcevent "#aroom_outgate_wop::OnEnable";
						}
						close2;
					}
					else {
						mes "All War Badges equipped.";
						mes "No need to equip any more.";
						close2;
					}
				}
				else {
					mes "^4d4dff - War Badge missing. You can obtain a War badge by killing members of the other team. - ^000000";
					close2;
				}
				break;
			case 2:
				mes "Cancel.";
				close2;
			}
		}
		else {
			mes "There is a device to equip a War Badge.";
			mes "Be carefull to not allow the enemy to take and equip your War Badge here.";
			close2;
		}
	}
	else {
		mes "All War Badges have been equipped.";
		close2;
	}
	cutin "",255;
	end;

OnInit:
	set $@wop_doorcount_a,0;
	end;
}

poring_w02,103,52,0	script	#aroom_ingate_wop	139,1,1,{
	end;

OnInit:
	disablenpc "#aroom_ingate_wop";
	end;

OnEnable:
	enablenpc "#aroom_ingate_wop";
	end;

OnDisable:
	disablenpc "#aroom_ingate_wop";
	end;

OnTouch:
	warp "poring_w02",99,49;
	end;
}

poring_w02,93,51,0	script	#aroom_outgate_wop	139,1,1,{
	end;

OnInit:
	disablenpc "#aroom_outgate_wop";
	end;

OnEnable:
	enablenpc "#aroom_outgate_wop";
	end;

OnDisable:
	disablenpc "#aroom_outgate_wop";
	end;

OnTouch:
	warp "poring_w02",99,54;
	end;
}

poring_w02,98,113,0	script	Deviling Guardian#wop_dd	111,{
	cutin "wop_emb0" + $@wop_doorcount_d,1;
	if($@wop_doorcount_d < 4) {
		if (wop_team == 1) {
			mes "There is a device to equip the War Badges.";
			mes "I can see the empty slots to equip the Badges.";
			next;
			switch(select("Equip War Badge.:Cancel.")) {
			case 1:
				if(countitem(7773)) {
					if($@wop_doorcount_d < 4) {
						mes "War Badge equipped.";
						delitem 7773,1; // War_Badge
						set $@wop_doorcount_d,$@wop_doorcount_d + 1;
						cutin "wop_emb0" + $@wop_doorcount_d,1;
						if($@wop_doorcount_d == 4) {
							next;
							mes "Gate Activated.";
							donpcevent "#droom_ingate_wop::OnEnable";
							donpcevent "#droom_outgate_wop::OnEnable";
						}
						close2;
					}
					else {
						mes "All War Badges equipped.";
						mes "No need to equip any more.";
						close2;
					}
				}
				else {
					mes "^4d4dff - War Badge missing. You can obtain a War badge by killing members of the other team. - ^000000";
					close2;
				}
				break;
			case 2:
				mes "Cancel.";
				close2;
			}
		}
		else {
			mes "There is a device to equip a War Badge.";
			mes "Be carefull to not allow the enemy to take and equip your War Badge here.";
			close2;
		}
	}
	else {
		mes "All War Badges have been equipped.";
		close2;
	}
	cutin "",255;
	end;

OnInit:
	set $@wop_doorcount_d,0;
	end;
}

poring_w02,93,113,0	script	#droom_ingate_wop	139,1,1,{
	end;

OnInit:
	disablenpc "#droom_ingate_wop";
	end;

OnEnable:
	enablenpc "#droom_ingate_wop";
	end;

OnDisable:
	disablenpc "#droom_ingate_wop";
	end;

OnTouch:
	warp "poring_w02",98,116;
	end;
}

poring_w02,103,114,0	script	#droom_outgate_wop	139,1,1,{
	end;

OnInit:
	disablenpc "#droom_outgate_wop";
	end;

OnEnable:
	enablenpc "#droom_outgate_wop";
	end;

OnDisable:
	disablenpc "#droom_outgate_wop";
	end;

OnTouch:
	warp "poring_w02",98,111;
	end;
}

// Other NPCs
//============================================================
-	script	Angeling Side Poring#wpa	-1,{
	end;
}

-	script	Deviling Side Marin#wpd	-1,{
	end;
}

poring_w01,79,102,5	duplicate(Angeling Side Poring#wpa)	Angeling Side Poring#wa1	1002
poring_w01,80,107,5	duplicate(Angeling Side Poring#wpa)	Angeling Side Poring#wa2	1002
poring_w01,84,108,5	duplicate(Angeling Side Poring#wpa)	Angeling Side Poring#wa3	1002
poring_w01,84,112,5	duplicate(Angeling Side Poring#wpa)	Angeling Side Poring#wa4	1002
poring_w01,88,112,5	duplicate(Angeling Side Poring#wpa)	Angeling Side Poring#wa5	1002

poring_w01,114,112,3	duplicate(Deviling Side Marin#wpd)	Deviling Side Marin#wd1	1242
poring_w01,117,111,3	duplicate(Deviling Side Marin#wpd)	Deviling Side Marin#wd2	1242
poring_w01,117,108,3	duplicate(Deviling Side Marin#wpd)	Deviling Side Marin#wd3	1242
poring_w01,122,108,3	duplicate(Deviling Side Marin#wpd)	Deviling Side Marin#wd4	1242
poring_w01,121,105,3	duplicate(Deviling Side Marin#wpd)	Deviling Side Marin#wd5	1242

poring_w01,84,108,3	script	#wop_ex_1	139,3,3,{
	end;

OnTouch:
	mes "[Porings]";
	mes "P~ooooooooo -!!!";
	mes "Let's teach them a lesson, ring!";
	mes "We are no longer betting our lives for Jellopies, ring!!!";
	next;
	mes "[Porings]";
	mes "Let's go! Let's fight! Let's win, win, win!!!";
	emotion e_go,0,"Angeling Side Poring#wa1";
	emotion e_go,0,"Angeling Side Poring#wa2";
	emotion e_go,0,"Angeling Side Poring#wa3";
	emotion e_go,0,"Angeling Side Poring#wa4";
	emotion e_go,0,"Angeling Side Poring#wa5";
	next;
	if(wop_team == 1) {
		mes "[Porings]";
		mes "Ohhhhhh, there he is, the warrior that fought for us!!";
		mes "Oh my god... Nice, ring!";
		mes "Poring~ Poring~ Poooooo~";
		mes "Party of Angeling~ Popopo, Poring!";
	}
	else if(wop_team == 2) {
		mes "[Porings]";
		mes "Wait, YOU! Aren't you on the side of the Devilings?!";
		mes "Get out now! Leave!!";
		mes "Booooo~ Boo~ Boooo~";
		emotion e_omg,0,"Angeling Side Poring#wa1";
		emotion e_an,0,"Angeling Side Poring#wa2";
		emotion e_omg,0,"Angeling Side Poring#wa3";
		emotion e_an,0,"Angeling Side Poring#wa4";
		emotion e_gasp,0,"Angeling Side Poring#wa5";
	}
	else {
		mes "[Porings]";
		mes "Hey, human. How about fighting for us Porings on Angeling's side??!";
		emotion e_hlp,0,"Angeling Side Poring#wa1";
		emotion e_go,0,"Angeling Side Poring#wa2";
		emotion e_hlp,0,"Angeling Side Poring#wa3";
		emotion e_go,0,"Angeling Side Poring#wa4";
		emotion e_go,0,"Angeling Side Poring#wa5";
	}
	next;
	mes "[Porings]";
	mes "Party of Angeling~ Popopo, Poring!";
	mes "Victory~ Victory~ Pooooooo~";
	next;
	mes "- Porings are cheerfully shouting for the victory. -";
	close;
}

poring_w01,119,107,3	script	#wop_ex_2	139,3,3,{
	end;

OnTouch:
	mes "[Marins]";
	mes "Woooooaaaaaaaaaaa!";
	mes "Finally, it's time for us to teach those stupid pigs a lesson!!";
	mes "Those Porings with low-grades are all idiots!!";
	next;
	mes "[Marins]";
	mes "Let's go! Let's fight! Fight for Triumph!!!!";
	emotion e_go,0,"Deviling Side Marin#wd1";
	emotion e_go,0,"Deviling Side Marin#wd2";
	emotion e_go,0,"Deviling Side Marin#wd3";
	emotion e_go,0,"Deviling Side Marin#wd4";
	emotion e_go,0,"Deviling Side Marin#wd5";
	next;
	if(wop_team == 2) {
		mes "[Marins]";
		mes "Ohhhh... Here is the warrior that fought for us!!";
		mes "Amazing!";
		mes "This proves that humans recognize us as true monsters!!";
	}
	else if(wop_team == 1) {
		mes "[Marins]";
		mes "Wait, YOU! Aren't you on the side of the Angelings?!";
		mes "Get out now! Leave!!";
		mes "Booooo~ Boo~ Boooo~";
		emotion e_omg,0,"Deviling Side Marin#wd1";
		emotion e_an,0,"Deviling Side Marin#wd2";
		emotion e_omg,0,"Deviling Side Marin#wd3";
		emotion e_an,0,"Deviling Side Marin#wd4";
		emotion e_gasp,0,"Deviling Side Marin#wd5";
	}
	else {
		mes "[Marins]";
		mes "Hey, human. Don't you wanna fight for Deviling, the noble of darkness? What do you say?!";
		emotion e_hlp,0,"Deviling Side Marin#wd1";
		emotion e_go,0,"Deviling Side Marin#wd2";
		emotion e_hlp,0,"Deviling Side Marin#wd3";
		emotion e_go,0,"Deviling Side Marin#wd4";
		emotion e_go,0,"Deviling Side Marin#wd5";
	}
	next;
	mes "[Marins]";
	mes "The world's Best Miraculous Poring! Deviling has it all! Go, Deviling, Go-!!";
	next;
	mes "- Marins are cheerfully shouting for the victory. -";
	close;
}