Beispiel #1
0
        public static void ApplyArmorBuff(TriggerBuff buff, FightActor triggerer, BuffTriggerType trigger, object token)
        {
            var damage = token as Fights.Damage;

            if (damage == null)
            {
                return;
            }

            var integerEffect = buff.GenerateEffect();

            if (integerEffect == null)
            {
                return;
            }

            var target = buff.Target;

            if (target is SummonedBomb)
            {
                target = ((SummonedBomb)target).Summoner;
            }

            var reduction    = target.CalculateArmorValue(integerEffect.Value);
            var dmgReduction = Math.Min(damage.Amount, target.CalculateArmorValue(integerEffect.Value));

            ActionsHandler.SendGameActionFightReduceDamagesMessage(target.Fight.Clients, damage.Source, target, reduction);
            damage.Amount -= dmgReduction;
        }
Beispiel #2
0
        private static void HealBuffTrigger(TriggerBuff buff, BuffTriggerType trigger, object token)
        {
            EffectInteger effectInteger = buff.GenerateEffect();

            if (!(effectInteger == null))
            {
                buff.Target.Heal((int)effectInteger.Value, buff.Caster, true);
            }
        }
        public static void ApplyArmorBuff(TriggerBuff buff, BuffTriggerType trigger, object token)
        {
            EffectInteger effectInteger = buff.GenerateEffect();

            if (!(effectInteger == null))
            {
                buff.Target.DamageMultiplicator = effectInteger.Value / 100;
            }
        }
Beispiel #4
0
        public static void BuffHandler(TriggerBuff buff, BuffTriggerType type, object token)
        {
            EffectInteger effectInteger = buff.GenerateEffect();

            if (!(effectInteger == null))
            {
                int      id       = buff.Target.PopNextBuffId();
                StatBuff statBuff = new StatBuff(id, buff.Target, buff.Caster, buff.Effect, buff.Spell, effectInteger.Value, PlayerFields.AP, false, false);
                buff.Target.AddAndApplyBuff(statBuff, true);
            }
        }
Beispiel #5
0
        public static void RemoveArmorBuff(TriggerBuff buff)
        {
            EffectInteger effectInteger = buff.GenerateEffect();

            if (!(effectInteger == null))
            {
                foreach (PlayerFields current in DamageArmor.GetAssociatedCaracteristics(buff.Spell.Id))
                {
                    buff.Target.Stats[current].Context -= buff.Target.CalculateArmorValue((int)effectInteger.Value);
                }
            }
        }
Beispiel #6
0
        private static void HealBuffTrigger(TriggerBuff buff, FightActor triggerrer, BuffTriggerType trigger, object token)
        {
            var integerEffect = buff.GenerateEffect();

            if (integerEffect == null)
            {
                return;
            }

            if (buff.Target.IsAlive())
            {
                buff.Target.Heal(integerEffect.Value, buff.Caster);
            }
        }
        private static void DamageBuffTrigger(TriggerBuff buff, BuffTriggerType trigger, object token)
        {
            EffectInteger left = buff.GenerateEffect();

            if (!(left == null))
            {
                Fights.Damage damage = new Fights.Damage(buff.Dice, DamagePercent.GetEffectSchool(buff.Dice.EffectId), buff.Caster, buff.Spell)
                {
                    Buff = buff
                };
                damage.GenerateDamages();
                damage.Amount            = (int)((double)buff.Target.MaxLifePoints * ((double)damage.Amount / 100.0));
                damage.IgnoreDamageBoost = true;
                buff.Target.InflictDamage(damage);
            }
        }