Пример #1
0
        public void ApplyEffects(IObjAiBase owner, IAttackableUnit target, ISpell spell, IProjectile projectile)
        {
            var ap     = owner.Stats.AbilityPower.Total * 0.8f;
            var damage = 45 + spell.Level * 35 + ap;

            if (target != null && !target.IsDead)
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL,
                                  false);
                if (target.IsDead)
                {
                    spell.LowerCooldown(spell.GetCooldown());
                    float manaToRecover = 55 + spell.Level * 5;
                    var   newMana       = owner.Stats.CurrentMana + manaToRecover;
                    var   maxMana       = owner.Stats.ManaPoints.Total;
                    if (newMana >= maxMana)
                    {
                        owner.Stats.CurrentMana = maxMana;
                    }
                    else
                    {
                        owner.Stats.CurrentMana = newMana;
                    }
                }
            }

            projectile.SetToRemove();
        }
Пример #2
0
        public void OnFinishCasting(IChampion owner, ISpell spell, IAttackableUnit target)
        {
            var ap     = owner.Stats.AbilityPower.Total * 0.3f;
            var ad     = owner.Stats.AttackDamage.Total * 0.6f;
            var damage = 40 + spell.Level * 30 + ap + ad;

            foreach (var enemyTarget in GetUnitsInRange(owner, 300, true)
                     .Where(x => x.Team == CustomConvert.GetEnemyTeam(owner.Team)))
            {
                enemyTarget.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL,
                                       false);
                if (target.IsDead)
                {
                    spell.LowerCooldown(spell.CurrentCooldown * 0.6f);
                }
            }
        }