Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function NTMain()
- {
- Include("libs/common/NTCommon.ntl");
- NTC_IncludeLibs();
- NTC_IncludeConfig("NTBot/char_configs");
- NT_LoadConfig();
- NTSI_LoadNIPFiles("NTBot/item_configs");
- NTA_Initialize(); // 10
- if(!NTTM_CheckAct())
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return;
- }
- if(me.areaid != 109)
- {
- if(!NTTM_TownMove("waypoint"))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(109))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- }
- NTTMGR_TownManager();
- NTTM_TownMove("portalspot");
- //wait for party
- for(i = 0; i <= 200; i++)
- {
- if(NTC_InMyParty(NTConfig_Leader))
- break;
- //Party Leader only!
- _player = GetPlayerUnit();
- if(_player)
- {
- _mypartyid = _player.partyid;
- while(_player.GetNext())
- {
- if(_player.name == NTConfig_Leader && _player.partyflag == 2 && (_player.partyid == 65535 || _player.partyid != _mypartyid))
- {
- me.ClickParty(_player, 2);
- Say("kid");
- break;
- }
- }
- }
- NTC_Delay(800);
- }
- while(me.areaid == 109 && NTC_InMyParty(NTConfig_Leader))
- {
- NTM_UsePortal("BluePortal", 131, NTConfig_Leader); // 50
- Delay(1000);
- }
- NTP_DoPrecast(true);
- while(NTC_InMyParty(NTConfig_Leader))
- {
- NT_ClearThroneInt();
- while(1)
- {
- if(me.classid == NTC_CHAR_CLASS_PALADIN || me.classid == NTC_CHAR_CLASS_BARBARIAN)
- NTM_MoveTo(me.areaid, 15092, 5028);
- else
- NTM_MoveTo(me.areaid, 15092, 5040);
- if(me.GetState(2))
- NTC_PutSkill(109, NTC_HAND_RIGHT);
- 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 > 15000)
- {
- NT_ClearThroneInt();
- _starttick = GetTickCount();
- }
- _wave = NT_ThroneCheckInt();
- }
- switch(_wave)
- {
- case 1:
- NTA_ClearPosition(40, true, 1);
- NTP_DoPrecast(true);
- break;
- case 3:
- NTA_ClearPosition(40, true, 2);
- break;
- case 4:
- NTA_ClearPosition(40, true, 2);
- break;
- case 5:
- NTA_ClearPosition(40, true);
- break;
- default:
- NTA_ClearPosition(40, true, 1);
- break;
- }
- if(_wave == 5)
- break;
- }
- if(NTConfig_KillBaal)
- {
- var _portal;
- if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe|0x01, NTConfig_CheckMercSafe))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
- return;
- }
- NTM_MoveTo(me.areaid, 15092, 5010);
- NTP_DoPrecast(true);
- while(NTC_GetUnit(NTC_UNIT_MONSTER, 543))
- NTC_Delay(500);
- _portal = NTC_GetUnit(NTC_UNIT_OBJECT, 563, 1);
- if(!_portal)
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTC_GetUnit()");
- return;
- }
- if(!NTM_UsePortal("Portal", 132, null, _portal))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_UsePortal()");
- return;
- }
- NTM_MoveTo(me.areaid, 15138, 5916);
- if(!NTA_KillMonster(544))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
- return;
- }
- NTSI_PickItems();
- }
- }
- 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_GetUnit(NTC_UNIT_MONSTER, 543))
- return 5;
- _monster = NTC_GetUnit(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_AttackSkill[3] == 56 || NTConfig_AttackSkill[3] == 59)
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2, 15092, 5028);
- }
- else if(me.classid == NTC_CHAR_CLASS_PALADIN)
- {
- if(NTConfig_AttackSkill[3] == 112)
- {
- if(NTConfig_AttackSkill[4] > 0)
- NTC_PutSkill(NTConfig_AttackSkill[4], NTC_HAND_RIGHT);
- return NTC_CastSkill(NTConfig_AttackSkill[3], 2);
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement