Advertisement
ulin

Untitled

Oct 13th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.78 KB | None | 0 0
  1. //-------------------------------------------------------------------------
  2. //Toasty Warper 1.32
  3. // by ToastOfDoom
  4. //-------------------------------------------------------------------------
  5. //Changelog:
  6. //1.32 --------------------------------------------------------------------
  7. //- Changed default 'Upper' value to allow for 3rd class. (Thanks Annie)
  8. //1.31 --------------------------------------------------------------------
  9. //- Reverted BaseJob check back to jobLookup method but uses BaseJob instead
  10. // of Class. Best of both methods. Saves on post processing calculations
  11. // but still allows for an elegant way of writing script (don't need a
  12. // bunch of exceptions)
  13. //1.3 ---------------------------------------------------------------------
  14. //- Changed OnStart labels to OnStartNPC to prevent mystery errors.
  15. //- Removed jobLookup and replaced with BaseJob check with simple
  16. // adjustment for dancers. (Cheers to AnnieRuru for reminding me)
  17. //- Changed the way Upper status was checked.
  18. //- Changed the way WoE status was checked.
  19. //- Commented out defaultly missing moc_filds.
  20. //- Modified mapserver console output when script loads.
  21. //1.2 ---------------------------------------------------------------------
  22. //- Added a index lookup for maps (.map_<mapname> = index)
  23. //- Implemented user count for nodes (stored in .userCount_#[%])
  24. //- Added settings to turn on/off user count for nodes and maps
  25. // (in OnInit: .showNodeUserCount, .showMapUserCount)
  26. //- Optimised the overflow test function so it wouldn't sleep so much
  27. // (ie..no longer takes so much time to execute)
  28. //1.1 ---------------------------------------------------------------------
  29. //- Renamed some NPCs cause 'warper' was too common and was causing problems
  30. //- Chucked out the old cost system and replaced with a new multi-
  31. // modification structure. Thus old bug with cost not passing on pass 1st
  32. // sub menu no longer exists.
  33. //- Now can dynamically adjusts available maps/menus according to:
  34. // - "gm": 0: allows everyone
  35. // 0+: only allows people above or equal to set gmlevel
  36. // 0-: only allows people below or equal to set gmlevel
  37. // - "woe": 1:active when woe inactive
  38. // 2:active when woe active
  39. // 3:active regardless of woe setting
  40. // - "job": works exactly the same as the 'job' setting in item_db
  41. // - "upper": same as 'upper' setting in item_db
  42. // - "gender": same as 'sex' setting in item_db
  43. // - "blvl": works the same as 'gm' but with base level instead
  44. // - "flag": when passed a variable name, it check if variable is
  45. // empty as the condition to allow access.
  46. // - "function": like with 'flag' but instead of a variable, it uses a
  47. // function name. Will pass the following parameters:
  48. // Node: "Node", <nodeID>, <nodeName>
  49. // Map: "Map", <mapID>, <mapTitle>, <mapName>, <mapX>, <mapY>, <mapCost>
  50. //- Other modifiers added: "zeny", "mapUsers"
  51. //- Shortened some of the map names to get them to fit better
  52. //1.0 ---------------------------------------------------------------------
  53. //- Added menu check in OnInit that checks if a menu may exceed maximum
  54. // menu length. Hardcoded to print a warning at 2000 characters to
  55. // compensate for changes in length due to number of map users. Client
  56. // will crash if exceeds 2047.
  57. //0.3 ---------------------------------------------------------------------
  58. //- Fixed npc duplication problem
  59. //- Added last warp functionality (edit .numLastWarps in OnInit to adjust
  60. // number of listed warps)
  61. //- Colour-coded some things in the menu
  62. //0.2 ---------------------------------------------------------------------
  63. //- Fixed bad lookup names for x/y coords for warp (thanks BrianL)
  64. //- Removed 'Back' option for root node
  65. //- Added ablilty to define basic zeny cost to individual nodes and/or maps
  66. //0.1 ---------------------------------------------------------------------
  67. //- Initial Release
  68. //-------------------------------------------------------------------------
  69. - script toastywarperbase -1,{
  70.  
  71. function StartNode;
  72. function EndNode;
  73. function AddMap;
  74. function SetArrayValue;
  75. function GetArrayValue;
  76. function WipeArray; //can't use cleararray =P
  77. function ComputeMenu;
  78. function ShowMenu;
  79. function SelectMap;
  80. function AddLastWarpsNode;
  81. function ConvertStringToChrArray;
  82. function GenerateMapSaveString;
  83. function AddMapToList;
  84. function ListMaps;
  85. function InitialiseMapData;
  86. function PrepLastWarpsMenu;
  87. function TestMenus;
  88. function CountAllUsers;
  89.  
  90. OnStartNPC:
  91. set @gotoCount, 0; //make sure it doesn't overflow and crash later on.
  92. if(getgmlevel() >= .gmAccessLvl) {
  93. mes "Would to like to test all the menus for overflow error?";
  94. next;
  95. if(prompt("Yes:No") == 1) {
  96. TestMenus();
  97. }
  98. }
  99.  
  100. mes "Welcome!!";
  101.  
  102. if(.showNodeUserCount)
  103. CountAllUsers();
  104.  
  105. next;
  106.  
  107. set .@selectedMap, ShowMenu();
  108. SelectMap(.@selectedMap);
  109.  
  110. end;
  111.  
  112. function ShowMenu {
  113. setarray .@stack$[0], ".menu_0$"; //traversed menu stack
  114.  
  115. while(1) {
  116. set .@currentMenu$, .@stack$[getarraysize(.@stack$) - 1];
  117. set .@menuStr$, ComputeMenu(.@currentMenu$);
  118.  
  119. if(getstrlen(.@menuStr$) >= 2047) { //graceful close if menu string overflows(2047)
  120. debugmes "TOASTYWARPER - ERROR: Menu (" + getd(.@currentMenu$ + "[0]") + ") has overflowed: " + getstrlen(.@menuStr$) + " chars.";
  121. mes "An error has occurred. Please notify the GMs";
  122. close;
  123. }
  124. set .@menu, select(.@menuStr$);
  125. set .@selectedItem, atoi(getd(.@currentMenu$ + "[" + (.@menu + 1) + "]"));
  126.  
  127. if(.@selectedItem == 0) {
  128. //back
  129. if(getarraysize(.@stack$) <= 1) {
  130. set .@i, -1;
  131. break;
  132. }
  133. setarray .@stack$[getarraysize(.@stack$) - 1], "";
  134. } else
  135. if(.@selectedItem <= .mapOffset) {
  136. setarray .@stack$[getarraysize(.@stack$)], ((.@selectedItem == .mapOffset)?"@menu_lastwarps$":".menu_" + .@selectedItem + "$");
  137. } else {
  138. //leaf node - map
  139. set .@i, .@selectedItem - .mapOffset;
  140. break;
  141. }
  142. }
  143. return .@i;
  144. }
  145.  
  146. function CountAllUsers {
  147. //".userCount_#[%]"
  148. set .@i, .nodeCount;
  149.  
  150. while(.@i > 0) {
  151. set .@nodePtr$, ".menu_" + .@i + "$";
  152. set .@userCount, 0;
  153. set .@k, 2;
  154. while(getd(.@nodePtr$ + "[" + .@k + "]") != "") {
  155. set .@selectedItem, atoi(getd(.@nodePtr$ + "[" + .@k + "]"));
  156. if(.@selectedItem <= .mapOffset) {
  157. //node
  158. set .@userCount, .@userCount + ((.@selectedItem != .mapOffset)?
  159. (getd(".userCount_" + (.@selectedItem / 128) + "[" + (.@selectedItem % 128))):
  160. 0); //make sure it's not the lastwarp menu
  161. } else {
  162. //map
  163. set .@selectedItem, .@selectedItem - .mapOffset;
  164.  
  165. set .@a$, "_" + (.@selectedItem / 128) + "$[" + (.@selectedItem % 128) + "]";
  166. set .@mapMap$, getd(".maps_map" + .@a$);
  167. set .@mapUsers$, getd(".maps_mapUsers" + .@a$);
  168.  
  169. set .@userCount, .@userCount + getmapusers((.@mapUsers$ == "")?.@mapMap$:.@mapUsers$);
  170. }
  171. set .@k, .@k + 1;
  172. }
  173. setd(".userCount_" + (.@i / 128) + "[" + (.@i % 128) + "]", .@userCount);
  174. set .@i, .@i - 1;
  175. }
  176. }
  177.  
  178. //Dynamic generation of menus happens in here!!!
  179. function ComputeMenu { //menu_pointer
  180. //default precomputed string (here for memory's sake)
  181. //return getd(getarg(0) + "[1]");
  182. set .@i, 2;
  183. set @gotoCount, @gotoCount + 3;
  184.  
  185. while(getd(getarg(0) + "[" + .@i + "]") != "") {
  186. set .@selectedItem, atoi(getd(getarg(0) + "[" + .@i + "]"));
  187.  
  188. set .@player_job, getd(".jobLookUp_" + BaseJob);
  189.  
  190. set @gotoCount, @gotoCount + 1;
  191. if(.@selectedItem <= .mapOffset) {
  192. //node - category
  193. set @gotoCount, @gotoCount + 1;
  194. if(.@selectedItem == .mapOffset) {
  195. //lastwarp
  196. set .@output$, .@output$ + "Last Warp";
  197. } else {
  198. set .@enable, 1;
  199. set .@a$, "_" + (.@selectedItem / 128) + "[" + (.@selectedItem % 128) + "]";
  200. set .@b$, "_" + (.@selectedItem / 128) + "$[" + (.@selectedItem % 128) + "]";
  201.  
  202. set .@nodeName$, getd(".menu_" + .@selectedItem + "$[0]");
  203. set .@gm, getd(".menus_gm" + .@a$);
  204. set .@woe, getd(".menus_woe" + .@a$);
  205. set .@job, getd(".menus_job" + .@a$);
  206. set .@upper, getd(".menus_upper" + .@a$);
  207. set .@gender, getd(".menus_gender" + .@a$);
  208. set .@blvl, getd(".menus_blvl" + .@a$);
  209. set .@flag$, getd(".menus_flag" + .@b$);
  210. set .@function$, getd(".menus_function" + .@b$);
  211.  
  212. set .@enable, .@enable && ((.@gm >= 0)?(getgmlevel() >= .@gm):((getgmlevel() + .@gm) <= 0));
  213. set .@enable, .@enable && (.@woe & ((agitcheck() || agitcheck2()) + 1) > 0);
  214. set .@enable, .@enable && ((.@job & (1 << .@player_job)) > 0);
  215. set .@enable, .@enable && ((.@upper & pow(2, Upper)) > 0);
  216. set .@enable, .@enable && (.@gender == Sex || .@gender == 2);
  217. set .@enable, .@enable && ((.@blvl >= 0)?(BaseLevel >= .@blvl):(BaseLevel + .@blvl <= 0));
  218. set .@enable, .@enable && ((.@flag$ != "")?getd(.@flag$):1);
  219. if(.@function$ != "") //used if here cause logical operators won't shortcircuit and thus will execute really bad code
  220. set .@enable, .@enable && callfunc(.@function$, "Node", .@selectedItem, .@nodeName$);
  221.  
  222. set .@userCount, getd(".userCount" + .@a$);
  223.  
  224. set .@output$, .@output$ + ((.@enable)?(.@nodeName$ +
  225. ((.showNodeUserCount)?(" [^0000FF" + .@userCount + "^000000]"):"")):"");
  226.  
  227. set @gotoCount, @gotoCount + 2;
  228. }
  229.  
  230. set .@output$, .@output$ + ":";
  231. } else {
  232. //leaf node - map
  233. set .@selectedItem, .@selectedItem - .mapOffset;
  234.  
  235. set .@enable, 1;
  236. set .@a$, "_" + (.@selectedItem / 128) + "[" + (.@selectedItem % 128) + "]";
  237. set .@b$, "_" + (.@selectedItem / 128) + "$[" + (.@selectedItem % 128) + "]";
  238.  
  239. set .@mapName$, getd(".maps_name" + .@b$);
  240. set .@mapMap$, getd(".maps_map" + .@b$);
  241.  
  242. set .@zeny, getd(".maps_zeny" + .@a$);
  243. set .@gm, getd(".maps_gm" + .@a$);
  244. set .@woe, getd(".maps_woe" + .@a$);
  245. set .@job, getd(".maps_job" + .@a$);
  246. set .@upper, getd(".maps_upper" + .@a$);
  247. set .@gender, getd(".maps_gender" + .@a$);
  248. set .@blvl, getd(".maps_blvl" + .@a$);
  249. set .@mapUsers$, getd(".maps_mapUsers" + .@b$);
  250. set .@flag$, getd(".maps_flag" + .@b$);
  251. set .@function$, getd(".maps_function" + .@b$);
  252.  
  253. set .@enable, .@enable && ((.@gm >= 0)?(getgmlevel() >= .@gm):((getgmlevel() + .@gm) <= 0));
  254. set .@enable, .@enable && (.@woe & ((agitcheck() || agitcheck2()) + 1) > 0);
  255. set .@enable, .@enable && ((.@job & (1 << .@player_job)) > 0);
  256. set .@enable, .@enable && ((.@upper & pow(2, Upper)) > 0);
  257. set .@enable, .@enable && (.@gender == Sex || .@gender == 2);
  258. set .@enable, .@enable && ((.@blvl >= 0)?(BaseLevel >= .@blvl):(BaseLevel + .@blvl <= 0));
  259. set .@enable, .@enable && ((.@flag$ != "")?getd(.@flag$):1);
  260. if(.@function$ != "") { //used if here cause logical operators won't shortcircuit and thus will execute really bad code
  261. set .@mapX, getd(".maps_x" + .@a$);
  262. set .@mapY, getd(".maps_y" + .@a$);
  263. set .@enable, .@enable && callfunc(.@function$, "Map", .@selectedItem, .@mapName$, .@mapMap$, .@mapX, .@mapY, .@zeny);
  264. }
  265.  
  266. set .@numUsers, getmapusers((.@mapUsers$ == "")?.@mapMap$:.@mapUsers$);
  267.  
  268. set .@output$, .@output$ + ((.@enable)?
  269. ("- " + .@mapName$ +
  270. ((.showMapUserCount)?(" [^0000FF" + .@numUsers + "^000000]"):"") +
  271. ((.@zeny > 0)?(" - " + .@zeny + "z"):"")):"") + ":";
  272.  
  273. set @gotoCount, @gotoCount + 2;
  274. }
  275. set .@i, .@i + 1;
  276. set @gotoCount, @gotoCount + 1;
  277. }
  278. return .@output$ + ((getarg(0) != ".menu_0$") ? "Back" : "");
  279. }
  280.  
  281. function SelectMap { // <mapID>
  282. set .@name$, GetArrayValue(".maps_name", getarg(0), 1);
  283. set .@map$, GetArrayValue(".maps_map", getarg(0), 1);
  284. set .@x, GetArrayValue(".maps_x", getarg(0));
  285. set .@y, GetArrayValue(".maps_y", getarg(0));
  286. set .@users, getmapusers(.@map$);
  287. set .@cost, GetArrayValue(".maps_zeny", getarg(0));
  288.  
  289. mes "^0000FF" + .@name$ + "^000000 has ^0000FF" + .@users + "^000000 player" + ((.@users != 1)?"s":"") + " at the moment.";
  290. if(.@cost > 0) {
  291. mes "It costs ^0000FF" + .@cost + "z^000000 to warp here.";
  292. if(Zeny < .@cost) {
  293. mes " ";
  294. mes "^FF0000You do not have enough zeny to warp here.^000000";
  295. mes "Please come back when you do.";
  296. close2;
  297. return;
  298. }
  299. }
  300.  
  301. mes "Would you like to warp there now?";
  302.  
  303. set .@menu, select("Yes:No");
  304. close2;
  305.  
  306. if(.@menu == 1) {
  307. AddMapToList(getarg(0) + 1);
  308. PrepLastWarpsMenu();
  309.  
  310. set Zeny, Zeny - .@cost;
  311. //warp .@map$, .@x, .@y;
  312. warpportal 152, 182,.@map$,.@x,.@y;
  313. }
  314.  
  315. return;
  316. }
  317.  
  318. OnPCLoginEvent:
  319. set @toasty_stackStart, 0;
  320. ConvertStringToChrArray(toasty_mapSave$, "@toasty_savedMaps");
  321. InitialiseMapData();
  322. end;
  323.  
  324. OnInit:
  325. set .gotoLimit, 2000; //lower this if you get infinite loop errors
  326. set .numLastWarps, 10; //max 64
  327. set .gmAccessLvl, 80;
  328.  
  329. set .mapOffset, 1000; //increase if total number of nodes exceed
  330.  
  331. set .showNodeUserCount, 1; //enables|disables display of number of users on nodes
  332. set .showMapUserCount, 1; //enables|disables display of number of users on maps
  333.  
  334. //used for data compression in last warp storage (DON'T TOUCH)
  335. setarray .char$[0],
  336. "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
  337. "A", "B", "C", "D", "E", "F", "G", "H", "I",
  338. "J", "K", "L", "M", "N", "O", "P", "Q", "R",
  339. "S", "T", "U", "V", "W", "X", "Y", "Z",
  340. "a", "b", "c", "d", "e", "f", "g", "h", "i",
  341. "j", "k", "l", "m", "n", "o", "p", "q", "r",
  342. "s", "t", "u", "v", "w", "x", "y", "z",
  343. "{", "|";
  344.  
  345. setarray .mapModifiers$[0], "", "zeny", "gm", "woe", "job", "upper", "gender", "blvl", "mapUsers", "flag", "function";
  346. setarray .tempModPtrs$[0], ".@badData$", ".@node_zeny", ".@node_gm", ".@node_woe", ".@node_job", ".@node_upper", ".@node_gender", ".@node_blvl", ".@node_mapUsers$", ".@node_flag$", ".@node_function$";
  347.  
  348. //define index lookups for modifiers
  349. while(.@i < getarraysize(.mapModifiers$)) {
  350. setd(".modifier_" + .mapModifiers$[.@i], .@i);
  351. set .@i, .@i + 1;
  352. }
  353.  
  354. //define index lookups for jobs
  355. setarray .@jobLookup_0[0], Job_Novice, Job_SuperNovice;
  356. setarray .@jobLookup_1[0], Job_Swordman;
  357. setarray .@jobLookup_2[0], Job_Mage;
  358. setarray .@jobLookup_3[0], Job_Archer;
  359. setarray .@jobLookup_4[0], Job_Acolyte;
  360. setarray .@jobLookup_5[0], Job_Merchant;
  361. setarray .@jobLookup_6[0], Job_Thief;
  362. setarray .@jobLookup_7[0], Job_Knight;
  363. setarray .@jobLookup_8[0], Job_Priest;
  364. setarray .@jobLookup_9[0], Job_Wizard;
  365. setarray .@jobLookup_10[0], Job_Blacksmith;
  366. setarray .@jobLookup_11[0], Job_Hunter;
  367. setarray .@jobLookup_12[0], Job_Assassin;
  368. setarray .@jobLookup_14[0], Job_Crusader;
  369. setarray .@jobLookup_15[0], Job_Monk;
  370. setarray .@jobLookup_16[0], Job_Sage;
  371. setarray .@jobLookup_18[0], Job_Alchemist;
  372. setarray .@jobLookup_19[0], Job_Bard, Job_Dancer;
  373. setarray .@jobLookup_21[0], Job_Taekwon;
  374. setarray .@jobLookup_22[0], Job_Star_Gladiator;
  375. setarray .@jobLookup_23[0], Job_Soul_Linker;
  376. setarray .@jobLookup_24[0], Job_Gunslinger;
  377. setarray .@jobLookup_25[0], Job_Ninja;
  378.  
  379. set .@i, 0;
  380. while(.@i < 25) {
  381. set .@jobsPtr$, ".@jobLookup_" + .@i;
  382. set .@k, getarraysize(getd(.@jobsPtr$));
  383. while(.@k > 0) {
  384. set .@k, .@k - 1;
  385. setd(".jobLookUp_" + getd(.@jobsPtr$ + "[" + .@k + "]"), .@i);
  386. }
  387. set .@i, .@i + 1;
  388. }
  389.  
  390. callsub(LoadData);
  391. end;
  392.  
  393. LoadData:
  394. //reset data;
  395. set .nodeCount, 0;
  396. set .mapCount, 1;
  397. cleararray(.buildStack$[0], "", 128);
  398. setarray .buildStack$[0], ".menu_0$";
  399.  
  400. //default mod values
  401. setarray .stack_zeny[0], 0;
  402. setarray .stack_gm[0], 0;
  403. setarray .stack_woe[0], 3;
  404. setarray .stack_job[0], 0x03FFFFFF;
  405. setarray .stack_upper[0], 119;
  406. setarray .stack_gender[0], 2;
  407. setarray .stack_blvl[0], 0;
  408. setarray .stack_mapUsers$[0], "";
  409. setarray .stack_flag$[0], "";
  410. setarray .stack_function$[0], "";
  411.  
  412. set .stackLevel, 1;
  413.  
  414. set .gotoCount, 0;
  415. sleep(1);
  416. set .@startLoadTime, gettimetick(0);
  417.  
  418. AddLastWarpsNode();
  419. StartNode("Towns");
  420. AddMap("Alberta", "alberta", 28, 234);
  421. AddMap("Aldebaran", "aldebaran", 140, 131);
  422. AddMap("Amatsu", "amatsu", 198, 84);
  423. AddMap("Ayothaya", "ayothaya", 150, 163);
  424. AddMap("Comodo", "comodo", 209, 143);
  425. AddMap("Einbech (Mining Village);", "einbech", 70, 95);
  426. AddMap("Einbroch", "einbroch", 64, 200);
  427. AddMap("Geffen", "geffen", 119, 59);
  428. AddMap("Gonryun", "gonryun", 160, 121);
  429. AddMap("Hugel", "hugel", 96, 145);
  430. AddMap("Izlude", "izlude", 128, 114);
  431. AddMap("Jawaii", "jawaii", 213, 230);
  432. AddMap("Lighthalzen", "lighthalzen", 158, 92);
  433. AddMap("Louyang", "louyang", 210, 108);
  434. AddMap("Lutie", "xmas", 147, 134);
  435. AddMap("Moscovia", "moscovia", 214, 183);
  436. AddMap("Morroc", "morocc", 156, 93);
  437. AddMap("Nameless Island", "nameless_n", 256, 215);
  438. AddMap("Niflheim", "niflheim", 85, 154);
  439. AddMap("Payon", "payon", 152, 75);
  440. AddMap("Prontera", "prontera", 155, 183);
  441. AddMap("Rachel", "rachel", 130, 137);
  442. AddMap("Thor Camp", "thor_camp", 254, 90);
  443. AddMap("Veins", "veins", 216, 123);
  444. AddMap("Yuno", "yuno", 157, 51);
  445. AddMap("Umbala", "umbala", 145, 155);
  446. EndNode();
  447. StartNode("Fields");
  448. StartNode("Amatsu Fields");
  449. AddMap("Amatsu Field 1", "ama_fild01", 190, 197);
  450. EndNode();
  451. StartNode("Ayothaya Fields");
  452. AddMap("Ayothaya Field 1", "ayo_fild01", 173, 134);
  453. AddMap("Ayothaya Field 2", "ayo_fild02", 212, 150);
  454. EndNode();
  455. StartNode("Comodo Fields");
  456. AddMap("Comodo Field 1", "cmd_fild01", 180, 178);
  457. AddMap("Comodo Field 2", "cmd_fild02", 231, 160);
  458. AddMap("Comodo Field 3", "cmd_fild03", 191, 172);
  459. AddMap("Comodo Field 4", "cmd_fild04", 228, 194);
  460. AddMap("Comodo Field 5", "cmd_fild05", 224, 203);
  461. AddMap("Comodo Field 6", "cmd_fild06", 190, 223);
  462. AddMap("Comodo Field 7", "cmd_fild07", 234, 177);
  463. AddMap("Comodo Field 8", "cmd_fild08", 194, 175);
  464. AddMap("Comodo Field 9", "cmd_fild09", 172, 172);
  465. EndNode();
  466. StartNode("Einbroch Fields");
  467. AddMap("Einbroch Field 1", "ein_fild01", 142, 225);
  468. AddMap("Einbroch Field 2", "ein_fild02", 182, 141);
  469. AddMap("Einbroch Field 3", "ein_fild03", 187, 228);
  470. AddMap("Einbroch Field 4", "ein_fild04", 185, 173);
  471. AddMap("Einbroch Field 5", "ein_fild05", 216, 173);
  472. AddMap("Einbroch Field 6", "ein_fild06", 195, 148);
  473. AddMap("Einbroch Field 7", "ein_fild07", 272, 220);
  474. AddMap("Einbroch Field 8", "ein_fild08", 173, 214);
  475. AddMap("Einbroch Field 9", "ein_fild09", 207, 174);
  476. AddMap("Einbroch Field 10", "ein_fild10", 196, 200);
  477. EndNode();
  478. StartNode("Geffen Fields");
  479. AddMap("Geffen Field 0", "gef_fild00", 46, 199);
  480. AddMap("Geffen Field 1", "gef_fild01", 213, 204);
  481. AddMap("Geffen Field 2", "gef_fild02", 195, 212);
  482. AddMap("Geffen Field 3", "gef_fild03", 257, 192);
  483. AddMap("Geffen Field 4", "gef_fild04", 188, 171);
  484. AddMap("Geffen Field 5", "gef_fild05", 166, 263);
  485. AddMap("Geffen Field 6", "gef_fild06", 248, 158);
  486. AddMap("Geffen Field 7", "gef_fild07", 195, 191);
  487. AddMap("Geffen Field 8", "gef_fild08", 186, 183);
  488. AddMap("Geffen Field 9", "gef_fild09", 221, 117);
  489. AddMap("Geffen Field 10", "gef_fild10", 178, 218);
  490. AddMap("Geffen Field 11", "gef_fild11", 136, 328);
  491. AddMap("Geffen Field 12", "gef_fild12", 240, 181);
  492. AddMap("Geffen Field 13", "gef_fild13", 235, 235);
  493. AddMap("Geffen Field 14", "gef_fild14", 211, 185);
  494. EndNode();
  495. StartNode("Gonryun Fields");
  496. AddMap("Gonryun Field 1", "gon_fild01", 220, 227);
  497. EndNode();
  498. StartNode("Hugel Fields");
  499. AddMap("Hugel Field 1", "hu_fild01", 268, 101);
  500. AddMap("Hugel Field 2", "hu_fild02", 222, 193);
  501. AddMap("Hugel Field 3", "hu_fild03", 232, 185);
  502. AddMap("Hugel Field 4", "hu_fild04", 252, 189);
  503. AddMap("Hugel Field 5", "hu_fild05", 196, 106);
  504. AddMap("Hugel Field 6", "hu_fild06", 216, 220);
  505. AddMap("Hugel Field 7", "hu_fild07", 227, 197);
  506. EndNode();
  507. StartNode("Lighthalzen Fields");
  508. AddMap("Lighthalzen Field 1", "lhz_fild01", 240, 179);
  509. AddMap("Lighthalzen Field 2", "lhz_fild02", 185, 235);
  510. AddMap("Lighthalzen Field 3", "lhz_fild03", 240, 226);
  511. EndNode();
  512. StartNode("Louyang Field");
  513. AddMap("Louyang Field 1", "lou_fild01", 229, 187);
  514. EndNode();
  515. StartNode("Lutie Field");
  516. AddMap("Lutie Field 1", "xmas_fild01", 115, 145);
  517. EndNode();
  518. StartNode("Manuk Fields");
  519. AddMap("Manuk Field 1", "man_fild01", 200, 210);
  520. AddMap("Manuk Field 2", "man_fild02", 206, 219);
  521. EndNode();
  522. StartNode("Mjolnir Fields");
  523. AddMap("Mjolnir Field 1", "mjolnir_01", 204, 120);
  524. AddMap("Mjolnir Field 2", "mjolnir_02", 175, 193);
  525. AddMap("Mjolnir Field 3", "mjolnir_03", 208, 213);
  526. AddMap("Mjolnir Field 4", "mjolnir_04", 179, 180);
  527. AddMap("Mjolnir Field 5", "mjolnir_05", 181, 240);
  528. AddMap("Mjolnir Field 6", "mjolnir_06", 195, 270);
  529. AddMap("Mjolnir Field 7", "mjolnir_07", 235, 202);
  530. AddMap("Mjolnir Field 8", "mjolnir_08", 188, 215);
  531. AddMap("Mjolnir Field 9", "mjolnir_09", 205, 144);
  532. AddMap("Mjolnir Field 10", "mjolnir_10", 245, 223);
  533. AddMap("Mjolnir Field 11", "mjolnir_11", 180, 206);
  534. AddMap("Mjolnir Field 12", "mjolnir_12", 196, 208);
  535. EndNode();
  536. StartNode("Moscovia Fields");
  537. AddMap("Okrestnosti of Moscovia Field 1", "mosk_fild01", 82, 104);
  538. AddMap("Okrestnosti of Moscovia 2", "mosk_fild02", 131, 147);
  539. EndNode();
  540. StartNode("Niflheim Fields");
  541. AddMap("Niflheim Field 1", "nif_fild01", 215, 229);
  542. AddMap("Niflheim Field 2", "nif_fild02", 167, 234);
  543. EndNode();
  544. StartNode("Odin Temple");
  545. AddMap("Odin Temple 1", "odin_tem01", 298, 167);
  546. AddMap("Odin Temple 2", "odin_tem02", 224, 149);
  547. AddMap("Odin Temple 3", "odin_tem03", 266, 280);
  548. EndNode();
  549. StartNode("Payon Forests");
  550. AddMap("Payon Forest 1", "pay_fild01", 158, 206);
  551. AddMap("Payon Forest 2", "pay_fild02", 151, 219);
  552. AddMap("Payon Forest 3", "pay_fild03", 205, 148);
  553. AddMap("Payon Forest 4", "pay_fild04", 186, 247);
  554. AddMap("Payon Forest 5", "pay_fild05", 134, 204);
  555. AddMap("Payon Forest 6", "pay_fild06", 193, 235);
  556. AddMap("Payon Forest 7", "pay_fild07", 200, 177);
  557. AddMap("Payon Forest 8", "pay_fild08", 137, 189);
  558. AddMap("Payon Forest 9", "pay_fild09", 201, 224);
  559. AddMap("Payon Forest 10", "pay_fild10", 160, 205);
  560. AddMap("Payon Forest 11", "pay_fild11", 194, 150);
  561. EndNode();
  562. StartNode("Prontera Fields");
  563. AddMap("Prontera Field 0", "prt_fild00", 184, 235);
  564. AddMap("Prontera Field 1", "prt_fild01", 190, 206);
  565. AddMap("Prontera Field 2", "prt_fild02", 240, 206);
  566. AddMap("Prontera Field 3", "prt_fild03", 190, 143);
  567. AddMap("Prontera Field 4", "prt_fild04", 307, 252);
  568. AddMap("Prontera Field 5", "prt_fild05", 239, 213);
  569. AddMap("Prontera Field 6", "prt_fild06", 185, 188);
  570. AddMap("Prontera Field 7", "prt_fild07", 193, 194);
  571. AddMap("Prontera Field 8", "prt_fild08", 187, 218);
  572. AddMap("Prontera Field 9", "prt_fild09", 210, 183);
  573. AddMap("Prontera Field 10", "prt_fild10", 195, 149);
  574. AddMap("Prontera Field 11", "prt_fild11", 198, 164);
  575. EndNode();
  576. StartNode("Rachel Fields");
  577. AddMap("Rachel Field 1", "ra_fild01", 192, 162);
  578. AddMap("Rachel Field 2", "ra_fild02", 235, 166);
  579. AddMap("Rachel Field 3", "ra_fild03", 202, 206);
  580. AddMap("Rachel Field 4", "ra_fild04", 202, 208);
  581. AddMap("Rachel Field 5", "ra_fild05", 225, 202);
  582. AddMap("Rachel Field 6", "ra_fild06", 202, 214);
  583. AddMap("Rachel Field 7", "ra_fild07", 263, 196);
  584. AddMap("Rachel Field 8", "ra_fild08", 217, 201);
  585. AddMap("Rachel Field 9", "ra_fild09", 87, 121);
  586. AddMap("Rachel Field 10", "ra_fild10", 277, 181);
  587. AddMap("Rachel Field 11", "ra_fild11", 221, 185);
  588. AddMap("Rachel Field 12", "ra_fild12", 175, 200);
  589. AddMap("Rachel Field 13", "ra_fild13", 174, 197);
  590. EndNode();
  591. StartNode("Sograt Deserts");
  592. AddMap("Sograt Desert 1", "moc_fild01", 219, 205);
  593. AddMap("Sograt Desert 2", "moc_fild02", 177, 206);
  594. AddMap("Sograt Desert 3", "moc_fild03", 194, 182);
  595. //AddMap("Sograt Desert 4", "moc_fild04", 184, 217);
  596. //AddMap("Sograt Desert 5", "moc_fild05", 203, 213);
  597. //AddMap("Sograt Desert 6", "moc_fild06", 213, 208);
  598. AddMap("Sograt Desert 7", "moc_fild07", 224, 170);
  599. //AddMap("Sograt Desert 8", "moc_fild08", 229, 177);
  600. //AddMap("Sograt Desert 9", "moc_fild09", 195, 198);
  601. //AddMap("Sograt Desert 10", "moc_fild10", 209, 168);
  602. AddMap("Sograt Desert 11", "moc_fild11", 198, 216);
  603. AddMap("Sograt Desert 12", "moc_fild12", 156, 187);
  604. AddMap("Sograt Desert 13", "moc_fild13", 185, 263);
  605. //AddMap("Sograt Desert 14", "moc_fild14", 209, 219);
  606. //AddMap("Sograt Desert 15", "moc_fild15", 223, 188);
  607. AddMap("Sograt Desert 16", "moc_fild16", 206, 228);
  608. AddMap("Sograt Desert 17", "moc_fild17", 208, 238);
  609. AddMap("Sograt Desert 18", "moc_fild18", 209, 223);
  610. AddMap("Sograt Desert 19", "moc_fild19", 85, 97);
  611. AddMap("Sograt Desert 20", "moc_fild20", 85, 97);
  612. AddMap("Sograt Desert 21", "moc_fild21", 85, 97);
  613. AddMap("Sograt Desert 22", "moc_fild22", 85, 97);
  614. EndNode();
  615. StartNode("Splendide Fields");
  616. AddMap("Splendide Field 1", "spl_fild01", 175, 186);
  617. AddMap("Splendide Field 2", "spl_fild02", 236, 184);
  618. AddMap("Splendide Field 3", "spl_fild03", 188, 204);
  619. EndNode();
  620. StartNode("Umbala Fields");
  621. AddMap("Umbala Field 1", "um_fild01", 217, 206);
  622. AddMap("Umbala Field 2", "um_fild02", 223, 221);
  623. AddMap("Umbala Field 3", "um_fild03", 237, 215);
  624. AddMap("Umbala Field 4", "um_fild04", 202, 197);
  625. EndNode();
  626. StartNode("Veins Fields");
  627. AddMap("Veins Field 1", "ve_fild01", 186, 175);
  628. AddMap("Veins Field 2", "ve_fild02", 196, 370);
  629. AddMap("Veins Field 3", "ve_fild03", 222, 45);
  630. AddMap("Veins Field 4", "ve_fild04", 51, 250);
  631. AddMap("Veins Field 5", "ve_fild05", 202, 324);
  632. AddMap("Veins Field 6", "ve_fild06", 150, 223);
  633. AddMap("Veins Field 7", "ve_fild07", 149, 307);
  634. EndNode();
  635. StartNode("Yuno Fields");
  636. AddMap("Yuno Field 1", "yuno_fild01", 189, 224);
  637. AddMap("Yuno Field 2", "yuno_fild02", 192, 207);
  638. AddMap("Yuno Field 3", "yuno_fild03", 221, 157);
  639. AddMap("Yuno Field 4", "yuno_fild04", 226, 199);
  640. AddMap("Yuno Field 5", "yuno_fild05", 223, 177);
  641. AddMap("Yuno Field 6", "yuno_fild06", 187, 232);
  642. AddMap("Yuno Field 7", "yuno_fild07", 231, 174);
  643. AddMap("Yuno Field 8", "yuno_fild08", 196, 203);
  644. AddMap("Yuno Field 9", "yuno_fild09", 183, 214);
  645. AddMap("Yuno Field 10", "yuno_fild10", 200, 124);
  646. AddMap("Yuno Field 11", "yuno_fild11", 195, 226);
  647. AddMap("Yuno Field 12", "yuno_fild12", 210, 304);
  648. EndNode();
  649. EndNode();
  650. StartNode("Dungeons");
  651. StartNode("Abbey, Cursed Monastery");
  652. AddMap("Abbey, Cursed Monastery - Lvl 1", "abbey01", 51, 14);
  653. AddMap("Abbey, Cursed Monastery - Lvl 2", "abbey02", 150, 11);
  654. AddMap("Abbey, Cursed Monastery - Lvl 3", "abbey03", 120, 10);
  655. EndNode();
  656. StartNode("Abyss Lakes");
  657. AddMap("Abyss Lakes - Lvl 1", "abyss_01", 192, 207);
  658. AddMap("Abyss Lakes - Lvl 2", "abyss_02", 275, 270);
  659. AddMap("Abyss Lakes - Lvl 3", "abyss_03", 116, 27);
  660. EndNode();
  661. StartNode("Amatsu Dungeon");
  662. AddMap("Amatsu Dungeon - Lvl 1", "ama_dun01", 228, 11);
  663. AddMap("Amatsu Dungeon - Lvl 2", "ama_dun02", 34, 41);
  664. AddMap("Amatsu Dungeon - Lvl 3", "ama_dun03", 119, 14);
  665. EndNode();
  666. StartNode("Anthell");
  667. AddMap("Anthell - Lvl 1", "anthell01", 35, 262);
  668. AddMap("Anthell - Lvl 2", "anthell02", 168, 170);
  669. EndNode();
  670. StartNode("Beach Dungeon");
  671. AddMap("Beach Dungeon - Lvl 1", "beach_dun", 266, 67);
  672. AddMap("Beach Dungeon - Lvl 2", "beach_dun2", 255, 244);
  673. AddMap("Beach Dungeon - Lvl 3", "beach_dun3", 23, 260);
  674. EndNode();
  675. StartNode("Ayothaya Dungeons");
  676. AddMap("Ancient Shrine Maze", "ayo_dun01", 275, 19);
  677. AddMap("Inside Ancient Shrine", "ayo_dun02", 24, 26);
  678. EndNode();
  679. StartNode("Byalan Dungeon");
  680. AddMap("Byalan Dungeon - Lvl 1", "iz_dun00", 168, 168);
  681. AddMap("Byalan Dungeon - Lvl 2", "iz_dun01", 253, 252);
  682. AddMap("Byalan Dungeon - Lvl 3", "iz_dun02", 236, 204);
  683. AddMap("Byalan Dungeon - Lvl 4", "iz_dun03", 32, 63);
  684. AddMap("Byalan Dungeon - Lvl 5", "iz_dun04", 26, 27);
  685. EndNode();
  686. StartNode("Clock Tower");
  687. AddMap("Clock Tower - Lvl 1", "c_tower1", 199, 159);
  688. AddMap("Clock Tower - Lvl 2", "c_tower2", 148, 283);
  689. AddMap("Clock Tower - Lvl 3", "c_tower3", 65, 147);
  690. AddMap("Clock Tower - Lvl 4", "c_tower4", 56, 155);
  691. AddMap("Clock Tower - Basement 1", "alde_dun01", 297, 25);
  692. AddMap("Clock Tower - Basement 2", "alde_dun02", 127, 169);
  693. AddMap("Clock Tower - Basement 3", "alde_dun03", 277, 178);
  694. AddMap("Clock Tower - Basement 4", "alde_dun04", 268, 74);
  695. EndNode();
  696. StartNode("Coal Mines");
  697. AddMap("Coal Mines - Lvl 1", "mjo_dun01", 52, 17);
  698. AddMap("Coal Mines - Lvl 2", "mjo_dun02", 381, 343);
  699. AddMap("Coal Mines - Lvl 3", "mjo_dun03", 302, 262);
  700. EndNode();
  701. StartNode("Culverts");
  702. AddMap("Culverts - Lvl 1", "prt_sewb1", 131, 247);
  703. AddMap("Culverts - Lvl 2", "prt_sewb2", 19, 19);
  704. AddMap("Culverts - Lvl 3", "prt_sewb3", 180, 169);
  705. AddMap("Culverts - Lvl 4", "prt_sewb4", 100, 92);
  706. EndNode();
  707. StartNode("Einbroch Dungeons");
  708. AddMap("Einbroch Dungeons - Lvl 1", "ein_dun01", 22, 14);
  709. AddMap("Einbroch Dungeons - Lvl 2", "ein_dun02", 292, 290);
  710. EndNode();
  711. StartNode("Gefenia");
  712. AddMap("Gefenia - Lvl 1", "gefenia01", 40, 103);
  713. AddMap("Gefenia - Lvl 2", "gefenia02", 203, 34);
  714. AddMap("Gefenia - Lvl 3", "gefenia03", 266, 168);
  715. AddMap("Gefenia - Lvl 4", "gefenia04", 130, 272);
  716. EndNode();
  717. StartNode("Geffen Dungeon");
  718. AddMap("Geffen Dungeon - Lvl 1", "gef_dun00", 104, 99);
  719. AddMap("Geffen Dungeon - Lvl 2", "gef_dun01", 115, 236);
  720. AddMap("Geffen Dungeon - Lvl 3", "gef_dun02", 106, 132);
  721. AddMap("Geffen Dungeon - Lvl 4", "gef_dun03", 203, 200);
  722. EndNode();
  723. StartNode("Glast Heim");
  724. AddMap("Glast Heim - Entrance", "glast_01", 375, 304);
  725. AddMap("Glast Heim - Castle 1", "gl_cas01", 199, 29);
  726. AddMap("Glast Heim - Castle 2", "gl_cas02", 104, 25);
  727. AddMap("Glast Heim - Chivalry 1", "gl_knt01", 150, 15);
  728. AddMap("Glast Heim - Chivalry 2", "gl_knt02", 157, 287);
  729. AddMap("Glast Heim - Churchyard", "gl_chyard", 147, 15);
  730. AddMap("Glast Heim - Culvert 1", "gl_sew01", 258, 255);
  731. AddMap("Glast Heim - Culvert 2", "gl_sew02", 108, 291);
  732. AddMap("Glast Heim - Culvert 3", "gl_sew03", 171, 283);
  733. AddMap("Glast Heim - Culvert 4", "gl_sew04", 68, 277);
  734. AddMap("Glast Heim - St.Abbey", "gl_church", 156, 7);
  735. AddMap("Glast Heim - Staircase Dungeon", "gl_step", 12, 7);
  736. AddMap("Glast Heim - UG Cave 1", "gl_dun01", 133, 271);
  737. AddMap("Glast Heim - UG Cave 2", "gl_dun02", 224, 274);
  738. AddMap("Glast Heim - UG Prison 1", "gl_prison", 14, 70);
  739. AddMap("Glast Heim - UG Prison 2", "gl_prison1", 150, 14);
  740. EndNode();
  741. StartNode("Gonryun Dungeon");
  742. AddMap("Gonryun Dungeon - Lvl 1", "gon_dun01", 153, 53);
  743. AddMap("Gonryun Dungeon - Lvl 2", "gon_dun02", 28, 113);
  744. AddMap("Gonryun Dungeon - Lvl 3", "gon_dun03", 68, 16);
  745. EndNode();
  746. StartNode("Hidden Dungeon");
  747. AddMap("Hidden Dungeon - Lvl 1", "prt_maze01", 176, 7);
  748. AddMap("Hidden Dungeon - Lvl 2", "prt_maze02", 94, 9);
  749. AddMap("Hidden Dungeon - Lvl 3", "prt_maze03", 23, 8);
  750. EndNode();
  751. StartNode("Ice Dungeon");
  752. AddMap("Ice Dungeon - Lvl 1", "ice_dun01", 157, 14);
  753. AddMap("Ice Dungeon - Lvl 2", "ice_dun02", 151, 155);
  754. AddMap("Ice Dungeon - Lvl 3", "ice_dun03", 149, 22);
  755. AddMap("Ice Dungeon - Lvl 4", "ice_dun04", 33, 158);
  756. EndNode();
  757. StartNode("Juperos Dungeons");
  758. AddMap("Juperos Dungeons - Lvl 1", "juperos_01", 53, 247);
  759. AddMap("Juperos Dungeons - Lvl 2", "juperos_02", 37, 63);
  760. AddMap("Juperos Dungeons - Core", "jupe_core", 150, 285);
  761. EndNode();
  762. StartNode("Kiel Dungeons");
  763. AddMap("Kiel Dungeons - Lvl 1", "kh_dun01", 28, 226);
  764. AddMap("Kiel Dungeons - Lvl 2", "kh_dun02", 41, 198);
  765. EndNode();
  766. StartNode("Lighthalzen Dungeons");
  767. AddMap("Lighthalzen Dungeons - Lvl 1", "lhz_dun01", 150, 288);
  768. AddMap("Lighthalzen Dungeons - Lvl 2", "lhz_dun02", 150, 18);
  769. AddMap("Lighthalzen Dungeons - Lvl 3", "lhz_dun03", 140, 130);
  770. EndNode();
  771. StartNode("Louyang Dungeons");
  772. AddMap("The Royal Tomb", "lou_dun01", 218, 196);
  773. AddMap("Inside the Royal Tomb", "lou_dun02", 282, 20);
  774. AddMap("Suei Long Gon", "lou_dun03", 165, 38);
  775. EndNode();
  776. StartNode("Magma Dungeon");
  777. AddMap("Magma Dungeon - Lvl 1", "mag_dun01", 126, 68);
  778. AddMap("Magma Dungeon - Lvl 2", "mag_dun02", 47, 30);
  779. EndNode();
  780. StartNode("Moscovia Dungeons");
  781. AddMap("Les Forest", "mosk_dun01", 132, 124);
  782. AddMap("Temny Forest", "mosk_dun02", 155, 123);
  783. AddMap("Dremuci Forest", "mosk_dun03", 122, 130);
  784. EndNode();
  785. StartNode("Orc Dungeon");
  786. AddMap("Orc Dungeon - Lvl 1", "orcsdun01", 32, 170);
  787. AddMap("Orc Dungeon - Lvl 2", "orcsdun02", 21, 185);
  788. EndNode();
  789. StartNode("Payon Dungeon");
  790. AddMap("Payon Dungeon - Lvl 1", "pay_dun00", 21, 183);
  791. AddMap("Payon Dungeon - Lvl 2", "pay_dun01", 19, 33);
  792. AddMap("Payon Dungeon - Lvl 3", "pay_dun02", 19, 63);
  793. AddMap("Payon Dungeon - Lvl 4", "pay_dun03", 155, 159);
  794. AddMap("Payon Dungeon - Lvl 5", "pay_dun04", 201, 204);
  795. EndNode();
  796. StartNode("Pyramids");
  797. AddMap("Pyramids - Lvl 1", "moc_pryd01", 192, 9);
  798. AddMap("Pyramids - Lvl 2", "moc_pryd02", 10, 192);
  799. AddMap("Pyramids - Lvl 3", "moc_pryd03", 100, 92);
  800. AddMap("Pyramids - Lvl 4", "moc_pryd04", 181, 11);
  801. AddMap("Pyramids - Basement 1", "moc_pryd05", 94, 96);
  802. AddMap("Pyramids - Basement 2", "moc_pryd06", 192, 8);
  803. EndNode();
  804. StartNode("Rachel Sanctuary");
  805. AddMap("Rachel Sanctuary - Lvl 1", "ra_san01", 140, 11);
  806. AddMap("Rachel Sanctuary - Lvl 2", "ra_san02", 32, 21);
  807. AddMap("Rachel Sanctuary - Lvl 3", "ra_san03", 4, 149);
  808. AddMap("Rachel Sanctuary - Lvl 4", "ra_san04", 204, 218);
  809. AddMap("Rachel Sanctuary - Lvl 5", "ra_san05", 150, 9);
  810. EndNode();
  811. StartNode("Sphinx");
  812. AddMap("Sphinx - Lvl 1", "in_sphinx1", 288, 9);
  813. AddMap("Sphinx - Lvl 2", "in_sphinx2", 149, 81);
  814. AddMap("Sphinx - Lvl 3", "in_sphinx3", 210, 54);
  815. AddMap("Sphinx - Lvl 4", "in_sphinx4", 10, 222);
  816. AddMap("Sphinx - Lvl 5", "in_sphinx5", 100, 99);
  817. EndNode();
  818. StartNode("Sunken Ship");
  819. AddMap("Sunken Ship - Lvl 1", "treasure01", 69, 24);
  820. AddMap("Sunken Ship - Lvl 2", "treasure02", 102, 27);
  821. EndNode();
  822. StartNode("Thanatos Tower");
  823. AddMap("Thanatos Tower - Lvl 1", "tha_t01", 150, 39);
  824. AddMap("Thanatos Tower - Lvl 2", "tha_t02", 150, 136);
  825. AddMap("Thanatos Tower - Lvl 3", "tha_t03", 220, 158);
  826. AddMap("Thanatos Tower - Lvl 4", "tha_t04", 59, 143);
  827. AddMap("Thanatos Tower - Lvl 5", "tha_t05", 62, 11);
  828. AddMap("Thanatos Tower - Lvl 6", "tha_t06", 89, 221);
  829. AddMap("Thanatos Tower - Lvl 7", "tha_t07", 35, 166);
  830. AddMap("Thanatos Tower - Lvl 8", "tha_t08", 93, 148);
  831. AddMap("Thanatos Tower - Lvl 9", "tha_t09", 29, 107);
  832. AddMap("Thanatos Tower - Lvl 10", "tha_t10", 159, 138);
  833. AddMap("Thanatos Tower - Lvl 11", "tha_t11", 19, 20);
  834. AddMap("Thanatos Tower - Lvl 12", "tha_t12", 130, 52);
  835. EndNode();
  836. StartNode("Thor Volcano");
  837. AddMap("Thor Volcano - Lvl 1", "thor_v01", 21, 228);
  838. AddMap("Thor Volcano - Lvl 2", "thor_v02", 75, 205);
  839. AddMap("Thor Volcano - Lvl 3", "thor_v03", 34, 272);
  840. EndNode();
  841. StartNode("Toy Factory");
  842. AddMap("Toy Factory - Lvl 1", "xmas_dun01", 205, 15);
  843. AddMap("Toy Factory - Lvl 2", "xmas_dun02", 129, 133);
  844. EndNode();
  845. StartNode("Turtle Dungeon");
  846. AddMap("Turtle Dungeon - Entrance", "tur_dun01", 154, 49);
  847. AddMap("Turtle Dungeon - Lvl 1", "tur_dun02", 148, 261);
  848. AddMap("Turtle Dungeon - Lvl 2", "tur_dun03", 132, 189);
  849. AddMap("Turtle Dungeon - Lvl 3", "tur_dun04", 100, 192);
  850. EndNode();
  851. StartNode("Umbala Dungeons");
  852. AddMap("Carpenter's Shop in the Tree", "um_dun01", 42, 31);
  853. AddMap("Passage to a Foreign World", "um_dun01", 48, 30);
  854. AddMap("Hvergermil's Fountain", "yggdrasil01", 204, 78);
  855. EndNode();
  856. EndNode();
  857. StartNode("Guild Dungeons");
  858. AddMap("Baldur Guild Dungeon", "gld_dun01", 119, 93);
  859. AddMap("Luina Guild Dungeon", "gld_dun02", 39, 161);
  860. AddMap("Valkyrie Guild Dungeon", "gld_dun03", 50, 44);
  861. AddMap("Britoniah Guild Dungeon", "gld_dun04", 116, 45);
  862. EndNode();
  863. StartNode("Castles");
  864. StartNode("Aldebaran Castles");
  865. AddMap("Neuschwanstein(Aldebaran)", "alde_gld", 48, 83, "mapUsers", "aldeg_cas01");
  866. AddMap("Hohenschwangau(Aldebaran)", "alde_gld", 95, 249, "mapUsers", "aldeg_cas02");
  867. AddMap("Nuenberg(Aldebaran)", "alde_gld", 142, 85, "mapUsers", "aldeg_cas03");
  868. AddMap("Wuerzburg(Aldebaran)", "alde_gld", 239, 242, "mapUsers", "aldeg_cas04");
  869. AddMap("Rothenburg(Aldebaran)", "alde_gld", 264, 90, "mapUsers", "aldeg_cas05");
  870. EndNode();
  871. StartNode("Geffen Castles");
  872. AddMap("Repherion(Geffen)", "gef_fild13", 214, 75, "mapUsers", "gefg_cas01");
  873. AddMap("Eeyolbriggar(Geffen)", "gef_fild13", 308, 240, "mapUsers", "gefg_cas02");
  874. AddMap("Yesnelph(Geffen)", "gef_fild13", 143, 240, "mapUsers", "gefg_cas03");
  875. AddMap("Bergel(Geffen)", "gef_fild13", 193, 278, "mapUsers", "gefg_cas04");
  876. AddMap("Mersetzdeitz(Geffen)", "gef_fild13", 305, 87, "mapUsers", "gefg_cas05");
  877. EndNode();
  878. StartNode("Payon Castles");
  879. AddMap("Bright Arbor(Payon)", "pay_gld", 121, 233, "mapUsers", "payg_cas01");
  880. AddMap("Scarlet Palace(Payon)", "pay_gld", 295, 116, "mapUsers", "payg_cas02");
  881. AddMap("Holy Shadow(Payon)", "pay_gld", 317, 293, "mapUsers", "payg_cas03");
  882. AddMap("Sacred Altar(Payon)", "pay_gld", 140, 160, "mapUsers", "payg_cas04");
  883. AddMap("Bamboo Grove Hill(Payon)", "pay_gld", 204, 266, "mapUsers", "payg_cas05");
  884. EndNode();
  885. StartNode("Prontera Castles");
  886. AddMap("Kriemhild(Prontera)", "prt_gld", 134, 65, "mapUsers", "prtg_cas01");
  887. AddMap("Swanhild(Prontera)", "prt_gld", 240, 128, "mapUsers", "prtg_cas02");
  888. AddMap("Fadhgridh(Prontera)", "prt_gld", 153, 137, "mapUsers", "prtg_cas03");
  889. AddMap("Skoegul(Prontera)", "prt_gld", 111, 240, "mapUsers", "prtg_cas04");
  890. AddMap("Gondul(Prontera)", "prt_gld", 208, 240, "mapUsers", "prtg_cas05");
  891. EndNode();
  892. StartNode("Schwaltzvalt Castles");
  893. AddMap("Himinn(Schwaltzvalt)", "sch_gld", 293, 100, "mapUsers", "schg_cas01");
  894. AddMap("Andlangr(Schwaltzvalt)", "sch_gld", 288, 252, "mapUsers", "schg_cas02");
  895. AddMap("Viblainn(Schwaltzvalt)", "sch_gld", 97, 196, "mapUsers", "schg_cas03");
  896. AddMap("Hljod(Schwaltzvalt)", "sch_gld", 137, 90, "mapUsers", "schg_cas04");
  897. AddMap("Skidbladnir(Schwaltzvalt)", "sch_gld", 71, 315, "mapUsers", "schg_cas05");
  898. EndNode();
  899. StartNode("Arunafeltz Castles");
  900. AddMap("Mardol(Arunafeltz)", "aru_gld", 158, 272, "mapUsers", "arug_cas01");
  901. AddMap("Cyr(Arunafeltz)", "aru_gld", 83, 47, "mapUsers", "arug_cas02");
  902. AddMap("Horn(Arunafeltz)", "aru_gld", 68, 155, "mapUsers", "arug_cas03");
  903. AddMap("Gefn(Arunafeltz)", "aru_gld", 299, 345, "mapUsers", "arug_cas04");
  904. AddMap("Bandis(Arunafeltz)", "aru_gld", 292, 107, "mapUsers", "arug_cas05");
  905. EndNode();
  906. StartNode("Other");
  907. AddMap("Casino", "cmd_in02", 179, 129);
  908. EndNode();
  909.  
  910. debugmes "TOASTYWARPER - Map Data Loaded: " + .mapCount + " maps, " + (gettimetick(0) - .@startLoadTime) + "ms";
  911. cleararray(.buildStack$[0], "", 128);
  912. //debugmes "gotos: " + .gotoCount;
  913. sleep(1);
  914. end;
  915.  
  916. //-----------------------------------------------------------
  917. //TEST FUNCTIONS
  918. //-----------------------------------------------------------
  919. function TestMenus {
  920. sleep2(1);
  921. set @gotoCount, 1;
  922. while(.@i < .nodeCount) {
  923.  
  924. set .@nodePtr$, ".menu_" + .@i + "$";
  925. set .@menu$, ComputeMenu(.@nodePtr$);
  926. if(getstrlen(.@menu$) >= 2000) {
  927. set .@check, 1;
  928. mes "Menu (" + getd(.@nodePtr$ + "[0]") + ") may overflow (" + getstrlen(.@menu$) + " chars)";
  929. }
  930. set .@i, .@i + 1;
  931.  
  932. set @gotoCount, @gotoCount + 2;
  933. sleep2(@gotoCount >= .gotoLimit);
  934. set @gotoCount, @gotoCount * (@gotoCount < .gotoLimit);
  935. }
  936. if(.@check == 0)
  937. mes "No overflows detected";
  938.  
  939. next;
  940. }
  941.  
  942. //-----------------------------------------------------------
  943. //TREE MAPPING FUNCTIONS
  944. //-----------------------------------------------------------
  945.  
  946. function AddLastWarpsNode {
  947. set .@parentNodePtr$, .buildStack$[.stackLevel - 1];
  948.  
  949. //add to parent node
  950. setd(.@parentNodePtr$ + "[1]", getd(.@parentNodePtr$ + "[1]") + "Last Warp" + ":");
  951. setd(.@parentNodePtr$ + "[" + getarraysize(getd(.@parentNodePtr$)) + "]", .mapOffset);
  952.  
  953. //infinte loop check
  954. set .gotoCount, .gotoCount + 3;
  955. sleep(.gotoCount >= .gotoLimit);
  956. set .gotoCount, .gotoCount * (.gotoCount < .gotoLimit);
  957. }
  958.  
  959. function StartNode {
  960. set .@header$, getarg(0, "");
  961.  
  962. set .nodeCount, .nodeCount + 1;
  963. set .@nodePtr$, ".menu_" + .nodeCount + "$";
  964.  
  965. set .@parentNodePtr$, .buildStack$[.stackLevel - 1];
  966.  
  967. //clear the node just in case there was something in it
  968. cleararray(getd(.@nodePtr$), "", 128);
  969.  
  970. //add to parent node
  971. setd(.@parentNodePtr$ + "[1]", getd(.@parentNodePtr$ + "[1]") + .@header$ + ":");
  972. setd(.@parentNodePtr$ + "[" + getarraysize(getd(.@parentNodePtr$)) + "]", .nodeCount);
  973. setd(.@nodePtr$ + "[0]", .@header$);
  974.  
  975. //carry down node data
  976. set .@node_zeny, .stack_zeny[.stackLevel - 1];
  977. set .@node_gm, .stack_gm[.stackLevel - 1];
  978. set .@node_woe, .stack_woe[.stackLevel - 1];
  979. set .@node_job, .stack_job[.stackLevel - 1];
  980. set .@node_upper, .stack_upper[.stackLevel - 1];
  981. set .@node_gender, .stack_gender[.stackLevel - 1];
  982. set .@node_blvl, .stack_blvl[.stackLevel - 1];
  983. set .@node_mapUsers$, .stack_mapUsers$[.stackLevel - 1];
  984. set .@node_flag$, .stack_flag$[.stackLevel - 1];
  985. set .@node_function$, .stack_function$[.stackLevel - 1];
  986.  
  987. //check for modifiers
  988. set .@i, 1;
  989. while((getarg(.@i, "") + "") != "" && (getarg(.@i + 1, "") + "") != "") {
  990. set .@modIndex, getd(".modifier_" + getarg(.@i));
  991. setd(.tempModPtrs$[.@modIndex], getarg(.@i + 1));
  992.  
  993. set .@i, .@i + 2;
  994. set .gotoCount, .gotoCount + 1;
  995. }
  996. set .gotoCount, .gotoCount + 1;
  997.  
  998. setarray .buildStack$[.stackLevel], .@nodePtr$; //add to stack
  999.  
  1000. //push data to stack
  1001. setarray .stack_zeny[.stackLevel], .@node_zeny;
  1002. setarray .stack_gm[.stackLevel], .@node_gm;
  1003. setarray .stack_woe[.stackLevel], .@node_woe;
  1004. setarray .stack_job[.stackLevel], .@node_job;
  1005. setarray .stack_upper[.stackLevel], .@node_upper;
  1006. setarray .stack_gender[.stackLevel], .@node_gender;
  1007. setarray .stack_blvl[.stackLevel], .@node_blvl;
  1008. setarray .stack_mapUsers$[.stackLevel], .@node_mapUsers$;
  1009. setarray .stack_flag$[.stackLevel], .@node_flag$;
  1010. setarray .stack_function$[.stackLevel], .@node_function$;
  1011.  
  1012. //store node applicable mods
  1013. set .@a$, "_" + (.nodeCount / 128) + "[" + (.nodeCount % 128) + "]";
  1014. set .@b$, "_" + (.nodeCount / 128) + "$[" + (.nodeCount % 128) + "]";
  1015. setd(".menus_gm" + .@a$, .@node_gm);
  1016. setd(".menus_woe" + .@a$, .@node_woe);
  1017. setd(".menus_job" + .@a$, .@node_job);
  1018. setd(".menus_upper" + .@a$, .@node_upper);
  1019. setd(".menus_gender" + .@a$, .@node_gender);
  1020. setd(".menus_blvl" + .@a$, .@node_blvl);
  1021. setd(".menus_flag" + .@b$, .@node_flag$);
  1022. setd(".menus_function" + .@b$, .@node_function$);
  1023.  
  1024. set .stackLevel, .stackLevel + 1;
  1025.  
  1026. //infinte loop check
  1027. set .gotoCount, .gotoCount + 3;
  1028. sleep(.gotoCount >= .gotoLimit);
  1029. set .gotoCount, .gotoCount * (.gotoCount < .gotoLimit);
  1030. }
  1031.  
  1032. function EndNode {
  1033. set .stackLevel, .stackLevel - 1;
  1034. set .@nodePtr$, .buildStack$[.stackLevel];
  1035. setd(.@nodePtr$ + "[1]", getd(.@nodePtr$ + "[1]") + "Back"); //add back option to menu
  1036.  
  1037. setarray .buildStack$[.stackLevel], ""; //remove from stack
  1038.  
  1039. //pop the stack
  1040. setarray .stack_zeny[.stackLevel], .@node_zeny;
  1041. setarray .stack_gm[.stackLevel], 0;
  1042. setarray .stack_woe[.stackLevel], 0;
  1043. setarray .stack_job[.stackLevel], 0x0FFFFFFF;
  1044. setarray .stack_upper[.stackLevel], 8;
  1045. setarray .stack_gender[.stackLevel], 2;
  1046. setarray .stack_blvl[.stackLevel], 0;
  1047. setarray .stack_mapUsers$[.stackLevel], "";
  1048. setarray .stack_flag$[.stackLevel], "";
  1049. setarray .stack_function$[.stackLevel], "";
  1050.  
  1051. //infinte loop check
  1052. set .gotoCount, .gotoCount + 2;
  1053. sleep(.gotoCount >= .gotoLimit);
  1054. set .gotoCount, .gotoCount * (.gotoCount < .gotoLimit);
  1055. }
  1056.  
  1057. function AddMap {
  1058. set .@nodePtr$, .buildStack$[.stackLevel - 1];
  1059.  
  1060. if(getmapusers(getarg(1)) >= 0) { //makes sure it's a real map
  1061. //add to map arrays (basically 4x SetArrayValue calls..but put inline to prevent infinite loop error)
  1062. set .@a$, "_" + (.mapCount / 128) + "[" + (.mapCount % 128) + "]";
  1063. set .@b$, "_" + (.mapCount / 128) + "$[" + (.mapCount % 128) + "]";
  1064.  
  1065. setd ".maps_name" + .@b$, getarg(0);
  1066. setd ".maps_map" + .@b$, getarg(1);
  1067. setd ".maps_x" + .@a$, getarg(2);
  1068. setd ".maps_y" + .@a$, getarg(3);
  1069.  
  1070. //carry down node data
  1071. set .@node_zeny, .stack_zeny[.stackLevel - 1];
  1072. set .@node_gm, .stack_gm[.stackLevel - 1];
  1073. set .@node_woe, .stack_woe[.stackLevel - 1];
  1074. set .@node_job, .stack_job[.stackLevel - 1];
  1075. set .@node_upper, .stack_upper[.stackLevel - 1];
  1076. set .@node_gender, .stack_gender[.stackLevel - 1];
  1077. set .@node_blvl, .stack_blvl[.stackLevel - 1];
  1078. set .@node_mapUsers$, .stack_mapUsers$[.stackLevel - 1];
  1079. set .@node_flag$, .stack_flag$[.stackLevel - 1];
  1080. set .@node_function$, .stack_function$[.stackLevel - 1];
  1081.  
  1082. //check for modifiers
  1083. set .@i, 4;
  1084. while((getarg(.@i, "") + "") != "" && (getarg(.@i + 1, "") + "") != "") {
  1085. set .@modIndex, getd(".modifier_" + getarg(.@i));
  1086. setd(.tempModPtrs$[.@modIndex], getarg(.@i + 1));
  1087. set .@i, .@i + 2;
  1088. set .gotoCount, .gotoCount + 1;
  1089. }
  1090. set .gotoCount, .gotoCount + 1;
  1091.  
  1092. //store map applicable modifiers
  1093. setd(".maps_zeny" + .@a$, .@node_zeny);
  1094. setd(".maps_gm" + .@a$, .@node_gm);
  1095. setd(".maps_woe" + .@a$, .@node_woe);
  1096. setd(".maps_job" + .@a$, .@node_job);
  1097. setd(".maps_upper" + .@a$, .@node_upper);
  1098. setd(".maps_gender" + .@a$, .@node_gender);
  1099. setd(".maps_blvl" + .@a$, .@node_blvl);
  1100. setd(".maps_mapUsers" + .@b$, .@node_mapUsers$);
  1101. setd(".maps_flag" + .@b$, .@node_flag$);
  1102. setd(".maps_function" + .@b$, .@node_function$);
  1103.  
  1104. //add to parent node
  1105. setd(.@nodePtr$ + "[1]", getd(.@nodePtr$ + "[1]") + "- " + getarg(0) + ":");
  1106. setd(.@nodePtr$ + "[" + getarraysize(getd(.@nodePtr$)) + "]", .mapCount + .mapOffset);
  1107.  
  1108. //set index lookup for map
  1109. setd(".map_" + getarg(1), .mapCount);
  1110.  
  1111. set .mapCount, .mapCount + 1;
  1112. } else {
  1113. debugmes("TOASTYWARPER - BADMAP: " + getarg(0) + " - " + getarg(1));
  1114. }
  1115.  
  1116. //infinte loop check
  1117. set .gotoCount, .gotoCount + 3;
  1118. sleep(.gotoCount >= .gotoLimit);
  1119. set .gotoCount, .gotoCount * (.gotoCount < .gotoLimit);
  1120. }
  1121.  
  1122. //-----------------------------------------------------------
  1123. //INFINITE ARRAY FUNCTIONS
  1124. //-----------------------------------------------------------
  1125. function SetArrayValue {// <arrayname>, <index>, <value>{, <isString> = 0}
  1126. //debugmes("setarrayvalue: " + (getarg(0) + "_" + (getarg(1) / 128) + "[" + (getarg(1) % 128) + "]"));
  1127. setd getarg(0) + "_" + (getarg(1) / 128) + (getarg(3, 0)?"$":"") + "[" + (getarg(1) % 128) + "]", getarg(2);
  1128. return;
  1129. }
  1130.  
  1131. function GetArrayValue { // <arrayname>, <index>{, <isString> = 0}
  1132. //debugmes("getarrayvalue: " + getarg(0) + "_" + (getarg(1) / 128) + (getarg(2, 0)?"$":"") + "[" + (getarg(1) % 128) + "]");
  1133. return getd(getarg(0) + "_" + (getarg(1) / 128) + (getarg(2, 0)?"$":"") + "[" + (getarg(1) % 128) + "]");
  1134. }
  1135.  
  1136. function WipeArray { //<arrayname>, <num_indices>{{, <value> = 0}, <isString> = 0}
  1137. set .@count, getarg(1) / 128 + 1;
  1138. for(set .@i, 0; .@i < .@count; set .@i, .@i + 1)
  1139. cleararray(getd(getarg(0) + "_" + .@i + (getarg(3, 0)?"$":"") + "[0]"), getarg(2, 0), 128);
  1140. return;
  1141. }
  1142.  
  1143. //-----------------------------------------------------------
  1144. //LAST WARPS STORAGE FUNCTIONS
  1145. //-----------------------------------------------------------
  1146.  
  1147. function PrepLastWarpsMenu {
  1148. set @menu_lastwarps$[0], "Last Warps";
  1149.  
  1150. while(.@i < 128 && .@count < .numLastWarps) {
  1151. set .@map, @toasty_savedMaps[(@toasty_stackStart + .@i) % 128] - 1;
  1152. if(.@map > 0 && .@map < .mapCount) {
  1153. set .@mapName$, getd(".maps_name_" + (.@map / 128) + "$" + "[" + (.@map % 128) + "]");
  1154. set @menu_lastwarps$[.@count + 2], .@map + .mapOffset;
  1155.  
  1156. set .@count, .@count + 1;
  1157. set .@menu$, .@menu$ + .@mapName$ + ":";
  1158. }
  1159. set .@i, .@i + 1;
  1160. }
  1161. set @menu_lastwarps$[1], .@menu$ + "Back";
  1162. return;
  1163. }
  1164.  
  1165. function InitialiseMapData {
  1166. while(.@i < getarraysize(@toasty_savedMaps)) {
  1167. setd("@toasty_map" + @toasty_savedMaps[.@i], (@toasty_savedMaps[.@i] > 0)?.@i + 1:0);
  1168. set .@i, .@i + 1;
  1169. }
  1170. PrepLastWarpsMenu();
  1171. return;
  1172. }
  1173.  
  1174. function AddMapToList { //<mapIndex>
  1175. set .@map, getarg(0);
  1176.  
  1177. if(getd("@toasty_map" + .@map) > 0) {
  1178. if(@toasty_savedMaps[getd("@toasty_map" + .@map) - 1] == .@map) { //double checking
  1179. set @toasty_savedMaps[getd("@toasty_map" + .@map) - 1], 0;
  1180. }
  1181. }
  1182. set @toasty_stackStart, (@toasty_stackStart + 127) % 128;
  1183.  
  1184. set @toasty_savedMaps[@toasty_stackStart], .@map;
  1185. setd("@toasty_map" + .@map, @toasty_stackStart + 1);
  1186.  
  1187. set toasty_mapSave$, GenerateMapSaveString();
  1188. return;
  1189. }
  1190.  
  1191. function ListMaps { //debug
  1192. while(.@i < 128 && .@count < .numLastWarps) {
  1193. if( @toasty_savedMaps[(@toasty_stackStart + .@i) % 128] > 0) {
  1194. set .@count, .@count + 1;
  1195. set .@out$, .@out$ + @toasty_savedMaps[(@toasty_stackStart + .@i) % 128] + ", ";
  1196. }
  1197. set .@i, .@i + 1;
  1198. }
  1199. return .@out$;
  1200. }
  1201.  
  1202. function GenerateMapSaveString {
  1203. while(.@i < 128 && .@count < .numLastWarps) {
  1204. set .@index, (@toasty_stackStart + .@i) % 128;
  1205. if( @toasty_savedMaps[(@toasty_stackStart + .@i) % 128] > 0) {
  1206. set .@count, .@count + 1;
  1207. set .@out$, .@out$ + .char$[(@toasty_savedMaps[.@index] % 64)] + .char$[(@toasty_savedMaps[.@index] / 64)];
  1208. }
  1209. set .@i, .@i + 1;
  1210. }
  1211. return .@out$;
  1212. }
  1213.  
  1214. function ConvertStringToChrArray {
  1215. if ( getstrlen( getarg(0) ) > 128 ) return 0;
  1216. set .@charsize, getarraysize(.char$);
  1217. set .@str$, getarg(0);
  1218. set .@len, getstrlen(.@str$);
  1219.  
  1220. sleep2 1;
  1221.  
  1222. do {
  1223. set .@range[0], .@charsize;
  1224. set .@range[1], 0;
  1225.  
  1226. //ignore repetiton, it keeps the gotos down
  1227. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1228. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1229. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1230. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1231. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1232. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1233. set .@range[(.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"))], (.@range[0] + .@range[1]) / 2;
  1234.  
  1235. set .@charIndex, (.@range[0] + .@range[1]) / 2 + (.@str$ > (.@temp$ + .char$[(.@range[0] + .@range[1]) / 2] + "?"));
  1236.  
  1237. set .@temp$, .@temp$ + .char$[.@charIndex];
  1238. set .@arr[.@i / 2], .@arr[.@i / 2] + .@charIndex * (1 + 63 * (.@i % 2));
  1239.  
  1240. set .@i, .@i + 1;
  1241. } while( .@i < .@len );
  1242.  
  1243. sleep2 1; //used alot of gotos..sleep for good measure
  1244.  
  1245. deletearray getd(getarg(1));
  1246. copyarray getd(getarg(1)), .@arr, .@len / 2;
  1247.  
  1248. return .@len / 2;
  1249. }
  1250. end;
  1251. }
  1252.  
  1253. prontera,151,186,5 script Warper#toasty 721,{
  1254. doevent "toastywarperbase::OnStartNPC";
  1255. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement