root/npc/custom/airplane.txt @ 23

Revision 1, 13.1 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= elRO Airship
3//===== By: ==================================================
4//= Edited And removed irrelevent comments by eAthena Dev Team
5//= Draike\Bluto\Hephaestus
6//===== Current Version: =====================================
7//= 2.2a
8//===== Compatible With: =====================================
9//= eAthena SVN 02/05/2005 +
10//===== Description: =========================================
11//= It's the elRO airship. XD
12//===== Additional Comments: =================================
13//= ALWAYS HAVE AT LEAST TWELVE (12) LOCATIONS AS THE MINIMUM.  This is unless you modify to OnMinutes and change the schedule around.
14//= If you have "airplane,103,72,0      warp    airs02a 1,1,airplane,102,200" as a warp, remove it.  Where it's supposed to go, I have no clue.
15//= 2.1 Removed Duplicates [Silent]
16//= 2.2 Added missing next;'s [Evera]
17//============================================================
18payon,153,43,5  script  itinsetter      -1,{
19
20//This is just OnInit stuff to set the hourly intinerary.
21OnInit:
22deletearray $locationsname$[0],500;
23deletearray $locationsmap$[0],500;
24deletearray $locationsx[0],500;
25deletearray $locationsy[0],500;
26deletearray $alreadygoneto[0],500;
27setarray $locationsname$[0],"Airport";
28setarray $locationsname$[1],"Prontera";
29setarray $locationsname$[2],"Payon";
30setarray $locationsname$[3],"Aldebaran";
31setarray $locationsname$[4],"Alberta";
32setarray $locationsname$[5],"Geffen";
33setarray $locationsname$[6],"Morocc";
34setarray $locationsname$[7],"Glast Heim";
35setarray $locationsname$[8],"Umbala";
36setarray $locationsname$[9],"Comodo";
37setarray $locationsname$[10],"Amatsu";
38setarray $locationsname$[11],"Niflheim";
39setarray $locationsname$[12],"Lutie";
40setarray $locationsname$[13],"Louyang";
41setarray $locationsname$[14],"Gonryun";
42setarray $locationsname$[15],"Yuno";
43setarray $locationsname$[16],"Ant Hell";
44setarray $locationsname$[17],"Jawaii";
45setarray $locationsname$[18],"Orc Village";
46setarray $locationsname$[19],"Mjolnir Coal Mines";
47setarray $locationsname$[20],"Gefenia Ruins";
48setarray $locationsname$[21],"Ayothaya";
49setarray $locationsname$[22],"Lighthalzen";
50setarray $locationsname$[23],"Juperos";
51setarray $locationsmap$[0],"airport";
52setarray $locationsmap$[1],"prt_fild08";
53setarray $locationsmap$[2],"pay_fild08";
54setarray $locationsmap$[3],"mjolnir_12";
55setarray $locationsmap$[4],"pay_fild03";
56setarray $locationsmap$[5],"gef_fild00";
57setarray $locationsmap$[6],"moc_fild10";
58setarray $locationsmap$[7],"glast_01";
59setarray $locationsmap$[8],"umbala";
60setarray $locationsmap$[9],"comodo";
61setarray $locationsmap$[10],"amatsu";
62setarray $locationsmap$[11],"niflheim";
63setarray $locationsmap$[12],"xmas";
64setarray $locationsmap$[13],"louyang";
65setarray $locationsmap$[14],"gonryun";
66setarray $locationsmap$[15],"yuno";
67setarray $locationsmap$[16],"moc_fild04";
68setarray $locationsmap$[17],"jawaii";
69setarray $locationsmap$[18],"gef_fild10";
70setarray $locationsmap$[19],"mjolnir_02";
71setarray $locationsmap$[20],"gefenia01";
72setarray $locationsmap$[21],"ayothaya";
73setarray $locationsmap$[22],"lighthalzen";
74setarray $locationsmap$[23],"jupe_gate";
75setarray $locationsx[0],148;
76setarray $locationsx[1],206;
77setarray $locationsx[2],159;
78setarray $locationsx[3],62;
79setarray $locationsx[4],194;
80setarray $locationsx[5],50;
81setarray $locationsx[6],163;
82setarray $locationsx[7],196;
83setarray $locationsx[8],187;
84setarray $locationsx[9],203;
85setarray $locationsx[10],115;
86setarray $locationsx[11],132;
87setarray $locationsx[12],232;
88setarray $locationsx[13],36;
89setarray $locationsx[14],82;
90setarray $locationsx[15],58;
91setarray $locationsx[16],209;
92setarray $locationsx[17],248;
93setarray $locationsx[18],158;
94setarray $locationsx[19],76;
95setarray $locationsx[20],98;
96setarray $locationsx[21],183;
97setarray $locationsx[22],99;
98setarray $locationsx[23],46;
99setarray $locationsy[0],45;
100setarray $locationsy[1],280;
101setarray $locationsy[2],92;
102setarray $locationsy[3],381;
103setarray $locationsy[4],182;
104setarray $locationsy[5],365;
105setarray $locationsy[6],172;
106setarray $locationsy[7],327;
107setarray $locationsy[8],98;
108setarray $locationsy[9],76;
109setarray $locationsy[10],79;
110setarray $locationsy[11],241;
111setarray $locationsy[12],308;
112setarray $locationsy[13],279;
113setarray $locationsy[14],96;
114setarray $locationsy[15],194;
115setarray $locationsy[16],326;
116setarray $locationsy[17],175;
117setarray $locationsy[18],95;
118setarray $locationsy[19],363;
119setarray $locationsy[20],21;
120setarray $locationsy[21],104;
121setarray $locationsy[22],240;
122setarray $locationsy[23],19;
123goto resetgoneto;
124end;
125
126setrandomitin:
127set $@settervariable,$@settervariable + 1;
128setarray $locationn[$@settervariable],rand(0,getarraysize($locationsname$) - 1);
129if($alreadygoneto[$locationn[$@settervariable]]==1)set $@settervariable,$@settervariable - 1;
130if($alreadygoneto[$locationn[$@settervariable]]==1)goto setrandomitin;
131setarray $alreadygoneto[$locationn[$@settervariable]], 1;
132if($@settervariable<12)goto setrandomitin;
133end;
134
135resetgoneto:
136deletearray $alreadygoneto[0], 500;
137set $@currenttime, 0;
138goto setrandomitin;
139
140OnMinute00:
141set $@currenttime, 1;
142callfunc "F_Itinreset",12,1,2;
143
144OnMinute03:
145set $destination,250;
146end;
147
148OnMinute05:
149set $@currenttime, 2;
150callfunc "F_Itinreset",1,2,3;
151
152OnMinute08:
153set $destination,250;
154end;
155
156OnMinute10:
157set $@currenttime, 3;
158callfunc "F_Itinreset",2,3,4;
159
160OnMinute13:
161set $destination,250;
162end;
163
164OnMinute15:
165set $@currenttime, 4;
166callfunc "F_Itinreset",3,4,5;
167
168OnMinute18:
169set $destination,250;
170end;
171
172OnMinute20:
173set $@currenttime, 5;
174callfunc "F_Itinreset",4,5,6;
175
176OnMinute23:
177set $destination,250;
178end;
179
180OnMinute25:
181set $@currenttime, 6;
182callfunc "F_Itinreset",5,6,7;
183
184OnMinute28:
185set $destination,250;
186end;
187
188OnMinute30:
189set $@currenttime, 7;
190callfunc "F_Itinreset",6,7,8;
191
192OnMinute33:
193set $destination,250;
194end;
195
196OnMinute35:
197set $@currenttime, 8;
198callfunc "F_Itinreset",7,8,9;
199
200OnMinute38:
201set $destination,250;
202end;
203
204OnMinute40:
205set $@currenttime, 9;
206callfunc "F_Itinreset",8,9,10;
207
208OnMinute43:
209set $destination,250;
210end;
211
212OnMinute45:
213set $@currenttime, 10;
214callfunc "F_Itinreset",9,10,11;
215
216OnMinute48:
217set $destination,250;
218end;
219
220OnMinute50:
221set $@currenttime, 11;
222callfunc "F_Itinreset",10,11,12;
223
224OnMinute53:
225set $destination,250;
226end;
227
228OnMinute55:
229set $@currenttime, 12;
230callfunc "F_Itinreset",11,12,1;
231
232OnMinute58:
233set $destination,250;
234end;
235}
236function        script  F_Porter        {
237        if($destination==getarg(0))goto Board;
238        if($destination!=getarg(0))goto Notime;
239
240Board:
241        mes "^FF0000[Porter]^000000";
242        mes "The plane is currently ported.  Would you like to board?";
243        next;
244        menu "Yes.",L_Yes,"No.",L_Nope,"View Hourly Itinerary.",Itin;
245
246L_Yes:
247        if($destination!=getarg(0))goto Notime;
248        warp "airplane", 105, 72;
249        specialeffect2 501;
250L_Nope:
251        mes "^FF0000[Porter]^000000";
252        mes "Have a good day.  Thank you for traveling with Airship.";
253        close;
254
255Notime:
256        mes "^FF0000[Porter]^000000";
257        if(sex==0) mes "Sorry, ma'am, but the plane currently isn't ported.  However, you can view the airplane's hourly itinerary.";
258        if(sex==1) mes "Sorry, sir, but the plane currently isn't ported.  However, you can view the airplane's hourly itinerary.";
259        next;
260        menu "Yes, please.",Itin,"No thanks.",L_Nope;
261        close;
262        end;
263
264Itin:
265mes "^FF0000[Porter]^000000";
266callfunc "F_Itin";
267}
268airport,153,43,5        script  Airport Porter  774,{
269callfunc "F_Porter",0;
270}
271prt_fild08,206,279,5    script  Porter#01       774,{
272callfunc "F_Porter",1;
273}
274gef_fild00,50,364,5     script  Porter#02       774,{
275callfunc "F_Porter",5;
276}
277moc_fild10,163,173,5    script  Porter#03       774,{
278callfunc "F_Porter",6;
279}
280mjolnir_12,61,380,5     script  Porter#04       774,{
281callfunc "F_Porter",3;
282}
283pay_fild08,159,91,5     script  Porter#05       774,{
284callfunc "F_Porter",2;
285}
286pay_fild03,194,181,5    script  Porter#06       774,{
287callfunc "F_Porter",4;
288}
289glast_01,196,326,1      script  Porter#07       774,{
290callfunc "F_Porter",7;
291}
292umbala,188,98,3 script  Porter#08       774,{
293callfunc "F_Porter",8;
294}
295comodo,203,75,8 script  Porter#09       774,{
296callfunc "F_Porter",9;
297}
298amatsu,115,78,8 script  Porter#10       774,{
299callfunc "F_Porter",10;
300}
301niflheim,132,242,5      script  Porter#11       774,{
302callfunc "F_Porter",11;
303}
304xmas,232,309,5  script  Porter#12       774,{
305callfunc "F_Porter",12;
306}
307louyang,35,279,8        script  Porter#13       774,{
308callfunc "F_Porter",13;
309}
310gonryun,82,95,7 script  Porter#14       774,{
311callfunc "F_Porter",14;
312}
313yuno,58,195,4   script  Porter#15       774,{
314callfunc "F_Porter",15;
315}
316moc_fild04,210,326,2    script  Porter#16       774,{
317callfunc "F_Porter",16;
318}
319jawaii,247,174,7        script  Porter#17       774,{
320callfunc "F_Porter",17;
321}
322gef_fild10,159,95,2     script  Porter#18       774,{
323callfunc "F_Porter",18;
324}
325mjolnir_02,76,364,5     script  Porter#19       774,{
326callfunc "F_Porter",19;
327}
328gefenia01,97,22,6       script  Porter#20       774,{
329callfunc "F_Porter",20;
330}
331ayothaya,182,105,5      script  Porter#21       774,{
332callfunc "F_Porter",21;
333}
334lighthalzen,99,241,4    script  Porter#22       774,{
335callfunc "F_Porter",22;
336}
337jupe_gate,46,18,7       script  Porter#23       774,{
338callfunc "F_Porter",23;
339}
340airport,141,43,5        script  Itinerary Schedule      837,{
341mes "^FF0000[Itinerary]^000000";
342callfunc "F_Itin";
343}
344airplane,102,68,5       script  Docker  852,{
345        if($destination == 250) goto Nowhere;
346        mes "^FF0000[Airplane Attendant]^000000";
347        if($destination == 250)goto Notime;
348        set @dockky, $destination;
349        if($destination != 250)mes "We are currently docked at "+$locationsname$[$destination]+".  Would you like to exit?";
350        next;
351        menu "Yes.",Lyes,"No.",Lnope;
352
353Lyes:
354        if($destination == 250)goto Notime;
355        if($destination != @dockky)goto Notime;
356        warp $locationsmap$[$destination], $locationsx[$destination], $locationsy[$destination];
357        specialeffect2 501;
358
359Lnope:
360        mes "^FF0000[Airplane Attendant]^000000";
361        mes "Have a good day.  Thank you for traveling with us.";
362        close;
363
364Notime:
365        mes "^FF0000[Airplane Attendant]^000000";
366        if(sex==0) mes "Sorry, ma'am, but the plane currently isn't docked.  Please wait.";
367        if(sex==1) mes "Sorry, sir, but the plane currently isn't docked.  Please wait.";
368        close;
369
370Nowhere:
371        mes "^FF0000[Airplane Attendant]^000000";
372        mes "We're currently in air. Please wait until the pilot has announced that we have safely landed.";
373        close;
374}
375function        script  F_Itin  {
376//This is the itinerary's function.  It should work well enough.
377if($@currenttime==0)mes "Try again later.  A recent server reboot or rehash has messed the itinerary up for a bit.";
378if($@currenttime==0)close;
379if($@currenttime==0)end;
380set @tempo, 0;
381set @tempo, $@currenttime - 1;
382goto seta;
383close;
384
385seta:
386set @tempo, @tempo + 1;
387set @time, gettime(3);
388set @minutes, 5 * @tempo - 5;
389set @minutess, 5 * @tempo - 2;
390if(@minutes<10)set @minutes$, "0" + @minutes;
391if(@minutes>9)set @minutes$, @minutes;
392if(@minutess<10)set @minutess$, "0" + @minutess;
393if(@minutess>9)set @minutess$, @minutess;
394if(@time<12)set @time$,@time;
395if(@time==12)set @time$,12;
396if(@time>12)set @time$,@time - 12;
397if(@time<12)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. - "+"^FF0000"+$locationsname$[$locationn[@tempo]]+"^000000";
398if(@time==12)mes @time$+":"+ @minutes$ + " P.M. - "+@time$+ ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
399if(@time>12 && time<24)mes @time$ +":"+ @minutes$ + " P.M. - "+@time$ + ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
400if(@time==24)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
401if(@tempo<12)goto seta;
402set @tempo, 0;
403goto setb;
404
405setb:
406if($@currenttime - 1==@tempo)goto setc;
407set @tempo, @tempo + 1;
408set @time, gettime(3) + 1;
409set @minutes, 5 * @tempo - 5;
410set @minutess, 5 * @tempo - 2;
411if(@minutes<10)set @minutes$, "0" + @minutes;
412if(@minutes>9)set @minutes$, @minutes;
413if(@minutess<10)set @minutess$, "0" + @minutess;
414if(@minutess>9)set @minutess$, @minutess;
415if(@time<12)set @time$,@time;
416if(@time==12)set @time$,12;
417if(@time>12)set @time$,@time - 12;
418if(@time<12)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. - "+"^FF0000"+$locationsname$[$locationn[@tempo]]+"^000000";
419if(@time==12)mes @time$+":"+ @minutes$ + " P.M. - "+@time$+ ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
420if(@time>12 && time<24)mes @time$ +":"+ @minutes$ + " P.M. - "+@time$+ ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
421if(@time==24)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
422goto setb;
423
424setc:
425close;
426end;
427}
428function        script  F_Itinreset     {
429setarray $alreadygoneto[$locationn[getarg(0)]], 0;
430goto sest;
431
432sest:
433setarray $locationn[getarg(0)],rand(0,getarraysize($locationsname$) - 1);
434if($alreadygoneto[$locationn[getarg(0)]]==1)goto sest;
435setarray $alreadygoneto[$locationn[getarg(0)]], 1;
436set $destination,$locationn[$@currenttime];
437announce "Pilot: The plane has arrived at "+$locationsname$[$locationn[getarg(1)]]+".  Departure to "+ $locationsname$[$locationn[getarg(2)]] + " is in 3 minutes.",16;
438end;
439}
Note: See TracBrowser for help on using the browser.