root/npc/guild2/arug_cas03.txt

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