Пример #1
0
        public override bool Apply()
        {
            bool result;

            foreach (FightActor current in base.GetAffectedActors())
            {
                EffectInteger effectInteger = base.GenerateEffect();
                if (effectInteger == null)
                {
                    result = false;
                    return(result);
                }
                FightActor          fightActor         = current;
                SpellReflectionBuff bestReflectionBuff = current.GetBestReflectionBuff();
                if (bestReflectionBuff != null && bestReflectionBuff.ReflectedLevel >= (int)base.Spell.CurrentLevel && base.Spell.Template.Id != 0)
                {
                    this.NotifySpellReflected(current);
                    current.RemoveAndDispellBuff(bestReflectionBuff);
                    fightActor = base.Caster;
                }
                if (this.Effect.Duration > 1)
                {
                    base.AddStatBuff(fightActor, Convert.ToInt16(-effectInteger.Value), PlayerFields.AP, true, 168);
                }
                else
                {
                    fightActor.LostAP(effectInteger.Value);
                }
            }
            result = true;
            return(result);
        }