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 | //===== Cronus Script =======================================
//= Guerra de Emperium - Arquivo Principal
//===== Por: ================================================
//= L0ne_W0lf
//===== Versão Atual: =======================================
//= 3.0
//===== Compatível com: =====================================
//= Cronus SVN
//===== Descrição: ==========================================
//= ---------------------------------------------------------
//= - ESSE ARQUIVO É NECESSÁRIO PARA FUNÇÕES DOS CASTELOS
//= ---------------------------------------------------------
//= - Habilita Gerente dentro dos Castelos das Guilds.
//= Nome obrigátorio visível: Agit
//= Controla diversas funções usadas dentro e fora da WoE.
//=
//= - Habilita mordomos dentro dos Castelos das Guilds que vão investir
//= na Defesa e na Economia, e invocar os guardiões, a Kafra, e entrada
//= da Sala do Mestre.
//=
//= - Modelo de Invocação dos Guardiões
//= Nome obrigátorio visível: Guardian
//= Invoca guardiões do Castelo quando seus dados são recebidos.
//=
//= - Habilita o Serviços Kafra dentro dos Castelos.
//= Nome obrigátorio visível: Kafra Staff
//= Armazém, Armazém da Guild, Serviço de Teleporte, Alugel de Carrinho.
//=
//= - Sala do Tesouro Treasure Room Protection and Chest spawning.
//= Chests will NOT be saved anymore in the event of crashes.
//= Treasures will NOT spawn on a location that already has
//= treasure chest spawned.
//===== Comentários Adicionais: ==============================
//= 2.0 Puxado e traduzido o script para Português-BR [Asus]
// - O changelog original, se encontra no fim do arquivo
//= 2.1 Script corrigido [Minos & Soulblaker]
//= 2.2 Corrigido bug dos mobs. [SoulBlaker]
// - bugid: showissue=69, os monstros já começava mortos
// - mesmo sem o Castelo estar dominado.
//= 2.3 Corrigido bug do Emperium [Asus/Soulblaker]
// - O emperium não aparece no Castelo com a WOE desligada.
//= 2.4 Corrigido respawn dos membros que não são da guild que [SoulBlaker]
// dominar o castelo.
//= 2.4a Corrigido bug, no qual o emperium não sumia se a WOE
// acabasse e o castelo não possuir dono. [Lord]
//= 2.5 Script corrigido. [Lord]
//= 2.5b Corrigido coordenadas do respaw do emperium de payg_cas01. [Lord]
//= 2.6 Readicionado delay após a destruição do Emperium [Asus]
//= 2.7 Anúncio de conquista do Castelo oficial, de acordo com o bRo [Asus]
//= 2.8 Corrigido a checagem de Zeny ao comprar guardiões. [RoM]
//= Corrigido o custo do investimento.
//= O segundo investimento agora é o quadruplo do valor do primeiro.
//= O investimento agora ocorre na mudança do dia.
//= 2.8a Revisado. [RoM]
//= 2.9 Atualizados os broadcasts. [RoM]
//= 3.0 Desativado o spawn dos monstros em caso de o clã ser desfeito
//= de acordo com padrão bRO. O spawn é ativado novamente caso a
//= opção 'castle_mob_spawn' seja ativada no arquivo 'guild.conf' [Wilk Maia]
//============================================================
// AGIT Manager Template
//============================================================
- script Gld_Agit_Manager::Gld_Agit_Manager -1,{
end;
// Load (or reload) specific information for a castle.
OnInterIfInitOnce:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
GetCastleData strnpcinfo(2),0,strnpcinfo(0) + "::OnRecvCastle";
end;
// Início da Guerra do Emperium.
OnAgitStart:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
MapRespawnGuildID strnpcinfo(2),GetCastleData(strnpcinfo(2),1),2;
GvgOn strnpcinfo(2);
// Spawn (fall through), or respawn the Emperium once it has been broken.
OnStartArena:
// OnAgitStart will fall through and spawn the Emperium.
if (strnpcinfo(2) == "aldeg_cas01") { setarray .@emproom[0],216,23; }
else if (strnpcinfo(2) == "aldeg_cas02") { setarray .@emproom[0],213,23; }
else if (strnpcinfo(2) == "aldeg_cas03") { setarray .@emproom[0],205,31; }
else if (strnpcinfo(2) == "aldeg_cas04") { setarray .@emproom[0],36,217; }
else if (strnpcinfo(2) == "aldeg_cas05") { setarray .@emproom[0],27,101; }
else if (strnpcinfo(2) == "gefg_cas01") { setarray .@emproom[0],197,181; }
else if (strnpcinfo(2) == "gefg_cas02") { setarray .@emproom[0],176,178; }
else if (strnpcinfo(2) == "gefg_cas03") { setarray .@emproom[0],244,166; }
else if (strnpcinfo(2) == "gefg_cas04") { setarray .@emproom[0],174,177; }
else if (strnpcinfo(2) == "gefg_cas05") { setarray .@emproom[0],194,184; }
else if (strnpcinfo(2) == "payg_cas01") { setarray .@emproom[0],139,139; }
else if (strnpcinfo(2) == "payg_cas02") { setarray .@emproom[0],38,25; }
else if (strnpcinfo(2) == "payg_cas03") { setarray .@emproom[0],268,264; }
else if (strnpcinfo(2) == "payg_cas04") { setarray .@emproom[0],270,28; }
else if (strnpcinfo(2) == "payg_cas05") { setarray .@emproom[0],30,30; }
else if (strnpcinfo(2) == "prtg_cas01") { setarray .@emproom[0],197,197; }
else if (strnpcinfo(2) == "prtg_cas02") { setarray .@emproom[0],157,174; }
else if (strnpcinfo(2) == "prtg_cas03") { setarray .@emproom[0],16,220; }
else if (strnpcinfo(2) == "prtg_cas04") { setarray .@emproom[0],291,14; }
else if (strnpcinfo(2) == "prtg_cas05") { setarray .@emproom[0],266,266; }
// Add custom Guild Castles here.
else {
end;
}
if (!mobcount(strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak")) {
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Emperium",1288,1,"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
end;
// O Emperium foi quebrado.
OnAgitBreak:
set .@GID,getcharid(2);
set .@breaker$,strcharinfo(0);
// Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen)
if (.@GID <= 0) {
set .@notice$,"O Jogador "+strcharinfo(0)+" ("+getcharid(0)+") quebrou o Emperim no Castelo: "+strnpcinfo(2)+" enquanto estava sem Guilda. As informações não serão salvas e o Emperium reaparecerá.";
logmes .@notice$; debugmes .@notice$;
donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
end;
}
// Adjust Economy Invest Level for Castle
set .@Economy,GetCastleData(strnpcinfo(2),2) - 5;
if (.@Economy < 0) set .@Economy, 0;
SetCastleData strnpcinfo(2), 2, .@Economy;
// Adjust Defense Invest Level for Castle
set .@Defence,GetCastleData(strnpcinfo(2),3) - 5;
if (.@Defence < 0) set .@Defence, 0;
SetCastleData strnpcinfo(2), 3, .@Defence;
// Set new Castle Occupant
SetCastleData strnpcinfo(2),1, .@GID;
// Announce that the Emperium is destroyed, and respawn all but new castle-occupants.
mapannounce strnpcinfo(2),"O Emperium foi destruído.",bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12;
// Refresh castle data, disable Kafra and reset Invest information.
GetCastleData strnpcinfo(2),0,strnpcinfo(0)+"::OnRecvCastle";
disablenpc "Kafra#"+strnpcinfo(2);
for( set .@i, 4; .@i <= 9; set .@i, .@i+1 ) {
SetCastleData strnpcinfo(2), .@i, 0;
}
// Erase Guardian Database information if the new owners do not have Guardian Research.
if( getgdskilllv(.@GID,10002) == 0 ) {
for( set .@i, 10; .@i <= 17; set .@i, .@i+1 ) {
SetCastleData strnpcinfo(2), .@i, 0;
}
}
// Respawn the Emperium, and display new owners.
sleep 500; // Slow down script execution slightly.
if( agitcheck() )
donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
sleep getbattleflag("gvg_eliminate_time");
MapRespawnGuildID strnpcinfo(2),.@GID,2;
MapRespawnGuildID strnpcinfo(2),.@GID,4;
announce "O Clã [" + getguildName(.@GID) + "] conquistou o Castelo [" + getcastlename(strnpcinfo(2)) + "] Graças ao Jogador [ "+ .@breaker$ +" ]",bc_all|bc_woe;
end;
// Fim da Guerra do Emperium.
OnAgitEnd:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
GvgOff strnpcinfo(2);
// If the castle has no owner at the end of WoE, do not kill Emperium.
if (GetCastleData(strnpcinfo(2),1)) {
KillMonster strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
end;
// Occupying Guild has been disbanded.
OnGuildBreak:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
// Kill guardians, disable the Kafra, and set owner to 0.
killmonster strnpcinfo(2),"Guardian#"+strnpcinfo(2)+"::OnGuardianDied";
disablenpc "Kafra#"+strnpcinfo(2);
SetCastleData strnpcinfo(2),0,0;
// Wait before refreshing guild information.
sleep getbattleflag("gvg_eliminate_time");
Announce "O Castelo [" + GetCastleName(strnpcinfo(2)) + "] foi abandonado.",0;
GetCastleData strnpcinfo(2),0,strnpcinfo(0)+"::OnRecvCastle";
end;
OnRecvCastle:
RequestGuildInfo GetCastleData(strnpcinfo(2),1);
// Spawn Monsters if the castle is empty.
set .@GID, GetCastleData(strnpcinfo(2),1);
set .@CMR, GetCastleMobRespawnInfo(); // [Wilk Maia]
if (.@GID == 0) {
killmonsterall strnpcinfo(2);
if (compare(strnpcinfo(2),"aldeg")) {
// Normal Spawns
if (.@CMR)
{
monster strnpcinfo(2),0,0,"Druida Maligno",1117,10;
monster strnpcinfo(2),0,0,"Khalitzburg",1132,4;
monster strnpcinfo(2),0,0,"Cavaleiro do Abismo",1219,2;
monster strnpcinfo(2),0,0,"Executor",1205,1;
monster strnpcinfo(2),0,0,"Penomena",1216,10;
monster strnpcinfo(2),0,0,"Alarme",1193,18;
monster strnpcinfo(2),0,0,"Relógio",1269,9;
monster strnpcinfo(2),0,0,"Raydric Arqueiro",1276,7;
monster strnpcinfo(2),0,0,"Andarilho",1208,3;
monster strnpcinfo(2),0,0,"Alice",1275,1;
monster strnpcinfo(2),0,0,"Cavaleiro Sanguinário",1268,1;
monster strnpcinfo(2),0,0,"Senhor das Trevas",1272,1;
}
// Set Emperium room spawn coordinates and spawn monsters.
if (strnpcinfo(2) == "aldeg_cas01") { setarray .@emproom[0],216,23; }
else if (strnpcinfo(2) == "aldeg_cas02") { setarray .@emproom[0],213,23; }
else if (strnpcinfo(2) == "aldeg_cas03") { setarray .@emproom[0],205,31; }
else if (strnpcinfo(2) == "aldeg_cas04") { setarray .@emproom[0],36,217; }
else if (strnpcinfo(2) == "aldeg_cas05") { setarray .@emproom[0],27,101; }
if (.@CMR)
{
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Senhor das Trevas",1272,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Gerente",1270,4;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Cavaleiro Sanguinário",1268,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Cavaleiro do Abismo",1219,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Raydric Arqueiro",1276,5;
}
}
else if (compare(strnpcinfo(2),"gefg")) {
// Normal Spawns
if (.@CMR)
{
monster strnpcinfo(2),0,0,"Druida Maligno",1117,10;
monster strnpcinfo(2),0,0,"Xamã do Vento",1263,11;
monster strnpcinfo(2),0,0,"Bathory",1102,10;
monster strnpcinfo(2),0,0,"Jakk",1130,10;
monster strnpcinfo(2),0,0,"Marduk",1140,20;
monster strnpcinfo(2),0,0,"Raydric",1163,9;
monster strnpcinfo(2),0,0,"Alice",1275,1;
monster strnpcinfo(2),0,0,"Cavaleiro do Abismo",1219,1;
monster strnpcinfo(2),0,0,"Flor do Luar",1150,1;
monster strnpcinfo(2),0,0,"Freeoni",1159,1;
}
// Set Emperium room spawn coordinates and spawn monsters.
if (strnpcinfo(2) == "gefg_cas01") { setarray .@emproom[0],197,181; }
else if (strnpcinfo(2) == "gefg_cas02") { setarray .@emproom[0],176,178; }
else if (strnpcinfo(2) == "gefg_cas03") { setarray .@emproom[0],244,166; }
else if (strnpcinfo(2) == "gefg_cas04") { setarray .@emproom[0],174,177; }
else if (strnpcinfo(2) == "gefg_cas05") { setarray .@emproom[0],194,184; }
if (.@CMR)
{
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Mysteltainn",1203,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Orc Herói",1087,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Grand Orc",1213,10;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Orc Arqueiro",1189,10;
}
}
else if (compare(strnpcinfo(2),"payg")) {
// Normal Spawns
if (.@CMR)
{
monster strnpcinfo(2),0,0,"Guardião da Floresta",1277,9;
monster strnpcinfo(2),0,0,"Andarilho",1208,10;
monster strnpcinfo(2),0,0,"Dragão Mutante",1262,5;
monster strnpcinfo(2),0,0,"Bathory",1102,5;
monster strnpcinfo(2),0,0,"Flor do Luar",1150,1;
monster strnpcinfo(2),0,0,"Eddga",1115,1;
monster strnpcinfo(2),0,0,"Horong",1129,11;
monster strnpcinfo(2),0,0,"Raydric Arqueiro",1276,5;
monster strnpcinfo(2),0,0,"Cobold Arqueiro",1282,4;
monster strnpcinfo(2),0,0,"Gárgula",1253,5;
}
// Set Emperium room spawn coordinates and spawn monsters.
if (strnpcinfo(2) == "payg_cas01") { setarray .@emproom[0],139,139; }
else if (strnpcinfo(2) == "payg_cas02") { setarray .@emproom[0],38,25; }
else if (strnpcinfo(2) == "payg_cas03") { setarray .@emproom[0],268,264; }
else if (strnpcinfo(2) == "payg_cas04") { setarray .@emproom[0],270,28; }
else if (strnpcinfo(2) == "payg_cas05") { setarray .@emproom[0],30,30; }
if (.@CMR)
{
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Flor do Luar",1150,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Eddga",1115,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Andarilho",1208,6;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Raydric Arqueiro",1276,5;
}
}
else if (compare(strnpcinfo(2),"prtg")) {
// Normal Spawns
if (.@CMR)
{
monster strnpcinfo(2),0,0,"Raydric",1163,1;
monster strnpcinfo(2),0,0,"Khalitzburg",1132,10;
monster strnpcinfo(2),0,0,"Cavaleiro do Abismo",1219,5;
monster strnpcinfo(2),0,0,"Cavaleiro Sanguinário",1268,5;
monster strnpcinfo(2),0,0,"Cavaleiro da Tempestade",1251,1;
monster strnpcinfo(2),0,0,"Hatii",1252,1;
monster strnpcinfo(2),0,0,"Raydric Arqueiro",1276,5;
monster strnpcinfo(2),0,0,"Grifo",1259,2;
monster strnpcinfo(2),0,0,"Quimera",1283,3;
monster strnpcinfo(2),0,0,"Alice",1275,1;
monster strnpcinfo(2),0,0,"Jirtas",1200,1;
}
// Set Emperium room spawn coordinates and spawn monsters.
if (strnpcinfo(2) == "prtg_cas01") { setarray .@emproom[0],197,197; }
else if (strnpcinfo(2) == "prtg_cas02") { setarray .@emproom[0],157,174; }
else if (strnpcinfo(2) == "prtg_cas03") { setarray .@emproom[0],16,220; }
else if (strnpcinfo(2) == "prtg_cas04") { setarray .@emproom[0],291,14; }
else if (strnpcinfo(2) == "prtg_cas05") { setarray .@emproom[0],266,266; }
if (.@CMR)
{
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Cavaleiro Sanguinário",1268,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Cavaleiro da Tempestade",1251,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Hatii",1252,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Cavaleiro do Abismo",1219,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Raydric Arqueiro",1276,5;
}
}
// Add custom Guild Castles here.
else {
end;
}
donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
// Disable Kafra Staff...
disablenpc "Kafra#"+strnpcinfo(2);
end;
}
else {
// Otherwise place the guild emblem on flags.
if (strnpcinfo(2) == "aldeg_cas01") { donpcevent "::OnRecvCastleA01"; }
else if (strnpcinfo(2) == "aldeg_cas02") { donpcevent "::OnRecvCastleA02"; }
else if (strnpcinfo(2) == "aldeg_cas03") { donpcevent "::OnRecvCastleA03"; }
else if (strnpcinfo(2) == "aldeg_cas04") { donpcevent "::OnRecvCastleA04"; }
else if (strnpcinfo(2) == "aldeg_cas05") { donpcevent "::OnRecvCastleA05"; }
else if (strnpcinfo(2) == "gefg_cas01") { donpcevent "::OnRecvCastleG01"; }
else if (strnpcinfo(2) == "gefg_cas02") { donpcevent "::OnRecvCastleG02"; }
else if (strnpcinfo(2) == "gefg_cas03") { donpcevent "::OnRecvCastleG03"; }
else if (strnpcinfo(2) == "gefg_cas04") { donpcevent "::OnRecvCastleG04"; }
else if (strnpcinfo(2) == "gefg_cas05") { donpcevent "::OnRecvCastleG05"; }
else if (strnpcinfo(2) == "payg_cas01") { donpcevent "::OnRecvCastlePy01"; }
else if (strnpcinfo(2) == "payg_cas02") { donpcevent "::OnRecvCastlePy02"; }
else if (strnpcinfo(2) == "payg_cas03") { donpcevent "::OnRecvCastlePy03"; }
else if (strnpcinfo(2) == "payg_cas04") { donpcevent "::OnRecvCastlePy04"; }
else if (strnpcinfo(2) == "payg_cas05") { donpcevent "::OnRecvCastlePy05"; }
else if (strnpcinfo(2) == "prtg_cas01") { donpcevent "::OnRecvCastlePt01"; }
else if (strnpcinfo(2) == "prtg_cas02") { donpcevent "::OnRecvCastlePt02"; }
else if (strnpcinfo(2) == "prtg_cas03") { donpcevent "::OnRecvCastlePt03"; }
else if (strnpcinfo(2) == "prtg_cas04") { donpcevent "::OnRecvCastlePt04"; }
else if (strnpcinfo(2) == "prtg_cas05") { donpcevent "::OnRecvCastlePt05"; }
// Add custom Guild Castles here.
else {
end;
}
// And load purchased Guardian in castles.
donpcevent "Guardian#"+strnpcinfo(2)+"::OnSpawnGuardians";
// And display Kafra if purchased.
if (GetCastleData(strnpcinfo(2),9) < 1) disablenpc "Kafra#"+strnpcinfo(2);
}
end;
}
// Guild Steward Template
//============================================================
- script Gld_Mngr_Template::Gld_Mngr_Template -1,{
// What is the Display Name of the NPC?
set .@name$,strnpcinfo(1);
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
// Define the types of guardians on a per castle basis.
// 1 - Soldier Guardian; 2 - Archer Guardian; 3 - Knight Guardian
// Define the x spawn point for each uardian.
// [0] = 1st guardian's x spawn point.
// Define the y spawn point for each guardian.
// [0] = 1st guardian's y spawn point.
// Define the coordinates of the "Treasure Room."
// Aldebaran (Luina) Castles
if (strnpcinfo(2) == "aldeg_cas01") {
setarray .@guardiantype[0],1,2,2,2,2,3,3,3;
setarray .@guardianposx[0],17,39,38,45,21,218,213,73;
setarray .@guardianposy[0],218,208,196,228,194,24,24,70;
setarray .@masterroom[0],113,223;
}
else if (strnpcinfo(2) == "aldeg_cas02") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],27,88,117,60,51,21,36,210;
setarray .@guardianposy[0],184,43,46,202,183,177,183,7;
setarray .@masterroom[0],134,225;
}
else if (strnpcinfo(2) == "aldeg_cas03") {
setarray .@guardiantype[0],3,3,1,1,1,2,2,2;
setarray .@guardianposx[0],90,116,86,116,64,212,195,110;
setarray .@guardianposy[0],112,112,120,76,103,160,151,217;
setarray .@masterroom[0],229,267;
}
else if (strnpcinfo(2) == "aldeg_cas04") {
setarray .@guardiantype[0],2,2,2,1,1,1,3,3;
setarray .@guardianposx[0],187,192,148,145,169,198,48,55;
setarray .@guardianposy[0],100,42,88,209,53,77,72,88;
setarray .@masterroom[0],83,17;
}
else if (strnpcinfo(2) == "aldeg_cas05") {
setarray .@guardiantype[0],2,2,1,1,3,3,3,3;
setarray .@guardianposx[0],51,188,157,157,27,145,156,41;
setarray .@guardianposy[0],202,79,192,74,221,78,73,112;
setarray .@masterroom[0],64,8;
}
// Geffen (Britoniah) Castles
else if (strnpcinfo(2) == "gefg_cas01") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],67,184,62,36,50,50,189,200;
setarray .@guardianposy[0],179,20,41,186,186,67,41,167;
setarray .@masterroom[0],152,117;
}
else if (strnpcinfo(2) == "gefg_cas02") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],64,56,166,35,20,19,166,159;
setarray .@guardianposy[0],168,41,25,148,150,41,42,188;
setarray .@masterroom[0],145,115;
}
else if (strnpcinfo(2) == "gefg_cas03") {
setarray .@guardiantype[0],2,2,1,1,1,3,3,3;
setarray .@guardianposx[0],48,113,48,157,243,157,234,238;
setarray .@guardianposy[0],176,214,207,62,41,45,25,160;
setarray .@masterroom[0],275,289;
}
else if (strnpcinfo(2) == "gefg_cas04") {
setarray .@guardiantype[0],2,2,1,1,1,3,3,3;
setarray .@guardianposx[0],53,31,49,29,147,57,160,148;
setarray .@guardianposy[0],191,178,220,46,65,46,50,189;
setarray .@masterroom[0],116,123;
}
else if (strnpcinfo(2) == "gefg_cas05") {
setarray .@guardiantype[0],2,2,1,1,1,3,3,3;
setarray .@guardianposx[0],45,71,72,66,177,66,177,193;
setarray .@guardianposy[0],149,163,142,47,50,17,35,166;
setarray .@masterroom[0],149,106;
}
// Payon (Baulder) Castles
else if (strnpcinfo(2) == "payg_cas01") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],229,225,222,99,65,36,51,138;
setarray .@guardianposy[0],92,80,111,45,31,127,144,133;
setarray .@masterroom[0],295,8;
}
else if (strnpcinfo(2) == "payg_cas02") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],237,228,210,57,42,287,264,27;
setarray .@guardianposy[0],54,72,41,241,241,257,272,20;
setarray .@masterroom[0],141,149;
}
else if (strnpcinfo(2) == "payg_cas03") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],245,269,36,41,39,19,37,268;
setarray .@guardianposy[0],37,51,39,39,65,276,277,244;
setarray .@masterroom[0],163,167;
}
else if (strnpcinfo(2) == "payg_cas04") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],251,232,231,32,32,35,36,270;
setarray .@guardianposy[0],212,212,175,287,232,45,17,41;
setarray .@masterroom[0],151,47;
}
else if (strnpcinfo(2) == "payg_cas05") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],19,33,266,266,263,263,250,36;
setarray .@guardianposy[0],279,260,234,279,37,21,22,36;
setarray .@masterroom[0],153,137;
}
// Prontera (Valkyrie Realms) Castles
else if (strnpcinfo(2) == "prtg_cas01") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],182,182,153,59,50,184,196,107;
setarray .@guardianposy[0],62,116,86,28,36,183,189,179;
setarray .@masterroom[0],15,209;
}
else if (strnpcinfo(2) == "prtg_cas02") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],161,153,178,71,49,64,7,75;
setarray .@guardianposy[0],161,161,44,75,28,186,196,175;
setarray .@masterroom[0],207,229;
}
else if (strnpcinfo(2) == "prtg_cas03") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],191,137,45,50,41,191,179,191;
setarray .@guardianposy[0],190,190,99,87,87,42,43,72;
setarray .@masterroom[0],190,130;
}
else if (strnpcinfo(2) == "prtg_cas04") {
setarray .@guardiantype[0],3,3,3,1,1,1,2,2;
setarray .@guardianposx[0],276,274,246,38,29,33,78,36;
setarray .@guardianposy[0],14,35,246,240,240,258,48,61;
setarray .@masterroom[0],275,160;
}
else if (strnpcinfo(2) == "prtg_cas05") {
setarray .@guardiantype[0],3,3,3,1,1,1,2,2;
setarray .@guardianposx[0],266,287,245,236,251,278,32,44;
setarray .@guardianposy[0],262,280,250,63,63,253,253,248;
setarray .@masterroom[0],281,176;
}
// Add custom Guild Castles here.
else {
end;
}
show "[ Steward " + .@name$ + " ]";
if (.@GID == 0) {
show "Eu estou esperando meu mestre retornar.";
show "Se você quiser falar com ele, terá que esperar também.";
close;
}
if (getcharid(2) != .@GID || strcharinfo(0) != getguildmaster(.@GID)){
show "Eu sou leal e seguirei o meu estre ^ff0000" + getguildmaster(.@GID) + "^000000. Nós somos Guardiões. Defenderemos até o amargo final!";
close;
}
show "Bem-vindo, meu honorável mestre, ^ff0000" + getguildmaster(.@GID) + "^000000...";
show "Não importa o que você precisar, estou aqui para servi-lo. Serei fiel nos meus deveres.";
next;
switch(select("Informações Sobre o Castelo:Investir no Comércio:Investir na Defesa do Castelo:Contratar Guardiões:Contratar/demitir Kafra:Entrar na Sala do Mestre")) {
case 1:
show "[ Steward " + .@name$ + " ]";
show "Aqui está o relatório sobre o Castelo, Mestre.";
show " ";
show " ^0000ffAgora, o Nível Comercial do castelo é de " + GetCastleData(strnpcinfo(2),2) + ".";
if (GetCastleData(strnpcinfo(2),4)) {
show " Você investiu " + GetCastleData(strnpcinfo(2),4) + " vezes no último dia.";
}
show " Agora, o Nível da Defesa do Castelo é de " + GetCastleData(strnpcinfo(2),3) + ".^000000";
if (GetCastleData(strnpcinfo(2),5)) {
show " ^0000ff- Você investiu " + GetCastleData(strnpcinfo(2),5) + " vezes no último dia.^000000";
}
show " ";
show "Isso é tudo, Mestre.";
close;
case 2:
set .@Economy,GetCastleData(strnpcinfo(2),2);
if (.@Economy < 6) { set .@eco_invest,5000; }
else if ((.@Economy >= 6) && (.@Economy <= 10)) { set .@eco_invest,10000; }
else if ((.@Economy >= 11) && (.@Economy <= 15)) { set .@eco_invest,20000; }
else if ((.@Economy >= 16) && (.@Economy <= 20)) { set .@eco_invest,35000; }
else if ((.@Economy >= 21) && (.@Economy <= 25)) { set .@eco_invest,55000; }
else if ((.@Economy >= 26) && (.@Economy <= 30)) { set .@eco_invest,80000; }
else if ((.@Economy >= 31) && (.@Economy <= 35)) { set .@eco_invest,110000; }
else if ((.@Economy >= 36) && (.@Economy <= 40)) { set .@eco_invest,145000; }
else if ((.@Economy >= 41) && (.@Economy <= 45)) { set .@eco_invest,185000; }
else if ((.@Economy >= 46) && (.@Economy <= 50)) { set .@eco_invest,230000; }
else if ((.@Economy >= 51) && (.@Economy <= 55)) { set .@eco_invest,280000; }
else if ((.@Economy >= 56) && (.@Economy <= 60)) { set .@eco_invest,335000; }
else if ((.@Economy >= 61) && (.@Economy <= 65)) { set .@eco_invest,395000; }
else if ((.@Economy >= 66) && (.@Economy <= 70)) { set .@eco_invest,460000; }
else if ((.@Economy >= 71) && (.@Economy <= 75)) { set .@eco_invest,530000; }
else if ((.@Economy >= 76) && (.@Economy <= 80)) { set .@eco_invest,605000; }
else if ((.@Economy >= 81) && (.@Economy <= 85)) { set .@eco_invest,685000; }
else if ((.@Economy >= 86) && (.@Economy <= 90)) { set .@eco_invest,770000; }
else if ((.@Economy >= 91) && (.@Economy <= 95)) { set .@eco_invest,860000; }
else if ((.@Economy >= 96) && (.@Economy <= 100)) { set .@eco_invest,955000; }
//Quadruple the cost of investing if you've already invested once.
if (GetCastleData(strnpcinfo(2),4)) {
set .@eco_invest,.@eco_invest*4;
}
show "[ Steward " + .@name$ + " ]";
show "Se você investir no Comércio, a quantidade de bens do Clã irá crescer. Se você pensa no futuro, investir é uma necessidade.";
show " ";
show "Inicialmente, você pode investir somente uma vez, se você tiver mais dinheiro, poderá investir duas vezes.";
show " ";
if (.@Economy == 100) {
show "^ff0000A Economia do Castelo está no máximo, ou seja, 100%. Nenhum investimento é necessário. Justamente o que eu esperava, Mestre.^000000";
close;
}
if (GetCastleData(strnpcinfo(2),4) == 2) {
show "^ff0000Você já investiu duas vezes hoje, você não pode investir mais.^000000";
close;
}
if (GetCastleData(strnpcinfo(2),4) == 0) {
show "O preço para o investimento do Castelo é de ^ff0000" + .@eco_invest + "^000000 zeny. Você vai investr mais?";
}
else {
show "Você já investiu uma vez, gostaria de ivestir outra? Serão necessários mais ^ff0000" + .@eco_invest + "^000000 zeny.";
}
next;
switch(select("Investir no Comércio:Cancelar")) {
case 1:
if (Zeny < .@eco_invest) {
show "[ Steward " + .@name$ + " ]";
show "Sinto muito, mas você não tem a quantidade de zeny necessária para investir. Você terá que tentar novamente quando tiver fundos, Mestre.";
close;
}
set zeny,zeny-.@eco_invest;
SetCastleData strnpcinfo(2),4,GetCastleData(strnpcinfo(2),4)+1;
show "[ Steward " + .@name$ + "]";
show "O investimento foi concluído com sucesso, Mestre. Eu espero que o senhor continue investindo amanhã.";
close;
case 2:
show "[ Steward " + .@name$ + " ]";
show "Eu farei como instruido, Senhor... Não há pressa. Nós faremos o nosso melhor.";
close;
}
case 3:
set .@Defence,GetCastleData(strnpcinfo(2),3);
if (.@Defence < 6) { set .@def_invest,10000; }
else if ((.@Defence >= 6) && (.@Defence <= 10)) { set .@def_invest,20000; }
else if ((.@Defence >= 11) && (.@Defence <= 15)) { set .@def_invest,40000; }
else if ((.@Defence >= 16) && (.@Defence <= 20)) { set .@def_invest,70000; }
else if ((.@Defence >= 21) && (.@Defence <= 25)) { set .@def_invest,110000; }
else if ((.@Defence >= 26) && (.@Defence <= 30)) { set .@def_invest,160000; }
else if ((.@Defence >= 31) && (.@Defence <= 35)) { set .@def_invest,220000; }
else if ((.@Defence >= 36) && (.@Defence <= 40)) { set .@def_invest,290000; }
else if ((.@Defence >= 41) && (.@Defence <= 45)) { set .@def_invest,370000; }
else if ((.@Defence >= 46) && (.@Defence <= 50)) { set .@def_invest,460000; }
else if ((.@Defence >= 51) && (.@Defence <= 55)) { set .@def_invest,560000; }
else if ((.@Defence >= 56) && (.@Defence <= 60)) { set .@def_invest,670000; }
else if ((.@Defence >= 61) && (.@Defence <= 65)) { set .@def_invest,790000; }
else if ((.@Defence >= 66) && (.@Defence <= 70)) { set .@def_invest,920000; }
else if ((.@Defence >= 71) && (.@Defence <= 75)) { set .@def_invest,1060000; }
else if ((.@Defence >= 76) && (.@Defence <= 80)) { set .@def_invest,1210000; }
else if ((.@Defence >= 81) && (.@Defence <= 85)) { set .@def_invest,1370000; }
else if ((.@Defence >= 86) && (.@Defence <= 90)) { set .@def_invest,1540000; }
else if ((.@Defence >= 91) && (.@Defence <= 95)) { set .@def_invest,1720000; }
else if ((.@Defence >= 96) && (.@Defence <= 100)) { set .@def_invest,1910000; }
//Quadruple the cost of investing if you've already invested once.
if (GetCastleData(strnpcinfo(2),5)) {
set .@def_invest,.@def_invest*4;
}
show "[ Steward " + .@name$ + " ]";
show "Se você investir na Defesa, os Guardiões e o Emperium ficarão mais fortes. Se o Senhor considerar as batalhas futuras, investir nessa área é necessário.";
show " ";
show "Inicialmente, você pode investir somente uma vez, se você tiver mais dinheiro, poderá investir duas vezes.";
show " ";
if (.@Defence == 100) {
show "^ff0000ff0000A defesa do Castelo está totalmente sólida, ou seja, 100%. Nenhum investimento é necessário, o que era esperado de um grande estrategista como o senhor, Mestre^000000";
close;
}
if (GetCastleData(strnpcinfo(2),5) == 2) {
show "^ff0000Você só pode investir duas vezes ao dia.^000000";
close;
}
if (GetCastleData(strnpcinfo(2),5) == 0) {
show "O preço para o investimento do Castelo é de " + .@def_invest + "^000000 zeny. Você vai investir??";
}
else {
show "Você já investiu uma vez hoje, gostaria de investir mais uma vez? Serão necessários mais ^ff0000" + .@def_invest + "^000000 zeny.";
}
next;
switch(select("Investir na Defesa:Cancelar")) {
case 1:
if (Zeny < .@def_invest) {
show "[ Steward " + .@name$ + " ]";
show "Sinto muito, mas você não tem a quantidade de zeny necessária para investir. Você terá que tentar novamente quando tiver fundos, Mestre.";
close;
}
set zeny,zeny-.@def_invest;
SetCastleData strnpcinfo(2),5,GetCastleData(strnpcinfo(2),5)+1;
show "[ Steward " + .@name$ + "]";
show "O investimento foi concluído com sucesso. Eu espero que o senhor continue investindo, Mestre.";
close;
case 2:
show "[ Steward " + .@name$ + " ]";
show "Eu farei como instruido, Senhor... Não há pressa. Nós faremos o nosso melhor.";
close;
}
case 4:
show "[ Steward " + .@name$ + " ]";
show "Você gostaria de contrar um Guardião? Ele será um protetor leal para nos defender.";
show "Por favor, escolha o Guardião para nos defender.";
next;
for( set .@i, 0; .@i <= 7 ; set .@i, .@i+1 ) {
if (.@guardiantype[.@i] == 1) { set .@type$,"Soldado Guardião"; }
else if (.@guardiantype[.@i] == 2) { set .@type$,"Arqueiro Guardião"; }
else { set .@type$,"Cavaleiro Guardião"; }
if (guardianinfo(strnpcinfo(2),.@i,0)) {
setarray .@gname$[.@i], .@type$ + " - Implementado (" + guardianinfo(strnpcinfo(2),.@i,2) + "/" + guardianinfo(strnpcinfo(2),.@i,1) + ")";
}
else {
setarray .@gname$[.@i], .@type$ + " - Não Implementado";
}
}
set .@menu$,.@gname$[0]+":"+.@gname$[1]+":"+.@gname$[2]+":"+.@gname$[3]+":"+.@gname$[4]+":"+.@gname$[5]+":"+.@gname$[6]+":"+.@gname$[7];
set .@GDnum,select(.@menu$)+9;
show "[ Steward " + .@name$ + " ]";
show "Deseja contratar o Guardião selecionado? São necessários 10000 zeny para fechar o contrato.";
next;
switch(select("Invocar:Cancelar")) {
case 1:
show "[ Steward " + .@name$ + " ]";
if (getgdskilllv(.@GID,10002) == 0) {
show "Mestre, nós não temos os conhecimentos necessários para contratar um Guardião...";
close;
}
if (GetCastleData(strnpcinfo(2),.@GDnum) == 1) {
show "Mestre, você já contratou esse Guardião. Você não pode contratar outro da mesma Classe.";
close;
}
if (Zeny < 10000) {
show "Bem... Sinto muito, mas não temos fundos para contratar o Guardião.";
close;
}
set zeny,zeny-10000;
SetCastleData strnpcinfo(2),.@GDnum,1; // mark as 'installed'
set .@UseGID,.@GDnum - 10;
if (.@guardiantype[.@UseGID] == 1) { set .@type,1287; }
else if (.@guardiantype[.@UseGID] == 2) { set .@type,1285; }
else { set .@type,1286; }
guardian strnpcinfo(2),.@guardianposx[.@UseGID],.@guardianposy[.@UseGID],strmobinfo(2,.@type),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@UseGID;
show "Guardião foi contratado com sucesso. Nossas defesas foram reforçadas com ele.";
close;
case 2:
show "[ Steward " + .@name$ + " ]";
show "Eu fiz como desejado senhor, e lembre-se, não deixe de contratar mais Guardiões.";
close;
}
case 5:
if (GetCastleData(strnpcinfo(2),9) == 1) {
show "[ Steward " + .@name$ + " ]";
show "Agora sobre a Funcionária Kafra... Você irá demitir a Funcionária Kafra?";
next;
switch(select("Demitir:Cancelar")) {
case 1:
cutin "kafra_01",2;
show "[ Funcionária Kafra ]";
show "Eu trabalhei tanto... Como o senhor pode fazer isso, Mestre?... Por favor, reconsidere Mestre... Por favor...";
next;
switch(select("Demitir:Reconsiderar")) {
case 1:
show "[ Funcionária Kafra ]";
show "Oh, meu Deus! Isso não tem sentido!";
next;
cutin "kafra_01",255;
break;
case 2:
show "[ Funcionária Kafra ]";
show "Vou continuar trabalhando duro, obrigado Mestre!";
close2;
cutin "kafra_01",255;
end;
}
break;
case 2:
show "[ Steward " + .@name$ + " ]";
show "Ela trabalha duro. Foi uma boa decisão mantê-la";
close;
}
disablenpc "Kafra#"+strnpcinfo(2);
SetCastleData strnpcinfo(2),9,0;
show "[ Steward " + .@name$ + " ]";
show "....";
show "Eu demiti a Funcionária Kafra... Mas... Você está insatisfeito com essa decisão?";
close;
}
else {
show "[ Steward " + .@name$ + " ]";
show "Gostaria de contratar uma Funcionária Kafra para o Castelo?";
show "^ff0000São necessários 10000 zeny para assinar o contrato.";
next;
switch(select("Contratar:Cancelar")) {
case 1:
show "[ Steward " + .@name$ + " ]";
if (getgdskilllv(.@GID,10001) == 0) {
show "Mestre, não podemos contratar uma Kafra sem ter um Contrato com a Corporação antes, por favor, assine esse contrato.";
close;
}
if (Zeny < 10000) {
show "Sinto muito, mas não temos zenys para assinar o contrato.";
close;
}
set zeny,zeny-10000;
enablenpc "Kafra#"+strnpcinfo(2);
SetCastleData strnpcinfo(2),9,1;
show "O contrato foi assinado com sucesso.";
next;
cutin "kafra_01",2;
show "[ Funcionária Kafra ]";
show "Como vai você? Eu fui mandada pela Corporação.";
show "Eu farei o melhor para manter a imagem do Clã como a melhor possível.";
next;
cutin "kafra_01",255;
show "[ Steward " + .@name$ + " ]";
show "O contrato é válido por um mês, depois disso, o Senhor terá que pagar um adicional.";
show "Isso é para o bem das nossas funcionárias.";
close;
case 2:
show "[ Steward " + .@name$ + " ]";
show "Eu fiz como o Senhor mandou, mas pelo bem do Clã, seria de bom grado contratar uma Kafra imediatamente.";
close;
}
}
case 6:
show "[ Steward " + .@name$ + " ]";
show "Deseja entrar na Sala, Mestre?";
show "Este lugar é somente para o Senhor, ninguém mais pode entrar...";
next;
switch(select("Entrar na Sala:Cancelar")) {
case 1:
show "[ Steward " + .@name$ + " ]";
show "Eu lhe mostrarei o lugar secreto, por favor, me siga.";
show "Quando o Senhor quiser retornar, puxe a alavanca.";
close2;
warp strnpcinfo(2),.@masterroom[0],.@masterroom[1];
end;
case 2:
show "[ Steward " + .@name$ + " ]";
show "Os materiais são produzidos diariamente... Se o Senhor não retirar, eles não serão mais produzidos.";
show "Sendo assim, é melhor checar eles todos os dias.";
close;
}
}
}
// Guardian Spawner Template
//============================================================
- script Gld_Guard_Template::Gld_Guard_Template -1,{
// Spawn Guardians in castles
// When adding new castles, ensure that the coordinates coincide
// with the coordinates defined in the Guild Steward template.
OnSpawnGuardians:
// Define the types of guardians on a per castle basis.
// 1 - Soldier Guardian; 2 - Archer Guardian; 3 - Knight Guardian
// Define the x spawn point for each uardian.
// [0] = 1st guardian's x spawn point.
// Define the y spawn point for each uardian.
// [0] = 1st guardian's y spawn point.
// Aldebaran (Luina) Castles
if (strnpcinfo(2) == "aldeg_cas01") {
setarray .@guardiantype[0],1,2,2,2,2,3,3,3;
setarray .@guardianposx[0],17,39,38,45,21,218,213,73;
setarray .@guardianposy[0],218,208,196,228,194,24,24,70;
}
else if (strnpcinfo(2) == "aldeg_cas02") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],27,88,117,60,51,21,36,210;
setarray .@guardianposy[0],184,43,46,202,183,177,183,7;
}
else if (strnpcinfo(2) == "aldeg_cas03") {
setarray .@guardiantype[0],3,3,1,1,1,2,2,2;
setarray .@guardianposx[0],90,116,86,116,64,212,195,110;
setarray .@guardianposy[0],112,112,120,76,103,160,151,217;
}
else if (strnpcinfo(2) == "aldeg_cas04") {
setarray .@guardiantype[0],2,2,2,1,1,1,3,3;
setarray .@guardianposx[0],187,192,148,145,169,198,48,55;
setarray .@guardianposy[0],100,42,88,209,53,77,72,88;
}
else if (strnpcinfo(2) == "aldeg_cas05") {
setarray .@guardiantype[0],2,2,1,1,3,3,3,3;
setarray .@guardianposx[0],51,188,157,157,27,145,156,41;
setarray .@guardianposy[0],202,79,192,74,221,78,73,112;
}
// Geffen (Britoniah) Castles
else if (strnpcinfo(2) == "gefg_cas01") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],67,184,62,36,50,50,189,200;
setarray .@guardianposy[0],179,20,41,186,186,67,41,167;
}
else if (strnpcinfo(2) == "gefg_cas02") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],64,56,166,35,20,19,166,159;
setarray .@guardianposy[0],168,41,25,148,150,41,42,188;
}
else if (strnpcinfo(2) == "gefg_cas03") {
setarray .@guardiantype[0],2,2,1,1,1,3,3,3;
setarray .@guardianposx[0],48,113,48,157,243,157,234,238;
setarray .@guardianposy[0],176,214,207,62,41,45,25,160;
}
else if (strnpcinfo(2) == "gefg_cas04") {
setarray .@guardiantype[0],2,2,1,1,1,3,3,3;
setarray .@guardianposx[0],53,31,49,29,147,57,160,148;
setarray .@guardianposy[0],191,178,220,46,65,46,50,189;
}
else if (strnpcinfo(2) == "gefg_cas05") {
setarray .@guardiantype[0],2,2,1,1,1,3,3,3;
setarray .@guardianposx[0],45,71,72,66,177,66,177,193;
setarray .@guardianposy[0],149,163,142,47,50,17,35,166;
}
// Payon (Baulder) Castles
else if (strnpcinfo(2) == "payg_cas01") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],229,225,222,99,65,36,51,138;
setarray .@guardianposy[0],92,80,111,45,31,127,144,133;
}
else if (strnpcinfo(2) == "payg_cas02") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],237,228,210,57,42,287,264,27;
setarray .@guardianposy[0],54,72,41,241,241,257,272,20;
}
else if (strnpcinfo(2) == "payg_cas03") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],245,269,36,41,39,19,37,268;
setarray .@guardianposy[0],37,51,39,39,65,276,277,244;
}
else if (strnpcinfo(2) == "payg_cas04") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],251,232,231,32,32,35,36,270;
setarray .@guardianposy[0],212,212,175,287,232,45,17,41;
}
else if (strnpcinfo(2) == "payg_cas05") {
setarray .@guardiantype[0],2,2,2,2,2,2,2,3;
setarray .@guardianposx[0],19,33,266,266,263,263,250,36;
setarray .@guardianposy[0],279,260,234,279,37,21,22,36;
}
// Prontera (Valkyrie Realms) Castles
else if (strnpcinfo(2) == "prtg_cas01") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],182,182,153,59,50,184,196,107;
setarray .@guardianposy[0],62,116,86,28,36,183,189,179;
}
else if (strnpcinfo(2) == "prtg_cas02") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],161,153,178,71,49,64,7,75;
setarray .@guardianposy[0],161,161,44,75,28,186,196,175;
}
else if (strnpcinfo(2) == "prtg_cas03") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],191,137,45,50,41,191,179,191;
setarray .@guardianposy[0],190,190,99,87,87,42,43,72;
}
else if (strnpcinfo(2) == "prtg_cas04") {
setarray .@guardiantype[0],3,3,3,1,1,1,2,2;
setarray .@guardianposx[0],276,274,246,38,29,33,78,36;
setarray .@guardianposy[0],14,35,246,240,240,258,48,61;
}
else if (strnpcinfo(2) == "prtg_cas05") {
setarray .@guardiantype[0],3,3,3,1,1,1,2,2;
setarray .@guardianposx[0],266,287,245,236,251,278,32,44;
setarray .@guardianposy[0],262,280,250,63,63,253,253,248;
}
// Add custom Guild Castles here.
else {
end;
}
// Kill all existing guardians before spawning new ones.
// This should prevent duplicating Guardians when char Server disconnects.
killmonster strnpcinfo(2),strnpcinfo(0)+"::OnGuardianDied";
for( set .@i, 0; .@i <= 7 ; set .@i, .@i+1 ) {
set .@UseGID,.@i + 10;
if (.@guardiantype[.@i] == 1) { set .@type,1287; }
else if (.@guardiantype[.@i] == 2) { set .@type,1285; }
else { set .@type,1286; }
if (GetCastleData(strnpcinfo(2),.@UseGID)) {
guardian strnpcinfo(2),.@guardianposx[.@i],.@guardianposy[.@i],strmobinfo(2,.@type),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@i;
}
}
end;
OnGuardianDied:
end;
}
// Kafra Template
//============================================================
- script Gld_Kafra_Template::Gld_Kafra_Template -1,{
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
if (compare(strnpcinfo(2),"aldeg")) {
setarray .@destination$[0],"Al De Baran","aldebaran";
setarray .@coordinates[0],132,103;
}
else if (compare(strnpcinfo(2),"gefg")) {
setarray .@destination$[0],"Geffen","geffen";
setarray .@coordinates[0],120,39;
}
else if (compare(strnpcinfo(2),"payg")) {
setarray .@destination$[0],"Payon","payon";
setarray .@coordinates[0],70,100;
}
else if (compare(strnpcinfo(2),"prtg")) {
setarray .@destination$[0],"Prontera","prontera";
setarray .@coordinates[0],116,72;
}
// Add custom Guild Castles here.
else {
end;
}
cutin "kafra_01",2;
if (getcharid(2) == .@GID) {
show "[Funcionária Kafra]";
show "Bem-vindo, membro do Clã ^ff0000" + getguildname(.@GID) + "^000000.";
show "A Corporação Kafra está ao seu lado onde quer que você vá.";
next;
switch(select("Usar Armazém:Usar Armazém de Clã:Usar Serviço de Teletransporte:Alugar um Carrinho:Cancelar")) {
case 1:
if (basicskillcheck() && getskilllv(1) < 6) {
show "[Funcionária Kafra]";
show "Eu sinto muito, mas você precisa ser pelo menos Aprendiz Nível 6 se você desejar usar nosso serviço de Armazém.";
}
else {
callfunc("F_CheckKafCode"); //check your storage password, if set
openstorage;
}
break;
case 2:
// Unofficial, but since it's already been in eA for ages
// and used, I can't exactly remove it, now, can I? >:(
if(guildopenstorage(0) == 1){
show "[Funcionária Kafra]";
show "Sinto muito, mas há outro membro usando o Armazém do Clã";
show "neste momento. Espere por favor, até que este membro termine.";
close2;
cutin "", 255;
end;
}
cutin "", 255;
close;
case 3:
show "[Funcionária Kafra]";
show "Por favor, selecione seu destino.";
next;
switch(select(.@destination$ + " ^880000200 ^000000z:Cancelar")) {
case 1:
if (Zeny < 200) {
show "[Funcionária Kafra]";
show "Desculpe, mas você não possui a quantidade de zeny necessária. A taxa do Armazém é de 200 zeny.";
}
else {
set zeny,zeny-200;
set kf_10_pit,kf_10_pit+2;
cutin "kafra_01",255;
warp .@destination$[1],.@coordinates[0],.@coordinates[1];
end;
}
break;
case 2:
break;
}
break;
case 4:
if(baseClass != Job_Merchant){
show "[Funcionária Kafra]";
show "Eu sinto muito. O Serviço de Carrinho é fornecido apenas para as classes de Mercadores, como os próprios Mercadores, Ferreiros, Alquimistas e suas evoluções.";
}
else if(checkcart() == 1){
show "[Funcionária Kafra]";
show "Desculpe-me... mas você já possui um carrinho...";
}
else {
show "[Funcionária Kafra]" ;
show "A taxa de Carrinho é de 800 zeny. Você deseja alugar um Carrinho?";
next;
switch(select("Sim:Cancelar")) {
case 1:
if (Zeny < 800) {
show "[Funcionária Kafra]";
show "Senhor, você não possui a quantidade de zeny necessária. Você precisa de 800 zeny.";
}
else {
close2;
cutin "kafra_01",255;
set kf_10_pit,kf_10_pit+8;
set zeny,zeny-800;
setcart;
end;
}
break;
case 2:
break;
}
}
break;
case 5:
show "[Funcionária Kafra]";
show "A Corp. Kafra sempre tenta prestar o melhor serviço.";
show "Obrigado por usar os Serviços da Corporação Kafra. Volte sempre.";
}
}
else {
show "[Funcionária Kafra]";
show "Eu estou aqui para servir somente os membros do Clã ^ff0000" + getguildname(.@GID) + "^000000. Por favor, use um Serviço de Kafra diferente. Me desculpe pelo inconveniente.";
}
close2;
cutin "kafra_01",255;
end;
}
// Guild Dungeon Switch Template
//============================================================
- script Gld_Dun_Template::Gld_Dun_Template -1,{
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
// Pick what Dungeon I should warp too, and where in that dungeon.
if (compare(strnpcinfo(2),"aldeg")) {
set .@destination$,"gld_dun02";
if (compare(strnpcinfo(2),"cas01")) setarray .@coordinates[0],32,122;
else if (compare(strnpcinfo(2),"cas02")) setarray .@coordinates[0],79,32;
else if (compare(strnpcinfo(2),"cas03")) setarray .@coordinates[0],165,38;
else if (compare(strnpcinfo(2),"cas04")) setarray .@coordinates[0],160,148;
else if (compare(strnpcinfo(2),"cas05")) setarray .@coordinates[0],103,169;
}
else if (compare(strnpcinfo(2),"gefg")) {
set .@destination$,"gld_dun04";
if (compare(strnpcinfo(2),"cas01")) setarray .@coordinates[0],39,258;
else if (compare(strnpcinfo(2),"cas02")) setarray .@coordinates[0],125,270;
else if (compare(strnpcinfo(2),"cas03")) setarray .@coordinates[0],268,251;
else if (compare(strnpcinfo(2),"cas04")) setarray .@coordinates[0],268,108;
else if (compare(strnpcinfo(2),"cas05")) setarray .@coordinates[0],230,35;
}
else if (compare(strnpcinfo(2),"payg")) {
set .@destination$,"gld_dun01";
if (compare(strnpcinfo(2),"cas01")) setarray .@coordinates[0],186,165;
else if (compare(strnpcinfo(2),"cas02")) setarray .@coordinates[0],54,165;
else if (compare(strnpcinfo(2),"cas03")) setarray .@coordinates[0],54,39;
else if (compare(strnpcinfo(2),"cas04")) setarray .@coordinates[0],186,39;
else if (compare(strnpcinfo(2),"cas05")) setarray .@coordinates[0],223,202;
}
else if (compare(strnpcinfo(2),"prtg")) {
set .@destination$,"gld_dun03";
if (compare(strnpcinfo(2),"cas01")) setarray .@coordinates[0],28,251;
else if (compare(strnpcinfo(2),"cas02")) setarray .@coordinates[0],164,268;
else if (compare(strnpcinfo(2),"cas03")) setarray .@coordinates[0],164,179;
else if (compare(strnpcinfo(2),"cas04")) setarray .@coordinates[0],268,203;
else if (compare(strnpcinfo(2),"cas05")) setarray .@coordinates[0],199,28;
}
// Add custom Guild Castles here.
else {
end;
}
if (.@GID == 0) {
show "[ Voz Misteriosa ]";
show " ' Quem mostrar braveza e coragem... Irá encontrar o caminho... ' ";
close;
}
else {
show "[ Voz Misteriosa ]";
show " ' Somente quem mostrar verdadeira coragem pode fazer este teste. '";
next;
show " ";
show "Há uma pequena alavanca. Você deseja puxá-la?";
next;
switch(select("Puxar:Não fazer nada")) {
case 1:
if ((getcharid(2) == .@GID)) {
warp .@destination$,.@coordinates[0],.@coordinates[1];
end;
}
else {
show " ";
show " Nada aconteceu.";
close;
}
case 2:
close;
}
}
}
// Treasure Room Protection Template
//============================================================
- script Gld_Trea_Protect::Gld_Trea_Protect -1,{
//OnTouch2:
OnTouch:
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
if (strcharinfo(0) != getguildmaster(.@GID)) {
if (compare(strnpcinfo(2),"aldeg")) {
warp "aldebaran",132,103;
}
else if (compare(strnpcinfo(2),"gefg")) {
warp "geffen",120,39;
}
else if (compare(strnpcinfo(2),"payg")) {
warp "payon",70,100;
}
else if (compare(strnpcinfo(2),"prtg")) {
warp "prontera",116,72;
}
// Add custom Guild Castles here.
else {
end;
}
}
end;
}
// Treasure Room Spawn Template
//============================================================
- script Gld_Trea_Spawn::Gld_Trea_Spawn -1,{
end;
OnClock0001:
// Do nothing if this script is the template.
if (strnpcinfo(1) == "Gld_Trea_Spawn") end;
// If there is no owner, do nothing.
if (!GetCastleData(strnpcinfo(2),1)) end;
// Is there Economy in this castle?
set .@Treasure,GetCastleData(strnpcinfo(2),2)/5+4;
// Set information
if (strnpcinfo(2) == "aldeg_cas01") {
set .@treasurebox,1324;
setarray .@treasurex[0],115,122,115,122,116,117,118,119,120,121,121,121,121,121,121,120,119,118,117,116,116,116,116,116;
setarray .@treasurey[0],226,226,219,219,225,225,225,225,225,225,224,223,222,221,220,220,220,220,220,220,221,222,223,224;
}
else if (strnpcinfo(2) == "aldeg_cas02") {
set .@treasurebox,1326;
setarray .@treasurex[0],134,135,135,134,132,133,134,135,136,137,137,137,137,137,137,136,135,134,133,132,132,132,132,132;
setarray .@treasurey[0],231,231,230,230,233,233,233,233,233,233,232,231,230,229,228,228,228,228,228,228,229,230,231,232;
}
else if (strnpcinfo(2) == "aldeg_cas03") {
set .@treasurebox,1328;
setarray .@treasurex[0],224,225,225,224,222,223,224,225,226,227,227,227,227,227,227,226,225,224,223,222,222,222,222,222;
setarray .@treasurey[0],269,269,268,268,271,271,271,271,271,271,270,269,268,267,266,266,266,266,266,266,267,268,269,270;
}
else if (strnpcinfo(2) == "aldeg_cas04") {
set .@treasurebox,1330;
setarray .@treasurex[0],84,85,85,84,82,83,84,85,86,87,87,87,87,87,87,86,85,84,83,82,82,82,82,82;
setarray .@treasurey[0],13,13,12,12,15,15,15,15,15,15,14,13,12,11,10,10,10,10,10,10,11,12,13,14;
}
else if (strnpcinfo(2) == "aldeg_cas05") {
set .@treasurebox,1332;
setarray .@treasurex[0],61,62,62,61,59,60,61,62,63,64,64,64,64,64,64,63,62,61,60,59,59,59,59,59;
setarray .@treasurey[0],12,12,11,11,14,14,14,14,14,14,13,12,11,10,9,9,9,9,9,9,10,11,12,13;
}
else if (strnpcinfo(2) == "gefg_cas01") {
set .@treasurebox,1334;
setarray .@treasurex[0],153,154,154,153,151,152,153,154,155,156,156,156,156,156,156,155,154,153,152,151,151,151,151,151;
setarray .@treasurey[0],113,113,112,112,115,115,115,115,115,115,114,113,112,111,110,110,110,110,110,110,111,112,113,114;
}
else if (strnpcinfo(2) == "gefg_cas02") {
set .@treasurebox,1336;
setarray .@treasurex[0],139,140,140,139,137,138,139,140,141,142,142,142,142,142,142,141,140,139,138,137,137,137,137,137;
setarray .@treasurey[0],115,115,114,114,117,117,117,117,117,117,116,115,114,113,112,112,112,112,112,112,113,114,115,116;
}
else if (strnpcinfo(2) == "gefg_cas03") {
set .@treasurebox,1338;
setarray .@treasurex[0],269,270,270,269,267,268,269,270,271,272,272,272,272,272,272,271,270,269,268,267,267,267,267,267;
setarray .@treasurey[0],291,291,290,290,293,293,293,293,293,293,292,291,290,289,288,288,288,288,288,288,289,290,291,292;
}
else if (strnpcinfo(2) == "gefg_cas04") {
set .@treasurebox,1340;
setarray .@treasurex[0],115,116,116,115,113,114,115,116,117,118,118,118,118,118,118,117,116,115,114,113,113,113,113,113;
setarray .@treasurey[0],119,119,118,118,121,121,121,121,121,121,120,119,118,117,116,116,116,116,116,116,117,118,119,120;
}
else if (strnpcinfo(2) == "gefg_cas05") {
set .@treasurebox,1342;
setarray .@treasurex[0],143,144,144,143,141,142,143,144,145,146,146,146,146,146,146,145,144,143,142,141,141,141,141,141;
setarray .@treasurey[0],110,110,109,109,112,112,112,112,112,112,111,110,109,108,107,107,107,107,107,107,108,109,110,111;
}
else if (strnpcinfo(2) == "payg_cas01") {
set .@treasurebox,1344;
setarray .@treasurex[0],289,292,292,289,288,289,290,291,292,293,293,293,293,293,293,292,291,290,289,288,288,288,288,288;
setarray .@treasurey[0],10,10,7,7,11,11,11,11,11,11,10,9,8,7,6,6,6,6,6,6,7,8,9,10;
}
else if (strnpcinfo(2) == "payg_cas02") {
set .@treasurebox,1346;
setarray .@treasurex[0],143,146,146,143,142,143,144,145,146,147,147,147,147,147,147,146,145,144,143,142,142,142,142,142;
setarray .@treasurey[0],146,146,143,143,147,147,147,147,147,147,146,145,144,143,142,142,142,142,142,142,143,144,145,146;
}
else if (strnpcinfo(2) == "payg_cas03") {
set .@treasurebox,1348;
setarray .@treasurex[0],158,159,159,158,156,157,158,159,160,161,161,161,161,161,161,160,159,158,157,156,156,156,156,156;
setarray .@treasurey[0],169,169,168,168,171,171,171,171,171,171,170,169,168,167,166,166,166,166,166,166,167,168,169,170;
}
else if (strnpcinfo(2) == "payg_cas04") {
set .@treasurebox,1350;
setarray .@treasurex[0],146,147,147,146,144,145,146,147,148,149,149,149,149,149,149,148,147,146,145,144,144,144,144,144;
setarray .@treasurey[0],48,48,47,47,50,50,50,50,50,50,49,48,47,46,45,45,45,45,45,45,46,47,48,49;
}
else if (strnpcinfo(2) == "payg_cas05") {
set .@treasurebox,1352;
setarray .@treasurex[0],155,158,158,155,154,155,156,157,158,159,159,159,159,159,159,158,157,156,155,154,154,154,154,154;
setarray .@treasurey[0],134,134,131,131,135,135,135,135,135,135,134,133,132,131,130,130,130,130,130,130,131,132,133,134;
}
else if (strnpcinfo(2) == "prtg_cas01") {
set .@treasurebox,1354;
setarray .@treasurex[0],10,11,11,10,8,9,10,11,12,13,13,13,13,13,13,12,11,10,9,8,8,8,8,8;
setarray .@treasurey[0],209,209,208,208,211,211,211,211,211,211,210,209,208,207,206,206,206,206,206,206,207,208,209,210;
}
else if (strnpcinfo(2) == "prtg_cas02") {
set .@treasurebox,1356;
setarray .@treasurex[0],201,202,202,201,199,200,201,202,203,204,204,204,204,204,204,203,202,201,200,199,199,199,199,199;
setarray .@treasurey[0],228,228,227,227,230,230,230,230,230,230,229,228,227,226,225,225,225,225,225,225,226,227,228,229;
}
else if (strnpcinfo(2) == "prtg_cas03") {
set .@treasurebox,1358;
setarray .@treasurex[0],187,188,188,187,185,186,187,188,189,190,190,190,190,190,190,189,188,187,186,185,185,185,185,185;
setarray .@treasurey[0],132,132,131,131,134,134,134,134,134,134,133,132,131,130,129,129,129,129,129,129,130,131,132,133;
}
else if (strnpcinfo(2) == "prtg_cas04") {
set .@treasurebox,1360;
setarray .@treasurex[0],269,270,270,269,267,268,269,270,271,272,272,272,272,272,272,271,270,269,268,267,267,267,267,267;
setarray .@treasurey[0],162,162,161,161,164,164,164,164,164,164,163,162,161,160,159,159,159,159,159,159,160,161,162,163;
}
else if (strnpcinfo(2) == "prtg_cas05") {
set .@treasurebox,1362;
setarray .@treasurex[0],275,276,276,275,273,274,275,276,277,278,278,278,278,278,278,277,276,275,274,273,273,273,273,273;
setarray .@treasurey[0],178,178,177,177,180,180,180,180,180,180,179,178,177,176,175,175,175,175,175,175,176,177,178,179;
}
// Add custom Guild Castles here.
else {
end;
}
// Apply investment to Eco. and Def. Only happens if there were investments made.
// Permanent Development can only happen once per day.
if (GetCastleData(strnpcinfo(2),4)) {
set .@Economy,GetCastleData(strnpcinfo(2),2);
SetCastleData strnpcinfo(2),2,.@Economy + GetCastleData(strnpcinfo(2),4) + (.@Economy<99 && rand(2) && getgdskilllv(.@GID,10014));
}
if (GetCastleData(strnpcinfo(2),5)) {
set .@Defence,GetCastleData(strnpcinfo(2),3);
SetCastleData strnpcinfo(2),3,.@Defence + GetCastleData(strnpcinfo(2),5);
}
// Reset daily investment limits.
setcastledata strnpcinfo(2),4,0;
setcastledata strnpcinfo(2),5,0;
// Spawn boxes in proper order.
for (set .@i,0; .@i < .@Treasure ; set .@i,.@i+1) {
// set treasure box ID
set .@boxid, .@treasurebox + (.@i+2) % 2;
set .@box,1 << .@i;
// Spawn or do not spawn chests if one already exists.
if ((getd("$@"+strnpcinfo(2)+"_treasure") & .@box) == 0) {
monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Baú do Tesouro",.@boxid,1,"Treasure#"+strnpcinfo(2)+"::OnTreasureDied"+.@i;
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") | .@box;
}
}
end;
// Individual "You killed a chest" events to ensure proper spawning at the change of day.
OnTreasureDied0:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1;
end;
OnTreasureDied1:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2;
end;
OnTreasureDied2:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4;
end;
OnTreasureDied3:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8;
end;
OnTreasureDied4:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~16;
end;
OnTreasureDied5:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~32;
end;
OnTreasureDied6:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~64;
end;
OnTreasureDied7:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~128;
end;
OnTreasureDied8:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~256;
end;
OnTreasureDied9:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~512;
end;
OnTreasureDied10:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1024;
end;
OnTreasureDied11:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2048;
end;
OnTreasureDied12:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4096;
end;
OnTreasureDied13:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8192;
end;
OnTreasureDied14:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~16384;
end;
OnTreasureDied15:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~32768;
end;
OnTreasureDied16:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~65536;
end;
OnTreasureDied17:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~131072;
end;
OnTreasureDied18:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~262144;
end;
OnTreasureDied19:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~524288;
end;
OnTreasureDied20:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1048576;
end;
OnTreasureDied21:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2097152;
end;
OnTreasureDied22:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4194304;
end;
OnTreasureDied23:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8388608;
end;
}
}
|