Advertisement
kolton

Untitled

Sep 5th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var NTConfig_Entrance = false;
  2. var NTConfig_Dodge = true;
  3.  
  4. function NTMain() {
  5.     Include("libs/common/NTCommon.ntl");
  6.     NTC_IncludeLibs();
  7.  
  8.     NTC_IncludeConfig("NTBot/char_configs");
  9.     NT_LoadConfig();
  10.  
  11.     NTSI_LoadNIPFiles("NTBot/item_configs");
  12.    
  13.     NTA_Initialize();
  14.     Print(COLOR_3 + "Starting Diablo Script");
  15.    
  16.     if(!NTTM_CheckAct()){
  17.         NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
  18.         return;
  19.     }
  20.    
  21.     NTTMGR_TownManager();
  22.    
  23.     Print(COLOR_8 + "Going to River of Flame");
  24.    
  25.     if(!NTTM_TownMove("waypoint")){
  26.         NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
  27.         return;
  28.     }
  29.    
  30.     if(!NTM_TakeWaypoint(107)){
  31.         NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
  32.         return;
  33.     }
  34.    
  35.     Print(COLOR_5 + "Precasting");
  36.     NTP_DoPrecast(true);
  37.     Print(COLOR_8 + "Going to Chaos Sanctuary");
  38.    
  39.     if (!NTM_MoveTo(108, 7797, 5600)) {
  40.         NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
  41.         return;
  42.     }
  43.    
  44.     NTM_TeleportTo(7797, 5560);
  45.    
  46.     if (!NTM_MoveTo(me.areaid, 7790, 5544)) {
  47.         NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
  48.         return;
  49.     }
  50.    
  51.     if (NTConfig_Entrance) {
  52.         NTCS_ClearPosition(30, EntranceSort);
  53.         NTM_MoveTo(me.areaid, 7790, 5544);
  54.         PubTP();
  55.         PubSay("Entrance TP up.");
  56.         BO_Party();
  57.         NTCS_ClearPosition(30, EntranceSort);
  58.        
  59.         var FrontToStarX = [7792,7794,7791,7777,7813,7769,7782,7802,7819,7768,7770,7791,7819, 7804];
  60.         var FrontToStarY = [5564,5529,5495,5486,5486,5445,5421,5421,5446,5390,5355,5355,5376, 5340];
  61.        
  62.         for (var i = 0; i < FrontToStarX.length; i += 1) {
  63.             NTM_MoveTo(me.areaid, FrontToStarX[i], FrontToStarY[i]);
  64.             NTCS_ClearPosition(35, EntranceSort);
  65.         }
  66.     }
  67.    
  68.     NTM_MoveTo(me.areaid, 7784, 5310);
  69.     NTCS_ClearPosition(30, SealSort);
  70.     NTM_MoveTo(me.areaid, 7784, 5310);
  71.     PubTP();
  72.     PubSay("Star TP up.");
  73.     BO_Party();
  74.     NTCS_ClearPosition(30, SealSort);
  75.    
  76.     if (!NT_OpenSealsInt()) {
  77.         NTC_SendMsgToScript("NTBotGame.ntj", "NT_OpenSealsInt()");
  78.         return;
  79.     }
  80.    
  81.     PubSay("Diablo.");
  82.     NTM_MoveTo(me.areaid, 7760, 5267);
  83.     PubTP();
  84.     PubSay("Diablo TP up.");
  85.     //NTM_MoveTo(me.areaid, 7800, 5294);
  86.     NTM_MoveTo(me.areaid, 7792, 5291);
  87.     NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  88.     Print(COLOR_8 + "Waiting for Diablo to spawn..");
  89.    
  90.     for (i = 0; i < 200; i += 1) {
  91.         if (GetUnit(NTC_UNIT_MONSTER, 243)) {
  92.             break;
  93.         }
  94.        
  95.         NTC_Delay(500);
  96.     }
  97.    
  98.     if (!NTA_KillMonster(243)) {
  99.         NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
  100.         return;
  101.     }
  102.    
  103.     NTSI_PickItems();
  104.     PubSay("NG " + NTC_GetNextGame());
  105.    
  106.     NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  107. }
  108.  
  109. function NT_OpenSealsInt() {
  110.     var _unit;
  111.     var _result;
  112.    
  113.     _unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 396);
  114.    
  115.     if (!_unit) {
  116.         return false;
  117.     }
  118.    
  119.     if (_unit[0].roomy * 5 + _unit[0].y == 5275) {
  120.         _result = NT_OpenVizierSealInt(1);
  121.     } else {
  122.         _result = NT_OpenVizierSealInt(2);
  123.     }
  124.    
  125.     NTP_DoPrecast(true);
  126.    
  127.     _unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 394);
  128.    
  129.     if (_unit[0].roomx * 5 + _unit[0].x == 7773) {
  130.         _result = NT_OpenDeSeisSealInt(1);
  131.     } else {
  132.         _result = NT_OpenDeSeisSealInt(2);
  133.     }
  134.    
  135.     if (!_result) {
  136.         return false;
  137.     }
  138.    
  139.     PubTP();
  140.     BO_Party();
  141.     NTCS_ClearPosition(40, SealSortB);
  142.    
  143.     _unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 392);
  144.    
  145.     if (!_unit) {
  146.         return false;
  147.     }
  148.    
  149.     if (_unit[0].roomx * 5 + _unit[0].x == 7893) {
  150.         _result = NT_OpenVenomSealInt(1);
  151.     } else {
  152.         _result = NT_OpenVenomSealInt(2);
  153.     }
  154.    
  155.     NTP_DoPrecast(true);
  156.    
  157.     return _result;
  158. }
  159.  
  160. function NT_OpenVizierSealInt(type) {
  161.     var i, n;
  162.    
  163.     if (type === 1) {
  164.         var vx = [7767,7756,7744,7747,7750,7741,7729,7720,7720,7721,7719,7712,7700,7687,7676, 7666, 7647];//   |||   |||
  165.         var vy = [5292,5284,5275,5290,5303,5310,5314,5312,5301,5288,5273,5292,5294,5294,5292, 5307, 5267];//      |||
  166.     } else {
  167.         var vx = [7768,7755,7741,7733,7723,7714,7707,7680,7666, 7655, 7649];//   |||||||||
  168.         var vy = [5289,5295,5282,5291,5300,5282,5315,5310,5311, 5282, 5269];//   |||
  169.     }
  170.    
  171.     for (var i = 0; i < vx.length; i += 1) {
  172.         NTM_MoveTo(me.areaid, vx[i], vy[i]);
  173.         NTCS_ClearPosition(30, SealSort);
  174.     }
  175.    
  176.     PubTP();
  177.     PubSay("Leech TP up.");
  178.    
  179.     if (!NT_OpenSealInt(395) || !NT_OpenSealInt(396)) {
  180.         return false;
  181.     }
  182.    
  183.     if (type == 1) {
  184.         NTM_MoveTo(me.areaid, 7691, 5292);
  185.     } else {
  186.         NTM_MoveTo(me.areaid, 7695, 5316);
  187.     }
  188.    
  189.     NTC_FindUnit(1, GetLocaleString(2851), 10);
  190.     NTCS_ClearPosition(40, SealSort);
  191.     NTA_KillMonster(GetLocaleString(2851)); // Grand Vizier of Chaos
  192.     NTCS_ClearPosition(40, SealSort);
  193.     PubSay("Vizier dead.");
  194.    
  195.     if(NTConfig_IdInField){
  196.         NT_FieldID();
  197.     }
  198.    
  199.     return true;
  200. }
  201.  
  202. function NT_OpenDeSeisSealInt(type) {
  203.     var i, n;
  204.    
  205.     if (type === 1) {
  206.         var sx = [7791,7783,7800,7809,7785,7773,7773,7776,7794,7811,7817,7815,7798,7785]; // Shape of "2"
  207.         var sy = [5265,5256,5247,5232,5230,5222,5212,5194,5194,5193,5177,5157,5155,5155];
  208.     } else {
  209.         var sx = [7786,7801,7786,7787,7810,7811,7810,7790,7774,7773,7794, 7821]; // shape of an "S" or "5"
  210.         var sy = [5263,5249,5245,5227,5233,5215,5198,5194,5181,5156,5154, 5160];
  211.     }
  212.    
  213.     for (var i = 0; i < sx.length; i += 1) {
  214.         NTM_MoveTo(me.areaid, sx[i], sy[i]);
  215.         NTCS_ClearPosition(30, type === 1 ? SealSort : SealSortB);
  216.     }
  217.    
  218.     PubTP();
  219.     PubSay("Leech TP up.");
  220.    
  221.     if (!NT_OpenSealInt(394)) {
  222.         return false;
  223.     }
  224.    
  225.     if (type == 1) {
  226.         NTM_MoveTo(me.areaid, 7797, 5201);
  227.        
  228.         for (i = 0; i < 3; i += 1) {
  229.             NTM_TeleportTo(7794, 5227);
  230.         }
  231.     } else {
  232.         NTM_MoveTo(me.areaid, 7798, 5186);
  233.     }
  234.    
  235.     NTCS_Preattack(GetLocaleString(2852));
  236.     NTCS_ClearPosition(40, DistanceSort);
  237.     NTA_KillMonster(GetLocaleString(2852)); // Lord De Seis
  238.     NTCS_ClearPosition(40, DistanceSort);
  239.     PubSay("De Seis dead.");
  240.    
  241.     if(NTConfig_IdInField){
  242.         NT_FieldID();
  243.     }
  244.    
  245.     return NTM_MoveTo(me.areaid, 7800, 5255);
  246. }
  247.  
  248. function NT_OpenVenomSealInt(type) {
  249.     if (type === 1) {
  250.         var IX = [7825,7827,7834,7845,7855,7852,7875,7896,7917, 7861]; // shape of a "t"
  251.         var IY = [5293,5276,5291,5315,5301,5278,5293,5295,5291, 5321];
  252.     } else {
  253.         var IX = [7822,7826,7832,7850,7868,7877,7891,7907,7927,7932, 7909]; // looks like a hook
  254.         var IY = [5297,5278,5307,5278,5297,5276,5276,5276,5279,5298, 5318];
  255.     }
  256.    
  257.     for (var i = 0; i < IX.length; i += 1) {
  258.         NTM_MoveTo(me.areaid, IX[i], IY[i]);
  259.         NTCS_ClearPosition(30, SealSortB);
  260.     }
  261.    
  262.     PubTP();
  263.     PubSay("Leech TP up.");
  264.    
  265.     if (!NT_OpenSealInt(393) || !NT_OpenSealInt(392)) {
  266.         return false;
  267.     }
  268.    
  269.     if (type === 1) {
  270.         type = 1; // temp
  271.     } else {
  272.         NTM_MoveTo(me.areaid, 7933, 5299);
  273.     }
  274.    
  275.     NTC_FindUnit(1, GetLocaleString(2853), 10);
  276.     NTCS_ClearPosition(40, DistanceSort);
  277.     NTA_KillMonster(GetLocaleString(2853)); // Infector of Souls
  278.     NTCS_ClearPosition(40, DistanceSort);
  279.     PubSay("Infector dead.");
  280.    
  281.     if(NTConfig_IdInField){
  282.         NT_FieldID();
  283.     }
  284.    
  285.     if (NTC_PutSkill(124, NTC_HAND_RIGHT)) {
  286.         NTC_PingDelay(1000);
  287.     }
  288.    
  289.     return true;
  290. }
  291.  
  292. function NT_OpenSealInt(classid) {
  293.     var warn;
  294.     switch (classid) {
  295.     case 396:
  296.     case 394:
  297.     case 392:
  298.         warn = true;
  299.         break;
  300.     default:
  301.         warn = false;
  302.         break;
  303.     }
  304.    
  305.     var i, seal;
  306.    
  307.     for (i = 0; i < 5; i += 1) {
  308.         NTM_MoveToPresetUnit(me.areaid, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0);
  309.        
  310.         seal = NTC_FindUnit(NTC_UNIT_OBJECT, classid);
  311.        
  312.         if (!seal) {
  313.             return false;
  314.         }
  315.        
  316.         if (seal.mode) { // for pubbies
  317.             if (warn) {
  318.                 PubSay("Don't hit the seals.");
  319.             }
  320.            
  321.             return true;
  322.         }
  323.        
  324.         warn = false;
  325.        
  326.         NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, seal);
  327.         NTC_Delay(classid === 394 ? 1000 : 500);
  328.        
  329.         if (!seal.mode) {
  330.             if (classid === 394 && CheckCollision(seal.x + 15, seal.y)) { // de seis optimization
  331.                 NTM_MoveTo(me.areaid, seal.x + 15, seal.y);
  332.             } else {
  333.                 NTM_MoveTo(me.areaid, seal.x - 5, seal.y - 5);
  334.             }
  335.            
  336.             NTC_Delay(500);
  337.         } else {
  338.             return true;
  339.         }
  340.     }
  341.    
  342.     return false;
  343. }
  344.  
  345. function BO_Party() {
  346.     if (NTConfig_PublicMode) {
  347.         NTC_Delay(1000);
  348.     }
  349.    
  350.     NTP_DoPrecast(true);
  351. }
  352.  
  353. function NTC_GetNextGame() { // move this to ntc
  354.     function Pad(num) {
  355.         if (num < 10) {
  356.             num = 0 + "" + num;
  357.         }
  358.        
  359.         return num;
  360.     }
  361.    
  362.     var i, result, number,
  363.         game = me.gamename;
  364.    
  365.     for (i = game.length - 1; i > -1; i -= 1) {
  366.         if (isNaN(game[i])) {
  367.             break;
  368.         }
  369.     }
  370.    
  371.     result = game.substring(0, i + 1);
  372.     number = parseInt(game.substring(i + 1), 10) === 99 ? 0 : (parseInt(game.substring(i + 1), 10) + 1); // 99 correction
  373.     result += Pad(number);
  374.    
  375.     return result;
  376. }
  377.  
  378. //
  379.  
  380. function NTA_MonsterStats(unit) {
  381.     this.name = unit.name;
  382.     this.x = unit.x;
  383.     this.y = unit.y;
  384.     this.gid = unit.gid;
  385.     this.classid = unit.classid;
  386.     this.spectype = unit.spectype;
  387. }
  388.  
  389. function DistanceSort(unitA, unitB) {
  390.     if (GetDistance(me.x, me.y, unitA.x, unitA.y) < GetDistance(me.x, me.y, unitB.x, unitB.y)) {
  391.         return -1;
  392.     }
  393.    
  394.     return 1;
  395. }
  396.  
  397. function EntranceSort(unitA, unitB) {
  398.     if (GetDistance(unitA.x, unitA.y, 7790, 5544) < GetDistance(unitB.x, unitB.y, 7790, 5544)) {
  399.         return -1;
  400.     }
  401.    
  402.     return 1;
  403. }
  404.  
  405. function SealSort(unitA, unitB) {  
  406.     if (GetDistance(unitA.x, unitA.y, 7784, 5310) < GetDistance(unitB.x, unitB.y, 7784, 5310)) {
  407.         return -1;
  408.     }
  409.    
  410.     return 1;
  411. }
  412.  
  413. function SealSortB(unitA, unitB) { 
  414.     if (GetDistance(unitA.x, unitA.y, 7800, 5255) < GetDistance(unitB.x, unitB.y, 7800, 5255)) {
  415.         return -1;
  416.     }
  417.    
  418.     return 1;
  419. }
  420.  
  421. function NTCS_Preattack(name) {
  422.     var i, target;
  423.    
  424.     switch (me.classid) {
  425.         case 0:
  426.             break;
  427.         case 1:
  428.             break;
  429.         case 2:
  430.             break;
  431.         case 3:
  432.             NTC_FindUnit(1, name, 10); // don't wait for other classes
  433.            
  434.             if (!target) {
  435.                 return;
  436.             }
  437.            
  438.             if (CheckCollision(me.areaid, target.x + 6, target.y + 10, 1)) { // check if we can move there
  439.                 NTM_MoveTo(me.areaid, target.x + 6, target.y + 10);
  440.                 NTC_PutSkill(NTConfig_AttackSkill[2], NTC_HAND_RIGHT);
  441.                
  442.                 for (i = 0; i < 7; i += 1) {
  443.                     NTC_CastSkill(NTConfig_AttackSkill[1], 2);
  444.                 }
  445.             }
  446.            
  447.             break;
  448.         case 4:
  449.             NTC_FindUnit(1, name, 10); // don't wait for other classes
  450.            
  451.             if (!target) {
  452.                 return;
  453.             }
  454.  
  455.             if (CheckCollision(me.areaid, target.x, target.y + 10, 1)) { // check if we can move there
  456.                 NTM_MoveTo(me.areaid, target.x, target.y + 10);
  457.                
  458.                
  459.                 for (i = 0; i < 2; i += 1) {
  460.                     NTC_CastSkill(130, NTC_HAND_RIGHT);
  461.                     NTC_Delay(150);
  462.                 }
  463.             }
  464.            
  465.             break;
  466.         case 5:
  467.             break;
  468.         case 6:
  469.             break;
  470.         case 7:
  471.             break;
  472.     }
  473. }
  474.  
  475. // general functions
  476.  
  477. function PubTP() {
  478.     if (NTConfig_PublicMode) {
  479.         NTM_MakeTP();
  480.     }
  481. }
  482.  
  483. function PubSay(string) {
  484.     if (NTConfig_PublicMode) {
  485.         Say(string);
  486.     }
  487. }
  488.  
  489. function NTT_CheckPotionSafe() {
  490.     var i, items, hpCheck, mpCheck;
  491.    
  492.     if (NTConfig_BeltColType.indexOf("hp") > -1 || NTConfig_BeltColType.indexOf("mp") > -1) {
  493.         items = me.GetItems();
  494.        
  495.         for (i in items) {
  496.             if (!hpCheck && items[i].mode === 2 && items[i].code.indexOf("hp") > -1) {
  497.                 hpCheck = true;
  498.             }
  499.            
  500.             if (!mpCheck && items[i].mode === 2 && items[i].code.indexOf("mp") > -1) {
  501.                 mpCheck = true;
  502.             }
  503.         }
  504.     }
  505.    
  506.     return !(hpCheck && mpCheck);
  507. }
  508.  
  509. function NTA_Dodge(target, distance) {
  510.     var i, j, coordx, coordy, monster, count,
  511.         maxcount = 999,
  512.         coords = [],
  513.         goodCoords = [],
  514.         monList = [],
  515.         angles = [45, 90, 135, 180, 225, 270, 305, 360];
  516.  
  517.     for (i = 0; i < angles.length; i = i + 1) {
  518.         coordx = Math.round((Math.cos(angles[i] * Math.PI / 180)) * distance + target.x);
  519.         coordy = Math.round((Math.sin(angles[i] * Math.PI / 180)) * distance + target.y);
  520.        
  521.         if (CheckCollision(me.areaid, coordx, coordy, 1)) {
  522.             coords.push([coordx, coordy]);
  523.         }
  524.     }
  525.    
  526.     if (coords.length === 0) { // no valid positions - don't move
  527.         return true;
  528.     }
  529.    
  530.     coords.sort(NTA_SortRooms);
  531.    
  532.     monster = GetUnit(1);
  533.    
  534.     if (monster) {
  535.         do {
  536.             if (monster.hp > 0) {
  537.                 monList.push(new NTA_MonsterStats(target));
  538.             }
  539.         } while (monster.GetNext());
  540.     }
  541.    
  542.     for (i = 0; i < coords.length; i += 1) {
  543.         count = 0;
  544.        
  545.         for (j = 0; j < monList.length; j += 1) {
  546.             if (monList[j].hp > 0 && GetDistance(monList[j].x, monList[j].y, coords[i][0], coords[i][1]) < 10) {
  547.                 count += 1;
  548.             }
  549.         }
  550.        
  551.         if (count < maxcount) {
  552.             goodCoords = [coords[i][0], coords[i][1]];
  553.             maxcount = count;
  554.            
  555.             if (count === 0) {
  556.                 break;
  557.             }
  558.         }
  559.     }
  560.    
  561.     if (goodCoords.length > 0) { // just in case goodCoords is empty (shouldn't happen)
  562.         if (Math.abs(me.x - goodCoords[0]) < 3 && Math.abs(me.y - goodCoords[1]) < 3) { // close enough
  563.             return true;
  564.         }
  565.        
  566.         Say("!Dodge " + target.name);
  567.         NTM_MoveTo(me.areaid, goodCoords[0], goodCoords[1]);
  568.     }
  569.    
  570.     return true;
  571. }
  572.  
  573. function NTCS_ClearPosition(range, sortFunc) {
  574.     var i, orgx, orgy, monList, skipList, target, result,
  575.         dodgeIDs = [310, 362],
  576.         attackcount = 0;
  577.        
  578.     if (NTConfig_AttackSkill[1] < 0 || NTConfig_AttackSkill[3] < 0) {
  579.         return false;
  580.     }
  581.    
  582.     switch (arguments.length) {
  583.     case 0:
  584.         range = 20;
  585.     case 1:
  586.         sortFunc = DistanceSort;
  587.         break;
  588.     }
  589.    
  590.     orgx = me.x;
  591.     orgy = me.y;
  592.     skipList = [];
  593.    
  594.     MainLoop : while (attackcount < 300) {
  595.         monList = [];
  596.         target = NTC_FindUnit(NTC_UNIT_MONSTER);
  597.        
  598.         if (target) {
  599.             do {
  600.                 if (skipList.indexOf(target.gid) < 0) {
  601.                     if (target.IsAttackable()) {
  602.                         if (NTA_IsValidMonster(target)) {
  603.                             if (GetDistance(orgx, orgy, target.x, target.y) <= range) {
  604.                                 monList.push(new NTA_MonsterStats(target));
  605.                             }
  606.                            
  607.                             if (NTConfig_Dodge && GetDistance(me, target) < 7 && dodgeIDs.indexOf(target.classid) > -1) {
  608.                                 NTA_Dodge(target, _NTA_SkillRange[1]);
  609.                                 continue MainLoop;
  610.                             }
  611.                         }
  612.                     } else {
  613.                         skipList.push(target.gid);
  614.                     }
  615.                 }
  616.             } while (target.GetNext());
  617.         }
  618.        
  619.         if (monList.length === 0) {
  620.             break;
  621.         }
  622.        
  623.         monList.sort(sortFunc);
  624.        
  625.         target = NTC_FindUnit(NTC_UNIT_MONSTER, monList[0].gid);
  626.        
  627.         if (target && target.IsAttackable()) {
  628.            
  629.             result = NTA_Attack(target, attackcount % 30 === 0);
  630.            
  631.             switch (result) {
  632.             case 1:
  633.                 skipList.push(target.gid);
  634.                 monList.shift();
  635.                 break;
  636.             case 2:
  637.             case 3:
  638.                 if (target.mode === 0 || target.mode === 12) {
  639.                     NTSI_FastPick();
  640.                 }
  641.                
  642.                 attackcount += 1;
  643.                 break;
  644.             default:
  645.                 return false;
  646.             }
  647.         } else {
  648.             monList.shift();
  649.         }
  650.     }
  651.    
  652.     switch (me.classid) {
  653.         case NTC_CHAR_CLASS_PALADIN:
  654.             if (attackcount > 2 && (parseInt(me.hp*100/me.hpmax) < NTConfig_UseRedemptionHP || parseInt(me.mp*100/me.mpmax) < NTConfig_UseRedemptionMP)) {
  655.                 if (NTC_PutSkill(124, NTC_HAND_RIGHT)) {
  656.                     NTC_PingDelay(1000);
  657.                 }
  658.             }
  659.            
  660.             break;
  661.         case NTC_CHAR_CLASS_NECROMANCER:
  662.             NTA_SkeletonArmy(NTConfig_SkeletonArmy);
  663.             NTA_MageArmy(NTConfig_MageArmy);
  664.             NTA_ReviveArmy(NTConfig_ReviveArmy);
  665.             break;
  666.         case NTC_CHAR_CLASS_SORCERESS:
  667.             if (me.GetState(30) === 0) {
  668.                 NTC_CastSkill(58, NTC_HAND_RIGHT);
  669.             }
  670.            
  671.             break;
  672.         case NTC_CHAR_CLASS_BARBARIAN:
  673.             if (attackcount > 0) {
  674.                 MWL_FindItem(20);
  675.             }
  676.            
  677.             break;
  678.     }
  679.    
  680.     if (attackcount > 0) {
  681.         NTSI_PickItems();
  682.     }
  683.    
  684.     if (NTT_CheckPotionSafe()) {
  685.         NTTMGR_VisitTown();
  686.     }
  687.    
  688.     return true;
  689. }
  690.  
  691. function NTA_SortRooms(a, b) {
  692.     if (GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1])) {
  693.         return -1;
  694.     }
  695.    
  696.     return 1;
  697. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement