airplane.txt 13 KB

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