root/npc/events/nguild/nguild_ev_agit.txt @ 1

Revision 1, 6.3 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= War of Emperium - NGuild Wars Events
3//===== By: ==================================================
4//= kobra_k88
5//===== Current Version: =====================================
6//= 1.4
7//===== Compatible With: =====================================
8//= eAthena 0.1+; RO Episode 4+
9//===== Description: =========================================
10//= Event Triggers for NGuild Wars
11//===== Additional Comments: =================================
12// Based off existing guild scripts.  Do not know if it is accurate.[kobra_k88]
13//= 1.3 Added code for abandoning captured castles on /breakguild [Lupus]
14//= 1.4 AGIT Functions added, treasure spawning added. [L0ne_W0lf]
15//============================================================
16
17
18// Function for OnAgitStart =========================================
19function        script  F_AgitStart     {
20        set .@map$, getarg(0);
21        set .@castle$, getarg(1);
22        set .@empx, getarg(2);
23        set .@empy, getarg(3);
24
25        MapRespawnGuildID .@map$,GetCastleData(.@map$,1),2;
26        monster .@map$,.@empx,.@empy,"Emperium",1288,1,"Agit_"+.@castle$+"::OnAgitBreak";
27        GvgOn .@map$;
28        if (GetCastleData(.@map$,1) != 0) return;
29        end;
30}
31
32// Function for OnGuildBreak ======================================
33function        script  F_GuildBreak    {
34        set .@map$, getarg(0);
35        set .@castle$, getarg(1);
36
37        killmonsterall .@map$;
38
39        Announce "Guild Base [" + GetCastleName(.@map$) + "] has been abandoned.",0;
40        disablenpc "Kafra Staff#"+.@castle$;
41
42        SetCastleData .@map$,0,0;
43        return;
44}
45
46// Function for OnAgitBreak ======================================
47function        script  F_AgitBreak     {
48        set .@map$, getarg(0);
49        set .@castle$, getarg(1);
50
51        set .@GID,getcharid(2);
52        if (.@GID <= 0) return;
53
54        set .@Economy,GetCastleData(.@map$,2) - 5;
55        if (.@Economy < 0) set .@Economy, 0;
56        SetCastleData .@map$, 2, .@Economy;
57
58        set .@Defence,GetCastleData(.@map$,3) - 5;
59        if (.@Defence < 0) set .@Defence, 0;
60        SetCastleData .@map$, 3, .@Defence;
61
62        SetCastleData .@map$,1, .@GID;
63        MapAnnounce .@map$,"The emperium has been destroyed.",bc_map,0x00CCFF;
64        Announce "The [" + GetCastleName(.@map$) + "] castle has been conquered by the [" + GetGuildName(.@GID) + "] guild.",bc_all;
65        GetCastleData .@map$,0,"::OnRecvCastle"+.@castle$;
66
67        disablenpc "Kafra Staff#"+.@castle$;
68
69        // remove investment data and kafra
70        for( set .@i, 4; .@i <= 9; set .@i, .@i+1 )
71                SetCastleData .@map$, .@i, 0;
72
73        // if the new guild doesn't have Guardian Research, erase guardians
74        if( getgdskilllv(.@GID,10002) == 0 )
75                for( set .@i, 10; .@i <= 17; set .@i, .@i+1 )
76                        SetCastleData .@map$, .@i, 0;
77
78        return;
79}
80
81
82// Function for OnAgitEnd ======================================
83function        script  F_AgitEnd       {
84        set .@map$, getarg(0);
85        set .@castle$, getarg(1);
86
87        GvgOff .@map$;
88        // Disable the following if statment to keep empty
89        // castles from being aquired after after WoE ends.
90        if (GetCastleData(.@map$,1) == 0) return;
91        MapRespawnGuildID .@map$,GetCastleData(.@map$,1),4;
92        KillMonster .@map$,"Agit_"+.@castle$+"::OnAgitBreak";
93        end;
94}
95
96// Castle 1 ================================================================
97nguild_alde,0,0,0       script  Agit_N01        -1,{
98OnInterIfInitOnce:
99        GetCastleData "nguild_alde",0,"::OnRecvCastleN01";
100        end;
101OnRecvCastleN01:
102        RequestGuildInfo GetCastleData("nguild_alde",1);
103        end;
104OnAgitStart:
105        callfunc "F_AgitStart","nguild_alde","N01",216,24;
106        end;
107OnAgitBreak:
108        callfunc "F_AgitBreak","nguild_alde","N01";
109        end;
110OnGuildBreak:
111        callfunc "F_GuildBreak","nguild_alde","N01";
112        end;
113OnAgitEliminate:
114        MapRespawnGuildID "nguild_alde",GetCastleData("nguild_alde",1),6;
115        Monster "nguild_alde",216,24,"EMPERIUM",1288,1,"Agit_N01::OnAgitBreak";
116        end;
117OnAgitEnd:
118        callfunc "F_AgitEnd","nguild_alde","N01";
119        end;
120}
121
122// Castle 2 ================================================================
123nguild_gef,0,0,0        script  Agit_N02        -1,{
124OnInterIfInitOnce:
125        GetCastleData "nguild_gef",0,"::OnRecvCastleN02";
126        end;
127OnRecvCastleN02:
128        RequestGuildInfo GetCastleData("nguild_gef",1);
129        end;
130OnAgitStart:
131        callfunc "F_AgitStart","nguild_gef","N02",198,182;
132        end;
133OnAgitBreak:
134        callfunc "F_AgitBreak","nguild_gef","N02";
135        end;
136OnGuildBreak:
137        callfunc "F_GuildBreak","nguild_gef","N02";
138        end;
139OnAgitEliminate:
140        MapRespawnGuildID "nguild_gef",GetCastleData("nguild_gef",1),6;
141        Monster "nguild_gef",198,182,"EMPERIUM",1288,1,"Agit_N02::OnAgitBreak";
142        end;
143OnAgitEnd:
144        callfunc "F_AgitEnd","nguild_gef","N02";
145        end;
146}
147
148// Castle 3 ================================================================
149nguild_pay,0,0,0        script  Agit_N03        -1,{
150OnInterIfInitOnce:
151        GetCastleData "nguild_pay",0,"::OnRecvCastleN03";
152        end;
153OnRecvCastleN03:
154        RequestGuildInfo GetCastleData("nguild_pay",1);
155        end;
156OnAgitStart:
157        callfunc "F_AgitStart","nguild_pay","N03",139,139;
158        end;
159OnAgitBreak:
160        callfunc "F_AgitBreak","nguild_pay","N03";
161        end;
162OnGuildBreak:
163        callfunc "F_GuildBreak","nguild_pay","N03";
164        end;
165OnAgitEliminate:
166        MapRespawnGuildID "nguild_pay",GetCastleData("nguild_pay",1),6;
167        Monster "nguild_pay",139,139,"EMPERIUM",1288,1,"Agit_N03::OnAgitBreak";
168        end;
169OnAgitEnd:
170        callfunc "F_AgitEnd","nguild_pay","N03";
171        end;
172}
173
174// Castle 4 ================================================================
175nguild_prt,0,0,0        script  Agit_N04        -1,{
176OnInterIfInitOnce:
177        GetCastleData "nguild_prt",0,"::OnRecvCastleN04";
178        end;
179OnRecvCastleN04:
180        RequestGuildInfo GetCastleData("nguild_prt",1);
181        end;
182OnAgitStart:
183        callfunc "F_AgitStart","nguild_prt","N04",197,197;
184        end;
185OnAgitBreak:
186        callfunc "F_AgitBreak","nguild_prt","N04";
187        end;
188OnGuildBreak:
189        callfunc "F_GuildBreak","nguild_prt","N04";
190        end;
191OnAgitEliminate:
192        MapRespawnGuildID "nguild_prt",GetCastleData("nguild_prt",1),6;
193        Monster "nguild_prt",197,197,"EMPERIUM",1288,1,"Agit_N04::OnAgitBreak";
194        end;
195OnAgitEnd:
196        callfunc "F_AgitEnd","nguild_prt","N04";
197        end;
198}
199
200// Treasure Spawn Time
201//========================================
202-       script  TreasSpawn      -1,{
203        end;
204
205OnClock0005:
206        callfunc "F_GldTreas","nguild_alde","N01",$boxNumN01,$@bxN01,$@boxIdN01,1324,114,218,123,227,0;
207        callfunc "F_GldTreas","nguild_gef","N02",$boxNumN02,$@bxN02,$@boxIdN02,1334,150,108,158,114,0;
208        callfunc "F_GldTreas","nguild_pay","N03",$boxNumN03,$@bxN03,$@boxIdN03,1344,286,4,295,13,0;
209        callfunc "F_GldTreas","nguild_prt","N04",$boxNumN04,$@bxN04,$@boxIdN04,1354,6,204,15,213,0;
210        end;
211}
Note: See TracBrowser for help on using the browser.