Ejemplo n.º 1
0
        void StealHp(FightActor target)
        {
            var damage = new Fights.Damage(Dice, GetEffectSchool(Effect.EffectId), Caster, Spell, TargetedCell, EffectZone)
            {
                IsCritical = Critical
            };

            // spell reflected
            var buff = target.GetBestReflectionBuff();

            if (buff != null && buff.ReflectedLevel >= Spell.CurrentLevel && Spell.Template.Id != 0)
            {
                NotifySpellReflected(target);
                damage.Source           = Caster;
                damage.ReflectedDamages = true;
                Caster.InflictDamage(damage);

                if (buff.Duration <= 0)
                {
                    target.RemoveBuff(buff);
                }
            }
            else
            {
                target.InflictDamage(damage);

                var amount = (short)Math.Floor(damage.Amount / 2.0);
                if (amount > 0)
                {
                    Caster.Heal(amount, target, true);
                }
            }
        }