كود:
case 10381:
{
//if (CanUseSpell(spell, attacker.Owner) && Time32.Now > attacker.SpellStamp.AddMilliseconds(500))
{
attacker.SpellStamp = Time32.Now;
ushort Xx, Yx;
if (attacked != null)
{
Xx = attacked.X;
Yx = attacked.Y;
}
else
{
Xx = attackedsob.X;
Yx = attackedsob.Y;
}
if (Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= 7)
{
if (attackedsob == null)
if (attacked.ContainsFlag(Update.Flags.Fly))
return;
if (attacker.ContainsFlag(Update.Flags.Fly))
return;
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
attacker.Stamina -= spell.UseStamina;
suse.Attacker = attacker.UID;
// attacker.Stamina -= 9;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
bool send = false;
if (attackedsob == null)
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, client_Spell.LevelHu2);
damage = (uint)(damage * 1.4);
suse.Effect1 = attack.Effect1;
//double dmg = (double)damage * 0.9;
//damage = (uint)dmg;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
send = true;
}
}
else
{
if (CanAttack(attacker, attackedsob, spell))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = (uint)(damage * 180 / 100);
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.Effect1 = attack.Effect1;
suse.AddTarget(attackedsob, damage, attack);
send = true;
}
}
if (send)
attacker.Owner.SendScreen(suse, true);
}
else
{
attacker.AttackPacket = null;
}
}
break;
}