I Have Shit Bug At This SKill I try Alot to fix it but i fail
[Only registered and activated users can see links. Click Here To Register...]
and this Skill Code
the Bug sometimes the skill out other way i turn (sory for bad english)
[Only registered and activated users can see links. Click Here To Register...]
and this Skill Code
Code:
//Radiant Palm
case 10381:
// case 10315:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
Game.Attacking.InLineAlgorithm ila = new Conquer_Online_Server.Game.Attacking.InLineAlgorithm(attacker.X,
X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = SpellID;
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
suse.X = X;
suse.Y = Y;
for (int c = 0; c < attacker.Owner.Screen.Objects.Length; c++)
{
//For a multi threaded application, while we go through the collection
//the collection might change. We will make sure that we wont go off
//the limits with a check.
if (c >= attacker.Owner.Screen.Objects.Length)
break;
Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
if (_obj == null)
continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
attacked = _obj as Entity;
if (ila.InLine(attacked.X, attacked.Y))
{
if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
continue;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
attack.Damage = damage;
// damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
ReceiveAttack( attacker, attacked, attack, damage, spell);
suse.Targets.Add(attacked.UID, damage);
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (ila.InLine(attackedsob.X, attackedsob.Y))
{
if (!CanAttack(attacker, attackedsob, spell))
continue;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
damage = (uint)(damage * spell.PowerPercent);
attack.Damage = damage;
ReceiveAttack( attacker, attackedsob, attack, damage, spell);
suse.Targets.Add(attackedsob.UID, damage);
}
}
}
attacker.Owner.SendScreen(suse, true);
}
attacker.AttackPacket = null;
break;
}