01-04-2011, 02:18 PM
schwig84 Wrote:I like her using static field cuz it helps out alot. But if it will help keep me alive i will disable it and see if that helps.
I found some code that might help your problem... but I don't understand any of it so...
Code:
function NTA_SorceressAttackInt(target, firstorder)
{
var _primaryindex;
if(NTTMGR_CheckCurse(NTConfig_CheckSelfSafe&0x10, NTConfig_CheckMercSafe&0x10))
{
if(!NTTMGR_VisitTown())
return 0;
}
if(firstorder && NTConfig_AttackSkill[0] > 0 && NTA_GetResistance(target, _NTA_SkillDamage[0]) < 100 && me.GetSkillStatus(NTConfig_AttackSkill[0]) != 8)
{
if(GetDistance(me, target) > _NTA_SkillRange[0] || !CheckCollision(me, target, 4))
{
var _pos = me.GetOptimalAttackPos(target.areaid, target.x, target.y, _NTA_SkillRange[0], 4);
if(_pos)
NTM_MoveTo(target.areaid, _pos[0], _pos[1], 0);
}
if(!NTC_CastSkill(NTConfig_AttackSkill[0], _NTA_SkillHand[0], target))
return 2;
return 3;
}
if(NTConfig_CastStatic < 100 && parseInt(target.hp*100/target.hpmax) > NTConfig_CastStatic && NTA_GetResistance(target, NTA_DAMAGE_LIGHTNING) <= 80)
{
var _staticlevel = NTC_GetSkillLevel(42);
if(_staticlevel > 0)
{
var _staticrange;
var _castx, _casty;
_staticrange = Math.floor((5+_staticlevel-1)*2/3);
if(GetDistance(me, target) > _staticrange || !CheckCollision(me, target, 6))
{
var _pos = me.GetOptimalAttackPos(target.areaid, target.x, target.y, _staticrange, 6);
if(_pos)
NTM_MoveTo(target.areaid, _pos[0], _pos[1], 0);
}
if(target.x < me.x)
_castx = me.x - 1;
else if(target.x > me.x)
_castx = me.x + 1;
else
_castx = me.x;
if(target.y < me.y)
_casty = me.y - 1;
else if(target.y > me.y)
_casty = me.y + 1;
else
_casty = me.y;
if(!CheckCollision(target.areaid, _castx, _casty, 1))
{
_castx = me.x;
_casty = me.y;
}
if(!NTC_CastSkill(42, NTC_HAND_RIGHT, _castx, _casty))
return 2;
return 3;
}
}
_primaryindex = (target.spectype&0x0A) ? 1 : 3;
if(NTA_GetResistance(target, _NTA_SkillDamage[_primaryindex]) <= 90)
{
if(!NTA_SorceressCastSkillInt(_primaryindex, target))
return 2;
return 3;
}
if(NTConfig_AttackSkill[5] > 0 && NTA_GetResistance(target, _NTA_SkillDamage[5]) <= 80)
{
if(!NTA_SorceressCastSkillInt(5, target))
return 2;
return 3;
}
if(NTA_GetResistance(target, _NTA_SkillDamage[_primaryindex]) < 100 || (_primaryindex == 1 && NTC_GetMerc()))
{
if(!NTA_SorceressCastSkillInt(_primaryindex, target))
return 2;
return 3;
}
return 1;
}
function NTA_SorceressCastSkillInt(index, target)
{
if(me.GetSkillStatus(NTConfig_AttackSkill[index]) != 8)
{
if(GetDistance(me, target) > _NTA_SkillRange[index] || !CheckCollision(me, target, 4))
{
var _pos = me.GetOptimalAttackPos(target.areaid, target.x, target.y, _NTA_SkillRange[index], 4);
if(_pos)
NTM_MoveTo(target.areaid, _pos[0], _pos[1], 0);
}
return NTC_CastSkill(NTConfig_AttackSkill[index], _NTA_SkillHand[index], target);
}
if(NTConfig_AttackSkill[index+1] > 0)
{
if(GetDistance(me, target) > _NTA_SkillRange[index+1] || !CheckCollision(me, target, 4))
{
var _pos = me.GetOptimalAttackPos(target.areaid, target.x, target.y, _NTA_SkillRange[index+1], 4);
if(_pos)
NTM_MoveTo(target.areaid, _pos[0], _pos[1], 0);
}
return NTC_CastSkill(NTConfig_AttackSkill[index+1], _NTA_SkillHand[index+1], target);
}
for(var i = 0 ; i < 25 ; i++)
{
NTC_Delay(NTC_DELAY_FRAME);
if(me.GetSkillStatus(NTConfig_AttackSkill[index]) != 8)
break;
}
return false;
}
It's located in "NT Attack" under "D2NT31_NTBot42\D2NT\scripts\libs\common"
![[Image: nyyzok.gif]](http://i50.tinypic.com/nyyzok.gif)