Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _hostilepause = false;
- var poscount = 1;
- var _trapsPreCasted;
- function NTMain(){
- Include("libs/common/NTCommon.ntl");
- NTC_IncludeLibs();
- NTC_IncludeConfig("NTBot/char_configs");
- var i;
- var _wave;
- var _starttick;
- NT_LoadConfig();
- NTSI_LoadNIPFiles("NTBot/item_configs");
- NTA_Initialize();
- if(!NTTM_CheckAct()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return;
- }
- NTTMGR_TownManager();
- /////GO FO REBO CATACOMBS ADD, STARTS HERE
- if(!NTTM_TownMove("waypoint"))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(35))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- NTC_PingDelay(1000);
- NTM_MoveTo(me.areaid, me.x-4, me.y)
- Delay(500)
- NTP_DoPrecast(true);
- NTC_PingDelay(1000);
- NTM_MoveTo(me.areaid, me.x-6, me.y)
- while(!me.GetState(32)) // remove // on this if u want this option instead of "if (!me.GetState(32)) me.maxgametime = 1;"
- NTC_Delay(1000); // default is 10000
- NTC_PingDelay(2000);
- if(me.classid == NTC_CHAR_CLASS_SORCERESS)
- {
- NTC_Delay(100);
- NT_DoEnchant();
- NT_DoEnchantMerc();
- }
- if(!NTM_TakeWaypoint(1))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- //// GO FOR BO CATACOMBS ADD , END HERE
- if(!NTTM_TownMove("waypoint")){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(129)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- NTP_DoPrecast(true);
- if(NTConfig_ClearWorldStoneKeep == 1){ // Chair add - checking what clear option has been selected. non specified = don't clear!
- clearpath = true;
- }
- else if(NTConfig_ClearWorldStoneKeep == 2){
- clearpath = 2;
- }
- else{
- clearpath = false;
- }
- if(clearpath != 2){ //Chair add - first block handles anything but full level clears
- if(!NTM_MoveToStair(me.areaid, 130,0,0,clearpath)){ // Chair add - the clearpath variable is adjusted by NTConfig_ClearWorldStoneKeep above
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
- return;
- }
- if(!NTM_TakeStair(130)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
- return;
- }
- if(!NTM_MoveToStair(me.areaid, 131,0,0,clearpath)){ // Chair add - the clearpath variable is adjusted by NTConfig_ClearWorldStoneKeep above
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
- return;
- }
- if(NTConfig_MakeWSK3TP && NTConfig_PublicMode){
- NTM_MakeTP();
- Print(Baal_WSK3_TP_MSG);
- NTC_Delay(1000);
- NTP_DoPrecast(true);
- }
- if(!NTM_TakeStair(130+i)){ // stair var i isn't being used yet so not sure why you have it here??? doesn't get used until line 147
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
- return;
- }
- }
- else{ //Chair add - This entire block handles the option to clear the entire lvl 2 and 3, not only the path.
- if(!NTA_ClearLevel()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTA_ClearLevel()");
- return;
- }
- if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas())
- OpenChestsInArea();
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_TILE, 82)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
- return;
- }
- if(!NTM_TakeStair()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
- return;
- }
- NTP_DoPrecast();
- if(!NTA_ClearLevel()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTA_ClearLevel()");
- return;
- }
- if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas())
- OpenChestsInArea();
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_TILE, 82)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
- return;
- }
- if(!NTM_TakeStair()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
- return;
- }
- NTP_DoPrecast();
- if(!NTA_ClearLevel()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTA_ClearLevel()");
- return;
- }
- if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas())
- OpenChestsInArea();
- }
- //End of things added by Chairman
- if(!NTM_MoveTo(me.areaid, 15112, 5068)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
- return;
- }
- // Adding Doll Check
- //if(NTConfig_CheckSoulKillers && NTC_FindUnit(NTC_UNIT_MONSTER, GetLocaleString(2904))) {
- //NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_1 + "Undead Soul Killers found.");
- //NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END"); // change to NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- //return;
- //}
- // End Doll Check
- if(NTConfig_PublicMode){
- if(NTConfig_MakeHotTP){
- NTM_MoveTo(me.areaid, 15118, 5056);
- //NTM_MoveTo(me.areaid, 15118, 5069);
- NTC_PingDelay(0);
- NTM_MoveTo(me.areaid, 15118, 5056);
- //NTM_MoveTo(me.areaid, 15118, 5069);
- if(NTThrone_Announce)
- _announceTMobs();
- // Adding Doll Check
- if(NTConfig_CheckSoulKillers && NTC_FindUnit(NTC_UNIT_MONSTER, GetLocaleString(2904))) {
- NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_1 + "Undead Soul Killers found.");
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END"); // change to NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- return;
- }
- // End Doll Check
- // Adding Death lord Check
- if(NTConfig_CheckDeathLords && NTC_FindUnit(NTC_UNIT_MONSTER, GetLocaleString(22424))) {
- NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_1 + "Death Lords found.");
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END"); // change to NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- return;
- }
- // End Death Lord check
- NTM_MakeTP();
- Say(Baal_HotTp);
- Delay(100); // 2000 was default but sorc died
- }
- }
- NT_ClearThroneInt();
- if(NTConfig_PublicMode){
- if(NTConfig_MakeSafeTP){
- NTM_MoveTo(me.areaid, 15118, 5068, 1, true);
- NTM_MakeTP();
- Say(Baal_SafeTp);
- NTC_Delay(0);
- }
- }
- while(1){
- NTC_Delay(100);
- NTM_MoveTo(me.areaid, prewavespot[0], prewavespot[1]);
- if(me.GetState(2))
- NTC_PutSkill(109, NTC_HAND_RIGHT);
- if(NTConfig_IdInField){
- NT_FieldID();
- }
- for(i = 0 ; i < 6 ; i++){
- _wave = NT_ThroneCheckInt();
- if(_wave > 0)
- break;
- NTC_Delay(500);
- }
- _starttick = GetTickCount();
- while(_wave == 0){
- if(!NT_ThronePreAttackInt())
- NTC_Delay(200);
- if(GetTickCount()-_starttick > 17000){
- NT_ClearThroneInt();
- _starttick = GetTickCount();
- }
- _wave = NT_ThroneCheckInt();
- }
- switch(_wave){
- case 1:
- if(NTConfig_PreWaveTele){
- NTM_TeleportTo(me.x+1, me.y+3);
- }
- Say("");
- NTA_ClearPosition(40, true, 2);
- NTP_DoPrecast(true);
- break;
- case 2:
- if(NTConfig_PreWaveTele){
- NTM_TeleportTo(me.x+1, me.y+3);
- }
- if(NTConfig_HolyBoltBaal){
- if (me.classid == NTC_CHAR_CLASS_PALADIN && NTConfig_AttackSkill[5] == 101)
- achmel();
- }
- NTA_ClearPosition(40, true, 2);
- if(NTConfig_Wave2PSNCheck && me.GetState(2) != -1){
- NTTMGR_VisitTown();
- }
- break;
- case 3:
- if(NTConfig_PreWaveTele){
- NTM_TeleportTo(me.x+1, me.y+3);
- }
- NTA_ClearPosition(40, true, 2);
- if(NTConfig_Wave3Move > 0){
- NT_CheckHydraInt();
- }
- else
- NTC_Delay(3000);
- break;
- case 4:
- if(NTConfig_PreWaveTele){
- NTM_TeleportTo(me.x+1, me.y+3);
- }
- NTA_ClearPosition(40, true, 2);
- break;
- case 5:
- if(NTConfig_PreWaveTele){
- NTM_TeleportTo(me.x+1, me.y+3);
- }
- NTA_ClearPosition(40, true, 2);
- break;
- default:
- if(NTConfig_PreWaveTele){
- NTM_TeleportTo(me.x+1, me.y+3);
- }
- NTA_ClearPosition(40, true, 2);
- break;
- }
- if(_wave != 0) // Need to force a one time cast/wave Assassin only
- _trapsPreCasted = false;
- if(_wave == 5)
- break;
- }
- if(NTConfig_KillBaal){
- var _portal;
- if(NTConfig_PublicMode)
- Say(Baal_KillBaalMessage);
- if(NTConfig_TownBeforeBaal && NTT_CheckInventoryBeforeBoss()){
- Delay(1000);
- if(NTConfig_PublicMode) {
- Print(Baal_FreeSpaceMessage);
- }
- NTTMGR_VisitTown();
- }
- //NTM_MoveTo(me.areaid, 15092, 5010);
- NTM_MoveTo(me.areaid, 15101, 5018);
- NTP_DoPrecast(true);
- if(NTConfig_IdInField){
- NT_FieldID();
- }
- for(var i = 0; i < 60; i++) {
- Delay(500);
- if(!NTC_FindUnit(NTC_UNIT_MONSTER, 543)) {
- break;
- }
- if(i >= 58) {
- Print("looks like baal is bugged");
- if(Baal_BSayNextGame.length > 0 && NTConfig_PublicMode) {
- Print(Baal_BSayNextGame + NTC_NextGameSayererer());
- }
- }
- }
- _portal = NTC_FindUnit(NTC_UNIT_OBJECT, 563, 1);
- if(!_portal){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTC_FindUnit()");
- return;
- }
- if(!NTM_UsePortal("Portal", 132, null, _portal)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_UsePortal()");
- return;
- }
- NTM_MoveTo(me.areaid, 15138, 5916);
- NTM_MakeTP();
- if(!NTA_KillMonster(544)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
- return;
- }
- NTSI_PickItems();
- }
- Delay(500);
- if(NTConfig_PublicMode)
- Say(Baal_NextGameMessage);
- Delay(500)
- if(Baal_BSayNextGame.length > 0 && NTConfig_PublicMode)
- Print(Baal_BSayNextGame + NTC_NextGameSayererer());
- Delay(1000);
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- }
- // Internal function
- function NT_ClearThroneInt(){
- var _attackpos = [15112, 5068, 15075, 5065, 15114, 5045, 15114, 5012, 15095, 5024, 15078, 5013, 15092, 5040];
- for(var i = 0 ; i < _attackpos.length ; i += 2){
- NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
- NTA_ClearPosition(25, true, 2);
- }
- }
- function NT_ThroneCheckInt(){
- var _monster;
- if(!NTC_FindUnit(NTC_UNIT_MONSTER, 543))
- return 5;
- _monster = NTC_FindUnit(NTC_UNIT_MONSTER);
- if(_monster){
- do{
- if(NTA_IsValidMonster(_monster)){
- if(_monster.classid == 23 || _monster.classid == 62)
- return 1;
- if(_monster.classid == 105 || _monster.classid == 381)
- return 2;
- if(_monster.classid == 557)
- return 3;
- if(_monster.classid == 558)
- return 4;
- if(_monster.classid == 571)
- return 5;
- }
- } while(_monster.GetNext());
- }
- return 0;
- }
- function NT_ThronePreAttackInt(){
- if(me.classid == NTC_CHAR_CLASS_SORCERESS){
- if(NTConfig_PreWaveSpam > 0){
- if(poscount == 1){
- poscount = 2;
- return NTC_CastSkill(NTConfig_PreWaveSpam, 0, KBLSpamPos[0], KBLSpamPos[1]);
- }
- else if(poscount == 2){
- poscount = 3;
- return NTC_CastSkill(NTConfig_PreWaveSpam, 0, KBLSpamPos[2], KBLSpamPos[3]);
- }
- else{
- poscount = 1;
- return NTC_CastSkill(NTConfig_PreWaveSpam, 0, KBLSpamPos[4], KBLSpamPos[5]);
- }
- }
- }
- else if(me.classid == NTC_CHAR_CLASS_DRUID){
- if(NTConfig_AttackSkill[3] == 245){
- if(!DruidPreAtt[2]){
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, DruidPreAtt[0], DruidPreAtt[1]);
- }
- else{
- if(poscount == 1){
- poscount = 2;
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, DruidPreAtt[0], DruidPreAtt[1]);
- }
- else if(poscount == 2){
- poscount = 3;
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, (DruidPreAtt[0]+3), DruidPreAtt[1]);
- }
- else{
- poscount = 1;
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, (DruidPreAtt[0]+5), DruidPreAtt[1]);
- }
- }
- }
- }
- else if(me.classid == NTC_CHAR_CLASS_NECROMANCER){
- if(NTConfig_PreWaveSpam > 0)
- return NTC_CastSkill(NTConfig_PreWaveSpam, _NTA_SkillHand[NTConfig_PreWaveSpam], NecroPreAtt[0], NecroPreAtt[1]);
- }
- else if(me.classid == NTC_CHAR_CLASS_PALADIN){
- if(NTConfig_AttackSkill[3] == 112){
- NTC_PutSkill(NTConfig_AttackSkill[3], NTC_HAND_LEFT);
- NTC_PutSkill(NTConfig_AttackSkill[4], NTC_HAND_RIGHT);
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, 15092, 5028);
- }
- }
- else if(me.classid == NTC_CHAR_CLASS_ASSASSIN){
- var _attackPos = [15088,5023,15087,5032,15098,5022,15101,5034,15094,5029];
- if(NTConfig_UseTraps && !_trapsPreCasted){
- for(var i=0;i<5;i++) {
- if(i == 0 || i == 2 || i == 3) // Added delays to prevent trap miscast
- NTC_Delay(25);
- if(NTConfig_TrapSet[i] > 0)
- NTC_CastSkill(NTConfig_TrapSet[i], NTC_HAND_RIGHT, _attackPos[i*2],_attackPos[(i*2)+1]);
- }
- _trapsPreCasted = true;
- }
- if(NTConfig_AttackSkill[3] == 256)
- if(me.GetSkillStatus(NTConfig_AttackSkill[3]) != 8)
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, 15093, 5030);
- }
- return false;
- }
- function NT_CheckHydraInt(){
- var _hydra1, _hydra2, _hydra3;
- _hydra1 = NTC_FindUnit(NTC_UNIT_MONSTER, 351);
- _hydra2 = NTC_FindUnit(NTC_UNIT_MONSTER, 352);
- _hydra3 = NTC_FindUnit(NTC_UNIT_MONSTER, 353);
- if((_hydra1 && _hydra1.GetStat(172) != 2 && _hydra1.GetState(105))
- || (_hydra2 && _hydra2.GetStat(172) != 2 && _hydra2.GetState(105))
- || (_hydra3 && _hydra3.GetStat(172) != 2 && _hydra3.GetState(105))){
- if(NTConfig_Wave3Move == 1)
- NTM_MoveTo(me.areaid, 15112, 5004); // right side
- else if(NTConfig_Wave3Move == 2)
- NTM_MoveTo(me.areaid, 15073, 5002); // left side
- if(me.GetState(2))
- NTC_PutSkill(109, NTC_HAND_RIGHT);
- NTC_PingDelay(3000);
- }
- }
- function achmel(){
- var x = 0;
- var _holdTargetHp = 0;
- NTC_PutSkill(NTConfig_AttackSkill[6], NTC_HAND_RIGHT);
- var _achmel = NTC_FindUnit(NTC_UNIT_MONSTER, GetLocaleString(21852));
- while (_achmel && _achmel.hp > 0){
- _holdTargetHp = _achmel.hp;
- for(var i = 0; i < 5 ; i++){
- NTC_CastSkill(NTConfig_AttackSkill[5], NTC_HAND_LEFT, _achmel);
- }
- if(_holdTargetHp <= _achmel.hp && NTConfig_WalkAround) {
- x++;
- if(x % 2 == 0)
- NTM_WalkTo(me.x+10, me.y);
- else
- NTM_WalkTo(me.x-10, me.y);
- }
- }
- var _company = NTC_FindUnit(NTC_UNIT_MONSTER, 105);
- do{
- while (_company != null && _company.hp >0 && !_company.GetState(53) && !_company.GetState(96)){
- _holdTargetHp = _company.hp;
- for(var i = 0; i < 5 ; i++){
- NTC_CastSkill(NTConfig_AttackSkill[5], NTC_HAND_LEFT, _company);
- }
- if(_holdTargetHp <= _company.hp && NTConfig_WalkAround) {
- x++;
- if(x % 2 == 0)
- NTM_WalkTo(me.x+10, me.y);
- else
- NTM_WalkTo(me.x-10, me.y);
- }
- }
- } while (_company && _company.GetNext());
- }
- function HostileHandler(msg){
- if(msg == "pause"){
- if(_hostilepause){
- Print(COLOR_3 + "Resuming...");
- _hostilepause = false;
- }
- else{
- Print(COLOR_1 + "Pausing to kill hostiles...");
- _hostilepause = true;
- ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
- ClickMap(NTC_CLICK_RUP, NTC_SHIFT_NONE, null);
- while(_hostilepause)
- NTC_Delay(250);
- }
- }
- }
- function _announceTMobs() {
- var _throneMobs = [];
- var _count = [];
- _monster = NTC_FindUnit(NTC_UNIT_MONSTER);
- if(_monster){
- do {
- if(_outofTBounds(_monster.x, _monster.y))
- continue;
- switch(_monster.classid) {
- case 120:
- case 641:
- case 733: _updateTMobs("Burning Soul");
- break;
- case 215:
- case 691: _updateTMobs("Undead Soul Killer");
- break;
- case 478:
- case 637: _updateTMobs("Hell Witch");
- break;
- case 77:
- case 598: _updateTMobs("Serpent Magus");
- break;
- case 133:
- case 697:
- case 731: _updateTMobs("Dark Lord");
- break;
- case 510: _updateTMobs("Blood Lord");
- break;
- case 310:
- case 699:
- case 700: _updateTMobs("Doom Knight");
- break;
- case 312:
- case 701:
- case 702:
- case 713: _updateTMobs("Oblivion Knight");
- break;
- case 361:
- case 687:
- case 712: _updateTMobs("Pit Lord");
- break;
- case 104:
- case 669:
- case 670: _updateTMobs("Horadrim Ancient");
- break;
- case 33:
- case 603: _updateTMobs("Assailant");
- break;
- default: _updateTMobs("Trash Mob");
- break;
- }
- } while(_monster.GetNext())
- }
- _sayTMobs();
- function _updateTMobs(Tmob) {
- var _tIndex = _throneMobs.indexOf(Tmob);
- if(_tIndex == -1) {
- _throneMobs.push(Tmob);
- _count.push(1);
- }
- else {
- _count[_tIndex]++;
- }
- }
- function _sayTMobs() {
- for(var i = 0; i < _throneMobs.length; i++) {
- Print(_count[i] + " " + (_count[i] == 1 ? _throneMobs[i] : (_throneMobs[i].charAt(_throneMobs[i].length - 1).toLowerCase() == "s" ? _throneMobs[i] + "'s" : (_throneMobs[i].indexOf("Witch") != -1 ? _throneMobs[i] + "es" : _throneMobs[i] + "s"))));
- Delay(100);
- }
- }
- function _outofTBounds(monX, monY) {
- if((monX >= 15072 && monX <= 15118 && monY >= 5002 && monY <=5073) || (monX >= 15087 && monX <= 15104 && monY >= 5073 && monY <= 5094))
- return false;
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement