airplane.txt 13 KB

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