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);
            });
        }
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var buff       = ((ObjAIBase)target).AddBuffGameScript("ImpureShotsActive", "ImpureShotsActive", spell, -1, true);
            var visualBuff = ApiFunctionManager.AddBuffHUDVisual("MissFortuneViciousStrikes", 5.0f, 1, owner);

            ApiFunctionManager.CreateTimer(6.0f, () =>
            {
                owner.RemoveBuffGameScript(buff);
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
            });
        }
Exemple #3
0
        public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            var buff       = ((ObjAIBase)target).AddBuffGameScript("TristanaQ", "TristanaQ", spell);
            var visualBuff = ApiFunctionManager.AddBuffHUDVisual("RapidFire", 5.0f, 1, owner);

            ApiFunctionManager.CreateTimer(5.0f, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                owner.RemoveBuffGameScript(buff);
            });
        }
Exemple #4
0
        public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
        {
            float time       = 5;
            var   visualBuff = ApiFunctionManager.AddBuffHUDVisual("ExplosiveShotDebuff", time, 5, (ObjAIBase)target);

            ApiFunctionManager.CreateTimer(time, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
            });
            projectile.setToRemove();
        }
        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);
            });
        }
        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); });
            }
        }
Exemple #7
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!");
        }
Exemple #8
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);
            });
        }
Exemple #9
0
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            ChampionStatModifier statMod = new ChampionStatModifier();

            statMod.MoveSpeed.PercentBonus   -= 30.0f / 100.0f;
            statMod.AttackSpeed.PercentBonus -= 30.0f / 100.0f;
            statMod.Armor.BaseBonus          -= 10;
            statMod.MagicResist.BaseBonus    -= 10;
            target.AddStatModifier(statMod);
            ApiFunctionManager.AddParticleTarget(owner, "Global_SS_Exhaust.troy", target);
            var visualBuff = ApiFunctionManager.AddBuffHUDVisual("SummonerExhaustDebuff", 2.5f, 1, (ObjAIBase)target);

            ApiFunctionManager.CreateTimer(2.5f, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                target.RemoveStatModifier(statMod);
            });
        }
Exemple #10
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 * 1150;
            var trueCoords = current + range;

            spell.AddProjectile("EzrealMysticShotMissile", trueCoords.X, trueCoords.Y);

            var buff       = owner.AddBuffGameScript("Quickdraw", "Quickdraw", spell);
            var visualBuff = ApiFunctionManager.AddBuffHUDVisual("Quickdraw", 6.0f, 0, owner);

            ApiFunctionManager.CreateTimer(6.0f, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                owner.RemoveBuffGameScript(buff);
            });
        }
        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);
            });
        }
Exemple #12
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;
                }
            });
        }
 public void OnUpdate(double diff)
 {
     _currentTime += diff;
     if (_currentTime >= (_lastUpdate + 1000))
     {
         if (_currentStatMod < 70)
         {
             _currentStatMod += 8;
             if (_currentStatMod > 70)
             {
                 _currentStatMod = 70;
             }
             _ownerUnit.RemoveStatModifier(_statMod);
             ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
             _statMod.MoveSpeed.FlatBonus = _currentStatMod;
             _lastUpdate = _currentTime;
             _ownerUnit.AddStatModifier(_statMod);
             _visualBuff = ApiFunctionManager.AddBuffHUDVisual("MissFortuneStrutStacks", 5.0f, (int)_currentStatMod, _ownerUnit, -1);
         }
     }
 }
        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();
        }
        public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
        {
            if (!owner.IsDead)
            {
                return;
            }

            owner.Respawn();

            ChampionStatModifier statMod = new ChampionStatModifier();

            statMod.MoveSpeed.PercentBonus = 125.0f / 100.0f;
            owner.AddStatModifier(statMod);
            ApiFunctionManager.AddParticleTarget(owner, "Global_SS_Revive.troy", owner);
            var visualBuff = ApiFunctionManager.AddBuffHUDVisual("SummonerReviveSpeedBoost", 12.0f, 1, owner);

            ApiFunctionManager.CreateTimer(12.0f, () =>
            {
                ApiFunctionManager.RemoveBuffHUDVisual(visualBuff);
                owner.RemoveStatModifier(statMod);
            });
        }
        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);
                });
            }
        }
Exemple #17
0
 public void OnDeactivate(ObjAIBase unit)
 {
     _ownerUnit.RemoveStatModifier(_statMod);
     ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
 }
 public void OnUpdate(double diff)
 {
     _ownerUnit.RemoveStatModifier(_statMod);
     ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
     _statMod.MoveSpeed.FlatBonus = _currentStatMod;
 }
Exemple #19
0
 public void OnDeactivate(ObjAIBase unit)
 {
     ApiFunctionManager.RemoveBuffHUDVisual(_visualBuff);
 }
Exemple #20
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;
                }
            }
        }