Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // settings for game run
- var NTConfig_CubingDelays = 1000;
- var grabFade = true;
- var endGameWhenDone = true;
- //ingame vars dont touch
- var tKey = me.GetItems("pk1");
- var hKey = me.GetItems("pk2");
- var dKey = me.GetItems("pk3");
- var existingPortal = [];
- function NTMain()
- {
- Include("libs/common/NTCommon.ntl");
- NTC_IncludeLibs();
- NTC_IncludeConfig("NTBot/char_configs");
- NT_LoadConfig();
- NTConfig_TPChicken = 0;
- NTSI_LoadNIPFiles("NTBot/item_configs");
- NTA_Initialize();
- NTTMGR_TownManager();
- NTTM_CheckAct(5);
- if(tKey.length >= 3 && hKey.length >= 3 && dKey.length >= 3) {
- if(NT_OpenMiniPortals()) {
- if(grabFade) {
- NT_PreBuffFade();
- }
- NT_FindExistingPortals();
- for(var n = 0; n < existingPortal.length; n++) {
- NT_TakeMiniPortal(existingPortal[n]);
- NT_CheckKeyBossAreaid();
- }
- if(!endGameWhenDone) {
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- }
- else {
- Say("Got the organs!");
- NTC_Delay(10001);
- }
- }
- }
- }
- function NT_CheckKeyBossAreaid(){
- switch(me.areaid)
- {
- case 133:
- Print(NTC_PrintRandomColor() + "Killing Lillith");
- NT_KillLilith();
- break;
- case 134:
- Print(NTC_PrintRandomColor() + "Killing Duriel");
- NT_KillUberDuriel();
- break;
- case 135:
- Print(NTC_PrintRandomColor() + "Killing Izzy");
- NT_KillIzual();
- break;
- }
- return;
- }
- function NT_IsPossiblePortal(possiblePortal) { // this checks for portals that we actually interested in.
- if((possiblePortal.subareaid == 133 || possiblePortal.subareaid == 134 || possiblePortal.subareaid == 135
- || possiblePortal.subareaid == 389 || possiblePortal.subareaid == 390 || possiblePortal.subareaid == 391
- || possiblePortal.subareaid == 136 || possiblePortal.subareaid == 392)
- && !NTC_CheckOwner(possiblePortal, me.name)) {
- return true;
- }
- else { return false; }
- }
- function NT_TakeMiniPortal(takePortal){
- var rightPortal;
- if(!takePortal) {
- return false;
- }
- var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- var _gid;
- if(_portal){
- do
- {
- _gid = _portal.gid;
- if(_gid == takePortal){
- rightPortal = _portal;
- break;
- }
- } while(_portal.GetNext());
- Delay(250)
- }
- while(rightPortal.mode != 2){
- Delay(500);
- }
- Delay(200)
- for(var i = 0 ; i <25 ; i++){
- if(NTM_GetCloserInt(rightPortal)) {
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, rightPortal);
- }
- NTC_Delay(250);
- if(me.areaid != 109){
- break;
- }
- }
- while(me.areaid == 0){
- NTC_Delay(200);
- }
- NTC_PingDelay(NTConfig_AreaDelay);
- if(me.areaid == 109){
- me.maxgametime = 0;
- }
- return me.areaid != 109;
- }
- function NT_KillLilith(){
- entryX = me.x
- entryY = me.y
- NTP_DoPrecast(true);
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 397, 2, 2)){
- return false;
- }
- if(!NT_KillMonster(707)){
- return false;
- }
- NTC_PingDelay(100);
- NTC_PickSpecialItem(650);
- NTC_PingDelay(100);
- NTSI_PickItems();
- NTM_MoveTo(me.areaid, entryX, entryY)
- var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226))
- for(var i = 0 ; i <25 ; i++){
- if(NTM_GetCloserInt(_portal)){
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _portal);
- }
- NTC_Delay(250);
- if(me.areaid != 133){
- break;
- }
- }
- NTC_PingDelay(NTConfig_AreaDelay);
- NTTMGR_VisitStash(); // force stash organs between mini's
- return true;
- }
- function NT_FindExistingPortals(){ // this function is called before cubing keys. Checks for already opened portals so we can find the one we will open next
- var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- var _gid;
- if(_portal){
- do{
- if(!NT_IsPossiblePortal(_portal)){
- continue;
- }
- _gid = _portal.gid;
- if( existingPortal.indexOf(_gid) == -1){ // if the portal has not already been pushed into the existingPortal array
- existingPortal.push(_gid); // push it into the array now
- }
- } while(_portal.GetNext());
- }
- return;
- }
- function NT_FindNewPortal(){ // now we have opened a new portal lets find it
- var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- var _gid;
- if(_portal){
- do
- {
- if(!NT_IsPossiblePortal(_portal)){
- continue;
- }
- _gid = _portal.gid;
- if( existingPortal.indexOf(_gid) == -1){
- return _gid; // return this portal. which will be the one taken
- }
- } while(_portal.GetNext());
- Delay(250)
- }
- return false;
- }
- function NT_KillIzual(){
- NTP_DoPrecast(true);
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 397, 2, 2)){
- return false;
- }
- if(!NT_KillMonster(706)){
- return false;
- }
- NTC_PingDelay(100);
- NTC_PickSpecialItem(652);
- NTC_PingDelay(100);
- NTSI_PickItems();
- NTM_MakeTP(true);
- NTTMGR_VisitStash(); // force stash organs between mini's
- return true;
- }
- function NT_KillUberDuriel(){
- NTP_DoPrecast(true);
- NT_FindUberDuriel();
- var UberDuriel = NTC_FindMonster(708);
- if(UberDuriel){
- NTM_MoveTo(me.areaid, UberDuriel.x, UberDuriel.y);
- }
- if(!NT_KillMonster(708)){
- return false;
- }
- NTC_PingDelay(100);
- NTC_PickSpecialItem(651);
- NTC_PingDelay(100);
- NTSI_PickItems();
- NTM_MakeTP(true);
- NTTMGR_VisitStash(); // force stash organs between mini's
- return true;
- }
- function NT_FindUberDuriel(){
- var _findLoc = [20196, 8694, 20308, 8588, 20187, 8639, 20100, 8550, 20103, 8688, 20144, 8709, 20263, 8811, 20247, 8665];
- for(var i = 0 ; i < _findLoc.length; i += 2){
- NTM_MoveTo(me.areaid, _findLoc[i], _findLoc[i+1]);
- if(NTC_FindUnit(NTC_UNIT_MONSTER, 708)){
- break;
- }
- }
- }
- function NT_KillMonster(classid) { // purpose of this is to increase max attacks for lilith
- var _target;
- if(NTConfig_AttackSkill[1] < 1){
- return false;
- }
- _target = NTC_FindUnit(NTC_UNIT_MONSTER, classid, 5);
- if(!_target){
- return false;
- }
- if(_target.IsAttackable()){
- var _attackcount = 0;
- while(_attackcount < 800 && NTA_IsValidMonster(_target)){
- if(NTA_Attack(_target, (_attackcount%30) == 0) < 2){
- break;
- }
- _attackcount++;
- }
- }
- return (_target.hp <= 0 || _target.mode == 0 || _target.mode == 12);
- }
- function TakeLilllithPortal()
- {
- _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- var Lportal;
- if(_portal ) {
- for(var n = 0; n < _portal.length; n++) {
- if(_portal.subareaid == 133) {
- Lportal = _portal;
- break;
- }
- }
- for(var i = 0 ; i <25 ; i++){
- if(NTM_GetCloserInt(Lportal)) {
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, Lportal);
- }
- NTC_Delay(250);
- if(me.areaid != 109){
- break;
- }
- }
- while(me.areaid == 0){
- NTC_Delay(200);
- }
- NTC_PingDelay(NTConfig_AreaDelay);
- if(me.areaid == 133) {
- return true;
- }
- return false;
- }
- }
- function TakeIzzyPortal()
- {
- _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- var Iportal;
- if(_portal ) {
- for(var n = 0; n < _portal.length; n++) {
- if(_portal.subareaid == 135) {
- Iportal = _portal;
- break;
- }
- }
- for(var i = 0 ; i <25 ; i++){
- if(NTM_GetCloserInt(Iportal)) {
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, Iportal);
- }
- NTC_Delay(250);
- if(me.areaid != 109){
- break;
- }
- }
- while(me.areaid == 0){
- NTC_Delay(200);
- }
- NTC_PingDelay(NTConfig_AreaDelay);
- if(me.areaid == 135) {
- return true;
- }
- return false;
- }
- }
- function TakeDuryPortal()
- {
- _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- var Iportal;
- if(_portal ) {
- for(var n = 0; n < _portal.length; n++) {
- if(_portal.subareaid == 134) {
- Dportal = _portal;
- break;
- }
- }
- for(var i = 0 ; i <25 ; i++){
- if(NTM_GetCloserInt(Dportal)) {
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, Dportal);
- }
- NTC_Delay(250);
- if(me.areaid != 109){
- break;
- }
- }
- while(me.areaid == 0){
- NTC_Delay(200);
- }
- NTC_PingDelay(NTConfig_AreaDelay);
- if(me.areaid == 134) {
- return true;
- }
- return false;
- }
- }
- function NT_OpenMiniPortals() {
- var miniSpots = []; // I know could have used parallel arrays, but was playing
- miniSpots[0] = [5134, 5056];
- miniSpots[1] = [5132, 5063];
- miniSpots[2] = [5130, 5070];
- for(var i = 0; i < 3; i++){
- Print(NTC_PrintRandomColor() + "opening portal");
- if(!NT_CubeKeys(miniSpots[i][0], miniSpots[i][1], i)){
- return false;
- }
- }
- NTC_PingDelay(NTConfig_CubingDelays);
- return true;
- }
- function NT_CubeKeys(spotx, spoty, keys) {
- var _stash;
- NTTM_TownMove("stash");
- _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
- if(_stash){
- if(NTT_DoInteract(_stash)){
- var cube;
- cube = me.GetItems(NTC_UNIT_CUBE);
- if(!cube || cube.length < 1){
- return false;
- }
- if(NTCU_CheckCubeInventoryInt() > 0){
- if(!NTCU_OpenCubeInt(cube[0])){
- return false;
- }
- if(NTCU_ClearCubeInt() < 1){
- return false;
- }
- NTCU_CloseCubeInt();
- }
- }
- NTCU_MoveItemToCubeInt(cube[0], tKey[keys])
- NTCU_MoveItemToCubeInt(cube[0], hKey[keys])
- NTCU_MoveItemToCubeInt(cube[0], dKey[keys])
- NTTM_TownMoveXY(spotx, spoty);
- Delay(250)
- if(!NTCU_OpenCubeInt(cube[0])){
- return false;
- }
- Delay(250);
- if(Transmute()){
- NTC_PingDelay(NTConfig_CubingDelays);
- NTCU_CloseCubeInt();
- NTC_PingDelay(NTConfig_CubingDelays);
- NTC_CancelMenus();
- NTC_PingDelay(parseInt((NTConfig_CubingDelays / 2), 10));
- NTC_PingDelay(100);
- return true;
- }
- else{
- NTC_PingDelay(NTConfig_CubingDelays);
- Print(COLOR_1 + "didn't open portal");
- NTCU_CloseCubeInt();
- return false;
- }
- }
- else{
- return false;
- }
- }
- function NT_PreBuffFade() {
- var specialCheckSelf = ['01'];
- var specialMercCheck = [];
- if(NTTM_TownMove("waypoint")){
- if(NTM_TakeWaypoint(107)){
- NTP_DoPrecast(true);
- NTM_MoveTo(me.areaid, 7811, 5872);
- Print(NTC_PrintRandomColor() + "Activating fade");
- while(1){
- if(me.GetStat(181) > 0) {
- break;
- }
- if(NTTMGR_CheckSafe(specialCheckSelf, specialMercCheck)){
- NTM_MoveTo(me.areaid, 7811, 5872);
- }
- NTC_Delay(200);
- }
- }
- }
- Print(NTC_PrintRandomColor() + "There's Our Fade");
- return;
- }
Add Comment
Please, Sign In to add comment