Example #1
0
        public override void OnHit(DamageAction action)
        {
            var chr = action.Attacker as Character;

            if (chr != null)
            {
                if (chr.Group != null)
                {
                    List <Character> origGroup      = new List <Character>(chr.Group.GetAllCharacters());
                    List <Character> scrambledGroup = new List <Character>();

                    Random randNum = new Random();
                    int    i       = -1;
                    foreach (Character groupMember in origGroup)
                    {
                        i++;
                        if (groupMember == chr)
                        {
                            continue;
                        }
                        if (randNum.NextDouble() < (3 - scrambledGroup.Count / origGroup.Count - i))
                        {
                            scrambledGroup.Add(groupMember);
                        }
                    }
                    var effect = SpellHandler.Get(SpellId.DivineStorm_2).GetEffect(SpellEffectType.Heal);
                    foreach (Character target in scrambledGroup)
                    {
                        target.Heal(action.GetDamagePercent(25), chr, effect);
                    }
                }
            }
            base.OnHit(action);
        }
 public override void OnAttack(DamageAction action)
 {
     //if (!action.IsDot)
     {
         var amount = action.GetDamagePercent(EffectValue);
         Owner.Heal(amount, m_aura.CasterUnit, m_spellEffect);
     }
 }
            public override void OnDefend(DamageAction action)
            {
                // absorb EffectValue % from the damage
                var absorbed = Math.Min(action.GetDamagePercent(EffectValue), RemainingValue);

                // RemainingValue corresponds to AMZ's health, when it reaches 0, AMZ will be destroyed
                RemainingValue = action.Absorb(absorbed, (DamageSchoolMask)m_spellEffect.MiscValue);
            }
            public override void OnAttack(DamageAction action)
            {
                var attacker = action.Attacker;                         // same as Owner
                var victim   = action.Victim;
                var dmg      = action.GetDamagePercent(EffectValue);

                victim.AddMessage(() => victim.DealSpellDamage(attacker, m_spellEffect, dmg, false, false));                    // may not crit
            }
Example #5
0
 public override void OnAttack(DamageAction action)
 {
     if (action.IsMagic)
     {
         // "Increases damage of all spells against targets with less than 35% health by $s1%."
         if (action.Victim.HealthPct <= 35)
         {
             action.Damage += action.GetDamagePercent(EffectValue);
         }
     }
 }
 public override void OnAttack(DamageAction action)
 {
     Owner.Heal(action.GetDamagePercent(EffectValue), m_aura.CasterUnit, m_spellEffect);
 }