Advertisement
Decist

Simple Warper NPC

Oct 27th, 2012
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.43 KB | None | 0 0
  1. //============================================================
  2. //= 10/27/2012
  3. //= Valiente - New script! Warps players anywhere they want
  4. //= by just typing the map name!
  5. //= DigmaanRO - Permitted servers: www.woon-ro.com
  6. //============================================================
  7.  
  8. prontera.gat,151,181,3 script Warper2::Warper2 874,{
  9. cutin "ep13_ahat_f",2;
  10. mes "[Warper]";
  11. mes "Would you like to be warped somewhere?";
  12. next;
  13. mes "[Warper]";
  14. mes "Where would you like to be warp?";
  15. next;
  16. menu "Last Warp",lastmap,"Type Map Name",type;
  17.  
  18.  
  19.  
  20. // Guild Dungeons have fees.
  21. lastmap:
  22. if(lastmap$=="") { mes "You have not warped anywhere yet!"; cutin "",255; close; }
  23. if(lastmap$=="arug_dun01" || lastmap$=="schg_dun01" || lastmap$=="gld_dun02" || lastmap$=="gld_dun04") {
  24. mes "Warping here costs ^FF0000" + BaseLevel*5000 + "^000000 Zeny.";
  25. next;
  26. switch(select("Proceed:Nevermind")) {
  27. case 1:
  28. if(BaseLevel*5000 > Zeny) {
  29. mes "[Warper]";
  30. mes "You don't have enough zeny.";
  31. cutin "",255;
  32. close;
  33. }
  34. else
  35. {
  36. warp lastmap$,lastx,lasty;
  37. set Zeny,Zeny-(BaseLevel*5000);
  38. }
  39. case 2:
  40. mes "[Warp Agent]";
  41. mes "Have a nice day.";
  42. cutin "",255;
  43. close;
  44. }
  45. }
  46. warp lastmap$,lastx,lasty; end;
  47.  
  48. type:
  49. setarray .towns$,
  50. "amatsu",
  51. "ayothaya",
  52. "brasilis",
  53. "comodo",
  54. "dewata",
  55. "dicastes01",
  56. "eclage",
  57. "einbroch",
  58. "geffen",
  59. "gonryun",
  60. "hugel",
  61. "izlude",
  62. "jawaii",
  63. "lighthalzen",
  64. "louyang",
  65. "malangdo",
  66. "malaya",
  67. "manuk",
  68. "mora",
  69. "morocc",
  70. "moscovia",
  71. "niflheim",
  72. "payon",
  73. "prontera",
  74. "rachel",
  75. "splendide",
  76. "thor_camp",
  77. "umbala",
  78. "veins",
  79. "xmas",
  80. "yuno"; // 31
  81. setarray .tcoordsx, 197, 150, 196, 209, 199, 197, 111, 64, 120, 160, 96, 128, 213, 158, 217, 224, 212, 260, 111, 156, 219, 202, 179, 155, 130, 200, 246, 127, 216, 147, 157,52;
  82. setarray .tcoordsy, 89, 113, 227, 143, 179, 187, 39, 200, 68, 121, 145, 114, 230, 92, 100, 184, 206, 175, 97, 93, 193, 174, 100, 183, 111, 153, 68, 128, 123, 134, 151,17;
  83.  
  84. setarray .dungeons$,
  85. "abyss_01",
  86. "abyss_02",
  87. "abyss_03",
  88. "ama_dun01",
  89. "ama_dun02",
  90. "ama_dun03",
  91. "anthell01",
  92. "anthell02",
  93. "ayo_dun01",
  94. "ayo_dun02",
  95. "beach_dun",
  96. "beach_dun2",
  97. "beach_dun3",
  98. /*"ecl_tdun01",
  99. "ecl_tdun02",
  100. "ecl_tdun03",
  101. "ecl_tdun04",*/
  102. "lhz_dun01",
  103. "lhz_dun02",
  104. "lhz_dun03",
  105. /*"lhz_dun04",*/
  106. "bra_dun01",
  107. "bra_dun02",
  108. /*"izlu2dun",*/
  109. "iz_dun00",
  110. "iz_dun01",
  111. "iz_dun02",
  112. "iz_dun03",
  113. "iz_dun04",
  114. "c_tower1",
  115. "c_tower2",
  116. "c_tower3",
  117. "c_tower4",
  118. "alde_dun01",
  119. "alde_dun02",
  120. "alde_dun03",
  121. "alde_dun04",
  122. "mjo_dun01",
  123. "mjo_dun02",
  124. "mjo_dun03",
  125. "dew_dun01",
  126. "dew_dun02",
  127. "ein_dun01",
  128. "ein_dun02",
  129. "gef_dun00",
  130. "gef_dun01",
  131. "gef_dun02",
  132. "gef_dun03",
  133. "gefenia01",
  134. "gefenia02",
  135. "gefenia03",
  136. "gefenia04",
  137. "glast_01",
  138. "gl_church",
  139. "gl_chyard",
  140. "gl_cas01",
  141. "gl_cas02",
  142. "gl_prison",
  143. "gl_prison1",
  144. "gl_knt01",
  145. "gl_knt02",
  146. "gl_in01",
  147. "gl_step",
  148. "gl_sew01",
  149. "gl_sew02",
  150. "gl_sew03",
  151. "gl_sew04",
  152. "gl_dun01",
  153. "gl_dun02",
  154. "gon_dun01",
  155. "gon_dun02",
  156. "gon_dun03",
  157. "prt_maze01",
  158. "prt_maze02",
  159. "prt_maze03",
  160. "ice_dun01",
  161. "ice_dun02",
  162. "ice_dun03",
  163. "ice_dun04",
  164. "juperos_01",
  165. "juperos_02",
  166. "jupe_core",
  167. "kh_dun01",
  168. "kh_dun02",
  169. "lou_dun01",
  170. "lou_dun02",
  171. "lou_dun03",
  172. "mag_dun01",
  173. "mag_dun02",
  174. "mosk_dun01",
  175. "most_dun02",
  176. "most_dun03",
  177. "nameless_n",
  178. "abbey01",
  179. "abbey02",
  180. "abbey03",
  181. "1@nyd",
  182. "2@nyd",
  183. "odin_temp01",
  184. "odin_temp02",
  185. "odin_temp03",
  186. "orcsdun01",
  187. "orcsdun02",
  188. "pay_dun00",
  189. "pay_dun01",
  190. "pay_dun02",
  191. "pay_dun03",
  192. "pay_dun04",
  193. "prt_sewb1",
  194. "prt_sewb2",
  195. "prt_sewb3",
  196. "prt_sewb4",
  197. "moc_pryd01",
  198. "moc_pryd02",
  199. "moc_pryd03",
  200. "moc_pryd04",
  201. "moc_pryd05",
  202. "moc_pryd06",
  203. "ra_san01",
  204. "ra_san02",
  205. "ra_san03",
  206. "ra_san04",
  207. "ra_san05",
  208. "dic_dun01",
  209. "dic_dun02",
  210. "dic_dun03",
  211. "in_sphinx1",
  212. "in_sphinx2",
  213. "in_sphinx3",
  214. "in_sphinx4",
  215. "in_sphinx5",
  216. "treasure01",
  217. "treasure02",
  218. "tha_t01";
  219. setarray .dcoordsx, 264, 275, 116, 228, 34, 119, 35, 168, 275, 24, 266, 255, 23,/*ecl*/ 150, 150, 140,/*lhz_dun04*/ 199, 22,/*izlu2dun*/ 168, 253, 236, 32, 26, 199, 148, 65, 56, 297, 127, 277, 268,52,381,302,286,277,22,292,104,115,106,203, 40,203,266,130,270,156,147,199,104,14,150,150,157,77,12,258,108,171, 68,133,224,153, 28,68,176,93,23,157,151,149, 33, 53,37,150, 28, 41,218,282,165,126,47,189,163, 33,256,51,150,120,311,163,298,224,266, 32, 21, 21,19,19,155,201,131,19,180,100,192, 10,100,181,94,192,139, 32, 10,204,150, 151,365,103,288,149,210, 10,100,69,102,150;
  220. setarray .dcoordsy, 272, 270, 28, 11, 41, 14, 262, 170, 19, 26, 67, 244, 260,/*ecl*/ 228, 18, 133,/*lhz_dun04*/ 41, 30,/*izlu2dun*/ 168, 252, 204, 63, 27, 159, 283, 147, 115, 25, 169, 178, 74,17,343,262,162, 31,14,290, 99,236,132,200,103, 34,168,272,304, 7, 15, 29, 25,70, 14, 15,287,68, 7,255,291,283,277,271,274, 53,113,16, 7,20, 8, 14,155, 22,158,247,63,285,226,198,196, 20, 38, 68,30, 46, 33,136,215,14, 11, 10,196,157,167,149,280,170,185,163,33,63,159,204,247,19,169, 92, 9,192, 92, 11,96, 8, 17, 21,149,218, 9, 181, 45,141, 9, 81, 54,222, 99,24, 27, 39;
  221.  
  222. setarray .dungeons2$,
  223. "tha_t02",
  224. "tha_t03",
  225. "tha_t04",
  226. "tha_t05",
  227. "tha_t06",
  228. "tha_t07",
  229. "tha_t08",
  230. "tha_t09",
  231. "tha_t10",
  232. "tha_t11",
  233. "tha_t12",
  234. "thor_v01",
  235. "thor_v02",
  236. "thor_v03",
  237. "xmas_dun01",
  238. "xmas_dun02",
  239. "tur_dun01",
  240. "tur_dun02",
  241. "tur_dun03",
  242. "tur_dun04",
  243. "um_dun01",
  244. "um_dun02",
  245. "gld_dun02",
  246. "gld_dun04",
  247. "arug_dun01",
  248. "schg_dun01";
  249. setarray .d2coordsx,150,220, 59,62, 89, 35, 93, 29,159,19,130, 21, 75, 34,205,129,154,148,132,100,42,51, 26,200,111,200;
  250. setarray .d2coordsy,136,158,143,11,221,166,148,107,138,20, 52,228,205,272, 15,133, 49,261,189,192,31,25,161,193, 31,137;
  251.  
  252. setarray .fields$,
  253. "ama_fild01",
  254. "ayo_fild01",
  255. "ayo_fild02",
  256. "bif_fild01",
  257. "bif_fild02",
  258. "bra_fild01",
  259. "cmd_fild01",
  260. "cmd_fild02",
  261. "cmd_fild03",
  262. "cmd_fild04",
  263. "cmd_fild05",
  264. "cmd_fild06",
  265. "cmd_fild07",
  266. "cmd_fild08",
  267. "cmd_fild09",
  268. "dew_fild01",
  269. "einbech",
  270. "ein_fild01",
  271. "ein_fild02",
  272. "ein_fild03",
  273. "ein_fild04",
  274. "ein_fild05",
  275. "ein_fild06",
  276. "ein_fild07",
  277. "ein_fild08",
  278. "ein_fild09",
  279. "ein_fild10",
  280. "dicastes02",
  281. "dic_fild01",
  282. "dic_fild02",
  283. "gef_fild00",
  284. "gef_fild01",
  285. "gef_fild02",
  286. "gef_fild03",
  287. "gef_fild04",
  288. "gef_fild05",
  289. "gef_fild06",
  290. "gef_fild07",
  291. "gef_fild08",
  292. "gef_fild09",
  293. "gef_fild10",
  294. "gef_fild11",
  295. "gef_fild12",
  296. "gef_fild13",
  297. "gef_fild14",
  298. "gon_fild01",
  299. "hu_fild01",
  300. "hu_fild02",
  301. "hu_fild03",
  302. "hu_fild04",
  303. "hu_fild05",
  304. "hu_fild06",
  305. "hu_fild07",
  306. "lhz_fild01",
  307. "lhz_fild02",
  308. "lhz_fild03",
  309. "lou_fild01",
  310. "xmas_fild01",
  311. "man_fild01",
  312. "man_fild02",
  313. "man_fild03",
  314. "moc_fild01",
  315. "moc_fild02",
  316. "moc_fild03",
  317. "moc_fild04",
  318. "moc_fild05",
  319. "moc_fild06",
  320. "moc_fild07",
  321. "moc_fild08",
  322. "moc_fild09",
  323. "moc_fild10",
  324. "moc_fild11",
  325. "moc_fild12",
  326. "moc_fild13",
  327. "moc_fild14",
  328. "moc_fild15",
  329. "moc_fild16",
  330. "moc_fild17",
  331. "moc_fild18",
  332. "moc_fild19",
  333. "moc_fild21",
  334. "moc_fild22",
  335. "mosk_fild01",
  336. "mosk_fild02",
  337. "mjolnir_01",
  338. "mjolnir_02",
  339. "mjolnir_03",
  340. "mjolnir_04",
  341. "mjolnir_05",
  342. "mjolnir_06",
  343. "mjolnir_07",
  344. "mjolnir_08",
  345. "mjolnir_09",
  346. "mjolnir_10",
  347. "mjolnir_11",
  348. "mjolnir_12",
  349. "nif_fild01",
  350. "nif_fild02",
  351. "pay_fild01",
  352. "pay_fild02",
  353. "pay_fild03",
  354. "pay_fild04",
  355. "pay_fild05",
  356. "pay_fild06",
  357. "pay_fild07",
  358. "pay_fild08",
  359. "pay_fild09",
  360. "pay_fild10",
  361. "pay_fild11",
  362. "prt_fild00",
  363. "prt_fild01",
  364. "prt_fild02",
  365. "prt_fild03",
  366. "prt_fild04",
  367. "prt_fild05",
  368. "prt_fild06",
  369. "prt_fild07",
  370. "prt_fild08",
  371. "prt_fild09",
  372. "prt_fild10",
  373. "prt_fild11",
  374. "ra_fild01",
  375. "ra_fild02",
  376. "ra_fild03",
  377. "ra_fild04",
  378. "ra_fild05",
  379. "ra_fild06",
  380. "ra_fild07";
  381. setarray .fcoordsx, 190,173,212,161,156,78,180,231,191,228,224,190,234,194,172,55,190,142,182,187,185,216,195,272,173,207,196,198,34, 71, 46,213,195,257,188,166,248,195,186,221,178,136,240,235,211,220,268,222,232,252,196,216,227,240,185,240,229,115,364, 38, 84,219,177,194,184,203,213,224,229,195,209,198,156,185,209,223,206,208,209,85, 35, 37, 99,204,204,175,208,179,181,195,235,188,205,245,180,196,215,167,158,151,205,186,134,193,200,137,201,160,194,184,190,240,190,307,239,185,193,187,210,195,198,192,235,202,202,225,202,263;
  382. setarray .fcoordsy, 197,134,150,322,232,34,178,160,172,194,203,223,177,175,172,68, 79,225,141,228,173,173,148,220,214,174,200,192,84,364,199,204,212,192,171,263,158,191,183,117,218,328,181,235,185,227,101,193,185,189,106,220,197,179,235,226,187,145,230,261,364,205,206,182,217,213,208,170,177,198,168,216,187,263,219,188,228,238,223,97,193,195,105, 59,120,193,213,180,240,270,202,215,144,223,206,208,229,234,206,219,148,247,204,235,177,189,224,205,150,235,206,206,143,252,213,188,194,218,183,149,164,162,166,206,208,202,214,196;
  383.  
  384. setarray .fields2$,
  385. "ra_fild08",
  386. "ra_fild09",
  387. "ra_fild10",
  388. "ra_fild11",
  389. "ra_fild12",
  390. "ra_fild13",
  391. "spl_fild01",
  392. "spl_fild02",
  393. "spl_fild03",
  394. "um_fild01",
  395. "um_fild02",
  396. "um_fild03",
  397. "um_fild04",
  398. "ve_fild01",
  399. "ve_fild02",
  400. "ve_fild03",
  401. "ve_fild04",
  402. "ve_fild05",
  403. "ve_fild06",
  404. "ve_fild07",
  405. "yggdrasil01",
  406. "yuno_fild01",
  407. "yuno_fild02",
  408. "yuno_fild03",
  409. "yuno_fild04",
  410. "yuno_fild05",
  411. "yuno_fild06",
  412. "yuno_fild07",
  413. "yuno_fild08",
  414. "yuno_fild09",
  415. "yuno_fild10",
  416. "yuno_fild11",
  417. "yuno_fild12";
  418. setarray .f2coordsx, 217, 87, 277, 221, 175, 174, 288, 98, 98,217,223,237,202,186,196,222, 51,202,150,149,204,189,192,221,226,227,187,231,196,183,200,195,196;
  419. setarray .f2coordsy, 201,121,181, 185, 200, 197, 34, 35,365,206,221,215,197,175,370, 45,250,324,223,307, 78,224,207,157,199,177,232,174,203,214,124,226,370;
  420.  
  421. set .tarraysize, getarraysize(.towns$);
  422. set .darraysize, getarraysize(.dungeons$);
  423. set .d2arraysize, getarraysize(.dungeons2$);
  424. set .farraysize, getarraysize(.fields$);
  425. set .f2arraysize, getarraysize(.fields2$);
  426. set .totalmapsize,.totalmapsize+.tarraysize+.darraysize+.d2arraysize+.farraysize+.f2arraysize;
  427.  
  428. set .darraysize,.darraysize+.d2arraysize;
  429. set .farraysize,.farraysize+.f2arraysize;
  430.  
  431. set .warp$,"prontera"; //default value
  432. mes "[Warp Agent]";
  433. mes "There are "+ .totalmapsize +" maps that can be inputted";
  434. mes "- "+ .tarraysize +" towns";
  435. mes "- "+ .darraysize +" dungeons";
  436. mes "- "+ .farraysize +" fields";
  437. next;
  438. mes "Please type the name of the map you want to go:";
  439. mes "NOTE: ONLY FIELDS, DUNGEONS AND TOWNS.";
  440. mes "Example: prontera, prt_fild08, /etc.";
  441. next;
  442. input .warp$;
  443. set .i,0;
  444. while ((.warp$ != .towns$[.i] && .warp$ != .dungeons$[.i] && .warp$ != .dungeons2$[.i] && .warp$ != .fields$[.i] && .warp$ != .fields2$[.i]) && .i < 128) {
  445. set .i,.i+1;
  446. if(.i == 128) {
  447. mes "[Warp Agent]";
  448. mes "Invalid map! You must have typed a restricted map";
  449. mes "or mispelled the map name.";
  450. cutin "",255;
  451. close;
  452. }
  453. }
  454. next;
  455. mes "[Warp Agent]";
  456. mes "You'll be warped to "+ .warp$ +".";
  457. next;
  458. if(.towns$[.i] == .warp$ ) { warp .towns$[.i],.tcoordsx[.i],.tcoordsy[.i]; set lastmap$,.towns$[.i]; set lastx,.tcoordsx[.i]; set lasty,.tcoordsx[.i]; }
  459. else if(.dungeons$[.i] == .warp$ ) { warp .dungeons$[.i],.dcoordsx[.i],.dcoordsy[.i]; set lastmap$,.dungeons$[.i]; set lastx,.dcoordsx[.i]; set lasty,.dcoordsx[.i]; }
  460. else if(.fields$[.i] == .warp$ ) { warp .fields$[.i],.fcoordsx[.i],.fcoordsy[.i]; set lastmap$,.fields$[.i]; set lastx,.fcoordsx[.i]; set lasty,.fcoordsx[.i]; }
  461. else if(.fields2$[.i] == .warp$ ) { warp .fields2$[.i],.f2coordsx[.i],.f2coordsy[.i]; set lastmap$,.fields2$[.i]; set lastx,.f2coordsx[.i]; set lasty,.f2coordsx[.i]; }
  462. else if(.dungeons2$[.i] == .warp$ ) {
  463. if (.warp$ == "gld_dun02" || .warp$ == "arug_dun01" || .warp$ == "gld_dun04" || .warp$ == "schg_dun01"){
  464. mes "[Warp NPC]";
  465. mes "Warping to this area costs ^FF0000" + BaseLevel*5000 + "^000000 Zeny.";
  466. mes "Is that ok with you?";
  467. next;
  468. switch(select("Yes:No")) {
  469. case 1:
  470. if(BaseLevel*5000 > Zeny){
  471. mes "[Warp Agent]";
  472. mes "I'm sorry, you don't have the required Zeny.";
  473. mes "Please come back once you earned enough.";
  474. cutin "",255;
  475. close;
  476. }
  477. else {
  478. set Zeny,Zeny-(BaseLevel*5000);
  479. warp .dungeons2$[.i],.d2coordsx[.i],.d2coordsy[.i];
  480. set lastmap$,.dungeons2$[.i];
  481. set lastx,.d2scoordsx[.i];
  482. set lasty,.d2coordsy[.i];
  483. }
  484. case 2:
  485. mes "[Warp Agent]";
  486. mes "Have a nice day.";
  487. cutin "",255;
  488. close;
  489. }
  490. }
  491. else {
  492. warp .dungeons2$[.i],.d2coordsx[.i],.d2coordsy[.i];
  493. set lastmap$,.dungeons2$[.i];
  494. set lastx,.d2coordsx[.i];
  495. set lasty,.d2coordsy[.i];
  496. }
  497. }
  498. else {
  499. next;
  500. mes "[Warp Agent]";
  501. mes "I'm sorry, something appears to be wrong.";
  502. mes "I will contact the developer to fix this issue." ;
  503. mes "Sorry for the inconvenience.";
  504. close;
  505. }
  506. end;
  507. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement