sahisahi
Member
Im trying to make an axe that deals damage bonus and removes mana from playermobiles with higher eval than 50.0
Right now, the bonus gets applied even if defender have 0 evaluating intelligence. heres the code:
Right now, the bonus gets applied even if defender have 0 evaluating intelligence. heres the code:
Code:
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) //On hit trigger
{
if (defender is PlayerMobile)
{
if (defender.Skills[SkillName.EvalInt].Value >=50.0);
{
if (Utility.RandomDouble() <= 0.42) // 20% chance of scoring a critical hit
{
damageBonus = 1.21;
attacker.SendAsciiMessage(45,"You remove mana from your target!");
defender.SendAsciiMessage(45,"The hit blows your mind!");
attacker.PlaySound( 0x5C6 );
defender.PlaySound( 0x5C6 );
defender.FixedParticles( 0x3709, 1, 30, 0x26ED, 5, 2, EffectLayer.Waist );
defender.FixedParticles( 0x376A, 1, 30, 0x251E, 5, 3, EffectLayer.Waist );
//defender.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
defender.Mana -= 15;
}
else
{
damageBonus = 1.18;
}
}
}
base.OnHit(attacker, defender, damageBonus);
}