airplane.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. //===== rAthena Script =======================================
  2. //= elRO Airship
  3. //===== By: ==================================================
  4. //= Draike, Bluto, Hephaestus
  5. //===== Current Version: =====================================
  6. //= 2.2a
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= It's the elRO airship. XD
  11. //===== Additional Comments: =================================
  12. //= ALWAYS HAVE AT LEAST TWELVE (12) LOCATIONS AS THE MINIMUM. This is unless you modify to OnMinutes and change the schedule around.
  13. //= 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.
  14. //= 2.1 Removed Duplicates [Silent]
  15. //= 2.2 Added missing next;'s [Evera]
  16. //============================================================
  17. payon,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";
  50. setarray $locationsmap$[1],"prt_fild08";
  51. setarray $locationsmap$[2],"pay_fild08";
  52. setarray $locationsmap$[3],"mjolnir_12";
  53. setarray $locationsmap$[4],"pay_fild03";
  54. setarray $locationsmap$[5],"gef_fild00";
  55. setarray $locationsmap$[6],"moc_fild10";
  56. setarray $locationsmap$[7],"glast_01";
  57. setarray $locationsmap$[8],"umbala";
  58. setarray $locationsmap$[9],"comodo";
  59. setarray $locationsmap$[10],"amatsu";
  60. setarray $locationsmap$[11],"niflheim";
  61. setarray $locationsmap$[12],"xmas";
  62. setarray $locationsmap$[13],"louyang";
  63. setarray $locationsmap$[14],"gonryun";
  64. setarray $locationsmap$[15],"yuno";
  65. setarray $locationsmap$[16],"moc_fild04";
  66. setarray $locationsmap$[17],"jawaii";
  67. setarray $locationsmap$[18],"gef_fild10";
  68. setarray $locationsmap$[19],"mjolnir_02";
  69. setarray $locationsmap$[20],"gefenia01";
  70. setarray $locationsmap$[21],"ayothaya";
  71. setarray $locationsmap$[22],"lighthalzen";
  72. setarray $locationsmap$[23],"jupe_gate";
  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. next;
  215. menu "Yes.",L_Yes,"No.",L_Nope,"View Hourly Itinerary.",Itin;
  216. L_Yes:
  217. if($destination!=getarg(0))goto Notime;
  218. warp "airplane", 105, 72;
  219. specialeffect2 EF_CASTSPIN;
  220. L_Nope:
  221. mes "^FF0000[Porter]^000000";
  222. mes "Have a good day. Thank you for traveling with Airship.";
  223. close;
  224. Notime:
  225. mes "^FF0000[Porter]^000000";
  226. if(Sex==SEX_FEMALE) mes "Sorry, ma'am, but the plane currently isn't ported. However, you can view the airplane's hourly itinerary.";
  227. else mes "Sorry, sir, but the plane currently isn't ported. However, you can view the airplane's hourly itinerary.";
  228. next;
  229. menu "Yes, please.",Itin,"No thanks.",L_Nope;
  230. close;
  231. end;
  232. Itin:
  233. mes "^FF0000[Porter]^000000";
  234. callfunc "F_Itin";
  235. }
  236. airport,153,43,5 script Airport Porter 774,{
  237. callfunc "F_Porter",0;
  238. }
  239. prt_fild08,206,279,5 script Porter#01 774,{
  240. callfunc "F_Porter",1;
  241. }
  242. gef_fild00,50,364,5 script Porter#02 774,{
  243. callfunc "F_Porter",5;
  244. }
  245. moc_fild10,163,173,5 script Porter#03 774,{
  246. callfunc "F_Porter",6;
  247. }
  248. mjolnir_12,61,380,5 script Porter#04 774,{
  249. callfunc "F_Porter",3;
  250. }
  251. pay_fild08,159,91,5 script Porter#05 774,{
  252. callfunc "F_Porter",2;
  253. }
  254. pay_fild03,194,181,5 script Porter#06 774,{
  255. callfunc "F_Porter",4;
  256. }
  257. glast_01,196,326,1 script Porter#07 774,{
  258. callfunc "F_Porter",7;
  259. }
  260. umbala,188,98,3 script Porter#08 774,{
  261. callfunc "F_Porter",8;
  262. }
  263. comodo,203,75,8 script Porter#09 774,{
  264. callfunc "F_Porter",9;
  265. }
  266. amatsu,115,78,8 script Porter#10 774,{
  267. callfunc "F_Porter",10;
  268. }
  269. niflheim,132,242,5 script Porter#11 774,{
  270. callfunc "F_Porter",11;
  271. }
  272. xmas,232,309,5 script Porter#12 774,{
  273. callfunc "F_Porter",12;
  274. }
  275. louyang,35,279,8 script Porter#13 774,{
  276. callfunc "F_Porter",13;
  277. }
  278. gonryun,82,95,7 script Porter#14 774,{
  279. callfunc "F_Porter",14;
  280. }
  281. yuno,58,195,4 script Porter#15 774,{
  282. callfunc "F_Porter",15;
  283. }
  284. moc_fild04,210,326,2 script Porter#16 774,{
  285. callfunc "F_Porter",16;
  286. }
  287. jawaii,247,174,7 script Porter#17 774,{
  288. callfunc "F_Porter",17;
  289. }
  290. gef_fild10,159,95,2 script Porter#18 774,{
  291. callfunc "F_Porter",18;
  292. }
  293. mjolnir_02,76,364,5 script Porter#19 774,{
  294. callfunc "F_Porter",19;
  295. }
  296. gefenia01,97,22,6 script Porter#20 774,{
  297. callfunc "F_Porter",20;
  298. }
  299. ayothaya,182,105,5 script Porter#21 774,{
  300. callfunc "F_Porter",21;
  301. }
  302. lighthalzen,99,241,4 script Porter#22 774,{
  303. callfunc "F_Porter",22;
  304. }
  305. jupe_gate,46,18,7 script Porter#23 774,{
  306. callfunc "F_Porter",23;
  307. }
  308. airport,141,43,5 script Itinerary Schedule 837,{
  309. mes "^FF0000[Itinerary]^000000";
  310. callfunc "F_Itin";
  311. }
  312. airplane,102,68,5 script Docker 852,{
  313. if($destination == 250) goto Nowhere;
  314. mes "^FF0000[Airplane Attendant]^000000";
  315. if($destination == 250)goto Notime;
  316. set @dockky, $destination;
  317. if($destination != 250)mes "We are currently docked at "+$locationsname$[$destination]+". Would you like to exit?";
  318. next;
  319. menu "Yes.",Lyes,"No.",Lnope;
  320. Lyes:
  321. if($destination == 250)goto Notime;
  322. if($destination != @dockky)goto Notime;
  323. warp $locationsmap$[$destination], $locationsx[$destination], $locationsy[$destination];
  324. specialeffect2 EF_CASTSPIN;
  325. Lnope:
  326. mes "^FF0000[Airplane Attendant]^000000";
  327. mes "Have a good day. Thank you for traveling with us.";
  328. close;
  329. Notime:
  330. mes "^FF0000[Airplane Attendant]^000000";
  331. if(Sex==SEX_FEMALE) mes "Sorry, ma'am, but the plane currently isn't docked. Please wait.";
  332. else mes "Sorry, sir, but the plane currently isn't docked. Please wait.";
  333. close;
  334. Nowhere:
  335. mes "^FF0000[Airplane Attendant]^000000";
  336. mes "We're currently in air. Please wait until the pilot has announced that we have safely landed.";
  337. close;
  338. }
  339. function script F_Itin {
  340. //This is the itinerary's function. It should work well enough.
  341. if($@currenttime==0)mes "Try again later. A recent server reboot or rehash has messed the itinerary up for a bit.";
  342. if($@currenttime==0)close;
  343. if($@currenttime==0)end;
  344. set @tempo, 0;
  345. set @tempo, $@currenttime - 1;
  346. goto seta;
  347. close;
  348. seta:
  349. set @tempo, @tempo + 1;
  350. set @time, gettime(DT_HOUR);
  351. set @minutes, 5 * @tempo - 5;
  352. set @minutess, 5 * @tempo - 2;
  353. if(@minutes<10)set @minutes$, "0" + @minutes;
  354. if(@minutes>9)set @minutes$, @minutes;
  355. if(@minutess<10)set @minutess$, "0" + @minutess;
  356. if(@minutess>9)set @minutess$, @minutess;
  357. if(@time<12)set @time$,@time;
  358. if(@time==12)set @time$,12;
  359. if(@time>12)set @time$,@time - 12;
  360. if(@time<12)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. - "+"^FF0000"+$locationsname$[$locationn[@tempo]]+"^000000";
  361. if(@time==12)mes @time$+":"+ @minutes$ + " P.M. - "+@time$+ ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
  362. if(@time>12 && time<24)mes @time$ +":"+ @minutes$ + " P.M. - "+@time$ + ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
  363. if(@time==24)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
  364. if(@tempo<12)goto seta;
  365. set @tempo, 0;
  366. goto setb;
  367. setb:
  368. if($@currenttime - 1==@tempo)goto setc;
  369. set @tempo, @tempo + 1;
  370. set @time, gettime(DT_HOUR) + 1;
  371. set @minutes, 5 * @tempo - 5;
  372. set @minutess, 5 * @tempo - 2;
  373. if(@minutes<10)set @minutes$, "0" + @minutes;
  374. if(@minutes>9)set @minutes$, @minutes;
  375. if(@minutess<10)set @minutess$, "0" + @minutess;
  376. if(@minutess>9)set @minutess$, @minutess;
  377. if(@time<12)set @time$,@time;
  378. if(@time==12)set @time$,12;
  379. if(@time>12)set @time$,@time - 12;
  380. if(@time<12)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. - "+"^FF0000"+$locationsname$[$locationn[@tempo]]+"^000000";
  381. if(@time==12)mes @time$+":"+ @minutes$ + " P.M. - "+@time$+ ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
  382. if(@time>12 && time<24)mes @time$ +":"+ @minutes$ + " P.M. - "+@time$+ ":"+ @minutess$ + " P.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
  383. if(@time==24)mes @time$+":"+ @minutes$ + " A.M. - "+@time$+ ":"+ @minutess$ + " A.M. -"+"^FF0000 "+$locationsname$[$locationn[@tempo]]+"^000000";
  384. goto setb;
  385. setc:
  386. close;
  387. end;
  388. }
  389. function script F_Itinreset {
  390. setarray $alreadygoneto[$locationn[getarg(0)]], 0;
  391. goto sest;
  392. sest:
  393. setarray $locationn[getarg(0)],rand(0,getarraysize($locationsname$) - 1);
  394. if($alreadygoneto[$locationn[getarg(0)]]==1)goto sest;
  395. setarray $alreadygoneto[$locationn[getarg(0)]], 1;
  396. set $destination,$locationn[$@currenttime];
  397. announce "Pilot: The plane has arrived at "+$locationsname$[$locationn[getarg(1)]]+". Departure to "+ $locationsname$[$locationn[getarg(2)]] + " is in 3 minutes.",16;
  398. end;
  399. }