public static void CheckHit(Mobile attacker, Mobile defender, int damage) { if (defender.FindItemOnLayer(Layer.TwoHanded) is BaseShield shield && shield.ArmorAttributes.SoulCharge > 0 && shield.ArmorAttributes.SoulCharge > Utility.Random(100)) { SoulChargeContext sc = GetContextForVictim <SoulChargeContext>(defender); if (sc == null) { AddEffects(sc = new SoulChargeContext(defender, shield)); } sc.OnDamaged(damage); } }
public static void CheckHit(Mobile attacker, Mobile defender, int damage) { BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield; if (shield != null && shield.ArmorAttributes.SoulCharge > 0 && shield.ArmorAttributes.SoulCharge > Utility.Random(100)) { SoulChargeContext sc = PropertyEffect.GetContext <SoulChargeContext>(defender, EffectsType.SoulCharge); if (sc == null) { sc = new SoulChargeContext(defender, shield); } sc.OnDamaged(damage); } }
public static void CheckHit(Mobile attacker, Mobile defender, int damage) { BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield; if (shield != null && shield.ArmorAttributes.SoulCharge > 0 && shield.ArmorAttributes.SoulCharge > Utility.Random(100)) { SoulChargeContext sc = (SoulChargeContext)PropertyEffect.GetContext(defender, EffectsType.SoulCharge); if (sc == null) sc = new SoulChargeContext(defender, shield); sc.OnDamaged(damage); } }