/------------------------------------------------------------------------------Quote:
hatten wir doch letztens schonmal so ein problem.. wie sieht deine attack config aus ?
// Attack configuration
//------------------------------------------------------------------------------
NTConfig_AttackSkill[271] = 5; // Cast your first spell once. Set to 0 if you won't
NTConfig_AttackSkill[271] = 1; // Cast your primary spell to boss.
NTConfig_AttackSkill[271] = 5; // Cast your primary spell to others.
NTConfig_AttackSkill[271] = 5; // Cast your primary untimed spell if primary spell is timed spell. Set to 0 if you won't
NTConfig_AttackSkill[4] = 0; // Cast your secondary spell if monster is immune to your primary spell. Set to 0 if you won't
NTConfig_AttackSkill[5] = 0; // Cast your secondary untimed spell if secondary spell is timed spell. Set to 0 if you won't
NTConfig_ClearPosition = true; // Set to true if you want to clear area after killing boss.
NTConfig_CheckSafe = true; // Set to true to check for curses, merc and potion (go to town if needed)
NTConfig_CastStatic = 100; // Cast Static Field until monster's HP lower less than this percent. Set to 100 if you won't
}
so sieht des bei mir aus ^^
mach des mit assa und macht immer tp nach 1 trap
const NTA_DAMAGE_NONE = 0;
const NTA_DAMAGE_PHYSICAL = 1;
const NTA_DAMAGE_MAGIC = 2;
const NTA_DAMAGE_FIRE = 3;
const NTA_DAMAGE_LIGHTNING = 4;
const NTA_DAMAGE_COLD = 5;
const NTA_DAMAGE_POISON = 6;
var _NTA_SkillHand = new Array(6);
var _NTA_SkillDamage = new Array(6);
var _NTA_SkillDelay = new Array(6);
function NTA_Initialize()
{
for(var i = 0 ; i < 6 ; i++)
{
if(NTConfig_AttackSkill[i] > 0)
{
_NTA_SkillHand[i] = GetBaseStat("skills.txt", NTConfig_AttackSkill[i], 166) ? 2 : NTC_HAND_RIGHT;
_NTA_SkillDamage[i] = NTA_GetDamageType(NTConfig_AttackSkill[i]);
_NTA_SkillDelay[i] = NTC_GetCastDelay(NTConfig_AttackSkill[i]);
}
}
}
function NTA_KillBoss(classid)
{
var _target;
if(NTConfig_AttackSkill[1] < 1)
return false;
_target = NTC_FindMonster(classid);
if(_target)
{
if(NTConfig_AttackSkill[0] > 0 && NTA_GetResistance(_target, _NTA_SkillDamage[0]) < 100)
NTC_DoCast(NTConfig_AttackSkill[0], _NTA_SkillHand[0], _target);
return NTA_Attack(_target, true, 100);
}
return false;
}
function NTA_ClearPosition(range, spectype)
{
var _orgx, _orgy;
var _target;
var _killnum = 0;
if(NTConfig_AttackSkill[2] < 1)
return false;
if(arguments.length < 1)
range = 20;
if(arguments.length < 2)
spectype = 0;
_orgx = me.x;
_orgy = me.y;
for(var i = 0 ; i < 2 ; i++)
{
_target = NTC_GetUnit(NTC_UNIT_MONSTER);
if(_target)
{
do
{
if(NTA_IsValidTarget(_target) && (spectype == 0 || (_target.spectype & spectype)) && GetDistance(_orgx, _orgy, _target.x, _target.y) < range)
{
if(_killnum == 0)
{
if(NTConfig_AttackSkill[0] > 0 && NTA_GetResistance(_target, _NTA_SkillDamage[0]) < 100 && CheckCollision(me, _target, 3))
NTC_DoCast(NTConfig_AttackSkill[0], _NTA_SkillHand[0], _target);
}
if(NTA_Attack(_target, false, 20))
_killnum++;
}
} while(_target.GetNext());
}
}
if(me.classid == NTC_CHAR_CLASS_PALADIN)
{
if(NTConfig_UseRedemption && _killnum > 1 && NTC_PutSkill(124, NTC_HAND_RIGHT))
NTC_PingDelay(1000);
}
return (_killnum > 0);
}
function NTA_ClearRooms()
{
var _room;
var _rooms;
_room = GetRoom();
if(!_room)
return false;
_rooms = new Array();
do
{
_rooms.push([parseInt(_room.x*5 + _room.xsize*5/2), parseInt(_room.y*5 + _room.ysize*5/2)]);
} while(_room.GetNext());
while(_rooms.length > 0)
{
_rooms.sort(NTA_SortRoomInt);
_room = _rooms.shift();
NTM_MoveTo(me.areaid, _room[0], _room[1], 0, true);
NTP_DoPrecastCTA(false);
}
return true;
}
function NTA_IsValidTarget(monster, simple)
{
if(!monster || monster.type != NTC_UNIT_MONSTER)
return false;
if(monster.hp <= 0 || monster.mode == 0 || monster.mode == 12)
return false;
if(((monster.classid >= 110 && monster.classid <= 113) || monster.classid == 608) && monster.mode == 8) // ignore flying scavengers
return false;
if(monster.classid == 68 && monster.mode == 14) // ignore burrowing maggots
return false;
if((monster.classid == 258 || monster.classid == 261) && monster.mode == 14) // ignore submerged WaterWatchers
return false;
if(monster.GetState(53) || monster.GetState(96)) // Conversion, Revive
return false;
if(arguments.length < 2)
simple = false;
if(!simple)
{
var _name;
var _parent;
// dummy
_name = GetBaseStat("monstats.txt", monster.classid, 5);
if(!_name || _name.toLowerCase() == "dummy")
return false;
// killable
if(!GetBaseStat("monstats.txt", monster.classid, 89))
return false;
// neverCount
if(GetBaseStat("monstats.txt", monster.classid, 93))
return false;
_parent = monster.GetParent();
if(_parent && _parent.type == NTC_UNIT_PLAYER && !GetPlayerFlag(_parent.gid, me.gid, 8))
return false;
}
return true;
}
function NTA_GetDamageType(skillid)
{
var _etype;
if(skillid == 74) // Corpse Explosion
return NTA_DAMAGE_PHYSICAL;
if(skillid == 112) // Blessed Hammer
return NTA_DAMAGE_NONE;
_etype = GetBaseStat("skills.txt", skillid, 233);
switch(_etype)
{
case "cold": return NTA_DAMAGE_COLD;
case "fire": return NTA_DAMAGE_FIRE;
case "ltng": return NTA_DAMAGE_LIGHTNING;
case "mag": return NTA_DAMAGE_MAGIC;
case "pois": return NTA_DAMAGE_POISON;
case "stun": return NTA_DAMAGE_NONE;
default:
if(GetBaseStat("skills.txt", skillid, 178) || GetBaseStat("skills.txt", skillid, 182)) // aura or passive
return NTA_DAMAGE_NONE;
}
return NTA_DAMAGE_PHYSICAL;
}
function NTA_GetResistance(enemy, type)
{
if(!enemy)
return false;
if(arguments.length == 2)
{
switch(type)
{
case NTA_DAMAGE_PHYSICAL:
return enemy.GetStat(36);
case NTA_DAMAGE_MAGIC:
return enemy.GetStat(37);
case NTA_DAMAGE_FIRE:
return enemy.GetStat(39);
case NTA_DAMAGE_LIGHTNING:
return enemy.GetStat(41);
case NTA_DAMAGE_COLD:
return enemy.GetStat(43);
case NTA_DAMAGE_POISON:
return enemy.GetStat(45);
}
}
return 0;
}
function NTA_Attack(target, boss, maxattacks)
{
switch(me.classid)
{
case NTC_CHAR_CLASS_AMAZON:
return NTA_AmazonAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_SORCERESS:
return NTA_SorceressAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_NECROMANCER:
return NTA_NecromancerAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_PALADIN:
return NTA_PaladinAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_BARBARIAN:
return NTA_BarbarianAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_DRUID:
return NTA_DruidAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_ASSASSIN:
return NTA_AssassinAttackInt(target, boss, maxattacks);
}
return false;
}
// Internal function
function NTA_AmazonAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_SorceressAttackInt(target, boss, maxattacks)
{
var _primaryindex;
var _maxattacks = 0;
var _range1, _range2;
var _prehp;
_primaryindex = boss ? 1 : 2;
switch(NTConfig_AttackSkill[_primaryindex])
{
case 48: // Nova
_range1 = 10;
break;
default:
_range1 = 20;
break;
}
switch(NTConfig_AttackSkill[4])
{
case 48: // Nova
_range2 = 10;
break;
default:
_range2 = 20;
break;
}
if(NTConfig_CastStatic < 100)
{
var _staticlevel = NTC_CheckSkill(42);
if(_staticlevel > 0 && NTA_GetResistance(target, NTA_DAMAGE_LIGHTNING) < 100)
{
var _cast = 0;
var _staticrange = Math.floor((5+_staticlevel-1)*2/3);
while(_cast++ < 10 && NTA_IsValidTarget(target, true) && parseInt(target.hp*100/target.hpmax) > NTConfig_CastStatic && (boss || CheckCollision(me, target, 2)))
{
NTA_MoveCloseInt(target, _staticrange);
if(!NTC_DoCast(42, NTC_HAND_RIGHT, target))
{
if(!boss)
break;
}
}
}
}
_prehp = target.hp;
while(_maxattacks++ < maxattacks && NTA_IsValidTarget(target, true))
{
if(!CheckCollision(me, target, 3))
{
if(boss)
NTA_MoveCloseInt(target, Math.round(GetDistance(me, target)/2));
else if(me.areaid != 131)
return false;
}
if(NTA_GetResistance(target, _NTA_SkillDamage[_primaryindex]) < 100)
{
if((_maxattacks % 2) == 1)
{
if(!NTA_MoveCloseInt(target, _range1) && !boss)
return false;
}
NTA_DoCastInt(_primaryindex, target);
}
else if(NTConfig_AttackSkill[4] > 0 && NTA_GetResistance(target, _NTA_SkillDamage[4]) < 100)
{
if((_maxattacks % 2) == 1)
{
if(!NTA_MoveCloseInt(target, _range2) && !boss)
return false;
}
NTA_DoCastInt(4, target);
}
else
{
if(boss)
{
if((_maxattacks % 2) == 1)
NTA_MoveCloseInt(target, _range1);
NTA_DoCastInt(_primaryindex, target);
}
else
return false;
}
if(boss)
{
if((_maxattacks % 4) == 0 && target.hp >= _prehp)
{
if(target.classid == 526)
return false;
}
if((_maxattacks % 8) == 0)
{
if(target.hp < _prehp)
_prehp = target.hp;
else
return false;
}
}
else
{
if((_maxattacks % 4) == 0)
{
if(target.hp < _prehp)
_prehp = target.hp;
else
return false;
}
}
if(NTConfig_CheckSafe)
{
if(!NTTMGR_CheckSafe(1))
return false;
}
}
return true;
}
function NTA_NecromancerAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_PaladinAttackInt(target, boss, maxattacks)
{
var _primaryindex;
var _maxattacks = 0;
var _range1, _range2;
var _prehp1, _prehp2;
var _nohit = true;
_primaryindex = boss ? 1 : 2;
switch(NTConfig_AttackSkill[_primaryindex])
{
case 101: // Holy Bolt
case 121: // Fist of the Heavens
_range1 = 20;
break;
default:
_range1 = 2;
break;
}
switch(NTConfig_AttackSkill[4])
{
case 101: // Holy Bolt
case 121: // Fist of the Heavens
_range2 = 20;
break;
default:
_range2 = 2;
break;
}
_prehp1 = target.hp;
while(_maxattacks++ < maxattacks && NTA_IsValidTarget(target, true))
{
if(!CheckCollision(me, target, 3))
{
if(boss)
{
if(NTConfig_AttackSkill[_primaryindex] == 101 || NTConfig_AttackSkill[_primaryindex] == 121)
NTA_MoveCloseInt(target, Math.round(GetDistance(me, target)/2));
}
else if(me.areaid != 131)
return false;
}
_prehp2 = target.hp;
if(NTA_GetResistance(target, _NTA_SkillDamage[_primaryindex]) < 100)
{
if((_maxattacks % 2) == 1 && _nohit)
{
if(NTConfig_AttackSkill[_primaryindex] == 112)
{
if(!NTM_MoveTo(target.areaid, target.x+1, target.y, 0) && !boss)
return false;
}
else
{
if(!NTA_MoveCloseInt(target, _range1) && !boss)
return false;
}
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
}
NTA_DoCastInt(_primaryindex, target);
}
else if(NTConfig_AttackSkill[4] > 0 && NTA_GetResistance(target, _NTA_SkillDamage[4]) < 100)
{
if((_maxattacks % 2) == 1 && _nohit)
{
if(NTConfig_AttackSkill[4] == 112)
{
if(!NTM_MoveTo(target.areaid, target.x+1, target.y, 0) && !boss)
return false;
}
else
{
if(!NTA_MoveCloseInt(target, _range2) && !boss)
return false;
}
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
}
NTA_DoCastInt(4, target);
}
else
{
if(boss)
{
if((_maxattacks % 2) == 1 && _nohit)
{
if(NTConfig_AttackSkill[_primaryindex] == 112)
NTM_MoveTo(target.areaid, target.x+1, target.y, 0);
else
NTA_MoveCloseInt(target, _range1);
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
}
NTA_DoCastInt(_primaryindex, target);
}
else
return false;
}
if(boss)
{
if((_maxattacks % 8) == 0)
{
if(target.hp < _prehp1)
_prehp1 = target.hp;
else
return false;
}
}
else
{
if((_maxattacks % 4) == 0)
{
if(target.hp < _prehp1)
_prehp1 = target.hp;
else
return false;
}
}
_nohit = (target.hp >= _prehp2);
if(NTConfig_CheckSafe)
{
if(!NTTMGR_CheckSafe(1))
return false;
}
}
return true;
}
function NTA_BarbarianAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_DruidAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_AssassinAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_DoCastInt(index, target)
{
var _untimedindex = index < 4 ? 3 : 5;
if(!NTC_DoCast(NTConfig_AttackSkill[index], _NTA_SkillHand[index], target))
return false;
if(_NTA_SkillDelay[index] > 0)
{
if(NTConfig_AttackSkill[_untimedindex] > 0)
{
var _starttick = GetTickCount();
while(NTA_IsValidTarget(target, true))
{
NTC_DoCast(NTConfig_AttackSkill[_untimedindex], _NTA_SkillHand[_untimedindex], target);
if(GetTickCount()-_starttick >= _NTA_SkillDelay[index])
break;
}
}
else
NTC_Delay(_NTA_SkillDelay[index]);
}
return true;
}
function NTA_MoveCloseInt(target, maxrange)
{
var _dist = GetDistance(me, target);
if(_dist > maxrange)
{
var _destx, _desty;
_destx = me.x + Math.round((_dist-maxrange)*(target.x-me.x) / _dist);
_desty = me.y + Math.round((_dist-maxrange)*(target.y-me.y) / _dist);
return NTM_MoveTo(me.areaid, _destx, _desty, 0);
}
return true;
}
function NTA_SortRoomInt(a, b)
{
if(GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1]))
return -1;
return 1;
}
const NTA_DAMAGE_PHYSICAL = 1;
const NTA_DAMAGE_MAGIC = 2;
const NTA_DAMAGE_FIRE = 3;
const NTA_DAMAGE_LIGHTNING = 4;
const NTA_DAMAGE_COLD = 5;
const NTA_DAMAGE_POISON = 6;
var _NTA_SkillHand = new Array(6);
var _NTA_SkillDamage = new Array(6);
var _NTA_SkillDelay = new Array(6);
function NTA_Initialize()
{
for(var i = 0 ; i < 6 ; i++)
{
if(NTConfig_AttackSkill[i] > 0)
{
_NTA_SkillHand[i] = GetBaseStat("skills.txt", NTConfig_AttackSkill[i], 166) ? 2 : NTC_HAND_RIGHT;
_NTA_SkillDamage[i] = NTA_GetDamageType(NTConfig_AttackSkill[i]);
_NTA_SkillDelay[i] = NTC_GetCastDelay(NTConfig_AttackSkill[i]);
}
}
}
function NTA_KillBoss(classid)
{
var _target;
if(NTConfig_AttackSkill[1] < 1)
return false;
_target = NTC_FindMonster(classid);
if(_target)
{
if(NTConfig_AttackSkill[0] > 0 && NTA_GetResistance(_target, _NTA_SkillDamage[0]) < 100)
NTC_DoCast(NTConfig_AttackSkill[0], _NTA_SkillHand[0], _target);
return NTA_Attack(_target, true, 100);
}
return false;
}
function NTA_ClearPosition(range, spectype)
{
var _orgx, _orgy;
var _target;
var _killnum = 0;
if(NTConfig_AttackSkill[2] < 1)
return false;
if(arguments.length < 1)
range = 20;
if(arguments.length < 2)
spectype = 0;
_orgx = me.x;
_orgy = me.y;
for(var i = 0 ; i < 2 ; i++)
{
_target = NTC_GetUnit(NTC_UNIT_MONSTER);
if(_target)
{
do
{
if(NTA_IsValidTarget(_target) && (spectype == 0 || (_target.spectype & spectype)) && GetDistance(_orgx, _orgy, _target.x, _target.y) < range)
{
if(_killnum == 0)
{
if(NTConfig_AttackSkill[0] > 0 && NTA_GetResistance(_target, _NTA_SkillDamage[0]) < 100 && CheckCollision(me, _target, 3))
NTC_DoCast(NTConfig_AttackSkill[0], _NTA_SkillHand[0], _target);
}
if(NTA_Attack(_target, false, 20))
_killnum++;
}
} while(_target.GetNext());
}
}
if(me.classid == NTC_CHAR_CLASS_PALADIN)
{
if(NTConfig_UseRedemption && _killnum > 1 && NTC_PutSkill(124, NTC_HAND_RIGHT))
NTC_PingDelay(1000);
}
return (_killnum > 0);
}
function NTA_ClearRooms()
{
var _room;
var _rooms;
_room = GetRoom();
if(!_room)
return false;
_rooms = new Array();
do
{
_rooms.push([parseInt(_room.x*5 + _room.xsize*5/2), parseInt(_room.y*5 + _room.ysize*5/2)]);
} while(_room.GetNext());
while(_rooms.length > 0)
{
_rooms.sort(NTA_SortRoomInt);
_room = _rooms.shift();
NTM_MoveTo(me.areaid, _room[0], _room[1], 0, true);
NTP_DoPrecastCTA(false);
}
return true;
}
function NTA_IsValidTarget(monster, simple)
{
if(!monster || monster.type != NTC_UNIT_MONSTER)
return false;
if(monster.hp <= 0 || monster.mode == 0 || monster.mode == 12)
return false;
if(((monster.classid >= 110 && monster.classid <= 113) || monster.classid == 608) && monster.mode == 8) // ignore flying scavengers
return false;
if(monster.classid == 68 && monster.mode == 14) // ignore burrowing maggots
return false;
if((monster.classid == 258 || monster.classid == 261) && monster.mode == 14) // ignore submerged WaterWatchers
return false;
if(monster.GetState(53) || monster.GetState(96)) // Conversion, Revive
return false;
if(arguments.length < 2)
simple = false;
if(!simple)
{
var _name;
var _parent;
// dummy
_name = GetBaseStat("monstats.txt", monster.classid, 5);
if(!_name || _name.toLowerCase() == "dummy")
return false;
// killable
if(!GetBaseStat("monstats.txt", monster.classid, 89))
return false;
// neverCount
if(GetBaseStat("monstats.txt", monster.classid, 93))
return false;
_parent = monster.GetParent();
if(_parent && _parent.type == NTC_UNIT_PLAYER && !GetPlayerFlag(_parent.gid, me.gid, 8))
return false;
}
return true;
}
function NTA_GetDamageType(skillid)
{
var _etype;
if(skillid == 74) // Corpse Explosion
return NTA_DAMAGE_PHYSICAL;
if(skillid == 112) // Blessed Hammer
return NTA_DAMAGE_NONE;
_etype = GetBaseStat("skills.txt", skillid, 233);
switch(_etype)
{
case "cold": return NTA_DAMAGE_COLD;
case "fire": return NTA_DAMAGE_FIRE;
case "ltng": return NTA_DAMAGE_LIGHTNING;
case "mag": return NTA_DAMAGE_MAGIC;
case "pois": return NTA_DAMAGE_POISON;
case "stun": return NTA_DAMAGE_NONE;
default:
if(GetBaseStat("skills.txt", skillid, 178) || GetBaseStat("skills.txt", skillid, 182)) // aura or passive
return NTA_DAMAGE_NONE;
}
return NTA_DAMAGE_PHYSICAL;
}
function NTA_GetResistance(enemy, type)
{
if(!enemy)
return false;
if(arguments.length == 2)
{
switch(type)
{
case NTA_DAMAGE_PHYSICAL:
return enemy.GetStat(36);
case NTA_DAMAGE_MAGIC:
return enemy.GetStat(37);
case NTA_DAMAGE_FIRE:
return enemy.GetStat(39);
case NTA_DAMAGE_LIGHTNING:
return enemy.GetStat(41);
case NTA_DAMAGE_COLD:
return enemy.GetStat(43);
case NTA_DAMAGE_POISON:
return enemy.GetStat(45);
}
}
return 0;
}
function NTA_Attack(target, boss, maxattacks)
{
switch(me.classid)
{
case NTC_CHAR_CLASS_AMAZON:
return NTA_AmazonAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_SORCERESS:
return NTA_SorceressAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_NECROMANCER:
return NTA_NecromancerAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_PALADIN:
return NTA_PaladinAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_BARBARIAN:
return NTA_BarbarianAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_DRUID:
return NTA_DruidAttackInt(target, boss, maxattacks);
case NTC_CHAR_CLASS_ASSASSIN:
return NTA_AssassinAttackInt(target, boss, maxattacks);
}
return false;
}
// Internal function
function NTA_AmazonAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_SorceressAttackInt(target, boss, maxattacks)
{
var _primaryindex;
var _maxattacks = 0;
var _range1, _range2;
var _prehp;
_primaryindex = boss ? 1 : 2;
switch(NTConfig_AttackSkill[_primaryindex])
{
case 48: // Nova
_range1 = 10;
break;
default:
_range1 = 20;
break;
}
switch(NTConfig_AttackSkill[4])
{
case 48: // Nova
_range2 = 10;
break;
default:
_range2 = 20;
break;
}
if(NTConfig_CastStatic < 100)
{
var _staticlevel = NTC_CheckSkill(42);
if(_staticlevel > 0 && NTA_GetResistance(target, NTA_DAMAGE_LIGHTNING) < 100)
{
var _cast = 0;
var _staticrange = Math.floor((5+_staticlevel-1)*2/3);
while(_cast++ < 10 && NTA_IsValidTarget(target, true) && parseInt(target.hp*100/target.hpmax) > NTConfig_CastStatic && (boss || CheckCollision(me, target, 2)))
{
NTA_MoveCloseInt(target, _staticrange);
if(!NTC_DoCast(42, NTC_HAND_RIGHT, target))
{
if(!boss)
break;
}
}
}
}
_prehp = target.hp;
while(_maxattacks++ < maxattacks && NTA_IsValidTarget(target, true))
{
if(!CheckCollision(me, target, 3))
{
if(boss)
NTA_MoveCloseInt(target, Math.round(GetDistance(me, target)/2));
else if(me.areaid != 131)
return false;
}
if(NTA_GetResistance(target, _NTA_SkillDamage[_primaryindex]) < 100)
{
if((_maxattacks % 2) == 1)
{
if(!NTA_MoveCloseInt(target, _range1) && !boss)
return false;
}
NTA_DoCastInt(_primaryindex, target);
}
else if(NTConfig_AttackSkill[4] > 0 && NTA_GetResistance(target, _NTA_SkillDamage[4]) < 100)
{
if((_maxattacks % 2) == 1)
{
if(!NTA_MoveCloseInt(target, _range2) && !boss)
return false;
}
NTA_DoCastInt(4, target);
}
else
{
if(boss)
{
if((_maxattacks % 2) == 1)
NTA_MoveCloseInt(target, _range1);
NTA_DoCastInt(_primaryindex, target);
}
else
return false;
}
if(boss)
{
if((_maxattacks % 4) == 0 && target.hp >= _prehp)
{
if(target.classid == 526)
return false;
}
if((_maxattacks % 8) == 0)
{
if(target.hp < _prehp)
_prehp = target.hp;
else
return false;
}
}
else
{
if((_maxattacks % 4) == 0)
{
if(target.hp < _prehp)
_prehp = target.hp;
else
return false;
}
}
if(NTConfig_CheckSafe)
{
if(!NTTMGR_CheckSafe(1))
return false;
}
}
return true;
}
function NTA_NecromancerAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_PaladinAttackInt(target, boss, maxattacks)
{
var _primaryindex;
var _maxattacks = 0;
var _range1, _range2;
var _prehp1, _prehp2;
var _nohit = true;
_primaryindex = boss ? 1 : 2;
switch(NTConfig_AttackSkill[_primaryindex])
{
case 101: // Holy Bolt
case 121: // Fist of the Heavens
_range1 = 20;
break;
default:
_range1 = 2;
break;
}
switch(NTConfig_AttackSkill[4])
{
case 101: // Holy Bolt
case 121: // Fist of the Heavens
_range2 = 20;
break;
default:
_range2 = 2;
break;
}
_prehp1 = target.hp;
while(_maxattacks++ < maxattacks && NTA_IsValidTarget(target, true))
{
if(!CheckCollision(me, target, 3))
{
if(boss)
{
if(NTConfig_AttackSkill[_primaryindex] == 101 || NTConfig_AttackSkill[_primaryindex] == 121)
NTA_MoveCloseInt(target, Math.round(GetDistance(me, target)/2));
}
else if(me.areaid != 131)
return false;
}
_prehp2 = target.hp;
if(NTA_GetResistance(target, _NTA_SkillDamage[_primaryindex]) < 100)
{
if((_maxattacks % 2) == 1 && _nohit)
{
if(NTConfig_AttackSkill[_primaryindex] == 112)
{
if(!NTM_MoveTo(target.areaid, target.x+1, target.y, 0) && !boss)
return false;
}
else
{
if(!NTA_MoveCloseInt(target, _range1) && !boss)
return false;
}
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
}
NTA_DoCastInt(_primaryindex, target);
}
else if(NTConfig_AttackSkill[4] > 0 && NTA_GetResistance(target, _NTA_SkillDamage[4]) < 100)
{
if((_maxattacks % 2) == 1 && _nohit)
{
if(NTConfig_AttackSkill[4] == 112)
{
if(!NTM_MoveTo(target.areaid, target.x+1, target.y, 0) && !boss)
return false;
}
else
{
if(!NTA_MoveCloseInt(target, _range2) && !boss)
return false;
}
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
}
NTA_DoCastInt(4, target);
}
else
{
if(boss)
{
if((_maxattacks % 2) == 1 && _nohit)
{
if(NTConfig_AttackSkill[_primaryindex] == 112)
NTM_MoveTo(target.areaid, target.x+1, target.y, 0);
else
NTA_MoveCloseInt(target, _range1);
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
}
NTA_DoCastInt(_primaryindex, target);
}
else
return false;
}
if(boss)
{
if((_maxattacks % 8) == 0)
{
if(target.hp < _prehp1)
_prehp1 = target.hp;
else
return false;
}
}
else
{
if((_maxattacks % 4) == 0)
{
if(target.hp < _prehp1)
_prehp1 = target.hp;
else
return false;
}
}
_nohit = (target.hp >= _prehp2);
if(NTConfig_CheckSafe)
{
if(!NTTMGR_CheckSafe(1))
return false;
}
}
return true;
}
function NTA_BarbarianAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_DruidAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_AssassinAttackInt(target, boss, maxattacks)
{
return false;
}
function NTA_DoCastInt(index, target)
{
var _untimedindex = index < 4 ? 3 : 5;
if(!NTC_DoCast(NTConfig_AttackSkill[index], _NTA_SkillHand[index], target))
return false;
if(_NTA_SkillDelay[index] > 0)
{
if(NTConfig_AttackSkill[_untimedindex] > 0)
{
var _starttick = GetTickCount();
while(NTA_IsValidTarget(target, true))
{
NTC_DoCast(NTConfig_AttackSkill[_untimedindex], _NTA_SkillHand[_untimedindex], target);
if(GetTickCount()-_starttick >= _NTA_SkillDelay[index])
break;
}
}
else
NTC_Delay(_NTA_SkillDelay[index]);
}
return true;
}
function NTA_MoveCloseInt(target, maxrange)
{
var _dist = GetDistance(me, target);
if(_dist > maxrange)
{
var _destx, _desty;
_destx = me.x + Math.round((_dist-maxrange)*(target.x-me.x) / _dist);
_desty = me.y + Math.round((_dist-maxrange)*(target.y-me.y) / _dist);
return NTM_MoveTo(me.areaid, _destx, _desty, 0);
}
return true;
}
function NTA_SortRoomInt(a, b)
{
if(GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1]))
return -1;
return 1;
}