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);
            });
        }
Exemplo n.º 2
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 * 800;
                var trueCoords = ownerLocation + range;
                ZoneCenter = new Target(trueCoords.X, trueCoords.Y);
            }
            else
            {
                ZoneCenter = new Target(spell.X, spell.Y);
            }
            Particle p = ApiFunctionManager.AddParticleTarget(owner, "missFortune_makeItRain_incoming.troy", ZoneCenter);

            for (byte i = 0; i < 8; ++i)
            {
                ApiFunctionManager.CreateTimer(0.25f * i, () =>
                {
                    DamageTargetsInZone(owner, spell, target, ZoneCenter);
                });
            }
            ApiFunctionManager.CreateTimer(2.0f, () =>
            {
                ApiFunctionManager.RemoveParticle(p);
            });
        }
Exemplo n.º 3
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.º 4
0
        public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            Particle p          = ApiFunctionManager.AddParticleTarget(owner, "Overdrive_buf.troy", target, 1);
            var      buff       = ((ObjAIBase)target).AddBuffGameScript("Overdrive", "Overdrive", spell);
            var      visualBuff = ApiFunctionManager.AddBuffHUDVisual("Overdrive", 8.0f, 1, owner);

            ApiFunctionManager.CreateTimer(8.0f, () =>
            {
                ApiFunctionManager.RemoveParticle(p);
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                ((ObjAIBase)target).RemoveBuffGameScript(buff);
            });
        }
Exemplo n.º 5
0
        public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            Particle p          = ApiFunctionManager.AddParticleTarget(owner, "Garen_Base_E_Spin.troy", owner, 1);
            var      visualBuff = ApiFunctionManager.AddBuffHUDVisual("GarenE", 3.0f, 1, owner);

            ApiFunctionManager.CreateTimer(3.0f, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                ApiFunctionManager.RemoveParticle(p);
            });
            for (float i = 0.0f; i < 3.0; i += 0.5f)
            {
                ApiFunctionManager.CreateTimer(i, () => { ApplySpinDamage(owner, spell, target); });
            }
        }
Exemplo n.º 6
0
        public override void TakeDamage(AttackableUnit attacker, float damage, DamageType type, DamageSource source, bool isCrit)
        {
            base.TakeDamage(attacker, damage, type, source, isCrit);

            _championHitFlagTimer = 15 * 1000; //15 seconds timer, so when you get executed the last enemy champion who hit you gets the gold
            _playerHitId          = NetId;

            if (IsRecalling)
            {
                ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
                ApiFunctionManager.RemoveParticle(_addParticle);
                IsRecalling = false;
            }
            _canRecall = false;
            //CORE_INFO("15 second execution timer on you. Do not get killed by a minion, turret or monster!");
        }
Exemplo n.º 7
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var current    = new Vector2(owner.X, owner.Y);
            var to         = Vector2.Normalize(new Vector2(spell.X, spell.Y) - current);
            var range      = to * 425;
            var trueCoords = current + range;

            ApiFunctionManager.DashToLocation(owner, trueCoords.X, trueCoords.Y, 1200, false, "Spell3");
            Particle p          = ApiFunctionManager.AddParticleTarget(owner, "Graves_Move_OnBuffActivate.troy", owner);
            var      visualBuff = ApiFunctionManager.AddBuffHUDVisual("GravesSteroid", 5.0f, 90, owner);
            var      buff       = owner.AddBuffGameScript("Quickdraw", "Quickdraw", spell, -1, true);

            ApiFunctionManager.CreateTimer(4.0f, () =>
            {
                ApiFunctionManager.RemoveParticle(p);
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                owner.RemoveBuffGameScript(buff);
            });
        }
Exemplo n.º 8
0
        public void Recall(ObjAIBase owner, float timer = 8.0f)
        {
            var spawnPos = GetRespawnPosition();

            IsRecalling  = true;
            _visualBuff  = ApiFunctionManager.AddBuffHUDVisual("Recall", timer, 1, this);
            _addParticle = ApiFunctionManager.AddParticleTarget(this, "TeleportHome.troy", this);
            _canRecall   = true;

            ApiFunctionManager.CreateTimer(timer, () =>
            {
                if (_canRecall)
                {
                    ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
                    ApiFunctionManager.RemoveParticle(_addParticle);
                    ApiFunctionManager.TeleportTo(owner, spawnPos.X, spawnPos.Y);
                    IsRecalling = false;
                }
            });
        }
Exemplo n.º 9
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            Champion champion   = (Champion)target;
            float    time       = 1 + 0.25f * spell.Level;
            var      buff       = ((ObjAIBase)target).AddBuffGameScript("LuluWDebuff", "LuluWDebuff", spell);
            var      visualBuff = ApiFunctionManager.AddBuffHUDVisual("LuluWDebuff", time, 1, (ObjAIBase)target);
            string   model      = champion.Model;

            ChangeModel(owner.Skin, target);

            Particle p = ApiFunctionManager.AddParticleTarget(owner, "Lulu_W_polymorph_01.troy", target, 1);

            ApiFunctionManager.CreateTimer(time, () =>
            {
                ApiFunctionManager.RemoveParticle(p);
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                owner.RemoveBuffGameScript(buff);
                ApiFunctionManager.SetChampionModel((Champion)target, model);
            });
            projectile.setToRemove();
        }
Exemplo n.º 10
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            Champion champion = (Champion)target;

            if (champion.Team != owner.Team)
            {
                spell.AddProjectileTarget("LuluWTwo", target);
            }
            else
            {
                Particle p = ApiFunctionManager.AddParticleTarget(owner, "Lulu_W_buf_02.troy", target, 1);
                ApiFunctionManager.AddParticleTarget(owner, "Lulu_W_buf_01.troy", target, 1);
                float time       = 2.5f + 0.5f * spell.Level;
                var   buff       = ((ObjAIBase)target).AddBuffGameScript("LuluWBuff", "LuluWBuff", spell);
                var   visualBuff = ApiFunctionManager.AddBuffHUDVisual("LuluWBuff", time, 1, (ObjAIBase)target);
                ApiFunctionManager.CreateTimer(time, () =>
                {
                    ApiFunctionManager.RemoveParticle(p);
                    ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                    owner.RemoveBuffGameScript(buff);
                });
            }
        }
Exemplo n.º 11
0
        public override void update(float diff)
        {
            base.update(diff);

            if (this.isMovementUpdated())
            {
                if (IsRecalling)
                {
                    ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
                    ApiFunctionManager.RemoveParticle(_addParticle);
                    IsRecalling = false;
                }
                _canRecall = false;
            }

            if (!IsDead && MoveOrder == MoveOrder.MOVE_ORDER_ATTACKMOVE && TargetUnit != null)
            {
                var            objects          = _game.ObjectManager.GetObjects();
                var            distanceToTarget = 9000000.0f;
                AttackableUnit nextTarget       = null;
                var            range            = Math.Max(Stats.Range.Total, DETECT_RANGE);

                foreach (var it in objects)
                {
                    var u = it.Value as AttackableUnit;

                    if (u == null || u.IsDead || u.Team == Team || GetDistanceTo(u) > range)
                    {
                        continue;
                    }

                    if (GetDistanceTo(u) < distanceToTarget)
                    {
                        distanceToTarget = GetDistanceTo(u);
                        nextTarget       = u;
                    }
                }

                if (nextTarget != null)
                {
                    TargetUnit = nextTarget;
                    _game.PacketNotifier.NotifySetTarget(this, nextTarget);
                }
            }

            if (!Stats.IsGeneratingGold() && _game.GameTime >= _game.Map.MapGameScript.FirstGoldTime)
            {
                Stats.SetGeneratingGold(true);
                _logger.LogCoreInfo("Generating Gold!");
            }

            if (RespawnTimer > 0)
            {
                RespawnTimer -= diff;
                if (RespawnTimer <= 0)
                {
                    Respawn();
                }
            }

            var isLevelup = LevelUp();

            if (isLevelup)
            {
                _game.PacketNotifier.NotifyLevelUp(this);
                _game.PacketNotifier.NotifyUpdatedStats(this, false);
            }

            foreach (var s in Spells.Values)
            {
                s.update(diff);
            }

            if (_championHitFlagTimer > 0)
            {
                _championHitFlagTimer -= diff;
                if (_championHitFlagTimer <= 0)
                {
                    _championHitFlagTimer = 0;
                }
            }
        }