Code:
#region MortalWound
case 11660:
{
if (CanUseSpell(spell, attacker.Owner))
{
spell.UseStamina = 60;
if (attacker.Stamina < spell.UseStamina)
return;
if (attacked != null)
{
if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
PrepareSpell(spell, attacker.Owner);
suse.MakeConst();
for (uint c = 0; c < 3; c++)
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
if (attacked.EntityFlag == TheOriginals.Game.EntityFlag.Player)
{
damage = (damage * 10) / 100; //kda lma t2lel el 40 ht2l 3nd attack el nas bs el monster htfdl zy mhya
}
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, damage, spell);
suse.Targets.Add(attacked.UID + c, damage);
}
if (attacked.EntityFlag == EntityFlag.Player)
attacked.Owner.SendScreen(suse, true);
else
attacked.MonsterInfo.SendScreen(suse);
}
}
else
{
attacker.AttackPacket = null;
}
}
else
{
if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
if (CanAttack(attacker, attackedsob, spell))
{
PrepareSpell(spell, attacker.Owner);
suse.MakeConst();
for (uint c = 0; c < 3; c++)
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
if (damage > attackedsob.Hitpoints)
damage = attackedsob.Hitpoints;
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.Targets.Add(attackedsob.UID + c, damage);
}
attacker.Owner.SendScreen(suse, true);
}
}
}
}
else
{
attacker.AttackPacket = null;
}
break;
}
#endregion






