Beispiel #1
0
        private static void SyndraE(
            Obj_AI_Base sender,
            GameObjectProcessSpellCastEventArgs args,
            SpellData data,
            SpellArgs spellArgs)
        {
            if (!data.MenuName.StartsWith("SyndraE"))
            {
                return;
            }

            SpellDetector.AddSpell(sender, sender.ServerPosition, args.End, data);
            var spell =
                Evade.DetectedSpells.Values.FirstOrDefault(
                    i => i.Data.MenuName == data.MenuName && i.Unit.CompareId(sender));
            SpellData eqData;

            if (spell != null && Evade.OnProcessSpells.TryGetValue("SyndraEQ", out eqData))
            {
                var cone =
                    new Polygons.Cone(
                        spell.Cone.Center,
                        spell.Cone.Direction,
                        spell.Data.RawRadius + 30,
                        spell.Data.RawRange + 200).ToPolygon();
                var orbs =
                    Evade.DetectedSpells.Values.Where(
                        i =>
                        i.Data.MenuName == "SyndraQ" && i.Unit.CompareId(spell.Unit) &&
                        Utils.GameTimeTickCount - i.StartTick < 400).Select(i => i.End).ToList();
                orbs.AddRange(
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(
                        i =>
                        i.IsValid() && !i.IsDead && i.CharData.BaseSkinName == "syndrasphere" &&
                        i.Team == sender.Team)
                    .Select(i => i.ServerPosition.To2D()));

                foreach (var orb in orbs.Where(i => !cone.IsOutside(i)))
                {
                    var startPos = orb.Extend(spell.Start, 100);
                    var endPos   = spell.Start.Extend(orb, spell.Start.Distance(orb) > 200 ? 1300 : 1100);
                    var startT   = spell.StartTick + data.Delay
                                   + (int)(spell.Start.Distance(orb) / data.MissileSpeed * 1000);
                    SpellDetector.AddSpell(sender, startPos, endPos, eqData, null, SpellType.None, true, startT);
                }
            }

            spellArgs.NoProcess = true;
        }
Beispiel #2
0
        public SpellInstance(
            SpellData data,
            int startT,
            int endT,
            Vector2 start,
            Vector2 end,
            Obj_AI_Base unit,
            SpellType type)
        {
            this.Data      = data;
            this.StartTick = startT;
            this.EndTick   = this.StartTick + endT;
            this.Start     = start;
            this.End       = end;
            this.Direction = (end - start).Normalized();
            this.Unit      = unit;
            this.Type      = type;
            this.Radius    = this.GetRadius;

            switch (this.Type)
            {
            case SpellType.Line:
            case SpellType.MissileLine:
                this.Line = new Polygons.Line(this.Start, this.End, this.Radius);
                break;

            case SpellType.Cone:
            case SpellType.MissileCone:
                this.Cone = new Polygons.Cone(this.Start, this.Direction, this.Radius, data.Range);
                break;

            case SpellType.Circle:
                this.Circle = new Polygons.Circle(this.End, this.Radius);
                break;

            case SpellType.Ring:
                this.Ring = new Polygons.Ring(this.End, data.RadiusEx, this.Radius);
                break;

            case SpellType.Arc:
                this.Arc = new Polygons.Arc(this.Start, this.End, this.Radius);
                break;
            }

            this.UpdatePolygon();
        }