Exemplo n.º 1
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            Target  ZoneCenter;
            Vector2 ownerLocation  = new Vector2(owner.X, owner.Y);
            Vector2 targetLocation = new Vector2(spell.X, spell.Y);
            var     spellData      = spell.SpellData;
            float   distance       = Vector2.Distance(ownerLocation, targetLocation);

            if (distance > spellData.CastRange[0])
            {
                var to         = Vector2.Normalize(targetLocation - ownerLocation);
                var range      = to * 650;
                var trueCoords = ownerLocation + range;

                ZoneCenter = new Target(trueCoords.X, trueCoords.Y);
            }
            else
            {
                ZoneCenter = new Target(spell.X, spell.Y);
            }

            Particle p = ApiFunctionManager.AddParticleTarget(owner, "Evelynn_R_cas.troy", ZoneCenter);

            spell.spellAnimation("SPELL4", owner);

            List <AttackableUnit> units = ApiFunctionManager.GetUnitsInRange(ZoneCenter, 250, true);
            var ap = owner.GetStats().AbilityPower.Total * 0.01f;
            var percentHealthDamage = ((new float[] { 0.15f, 0.20f, 0.25f })[spell.Level]) + ap;
            var damage        = 0.0f;
            var monsterDamage = 0.0f;

            foreach (AttackableUnit unit in units)
            {
                if (unit.Team != owner.Team)
                {
                    if (unit is Champion || unit is Minion)
                    {
                        damage = unit.GetStats().CurrentHealth *percentHealthDamage;
                        unit.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
                    }
                    else if (unit is Monster)
                    {
                        damage        = unit.GetStats().CurrentHealth *percentHealthDamage;
                        monsterDamage = Math.Max(damage, 1000);
                        unit.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
                    }
                }
            }

            //TODO:Give evelynn her shield per champion hit.

            ApiFunctionManager.CreateTimer(2.0f, () =>
            {
                ApiFunctionManager.RemoveParticle(p);
            });
        }
Exemplo n.º 2
0
        public void DamageTargetsInZone(Champion owner, Spell spell, AttackableUnit target, Target ZoneCenter)
        {
            List <AttackableUnit> units = ApiFunctionManager.GetUnitsInRange(ZoneCenter, 500, true);
            var ap     = owner.GetStats().AbilityPower.Total * 0.1f;
            var damage = ((new float[] { 11.25f, 18.125f, 25f, 31.875f, 38.75f })[spell.Level - 1]) + ap;

            foreach (AttackableUnit unit in units)
            {
                if (unit.Team != owner.Team)
                {
                    if (unit is Champion || unit is Minion || unit is Monster)
                    {
                        unit.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var     current = new Vector2(owner.X, owner.Y);
            var     to      = new Vector2(spell.X, spell.Y) - current;
            Vector2 trueCoords;

            if (to.Length() > 475)
            {
                to = Vector2.Normalize(to);
                var range = to * 475;
                trueCoords = current + range;
            }
            else
            {
                trueCoords = new Vector2(spell.X, spell.Y);
            }

            ApiFunctionManager.AddParticle(owner, "Ezreal_arcaneshift_cas.troy", owner.X, owner.Y);
            ApiFunctionManager.TeleportTo(owner, trueCoords.X, trueCoords.Y);
            ApiFunctionManager.AddParticleTarget(owner, "Ezreal_arcaneshift_flash.troy", owner);
            AttackableUnit target2 = null;
            var            units   = ApiFunctionManager.GetUnitsInRange(owner, 700, true);

            foreach (var value in units)
            {
                float distance = 700;
                if (owner.Team != value.Team)
                {
                    if (Vector2.Distance(new Vector2(trueCoords.X, trueCoords.Y), new Vector2(value.X, value.Y)) <=
                        distance)
                    {
                        target2  = value;
                        distance = Vector2.Distance(new Vector2(trueCoords.X, trueCoords.Y),
                                                    new Vector2(value.X, value.Y));
                    }
                }
            }

            if (target2 != null)
            {
                if (!ApiFunctionManager.UnitIsTurret(target2))
                {
                    spell.AddProjectileTarget("EzrealArcaneShiftMissile", target2);
                }
            }
        }
Exemplo n.º 4
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);
                }
            }
        }