Advertisement
Skorm

Toasty Warper 1.32

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