airplane.txt 13 KB

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