public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var      visualBuff = ApiFunctionManager.AddBuffHUDVisual("SummonerDot", 5.0f, 1, (ObjAIBase)target);
            Particle p          = ApiFunctionManager.AddParticleTarget(owner, "Global_SS_Ignite.troy", target, 1);
            var      damage     = 10 + owner.GetStats().Level * 4;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL, false);
            ApiFunctionManager.CreateTimer(1.0f,
                                           () =>
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL,
                                  false);
            });
            ApiFunctionManager.CreateTimer(2.0f,
                                           () =>
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL,
                                  false);
            });
            ApiFunctionManager.CreateTimer(3.0f,
                                           () =>
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL,
                                  false);
            });
            ApiFunctionManager.CreateTimer(4.0f, () =>
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL, false);
                ApiFunctionManager.RemoveParticle(p);
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
            });
        }
Пример #2
0
 public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
 {
     ApiFunctionManager.CreateTimer(1.0f, () => {
         var ap     = owner.GetStats().AbilityPower.Total * 0.2f;
         var damage = 7 + spell.Level * 9 + ap;
         target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
     });
     ApiFunctionManager.CreateTimer(2.0f, () => {
         var ap     = owner.GetStats().AbilityPower.Total * 0.2f;
         var damage = 7 + spell.Level * 9 + ap;
         target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
     });
     ApiFunctionManager.CreateTimer(3.0f, () => {
         var ap     = owner.GetStats().AbilityPower.Total * 0.2f;
         var damage = 7 + spell.Level * 9 + ap;
         target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
     });
     ApiFunctionManager.CreateTimer(4.0f, () => {
         var ap     = owner.GetStats().AbilityPower.Total * 0.2f;
         var damage = 7 + spell.Level * 9 + ap;
         target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
     });
     ApiFunctionManager.CreateTimer(5.0f, () => {
         var ap     = owner.GetStats().AbilityPower.Total * 0.2f;
         var damage = 7 + spell.Level * 9 + ap;
         target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
     });
 }
Пример #3
0
        /// <summary>
        /// This is called by the AA projectile when it hits its target
        /// </summary>
        public virtual void AutoAttackHit(AttackableUnit target)
        {
            if (HasCrowdControl(CrowdControlType.BLIND))
            {
                target.TakeDamage(this, 0, DamageType.DAMAGE_TYPE_PHYSICAL,
                                  DamageSource.DAMAGE_SOURCE_ATTACK,
                                  DamageText.DAMAGE_TEXT_MISS);
                return;
            }

            var damage = Stats.AttackDamage.Total;

            if (_isNextAutoCrit)
            {
                damage *= Stats.CriticalDamage.Total;
            }

            var onAutoAttack = _scriptEngine.GetStaticMethod <Action <AttackableUnit, AttackableUnit> >(Model, "Passive", "OnAutoAttack");

            onAutoAttack?.Invoke(this, target);

            target.TakeDamage(this, damage, DamageType.DAMAGE_TYPE_PHYSICAL,
                              DamageSource.DAMAGE_SOURCE_ATTACK,
                              _isNextAutoCrit);
        }
Пример #4
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var ad = (owner.GetStats().AttackDamage.Total - owner.GetStats().AttackDamage.BaseValue) * 0.5f;
            var ap = owner.GetStats().AbilityPower.Total * 0.5f;

            var damage = ((new float[] { 35, 55, 75, 95, 115 }[spell.Level - 1]) + ad + ap) / 2;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);

            RavageBuff = owner.AddBuffGameScript("EveRavage", "EveRavage", spell, 3.0f, true);
        }
Пример #5
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var ap     = owner.GetStats().AbilityPower.Total * 0.8f;
            var damage = 45 + spell.Level * 35 + ap;

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

            projectile.setToRemove();
        }
        public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            ApiFunctionManager.AddParticleTarget(owner, "Global_SS_Smite.troy", target, 1);
            var damage = 370 + owner.GetStats().Level * 20;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL, false);
        }
Пример #7
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var isCrit     = new Random().Next(0, 100) < owner.GetStats().CriticalChance.Total;
            var baseDamage = new[] { 20, 45, 70, 95, 120 }[spell.Level - 1] +owner.GetStats().AttackDamage.Total;
            var damage     = isCrit ? baseDamage * owner.GetStats().getCritDamagePct() / 100 : baseDamage;
            var goldIncome = new[] { 4, 5, 6, 7, 8 }[spell.Level - 1];

            if (target != null && !target.IsDead)
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK,
                                  false);
                if (target.IsDead)
                {
                    owner.GetStats().Gold += goldIncome;
                    var manaCost           = new float[] { 50, 55, 60, 65, 70 }[spell.Level - 1];
                    var newMana            = owner.GetStats().CurrentMana + manaCost / 2;
                    var maxMana            = owner.GetStats().ManaPoints.Total;
                    if (newMana >= maxMana)
                    {
                        owner.GetStats().CurrentMana = maxMana;
                    }
                    else
                    {
                        owner.GetStats().CurrentMana = newMana;
                    }
                }

                projectile.setToRemove();
            }
        }
Пример #8
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var bonusAD = owner.GetStats().AttackDamage.Total - owner.GetStats().AttackDamage.BaseValue;
            var ad      = bonusAD * 0.150f;
            var damage  = new[] { 60, 95, 130, 165, 200 }[spell.Level - 1] +ad;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
        }
Пример #9
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var ad     = owner.GetStats().AttackDamage.Total * 0.85f;
            var ap     = owner.GetStats().AbilityPower.Total * 0.35f;
            var damage = ((new float[] { 20f, 35f, 50f, 65f, 80f })[spell.Level - 1]) + ad + ap;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK, false);
            projectile.setToRemove();
        }
Пример #10
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var reduc      = Math.Min(projectile.ObjectsHit.Count, 5);
            var baseDamage = new[] { 20, 60, 100, 140, 180 }[spell.Level - 1] +
            1.3f * owner.GetStats().AttackDamage.Total;
            var damage = baseDamage * (1 - reduc / 10);

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
        }
Пример #11
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            ApiFunctionManager.AddParticleTarget(owner, "olaf_axeThrow_tar.troy", target, 1);
            var ad     = owner.GetStats().AttackDamage.Total * 1.1f;
            var ap     = owner.GetStats().AttackDamage.Total * 0.0f;
            var damage = 15 + spell.Level * 20 + ad + ap;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK, false);
        }
Пример #12
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var reduc   = Math.Min(projectile.ObjectsHit.Count, 7);
            var bonusAd = owner.GetStats().AttackDamage.Total - owner.GetStats().AttackDamage.BaseValue;
            var ap      = owner.GetStats().AbilityPower.Total * 0.9f;
            var damage  = 200 + spell.Level * 150 + bonusAd + ap;

            target.TakeDamage(owner, damage * (1 - reduc / 10), DamageType.DAMAGE_TYPE_MAGICAL,
                              DamageSource.DAMAGE_SOURCE_SPELL, false);
        }
Пример #13
0
 public override void AutoAttackHit(AttackableUnit target)
 {
     if (Type == TurretType.FOUNTAIN_TURRET)
     {
         target.TakeDamage(this, 1000, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_ATTACK, false);
     }
     else
     {
         base.AutoAttackHit(target);
     }
 }
Пример #14
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            if (target != null && !target.IsDead)
            {
                // 250/475/700
                var damage = 250 + owner.GetStats().AttackDamage.Total * 2;
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL,
                                  false);
            }

            projectile.setToRemove();
        }
Пример #15
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var ap     = owner.GetStats().AbilityPower.Total * 0.8f;
            var damage = 80 + (spell.Level - 1) * 50 + ap;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
            var slowDuration = new[] { 0, 1, 1.25f, 1.5f, 1.75f, 2 }[spell.Level];

            ApiFunctionManager.AddBuff("Slow", slowDuration, 1, (ObjAIBase)target, owner);
            ApiFunctionManager.AddParticleTarget(owner, "caitlyn_entrapment_tar.troy", target);
            ApiFunctionManager.AddParticleTarget(owner, "caitlyn_entrapment_slow.troy", target);
            projectile.setToRemove();
        }
Пример #16
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var ad     = owner.GetStats().AttackDamage.Total * 1.1f;
            var ap     = owner.GetStats().AbilityPower.Total * 0.4f;
            var damage = 15 + spell.Level * 20 + ad + ap;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK, false);
            spell.LowerCooldown(0, 1);
            spell.LowerCooldown(1, 1);
            spell.LowerCooldown(2, 1);
            spell.LowerCooldown(3, 1);
            projectile.setToRemove();
        }
Пример #17
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var ap     = owner.GetStats().AbilityPower.Total * 0.7f;
            var damage = 30 + spell.Level * 50 + ap;

            if (target != null && !ApiFunctionManager.IsDead(target))
            {
                target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL,
                                  false);
                if (target.IsDead)
                {
                }
            }

            projectile.setToRemove();
        }
Пример #18
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            var ap     = owner.GetStats().AbilityPower.Total * 0.8f;
            var damage = 35 + spell.Level * 45 + ap;

            target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
            float time       = 1.25f + 0.25f * spell.Level;
            var   buff       = ((ObjAIBase)target).AddBuffGameScript("Blind", "Blind", spell);
            var   visualBuff = ApiFunctionManager.AddBuffHUDVisual("Blind", time, 1, (ObjAIBase)target);

            ApiFunctionManager.CreateTimer(time, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                ((ObjAIBase)target).RemoveBuffGameScript(buff);
            });
        }
Пример #19
0
        private void ApplySpinDamage(Champion owner, Spell spell, AttackableUnit target)
        {
            List <AttackableUnit> units = ApiFunctionManager.GetUnitsInRange(owner, 500, true);

            foreach (AttackableUnit unit in units)
            {
                if (unit.Team != owner.Team)
                {
                    //PHYSICAL DAMAGE PER SECOND: 20 / 45 / 70 / 95 / 120 (+ 70 / 80 / 90 / 100 / 110% AD)
                    float ad = new[] { .7f, .8f, .9f, 1f, 1.1f }[spell.Level - 1] *owner.GetStats().AttackDamage.Total *
                    0.5f;
                    float damage = new[] { 20, 45, 70, 95, 120 }[spell.Level - 1] *0.5f + ad;
                    if (unit is Minion)
                    {
                        damage *= 0.75f;
                    }
                    target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL,
                                      false);
                }
            }
        }
Пример #20
0
 public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
 {
     target.TakeDamage(owner, 25f + spell.Level * 50f + owner.GetStats().AbilityPower.Total * 0.75f,
                       DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
     projectile.setToRemove();
 }