I am having problem with Triple Attack whenever activates it counts as 3 kills, not just 1, so if my pheasant drops 5 cps, and this skill activates it gives me 15 cps by one hit instead of 5 cps...does anyone see something wrong into this code?
I think the problem is at those 2 red lines I just highlighted...
I think the problem is at those 2 red lines I just highlighted...
Code:
case 10490:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
{
if (attackedsob != null)
{
if (CanAttack(attacker, attackedsob, spell))
{
PrepareSpell(spell, attacker.Owner);
suse.MakeConst();
[B][COLOR="Red"]for (uint c = 0; c < 3; c++)[/COLOR][/B]
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
if (damage > attackedsob.Hitpoints)
damage = attackedsob.Hitpoints;
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.Targets.Add(attackedsob.UID + c, damage);
}
}
}
else
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
PrepareSpell(spell, attacker.Owner);
suse.MakeConst();
[B][COLOR="red"]for (uint c = 0; c < 3; c++)[/COLOR][/B]
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
if (damage > attacked.Hitpoints)
damage = attacked.Hitpoints;
damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
suse.Targets.Add(attacked.UID + c, damage);
}
}
}
}
else
{
attacker.AttackPacket = null;
}
attacker.Owner.Screen.SendScreen(suse, true);
}
break;
}