Esempio n. 1
0
        private double GetHeroLevelDiff(GameObjectTeam team)
        {
            int maxAllies       = 0;
            int maxEnemies      = 0;
            int sumLevelAllies  = 0;
            int sumLevelEnemies = 0;

            foreach (Obj_AI_Hero hero in heroes)
            {
                if (team == hero.Team)
                {
                    maxAllies++;
                    sumLevelAllies += hero.Level;
                }
                else
                {
                    maxEnemies++;
                    sumLevelEnemies += hero.Level;
                }
            }

            double leveldiff = (maxAllies > 0 ? sumLevelAllies / maxAllies : 0) - (maxEnemies > 0 ? sumLevelEnemies / maxEnemies : 0);

            return(Math.Min(Math.Max(leveldiff, -3), 3));
        }
Esempio n. 2
0
            public Ward(AIHeroClient caster, Obj_AI_Base handle, Vector3 position, IWard wardInfo, int duration, GameObjectTeam team)
            {
                // Initialize properties
                Caster       = caster;
                Handle       = handle;
                FakePosition = position;
                Team         = team;
                WardInfo     = wardInfo;
                Duration     = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new Sprite(() => MinimapIconTexture);
                TextHandle    = new Text(string.Empty, new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));

                // Notify player about placement
                if (!MasterMind.IsSpectatorMode && Team.IsEnemy() &&
                    (Player.Instance.IsInRange(Position, NotifyRange.CurrentValue) || Player.Instance.IsInRange(position, NotifyRange.CurrentValue)))
                {
                    if (NotifyPlace.CurrentValue)
                    {
                        Notifications.Show(new SimpleNotification("A ward has been placed!",
                                                                  string.Format("{0} has placed a {1}", caster != null ? caster.ChampionName : "Unknown", WardInfo.FriendlyName)));
                    }
                    if (NotifyPlacePing.CurrentValue)
                    {
                        TacticalMap.ShowPing(PingCategory.Normal, Position, true);
                    }
                }
            }
Esempio n. 3
0
        public static IEnumerable <Obj_AI_Base> GetMobGroup(this LeagueSharp.Common.Spell spell,
                                                            FarmMode farmMode,
                                                            GameObjectTeam minionTeam,
                                                            MinionType minionType   = MinionType.All,
                                                            MinionGroup minionGroup = MinionGroup.Alone,
                                                            int minionCount         = 1)
        {
            IEnumerable <Obj_AI_Base> list =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(m => m.LSIsValidTarget(spell.Range) && m.Team == GameObjectTeam.Neutral);

            if (minionType == MinionType.BigMobs)
            {
                IEnumerable <Obj_AI_Base> oMob = (from fMobs in list
                                                  from fBigBoys in
                                                  new[]
                {
                    "SRU_Blue", "SRU_Gromp", "SRU_Murkwolf", "SRU_Razorbeak", "SRU_Red",
                    "SRU_Krug", "SRU_Dragon", "SRU_Baron", "Sru_Crab"
                }
                                                  where fBigBoys == fMobs.BaseSkinName
                                                  select fMobs).AsEnumerable();
                list = oMob;
            }
            return(list);
        }
Esempio n. 4
0
        IEnumerable <Obj_AI_Base> IValue <IEnumerable <Obj_AI_Base> > .GetValue(LeagueSharp.Common.Spell spell, FarmMode farmMode,
                                                                                GameObjectTeam minionTeam, MinionType minionType)
        {
            IEnumerable <Obj_AI_Base> list = ObjectManager.Get <Obj_AI_Minion>().Where(m => m.LSIsValidTarget(spell.Range));
            IEnumerable <Obj_AI_Base> mobs;

            if (farmMode == FarmMode.JungleClear)
            {
                mobs = list.Where(w => w.Team == minionTeam);
                if (minionType == MinionType.BigMobs)
                {
                    IEnumerable <Obj_AI_Base> oMob = (from fMobs in mobs
                                                      from fBigBoys in
                                                      new[]
                    {
                        "SRU_Blue", "SRU_Gromp", "SRU_Murkwolf", "SRU_Razorbeak", "SRU_Red",
                        "SRU_Krug", "SRU_Dragon", "SRU_Baron", "Sru_Crab"
                    }
                                                      where fBigBoys == fMobs.BaseSkinName
                                                      select fMobs).AsEnumerable();

                    mobs = oMob;
                }
            }
            else
            {
                mobs = list;
            }
            return(mobs);
        }
Esempio n. 5
0
 public Camp(string name,
             float spawnTime,
             int respawnTimer,
             Vector3 position,
             List <Mob> mobs,
             Utility.Map.MapType mapType,
             GameObjectTeam team,
             Color colour,
             Timers timer,
             bool isRanged         = false,
             int state             = 0,
             int respawnTime       = 0,
             int lastChangeOnState = 0)
 {
     Name              = name;
     SpawnTime         = spawnTime;
     RespawnTimer      = respawnTimer;
     Position          = position;
     MinimapPosition   = Drawing.WorldToMinimap(Position);
     Mobs              = mobs;
     MapType           = mapType;
     Team              = team;
     Colour            = colour;
     IsRanged          = isRanged;
     State             = state;
     RespawnTime       = respawnTime;
     LastChangeOnState = lastChangeOnState;
     Timer             = timer;
 }
Esempio n. 6
0
        public void InitializeComponent()
        {
            // Initialize texture references
            MasterMind.TextureLoader.Load(Resources.CooldownTracker, out _overlayRef);

            // Initialize menu
            Menu = MasterMind.Menu.AddSubMenu("Cooldown Tracker", longTitle: "Spell Cooldown Tracker");

            Menu.AddGroupLabel("Information");
            Menu.AddLabel("A spell cooldown tracker helps you in various ways ingame.");
            Menu.AddLabel("It lets you visually see the remaining time the spells are on cooldown.");
            Menu.AddLabel(string.Format("You can enable cooldown tracking for both, {0} and {1}.",
                MasterMind.IsSpectatorMode ? "blue" : "allies", MasterMind.IsSpectatorMode ? "red team" : "enemies"));
            Menu.AddSeparator();

            TrackAllies = Menu.Add("allies", new CheckBox(string.Format("Track {0}", MasterMind.IsSpectatorMode ? "blue team" : "allies")));
            TrackEnemies = Menu.Add("enemies", new CheckBox(string.Format("Track {0}", MasterMind.IsSpectatorMode ? "red team" : "enemies")));
            DrawText = Menu.Add("cooldownText", new CheckBox("Draw cooldown time below spell indicator"));

            // Initialize properties
            OverlaySprite = new EloBuddy.SDK.Rendering.Sprite(() => OverlayTextre);
            SpellCooldownText = new Text(string.Empty, new System.Drawing.Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular))
            {
                Color = Color.GhostWhite
            };

            AlliedTeam = GameObjectTeam.Order;
            if (!MasterMind.IsSpectatorMode)
            {
                AlliedTeam = Player.Instance.Team;
            }

            // Listen to required events
            Drawing.OnEndScene += OnDraw;
        }
Esempio n. 7
0
 //abstract stuff
 protected Camp(byte campID,Vector3 pos, GameObjectTeam team)
 {
     campId = campID;
     campPosition = pos;
     side = team;
     State = JungleCampState.Unknown;
 }
Esempio n. 8
0
        /// <summary>
        /// Returns a polygon containing the lane itself.
        /// </summary>
        /// <param name="team">The team.</param>
        /// <param name="lane">The lane.</param>
        /// <returns>A polygon containing the lane itself.</returns>
        public static Geometry.Polygon GetLanePolygon(GameObjectTeam team, Lane lane)
        {
            switch (team)
            {
            case GameObjectTeam.Order:
            {
                return(_teamOrderLaneZones.FirstOrDefault(entry => entry.Key == lane).Value);
            }

            case GameObjectTeam.Chaos:
            {
                return(_teamChaosLaneZones.FirstOrDefault(entry => entry.Key == lane).Value);
            }

            case GameObjectTeam.Neutral:
            {
                return(_teamNeutralLaneZones.FirstOrDefault(entry => entry.Key == lane).Value);
            }

            default:
            {
                return(null);
            }
            }
        }
Esempio n. 9
0
File: Camp.cs Progetto: betw01/detu
        //abstract stuff

        protected Camp(byte campID, Vector3 pos, GameObjectTeam team)
        {
            campId       = campID;
            campPosition = pos;
            side         = team;
            State        = JungleCampState.Unknown;
        }
Esempio n. 10
0
        public static string GetTurretName(GameObjectTeam team, Lane?lane = null, int?number = null)
        {
            var result = TurretBaseName;

            result += team == GameObjectTeam.Order ? "_T1" : "_T2";
            result += GetTurretLaneNaming(lane);
            result += number != null ? "_" + number : "";
            return(result);
        }
Esempio n. 11
0
 public PostBasicAttackArgs(Obj_AI_Base sender, GameObject target, Vector3 startPosition, Vector3 endPosition, int networkId, GameObjectTeam team)
 {
     Sender        = sender;
     Target        = target;
     StartPosition = startPosition;
     EndPosition   = endPosition;
     NetworkId     = networkId;
     Team          = team;
 }
Esempio n. 12
0
 public Ward(int snid, Vector3 pos, string wt, GameObjectTeam st, float e, int hp, int duration)
 {
     this.SenderNetworkID = snid;
     this.TimeExpires     = e;
     this.Position        = pos;
     this.WardType        = wt;
     this.SenderTeam      = st;
     this.Health          = hp;
     this.Duration        = duration;
 }
Esempio n. 13
0
        public static bool IsInFountain(Vector3 position, GameObjectTeam team)
        {
            float fountainRange = 1050;

            if (Game.MapId == GameMapId.SummonersRift)
            {
                Vector3 vec3 = (team == GameObjectTeam.Order) ? new Vector3(363, 426, 182) : new Vector3(14340, 14390, 172);
                return(position.IsInRange(vec3, fountainRange));
            }
            return(false);
        }
Esempio n. 14
0
        public static bool IsInFountain(Vector3 position, GameObjectTeam team)
        {
            float fountainRange = 1050;

            if (Game.MapId == GameMapId.SummonersRift)
            {
                Vector3 vec3 = (team == GameObjectTeam.Order) ? new Vector3(363, 426, 182) : new Vector3(14340, 14390, 172);
                return position.IsInRange(vec3, fountainRange);
            }
            return false;
        }
Esempio n. 15
0
        public JungleCamp(Vector3 position, uint respawnTime, string[] names, GameObjectTeam team = GameObjectTeam.Neutral, bool childrenMobs = true)
        {
            this.Position     = position;
            this.RespawnTime  = respawnTime;
            this.Names        = names;
            this.Team         = team;
            this.ChildrenMobs = childrenMobs;

            this.ObjectsAlive = new List <string>();
            this.ObjectsDead  = new List <string>();
        }
Esempio n. 16
0
        public JungleCamp(int respawnTime, Vector3 position, string[] mobNames, GameMapId mapID, GameObjectTeam team)
        {
            RespawnTime = respawnTime;
            Position    = position;
            MobNames    = mobNames;
            MapID       = mapID;
            Team        = team;

            ObjectsDead  = new List <string>();
            ObjectsAlive = new List <string>();
        }
Esempio n. 17
0
 public Camp(float spawnTime,
             float respawnTime,
             Vector3 position,
             List <Data.Jungle.Mob> mobs,
             bool isBig,
             LeagueSharp.Common.Utility.Map.MapType mapType,
             GameObjectTeam team,
             bool dead = false) : base(spawnTime, respawnTime, position, mobs, isBig, mapType, team)
 {
     Dead = dead;
     Mobs = mobs.Select(mob => new Mob(mob.Name)).ToList();
 }
Esempio n. 18
0
 public JungleCamp(String name, GameObjectTeam team, int campId, int spawnTime, int respawnTime,
                   Utility.Map.MapType mapType, Vector3 mapPosition, Vector3 minimapPosition, JungleMob[] creeps)
 {
     Name            = name;
     Team            = team;
     CampId          = campId;
     SpawnTime       = spawnTime;
     RespawnTime     = respawnTime;
     MapType         = mapType;
     MapPosition     = mapPosition;
     MinimapPosition = minimapPosition;
     Creeps          = creeps;
     NextRespawnTime = 0;
     Called          = false;
     Dead            = false;
     Visible         = false;
     TextMinimap     = new Render.Text(0, 0, "", Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue <Slider>().Value, new ColorBGRA(Color4.White));
     Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").ValueChanged += JungleCamp_ValueChanged;
     TextMinimap.TextUpdate = delegate
     {
         return((NextRespawnTime - (int)Game.ClockTime).ToString());
     };
     TextMinimap.PositionUpdate = delegate
     {
         Vector2 sPos = Drawing.WorldToMinimap(MinimapPosition);
         return(new Vector2(sPos.X, sPos.Y));
     };
     TextMinimap.VisibleCondition = sender =>
     {
         return(Timer.Timers.GetActive() && JungleTimer.GetActive() && NextRespawnTime > 0 && MapType == GMap.Type);
     };
     TextMinimap.OutLined = true;
     TextMinimap.Centered = true;
     TextMinimap.Add();
     TextMap            = new Render.Text(0, 0, "", (int)(Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue <Slider>().Value * 3.5), new ColorBGRA(Color4.White));
     TextMap.TextUpdate = delegate
     {
         return((NextRespawnTime - (int)Game.ClockTime).ToString());
     };
     TextMap.PositionUpdate = delegate
     {
         Vector2 sPos = Drawing.WorldToScreen(MapPosition);
         return(new Vector2(sPos.X, sPos.Y));
     };
     TextMap.VisibleCondition = sender =>
     {
         return(Timer.Timers.GetActive() && JungleTimer.GetActive() && NextRespawnTime > 0 && MapType == GMap.Type);
     };
     TextMap.OutLined = true;
     TextMap.Centered = true;
     TextMap.Add();
 }
Esempio n. 19
0
 public JungleCamps(String name, GameObjectTeam team, int campID, int spawnTime, int respawnTime, int mapID, Vector3 mapPosition, Vector3 minimapPosition, JungleMobs[] creeps)
 {
     this.name            = name;
     this.team            = team;
     this.campID          = campID;
     this.spawnTime       = spawnTime;
     this.respawnTime     = respawnTime;
     this.mapID           = mapID;
     this.mapPosition     = mapPosition;
     this.minimapPosition = minimapPosition;
     this.creeps          = creeps;
     nextRespawnTime      = 0;
 }
Esempio n. 20
0
 public RelicObject(string name, String objectName, GameObjectTeam team, Obj_AI_Minion obj, int spawnTime,
                    int respawnTime, Vector3 mapPosition, Vector3 minimapPosition)
 {
     Name            = name;
     ObjectName      = objectName;
     Team            = team;
     Obj             = obj;
     SpawnTime       = spawnTime;
     RespawnTime     = respawnTime;
     Locked          = false;
     MapPosition     = mapPosition;
     MinimapPosition = minimapPosition;
     MapType         = Utility.Map.MapType.CrystalScar;
     NextRespawnTime = 0;
     Called          = false;
     TextMinimap     = new Render.Text(0, 0, "", Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue <Slider>().Value, new ColorBGRA(Color4.White));
     Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").ValueChanged += RelicObject_ValueChanged;
     TextMinimap.TextUpdate = delegate
     {
         return((NextRespawnTime - (int)Game.ClockTime).ToString());
     };
     TextMinimap.PositionUpdate = delegate
     {
         Vector2 sPos = Drawing.WorldToMinimap(MinimapPosition);
         return(new Vector2(sPos.X, sPos.Y));
     };
     TextMinimap.VisibleCondition = sender =>
     {
         return(Timer.Timers.GetActive() && RelicTimer.GetActive() && NextRespawnTime > 0 && MapType == GMap.Type);
     };
     TextMinimap.OutLined = true;
     TextMinimap.Centered = true;
     TextMinimap.Add();
     TextMap            = new Render.Text(0, 0, "", (int)(Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue <Slider>().Value * 3.5), new ColorBGRA(Color4.White));
     TextMap.TextUpdate = delegate
     {
         return((NextRespawnTime - (int)Game.ClockTime).ToString());
     };
     TextMap.PositionUpdate = delegate
     {
         Vector2 sPos = Drawing.WorldToScreen(MapPosition);
         return(new Vector2(sPos.X, sPos.Y));
     };
     TextMap.VisibleCondition = sender =>
     {
         return(Timer.Timers.GetActive() && RelicTimer.GetActive() && NextRespawnTime > 0 && MapType == GMap.Type);
     };
     TextMap.OutLined = true;
     TextMap.Centered = true;
     TextMap.Add();
 }
Esempio n. 21
0
#pragma warning restore 649
#pragma warning restore 169

        #endregion

        #region Constructors and Destructors

        /// <summary>
        ///     Initializes static members of the <see cref="ObjectCache" /> class
        /// </summary>
        static ObjectCache()
        {
            GameObjectList    = ObjectManager.Get <GameObject>().ToList();
            Obj_AI_MinionList = GameObjectList.OfType <Obj_AI_Minion>().ToList();

            FieldData = new Dictionary <string, FieldInfo>(10)
            {
                { "GameObjectList", GetField("GameObjectList") },
                { "Obj_AI_MinionList", GetField("Obj_AI_MinionList") }
            };

            Minions = Obj_AI_MinionList.FindAll(minion =>
            {
                var type = minion.GetMinionType();
                return(type.HasFlag(MinionTypes.Melee) || type.HasFlag(MinionTypes.Ranged));
            });
            Pets          = Obj_AI_MinionList.FindAll(minion => minion.IsPet());
            Wards         = Obj_AI_MinionList.FindAll(minion => minion.GetMinionType().HasFlag(MinionTypes.Ward));
            JungleMinions = Obj_AI_MinionList.FindAll(minion => minion.GetJungleType() != JungleType.Unknown);
            OtherMinions  = Obj_AI_MinionList.FindAll(o => o.GetMinionType().HasFlag(MinionTypes.Unknown) && o.GetJungleType() == JungleType.Unknown && !o.IsPet());

            Player = (Obj_AI_Hero)GameObjectList.Single(o => o.IsMe);

            AlliedTeam = Player.Team;

            TeamDictionary = new Dictionary <ObjectTeam, GameObjectTeam>(4)
            {
                { ObjectTeam.Ally, AlliedTeam },
                {
                    ObjectTeam.Enemy,
                    AlliedTeam == GameObjectTeam.Order ? GameObjectTeam.Chaos : GameObjectTeam.Order
                },
                { ObjectTeam.Neutral, GameObjectTeam.Neutral },
                { ObjectTeam.Unknown, GameObjectTeam.Unknown }
            };

            // I don't find OnDelete too reliable when it comes to keeping the lists tidy so I'll additionally go for OnUpdate
            Game.OnUpdate += delegate
            {
                int index;

                while ((index = GameObjectList.FindIndex(o => o == null || !o.IsValid)) >= 0)
                {
                    Process(GameObjectList[index], false);
                }
            };

            GameObject.OnCreate += (sender, args) => Process(sender, true);
            GameObject.OnDelete += (sender, args) => Process(sender, false);
        }
Esempio n. 22
0
 public Camp(float spawnTime,
             float respawnTime,
             Vector3 position,
             List <Data.Jungle.Mob> mobs,
             bool isBig,
             MapType mapType,
             GameObjectTeam team,
             string name,
             bool dead    = false,
             bool noticed = false) : base(spawnTime, respawnTime, position, mobs, isBig, mapType, team, name)
 {
     Dead    = dead;
     Noticed = noticed;
     Mobs    = mobs.Select(mob => new Mob(mob.Name)).ToList();
 }
Esempio n. 23
0
        public Mobs(
            int respawnTime,
            Vector3 position,
            string[] mobNames,
            GameMapId MapID,
            GameObjectTeam team)
        {
            this.RespawnTime = respawnTime;
            this.Position    = position;
            this.MobNames    = mobNames;
            this.MapID       = MapID;
            this.Team        = team;

            this.ObjectsDead  = new List <string>();
            this.ObjectsAlive = new List <string>();
        }
Esempio n. 24
0
 private static Vector3 GetHomePos(GameObjectTeam team)
 {
     if (team == GameObjectTeam.Order) // Blue Team
     {
         return(new Vector3(396f, 462f, 182.1325f));
     }
     else if (team == GameObjectTeam.Chaos) // Red Team
     {
         return(new Vector3(14340f, 14390f, 171.9777f));
     }
     else
     {
         Game.PrintChat("Unknown Team : " + team.ToString());
         return(new Vector3());
     }
 }
Esempio n. 25
0
 public Gromp(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId = campID;
     side = team;
     Minions = new List<JungleMinion>
     {
         get_SRU_Gromp(1)
     };
     SpawnTime = TimeSpan.FromSeconds(115);
     RespawnTimer = TimeSpan.FromSeconds(100);
     bonusPrioLowLvl = -50;
     bonusPrio = -20;
     onRespawn();
     worthSmiting = true;
 }
Esempio n. 26
0
File: Gromp.cs Progetto: betw01/detu
 public Gromp(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId  = campID;
     side    = team;
     Minions = new List <JungleMinion>
     {
         get_SRU_Gromp(1)
     };
     SpawnTime       = TimeSpan.FromSeconds(115);
     RespawnTimer    = TimeSpan.FromSeconds(100);
     bonusPrioLowLvl = 4;
     bonusPrio       = 3;
     onRespawn();
     worthSmiting = true;
 }
Esempio n. 27
0
 public Senitels(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId  = campID;
     side    = team;
     Minions = new List <JungleMinion>
     {
         get_SRU_Blue(1),
         get_SRU_BlueMini(2),
         get_SRU_BlueMini(3, true),
     };
     SpawnTime    = TimeSpan.FromSeconds(115);
     RespawnTimer = TimeSpan.FromSeconds(300);
     useOverTime  = false;
     onRespawn();
 }
Esempio n. 28
0
            /// <summary>
            ///     Initializes a new instance of the <see cref="JungleCamp" /> class.
            /// </summary>
            /// <param name="respawnTime">The respawn time.</param>
            /// <param name="position">The position.</param>
            /// <param name="mobNames">The mob names.</param>
            /// <param name="mapType">Type of the map.</param>
            /// <param name="team">The team.</param>
            public JungleCamp(
                int respawnTime,
                Vector3 position,
                string[] mobNames,
                LeagueSharp.Common.Utility.Map.MapType mapType,
                GameObjectTeam team)
            {
                this.RespawnTime = respawnTime;
                this.Position    = position;
                this.MobNames    = mobNames;
                this.MapType     = mapType;
                this.Team        = team;

                this.ObjectsDead  = new List <string>();
                this.ObjectsAlive = new List <string>();
            }
Esempio n. 29
0
 public Senitels(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId = campID;
     side = team;
     Minions = new List<JungleMinion>
     {
         get_SRU_Blue(1),
         get_SRU_BlueMini(2),
         get_SRU_BlueMini(3,true),
     };
     SpawnTime = TimeSpan.FromSeconds(115);
     RespawnTimer = TimeSpan.FromSeconds(300);
     useOverTime = false;
     onRespawn();
 }
Esempio n. 30
0
        public static int CountEnemies(Vector3 from, float Range, GameObjectTeam team)
        {
            int Counter = 0;
            List<Obj_AI_Hero> Enemies = null;
            Enemies = ObjectHandler.Get<Obj_AI_Hero>().Where(t => t.IsEnemy && !t.IsDead).ToList();

            foreach (Obj_AI_Hero hero in Enemies)
            {
                if (from.Distance(hero.Position) < Range)
                {
                    Counter++;
                }
            }

            return Counter;
        }
Esempio n. 31
0
        public Mobs(
                int respawnTime,
                Vector3 position,
                string[] mobNames,
                GameMapId MapID,
                GameObjectTeam team)
        {
            this.RespawnTime = respawnTime;
            this.Position = position;
            this.MobNames = mobNames;
            this.MapID = MapID;
            this.Team = team;

            this.ObjectsDead = new List<string>();
            this.ObjectsAlive = new List<string>();
        }
Esempio n. 32
0
 public Camp(float spawnTime,
             float respawnTime,
             Vector3 position,
             List <Mob> mobs,
             bool isBig,
             Utility.Map.MapType mapType,
             GameObjectTeam team)
 {
     SpawnTime       = spawnTime;
     RespawnTime     = respawnTime;
     Position        = position;
     MinimapPosition = Drawing.WorldToMinimap(Position);
     Mobs            = mobs;
     IsBig           = isBig;
     MapType         = mapType;
     Team            = team;
 }
Esempio n. 33
0
 public Raptors(byte campID, Vector3 pos, GameObjectTeam team) : base(campID, pos, team)
 {
     campId  = campID;
     side    = team;
     Minions = new List <JungleMinion>
     {
         get_SRU_Razorbeak(1),
         get_SRU_RazorbeakMini(2),
         get_SRU_RazorbeakMini(3),
         get_SRU_RazorbeakMini(4)
     };
     SpawnTime       = TimeSpan.FromSeconds(115);
     RespawnTimer    = TimeSpan.FromSeconds(100);
     bonusPrioLowLvl = -5;
     onRespawn();
     worthSmiting = false;
 }
Esempio n. 34
0
        public static int CountMinions(Vector3 from, float Range, GameObjectTeam team)
        {
            int Counter = 0;
            List<Obj_AI_Minion> Minions = null;

            Minions = GetMinions(ENEMY_TEAM);

            foreach (Obj_AI_Minion minion in Minions)
            {
                if (from.Distance(minion.Position) < Range && !minion.IsDead)
                {
                    Counter++;
                }
            }

            return Counter;
        }
Esempio n. 35
0
 public RedBrambleback(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId  = campID;
     side    = team;
     Minions = new List <JungleMinion>
     {
         get_SRU_Red(1),
         get_SRU_RedMini(2),
         get_SRU_RedMini(3),
     };
     SpawnTime       = TimeSpan.FromSeconds(115);
     RespawnTimer    = TimeSpan.FromSeconds(300);
     useOverTime     = false;
     bonusPrioLowLvl = -1;
     onRespawn();
 }
        public bool IsValidTeam(GameObjectTeam team)
        {
            if (team == GameObjectTeam.Unknown)
                return true;

            switch (TeamDetect)
            {
                case DetectionTeam.AllyTeam:
                    return team == Utils.PlayerTeam();
                case DetectionTeam.EnemyTeam:
                    return team != Utils.PlayerTeam();
                case DetectionTeam.AnyTeam:
                    return true;
            }

            return false;
        }
Esempio n. 37
0
 public Camp(float spawnTime,
             float respawnTime,
             Vector3 position,
             List <Mob> mobs,
             bool isBig,
             GameObjectTeam team,
             bool dead = false)
 {
     SpawnTime       = spawnTime;
     RespawnTime     = respawnTime;
     Position        = position;
     MinimapPosition = position.ToMiniMapPosition();
     Mobs            = mobs;
     IsBig           = isBig;
     Team            = team;
     Dead            = dead;
 }
Esempio n. 38
0
 public Dragon(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId  = campID;
     side    = team;
     Minions = new List <JungleMinion>
     {
         get_SRU_Dragon(1)
     };
     SpawnTime       = TimeSpan.FromSeconds(150);
     RespawnTimer    = TimeSpan.FromSeconds(360);
     bonusPrioLowLvl = -5;
     bonusPrio      += 5;
     onRespawn();
     worthSmiting = false;
     isDrag       = true;
 }
Esempio n. 39
0
            /// <summary>
            /// Initializes a new instance of the <see cref="JungleCamp" /> class.
            /// </summary>
            /// <param name="respawnTime">The respawn time.</param>
            /// <param name="position">The position.</param>
            /// <param name="mobNames">The mob names.</param>
            /// <param name="mapType">Type of the map.</param>
            /// <param name="team">The team.</param>
            /// <param name="mobsAreChildren">if set to <c>true</c> the mob names need to be dead to respawn.</param>
            public JungleCamp(
                int respawnTime,
                Vector3 position,
                string[] mobNames,
                Utility.Map.MapType mapType,
                GameObjectTeam team, bool mobsAreChildren = true)
            {
                this.RespawnTime     = respawnTime;
                this.Position        = position;
                this.MobNames        = mobNames;
                this.MapType         = mapType;
                this.Team            = team;
                this.MobsAreChildren = mobsAreChildren;

                this.ObjectsDead  = new List <string>();
                this.ObjectsAlive = new List <string>();
            }
Esempio n. 40
0
 public Dragon(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId = campID;
     side = team;
     Minions = new List<JungleMinion>
     {
         get_SRU_Dragon(1)
     };
     SpawnTime = TimeSpan.FromSeconds(150);
     RespawnTimer = TimeSpan.FromSeconds(360);
     bonusPrioLowLvl = -5;
     bonusPrio += 5;
     onRespawn();
     worthSmiting = false;
     isDrag = true;
 }
Esempio n. 41
0
 public RedBrambleback(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId = campID;
     side = team;
     Minions = new List<JungleMinion>
     {
         get_SRU_Red(1),
         get_SRU_RedMini(2),
         get_SRU_RedMini(3),
     };
     SpawnTime = TimeSpan.FromSeconds(115);
     RespawnTimer = TimeSpan.FromSeconds(300);
     useOverTime = false;
     bonusPrioLowLvl = -1;
     onRespawn();
 }
Esempio n. 42
0
 public Raptors(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId = campID;
     side = team;
     Minions = new List<JungleMinion>
     {
         get_SRU_Razorbeak(1),
         get_SRU_RazorbeakMini(2),
         get_SRU_RazorbeakMini(3),
         get_SRU_RazorbeakMini(4)
     };
     SpawnTime = TimeSpan.FromSeconds(115);
     RespawnTimer = TimeSpan.FromSeconds(100);
     bonusPrioLowLvl = -5;
     onRespawn();
     worthSmiting = false;
 }
Esempio n. 43
0
 public MurkWolfs(byte campID, Vector3 pos, GameObjectTeam team)
     : base(campID, pos, team)
 {
     campId = campID;
     side = team;
     Minions = new List<JungleMinion>
     {
         get_SRU_Murkwofl(1),
         get_SRU_MurkwoflMini(2),
         get_SRU_MurkwoflMini(3),
     };
     SpawnTime = TimeSpan.FromSeconds(115);
     RespawnTimer = TimeSpan.FromSeconds(100);
     bonusPrioLowLvl = 3;
     onRespawn();
     worthSmiting = false;
     useOverTime = true;
 }
Esempio n. 44
0
 public Camp(string name,
     float spawnTime,
     int respawnTimer,
     Vector3 position,
     List<Mob> mobs,
     Utility.Map.MapType mapType,
     GameObjectTeam team,
     Color colour,
     Timers timer,
     bool isRanged = false,
     bool isDead = false,
     int state = 0,
     int respawnTime = 0,
     int lastChangeOnState = 0,
     bool shouldping = true,
     int lastPing = 0)
 {
     Name = name;
     IsDead = isDead;
     SpawnTime = spawnTime;
     RespawnTimer = respawnTimer;
     Position = position;
     ScreenPosition = Drawing.WorldToScreen(Position);
     MinimapPosition = Drawing.WorldToMinimap(Position);
     Mobs = mobs;
     MapType = mapType;
     Team = team;
     Colour = colour;
     IsRanged = isRanged;
     State = state;
     RespawnTime = respawnTime;
     LastChangeOnState = lastChangeOnState;
     Timer = timer;
     ShouldPing = shouldping;
     LastPing = lastPing;
 }
Esempio n. 45
0
 public Camp(float spawnTime,
     float respawnTime,
     Vector3 position,
     List<Mob> mobs,
     bool isBig,
     Utility.Map.MapType mapType,
     GameObjectTeam team)
 {
     SpawnTime = spawnTime;
     RespawnTime = respawnTime;
     Position = position;
     MinimapPosition = Drawing.WorldToMinimap(Position);
     Mobs = mobs;
     IsBig = isBig;
     MapType = mapType;
     Team = team;
 }
Esempio n. 46
0
 private static Obj_AI_Turret GetCloseTower(Obj_AI_Hero target, GameObjectTeam team)
 {
     List<Obj_AI_Turret> towerList = GetTowers(myHero.Team);
     Obj_AI_Turret[] towers = towerList.ToArray<Obj_AI_Turret>();
     if (towers != null)
     {
         Obj_AI_Turret candidate = towerList[1];
         int count = towers.Length;
         for (var i = 2; i < count; i++)
         {
             if (towers[i].Health / towers[i].MaxHealth > 0.1 && myHero.Distance(candidate) > myHero.Distance(towers[i]))
             {
                 candidate = towers[i];
             }
         }
         return candidate;
     }
     return null;
 }
Esempio n. 47
0
 public JungleCamp(String name, GameObjectTeam team, int campId, int spawnTime, int respawnTime,
     Utility.Map.MapType mapType, Vector3 mapPosition, Vector3 minimapPosition, JungleMob[] creeps)
 {
     Name = name;
     Team = team;
     CampId = campId;
     SpawnTime = spawnTime;
     RespawnTime = respawnTime;
     MapType = mapType;
     MapPosition = mapPosition;
     MinimapPosition = minimapPosition;
     Creeps = creeps;
     NextRespawnTime = 0;
     Called = false;
     Dead = false;
     Visible = false;
     TextMinimap = new Render.Text(0, 0, "", Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue<Slider>().Value, new ColorBGRA(Color4.White));
     Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").ValueChanged += JungleCamp_ValueChanged;
     TextMinimap.TextUpdate = delegate
     {
         return (NextRespawnTime - (int)Game.ClockTime).ToString();
     };
     TextMinimap.PositionUpdate = delegate
     {
         Vector2 sPos = Drawing.WorldToMinimap(MinimapPosition);
         return new Vector2(sPos.X, sPos.Y);
     };
     TextMinimap.VisibleCondition = sender =>
     {
         return IsActive() && NextRespawnTime > 0 && MapType == GMap.Type;
     };
     TextMinimap.OutLined = true;
     TextMinimap.Centered = true;
     TextMinimap.Add();
     TextMap = new Render.Text(0, 0, "", (int)(Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue<Slider>().Value * 3.5), new ColorBGRA(Color4.White));
     TextMap.TextUpdate = delegate
     {
         return (NextRespawnTime - (int)Game.ClockTime).ToString();
     };
     TextMap.PositionUpdate = delegate
     {
         Vector2 sPos = Drawing.WorldToScreen(MapPosition);
         return new Vector2(sPos.X, sPos.Y);
     };
     TextMap.VisibleCondition = sender =>
     {
         return IsActive() && NextRespawnTime > 0 && MapType == GMap.Type;
     };
     TextMap.OutLined = true;
     TextMap.Centered = true;
     TextMap.Add();
 }
Esempio n. 48
0
 public static Geometry.Polygon GetLastTurretInLanePolygon(GameObjectTeam team, Lane lane)
 {
     var turret = Turrets.GetTurretsPosition(team, lane);
     return new Geometry.Circle(turret.LastOrDefault(), 850).ToPolygon();
 }
Esempio n. 49
0
 public static IEnumerable<Obj_AI_Turret> GetTurrets(GameObjectTeam team, Lane lane)
 {
     switch (team)
     {
         case GameObjectTeam.Order:
         {
             switch (lane)
             {
                 case Lane.Base:
                 {
                     return
                         GameObjects.Turrets.Where(
                             turret =>
                                 orderBase.Any(
                                     orderBaseTurretPosition =>
                                         orderBaseTurretPosition.Distance(turret.Position) < 250));
                 }
                 case Lane.Bot:
                 {
                     return GameObjects.Turrets.Where(
                         turret =>
                             orderBot.Any(
                                 orderBotTurretPosition => orderBotTurretPosition.Distance(turret.Position) < 250));
                 }
                 case Lane.Mid:
                 {
                     return GameObjects.Turrets.Where(
                         turret =>
                             orderMid.Any(
                                 orderMidPosition => orderMidPosition.Distance(turret.Position) < 250));
                 }
                 case Lane.Top:
                 {
                     return GameObjects.Turrets.Where(
                         turret =>
                             orderTop.Any(
                                 orderTopTurretPosition => orderTopTurretPosition.Distance(turret.Position) < 250));
                 }
             }
             break;
         }
         case GameObjectTeam.Chaos:
         {
             switch (lane)
             {
                 case Lane.Base:
                 {
                     return
                         GameObjects.Turrets.Where(
                             turret =>
                                 chaosBase.Any(
                                     chaosBaseTurretPosition =>
                                         chaosBaseTurretPosition.Distance(turret.Position) < 250));
                 }
                 case Lane.Bot:
                 {
                     return GameObjects.Turrets.Where(
                         turret =>
                             chaosBot.Any(
                                 chaosBotTurretPosition => chaosBotTurretPosition.Distance(turret.Position) < 250));
                 }
                 case Lane.Mid:
                 {
                     return GameObjects.Turrets.Where(
                         turret =>
                             chaosMid.Any(
                                 chaosMidPosition => chaosMidPosition.Distance(turret.Position) < 250));
                 }
                 case Lane.Top:
                 {
                     return GameObjects.Turrets.Where(
                         turret =>
                             chaosTop.Any(
                                 chaosTopTurretPosition => chaosTopTurretPosition.Distance(turret.Position) < 250));
                 }
             }
             break;
         }
         default:
             return GameObjects.AllyTurrets;
     }
     return GameObjects.AllyTurrets;
 }
Esempio n. 50
0
 public static IEnumerable<Obj_AI_Minion> GetMinionsInLane(GameObjectTeam team, Lane lane)
 {
     return from entry in _minionsInLanes
         where entry.Value.Team == team && entry.Value.Lane == lane
         select entry.Value.MinionPtr;
 }
Esempio n. 51
0
 /// <summary>
 /// Gives you the ability to extract Vector2's from each turret in game (doesn't account for dead ones)
 /// </summary>
 /// <param name="team">The team of the turrets</param>
 /// <param name="lane">The lane of the turrets</param>
 /// <returns>A List of Vector2's representing positions of turrets in that specific lane.</returns>
 public static List<Vector2> GetTurretsPosition(GameObjectTeam team, Lane lane)
 {
     switch (team)
     {
         case GameObjectTeam.Order:
         {
             switch (lane)
             {
                 case Lane.Base:
                 {
                     return orderBase;
                 }
                 case Lane.Bot:
                 {
                     return orderBot;
                 }
                 case Lane.Mid:
                 {
                     return orderMid;
                 }
                 case Lane.Top:
                 {
                     return orderTop;
                 }
             }
             break;
         }
         case GameObjectTeam.Chaos:
         {
             switch (lane)
             {
                 case Lane.Base:
                 {
                     return chaosBase;
                 }
                 case Lane.Bot:
                 {
                     return chaosBot;
                 }
                 case Lane.Mid:
                 {
                     return chaosMid;
                 }
                 case Lane.Top:
                 {
                     return chaosTop;
                 }
             }
             break;
         }
         case GameObjectTeam.Neutral:
         {
             switch (lane)
             {
                 case Lane.Top:
                 {
                     return new List<Vector2> {new Vector2(2232, 12730)};
                 }
                 case Lane.Mid:
                 {
                     return new List<Vector2> {new Vector2(7464, 7464)};
                 }
                 case Lane.Bot:
                 {
                     return new List<Vector2> {new Vector2(12642, 2517)};
                 }
             }
             break;
         }
         default:
             return ObjectManager.Player.Team == GameObjectTeam.Order ? orderMid : chaosMid;
     }
     return ObjectManager.Player.Team == GameObjectTeam.Order ? orderMid : chaosMid;
 }
Esempio n. 52
0
 public static Obj_AI_Minion GetMostDamagedMinion(GameObjectTeam team, Lane lane)
 {
     return GetMinionsInLane(team, lane).OrderBy(m => m.Health).FirstOrDefault(minion => minion.Health > 0);
 }
Esempio n. 53
0
 public Relic(string name, String objectName, GameObjectTeam team, Obj_AI_Minion obj, int spawnTime,
     int respawnTime, Vector3 mapPosition, Vector3 minimapPosition)
 {
     Name = name;
     ObjectName = objectName;
     Team = team;
     Obj = obj;
     SpawnTime = spawnTime;
     RespawnTime = respawnTime;
     Locked = false;
     MapPosition = mapPosition;
     MinimapPosition = minimapPosition;
     MapType = Utility.Map.MapType.CrystalScar;
     NextRespawnTime = 0;
     Called = false;
 }
Esempio n. 54
0
 public JungleCamp(String name, GameObjectTeam team, int campId, int spawnTime, int respawnTime,
     Utility.Map.MapType mapType, Vector3 mapPosition, Vector3 minimapPosition, JungleMob[] creeps)
 {
     Name = name;
     Team = team;
     CampId = campId;
     SpawnTime = spawnTime;
     RespawnTime = respawnTime;
     MapType = mapType;
     MapPosition = mapPosition;
     MinimapPosition = minimapPosition;
     Creeps = creeps;
     NextRespawnTime = 0;
     Called = false;
 }
Esempio n. 55
0
            /// <summary>
            ///     Initializes a new instance of the <see cref="JungleCamp" /> class.
            /// </summary>
            /// <param name="respawnTime">The respawn time.</param>
            /// <param name="position">The position.</param>
            /// <param name="mobNames">The mob names.</param>
            /// <param name="mapType">Type of the map.</param>
            /// <param name="team">The team.</param>
            public JungleCamp(
                int respawnTime,
                Vector3 position,
                string[] mobNames,
                LeagueSharp.Common.Utility.Map.MapType mapType,
                GameObjectTeam team, bool mobsAreChildren = true)
            {
                this.RespawnTime = respawnTime;
                this.Position = position;
                this.MobNames = mobNames;
                this.MapType = mapType;
                this.Team = team;
                this.MobsAreChildren = mobsAreChildren;

                this.ObjectsDead = new List<string>();
                this.ObjectsAlive = new List<string>();
            }
Esempio n. 56
0
            public Camp(string name,
                float spawnTime,
                int respawnTimer,
                Vector3 position,
                List<Mob> mobs,
                Utility.Map.MapType mapType,
                GameObjectTeam team,
                Color colour,
                Timers timer,
                bool isRanged = false,
                int state = 0,
                int respawnTime = 0,
                int lastChangeOnState = 0,
                bool shouldping = true,
                int lastPing = 0)
            {
                Name = name;
                SpawnTime = spawnTime;
                RespawnTimer = respawnTimer;
                Position = position;
                MapPosition = Drawing.WorldToScreen(Position);
                MinimapPosition = Drawing.WorldToMinimap(Position);
                Mobs = mobs;
                MapType = mapType;
                Team = team;
                Colour = colour;
                IsRanged = isRanged;
                State = state;
                RespawnTime = respawnTime;
                LastChangeOnState = lastChangeOnState;
                Timer = timer;
                ShouldPing = shouldping;
                LastPing = lastPing;

                #region Load Text

                TextMinimap = new Render.Text(0, 0, "", Program._menu.Item("timerfontminimap").GetValue<Slider>().Value, Program.White)
                {
                    VisibleCondition =
                        sender =>
                            Program.Timeronminimap && RespawnTime > Environment.TickCount && State == 7,
                    PositionUpdate = delegate
                    {
                        Vector2 v2 = Timer.MinimapPosition;
                        return v2;
                    },
                    TextUpdate = () => Timer.TextOnMinimap,
                    OutLined = false,
                    Centered = true
                };
                TextMinimap.Add();

                TextMap = new Render.Text(0, 0, "", Program._menu.Item("timerfontmap").GetValue<Slider>().Value, Program.White)
                {
                    VisibleCondition =
                        sender =>
                            Program.Timeronmap && RespawnTime > Environment.TickCount && State == 7 && Position.IsOnScreen(),
                    PositionUpdate = delegate
                    {
                        Vector2 v2 = Timer.Position;
                        return v2;
                    },
                    TextUpdate = () => Timer.TextOnMap,
                    OutLined = false,
                    Centered = true
                };
                TextMap.Add();

                #endregion

                //Drawing.OnEndScene += Drawing_OnEndScene;
            }
Esempio n. 57
0
 private static void GetAllies(GameObjectTeam team)
 {
     List<Obj_AI_Hero> temp = new List<Obj_AI_Hero>();
     foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
     {
         temp.Add(hero);
     }
     AllAllies = temp.ToArray<Obj_AI_Hero>();
 }
Esempio n. 58
0
 /// <summary>
 /// Returns a polygon containing the lane itself.
 /// </summary>
 /// <param name="team">The team.</param>
 /// <param name="lane">The lane.</param>
 /// <returns>A polygon containing the lane itself.</returns>
 public static Geometry.Polygon GetLanePolygon(GameObjectTeam team, Lane lane)
 {
     switch (team)
     {
         case GameObjectTeam.Order:
         {
             return _teamOrderLaneZones.FirstOrDefault(entry => entry.Key == lane).Value;
         }
         case GameObjectTeam.Chaos:
         {
             return _teamChaosLaneZones.FirstOrDefault(entry => entry.Key == lane).Value;
         }
         case GameObjectTeam.Neutral:
         {
             return _teamNeutralLaneZones.FirstOrDefault(entry => entry.Key == lane).Value;
         }
         default:
         {
             return null;
         }
     }
 }
Esempio n. 59
0
 private static List<Obj_AI_Turret> GetTowers(GameObjectTeam team)
 {
     List<Obj_AI_Turret> towersList = new List<Obj_AI_Turret>();
     foreach( Obj_AI_Turret turret in ObjectManager.Get<Obj_AI_Turret>().Where(tur => tur.IsAlly && tur.Health > 0))
     {
         towersList.Add(turret);
     }
     return towersList;
 }
Esempio n. 60
0
 public static Geometry.Polygon GetLanePolygonExtendedToFarthestMinion(GameObjectTeam laneZoneTeam, Lane lane,
     GameObjectTeam minionTeam, int maxFieldDistance = 1000)
 {
     var farthestTurret = Turrets.GetTurretsPosition(laneZoneTeam, lane).Last();
     var mostdamaged = Minions.GetMostDamagedMinion(minionTeam, lane);
     var farthestMinion = mostdamaged != null
         ? mostdamaged
         : Minions.GetMinionsInLane(minionTeam, lane)
             .OrderBy(m => m.Distance(farthestTurret))
             .FirstOrDefault();
     if (farthestMinion != null)
     {
         return
             new Geometry.Rectangle(farthestMinion.Position.ToVector2(),
                 farthestMinion.Position.ToVector2().Extend(farthestTurret, maxFieldDistance), 700).ToPolygon();
     }
     return GetLanePolygon(laneZoneTeam, lane);
 }