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);
                }
            }
        }
示例#2
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 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() > 425)
            {
                to = Vector2.Normalize(to);
                var range = to * 425;
                trueCoords = current + range;
            }
            else
            {
                trueCoords = new Vector2(spell.X, spell.Y);
            }

            ApiFunctionManager.AddParticle(owner, "global_ss_flash.troy", owner.X, owner.Y);
            ApiFunctionManager.TeleportTo(owner, trueCoords.X, trueCoords.Y);

            ApiFunctionManager.AddParticleTarget(owner, "global_ss_flash_02.troy", owner);
        }