I'm Using this code for twofold blades ( Credits to TeroareBoss )Quote:
else if (SU.Info.ID == 6000)
{
try
{
if (GC.MyChar.EntityID != Target)
{
if (Game.World.H_Chars.ContainsKey(Target))
{
Game.Character Player = (Game.Character)Game.World.H_Chars[Target];
if (GC.MyChar.PKAble(GC.MyChar.PKMode, Player))
{
if (Player != GC.MyChar)
{
//int Dst = 0;
if ((Player.Loc.X - GC.MyChar.Loc.X) <= 1 || (Player.Loc.Y - GC.MyChar.Loc.Y) <= 1 || (GC.MyChar.Loc.X - Player.Loc.X) <= 1 || (GC.MyChar.Loc.Y - Player.Loc.Y) <= 1)
//if (MyMath.PointDistance(Player.Loc.X, Player.Loc.Y, x, y) <= Dst)
{
if (!Game.World.H_NPCs.Contains(Target))
{
SU.GetTargets(Target);
SU.Use();
}
}
}
}
}
else if (!Game.World.H_NPCs.Contains(Target))
{
SU.GetTargets(Target);
SU.Use();
GC.MyChar.AddSkillExp(SU.Info.ID, 100);
}
}
}
catch { }
}
If I'm out of the range typed in this codes . it takes stamina but it does not attack the player.. how can i make it to dooesn't take any stamina if im out of range?