root/npc/guild2/arug_cas02.txt @ 7

Revision 1, 88.1 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= War of Emperium Second Edition
3//===== By: ==================================================
4//= L0ne_W0lf
5//===== Current Version: =====================================
6//= 1.4
7//===== Compatible With: =====================================
8//= eAthena SVN
9//===== Description: =========================================
10//= WoE SE Arunafeltz Castle 2
11//===== Additional Comments: =================================
12//= 1.0 First Version [L0ne_W0lf]
13//= 1.1 Swaped an end for a close in eco investing. [L0ne_W0lf]
14//= 1.2 Fixed double message in defense investing. [L0ne_W0lf]
15//=     Corrected a minor typo in the guild steward.
16//= 1.3 Fixed a guardian spawning NPCs. [L0ne_W0lf]
17//= 1.4 Fixed investment period not resetting. [L0ne_W0lf]
18//=     Made it so treasure won't spawn if castle is empty.
19//=     Treasure will now be killed before spawning.
20//============================================================
21
22arug_cas02,1,1,0        script  Manager#aru02_02        111,{
23        end;
24
25OnInterIfInitOnce:
26        GetCastleData "arug_cas02",0,"::OnRecvCastleAr02";
27        end;
28
29OnRecvCastleAr02:
30        RequestGuildInfo GetCastleData("arug_cas02",1);
31        if (GetCastleData("arug_cas02",1) == 0) {
32                donpcevent "Manager#aru02_02::Onstart";
33        }
34        end;
35
36OnAgitStart:
37        if (agitcheck()) {
38                MapRespawnGuildID "arug_cas02",GetCastleData("arug_cas02",1),2;
39                GvgOn "arug_cas02";
40                donpcevent "Manager#aru02_02::Onstart";
41        }
42        else {
43                donpcevent "#aru02_RL00::OnDisable";
44                donpcevent "#aru02_RL01::OnDisable";
45                donpcevent "#aru02_RL02::OnDisable";
46                donpcevent "#aru02_RL03::OnDisable";
47        }
48        end;
49
50OnAgitEnd:
51        GvgOff "arug_cas02";
52        if (GetCastleData("arug_cas02",1)) {
53                KillMonster "arug_cas02","Steward#aru02::OnStartArena";
54                donpcevent "Manager#aru02_02::Onreset";
55                donpcevent "Steward#aru02::Onstop";
56        }
57        end;
58
59Onstart:
60        // 1st Guardian stone, 2nd Guardian stone, Barrier 1, Barrier 2, Barrier 3, Summon Guardians
61        // Settings for all but Summon Guardians
62        // 0 = Okay; 1 = Destroyed; 2 = Repairing
63        // Summon Guardians
64        // 0 = Do not Summon; 1 = Summon
65        if (GetCastleData("arug_cas02",1)) {
66                setarray $agit_ar02[0],0,0,0,0,0,0;
67                donpcevent "#aru02_df01::OnEnable";
68                donpcevent "#aru02_df02::OnEnable";
69                donpcevent "#aru02_RL00::OnEnable";
70                donpcevent "#aru02_RL01::OnEnable";
71                donpcevent "#aru02_RL02::OnEnable";
72                donpcevent "#aru02_RL03::OnEnable";
73        }
74        monster "arug_cas02",89,256,"Emperium",1288,1,"Steward#aru02::OnStartArena";
75        end;
76
77Onreset:
78        donpcevent "#aru02_df01::OnDisable";
79        donpcevent "#aru02_df02::OnDisable";
80        donpcevent "#aru02_gard01::Onreset";
81        donpcevent "#aru02_gard02::Onreset";
82        donpcevent "#aru02_RL00::OnDisable";
83        donpcevent "#aru02_RL01::OnDisable";
84        donpcevent "#aru02_RL02::OnDisable";
85        donpcevent "#aru02_RL03::OnDisable";
86        donpcevent "1st Guardian Stone#aru02::OnDisable";
87        donpcevent "2nd Guardian Stone#aru02::OnDisable";
88        donpcevent "Control Device01#aru02::OnDisable";
89        donpcevent "Control Device02#aru02::OnDisable";
90        donpcevent "Control Device03#aru02::OnDisable";
91        if (agitcheck()) {
92                setarray $agit_ar02[0],0,0,1,1,1,0;
93        }
94        end;
95
96Onchange:
97        setarray $agit_ar02[0],2,2,1,1,2,0;
98        monster "arug_cas02",89,256,"Emperium",1288,1,"Steward#aru02::OnStartArena";
99        donpcevent "Control Device03#aru02::OnEnable";
100        donpcevent "1st Guardian Stone#aru02::OnEnable";
101        donpcevent "2nd Guardian Stone#aru02::OnEnable";
102        end;
103
104OnClock0001:
105        if (!GetCastleData("arug_cas02",1)) end;
106        killmonster "arug_cas02","Manager#aru02_02::OnTreasureDied";
107
108        setcastledata "arug_cas02",4,0;
109        setcastledata "arug_cas02",5,0;
110
111        set .@Treasure,GetCastleData("arug_cas02",2)/5+4;
112        if (.@Treasure) {
113                monster "arug_cas02",382,231,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
114                monster "arug_cas02",383,231,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
115                monster "arug_cas02",384,231,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
116                monster "arug_cas02",385,231,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
117                if (.@Treasure < 5) end;
118                monster "arug_cas02",386,231,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
119                if (.@Treasure < 6) end;
120                monster "arug_cas02",387,231,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
121                if (.@Treasure < 7) end;
122                monster "arug_cas02",384,230,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
123                if (.@Treasure < 8) end;
124                monster "arug_cas02",385,230,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
125                if (.@Treasure < 9) end;
126                monster "arug_cas02",386,230,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
127                if (.@Treasure < 10) end;
128                monster "arug_cas02",387,230,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
129                if (.@Treasure < 11) end;
130                monster "arug_cas02",388,230,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
131                if (.@Treasure < 12) end;
132                monster "arug_cas02",389,230,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
133                if (.@Treasure < 13) end;
134                monster "arug_cas02",382,225,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
135                if (.@Treasure < 14) end;
136                monster "arug_cas02",383,225,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
137                if (.@Treasure < 15) end;
138                monster "arug_cas02",384,225,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
139                if (.@Treasure < 16) end;
140                monster "arug_cas02",385,225,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
141                if (.@Treasure < 17) end;
142                monster "arug_cas02",386,225,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
143                if (.@Treasure < 18) end;
144                monster "arug_cas02",387,225,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
145                if (.@Treasure < 19) end;
146                monster "arug_cas02",384,224,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
147                if (.@Treasure < 20) end;
148                monster "arug_cas02",385,224,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
149                if (.@Treasure < 21) end;
150                monster "arug_cas02",386,224,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
151                if (.@Treasure < 22) end;
152                monster "arug_cas02",387,224,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
153                if (.@Treasure < 23) end;
154                monster "arug_cas02",388,224,"Treasure Chest",1944,1,"Manager#aru02_02::OnTreasureDied";
155                if (.@Treasure < 24) end;
156                monster "arug_cas02",389,224,"Treasure Chest",1324,1,"Manager#aru02_02::OnTreasureDied";
157        }
158        end;
159
160OnTreasureDied:
161        end;
162}
163
164arug_cas02,38,259,5     script  Yumenes#aru02_01        868,{
165        set .@GID, GetCastleData("arug_cas02",1);
166        if (.@GID == 0) {
167                mes "[Yumenes]";
168                mes "Great job. Now, all you";
169                mes "need to do is destroy this";
170                mes "Emperium to gain ownership";
171                mes "over this stronghold.";
172                close;
173        }
174        if (getcharid(2) == .@GID) {
175                if (strcharinfo(0) != getguildmaster(.@GID)) {
176                        mes "[Brace]";
177                        mes "As guardian of this";
178                        mes "stronghold, I answer only";
179                        mes "to the master of the guild";
180                        mes "that controls this place.";
181                        close;
182                }
183                else {
184                        if (agitcheck() == 0) {
185                                mes "[Yumenes]";
186                                mes "I am Yumenes, guardian of";
187                                mes "this stronghold. For now,";
188                                mes "all is quiet in this place.";
189                                next;
190                                switch(select("Converse:Cancel")) {
191                                case 1:
192                                        mes "[Yumenes]";
193                                        mes "Do you have any questions";
194                                        mes "about this stronghold?";
195                                        next;
196                                        switch(select("Guardian Stones:Fortress Gates:Link Flags:Battle Strategy:Cancel")) {
197                                        case 1:
198                                                mes "[Yumenes]";
199                                                mes "There is one Emperium";
200                                                mes "and two Guardian Stones in";
201                                                mes "each fortress. These stones";
202                                                mes "are the first line of defense,";
203                                                mes "and must be destroyed before";
204                                                mes "enemies can even enter.";
205                                                next;
206                                                mes "[Yumenes]";
207                                                mes "The stones are located in";
208                                                mes "^4D4DFFGate Houses^000000 which must be";
209                                                mes "protected to prevent enemies";
210                                                mes "from reaching the Emperium.";
211                                                mes "Guardian Stones can ^4D4DFFrecall";
212                                                mes "your Guardians^000000 for protection.";
213                                                next;
214                                                mes "[Yumenes]";
215                                                mes "Fortresses with higher levels";
216                                                mes "of defense can summon more";
217                                                mes "Guardians: this is why it is";
218                                                mes "so important for guilds to";
219                                                mes "invest in Defense Growth.";
220                                                next;
221                                                mes "[Yumenes]";
222                                                mes "Guardian Stones that have";
223                                                mes "been destroyed can be revived";
224                                                mes "after a certain time, but one of^FFFFFF ^000000 the guild members must give";
225                                                mes "me the order. I can also report^FFFFFF ^000000 the status of the Guardian Stones.";
226                                                close;
227                                        case 2:
228                                                mes "[Yumenes]";
229                                                mes "^4D4DFFFortress Gates^000000 are the second ^FFFFFF ^000000 line of guild stronghold defense,";
230                                                mes "and are protected by extra barricades activated by the Guardian Stones.";
231                                                mes "These gates are located in three different parts of the fortress.";
232                                                next;
233                                                mes "[Yumenes]";
234                                                mes "Barricades are protected by";
235                                                mes "Guardian Stones, and are";
236                                                mes "restored when the Guardian";
237                                                mes "Stones are retrieved. However,";
238                                                mes "it is not as easy to restore";
239                                                mes "destroyed Fortress Gates.";
240                                                next;
241                                                mes "[Yumenes]";
242                                                mes "Fortress Gates can only be";
243                                                mes "restored when the ^4D4DFFguild";
244                                                mes "master of a stronghold";
245                                                mes "changes^000000, or if ^4D4DFFrestoration";
246                                                mes "is requested by the guild";
247                                                mes "master of the stronghold^000000.";
248                                                close;
249                                        case 3:
250                                                mes "[Yumenes]";
251                                                mes "Strongholds have many";
252                                                mes "Link Flags that allow you";
253                                                mes "to access vital areas within";
254                                                mes "restrictions placed by the";
255                                                mes "Barricades. Usually, ^4D4DFFFlag 1";
256                                                mes "links to the Gate House^000000.";
257                                                next;
258                                                mes "[Yumenes]";
259                                                mes "Many flags link directly to";
260                                                mes "the flag near the Emperium.";
261                                                mes "The final numbered flag is";
262                                                mes "linked to the Convenience";
263                                                mes "Facility of the stronghold's";
264                                                mes "owner. Keep this in mind.";
265                                                close;
266                                        case 4:
267                                                mes "[Yumenes]";
268                                                mes "Strategy? It would be better";
269                                                mes "to develop your battle plan to";
270                                                mes "exploit your guild's advantages";
271                                                mes "and your enemies' weaknesses.";
272                                                mes "Use the Gate Houses and Barricades, and rebuild as quickly as you can!";
273                                                close;
274                                        case 5:
275                                                mes "[Yumenes]";
276                                                mes "You have no questions";
277                                                mes "to ask of me? Well, I'm";
278                                                mes "here to serve your needs.";
279                                                close;
280                                        }
281                                case 2:
282                                        mes "[Yumenes]";
283                                        mes "I'm always here, so";
284                                        mes "feel free to request my";
285                                        mes "assistance whenever";
286                                        mes "the need arises.";
287                                        close;
288                                }
289                        }
290                        else {
291                                mes "[Yumenes]";
292                                mes "Greetings, "+strcharinfo(0)+".";
293                                mes "What are your orders?";
294                                next;
295                                switch(select("Increase Stronghold Defense:Situational Briefing:Cancel")) {
296                                case 1:
297                                        if ($agit_ar02[5] == 0) {
298                                                if (getgdskilllv(.@GID,10002) == 0) {
299                                                        mes "[Yumenes]";
300                                                        mes "I'm sorry, but the Guardian";
301                                                        mes "Stones aren't powerful enough";
302                                                        mes "to summon Guardians yet. We";
303                                                        mes "need to accumulate more";
304                                                        mes "knowledge before they can";
305                                                        mes "summon any Guardians.";
306                                                        close;
307                                                }
308                                                else {
309                                                        mes "[Yumenes]";
310                                                        mes "I shall endeavor to summon";
311                                                        mes "a Guardian through a Guardian";
312                                                        mes "Stone. However, keep in mind";
313                                                        mes "that this will not work if the";
314                                                        mes "Guardian Stone is destroyed.";
315                                                        setarray $agit_ar02[5],1;
316                                                        if ($agit_ar02[0] == 0) {
317                                                                donpcevent "#aru02_gard01::OnEnable";
318                                                        }
319                                                        if ($agit_ar02[1] == 0) {
320                                                                donpcevent "#aru02_gard02::OnEnable";
321                                                        }
322                                                        close;
323                                                }
324                                        }
325                                        else {
326                                                mes "[Yumenes]";
327                                                mes "You've already commanded";
328                                                mes "me to summon a Guardian";
329                                                mes "to defend the stronghold.";
330                                                close;
331                                        }
332                                case 2:
333                                        mes "[Yumenes]";
334                                        mes "Our defense status is...";
335                                        if ($agit_ar02[0] == 1) {
336                                                mes "1st Guardian Stone: ^FF0000Destroyed^000000";
337                                        }
338                                        else if ($agit_ar02[0] == 2) {
339                                                mes "1st Guardian Stone: ^008000Repairing^000000";
340                                        }
341                                        else {
342                                                mes "1st Guardian Stone: ^4D4DFFOperational^000000";
343                                        }
344                                        if ($agit_ar02[1] == 1) {
345                                                mes "2nd Guardian Stone: ^FF0000Destroyed^000000";
346                                        }
347                                        else if ($agit_ar02[1] == 2) {
348                                                mes "2nd Guardian Stone: ^008000Repairing^000000";
349                                        }
350                                        else {
351                                                mes "2nd Guardian Stone: ^4D4DFFOperational^000000";
352                                        }
353                                        if ($agit_ar02[2] == 1) {
354                                                mes "1st Fortress Gate: ^FF0000Destroyed^000000";
355                                        }
356                                        else if ($agit_ar02[2] == 2) {
357                                                mes "1st Fortress Gate: ^008000Repairing^000000";
358                                        }
359                                        else {
360                                                mes "1st Fortress Gate: ^4D4DFFOperational^000000";
361                                        }
362                                        if ($agit_ar02[3] == 1) {
363                                                mes "2nd Fortress Gate: ^FF0000Destroyed^000000";
364                                        }
365                                        else if ($agit_ar02[3] == 2) {
366                                                mes "2nd Fortress Gate: ^008000Repairing^000000";
367                                        }
368                                        else {
369                                                mes "2nd Fortress Gate: ^4D4DFFOperational^000000";
370                                        }
371                                        if ($agit_ar02[4] == 1) {
372                                                mes "3rd Fortress Gate: ^FF0000Destroyed^000000";
373                                        }
374                                        else if ($agit_ar02[4] == 2) {
375                                                mes "3rd Fortress Gate: ^008000Repairing^000000";
376                                        }
377                                        else {
378                                                mes "3rd Fortress Gate: ^4D4DFFOperational^000000";
379                                        }
380                                        close;
381                                case 3:
382                                        mes "[Yumenes]";
383                                        mes "I'll be standing by,";
384                                        mes "awaiting your orders.";
385                                        close;
386                                }
387                        }
388                }
389        }
390        else {
391                mes "[Yumenes]";
392                mes "Who are you? Scoundrel!";
393                mes "Leave this stronghold now!";
394                close;
395        }
396
397OnInit:
398        setarray $agit_ar02[0],0,0,0,0,0,0;
399        end;
400}
401
402arug_cas02,1,1,0        script  #aru02_gard01   -1,{
403OnEnable:
404        set .@defence,GetCastleData("arug_cas02",3);
405        guardian "arug_cas02",104,32,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //0;
406        if ((.@defence > 10) && (.@defence < 31)) {
407                set .MyMobCount,2;
408                guardian "arug_cas02",67,36,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //1;
409        }
410        else if ((.@defence > 30) && (.@defence < 51)) {
411                set .MyMobCount,3;
412                guardian "arug_cas02",67,36,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //1;
413                guardian "arug_cas02",67,85,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //2;
414        }
415        else if ((.@defence > 50) && (.@defence < 71)) {
416                set .MyMobCount,4;
417                guardian "arug_cas02",67,36,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //1;
418                guardian "arug_cas02",67,85,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //2;
419                guardian "arug_cas02",113,87,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //3;
420        }
421        else if (.@defence > 70) {
422                set .MyMobCount,5;
423                guardian "arug_cas02",67,36,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //1;
424                guardian "arug_cas02",67,85,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //2;
425                guardian "arug_cas02",113,87,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //3;
426                guardian "arug_cas02",122,112,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //4;
427        }
428        else {
429                set .MyMobCount,2;
430                guardian "arug_cas02",20,169,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //1;
431        }
432        initnpctimer;
433        end;
434
435OnTimer300000:
436        set .MyMobCount,.MyMobCount+1;
437        guardian "arug_cas02",67,60,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //5;
438        mapannounce "arug_cas02","The 1st Guardian has been summoned from the Gate House.",bc_map,"0xff4500";
439        end;
440
441OnTimer900000:
442        set .MyMobCount,.MyMobCount+1;
443        guardian "arug_cas02",90,167,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //6;
444        mapannounce "arug_cas02","The 2nd Guardian has been summoned from the Gate House.",bc_map,"0xff4500";
445        end;
446
447OnTimer1800000:
448        set .MyMobCount,.MyMobCount+1;
449        guardian "arug_cas02",91,119,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //7;
450        mapannounce "arug_cas02","The 3rd Guardian has been summoned from the Gate House.",bc_map,"0xff4500";
451        end;
452
453OnTimer2700000:
454        set .MyMobCount,.MyMobCount+1;
455        guardian "arug_cas02",122,112,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //8;
456        mapannounce "arug_cas02","The 4th Guardian has been summoned from the Gate House.",bc_map,"0xff4500";
457        end;
458
459OnTimer3600000:
460        set .MyMobCount,.MyMobCount+1;
461        guardian "arug_cas02",20,169,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //9;
462        mapannounce "arug_cas02","The 5th Guardian has been summoned from the Gate House.",bc_map,"0xff4500";
463        stopnpctimer;
464        end;
465
466OnGuardianDied:
467        set .MyMobCount,.MyMobCount-1;
468        if (.MyMobCount < 2) {
469                set .MyMobCount,.MyMobCount+1;
470                guardian "arug_cas02",67,85,"Guardian",1899,"#aru02_gard01::OnGuardianDied"; //10;
471        }
472        end;
473
474Onreset:
475        stopnpctimer;
476        killmonster "arug_cas02","#aru02_gard01::OnGuardianDied";
477        end;
478}
479
480arug_cas02,1,2,0        script  #aru02_gard02   -1,{
481OnEnable:
482        set .@defence,GetCastleData("arug_cas02",3);
483        guardian "arug_cas02",175,31,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //11;
484        if ((.@defence > 10) && (.@defence < 31)) {
485                set .MyMobCount,2;
486                guardian "arug_cas02",204,32,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //12;
487        }
488        else if ((.@defence > 30) && (.@defence < 51)) {
489                set .MyMobCount,3;
490                guardian "arug_cas02",204,32,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //12;
491                guardian "arug_cas02",211,63,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //13;
492        }
493        else if ((.@defence > 50) && (.@defence < 71)) {
494                set .MyMobCount,4;
495                guardian "arug_cas02",204,32,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //12;
496                guardian "arug_cas02",211,63,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //13;
497                guardian "arug_cas02",209,88,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //14;
498        }
499        else if (.@defence > 70) {
500                set .MyMobCount,5;
501                guardian "arug_cas02",204,32,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //12;
502                guardian "arug_cas02",211,63,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //13;
503                guardian "arug_cas02",209,88,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //14;
504                guardian "arug_cas02",161,91,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //15;
505        }
506        else {
507                set .MyMobCount,2;
508                guardian "arug_cas02",268,169,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //12;
509        }
510        initnpctimer;
511        end;
512
513OnTimer600000:
514        set .MyMobCount,.MyMobCount+1;
515        guardian "arug_cas02",186,170,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //16;
516        end;
517
518OnTimer1200000:
519        set .MyMobCount,.MyMobCount+1;
520        guardian "arug_cas02",183,121,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //17;
521        end;
522
523OnTimer2100000:
524        set .MyMobCount,.MyMobCount+1;
525        guardian "arug_cas02",150,110,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //18;
526        end;
527
528OnTimer3000000:
529        set .MyMobCount,.MyMobCount+1;
530        guardian "arug_cas02",161,91,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //19;
531        end;
532
533OnTimer3900000:
534        set .MyMobCount,.MyMobCount+1;
535        guardian "arug_cas02",209,88,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //20;
536        stopnpctimer;
537        end;
538
539OnGuardianDied:
540        set .MyMobCount,.MyMobCount-1;
541        if (.MyMobCount < 2) {
542                set .MyMobCount,.MyMobCount+1;
543                guardian "arug_cas02",211,63,"Guardian",1899,"#aru02_gard02::OnGuardianDied"; //21;
544        }
545        end;
546
547Onreset:
548        stopnpctimer;
549        killmonster "arug_cas02","#aru02_gard02::OnGuardianDied";
550        end;
551}
552
553arug_cas02,1,3,0        script  #aru02_df01     -1,{
554OnEnable:
555        guardian "arug_cas02",33,168,"1st Guardian Stone",1907,"#aru02_df01::OnGuardianStoneDied"; //22;
556        end;
557
558OnDisable:
559        killmonster "arug_cas02","#aru02_df01::OnGuardianStoneDied";
560        setarray $agit_ar02[0],1; //Global Variable
561        stopnpctimer;
562        end;
563
564OnGuardianStoneDied:
565        // 1st Guardian Stone is Destroyed
566        setarray $agit_ar02[0],1;
567        if (($agit_ar02[0] == 1) || ($agit_ar02[0] == 2)) {
568                set .@destroyed,.@destroyed + 1;
569        }
570        if (($agit_ar02[1] == 1) || ($agit_ar02[1] == 2)) {
571                set .@destroyed,.@destroyed + 1;
572        }
573        if (.@destroyed == 2) {
574                mapannounce "arug_cas02","All of the Guardian Stones have been destroyed!",bc_map,"0x00ff00";
575                donpcevent "#aru02_RL00::OnDisable";
576                donpcevent "#aru02_gard01::Onreset";
577        }
578        else {
579                mapannounce "arug_cas02","The 1st Guardian Stone has been destroyed!",bc_map,"0x00ff00";
580                donpcevent "#aru02_gard01::Onreset";
581        }
582        initnpctimer;
583        end;
584
585OnTimer300000:
586        donpcevent "1st Guardian Stone#aru02::OnGuardian";
587        setarray $agit_ar02[0],2; //Global Variable
588        stopnpctimer;
589        end;
590}
591
592arug_cas02,33,168,0     script  1st Guardian Stone#aru02        844,{
593        set .@GID, GetCastleData("arug_cas02",1);
594        if (getcharid(2) == .@GID) {
595                mes "^3355FFYou will need the";
596                mes "following materials to";
597                mes "rebuild a destroyed";
598                mes "Guardian Stone.^000000";
599                next;
600                mes "1 Oridecon";
601                mes "1 Elunium";
602                mes "30 Stones";
603                mes "5 Blue Gemstones";
604                mes "5 Yellow Gemstones";
605                mes "5 Red Gemstones";
606                next;
607                mes "^3355FFDo you want to continue?^000000";
608                switch(select("No:Continue")) {
609                case 1:
610                        mes "^3355FFWork canceled.^000000";
611                        close;
612                case 2:
613                        if ((countitem(984) > 0) && (countitem(985) > 0) && (countitem(7049) > 29) && (countitem(717) > 4) && (countitem(715) > 4) && (countitem(716) > 4)) {
614                                mes "^3355FFArrange Stones, Elunium, and";
615                                mes "Oridecon, in that order, in the";
616                                mes "center. Then you must arrange";
617                                mes "the enchanted Gemstones to";
618                                mes "rebuild the Guardian Stone.^000000";
619                                next;
620                                switch(select("Elunium:Oridecon:Stone")) {
621                                case 1:
622                                        mes "^3355FFElunium has been";
623                                        mes "placed in the center.^000000";
624                                        next;
625                                        break;
626                                case 2:
627                                        mes "^3355FFOridecon has been";
628                                        mes "placed in the center.^000000";
629                                        next;
630                                        break;
631                                case 3:
632                                        mes "^3355FFStones have been";
633                                        mes "placed in the center.^000000";
634                                        set .@nice,.@nice+10;
635                                        next;
636                                        break;
637                                }
638                                switch(select("Elunium:Oridecon:Stone")) {
639                                case 1:
640                                        mes "^3355FFYou have lined the";
641                                        mes "outside of the center";
642                                        mes "with some Elunium.^000000";
643                                        set .@nice,.@nice+10;
644                                        next;
645                                        break;
646                                case 2:
647                                        mes "^3355FFYou have lined the";
648                                        mes "outside of the center";
649                                        mes "with some Oridecon.^000000";
650                                        next;
651                                        break;
652                                case 3:
653                                        mes "^3355FFYou have lined the";
654                                        mes "outside of the center";
655                                        mes "with some Stones.^000000";
656                                        next;
657                                        break;
658                                }
659                                switch(select("Elunium:Oridecon:Stone")) {
660                                case 1:
661                                        mes "^3355FFYou covered the";
662                                        mes "rest of the materials";
663                                        mes "with some Elunium.^000000";
664                                        next;
665                                        break;
666                                case 2:
667                                        mes "^3355FFYou covered the";
668                                        mes "rest of the materials";
669                                        mes "with some Oridecon.^000000";
670                                        set .@nice,.@nice+10;
671                                        next;
672                                        break;
673                                case 3:
674                                        mes "^3355FFYou covered the";
675                                        mes "rest of the materials";
676                                        mes "with some Stones.^000000";
677                                        next;
678                                        break;
679                                }
680                                mes "^3355FFNow you need to arrange";
681                                mes "the enchanted Gemstones";
682                                mes "accordingly. You can identify";
683                                mes "their Magic properties by";
684                                mes "their casting effect.^000000";
685                                next;
686                                while(1) {
687                                        if (.@roof0 > 7) {
688                                                break;
689                                        }
690                                        else {
691                                                switch(rand(1,3)) {
692                                                case 1:
693                                                        specialeffect 54; //"1st Guardian Stone#aru02" EF_BEGINSPELL2
694                                                        mes "^3355FFThe Gemstones must";
695                                                        mes "be arranged in the correct";
696                                                        mes "order according to their";
697                                                        mes "magic properties and power.^000000";
698                                                        next;
699                                                        switch(select("Red Gemstone:Yellow Gemstone:Blue Gemstone")) {
700                                                        case 1:
701                                                                mes "^3355FFYou placed the Red Gemstone.";
702                                                                mes "However, the Guardian Stone";
703                                                                mes "Repair System failed because";
704                                                                mes "of a magic power conflict.^000000";
705                                                                close;
706                                                        case 2:
707                                                                mes "^3355FFYou placed the Yellow Gemstone.";
708                                                                mes "However, the Guardian Stone";
709                                                                mes "Repair System failed because";
710                                                                mes "of a magic power conflict.^000000";
711                                                                close;
712                                                        case 3:
713                                                                mes "^3355FFYou placed the Blue Gemstone.^000000";
714                                                                set .@nice,.@nice+10;
715                                                                set .@roof0,.@roof0 + 1;
716                                                                specialeffect 18; //"1st Guardian Stone#aru02" EF_STEAL
717                                                                next;
718                                                                break;
719                                                        }
720                                                        break;
721                                                case 2:
722                                                        specialeffect 225; //"1st Guardian Stone#aru02" EF_VOLCANO
723                                                        mes "^3355FFThe Gemstones must";
724                                                        mes "be arranged in the correct";
725                                                        mes "order according to their";
726                                                        mes "magic properties and power.^000000";
727                                                        next;
728                                                        switch(select("Red Gemstone:Yellow Gemstone:Blue Gemstone")) {
729                                                        case 1:
730                                                                mes "^3355FFYou placed the Red Gemstone.^000000";
731                                                                set .@nice,.@nice+10;
732                                                                set .@roof0,.@roof0 + 1;
733                                                                specialeffect 18; //"1st Guardian Stone#aru02" EF_STEAL
734                                                                next;
735                                                                break;
736                                                        case 2:
737                                                                mes "^3355FFYou placed the Yellow Gemstone.";
738                                                                mes "However, the Guardian Stone";
739                                                                mes "Repair System failed because";
740                                                                mes "of a magic power conflict.^000000";
741                                                                close;
742                                                        case 3:
743                                                                mes "^3355FFYou placed the Blue Gemstone.";
744                                                                mes "However, the Guardian Stone";
745                                                                mes "Repair System failed because";
746                                                                mes "of a magic power conflict.^000000";
747                                                                close;
748                                                        }
749                                                        break;
750                                                case 3:
751                                                        specialeffect 56; //"1st Guardian Stone#aru02" EF_BEGINSPELL4
752                                                        mes "^3355FFThe Gemstones must";
753                                                        mes "be arranged in the correct";
754                                                        mes "order according to their";
755                                                        mes "magic properties and power.^000000";
756                                                        next;
757                                                        switch(select("Red Gemstone:Yellow Gemstone:Blue Gemstone")) {
758                                                        case 1:
759                                                                mes "^3355FFYou placed the Red Gemstone.";
760                                                                mes "However, the Guardian Stone";
761                                                                mes "Repair System failed because";
762                                                                mes "of a magic power conflict.^000000";
763                                                                close;
764                                                        case 2:
765                                                                mes "^3355FFYou placed the Yellow Gemstone.^000000";
766                                                                set .@nice,.@nice+10;
767                                                                set .@roof0,.@roof0 + 1;
768                                                                specialeffect 18; //"1st Guardian Stone#aru02" EF_STEAL
769                                                                next;
770                                                                break;
771                                                        case 3:
772                                                                mes "^3355FFYou placed the Blue Gemstone.";
773                                                                mes "However, the Guardian Stone";
774                                                                mes "Repair System failed because";
775                                                                mes "of a magic power conflict.^000000";
776                                                                close;
777                                                        }
778                                                }
779                                        }
780                                }
781                                if (.@nice > 90) {
782                                        if ($agit_ar02[0] == 0) {
783                                                mes "^3355FFThe Guardian Stone";
784                                                mes "Repair System has";
785                                                mes "already completed.^000000";
786                                                close;
787                                        }
788                                        else {
789                                                if (agitcheck() == 0) {
790                                                        mes "^3355FFIt is impossible to";
791                                                        mes "rebuild the Guardian";
792                                                        mes "Stone because the";
793                                                        mes "Emperium is not present.^000000";
794                                                        close;
795                                                }
796                                                else {
797                                                        mes "^3355FFThe Gemstones have been";
798                                                        mes "arranged, and the Guardian";
799                                                        mes "Stone is successfully repaired.^000000";
800                                                        delitem 984,1; //Oridecon
801                                                        delitem 985,1; //Elunium
802                                                        delitem 7049,30; //Stone
803                                                        delitem 717,5; //Blue_Gemstone
804                                                        delitem 715,5; //Yellow_Gemstone
805                                                        delitem 716,5; //Red_Gemstone
806                                                        close2;
807                                                        donpcevent "#aru02_df01::OnEnable";
808                                                        specialeffect 135; //"1st Guardian Stone#aru02" EF_ICECRASH
809                                                        disablenpc "1st Guardian Stone#aru02";
810                                                        setarray $agit_ar02[0],0;
811                                                        set .@df_all,$agit_ar02[0]+$agit_ar02[1];
812                                                        if (.@df_all == 0) {
813                                                                mapannounce "arug_cas02","Both Guardian Stones have been erected, bolstering this stronghold's defenses!",bc_map,"0x00ff00";
814                                                                donpcevent "#aru02_RL00::OnEnable";
815                                                        }
816                                                        else {
817                                                                mapannounce "arug_cas02","The 1st Guardian Stone has been repaired successfully.",bc_map,"0x00ff00";
818                                                        }
819                                                        if ($agit_ar02[5] == 1) {
820                                                                donpcevent "#aru02_gard01::OnEnable";
821                                                        }
822                                                        end;
823                                                }
824                                        }
825                                }
826                                else {
827                                        mes "^3355FFAfter all of that work...";
828                                        mes "It looks like you failed";
829                                        mes "to fix the Guardian Stone,";
830                                        mes "and lost some materials.^000000";
831                                        delitem 7049,10; //Stone
832                                        delitem 717,2; //Blue_Gemstone
833                                        delitem 715,2; //Yellow_Gemstone
834                                        delitem 716,2; //Red_Gemstone
835                                        close;
836                                }
837                        }
838                        else {
839                                mes "^3355FFYou don't have enough";
840                                mes "materials to repair";
841                                mes "the Guardian Stone.^000000";
842                                close;
843                        }
844                }
845        }
846        end;
847
848OnInit:
849        disablenpc "1st Guardian Stone#aru02";
850        end;
851
852OnEnable:
853        enablenpc "1st Guardian Stone#aru02";
854        specialeffect 247; //"1st Guardian Stone#aru02" EF_MAPPILLAR2
855        end;
856
857OnDisable:
858        disablenpc "1st Guardian Stone#aru02";
859        end;
860}
861
862arug_cas02,1,4,0        script  #aru02_df02     -1,{
863OnEnable:
864        guardian "arug_cas02",245,168,"2nd Guardian Stone",1908,"#aru02_df02::OnGuardianStoneDied"; //23;
865        end;
866
867OnDisable:
868        killmonster "arug_cas02","#aru02_df02::OnGuardianStoneDied";
869        setarray $agit_ar02[1],1; //Global Variable
870        stopnpctimer;
871        end;
872
873OnGuardianStoneDied:
874        // 2nd Guardian Stone is Destroyed
875        setarray $agit_ar02[1],1;
876        if (($agit_ar02[0] == 1) || ($agit_ar02[0] == 2)) {
877                set .@destroyed,.@destroyed + 1;
878        }
879        if (($agit_ar02[1] == 1) || ($agit_ar02[1] == 2)) {
880                set .@destroyed,.@destroyed + 1;
881        }
882        if (.@destroyed == 2) {
883                mapannounce "arug_cas02","All of the Guardian Stones have been destroyed!",bc_map,"0x00ff00";
884                donpcevent "#aru02_RL00::OnDisable";
885                donpcevent "#aru02_gard02::Onreset";
886        }
887        else {
888                mapannounce "arug_cas02","The 2nd Guardian Stone has been destroyed!",bc_map,"0x00ff00";
889                donpcevent "#aru02_gard02::Onreset";
890        }
891        initnpctimer;
892        end;
893
894OnTimer300000:
895        donpcevent "2nd Guardian Stone#aru02::OnGuardian";
896        setarray $agit_ar02[1],2; //Global Variable
897        stopnpctimer;
898        end;
899}
900
901arug_cas02,245,168,0    script  2nd Guardian Stone#aru02        844,{
902        set .@GID, GetCastleData("arug_cas02",1);
903        if (getcharid(2) == .@GID) {
904                mes "^3355FFYou will need the";
905                mes "following materials to";
906                mes "rebuild a destroyed";
907                mes "Guardian Stone.^000000";
908                next;
909                mes "1 Oridecon";
910                mes "1 Elunium";
911                mes "30 Stones";
912                mes "5 Blue Gemstones";
913                mes "5 Yellow Gemstones";
914                mes "5 Red Gemstones";
915                next;
916                mes "^3355FFDo you want to continue?^000000";
917                switch(select("No:Continue")) {
918                case 1:
919                        mes "^3355FFWork canceled.^000000";
920                        close;
921                case 2:
922                        if ((countitem(984) > 0) && (countitem(985) > 0) && (countitem(7049) > 29) && (countitem(717) > 4) && (countitem(715) > 4) && (countitem(716) > 4)) {
923                                mes "^3355FFArrange Stones, Elunium, and";
924                                mes "Oridecon, in that order, in the";
925                                mes "center. Then you must arrange";
926                                mes "the enchanted Gemstones to";
927                                mes "rebuild the Guardian Stone.^000000";
928                                next;
929                                switch(select("Elunium:Oridecon:Stone")) {
930                                case 1:
931                                        mes "^3355FFElunium has been";
932                                        mes "placed in the center.^000000";
933                                        next;
934                                        break;
935                                case 2:
936                                        mes "^3355FFOridecon has been";
937                                        mes "placed in the center.^000000";
938                                        next;
939                                        break;
940                                case 3:
941                                        mes "^3355FFStones have been";
942                                        mes "placed in the center.^000000";
943                                        set .@nice,.@nice+10;
944                                        next;
945                                        break;
946                                }
947                                switch(select("Elunium:Oridecon:Stone")) {
948                                case 1:
949                                        mes "^3355FFYou have lined the";
950                                        mes "outside of the center";
951                                        mes "with some Elunium.^000000";
952                                        set .@nice,.@nice+10;
953                                        next;
954                                        break;
955                                case 2:
956                                        mes "^3355FFYou have lined the";
957                                        mes "outside of the center";
958                                        mes "with some Oridecon.^000000";
959                                        next;
960                                        break;
961                                case 3:
962                                        mes "^3355FFYou have lined the";
963                                        mes "outside of the center";
964                                        mes "with some Stones.^000000";
965                                        next;
966                                        break;
967                                }
968                                switch(select("Elunium:Oridecon:Stone")) {
969                                case 1:
970                                        mes "^3355FFYou covered the";
971                                        mes "rest of the materials";
972                                        mes "with some Elunium.^000000";
973                                        next;
974                                        break;
975                                case 2:
976                                        mes "^3355FFYou covered the";
977                                        mes "rest of the materials";
978                                        mes "with some Oridecon.^000000";
979                                        set .@nice,.@nice+10;
980                                        next;
981                                        break;
982                                case 3:
983                                        mes "^3355FFYou covered the";
984                                        mes "rest of the materials";
985                                        mes "with some Stones.^000000";
986                                        next;
987                                        break;
988                                }
989                                mes "^3355FFNow you need to arrange";
990                                mes "the enchanted Gemstones";
991                                mes "accordingly. You can identify";
992                                mes "their Magic properties by";
993                                mes "their casting effect.^000000";
994                                next;
995                                while(1) {
996                                        if (.@roof0 > 7) {
997                                                break;
998                                        }
999                                        else {
1000                                                switch(rand(1,3)) {
1001                                                case 1:
1002                                                        specialeffect 54; //"2nd Guardian Stone#aru02" EF_BEGINSPELL2
1003                                                        mes "^3355FFThe Gemstones must";
1004                                                        mes "be arranged in the correct";
1005                                                        mes "order according to their";
1006                                                        mes "magic properties and power.^000000";
1007                                                        next;
1008                                                        switch(select("Red Gemstone:Yellow Gemstone:Blue Gemstone")) {
1009                                                        case 1:
1010                                                                mes "^3355FFYou placed the Red Gemstone.";
1011                                                                mes "However, the Guardian Stone";
1012                                                                mes "Repair System failed because";
1013                                                                mes "of a magic power conflict.^000000";
1014                                                                close;
1015                                                        case 2:
1016                                                                mes "^3355FFYou placed the Yellow Gemstone.";
1017                                                                mes "However, the Guardian Stone";
1018                                                                mes "Repair System failed because";
1019                                                                mes "of a magic power conflict.^000000";
1020                                                                close;
1021                                                        case 3:
1022                                                                mes "^3355FFYou placed the Blue Gemstone.^000000";
1023                                                                set .@nice,.@nice+10;
1024                                                                set .@roof0,.@roof0 + 1;
1025                                                                specialeffect 18; //"2nd Guardian Stone#aru02" EF_STEAL
1026                                                                next;
1027                                                                break;
1028                                                        }
1029                                                        break;
1030                                                case 2:
1031                                                        specialeffect 225; //"2nd Guardian Stone#aru02" EF_VOLCANO
1032                                                        mes "^3355FFThe Gemstones must";
1033                                                        mes "be arranged in the correct";
1034                                                        mes "order according to their";
1035                                                        mes "magic properties and power.^000000";
1036                                                        next;
1037                                                        switch(select("Red Gemstone:Yellow Gemstone:Blue Gemstone")) {
1038                                                        case 1:
1039                                                                mes "^3355FFYou placed the Red Gemstone.^000000";
1040                                                                set .@nice,.@nice+10;
1041                                                                set .@roof0,.@roof0 + 1;
1042                                                                specialeffect 18; //"2nd Guardian Stone#aru02" EF_STEAL
1043                                                                next;
1044                                                                break;
1045                                                        case 2:
1046                                                                mes "^3355FFYou placed the Yellow Gemstone.";
1047                                                                mes "However, the Guardian Stone";
1048                                                                mes "Repair System failed because";
1049                                                                mes "of a magic power conflict.^000000";
1050                                                                close;
1051                                                        case 3:
1052                                                                mes "^3355FFYou placed the Blue Gemstone.";
1053                                                                mes "However, the Guardian Stone";
1054                                                                mes "Repair System failed because";
1055                                                                mes "of a magic power conflict.^000000";
1056                                                                close;
1057                                                        }
1058                                                        break;
1059                                                case 3:
1060                                                        specialeffect 56; //"2nd Guardian Stone#aru02" EF_BEGINSPELL4
1061                                                        mes "^3355FFThe Gemstones must";
1062                                                        mes "be arranged in the correct";
1063                                                        mes "order according to their";
1064                                                        mes "magic properties and power.^000000";
1065                                                        next;
1066                                                        switch(select("Red Gemstone:Yellow Gemstone:Blue Gemstone")) {
1067                                                        case 1:
1068                                                                mes "^3355FFYou placed the Red Gemstone.";
1069                                                                mes "However, the Guardian Stone";
1070                                                                mes "Repair System failed because";
1071                                                                mes "of a magic power conflict.^000000";
1072                                                                close;
1073                                                        case 2:
1074                                                                mes "^3355FFYou placed the Yellow Gemstone.^000000";
1075                                                                set .@nice,.@nice+10;
1076                                                                set .@roof0,.@roof0 + 1;
1077                                                                specialeffect 18; //"2nd Guardian Stone#aru02" EF_STEAL
1078                                                                next;
1079                                                                break;
1080                                                        case 3:
1081                                                                mes "^3355FFYou placed the Blue Gemstone.";
1082                                                                mes "However, the Guardian Stone";
1083                                                                mes "Repair System failed because";
1084                                                                mes "of a magic power conflict.^000000";
1085                                                                close;
1086                                                        }
1087                                                }
1088                                        }
1089                                }
1090                                if (.@nice > 90) {
1091                                        if ($agit_ar02[1] == 0) {
1092                                                mes "^3355FFThe Guardian Stone";
1093                                                mes "Repair System has";
1094                                                mes "successfully completed.^000000";
1095                                                close;
1096                                        }
1097                                        else {
1098                                                if (agitcheck() == 0) {
1099                                                        mes "^3355FFIt is impossible to";
1100                                                        mes "rebuild the Guardian";
1101                                                        mes "Stone because the";
1102                                                        mes "Emperium is not present.^000000";
1103                                                        close;
1104                                                }
1105                                                else {
1106                                                        mes "^3355FFThe Gemstones have been";
1107                                                        mes "arranged, and the Guardian";
1108                                                        mes "Stone is successfully repaired.^000000";
1109                                                        delitem 984,1; //Oridecon
1110                                                        delitem 985,1; //Elunium
1111                                                        delitem 7049,30; //Stone
1112                                                        delitem 717,5; //Blue_Gemstone
1113                                                        delitem 715,5; //Yellow_Gemstone
1114                                                        delitem 716,5; //Red_Gemstone
1115                                                        close2;
1116                                                        donpcevent "#aru02_df02::OnEnable";
1117                                                        specialeffect 135; //"2nd Guardian Stone#aru02" EF_ICECRASH
1118                                                        disablenpc "2nd Guardian Stone#aru02";
1119                                                        setarray $agit_ar02[1],0;
1120                                                        set .@df_all,$agit_ar02[0]+$agit_ar02[1];
1121                                                        if (.@df_all == 0) {
1122                                                                mapannounce "arug_cas02","Both Guardian Stones have been erected, bolstering this stronghold's defenses!",bc_map,"0x00ff00";
1123                                                                donpcevent "#aru02_RL00::OnEnable";
1124                                                        }
1125                                                        else {
1126                                                                mapannounce "arug_cas02","The 2nd Guardian Stone has been repaired successfully.",bc_map,"0x00ff00";
1127                                                        }
1128                                                        if ($agit_ar02[5] == 1) {
1129                                                                donpcevent "#aru02_gard02::OnEnable";
1130                                                        }
1131                                                        end;
1132                                                }
1133                                        }
1134                                }
1135                                else {
1136                                        mes "^3355FFAfter all of that work...";
1137                                        mes "It looks like you failed";
1138                                        mes "to fix the Guardian Stone,";
1139                                        mes "and lost some materials.^000000";
1140                                        delitem 7049,10; //Stone
1141                                        delitem 717,2; //Blue_Gemstone
1142                                        delitem 715,2; //Yellow_Gemstone
1143                                        delitem 716,2; //Red_Gemstone
1144                                        close;
1145                                }
1146                        }
1147                        else {
1148                                mes "^3355FFYou don't have enough";
1149                                mes "materials to repair";
1150                                mes "the Guardian Stone.^000000";
1151                                close;
1152                        }
1153                }
1154        }
1155        end;
1156
1157OnInit:
1158        disablenpc "2nd Guardian Stone#aru02";
1159        end;
1160
1161OnEnable:
1162        enablenpc "2nd Guardian Stone#aru02";
1163        specialeffect 247; //"2nd Guardian Stone#aru02" EF_MAPPILLAR2
1164        end;
1165
1166OnDisable:
1167        disablenpc "2nd Guardian Stone#aru02";
1168        end;
1169}
1170
1171// Barrier Summoners
1172arug_cas02,2,1,0        script  #aru02_RL00     -1,{
1173OnEnable:
1174        setcell "arug_cas02",136,136,143,136,cell_walkable,0;
1175        setcell "arug_cas02",136,136,143,136,cell_shootable,0;
1176        guardian "arug_cas02",137,137," ",1905,"#aru02_RL00::OnBarrierDestroyed"; //24;
1177        guardian "arug_cas02",139,137," ",1905,"#aru02_RL00::OnBarrierDestroyed"; //25;
1178        guardian "arug_cas02",141,137," ",1905,"#aru02_RL00::OnBarrierDestroyed"; //26;
1179        guardian "arug_cas02",143,137," ",1905,"#aru02_RL00::OnBarrierDestroyed"; //27;
1180        end;
1181
1182OnDisable:
1183        setcell "arug_cas02",136,136,143,136,cell_walkable,1;
1184        setcell "arug_cas02",136,136,143,136,cell_shootable,1;
1185        killmonster "arug_cas02","#aru02_RL00::OnBarrierDestroyed";
1186        end;
1187
1188OnBarrierDestroyed:
1189        end;
1190}
1191
1192arug_cas02,2,2,0        script  #aru02_RL01     -1,{
1193OnEnable:
1194        set .MyMobCount,6;
1195        setcell "arug_cas02",150,223,161,223,cell_walkable,0;
1196        guardian "arug_cas02",151,222," ",1905,"#aru02_RL01::OnBarrierDestroyed"; //28;
1197        guardian "arug_cas02",153,222," ",1905,"#aru02_RL01::OnBarrierDestroyed"; //29;
1198        guardian "arug_cas02",155,222," ",1905,"#aru02_RL01::OnBarrierDestroyed"; //30;
1199        guardian "arug_cas02",157,222," ",1905,"#aru02_RL01::OnBarrierDestroyed"; //31;
1200        guardian "arug_cas02",159,222," ",1905,"#aru02_RL01::OnBarrierDestroyed"; //32;
1201        guardian "arug_cas02",161,222," ",1905,"#aru02_RL01::OnBarrierDestroyed"; //33;
1202        end;
1203
1204OnBarrierDestroyed:
1205        set .MyMobCount,.MyMobCount-1;
1206        if (.MyMobCount == 0) {
1207                setarray $agit_ar02[2],1;
1208                mapannounce "arug_cas02","The 1st Fortress Gate is destroyed.",bc_map,"0x00ff00";
1209                setcell "arug_cas02",150,223,161,223,cell_walkable,1;
1210        }
1211        end;
1212
1213OnDisable:
1214        setcell "arug_cas02",150,223,161,223,cell_walkable,1;
1215        killmonster "arug_cas02","#aru02_RL01::OnBarrierDestroyed";
1216        end;
1217}
1218
1219arug_cas02,2,3,0        script  #aru02_RL02     -1,{
1220OnEnable:
1221        set .MyMobCount,6;
1222        setcell "arug_cas02",125,342,125,349,cell_walkable,0;
1223        guardian "arug_cas02",126,343," ",1905,"#aru02_RL02::OnBarrierDestroyed"; //34;
1224        guardian "arug_cas02",126,345," ",1905,"#aru02_RL02::OnBarrierDestroyed"; //35;
1225        guardian "arug_cas02",126,347," ",1905,"#aru02_RL02::OnBarrierDestroyed"; //36;
1226        guardian "arug_cas02",127,344," ",1905,"#aru02_RL02::OnBarrierDestroyed"; //37;
1227        guardian "arug_cas02",127,346," ",1905,"#aru02_RL02::OnBarrierDestroyed"; //38;
1228        guardian "arug_cas02",127,348," ",1905,"#aru02_RL02::OnBarrierDestroyed"; //39;
1229        end;
1230
1231OnBarrierDestroyed:
1232        set .MyMobCount,.MyMobCount-1;
1233        if (.MyMobCount == 0) {
1234                setarray $agit_ar02[3],1;
1235                mapannounce "arug_cas02","The 2nd Fortress Gate is destroyed.",bc_map,"0x00ff00";
1236                setcell "arug_cas02",125,342,125,349,cell_walkable,1;
1237        }
1238        end;
1239
1240OnDisable:
1241        setcell "arug_cas02",125,342,125,349,cell_walkable,1;
1242        killmonster "arug_cas02","#aru02_RL02::OnBarrierDestroyed";
1243        end;
1244}
1245
1246arug_cas02,2,4,0        script  #aru02_RL03     -1,{
1247OnEnable:
1248        set .MyMobCount,4;
1249        setcell "arug_cas02",38,314,49,314,cell_walkable,0;
1250        guardian "arug_cas02",40,315," ",1905,"#aru02_RL03::OnBarrierDestroyed"; //40;
1251        guardian "arug_cas02",42,315," ",1905,"#aru02_RL03::OnBarrierDestroyed"; //41;
1252        guardian "arug_cas02",44,315," ",1905,"#aru02_RL03::OnBarrierDestroyed"; //42;
1253        guardian "arug_cas02",46,315," ",1905,"#aru02_RL03::OnBarrierDestroyed"; //43;
1254        end;
1255
1256OnBarrierDestroyed:
1257        set .MyMobCount,.MyMobCount-1;
1258        if (.MyMobCount == 0) {
1259                setarray $agit_ar02[4],1;
1260                mapannounce "arug_cas02","The 3rd Fortress Gate is destroyed!",bc_map,"0x00ff00";
1261                setcell "arug_cas02",38,314,49,314,cell_walkable,1;
1262        }
1263        end;
1264
1265OnDisable:
1266        setcell "arug_cas02",38,314,49,314,cell_walkable,1;
1267        killmonster "arug_cas02","#aru02_RL03::OnBarrierDestroyed";
1268        end;
1269}
1270
1271arug_cas02,143,228,0    script  Control Device01#aru02  111,{
1272        set .@GID, GetCastleData("arug_cas02",1);
1273        if (getcharid(2) == .@GID) {
1274                if (strcharinfo(0) == getguildmaster(.@GID)) {
1275                        if ($agit_ar02[2] == 2) {
1276                                mes "^3355FFDemolished Fortress";
1277                                mes "Gates can be repaired,";
1278                                mes "but you will need to gather";
1279                                mes "the following materials.^000000";
1280                                next;
1281                                mes "^4D4DFF10 Steel^000000,";
1282                                mes "^4D4DFF30 Trunks^000000,";
1283                                mes "^4D4DFF5 Oridecon^000000, and";
1284                                mes "^4D4DFF10 Emveretarcon^000000.";
1285                                next;
1286                                select("Continue");
1287                                if ((countitem(1019) > 29) && (countitem(999) > 9) && (countitem(1011) > 9) && (countitem(984) > 4)) {
1288                                        mes "^3355FFYou will need Trunks to";
1289                                        mes "repair the support frame,";
1290                                        mes "Oridecon to enhance the";
1291                                        mes "gate's endurance, and";
1292                                        mes "Emveretarcon to basically";
1293                                        mes "hold everything together.^000000";
1294                                        next;
1295                                        set .@ro_of01,rand(10,15);
1296                                        while(1) {
1297                                                if (.@ro_of02 == .@ro_of01) {
1298                                                        break;
1299                                                }
1300                                                else {
1301                                                        switch(rand(1,4)) {
1302                                                        case 1:
1303                                                                mes "^3355FFThe support frame";
1304                                                                mes "is badly damaged:";
1305                                                                mes "fixing this part";
1306                                                                mes "is a top priority.^000000";
1307                                                                next;
1308                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1309                                                                case 1:
1310                                                                        mes "^3355FFThe frame has been";
1311                                                                        mes "reinforced with wood.^000000";
1312                                                                        set .@rp_temp,.@rp_temp + 1;
1313                                                                        set .@ro_of02,.@ro_of02 + 1;
1314                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1315                                                                        next;
1316                                                                        break;
1317                                                                case 2:
1318                                                                        mes "^3355FFYou tried using steel,";
1319                                                                        mes "but it's not working very";
1320                                                                        mes "well. You'll have to try";
1321                                                                        mes "something else.^000000";
1322                                                                        close;
1323                                                                case 3:
1324                                                                        mes "^3355FFYou tried using emveretarcon";
1325                                                                        mes "to reinforce the gate, but it's";
1326                                                                        mes "not working well at all.";
1327                                                                        mes "You'll have to start over.^000000";
1328                                                                        close;
1329                                                                case 4:
1330                                                                        mes "^3355FFYou tried using oridecon,";
1331                                                                        mes "but it's not working very";
1332                                                                        mes "well. You'll have to try";
1333                                                                        mes "something else.^000000";
1334                                                                        close;
1335                                                                }
1336                                                                break;
1337                                                        case 2:
1338                                                                mes "^3355FFIt looks like the gate's";
1339                                                                mes "overall endurance needs to";
1340                                                                mes "be reinforced with something.^000000";
1341                                                                next;
1342                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1343                                                                case 1:
1344                                                                        mes "^3355FFYou tried using wood";
1345                                                                        mes "to reinforce the gate.^000000";
1346                                                                        set .@ro_of02,.@ro_of02 + 1;
1347                                                                        next;
1348                                                                        break;
1349                                                                case 2:
1350                                                                        mes "^3355FFYou tried using steel";
1351                                                                        mes "to reinforce the gate, but";
1352                                                                        mes "it's not working well at all.";
1353                                                                        mes "You'll have to start over.^000000";
1354                                                                        close;
1355                                                                case 3:
1356                                                                        mes "^3355FFYou tried using emveretarcon";
1357                                                                        mes "to reinforce the gate, but it's";
1358                                                                        mes "not working well at all.";
1359                                                                        mes "You'll have to start over.^000000";
1360                                                                        close;
1361                                                                case 4:
1362                                                                        mes "^3355FFYou hammered the";
1363                                                                        mes "oridecon: it looks";
1364                                                                        mes "like this will work.^000000";
1365                                                                        set .@rp_temp,.@rp_temp + 1;
1366                                                                        set .@ro_of02,.@ro_of02 + 1;
1367                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1368                                                                        next;
1369                                                                        break;
1370                                                                }
1371                                                                break;
1372                                                        case 3:
1373                                                                mes "^3355FFThe damage to the gate";
1374                                                                mes "has caused all these";
1375                                                                mes "cracks. You'll have to";
1376                                                                mes "weld them solid somehow.^000000";
1377                                                                next;
1378                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1379                                                                case 1:
1380                                                                        mes "^3355FFYou tried using wood to fix";
1381                                                                        mes "this problem, but it seems";
1382                                                                        mes "to have made it worse.";
1383                                                                        mes "You'll have to start all over.^000000";
1384                                                                        close;
1385                                                                case 2:
1386                                                                        mes "^3355FFYou used steel to weld";
1387                                                                        mes "all the cracks: the gate is";
1388                                                                        mes "is starting to look more solid.^000000";
1389                                                                        set .@rp_temp,.@rp_temp + 1;
1390                                                                        set .@ro_of02,.@ro_of02 + 1;
1391                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1392                                                                        next;
1393                                                                        break;
1394                                                                case 3:
1395                                                                        mes "^3355FFYou tried using emveretarcon";
1396                                                                        mes "to reinforce the gate, but it's";
1397                                                                        mes "not working well at all.";
1398                                                                        mes "You'll have to start over.^000000";
1399                                                                        close;
1400                                                                case 4:
1401                                                                        mes "^3355FFYou tried using oridecon,";
1402                                                                        mes "but it's not working very";
1403                                                                        mes "well. You'll have to try";
1404                                                                        mes "something else.^000000";
1405                                                                        close;
1406                                                                }
1407                                                                break;
1408                                                        case 4:
1409                                                                mes "^3355FFNow you need to make";
1410                                                                mes "sure that the gate is held";
1411                                                                mes "together pretty solidly.^000000";
1412                                                                next;
1413                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1414                                                                case 1:
1415                                                                        mes "^3355FFYou tried using wood to fix";
1416                                                                        mes "this problem, but it seems";
1417                                                                        mes "to have made it worse.";
1418                                                                        mes "You'll have to start all over.^000000";
1419                                                                        close;
1420                                                                case 2:
1421                                                                        mes "^3355FFYou tried using steel,";
1422                                                                        mes "but it's not working very";
1423                                                                        mes "well. You'll have to try";
1424                                                                        mes "something else.^000000";
1425                                                                        close;
1426                                                                case 3:
1427                                                                        mes "^3355FFYou successfully used";
1428                                                                        mes "the emveretarcon to repair";
1429                                                                        mes "much of the gate's damage.^000000";
1430                                                                        set .@rp_temp,.@rp_temp + 1;
1431                                                                        set .@ro_of02,.@ro_of02 + 1;
1432                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1433                                                                        next;
1434                                                                        break;
1435                                                                case 4:
1436                                                                        mes "^3355FFYou tried using oridecon,";
1437                                                                        mes "but it's not working very";
1438                                                                        mes "well. You'll have to try";
1439                                                                        mes "something else.^000000";
1440                                                                        close;
1441                                                                }
1442                                                        }
1443                                                }
1444                                        }
1445                                        mes "^3355FFWell, it looks like";
1446                                        mes "you're just about done";
1447                                        mes "with repairing the gate.^000000";
1448                                        next;
1449                                        if (agitcheck() == 0) {
1450                                                mes "^3355FFUnfortunately, the Fortress";
1451                                                mes "Gate can't be reconstructed:";
1452                                                mes "the Emperium is no longer here.^000000";
1453                                                close;
1454                                        }
1455                                        else {
1456                                                if (.@rp_temp == .@ro_of01) {
1457                                                        mes "^3355FFThe Fortress Gate has";
1458                                                        mes "been successfully repaired!^000000";
1459                                                        delitem 1019,30; //Wooden_Block
1460                                                        delitem 999,10; //Steel
1461                                                        delitem 1011,10; //Emveretarcon
1462                                                        delitem 984,5; //Oridecon
1463                                                        close2;
1464                                                        donpcevent "#aru02_RL01::OnEnable";
1465                                                        disablenpc "Control Device01#aru02";
1466                                                        mapannounce "arug_cas02","The 1st Fortress Gate has been reconstructed!",bc_map,"0x00ff00";
1467                                                        setarray $agit_ar01[2],0;
1468                                                        end;
1469                                                }
1470                                                else {
1471                                                        mes "^3355FFThe wall has been breached,";
1472                                                        mes "and the attempt to repair the";
1473                                                        mes "Fortress Gate has failed.";
1474                                                        mes "You lost some of your";
1475                                                        mes "repair resources...^000000";
1476                                                        delitem 984,2; //Oridecon
1477                                                        delitem 999,4; //Steel
1478                                                        delitem 1019,14; //Wooden_Block
1479                                                        delitem 1011,3; //Emveretarcon
1480                                                        close;
1481                                                }
1482                                        }
1483                                }
1484                                else {
1485                                        mes "^3355FFYou can't attempt to repair";
1486                                        mes "the Fortress Gate if you don't";
1487                                        mes "have all the needed materials.^000000";
1488                                        close;
1489                                }
1490                        }
1491                }
1492        }
1493        end;
1494
1495OnInit:
1496        disablenpc "Control Device01#aru02";
1497        end;
1498
1499OnEnable:
1500        enablenpc "Control Device01#aru02";
1501        end;
1502
1503OnDisable:
1504        disablenpc "Control Device01#aru02";
1505        end;
1506}
1507
1508arug_cas02,118,356,0    script  Control Device02#aru02  111,{
1509        set .@GID, GetCastleData("arug_cas02",1);
1510        if (getcharid(2) == .@GID) {
1511                if (strcharinfo(0) == getguildmaster(.@GID)) {
1512                        if ($agit_ar02[3] == 2) {
1513                                mes "^3355FFDemolished Fortress";
1514                                mes "Gates can be repaired,";
1515                                mes "but you will need to gather";
1516                                mes "the following materials.^000000";
1517                                next;
1518                                mes "^4D4DFF10 Steel^000000,";
1519                                mes "^4D4DFF30 Trunks^000000,";
1520                                mes "^4D4DFF5 Oridecon^000000, and";
1521                                mes "^4D4DFF10 Emveretarcon^000000.";
1522                                next;
1523                                select("Continue");
1524                                if ((countitem(1019) > 29) && (countitem(999) > 9) && (countitem(1011) > 9) && (countitem(984) > 4)) {
1525                                        mes "^3355FFYou will need Trunks to";
1526                                        mes "repair the support frame,";
1527                                        mes "Oridecon to enhance the";
1528                                        mes "gate's endurance, and";
1529                                        mes "Emveretarcon to basically";
1530                                        mes "hold everything together.^000000";
1531                                        next;
1532                                        set .@ro_of01,rand(10,15);
1533                                        while(1) {
1534                                                if (.@ro_of02 == .@ro_of01) {
1535                                                        break;
1536                                                }
1537                                                else {
1538                                                        switch(rand(1,4)) {
1539                                                        case 1:
1540                                                                mes "^3355FFThe support frame";
1541                                                                mes "is badly damaged:";
1542                                                                mes "fixing this part";
1543                                                                mes "is a top priority.^000000";
1544                                                                next;
1545                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1546                                                                case 1:
1547                                                                        mes "^3355FFThe frame has been";
1548                                                                        mes "reinforced with wood.^000000";
1549                                                                        set .@rp_temp,.@rp_temp + 1;
1550                                                                        set .@ro_of02,.@ro_of02 + 1;
1551                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1552                                                                        next;
1553                                                                        break;
1554                                                                case 2:
1555                                                                        mes "^3355FFYou tried using steel,";
1556                                                                        mes "but it's not working very";
1557                                                                        mes "well. You'll have to try";
1558                                                                        mes "something else.^000000";
1559                                                                        close;
1560                                                                case 3:
1561                                                                        mes "^3355FFYou tried using emveretarcon";
1562                                                                        mes "to reinforce the gate, but it's";
1563                                                                        mes "not working well at all.";
1564                                                                        mes "You'll have to start over.^000000";
1565                                                                        close;
1566                                                                case 4:
1567                                                                        mes "^3355FFYou tried using oridecon,";
1568                                                                        mes "but it's not working very";
1569                                                                        mes "well. You'll have to try";
1570                                                                        mes "something else.^000000";
1571                                                                        close;
1572                                                                }
1573                                                                break;
1574                                                        case 2:
1575                                                                mes "^3355FFIt looks like the gate's";
1576                                                                mes "overall endurance needs to";
1577                                                                mes "be reinforced with something.^000000";
1578                                                                next;
1579                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1580                                                                case 1:
1581                                                                        mes "^3355FFYou tried using wood";
1582                                                                        mes "to reinforce the gate.^000000";
1583                                                                        set .@ro_of02,.@ro_of02 + 1;
1584                                                                        next;
1585                                                                        break;
1586                                                                case 2:
1587                                                                        mes "^3355FFYou tried using steel";
1588                                                                        mes "to reinforce the gate, but";
1589                                                                        mes "it's not working well at all.";
1590                                                                        mes "You'll have to start over.^000000";
1591                                                                        close;
1592                                                                case 3:
1593                                                                        mes "^3355FFYou tried using emveretarcon";
1594                                                                        mes "to reinforce the gate, but it's";
1595                                                                        mes "not working well at all.";
1596                                                                        mes "You'll have to start over.^000000";
1597                                                                        close;
1598                                                                case 4:
1599                                                                        mes "^3355FFYou hammered the";
1600                                                                        mes "oridecon: it looks";
1601                                                                        mes "like this will work.^000000";
1602                                                                        set .@rp_temp,.@rp_temp + 1;
1603                                                                        set .@ro_of02,.@ro_of02 + 1;
1604                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1605                                                                        next;
1606                                                                        break;
1607                                                                }
1608                                                                break;
1609                                                        case 3:
1610                                                                mes "^3355FFThe damage to the gate";
1611                                                                mes "has caused all these";
1612                                                                mes "cracks. You'll have to";
1613                                                                mes "weld them solid somehow.^000000";
1614                                                                next;
1615                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1616                                                                case 1:
1617                                                                        mes "^3355FFYou tried using wood to fix";
1618                                                                        mes "this problem, but it seems";
1619                                                                        mes "to have made it worse.";
1620                                                                        mes "You'll have to start all over.^000000";
1621                                                                        close;
1622                                                                case 2:
1623                                                                        mes "^3355FFYou used steel to weld";
1624                                                                        mes "all the cracks: the gate is";
1625                                                                        mes "is starting to look more solid.^000000";
1626                                                                        set .@rp_temp,.@rp_temp + 1;
1627                                                                        set .@ro_of02,.@ro_of02 + 1;
1628                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1629                                                                        next;
1630                                                                        break;
1631                                                                case 3:
1632                                                                        mes "^3355FFYou tried using emveretarcon";
1633                                                                        mes "to reinforce the gate, but it's";
1634                                                                        mes "not working well at all.";
1635                                                                        mes "You'll have to start over.^000000";
1636                                                                        close;
1637                                                                case 4:
1638                                                                        mes "^3355FFYou tried using oridecon,";
1639                                                                        mes "but it's not working very";
1640                                                                        mes "well. You'll have to try";
1641                                                                        mes "something else.^000000";
1642                                                                        close;
1643                                                                }
1644                                                                break;
1645                                                        case 4:
1646                                                                mes "^3355FFNow you need to make";
1647                                                                mes "sure that the gate is held";
1648                                                                mes "together pretty solidly.^000000";
1649                                                                next;
1650                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1651                                                                case 1:
1652                                                                        mes "^3355FFYou tried using wood to fix";
1653                                                                        mes "this problem, but it seems";
1654                                                                        mes "to have made it worse.";
1655                                                                        mes "You'll have to start all over.^000000";
1656                                                                        close;
1657                                                                case 2:
1658                                                                        mes "^3355FFYou tried using steel,";
1659                                                                        mes "but it's not working very";
1660                                                                        mes "well. You'll have to try";
1661                                                                        mes "something else.^000000";
1662                                                                        close;
1663                                                                case 3:
1664                                                                        mes "^3355FFYou successfully used";
1665                                                                        mes "the emveretarcon to repair";
1666                                                                        mes "much of the gate's damage.^000000";
1667                                                                        set .@rp_temp,.@rp_temp + 1;
1668                                                                        set .@ro_of02,.@ro_of02 + 1;
1669                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1670                                                                        next;
1671                                                                        break;
1672                                                                case 4:
1673                                                                        mes "^3355FFYou tried using oridecon,";
1674                                                                        mes "but it's not working very";
1675                                                                        mes "well. You'll have to try";
1676                                                                        mes "something else.^000000";
1677                                                                        close;
1678                                                                }
1679                                                        }
1680                                                }
1681                                        }
1682                                        mes "^3355FFWell, it looks like";
1683                                        mes "you're just about done";
1684                                        mes "with repairing the gate.^000000";
1685                                        next;
1686                                        if (agitcheck() == 0) {
1687                                                mes "^3355FFUnfortunately, the Fortress";
1688                                                mes "Gate can't be reconstructed:";
1689                                                mes "the Emperium is no longer here.^000000";
1690                                                close;
1691                                        }
1692                                        else {
1693                                                if (.@rp_temp == .@ro_of01) {
1694                                                        mes "^3355FFThe Fortress Gate has";
1695                                                        mes "been successfully repaired!^000000";
1696                                                        delitem 1019,30; //Wooden_Block
1697                                                        delitem 999,10; //Steel
1698                                                        delitem 1011,10; //Emveretarcon
1699                                                        delitem 984,5; //Oridecon
1700                                                        close2;
1701                                                        donpcevent "#aru02_RL02::OnEnable";
1702                                                        disablenpc "Control Device02#aru02";
1703                                                        mapannounce "arug_cas02","The 2nd Fortress Gate has been reconstructed!",bc_map,"0x00ff00";
1704                                                        setarray $agit_ar02[3],0; //Global Variable
1705                                                        setarray $agit_ar02[2],2; //Global Variable
1706                                                        donpcevent "Control Device01#aru02::OnDevice01#aru02_dlrp01";
1707                                                        end;
1708                                                }
1709                                                else {
1710                                                        mes "^3355FFThe wall has been breached,";
1711                                                        mes "and the attempt to repair the";
1712                                                        mes "Fortress Gate has failed.";
1713                                                        mes "You lost some of your";
1714                                                        mes "repair resources...^000000";
1715                                                        delitem 984,2; //Oridecon
1716                                                        delitem 999,4; //Steel
1717                                                        delitem 1019,14; //Wooden_Block
1718                                                        delitem 1011,3; //Emveretarcon
1719                                                        close;
1720                                                }
1721                                        }
1722                                }
1723                                else {
1724                                        mes "^3355FFYou can't attempt to repair";
1725                                        mes "the Fortress Gate if you don't";
1726                                        mes "have all the needed materials.^000000";
1727                                        close;
1728                                }
1729                        }
1730                }
1731        }
1732        end;
1733
1734OnInit:
1735        disablenpc "Control Device02#aru02";
1736        end;
1737
1738OnEnable:
1739        enablenpc "Control Device02#aru02";
1740        end;
1741
1742OnDisable:
1743        disablenpc "Control Device02#aru02";
1744        end;
1745}
1746
1747arug_cas02,56,308,0     script  Control Device03#aru02  111,{
1748        set .@GID, GetCastleData("arug_cas02",1);
1749        if (getcharid(2) == .@GID) {
1750                if (strcharinfo(0) == getguildmaster(.@GID)) {
1751                        if ($agit_ar02[4] == 2) {
1752                                mes "^3355FFDemolished Fortress";
1753                                mes "Gates can be repaired,";
1754                                mes "but you will need to gather";
1755                                mes "the following materials.^000000";
1756                                next;
1757                                mes "^4D4DFF10 Steel^000000,";
1758                                mes "^4D4DFF30 Trunks^000000,";
1759                                mes "^4D4DFF5 Oridecon^000000, and";
1760                                mes "^4D4DFF10 Emveretarcon^000000.";
1761                                next;
1762                                select("Continue");
1763                                if ((countitem(1019) > 29) && (countitem(999) > 9) && (countitem(1011) > 9) && (countitem(984) > 4)) {
1764                                        mes "^3355FFYou will need Trunks to";
1765                                        mes "repair the support frame,";
1766                                        mes "Oridecon to enhance the";
1767                                        mes "gate's endurance, and";
1768                                        mes "Emveretarcon to basically";
1769                                        mes "hold everything together.^000000";
1770                                        next;
1771                                        set .@ro_of01,rand(10,15);
1772                                        while(1) {
1773                                                if (.@ro_of02 == .@ro_of01) {
1774                                                        break;
1775                                                }
1776                                                else {
1777                                                        switch(rand(1,4)) {
1778                                                        case 1:
1779                                                                mes "^3355FFThe support frame";
1780                                                                mes "is badly damaged:";
1781                                                                mes "fixing this part";
1782                                                                mes "is a top priority.^000000";
1783                                                                next;
1784                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1785                                                                case 1:
1786                                                                        mes "^3355FFThe frame has been";
1787                                                                        mes "reinforced with wood.^000000";
1788                                                                        set .@rp_temp,.@rp_temp + 1;
1789                                                                        set .@ro_of02,.@ro_of02 + 1;
1790                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1791                                                                        next;
1792                                                                        break;
1793                                                                case 2:
1794                                                                        mes "^3355FFYou tried using steel,";
1795                                                                        mes "but it's not working very";
1796                                                                        mes "well. You'll have to try";
1797                                                                        mes "something else.^000000";
1798                                                                        close;
1799                                                                case 3:
1800                                                                        mes "^3355FFYou tried using emveretarcon";
1801                                                                        mes "to reinforce the gate, but it's";
1802                                                                        mes "not working well at all.";
1803                                                                        mes "You'll have to start over.^000000";
1804                                                                        close;
1805                                                                case 4:
1806                                                                        mes "^3355FFYou tried using oridecon,";
1807                                                                        mes "but it's not working very";
1808                                                                        mes "well. You'll have to try";
1809                                                                        mes "something else.^000000";
1810                                                                        close;
1811                                                                }
1812                                                                break;
1813                                                        case 2:
1814                                                                mes "^3355FFIt looks like the gate's";
1815                                                                mes "overall endurance needs to";
1816                                                                mes "be reinforced with something.^000000";
1817                                                                next;
1818                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1819                                                                case 1:
1820                                                                        mes "^3355FFYou tried using wood";
1821                                                                        mes "to reinforce the gate.^000000";
1822                                                                        set .@ro_of02,.@ro_of02 + 1;
1823                                                                        next;
1824                                                                        break;
1825                                                                case 2:
1826                                                                        mes "^3355FFYou tried using steel";
1827                                                                        mes "to reinforce the gate, but";
1828                                                                        mes "it's not working well at all.";
1829                                                                        mes "You'll have to start over.^000000";
1830                                                                        close;
1831                                                                case 3:
1832                                                                        mes "^3355FFYou tried using emveretarcon";
1833                                                                        mes "to reinforce the gate, but it's";
1834                                                                        mes "not working well at all.";
1835                                                                        mes "You'll have to start over.^000000";
1836                                                                        close;
1837                                                                case 4:
1838                                                                        mes "^3355FFYou hammered the";
1839                                                                        mes "oridecon: it looks";
1840                                                                        mes "like this will work.^000000";
1841                                                                        set .@rp_temp,.@rp_temp + 1;
1842                                                                        set .@ro_of02,.@ro_of02 + 1;
1843                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1844                                                                        next;
1845                                                                        break;
1846                                                                }
1847                                                                break;
1848                                                        case 3:
1849                                                                mes "^3355FFThe damage to the gate";
1850                                                                mes "has caused all these";
1851                                                                mes "cracks. You'll have to";
1852                                                                mes "weld them solid somehow.^000000";
1853                                                                next;
1854                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1855                                                                case 1:
1856                                                                        mes "^3355FFYou tried using wood to fix";
1857                                                                        mes "this problem, but it seems";
1858                                                                        mes "to have made it worse.";
1859                                                                        mes "You'll have to start all over.^000000";
1860                                                                        close;
1861                                                                case 2:
1862                                                                        mes "^3355FFYou used steel to weld";
1863                                                                        mes "all the cracks: the gate is";
1864                                                                        mes "is starting to look more solid.^000000";
1865                                                                        set .@rp_temp,.@rp_temp + 1;
1866                                                                        set .@ro_of02,.@ro_of02 + 1;
1867                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1868                                                                        next;
1869                                                                        break;
1870                                                                case 3:
1871                                                                        mes "^3355FFYou tried using emveretarcon";
1872                                                                        mes "to reinforce the gate, but it's";
1873                                                                        mes "not working well at all.";
1874                                                                        mes "You'll have to start over.^000000";
1875                                                                        close;
1876                                                                case 4:
1877                                                                        mes "^3355FFYou tried using oridecon,";
1878                                                                        mes "but it's not working very";
1879                                                                        mes "well. You'll have to try";
1880                                                                        mes "something else.^000000";
1881                                                                        close;
1882                                                                }
1883                                                                break;
1884                                                        case 4:
1885                                                                mes "^3355FFNow you need to make";
1886                                                                mes "sure that the gate is held";
1887                                                                mes "together pretty solidly.^000000";
1888                                                                next;
1889                                                                switch(select("Trunk:Steel:Emveretarcon:Oridecon")) {
1890                                                                case 1:
1891                                                                        mes "^3355FFYou tried using wood to fix";
1892                                                                        mes "this problem, but it seems";
1893                                                                        mes "to have made it worse.";
1894                                                                        mes "You'll have to start all over.^000000";
1895                                                                        close;
1896                                                                case 2:
1897                                                                        mes "^3355FFYou tried using steel,";
1898                                                                        mes "but it's not working very";
1899                                                                        mes "well. You'll have to try";
1900                                                                        mes "something else.^000000";
1901                                                                        close;
1902                                                                case 3:
1903                                                                        mes "^3355FFYou successfully used";
1904                                                                        mes "the emveretarcon to repair";
1905                                                                        mes "much of the gate's damage.^000000";
1906                                                                        set .@rp_temp,.@rp_temp + 1;
1907                                                                        set .@ro_of02,.@ro_of02 + 1;
1908                                                                        specialeffect2 101; // EF_REPAIRWEAPON
1909                                                                        next;
1910                                                                        break;
1911                                                                case 4:
1912                                                                        mes "^3355FFYou tried using oridecon,";
1913                                                                        mes "but it's not working very";
1914                                                                        mes "well. You'll have to try";
1915                                                                        mes "something else.^000000";
1916                                                                        close;
1917                                                                }
1918                                                        }
1919                                                }
1920                                        }
1921                                        mes "^3355FFWell, it looks like";
1922                                        mes "you're just about done";
1923                                        mes "with repairing the gate.^000000";
1924                                        next;
1925                                        if (agitcheck() == 0) {
1926                                                mes "^3355FFUnfortunately, the Fortress";
1927                                                mes "Gate can't be reconstructed:";
1928                                                mes "the Emperium is no longer here.^000000";
1929                                                close;
1930                                        }
1931                                        else {
1932                                                if (.@rp_temp == .@ro_of01) {
1933                                                        mes "^3355FFThe Fortress Gate has";
1934                                                        mes "been successfully repaired!^000000";
1935                                                        delitem 1019,30; //Wooden_Block
1936                                                        delitem 999,10; //Steel
1937                                                        delitem 1011,10; //Emveretarcon
1938                                                        delitem 984,5; //Oridecon
1939                                                        close2;
1940                                                        donpcevent "#aru02_RL03::OnEnable";
1941                                                        disablenpc "Control Device03#aru02";
1942                                                        mapannounce "arug_cas02","The 3rd Fortress Gate has been reconstructed!",bc_map,"0x00ff00";
1943                                                        setarray $agit_ar02[4],0;
1944                                                        setarray $agit_ar02[3],2;
1945                                                        donpcevent "Control Device02#aru02::OnDevice02#aru02_dlrp02";
1946                                                        end;
1947                                                }
1948                                                else {
1949                                                        mes "^3355FFThe wall has been breached,";
1950                                                        mes "and the attempt to repair the";
1951                                                        mes "Fortress Gate has failed.";
1952                                                        mes "You lost some of your";
1953                                                        mes "repair resources...^000000";
1954                                                        delitem 984,2; //Oridecon
1955                                                        delitem 999,4; //Steel
1956                                                        delitem 1019,14; //Wooden_Block
1957                                                        delitem 1011,3; //Emveretarcon
1958                                                        close;
1959                                                }
1960                                        }
1961                                }
1962                                else {
1963                                        mes "^3355FFYou can't attempt to repair";
1964                                        mes "the Fortress Gate if you don't";
1965                                        mes "have all the needed materials.^000000";
1966                                        close;
1967                                }
1968                        }
1969                }
1970        }
1971        end;
1972
1973OnInit:
1974        disablenpc "Control Device03#aru02";
1975        end;
1976
1977OnEnable:
1978        enablenpc "Control Device03#aru02";
1979        end;
1980
1981OnDisable:
1982        disablenpc "Control Device03#aru02";
1983        end;
1984}
1985
1986// Link Flags
1987arug_cas02,98,270,0     script  LF-01#arug_cas02        111,{
1988        set .@GID, GetCastleData("arug_cas02",1);
1989        if (getcharid(2) == .@GID) {
1990                mes "^3355FFThis is the Stronghold";
1991                mes "Teleport Service. Please";
1992                mes "choose a destination";
1993                mes "within the stronghold.^000000";
1994                switch(select("First Gate House:Second Gate House:Cancel")) {
1995                case 1:
1996                        warp "arug_cas02",10,187;
1997                        end;
1998                case 2:
1999                        warp "arug_cas02",268,187;
2000                        end;
2001                case 3:
2002                        close;
2003                }
2004        }
2005        end;
2006}
2007
2008arug_cas02,98,266,0     script  LF-02#arug_cas02        111,{
2009        set .@GID, GetCastleData("arug_cas02",1);
2010        if (getcharid(2) == .@GID) {
2011                mes "^3355FFThis is the Stronghold";
2012                mes "Teleport Service. Please";
2013                mes "choose a destination";
2014                mes "within the stronghold.^000000";
2015                switch(select("Defense Area 1-1:Defense Area 1-2:Cancel")) {
2016                case 1:
2017                        warp "arug_cas02",66,31;
2018                        end;
2019                case 2:
2020                        warp "arug_cas02",212,31;
2021                        end;
2022                case 3:
2023                        close;
2024                }
2025        }
2026        end;
2027}
2028
2029arug_cas02,98,262,0     script  LF-03#arug_cas02        111,{
2030        set .@GID, GetCastleData("arug_cas02",1);
2031        if (getcharid(2) == .@GID) {
2032                mes "^3355FFThis is the Stronghold";
2033                mes "Teleport Service. Please";
2034                mes "choose a destination";
2035                mes "within the stronghold.^000000";
2036                switch(select("Defense Area 1-3:Defense Area 1-4:Cancel")) {
2037                case 1:
2038                        warp "arug_cas02",90,120;
2039                        end;
2040                case 2:
2041                        warp "arug_cas02",188,119;
2042                        end;
2043                case 3:
2044                        close;
2045                }
2046        }
2047        end;
2048}
2049
2050arug_cas02,98,258,0     script  LF-04#arug_cas02        111,{
2051        set .@GID, GetCastleData("arug_cas02",1);
2052        if (getcharid(2) == .@GID) {
2053                mes "^3355FFThis is the Stronghold";
2054                mes "Teleport Service. Please";
2055                mes "choose a destination";
2056                mes "within the stronghold.^000000";
2057                switch(select("Defense Area 2-1:Defense Area 2-2:Cancel")) {
2058                case 1:
2059                        warp "arug_cas02",119,183;
2060                        end;
2061                case 2:
2062                        warp "arug_cas02",159,183;
2063                        end;
2064                case 3:
2065                        close;
2066                }
2067        }
2068        end;
2069}
2070
2071arug_cas02,98,253,0     script  LF-05#arug_cas02        111,{
2072        set .@GID, GetCastleData("arug_cas02",1);
2073        if (getcharid(2) == .@GID) {
2074                mes "^3355FFThis is the Stronghold";
2075                mes "Teleport Service. Please";
2076                mes "choose a destination";
2077                mes "within the stronghold.^000000";
2078                switch(select("Defense Area 2-3:Defense Area 2-4:Cancel")) {
2079                case 1:
2080                        warp "arug_cas02",156,324;
2081                        end;
2082                case 2:
2083                        warp "arug_cas02",174,372;
2084                        end;
2085                case 3:
2086                        close;
2087                }
2088        }
2089        end;
2090}
2091
2092arug_cas02,98,249,0     script  LF-06#arug_cas02        111,{
2093        set .@GID, GetCastleData("arug_cas02",1);
2094        if (getcharid(2) == .@GID) {
2095                mes "^3355FFThis is the Stronghold";
2096                mes "Teleport Service. Please";
2097                mes "choose a destination";
2098                mes "within the stronghold.^000000";
2099                switch(select("Defense Area 3-1:Defense Area 3-2:Cancel")) {
2100                case 1:
2101                        warp "arug_cas02",28,325;
2102                        end;
2103                case 2:
2104                        warp "arug_cas02",57,325;
2105                        end;
2106                case 3:
2107                        close;
2108                }
2109        }
2110        end;
2111}
2112
2113arug_cas02,98,245,0     script  LF-07#arug_cas02        111,{
2114        set .@GID, GetCastleData("arug_cas02",1);
2115        if (getcharid(2) == .@GID) {
2116                mes "^3355FFThis is the Stronghold";
2117                mes "Teleport Service. Please";
2118                mes "choose a destination";
2119                mes "within the stronghold.^000000";
2120                switch(select("Center 2nd Area:Center 3rd Area:Cancel")) {
2121                case 1:
2122                        warp "arug_cas02",156,263;
2123                        end;
2124                case 2:
2125                        warp "arug_cas02",43,354;
2126                        end;
2127                case 3:
2128                        close;
2129                }
2130        }
2131        end;
2132}
2133
2134arug_cas02,98,241,0     script  LF-08#arug_cas02        111,{
2135        set .@GID, GetCastleData("arug_cas02",1);
2136        if (getcharid(2) == .@GID) {
2137                mes "^3355FFThis is the Stronghold";
2138                mes "Teleport Service. Would";
2139                mes "you like to teleport to the";
2140                mes "Convenience Facility for";
2141                mes "guild members?^000000";
2142                switch(select("Go to Convenience Facility:Cancel")) {
2143                case 1:
2144                        warp "arug_cas02",387,323;
2145                        end;
2146                case 2:
2147                        close;
2148                }
2149        }
2150        end;
2151}
2152
2153arug_cas02,216,92,0     script  Cyr#LF_ar02_1::LF_ar02_1        111,{
2154        set .@GID, GetCastleData("arug_cas02",1);
2155        if (getcharid(2) == .@GID) {
2156                mes "^3355FFThis is the Stronghold";
2157                mes "Teleport Service. Would";
2158                mes "you like to teleport to";
2159                mes "the Emperium Center?^000000";
2160                switch(select("Teleport:Cancel")) {
2161                case 1:
2162                        warp "arug_cas02",43,256;
2163                        end;
2164                case 2:
2165                        close;
2166                }
2167        }
2168        end;
2169}
2170
2171arug_cas02,63,92,0      duplicate(LF_ar02_1)    Cyr#LF_ar02_2   111
2172arug_cas02,127,133,4    duplicate(LF_ar02_1)    Cyr#LF_ar02_3   111
2173arug_cas02,152,133,4    duplicate(LF_ar02_1)    Cyr#LF_ar02_4   111
2174arug_cas02,149,218,0    duplicate(LF_ar02_1)    Cyr#LF_ar02_5   111
2175arug_cas02,162,218,0    duplicate(LF_ar02_1)    Cyr#LF_ar02_6   111
2176arug_cas02,128,350,0    duplicate(LF_ar02_1)    Cyr#LF_ar02_7   111
2177arug_cas02,128,341,0    duplicate(LF_ar02_1)    Cyr#LF_ar02_8   111
2178arug_cas02,49,317,0     duplicate(LF_ar02_1)    Cyr#LF_ar02_9   111
2179arug_cas02,30,317,0     duplicate(LF_ar02_1)    Cyr#LF_ar02_10  111
2180arug_cas02,9,190,0      duplicate(LF_ar02_1)    Cyr#LF_ar02_11  111
2181arug_cas02,271,190,0    duplicate(LF_ar02_1)    Cyr#LF_ar02_12  111
2182
2183arug_cas02,129,178,4    script  Cyr#LF_ar02_13::LF_ar02_2       722,{
2184        set .@GID, GetCastleData("arug_cas02",1);
2185        if (getcharid(2) == .@GID) {
2186                mes "^3355FFThis is the Stronghold";
2187                mes "Teleport Service. Would";
2188                mes "you like to teleport to";
2189                mes "the Emperium Center?^000000";
2190                switch(select("Teleport:Cancel")) {
2191                case 1:
2192                        warp "arug_cas02",43,256;
2193                        end;
2194                case 2:
2195                        close;
2196                }
2197        }
2198        end;
2199
2200OnRecvCastleAr02:
2201        FlagEmblem GetCastleData("arug_cas02",1);
2202        end;
2203}
2204
2205arug_cas02,149,178,4    duplicate(LF_ar02_2)    Cyr#LF_ar02_14  722
2206arug_cas02,132,38,4     duplicate(LF_ar02_2)    Cyr#LF_ar02_15  722
2207arug_cas02,147,38,4     duplicate(LF_ar02_2)    Cyr#LF_ar02_16  722
2208
2209// Guild Manager
2210arug_cas02,303,341,3    script  Steward#aru02   55,{
2211        set .@GID, GetCastleData("arug_cas02",1);
2212        if (.@GID == 0) {
2213                mes "[ Steward ]";
2214                mes "I await for the master";
2215                mes "whom destiny will choose";
2216                mes "for me. Do you think you";
2217                mes "have to courage and strength";
2218                mes "to conquer this stronghold?";
2219                close;
2220        }
2221        if (getcharid(2) != .@GID || strcharinfo(0) != getguildmaster(.@GID)) {
2222                mes "[ Steward ]";
2223                mes "Hmpf. Your threats don't";
2224                mes "scare me! Guardians, drive";
2225                mes "this infidel away from here!";
2226                mes "I will always be loyal to the";
2227                mes "master of this stronghold,";
2228                mes "the one and only ^FF0000" + getguildmaster(.@GID) + "^000000.";
2229                close;
2230        }
2231        mes "[ Steward ]";
2232        mes "Ah, Master ^FF0000" + getguildmaster(.@GID) + "^000000...";
2233        mes "How shall I serve you today?";
2234        mes "Was there an aspect of this";
2235        mes "stronghold's maintenance";
2236        mes "you wanted to discuss?";
2237        next;
2238        switch(select("Stronghold Briefing:Invest in Commercial Growth:Invest in Defense growth:Hire/Fire Storage Staff:Go to Master's room")) {
2239        case 1:
2240                mes "[ Steward ]";
2241                mes "The Commercial Growth";
2242                mes "Level of the stronghold is ^0000ff" + GetCastleData("arug_cas02",2) + ".";
2243                if (GetCastleData("arug_cas02",4) > 0) {
2244                        mes "Last time, you invested in";
2245                        mes "Commercial Growth " + GetCastleData("arug_cas02",4) + ".";
2246                }
2247                next;
2248                mes "[ Steward ]";
2249                mes "Our stronghold's";
2250                mes "safeguard level is " + GetCastleData("arug_cas02",3) + ".";
2251                if (GetCastleData("arug_cas02",5) > 0) {
2252                        mes "Last time, you invested";
2253                        mes "in defense " + GetCastleData("arug_cas02",5) + " times.";
2254                }
2255                mes " ";
2256                mes "That is all, master.";
2257                close;
2258        case 2:
2259                set .@Economy,GetCastleData("arug_cas02",2);
2260                if(.@Economy < 8) set .@eco_invest,10000;
2261                if(.@Economy >= 8) set .@eco_invest,20000;
2262                if(.@Economy >= 16) set .@eco_invest,40000;
2263                if(.@Economy >= 25) set .@eco_invest,80000;
2264                if(.@Economy >= 34) set .@eco_invest,160000;
2265                if(.@Economy >= 44) set .@eco_invest,320000;
2266                if(.@Economy >= 54) set .@eco_invest,640000;
2267                if(.@Economy >= 65) set .@eco_invest,1280000;
2268                if(.@Economy >= 76) set .@eco_invest,2560000;
2269                if(.@Economy >= 88) set .@eco_invest,5120000;
2270                mes "[ Steward ]";
2271                mes "Raising the stronghold's";
2272                mes "commercial growth will";
2273                mes "increase the quantity of";
2274                mes "goods produced for the guild.";
2275                mes "Investing in commercial growth";
2276                mes "will help the guild's future.";
2277                next;
2278                mes "[ Steward ]";
2279                mes "You can make one investment";
2280                mes "each day, but if you can make";
2281                mes "two investments if you pay";
2282                mes "more zeny: this will speed";
2283                mes "up commercial development,";
2284                mes "but can be quite expensive.";
2285                next;
2286                if (.@Economy == 100) {
2287                        mes "[ Steward ]";
2288                        mes "However, our stronghold's";
2289                        mes "commerical growth level is";
2290                        mes "at 100%. It's not possible to";
2291                        mes "develop commercial growth";
2292                        mes "any further than that.";
2293                        close;
2294                }
2295                if (GetCastleData("arug_cas02",4) == 2) {
2296                        mes "[ Steward ]";
2297                        mes "You've already made two";
2298                        mes "investments today, so you'll";
2299                        mes "have to wait until tomorrow";
2300                        mes "to make another investment.";
2301                        close;
2302                }
2303                if (GetCastleData("arug_cas02",4) == 0) {
2304                        mes "[ Steward ]";
2305                        mes "You must pay ^FF0000" + .@eco_invest + "^000000 zeny";
2306                        mes "to make an investment";
2307                        mes "Will you invest in this";
2308                        mes "stronghold's commerical";
2309                        mes "development now?";
2310                }
2311                else {
2312                        mes "[ Steward ]";
2313                        mes "You must pay ^FF0000" + .@eco_invest + "^000000";
2314                        mes "more zeny to make a second";
2315                        mes "investment today. Will you";
2316                        mes "invest one more time?";
2317                }
2318                next;
2319                switch(select("Invest in Commercial Growth:Cancel")) {
2320                case 1:
2321                        if (Zeny < .@eco_invest) {
2322                                mes "[ Steward ]";
2323                                mes "I'm sorry, Master, but";
2324                                mes "you do not have enough";
2325                                mes "zeny to make an investment";
2326                                mes "for the guild today.";
2327                                close;
2328                        }
2329                        set zeny,zeny-.@eco_invest;
2330                        SetCastleData "arug_cas02",4,GetCastleData("arug_cas02",4)+1;
2331                        SetCastleData "arug_cas02",2,.@Economy + 1 + (.@Economy<99 && rand(2) && getgdskilllv(.@GID,10014));
2332                        mes "[ Steward ]";
2333                        mes "A wise use of the guild's";
2334                        mes "funds, Master. We can expect";
2335                        mes "to see the results of this";
2336                        mes "investment by tomorrow.";
2337                        close;
2338                case 2:
2339                        mes "[ Steward ]";
2340                        mes "As you command, Master.";
2341                        close;
2342                }
2343        case 3:
2344                set .@Defence,GetCastleData("arug_cas02",3);
2345                if(.@Defence < 8) set .@def_invest,20000;
2346                if(.@Defence >= 8) set .@def_invest,40000;
2347                if(.@Defence >= 16) set .@def_invest,80000;
2348                if(.@Defence >= 25) set .@def_invest,160000;
2349                if(.@Defence >= 34) set .@def_invest,320000;
2350                if(.@Defence >= 44) set .@def_invest,640000;
2351                if(.@Defence >= 54) set .@def_invest,1280000;
2352                if(.@Defence >= 65) set .@def_invest,2560000;
2353                if(.@Defence >= 76) set .@def_invest,5120000;
2354                if(.@Defence >= 88) set .@def_invest,10240000;
2355                mes "[ Steward ]";
2356                mes "Investing in our stronghold's";
2357                mes "defense will enhance the";
2358                mes "durability of our Guardians";
2359                mes "and the Emperium. We'll need";
2360                mes "every advantage to protect";
2361                mes "ourselves from our enemies.";
2362                next;
2363                mes "[ Steward ]";
2364                mes "You can invest in defense";
2365                mes "once per day, but if you pay";
2366                mes "more zeny, you can invest";
2367                mes "a maximum of two times daily.";
2368                next;
2369                mes "[ Steward ]";
2370                if (GetCastleData("arug_cas02",3) == 100) {
2371                        mes "The Defense Level of this";
2372                        mes "stronghold is 100%, and";
2373                        mes "cannot be increased further.";
2374                        close;
2375                }
2376                if (GetCastleData("arug_cas02",5) == 2) {
2377                        mes "Master, you've already";
2378                        mes "invested in Defense twice";
2379                        mes "today. You'll need to wait";
2380                        mes "until tomorrow if you really";
2381                        mes "want to increase our defenses.";
2382                        close;
2383                }
2384                if (GetCastleData("arug_cas02",5) == 0) {
2385                        mes "We need ^FF0000" + .@def_invest + "^000000";
2386                        mes "zeny to invest in our";
2387                        mes "stronghold's defenses.";
2388                        mes "Will you invest now?";
2389                }
2390                else {
2391                        mes "We need ^FF0000" + .@def_invest + "^000000";
2392                        mes "zeny to invest in our";
2393                        mes "stronghold's defenses";
2394                        mes "a second time today.";
2395                        mes "Will you invest now?";
2396                }
2397                next;
2398                switch(select("Invest in Defense:Cancel")) {
2399                case 1:
2400                        if (Zeny < .@def_invest) {
2401                                mes "[ Steward ]";
2402                                mes "I'm sorry, Master, but";
2403                                mes "you do not have enough";
2404                                mes "zeny to make an investment";
2405                                mes "for the guild today.";
2406                                close;
2407                        }
2408                        set zeny,zeny-.@def_invest;
2409                        SetCastleData "arug_cas02",5,GetCastleData("arug_cas02",5)+1;
2410                        SetCastleData "arug_cas02",3,.@Defence+1;
2411                        mes "[ Steward ]";
2412                        mes "A wise use of the guild's";
2413                        mes "funds, Master. Increasing";
2414                        mes "the frequency of treasure";
2415                        mes "procured by the guild will";
2416                        mes "definitely help us all.";
2417                        close;
2418                case 2:
2419                        mes "[ Steward ]";
2420                        mes "As you command, Master.";
2421                        close;
2422                }
2423        case 4:
2424                if (GetCastleData("arug_cas02",9) == 1) {
2425                        mes "[ Steward ]";
2426                        mes "Do you wish to dismiss";
2427                        mes "the Kafra Employee that";
2428                        mes "we've hired for the guild?";
2429                        next;
2430                        switch(select("Dismiss:Cancel")) {
2431                        case 1:
2432                                cutin "kafra_01",2;
2433                                mes "[ Hired Kafra Employee ]";
2434                                mes "Master, please reconsider!";
2435                                mes "I've been working very hard";
2436                                mes "for the success of the guild!";
2437                                mes "I'll try harder to serve the";
2438                                mes "guild members of this";
2439                                mes "stronghold, I promise!";
2440                                next;
2441                                switch(select("Dismiss:Cancel")) {
2442                                case 1:
2443                                        mes "[ Hired Kafra Employee ]";
2444                                        mes "Why?! What have I done";
2445                                        mes "to deserve this? Waaah~!";
2446                                        next;
2447                                        cutin "kafra_01",255;
2448                                        break;
2449                                case 2:
2450                                        mes "[ Hired Kafra Employee ]";
2451                                        mes "Thank you, Master!";
2452                                        mes "I'll obey your every";
2453                                        mes "command as best I can!";
2454                                        mes "You won't regret this!";
2455                                        close;
2456                                }
2457                                break;
2458                        case 2:
2459                                mes "[ Steward ]";
2460                                mes "She works very hard,";
2461                                mes "in my opinion. It was in";
2462                                mes "all of our best interests to";
2463                                mes "allow her to stay with us.";
2464                                close;
2465                        }
2466                        disablenpc "Kafra Employee#arug_cas02";
2467                        SetCastleData "arug_cas02",9,0;
2468                        mes "[ Steward ]";
2469                        mes "That Kafra Employee";
2470                        mes "has been dismissed.";
2471                        mes "Were really dissatisfied";
2472                        mes "by the quality of her service?";
2473                        close;
2474                }
2475                else {
2476                        mes "[ Steward ]";
2477                        mes "Will you hire a";
2478                        mes "Kafra Employee to serve";
2479                        mes "our stronghold? You must";
2480                        mes "pay ^FF000010,000 zeny^000000 to hire one.";
2481                        next;
2482                        switch(select("Hire:Cancel")) {
2483                        case 1:
2484                                if (getgdskilllv(.@GID,10001) == 0) {
2485                                        mes "[ Steward ]";
2486                                        mes "Master, we cannot hire a";
2487                                        mes "Kafra Employee because";
2488                                        mes "you have not yet attained";
2489                                        mes "the ^FF0000Contract with Kafra^000000";
2490                                        mes "guild skill.";
2491                                        close;
2492                                }
2493                                if (Zeny < 10000) {
2494                                        mes "[ Steward ]";
2495                                        mes "Master, we cannot hire a";
2496                                        mes "Kafra Employee because";
2497                                        mes "we do not have enough";
2498                                        mes "funds to pay the contract fee.";
2499                                        close;
2500                                }
2501                                set zeny,zeny-10000;
2502                                enablenpc "Kafra Employee#aru02";
2503                                SetCastleData "arug_cas02",9,1;
2504                                mes "[ Steward ]";
2505                                mes "Very well. We have formed";
2506                                mes "a contract with the Kafra";
2507                                mes "Head Office, and hired a";
2508                                mes "Kafra Employee for our";
2509                                mes "stronghold. Here she is~";
2510                                next;
2511                                cutin "kafra_01",2;
2512                                mes "[ Hired Kafra Employee ]";
2513                                mes "How do you do? I've";
2514                                mes "been dispatched by the";
2515                                mes "Kafra Head Office to";
2516                                mes "serve your guild's needs.";
2517                                mes "I'll do my best to follow";
2518                                mes "your every command, Master.";
2519                                next;
2520                                cutin "kafra_01",255;
2521                                mes "[ Steward ]";
2522                                mes "Our contract will expire";
2523                                mes "after one month, so we must";
2524                                mes "pay additional fees to keep";
2525                                mes "this Kafra Employee in";
2526                                mes "the service of our guild.";
2527                                close;
2528                        case 2:
2529                                mes "[ Steward ]";
2530                                mes "As you command, Master.";
2531                                mes "However, I suggest hiring";
2532                                mes "a Kafra Employee as soon";
2533                                mes "as possible since our guild";
2534                                mes "would greatly benefit from";
2535                                mes "the convenient Kafra services.";
2536                                close;
2537                        }
2538                }
2539        case 5:
2540                mes "[ Steward ]";
2541                mes "Do you wish to enter the";
2542                mes "Guild Treasure Room?";
2543                mes "Only you, the Guild Master,";
2544                mes "are permitted to enter.";
2545                next;
2546                mes "[ Steward ]";
2547                mes "Please remember to open";
2548                mes "the Treasure Boxes at the";
2549                mes "proper time. Otherwise, the";
2550                mes "treasure may disappear if";
2551                mes "something unexpected happens.";
2552                next;
2553                switch(select("Go to Treasure Room:Cancel")) {
2554                case 1:
2555                        mes "[ Steward ]";
2556                        mes "Allow me to guide you";
2557                        mes "on the secret path to";
2558                        mes "the Treasure Room.";
2559                        mes "Press the secret switch";
2560                        mes "when you wish to return here.";
2561                        close2;
2562                        warp "arug_cas02",382,227;
2563                        end;
2564                case 2:
2565                        mes "[ Steward ]";
2566                        mes "Items in the Treasure Room";
2567                        mes "are produced once each day.";
2568                        mes "Therefore, you must obtain";
2569                        mes "the treasure items everyday.";
2570                        mes "For the sake of the guild,";
2571                        mes "prioritize treasure harvesting!";
2572                        close;
2573                }
2574        }
2575
2576Onstop:
2577        stopnpctimer;
2578        end;
2579
2580OnStartArena:
2581        set .@GID,getcharid(2);
2582        // Lower castle Economy
2583        set .@Economy,GetCastleData("arug_cas02",2) - 5;
2584        if (.@Economy < 0) set .@Economy, 0;
2585        SetCastleData "arug_cas02", 2, .@Economy;
2586        // Lower Castle Defence
2587        set .@Defence,GetCastleData("arug_cas02",3) - 5;
2588        if (.@Defence < 0) set .@Defence, 0;
2589        SetCastleData "arug_cas02", 3, .@Defence;
2590        // Set new owner
2591        SetCastleData "arug_cas02",1, .@GID;
2592        // Clear castle's data.
2593        for( set .@i, 4; .@i <= 9; set .@i, .@i+1 )
2594                SetCastleData "arug_cas02", .@i, 0;
2595        // Disable Kafra
2596        disablenpc "Kafra Employee#aru02";
2597
2598        set .msg,2;
2599        if (.msg == 1) {
2600                announce "Fortress [" + GetCastleName("arug_cas02") + "]'s 'Valfreyja' was captured by [" + getguildname(.@gid) + "] Guild.",bc_all;
2601                donpcevent "Manager#aru02_02::Onstart";
2602        }
2603        else if (.msg == 2) {
2604                announce "The [" + getguildname(.@gid) + "] conquered the [Valfreyja 2] stronghold of "+GetCastleName("arug_cas02"),bc_all;
2605                mapannounce "arug_cas02","The emperium has been shattered!",bc_map,"0x00FF00";
2606                if (agitcheck()) {
2607                        donpcevent "Manager#aru02_02::Onreset";
2608                        initnpctimer;
2609                }
2610                else {
2611                        donpcevent "Manager#aru02_02::Onreset";
2612                        stopnpctimer;
2613                }
2614        }
2615        else if (.msg == 0) {
2616                announce "Fortress [" + GetCastleName("arug_cas02") + "]'s 'Valfreyja' was captured by [" + getguildname(.@gid) + "] Guild.",bc_all;
2617                donpcevent "Manager#aru02_02::Onreset";
2618                stopnpctimer;
2619                end;
2620        }
2621        MapRespawnGuildID "arug_cas02",GetCastleData("arug_cas02",1),2;
2622        GetCastleData "arug_cas02",0,"::OnRecvCastleAr02";
2623        end;
2624
2625OnTimer10000:
2626        donpcevent "Manager#aru02_02::Onchange";
2627        mapannounce "arug_cas02","Rebuild this stonghold's Guardian Stones and Fortress Gates to secure your guild's new aquisition!",bc_map,"0x00FF00";
2628        end;
2629}
2630
2631// Guild Kafra
2632arug_cas02,354,326,3    script  Kafra Employee#aru02    117,{
2633        set .@GID, GetCastleData("arug_cas02",1);
2634        if (getcharid(2) == .@GID && getgdskilllv(.@GID,10001)) {
2635                mes "[Kafra Employee]";
2636                mes "Welcome, proud member";
2637                mes "of the ^FF0000" + GetGuildName(.@GID) + "^000000 Guild!";
2638                mes "The Kafra Corporation is ready";
2639                mes "to assist you wherever you go!";
2640                next;
2641                switch(select("Use Storage:Use Warp Service:Rent Pushcart:Cancel")) {
2642                case 1:
2643                        if (basicskillcheck() && getskilllv("NV_BASIC") < 6) {
2644                                mes "[Kafra Employee]";
2645                                mes "I'm so sorry, but you must";
2646                                mes "have at least Novice Skill";
2647                                mes "Lv.6 to use the Storage.";
2648                        }
2649                        else {
2650                                openstorage;
2651                        }
2652                        break;
2653                case 2:
2654                        mes "[Kafra Employee]";
2655                        mes "Please tell me your";
2656                        mes "Warp destination.";
2657                        next;
2658                        switch(select("Rachel -> 200 z:Cancel")) {
2659                        case 1:
2660                                if (Zeny < 200) {
2661                                        mes "[Kafra Employee]";
2662                                        mes "I'm sorry, but you don't";
2663                                        mes "have enough zeny to pay";
2664                                        mes "the warp fee. Would you";
2665                                        mes "please check your funds again?";
2666                                        close2;
2667                                        cutin "kafra_01",255;
2668                                        end;
2669                                }
2670                                set zeny,zeny-200;
2671                                warp "rachel",115,125;
2672                                end;
2673                        case 2:
2674                                cutin "kafra_01",255;
2675                        }
2676                        break;
2677                case 3:
2678                        if (BaseClass != Job_Merchant) {
2679                                mes "[Kafra Employee]";
2680                                mes "I'm sorry, but the Pushcart";
2681                                mes "rental service can only be";
2682                                mes "used by Merchant, Blacksmith,";
2683                                mes "and Alchemist class characters.";
2684                        }
2685                        else if (checkcart() == 1) {
2686                                mes "[Kafra Employee]";
2687                                mes "Hm? You've already";
2688                                mes "rented a Pushcart.";
2689                        }
2690                        else {
2691                                mes "[Kafra Employee]";
2692                                mes "The Pushcart rental fee";
2693                                mes "is 800 zeny. Would you";
2694                                mes "like to rent a Pushcart?";
2695                                next;
2696                                switch(select("Rent Pushcart:Cancel")) {
2697                                case 1:
2698                                        if (Zeny < 800) {
2699                                                mes "[Kafra Employee]";
2700                                                mes "I'm sorry, but you don't";
2701                                                mes "have enough zeny to rent";
2702                                                mes "one of our Pushcarts.";
2703                                                close2;
2704                                                cutin "kafra_01",255;
2705                                                end;
2706                                        }
2707                                        set zeny,zeny-800;
2708                                        setcart;
2709                                        break;
2710                                case 2:
2711                                        break;
2712                                }
2713                        }
2714                        break;
2715                case 4:
2716                        mes "[Kafra Employee]";
2717                        mes "Thank you for using the";
2718                        mes "Kafra Service. Wherever";
2719                        mes "you go, Kafra will be";
2720                        mes "there to support you!";
2721                        close2;
2722                        cutin "kafra_01",255;
2723                        end;
2724                }
2725                close2;
2726                cutin "kafra_01",255;
2727                end;
2728        }
2729        else {
2730                mes "[Kafra Employee]";
2731                mes "I'm sorry, but I've been";
2732                mes "exclusively contracted";
2733                mes "to the members of the";
2734                mes "^FF0000" + GetGuildName(.@GID) + "^000000 Guild.";
2735                mes "You'll have to ask another";
2736                mes "Kafra Employee to help you...";
2737                close2;
2738                cutin "kafra_01",255;
2739                end;
2740        }
2741
2742OnRecvCastleAr02:
2743        if (GetCastleData("arug_cas02",1) == 0) {
2744                monster "arug_cas02",0,0,"Evil Druid",1117,10;
2745                monster "arug_cas02",0,0,"Khalitzburg",1132,4;
2746                monster "arug_cas02",0,0,"Abysmal Knight",1219,3;
2747                monster "arug_cas02",0,0,"Executioner",1205,1;
2748                monster "arug_cas02",0,0,"Penomena",1216,10;
2749                monster "arug_cas02",0,0,"Alarm",1193,18;
2750                monster "arug_cas02",0,0,"Clock",1269,9;
2751                monster "arug_cas02",0,0,"Raydric Archer",1276,12;
2752                monster "arug_cas02",0,0,"Wanderer",1208,3;
2753                monster "arug_cas02",0,0,"Alice",1275,1;
2754                monster "arug_cas02",0,0,"Bloody Knight",1268,2;
2755                monster "arug_cas02",0,0,"Dark Lord",1272,2;
2756                monster "arug_cas02",0,0,"Tower Keeper",1270,4;
2757        }
2758        if (GetCastleData("arug_cas02",9) < 1) {
2759                disablenpc "Kafra Employee#aru02";
2760        }
2761        end;
2762}
2763
2764arug_cas02,386,227,0    script  #aru02_switch   111,{
2765        mes " ";
2766        mes "^3355FFWill you pull";
2767        mes "this small lever?^000000";
2768        next;
2769        switch(select("Pull Lever:Cancel")) {
2770        case 1:
2771                warp "arug_cas02",387,323;
2772                end;
2773        case 2:
2774                close;
2775        }
2776}
2777
2778aru_gld,80,41,6 script  Cyr#flag_Ar02_1::Ar02_Flag      722,{
2779        set .@GID, GetCastleData("arug_cas02",1);
2780        if (.@GID == 0) {
2781                mes "[ Arunafeltz Royal Edict ]";
2782                mes "The Holy Kingdom of";
2783                mes "Arunafeltz declares that";
2784                mes "one has yet to claim lordship";
2785                mes "over this stronghold. The one";
2786                mes "that breaks the Emperium will";
2787                mes "be recognized as its new owner.";
2788                close;
2789        }
2790        else {
2791                if (getcharid(2) == .@GID) {
2792                        mes "[ Ringing Voice ]";
2793                        mes "Courageous one,";
2794                        mes "do you wish to return";
2795                        mes "to your stronghold?";
2796                        next;
2797                        switch(select("Return to the Stronghold:Cancel")) {
2798                        case 1:
2799                                set .@GID, GetCastleData("arug_cas02",1);
2800                                if (getcharid(2) == .@GID) {
2801                                        warp "arug_cas02",43,256;
2802                                        end;
2803                                }
2804                                close;
2805                        case 2:
2806                                close;
2807                        }
2808                }
2809                mes "[ Arunafeltz Royal Edict ]";
2810                mes "The Holy Kingdom of";
2811                mes "Arunafeltz decrees that";
2812                mes "this stronghold is owned";
2813                mes "by the ^FF0000" + GetGuildName(.@GID) + "^000000 Guild.";
2814                next;
2815                mes "[ Arunafeltz Royal Edict ]";
2816                mes "^FF0000" + GetGuildMaster(.@GID) + "^000000 is";
2817                mes "Guild Master of ^FF0000" + GetGuildName(.@GID) + "^000000.";
2818                mes "Any that object must claim this";
2819                mes "stronghold through strength of";
2820                mes "steel and magic during the";
2821                mes "appointed Guild Siege times.";
2822                close;
2823        }
2824
2825OnRecvCastleAr02:
2826        FlagEmblem GetCastleData("arug_cas02",1);
2827        end;
2828}
2829
2830aru_gld,80,52,6 duplicate(Ar02_Flag)    Cyr#flag_Ar02_2 722
2831
2832aru_gld,120,83,5        script  Cyr#flag_Ar02_3 722,{
2833        set .@GID, GetCastleData("arug_cas02",1);
2834        if (.@GID == 0) {
2835                mes "[ Arunafeltz Royal Edict ]";
2836                mes "The Holy Kingdom of";
2837                mes "Arunafeltz declares that";
2838                mes "one has yet to claim lordship";
2839                mes "over this stronghold. The one";
2840                mes "that breaks the Emperium will";
2841                mes "be recognized as its new owner.";
2842                close;
2843        }
2844        else {
2845                mes "[ Arunafeltz Royal Edict ]";
2846                mes "The Holy Kingdom of";
2847                mes "Arunafeltz decrees that";
2848                mes "this stronghold is owned";
2849                mes "by the ^FF0000" + guildName + "^000000 Guild.";
2850                next;
2851                mes "[ Arunafeltz Royal Edict ]";
2852                mes "^FF0000" + guildMaster + "^000000 is";
2853                mes "Guild Master of ^FF0000" + guildName + "^000000.";
2854                mes "Any that object must claim this";
2855                mes "stronghold through strength of";
2856                mes "steel and magic during the";
2857                mes "appointed Guild Siege times.";
2858                close;
2859        }
2860OnRecvCastleAr02:
2861        FlagEmblem GetCastleData("arug_cas02",1);
2862        end;
2863}
2864
Note: See TracBrowser for help on using the browser.