private void OnAttack(DOLEvent e, object sender, EventArgs arguments)
        {
            if (arguments == null)
            {
                return;
            }
            AttackedByEnemyEventArgs args = arguments as AttackedByEnemyEventArgs;

            if (args == null)
            {
                return;
            }
            if (args.AttackData == null)
            {
                return;
            }
            if (!args.AttackData.IsMeleeAttack)
            {
                return;
            }
            //FIXME: [WARN] this has been commented out, it should be handled somewhere
            if (args.AttackData.Attacker.EffectList.GetOfType <ChargeEffect>() != null || args.AttackData.Attacker.TempProperties.getProperty("Charging", false))
            {
                return;
            }
            if (!owner.IsWithinRadius(args.AttackData.Attacker, 300))
            {
                return;
            }
            if (Util.Chance(50))
            {
                RetributionOfTheFaithfulStunEffect effect = new RetributionOfTheFaithfulStunEffect();
                effect.Start(args.AttackData.Attacker);
            }
        }
Ejemplo n.º 2
0
 private void OnAttack(DOLEvent e, object sender, EventArgs arguments)
 {
     if (arguments == null) return;
     AttackedByEnemyEventArgs args = arguments as AttackedByEnemyEventArgs;
     if (args == null) return;
     if (args.AttackData == null) return;
     if (!args.AttackData.IsMeleeAttack) return;
     //FIXME: [WARN] this has been commented out, it should be handled somewhere
     if (args.AttackData.Attacker.EffectList.GetOfType<ChargeEffect>() != null || args.AttackData.Attacker.TempProperties.getProperty("Charging", false))
         return;
     if ( !owner.IsWithinRadius( args.AttackData.Attacker, 300 ) ) return;
     if (Util.Chance(50))
     {
         RetributionOfTheFaithfulStunEffect effect = new RetributionOfTheFaithfulStunEffect();
         effect.Start(args.AttackData.Attacker);
     }
 }