/
invest_main.txt
1672 lines (1627 loc) · 63.2 KB
/
invest_main.txt
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
//===== rAthena Script =======================================
//= Hall of Abyss - Core Scripts
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= [Official Conversion]
//= Expansion for War of Emperium FE.
//= Invest in each realm to unlock new maps:
//= - Guild Dungeon F2, total 20,000,000z.
//= - Hall of Abyss, total 70,000,000z.
//===== Additional Comments: =================================
//= 1.0 First version. Missing official times. [Euphy]
//= 1.1 Added GM management function. [Euphy]
//============================================================
// Global Variables
//============================================================
// Note: an asterisk (*) represents any realm (prt, pay, gef, alde).
/*
$2011_agit_invest
-- 0: Inactive.
-- 1: Investment in progress.
-- 2: Investment results calculating.
-- 4: Investment calculations complete (only when at least one $*_invest_result is 3).
-- 11-21: Tie, revote required.
$agit_result_notice
-- 0: Inactive.
-- 1-12: Interim statements (displaying $@vfund_*x) available.
$agit_result_timer
-- 0: Inactive.
-- 0-59: Time elapsed during investment (in hours).
$agit_revoting_timer
-- 0: Inactive.
-- 0-29: Time elapsed during revote (in minutes).
-- 30: Revote closed.
-- 31: Revote results calculating.
$*_invest_result
-- 0: No data.
-- 1: Realm not connected.
-- 2: Guild Dungeon F2 open.
-- 3: Abyss Gate (Hall of Abyss and Gulid Dungeon F2) open.
$fund_*[01-05]
-- Investment units per guild castle.
$fund_*_extra
-- Investment units per realm.
$@vfund_*[01-05]
$@vfund_*_extra
-- Investment units, used in interim statements only.
*/
// Investment Functions & Controller
//============================================================
// Note: The times in this section are almost entirely custom.
- script #invest_timer -1,{
OnClock0000: // Open investments on Wednesday (1 hour after WoE)
if (gettime(DT_DAYOFWEEK) == WEDNESDAY && !agitcheck()) {
set $2011_agit_invest,1;
donpcevent "#fund_master::OnInvest_start";
}
end;
OnClock1200: // Close investments on Friday (60 hours after investments open)
if (gettime(DT_DAYOFWEEK) == FRIDAY && !agitcheck()) {
set $2011_agit_invest,2;
donpcevent "#fund_master::OnInvest_stop";
}
end;
OnClock1235: // Open dungeons on Friday (at least 31 minutes after investments close)
if (gettime(DT_DAYOFWEEK) == FRIDAY && !agitcheck())
donpcevent "#fund_master::OnResult";
end;
OnClock2000: // Close dungeons on Tuesday (1 hour before WoE)
if (gettime(DT_DAYOFWEEK) == TUESDAY)
donpcevent "#fund_master::OnReset";
end;
}
function script F_Invest_Status {
set .@day, gettime(DT_DAYOFWEEK);
set .@hour, gettime(DT_HOUR);
set .@minute, gettime(DT_MINUTE);
// Inactive.
if (agitcheck())
return 0;
// Open for investments.
if (.@day >= WEDNESDAY && (.@day < FRIDAY || (.@day == FRIDAY && .@hour <= 12)))
return 1;
// Investments closed, calculating results.
if (.@day == FRIDAY && .@hour == 12 && .@minute < 35)
return 2;
// Calculations complete, dungeons open.
if ((.@day == FRIDAY && (.@hour > 12 || (.@hour == 12 && .@minute >= 35))) || .@day > FRIDAY ||
.@day < TUESDAY || (.@day == TUESDAY && .@hour < 20))
return 3;
// Dungeons closed.
return 0;
}
//callfunc "F_Invest_Abyss","<variable>","<NPC name>"{,"<addon message>"};
function script F_Invest_Abyss {
.@npc_name$ = getarg(1);
mes "There are 2 ways to invest, by Zeny or the Investment Certificate given out by the Cat Paw Merchant Guild.";
mes "Which way would you like to make your investment?";
next;
switch(select("Invest with Zeny.:Invest with Investment Certificates.:Cancel")) {
case 1:
mes .@npc_name$;
mes "So you've decided to invest in Zeny.";
mes "Minimum investment unit is ^4d4dff10,000 Zeny^000000.";
mes "You can invest a maximum of 50 units which is ^4d4dff500,000 Zeny^000000.";
next;
switch(select("1 unit 10,000 Zeny:10 units 100,000 Zeny:50 units 500,000 Zeny:Another amount:Cancel")) {
case 1:
set .@units,1;
break;
case 2:
set .@units,10;
break;
case 3:
set .@units,50;
break;
case 4:
mes .@npc_name$;
mes "Please enter the amount you want to invest.";
mes "Please choose between 1 to 200.";
mes "Please enter 0 to cancel.";
next;
input .@units;
if (.@units < 0 || .@units > 200) {
mes .@npc_name$;
mes "You've exceeded the amount per investment.";
mes "Please try again.";
close;
} else if (.@units == 0) {
mes .@npc_name$;
mes "Canceled.";
close;
} else
break;
case 5:
mes .@npc_name$;
mes "Canceled.";
close;
}
set .@zeny, .@units * 10000;
if (Zeny < .@zeny) {
mes .@npc_name$;
mes "You do not have enough money.";
close;
}
mes .@npc_name$;
mes "You've invested "+callfunc("F_InsertPlural",.@units,"unit")+" "+callfunc("F_InsertComma",.@zeny)+" Zeny"+getarg(2,"")+".";
mes "Not much but this is a small gift. You can exchange it with items in Malangdo.";
set Zeny, Zeny-.@zeny;
setd getarg(0), getd(getarg(0)) + .@units;
getitem 6488,.@units; //Thanks_Invest_Ticket
close;
case 2:
mes .@npc_name$;
mes "Wow, you've brought Investment Certificates.";
mes "How many certificates will you submit?";
next;
switch(select("1 Investment Certificate:5 Investment Certificates:Another amount:Cancel")) {
case 1:
set .@tickets,1;
break;
case 2:
set .@tickets,5;
break;
case 3:
mes .@npc_name$;
mes "Please enter the number of Investment Certificates you want to submit.";
mes "Please choose between 1 to 20.";
mes "Please enter 0 to cancel.";
next;
input .@tickets;
if (.@tickets < 0 || .@tickets > 20) {
mes .@npc_name$;
mes "You've exceeded the amount per investment.";
mes "Please try again.";
close;
} else if (.@tickets == 0) {
mes .@npc_name$;
mes "Canceled.";
close;
} else
break;
case 4:
mes .@npc_name$;
mes "Canceled.";
close;
}
if (countitem(6489) < .@tickets) {
mes .@npc_name$;
mes "Looks like you have fewer Investment Certificates than you want to submit.";
close;
}
set .@units, .@tickets * 10;
mes .@npc_name$;
mes .@tickets+" Investment Certificate"+((.@tickets == 1)?" is":"s are")+" the same as an investment of "+.@units+" units ("+((.@units < 100)?.@units:insertchar(""+.@units,",",1))+"0,000z)"+getarg(2,"")+".";
mes "Not much but this is a small gift. You can exchange it with items in Malangdo.";
delitem 6489,.@tickets; //Cats_Invest_Certif
setd getarg(0), getd(getarg(0)) + .@units;
getitem 6488,.@units; //Thanks_Invest_Ticket
close;
case 3:
mes .@npc_name$;
mes "Canceled.";
close;
}
}
// Script Core :: agit_fund
//============================================================
prt_gld,1,1,0 script #fund_master 844,{
end;
OnInit:
set .@invest_status, callfunc("F_Invest_Status");
if (.@invest_status == 1) {
set $2011_agit_invest,1;
end;
}
if ((.@invest_status == 2 && $2011_agit_invest == 1) ||
(.@invest_status == 3 && ($2011_agit_invest == 1 || $2011_agit_invest == 2))) {
donpcevent "#fund_master::OnCalculate";
end;
}
end;
OnCalculate_Election:
set .@force_vote,1;
OnCalculate:
setarray .@cas$[0],"prt","pay","gef","alde";
for(set .@i,0; .@i<4; set .@i,.@i+1) {
// All funds per realm are summed.
set .@funds[.@i], getd("$fund_"+.@cas$[.@i]+"01")+getd("$fund_"+.@cas$[.@i]+"02")+getd("$fund_"+.@cas$[.@i]+"03")+getd("$fund_"+.@cas$[.@i]+"04")+getd("$fund_"+.@cas$[.@i]+"05")+getd("$fund_"+.@cas$[.@i]+"_extra");
// 70,000,000z opens Hall of Abyss and F2.
if (.@funds[.@i] >= 7000) {
setd "$"+.@cas$[.@i]+"_invest_result",3;
set .@total_7000,1;
}
// 20,000,000z opens F2 and a chance for Hall of Abyss.
else if (.@funds[.@i] >= 2000) {
setd "$"+.@cas$[.@i]+"_invest_result",2;
set .@total_2000,1;
}
// Anything below that opens nothing.
else
setd "$"+.@cas$[.@i]+"_invest_result",1;
}
// No further actions if 20,000,000z isn't reached.
if (!.@total_2000)
end;
// No further actions if any realm hits 70,000,000z.
if (.@total_7000) {
set $2011_agit_invest,4;
end;
}
// Otherwise, highest investment above 20,000,000z opens Hall of Abyss.
set .@max, .@funds[0];
for(set .@i,1; .@i<4; set .@i,.@i+1) {
if (.@funds[.@i] > .@max) {
set .@max, .@funds[.@i];
set .@ele, .@i;
deletearray .@rand$[0], getarraysize(.@rand$);
} else if (.@funds[.@i] == .@max && .@funds[.@i] >= 2000) {
if (!getarraysize(.@rand$))
set .@rand$[0], .@cas$[.@ele];
set .@rand$[getarraysize(.@rand$)], .@cas$[.@i];
}
}
if (.@max < 2000)
end;
if (getarraysize(.@rand$)) {
// Tie: declare a random winner.
if (!.@force_vote) {
set .@i, rand(getarraysize(.@rand$));
setd "$"+.@rand$[.@i]+"_invest_result",3;
set $2011_agit_invest,4;
end;
}
// Tie: initiate a 30-minute election.
set .@str$, implode(.@rand$,"|");
for(set .@i,0; .@i<4; set .@i,.@i+1) {
if (compare(.@str$,.@cas$[.@i]))
set .@election, .@election | (1<<.@i);
}
switch(.@election) {
case 3: set $2011_agit_invest,11; break; //Prontera|Payon
case 9: set $2011_agit_invest,12; break; //Prontera|Al De Baran
case 5: set $2011_agit_invest,13; break; //Prontera|Geffen
case 10: set $2011_agit_invest,14; break; //Al De Baran|Payon
case 6: set $2011_agit_invest,15; break; //Geffen|Payon
case 12: set $2011_agit_invest,16; break; //Al De Baran|Geffen
case 11: set $2011_agit_invest,17; break; //Prontera|Payon|Al De Baran
case 7: set $2011_agit_invest,18; break; //Prontera|Payon|Geffen
case 13: set $2011_agit_invest,19; break; //Prontera|Al De Baran|Geffen
case 14: set $2011_agit_invest,20; break; //Al De Baran|Payon|Geffen
case 15: set $2011_agit_invest,21; break; //Prontera|Payon|Al De Baran|Geffen
}
if ($2011_agit_invest >= 11)
donpcevent "Revoting Manager#Invest1::OnStart";
end;
} else {
setd "$"+.@cas$[.@ele]+"_invest_result",3;
set $2011_agit_invest,4;
end;
}
end;
OnInvest_start:
announce "From now on, we are going to start the investments to connect the 'Abyss Gate' in the WOE areas: Valkyrie Realm, Greenwood Lake, Luina, Britoniah.",bc_all,0xFF0000; //FW_NORMAL 10
set $fund_prt01,0;
set $fund_prt02,0;
set $fund_prt03,0;
set $fund_prt04,0;
set $fund_prt05,0;
set $fund_pay01,0;
set $fund_pay02,0;
set $fund_pay03,0;
set $fund_pay04,0;
set $fund_pay05,0;
set $fund_gef01,0;
set $fund_gef02,0;
set $fund_gef03,0;
set $fund_gef04,0;
set $fund_gef05,0;
set $fund_alde01,0;
set $fund_alde02,0;
set $fund_alde03,0;
set $fund_alde04,0;
set $fund_alde05,0;
donpcevent "Investment_total#fund00::OnEnable";
end;
OnInvest_stop:
announce "We've finished the investments to connect the 'Abyss Gate'.",bc_all,0xFF0000; //FW_NORMAL 10
donpcevent "Investment_total#fund00::OnReset";
donpcevent "#fund_master::OnCalculate_Election";
end;
OnResult:
announce "We've got the results of the investments for the 'Abyss Gate'. You can check through the Investment Status Board in each WOE area.",bc_all,0xFF0000; //FW_NORMAL 10
if ($2011_agit_invest == 4) {
set $fund_prt01,0;
set $fund_prt02,0;
set $fund_prt03,0;
set $fund_prt04,0;
set $fund_prt05,0;
set $fund_prt_extra,0;
set $fund_pay01,0;
set $fund_pay02,0;
set $fund_pay03,0;
set $fund_pay04,0;
set $fund_pay05,0;
set $fund_pay_extra,0;
set $fund_gef01,0;
set $fund_gef02,0;
set $fund_gef03,0;
set $fund_gef04,0;
set $fund_gef05,0;
set $fund_gef_extra,0;
set $fund_alde01,0;
set $fund_alde02,0;
set $fund_alde03,0;
set $fund_alde04,0;
set $fund_alde05,0;
set $fund_alde_extra,0;
} else if ($2011_agit_invest == 2)
donpcevent "#fund_master::OnCalculate";
end;
OnReset:
set $2011_agit_invest,0;
donpcevent "Investment_total#fund00::OnReset";
end;
}
prt_gld,2,2,0 script Investment_total#fund00 844,{
callfunc "F_GM_NPC";
mes "Is this not working properly?";
next;
if (callfunc("F_GM_NPC",1854,0) == 1) {
mes "If you think the investment timer is dead, please adjust the timer.";
next;
switch(select("Turn on the timer:Cancel")) {
case 1:
donpcevent "Investment_total#fund00::OnTimerReset";
mes "You've turned on the timer.";
close;
case 2:
mes "Canceled.";
close;
}
} else {
mes "I don't need to adjust anything now.";
close;
}
OnInit:
if (callfunc("F_Invest_Status") == 1) {
initnpctimer;
donpcevent "Investment_total#fund00::OnVarInit";
} else {
set $agit_result_timer,0;
set $agit_result_notice,0;
}
end;
OnVarInit:
setarray .@cas$[0],"prt","pay","gef","alde";
for(set .@i,0; .@i<4; set .@i,.@i+1) {
setd "$@vfund_"+.@cas$[.@i]+"01", getd("$fund_"+.@cas$[.@i]+"01");
setd "$@vfund_"+.@cas$[.@i]+"02", getd("$fund_"+.@cas$[.@i]+"02");
setd "$@vfund_"+.@cas$[.@i]+"03", getd("$fund_"+.@cas$[.@i]+"03");
setd "$@vfund_"+.@cas$[.@i]+"04", getd("$fund_"+.@cas$[.@i]+"04");
setd "$@vfund_"+.@cas$[.@i]+"05", getd("$fund_"+.@cas$[.@i]+"05");
setd "$@vfund_"+.@cas$[.@i]+"_extra", getd("$fund_"+.@cas$[.@i]+"_extra");
}
end;
OnEnable:
set $agit_result_timer,0;
set $agit_result_notice,0;
initnpctimer;
end;
OnReset:
set $agit_result_timer,0;
set $agit_result_notice,0;
stopnpctimer;
end;
OnTimerReset:
initnpctimer;
end;
OnTimer3600000:
if (callfunc("F_Invest_Status") == 1) {
if ($agit_result_timer < 59) {
set $agit_result_timer, $agit_result_timer+1;
// Trigger on multiples of 5 up to 55, and 58.
if ($agit_result_timer % 10 == 5 || $agit_result_timer % 10 == 0 || $agit_result_timer == 58) {
set $agit_result_notice, $agit_result_notice+1;
donpcevent "Investment_total#fund00::OnVarInit";
announce "No. "+$agit_result_notice+" Interim statement is now available. You can check through the Investment Status Board in each WOE area.",bc_all,0xFF0000; //FW_NORMAL 10
}
donpcevent "Investment_total#fund00::OnTimerReset";
} else
stopnpctimer;
end;
} else {
donpcevent "Investment_total#fund00::OnReset";
end;
}
}
prt_gld,164,98,3 script Revoting Manager#Invest1 421,{
mes "[Revoting Manager]";
mes "We are not accepting additional votes.";
mes "Please wait for our results announcement.";
close;
OnInit:
set .@invest_status, callfunc("F_Invest_Status");
if (.@invest_status == 2 && $2011_agit_invest >= 11 && $agit_revoting_timer < 30) {
donpcevent "Revoting Manager#Invest2::OnEnable";
initnpctimer;
} else if (.@invest_status == 3 && $2011_agit_invest >= 11)
donpcevent "Revoting Manager#Invest1::OnCalculate";
donpcevent "Revoting Manager#Invest1::OnDisable";
end;
OnCalculate:
switch($2011_agit_invest) {
case 11: setarray.@cas$[0],"prt","pay"; break;
case 12: setarray.@cas$[0],"prt","alde"; break;
case 13: setarray.@cas$[0],"prt","gef"; break;
case 14: setarray.@cas$[0],"alde","pay"; break;
case 15: setarray.@cas$[0],"gef","pay"; break;
case 16: setarray.@cas$[0],"alde","gef"; break;
case 17: setarray.@cas$[0],"prt","pay","alde"; break;
case 18: setarray.@cas$[0],"prt","pay","gef"; break;
case 19: setarray.@cas$[0],"prt","alde","gef"; break;
case 20: setarray.@cas$[0],"alde","pay","gef"; break;
case 21: setarray.@cas$[0],"prt","pay","alde","gef"; break;
default: end;
}
set .@max, getd("$fund_"+.@cas$[0]+"_extra");
for(set .@i,1; .@i<getarraysize(.@cas$); set .@i,.@i+1) {
set .@funds, getd("$fund_"+.@cas$[.@i]+"_extra");
if (.@funds > .@max) {
set .@max, .@funds;
set .@ele, .@i;
deletearray .@rand$[0], getarraysize(.@rand$);
} else if (.@funds == .@max) {
if (!getarraysize(.@rand$))
set .@rand$[0], .@cas$[.@ele];
set .@rand$[getarraysize(.@rand$)], .@cas$[.@i];
}
}
if (getarraysize(.@rand$)) {
set .@i, rand(getarraysize(.@rand$));
setd "$"+.@rand$[.@i]+"_invest_result",3;
} else
setd "$"+.@cas$[.@ele]+"_invest_result",3;
set $2011_agit_invest,4;
set $agit_revoting_timer,0;
end;
OnEnable:
enablenpc "Revoting Manager#Invest1";
end;
OnDisable:
disablenpc "Revoting Manager#Invest1";
end;
OnStart:
initnpctimer;
donpcevent "Revoting Manager#Invest2::OnNotice_on";
end;
OnEnd:
stopnpctimer;
disablenpc "Revoting Manager#Invest1";
end;
OnTimerReset:
initnpctimer;
end;
OnTimer60000:
set .@revote, $agit_revoting_timer;
if (.@revote < 30) {
set $agit_revoting_timer, $agit_revoting_timer+1;
donpcevent "Revoting Manager#Invest1::OnTimerReset";
} else if (.@revote == 30) {
announce "Cat Paw Merchant Guild: Now we are going to close the additional vote. We will announce the results soon.",bc_all,0xFF0000; //FW_NORMAL 10
donpcevent "Revoting Manager#Invest2::OnDisable";
donpcevent "Revoting Manager#Invest1::OnEnable";
set $agit_revoting_timer, $agit_revoting_timer+1;
donpcevent "Revoting Manager#Invest1::OnTimerReset";
} else if (.@revote == 31) {
donpcevent "Revoting Manager#Invest1::OnCalculate";
donpcevent "Revoting Manager#Invest1::OnDisable";
stopnpctimer;
end;
} else {
donpcevent "Revoting Manager#Invest1::OnDisable";
stopnpctimer;
}
end;
}
prt_gld,164,98,3 script Revoting Manager#Invest2 421,{
set .@invest, $2011_agit_invest;
if (.@invest < 11) {
mes "[Revoting Manager]";
mes "No! This is not the time to take a revote.";
close2;
disablenpc "Revoting Manager#Invest2";
end;
}
set .@playtime, checkquest(7349,PLAYTIME);
if (.@playtime == 0 || .@playtime == 1) {
mes "[Revoting Manager]";
mes "You've already participated in the vote.";
mes "Please relax and wait for the results.";
close;
} else if (.@playtime == 2)
erasequest 7349;
mes "[Revoting Manager]";
mes "Would you like to participate in the vote for choosing where to connect the 'Abyss Gate'?";
next;
if(select("Participate in the vote.:Skip for now.") == 2) {
mes "[Revoting Manager]";
mes "You've canceled the vote.";
close;
}
mes "[Revoting Manager]";
mes "You can vote once and won't need to invest for your choice.";
mes "Plesae choose one WOE area.";
next;
// Create menu.
explode(.@candidates$, callsub(OnGetCandidates, .@invest),"|");
for(set .@i,0; .@i<getarraysize(.@candidates$); set .@i,.@i+1) {
if (.@candidates$[.@i] == "alde")
set .@menu$[.@i],"Luina";
else if (.@candidates$[.@i] == "gef")
set .@menu$[.@i],"Britoniah";
else if (.@candidates$[.@i] == "pay")
set .@menu$[.@i],"Greenwood Lake";
else if (.@candidates$[.@i] == "prt")
set .@menu$[.@i],"Valkyrie Realm";
}
set .@vote, select(implode(.@menu$,":"))-1;
mes "[Revoting Manager]";
mes "You've voted for "+.@menu$[.@vote]+".";
mes "Thanks for voting.";
setquest 7349;
setd "$fund_"+.@candidates$[.@vote]+"_extra", getd("$fund_"+.@candidates$[.@vote]+"_extra") + 1;
close;
OnGetCandidates:
switch(getarg(0)) {
case 11: return "prt|pay";
case 12: return "prt|alde";
case 13: return "prt|gef";
case 14: return "alde|pay";
case 15: return "gef|pay";
case 16: return "alde|gef";
case 17: return "prt|pay|alde";
case 18: return "prt|pay|gef";
case 19: return "prt|alde|gef";
case 20: return "alde|pay|gef";
case 21: return "prt|pay|alde|gef";
}
return "";
OnInit:
disablenpc "Revoting Manager#Invest2";
end;
OnEnable:
enablenpc "Revoting Manager#Invest2";
end;
OnDisable:
disablenpc "Revoting Manager#Invest2";
stopnpctimer;
end;
OnNotice_on:
initnpctimer;
end;
OnTimer5000:
announce "Cat Paw Merchant Guild: As no WOE area has reached the maximum investment level to connect the 'Abyss Gate'...",bc_all,0xFF0000; //FW_NORMAL 10
end;
OnTimer8000:
announce "Cat Paw Merchant Guild: We were about to connect the 'Abyss Gate' to the WOE area which invested most.",bc_all,0xFF0000; //FW_NORMAL 10
end;
OnTimer11000:
announce "Cat Paw Merchant Guild: However, there were areas which invested the same amount. So we will put them to a vote.",bc_all,0xFF0000; //FW_NORMAL 10
end;
OnTimer14000:
announce "Cat Paw Merchant Guild: Additional votes will be available for 30 minutes. You can vote in Valkyrie Realm.",bc_all,0xFF0000; //FW_NORMAL 10
end;
OnTimer20000:
explode(.@candidates$, callsub(OnGetCandidates, $2011_agit_invest),"|");
for(set .@i,0; .@i<getarraysize(.@candidates$); set .@i,.@i+1) {
if (.@candidates$[.@i] == "alde")
set .@choices$[.@i],"Luina";
else if (.@candidates$[.@i] == "gef")
set .@choices$[.@i],"Britoniah";
else if (.@candidates$[.@i] == "pay")
set .@choices$[.@i],"Greenwood Lake";
else if (.@candidates$[.@i] == "prt")
set .@choices$[.@i],"Valkyrie Realm";
}
announce "Cat Paw Merchant Guild: The candidates for the additional vote are... "+implode(.@choices$," vs. ")+".",bc_all,0xFF0000; //FW_NORMAL 10
set $fund_prt_extra,0;
set $fund_pay_extra,0;
set $fund_gef_extra,0;
set $fund_alde_extra,0;
set $agit_revoting_timer,0;
donpcevent "Revoting Manager#Invest2::OnEnable";
stopnpctimer;
end;
}
/*
prtg_cas01,2,2,0 script Abrai 55,{
mes "I should quit my steward job.";
close;
OnAgitInvest:
switch(callfunc("F_Invest_Status")) {
case 0:
set $2011_agit_invest,0;
donpcevent "#fund_master::OnReset";
break;
case 1:
set $2011_agit_invest,1;
donpcevent "#fund_master::OnInvest_start";
break;
case 2:
set $2011_agit_invest,2;
donpcevent "#fund_master::OnInvest_stop";
break;
case 3:
donpcevent "#fund_master::OnResult";
break;
}
end;
}
*/
// Realms - Merchant Guilds, Gate Managers, Status Boards
//============================================================
- script Cat Paw Merchant Guild -1,{
if (compare(strnpcinfo(4),"alde")) {
set .@npc$,"alde";
set .@name$,"Megrez";
set .@realm$,"Luina";
set .@intro$,"Luina Branch Manager in Al De Baran";
} else if (compare(strnpcinfo(4),"gef")) {
set .@npc$,"gef";
set .@name$,"Meraq";
set .@realm$,"Britoniah";
set .@intro$,"Britoniah Branch Manager";
} else if (compare(strnpcinfo(4),"pay")) {
set .@npc$,"pay";
set .@name$,"Phecda";
set .@realm$,"Greenwood Lake";
set .@intro$,"Payon Greenwood Lake Branch Manager";
} else if (compare(strnpcinfo(4),"prt")) {
set .@npc$,"prt";
set .@name$,"Dubae";
set .@realm$,"Valkyrie Realm";
set .@intro$,"Prontera Valkyrie Realm Branch Manager";
}
set .@n$,"["+.@name$+"]";
mes .@n$;
mes "I'm "+.@name$+", the "+.@intro$+" of the Cat Paw Merchant Guild.";
mes "I consult about investments for the Abyss Gate development.";
mes "How may I help you?";
next;
switch(select("What is the Abyss Gate?:Investing in the gate development?:I want to invest in this area.:Cancel")) {
case 1:
mes .@n$;
mes "It is only called the Abyss Gate for convenience but it's simply a ^4d4dffgap to another dimension^000000.";
next;
mes .@n$;
mes "More of these gaps are found here and there after Morocc created the Crack of Dimension.";
mes "I personally think that the Abyss Gate found recently is part of the past or even from the future.";
next;
mes .@n$;
mes "It is said that the Abyss Gate forcefully connects to another dimension beyond our world.";
mes "Probably because there are those that follow the Emperium's power.";
next;
mes .@n$;
mes "There are a total of 4 Abyss Gates found so far. They all connect to the Agit region overflowing with the Emperium's force.";
next;
mes .@n$;
mes "We named each by dimension beyond the gap.";
mes "^4d4dffWay of the Warrior, Hill of the Dead, Winds of the Ancient, and the Hero's Tears.^000000";
mes "And all these four gaps are called the ^4d4dffAbyss Gate^000000.";
next;
mes .@n$;
mes "The gap may lead to the past, future or even an unknown world.";
mes "The power the Abyss Gate holds is both fearful but sweet";
next;
mes .@n$;
mes "Are you also interested in exploring the Abyss Gate?";
mes "Ha ha. You'll need to go through several steps before exploring.";
next;
mes .@n$;
mes "If you are interested,";
mes "will you take the time to sit down and talk about investing in maintaining the Abyss Gate?";
close;
case 2:
mes .@n$;
mes "Are you curious about investing in the Gate development?";
mes "What do you want to know about?";
next;
switch(select("About the Gate?:About investments?:How to invest?:Benefits from investing?")) {
case 1:
mes .@n$;
mes "The Gate is what it is named after, a door.";
mes "A dimensional passageway that connects here to there.";
next;
mes .@n$;
mes "The Abyss Gate was created as a very unstable path from beyond the dimensional gap,";
mes "therefore traveling through the Gate will need an artificial dimension connection.";
next;
mes .@n$;
mes "Humans are far from having the advanced technology that's needed";
mes "but our Cat Paw Merchant Guild holds the high technology to use the Crack of Dimension.";
next;
mes .@n$;
mes "So we made a proposal.";
mes "With the promise of support the Cat Paw Merchant Guild and paying for the immense expense for maintaining the connection with the Gate,";
mes "we will make the connection to the Crack of Dimension.";
next;
mes .@n$;
mes "Of course working on the Crack of Dimension is no easy job and it does come with risks.";
mes "There are cases where people go missing from traveling between.";
next;
mes .@n$;
mes "The best maintaining duration is about 4 days";
mes "You invest in us and we create the door that connects to the dimensional gap.";
next;
mes .@n$;
mes "Doesn't this sound like the perfect win-win proposal?";
close;
case 2:
mes .@n$;
mes "Forcing through the unstable dimensional gap and creating a passageway is very dangerous.";
mes "Not to mention the huge resources needed.";
next;
mes .@n$;
mes "If you take care of the charges and also the danger pay by investing in the Cat Paw Merchant Guild,";
mes "we'll create and maintain the gate regardless of the risks.";
next;
mes .@n$;
mes "But then of course the money involved for the gate costs will be extreme.";
mes "It will be easy if you can find investors to share the amount.";
next;
mes .@n$;
mes "There is a basic charge to start connecting the gate.";
mes "Results depend on the how much investment money is collected.";
next;
mes .@n$;
mes "The Abyss Gate exists in each Agit region.";
mes "Can you imagine how much money and sacrifice our guild will have to go through to develop in all areas?";
next;
mes .@n$;
mes "This explains the regional competition in investments.";
mes "If not enough gate maintenance costs are collected then it is obvious the region with the most investments will receive the benefits";
next;
mes .@n$;
mes "If ^4d4dffthe Abyss Gate is successfully connected then the dungeon of the hideout area";
mes "will be open to others instead of being guild exclusive^000000 which will be very attractive for investment.";
next;
mes .@n$;
mes "But then again, this is only for when the gate is connected.";
close;
case 3:
mes .@n$;
mes "It's simple.";
mes "Visit the branch manager of the ^4d4dffregion you want to invest in during the investment duration^000000 and make your investment.";
next;
mes .@n$;
mes "We usually receive ^4d4dffthe common currency here, Zeny^000000.";
mes "But since we're talking about supporting our Cat Paw Merchant Guild, you can also invest with items in demand in Malangdo.";
next;
mes .@n$;
mes "Provide the items in need to Namis in Malangdo who is in charge of general affairs in our guild.";
mes "Bring back your Investment Certificate to add it to the investment tribute.";
next;
mes .@n$;
mes "You must visit and invest at the region you want in order for your investment to be counted as a tribute.";
close;
case 4:
mes .@n$;
mes "The Abyss Gate is basically contracting and connecting with the castle that owns the Agit;";
mes "therefore, we will provide all we have once the costs for connecting and maintaining the gate are sufficient.";
next;
mes .@n$;
mes "In terms of the minimum and maximum costs for the whole work,";
mes "if the collected investment ^4d4dffexceeds the minimum costs^000000, we can connect you to the ^4d4dffdeepest layer of an unknown guild dungeon^000000.";
next;
mes .@n$;
mes "If investments exceed the maximum costs, that region will be connected to the";
mes "^4d4dffAbyss Gate^000000 regardless of the investment rank which includes the deepest layer of the guild dungeon.";
next;
mes .@n$;
mes "^ff0000If there is no Agit region that reached the maximum investment, then the region with the";
mes "highest investment participation will get the Abyss Gate connected with the investment collected from all regions.^000000";
next;
mes .@n$;
mes "Once the Abyss Gate is connected, the deepest layer (2F) of the guild dungeon";
mes "will be open to all adventurers that participated in the regional investment.";
next;
mes .@n$;
mes "Visits to the dungeon will be counted for the next investment for the Agit region";
mes "so being in good terms with the guild that claims the Agit castle will be a bonus.";
next;
mes .@n$;
mes "By the way, it isn't easy to maintain the connection with the Abyss Gate and investments and reconnection is needed weekly";
mes "so please continue your support and investment if you want the power of the unknown.";
close;
}
case 3:
if (checkweight(1201,1) == 0 || MaxWeight - Weight < 1000) {
mes "- Currently you're carrying -";
mes "- too many items with you. -";
mes "- Please try again after you -";
mes "- lose some weight. -";
close;
}
if (countitem(6488) >= 4800) {
mes .@n$;
mes "You have too many Thank You Tickets to receive any more.";
mes "Cannot give you any more tickets. Please use your ticket and come back.";
mes "The ticket can be exchanged with various items in Malangdo.";
close;
}
if (callfunc("F_Invest_Status") != 1) {
mes .@n$;
mes "We do not receive investments now.";
mes "Please come back during the investment duration.";
close;
}
set .@guild, getcharid(2);
for(set .@i,1; .@i<=5; set .@i,.@i+1) {
set .@castle_name$[.@i], getcastlename(.@npc$+"g_cas0"+.@i);
set .@owner_id[.@i], getcastledata(.@npc$+"g_cas0"+.@i,CD_GUILD_ID);
set .@owner_name$[.@i], getguildname(.@owner_id[.@i]);
if (.@guild == .@owner_id[.@i]) {
set .@menu$, .@menu$+.@castle_name$[.@i]+" ["+.@owner_name$[.@i]+"] Guild:";
set .@castles_owned, .@castles_owned | (1<<.@i);
} else
set .@menu$, .@menu$+"^aaaaaaNot the guild that claimed "+.@castle_name$[.@i]+"^000000:";
}
mes .@n$;
mes "Would you like to invest in the ^4d4dff"+.@realm$+"^000000 region?";
mes "If there is a castle occupied already, you will invest in the castle and the guild that is occupying it.";
next;
if (.@castles_owned) {
set .@i, select(.@menu$+"Cancel");
if (.@i == 6) {
mes .@n$;
mes "Canceled.";
close;
}
if (.@guild != .@owner_id[.@i]) {
mes .@n$;
mes "The guild that is occupying "+.@castle_name$[.@i]+" is "+.@owner_name$[.@i]+".";
mes "Doesn't look like your guild.";
close;
}
mes .@n$;
mes "Invest under "+.@castle_name$[.@i]+"'s"+.@owner_name$[.@i]+" guild name.";
callfunc "F_Invest_Abyss","$fund_"+.@npc$+"0"+.@i,.@n$;
end;
} else {
mes .@n$;
callfunc "F_Invest_Abyss","$fund_"+.@npc$+"_extra",.@n$," for "+.@realm$;
end;
}
case 4:
mes .@n$;
mes "Is that so?";
mes "Please come back whenever you are interested in investing in the Abyss Gate development.";
close;
}
}
- script Gate Manager#realm -1,{
if (compare(strnpcinfo(4),"alde")) {
set .@npc$,"alde";
set .@name$,"Alkor";
set .@gate$,"Hero's Tears";
set .@realm$,"Luina";
} else if (compare(strnpcinfo(4),"gef")) {
set .@npc$,"gef";
set .@name$,"Mizar";
set .@gate$,"Hill of the Dead";
set .@realm$,"Britoniah";
} else if (compare(strnpcinfo(4),"pay")) {
set .@npc$,"pay";
set .@name$,"Alkaid";
set .@gate$,"Winds of the Ancient";
set .@realm$,"Greenwood Lake";
} else if (compare(strnpcinfo(4),"prt")) {
set .@npc$,"prt";
set .@name$,"Arios";
set .@gate$,"Way of the Warrior";
set .@realm$,"Valkyrie Realm";
}
set .@n$,"["+.@name$+"]";
if (callfunc("F_Invest_Status") != 3) {
mes .@n$;
mes "There are currently no connected dungeon gates.";
close;
}
set .@status, getd("$"+.@npc$+"_invest_result");
if (.@status == 3) {
mes .@n$;
mes "We've successfully connected the Abyss Gate ["+.@gate$+"] with the help from your investment.";
mes "The Agit dungeon will be open to everyone with a small entrance fee in "+.@realm$+".";
next;
mes .@n$;
mes "Please visit as often as possible since the entrance fee is saved as an investment for the region.";
mes "Do you want to enter the Agit dungeon?";
next;
set .@i, select(.@realm$+" Dungeon 1F - 10000z:"+.@realm$+" Dungeon 2F - 10000z:Cancel");
if (.@i == 3) {
mes .@n$;
mes "Canceled.";
close;
}
if (Zeny < 10000) {
mes .@n$;
mes "I'm collecting a small entrance fee.";
mes "Your contribution will be saved for the next investment.";
mes "Entrance fee is 10000z.";
close;
}
mes .@n$;
mes "I'm sending you to the "+.@realm$+" Agit Dungeon "+.@i+"F.";
set Zeny, Zeny-10000;
setd "$fund_"+.@npc$+"_extra", getd("$fund_"+.@npc$+"_extra") + 1;
close2;
if (compare(strnpcinfo(2),"alde"))
warp "gld_dun02"+((.@i == 2)?"_2":""),32,122;