1 | //===== eAthena Script ======================================= |
---|
2 | //= War of Emperium - WoE Auto-Start |
---|
3 | //===== By: ================================================== |
---|
4 | //= kalen (1.0) |
---|
5 | //= 1.1 by Akaru and ho|yAnge| |
---|
6 | //===== Current Version: ===================================== |
---|
7 | //= 1.9 |
---|
8 | //===== Compatible With: ===================================== |
---|
9 | //= eAthena SVN; RO Episode 4+ |
---|
10 | //===== Description: ========================================= |
---|
11 | //= Auto Start for War of Emperium |
---|
12 | //============================================= |
---|
13 | //= gettime(3): Gets hour (24 hour time) |
---|
14 | //= gettime(4): Gets day of week 1=Monday, 2=Tuesday, |
---|
15 | //= 3=Wednesday, 4=Thursday, etc. |
---|
16 | //===== Additional Comments: ================================= |
---|
17 | //= v1.1a changed OnInit to OnAgitInit.[kobra_k88] |
---|
18 | //= v1.2 added gettime checks. removed $AgitStarted var.[kobra_k88] |
---|
19 | //= v1.3 Moved treasure spawn time here.[kobra_k88] |
---|
20 | //= v1.3a Implemented Shadowlady's idea to allow for different |
---|
21 | //= start/stop times on different days.[kobra_k88] |
---|
22 | //= 1.4 Fixed treasure chests spawn! We had to unroll some loops |
---|
23 | //= Now they appear in castles from 00:01 to 00:24. [Lupus] |
---|
24 | //= 1.5 Fixed WOE end messages on non-WOE days, by Avaj |
---|
25 | //= 1.5a missing tabs [KarLaeda] |
---|
26 | //= 1.6 Corrected multiple "WoE has begun" announces [ultramage] |
---|
27 | //= 1.7 Commented out the WoE start and end announces. [L0ne_W0lf] |
---|
28 | //= 1.8 Castle owners displayed when WoE starts and finished. [L0ne_W0lf] |
---|
29 | //= 1.8a Will now report unoccupied castles at start/end. [L0ne_W0lf] |
---|
30 | //= 1.8b Whoops. Fixed a mistake :D [L0ne_W0lf] |
---|
31 | //= 1.9 Rearranged the time-checks so they no longer use goto. [L0ne_W0lf] |
---|
32 | //= Removed treasure spawning function calls. (No longer needed) |
---|
33 | //============================================================ |
---|
34 | //| To know how to set up WoE times, go to doc\woe_time_explanation.txt |
---|
35 | // WoE Start/Stop times |
---|
36 | //====================================== |
---|
37 | - script Agit_Event -1,{ |
---|
38 | end; |
---|
39 | |
---|
40 | OnClock2100: //start time for Tues(2), Thurs(4) |
---|
41 | OnClock2300: //end time for Tues(2), Thurs(4) |
---|
42 | OnClock1600: //start time for Sat(6) |
---|
43 | OnClock1800: //end time for Sat(6) |
---|
44 | |
---|
45 | OnAgitInit: |
---|
46 | // starting time checks |
---|
47 | if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23) || |
---|
48 | (gettime(4)==4) && (gettime(3)>=21 && gettime(3)<23) || |
---|
49 | (gettime(4)==6) && (gettime(3)>=16 && gettime(3)<18)) { |
---|
50 | if (!agitcheck()) { |
---|
51 | AgitStart; |
---|
52 | callsub S_DisplayOwners; |
---|
53 | } |
---|
54 | end; |
---|
55 | } |
---|
56 | |
---|
57 | // end time checks |
---|
58 | if ((gettime(4)==2) && (gettime(3)==23) || |
---|
59 | (gettime(4)==4) && (gettime(3)==23) || |
---|
60 | (gettime(4)==6) && (gettime(3)==18)) { |
---|
61 | if (agitcheck()) { |
---|
62 | AgitEnd; |
---|
63 | callsub S_DisplayOwners; |
---|
64 | } |
---|
65 | end; |
---|
66 | } |
---|
67 | end; |
---|
68 | |
---|
69 | S_DisplayOwners: |
---|
70 | setarray .@maps$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05"; |
---|
71 | setarray .@maps$[5],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05"; |
---|
72 | setarray .@maps$[10],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05"; |
---|
73 | setarray .@maps$[15],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05"; |
---|
74 | for( set .@i, 0; .@i <= 19; set .@i, .@i+1 ) { |
---|
75 | if (GetCastleData(.@maps$[.@i],1)) { |
---|
76 | Announce "The [" + GetCastleName(.@maps$[.@i]) + "] castle has been conquered by the [" + GetGuildName(GetCastleData(.@maps$[.@i],1)) + "] guild.",bc_all; |
---|
77 | } |
---|
78 | else { |
---|
79 | Announce "The [" + GetCastleName(.@maps$[.@i]) + "] castle is currently unoccupied.",bc_all; |
---|
80 | } |
---|
81 | } |
---|
82 | end; |
---|
83 | } |
---|