root/npc/guild2/schg_cas03.txt @ 1

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