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();
- var i;
- var _items;
- for(i = 0 ; i < 4 ; i++)
- {
- _items = me.GetItems();
- Delay(500);
- if(_items)
- break;
- }
- if(_items)
- {
- for(i = 0 ; i < _items.length ; i++)
- {
- if(_items[i].classid == 603 && _items[i].quality == 7)
- {
- NTDC_Say(NTConfig_Msg[0]);
- if(_items[i].itemloc == 4)
- {
- NTTM_TownMove("stash");
- var _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 5);
- if(_stash)
- {
- if(NTT_DoInteract(_stash))
- {
- if(NTC_ItemToCursor(_items[i]))
- {
- Delay(100);
- me.Cancel(1);
- NTC_ClearCursor();
- }
- Delay(500);
- }
- }
- }
- else if(_items[i].itemloc == 0)
- {
- SetUIState(0x01, true);
- if(NTT_DropItem(_items[i]))
- Delay(500);
- else
- NTDC_Say(NTConfig_Msg[1]);
- }
- else
- NTDC_Say(NTConfig_Msg[1]);
- break;
- }
- }
- }
- else
- NTDC_Say(NTConfig_Msg[2]);
- NTTMGR_TownManager();
- NTDC_Say(NTConfig_Msg[3]);
- if(!NTTM_TownMove("waypoint"))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(74))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- NTP_DoPrecast(true);
- for(i = 0 ; i < 3 ; i++)
- {
- NTM_TakeUnit(NTC_UNIT_OBJECT, 298);
- Delay(500);
- if(me.areaid == 54)
- break;
- }
- if(me.areaid != 54)
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeUnit(NTC_UNIT_OBJECT, 298)");
- return;
- }
- if(!NTDC_KillMonster(333))
- {
- NTDC_Say(NTConfig_Msg[4]);
- Delay(1000);
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- return;
- }
- Delay(1000);
- NTSI_PickItems();
- if(!NTTM_CheckAct())
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return;
- }
- if(!NTTM_TownMove("waypoint"))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(1))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- if(!NTTM_TownMove("stash"))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- NTDC_Say(NTConfig_Msg[5]);
- for(i = 0 ; i < 4 ; i++)
- {
- _items = me.GetItems();
- Delay(500);
- if(_items)
- break;
- }
- if(_items)
- {
- for(i = 0 ; i < _items.length ; i++)
- {
- if(_items[i].classid == 603 && _items[i].quality == 7)
- {
- SetUIState(0x01, true);
- if(NTT_DropItem(_items[i]))
- Delay(500);
- else
- NTDC_Say(NTConfig_Msg[1]);
- break;
- }
- }
- }
- else
- {
- NTDC_Say(NTConfig_Msg[1]);
- NTC_SendMsgToScript("NTBotGame.ntj", "ÿc1me.GetItems() is undefined");
- return;
- }
- Delay(1000);
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- }
- function NTDC_Say(msg)
- {
- Say(msg);
- Delay(50);
- }
- function NTDC_KillMonster(classid)
- {
- var _target;
- var _attackcount = 0;
- if(NTConfig_AttackSkill[1] < 1)
- return false;
- for(var i = 0; i < 4 ; i++)
- {
- _target = NTC_FindUnit(NTC_UNIT_MONSTER, classid, 5);
- if(_target)
- break;
- Delay(1000);
- }
- if(!_target)
- return false;
- NTDC_Say(NTConfig_Msg[6]);
- if(_target.IsAttackable())
- {
- _attackcount = 0;
- while(_attackcount < 1000 && NTA_IsValidMonster(_target))
- {
- if(NTA_Attack(_target, (_attackcount%30) == 0) < 2)
- break;
- _attackcount++;
- }
- }
- Delay(1000);
- NTDC_Say(NTConfig_Msg[7]);
- return (_target.hp <= 0 || _target.mode == 0 || _target.mode == 12);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement