root/npc/guild2/arug_cas01.txt @ 23

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