示例#1
0
 private void Speak(InternalKillable killable, Obj_AI_Hero hero)
 {
     if (killable != null)
     {
         if (KillableTracker.GetMenuItem("SAssembliesTrackersKillableSpeech").GetValue <bool>() && !killable.Spoken && hero.IsVisible && !hero.IsDead)
         {
             Speech.Speak("Killable " + hero.ChampionName);
             killable.Spoken = true;
         }
     }
 }
示例#2
0
        public Killable() //TODO: Add more option for e.g. most damage first, add ignite spell
        {
            int index = 0;

            foreach (Obj_AI_Hero enemy in ObjectManager.Get <Obj_AI_Hero>())
            {
                int i = 0 + index;
                if (enemy.IsEnemy)
                {
                    Combo            nCombo   = CalculateKillable(enemy, null);
                    InternalKillable killable = new InternalKillable(null, null);
                    Render.Text      text     = new Render.Text(new Vector2(0, 0), "", 28, SharpDX.Color.OrangeRed);
                    text.Centered         = true;
                    text.OutLined         = true;
                    text.VisibleCondition = sender =>
                    {
                        return((killable.Combo != null ? killable.Combo.Killable : false) && enemy.IsVisible && !enemy.IsDead &&
                               Tracker.Trackers.GetActive() && KillableTracker.GetActive());
                    };
                    text.PositionUpdate = delegate
                    {
                        return(new Vector2(Drawing.Width / 2, Drawing.Height * 0.80f - (17 * i)));
                    };
                    text.TextUpdate = delegate
                    {
                        if (killable.Combo == null)
                        {
                            return("");
                        }
                        Combo  combo    = killable.Combo;
                        String killText = "Killable " + enemy.ChampionName + ": ";
                        if (combo.Spells != null && combo.Spells.Count > 0)
                        {
                            combo.Spells.ForEach(x => killText += x.Name + "/");
                        }
                        if (combo.Items != null && combo.Items.Count > 0)
                        {
                            combo.Items.ForEach(x => killText += x.Name + "/");
                        }
                        if (killText.Contains("/"))
                        {
                            killText = killText.Remove(killText.LastIndexOf("/"));
                        }
                        return(killText);
                    };
                    text.Add();
                    killable = new InternalKillable(nCombo, text);
                    _enemies.Add(enemy, killable);
                }
                index++;
            }
            ThreadHelper.GetInstance().Called += Game_OnGameUpdate;
            //Game.OnGameUpdate += Game_OnGameUpdate;
        }
示例#3
0
 //TODO: Add more option for e.g. most damage first, add ignite spell
 public Killable()
 {
     int index = 0;
     foreach (Obj_AI_Hero enemy in ObjectManager.Get<Obj_AI_Hero>())
     {
         int i = 0 + index;
         if (enemy.IsEnemy)
         {
             Combo nCombo = CalculateKillable(enemy, null);
             InternalKillable killable = new InternalKillable(null, null);
             Render.Text text = new Render.Text(new Vector2(0, 0), "", 28, SharpDX.Color.OrangeRed);
             text.Centered = true;
             text.OutLined = true;
             text.VisibleCondition = sender =>
             {
                 return (killable.Combo != null ? killable.Combo.Killable : false) && enemy.IsVisible && !enemy.IsDead &&
                     Tracker.Trackers.GetActive() && KillableTracker.GetActive();
             };
             text.PositionUpdate = delegate
             {
                 return new Vector2(Drawing.Width / 2, Drawing.Height * 0.80f - (17 * i));
             };
             text.TextUpdate = delegate
             {
                 if (killable.Combo == null)
                     return "";
                 Combo combo = killable.Combo;
                 String killText = "Killable " + enemy.ChampionName + ": ";
                 if (combo.Spells != null && combo.Spells.Count > 0)
                     combo.Spells.ForEach(x => killText += x.Name + "/");
                 if (combo.Items != null && combo.Items.Count > 0)
                     combo.Items.ForEach(x => killText += x.Name + "/");
                 if (killText.Contains("/"))
                     killText = killText.Remove(killText.LastIndexOf("/"));
                 return killText;
             };
             text.Add();
             killable = new InternalKillable(nCombo, text);
             _enemies.Add(enemy, killable);
         }
         index++;
     }
     ThreadHelper.GetInstance().Called += Game_OnGameUpdate;
     //Game.OnGameUpdate += Game_OnGameUpdate;
 }
示例#4
0
        private Combo CalculateKillable(Obj_AI_Hero enemy, InternalKillable killable)
        {
            var creationItemList = new Dictionary<Item, Damage.DamageItems>();
            var creationSpellList = new List<LeagueSharp.Common.Spell>();
            var tempSpellList = new List<Spell>();
            var tempItemList = new List<Item>();

            var ignite = new LeagueSharp.Common.Spell(SummonerSpells.GetIgniteSlot(), 1000);

            var q = new LeagueSharp.Common.Spell(SpellSlot.Q, 1000);
            var w = new LeagueSharp.Common.Spell(SpellSlot.W, 1000);
            var e = new LeagueSharp.Common.Spell(SpellSlot.E, 1000);
            var r = new LeagueSharp.Common.Spell(SpellSlot.R, 1000);
            creationSpellList.Add(q);
            creationSpellList.Add(w);
            creationSpellList.Add(e);
            creationSpellList.Add(r);

            var dfg = new Item(3128, 1000, "Dfg");//Items.Deathfire_Grasp;
            var bilgewater = new Item(3144, 1000, "Bilgewater");//Items.Bilgewater_Cutlass;//
            var hextechgun = new Item(3146, 1000, "Hextech");//Items.Hextech_Gunblade;//
            var blackfire = new Item(3188, 1000, "Blackfire");//Items.Blackfire_Torch;//
            var botrk = new Item(3153, 1000, "Botrk");//Items.Blade_of_the_Ruined_King;//
            creationItemList.Add(dfg, Damage.DamageItems.Dfg);
            creationItemList.Add(bilgewater, Damage.DamageItems.Bilgewater);
            creationItemList.Add(hextechgun, Damage.DamageItems.Hexgun);
            creationItemList.Add(blackfire, Damage.DamageItems.BlackFireTorch);
            creationItemList.Add(botrk, Damage.DamageItems.Botrk);

            double enoughDmg = 0;
            double enoughMana = 0;

            foreach (var item in creationItemList)
            {
                if (item.Key.IsReady())
                {
                    enoughDmg += ObjectManager.Player.GetItemDamage(enemy, item.Value);
                    tempItemList.Add(item.Key);
                }
                if (enemy.Health < enoughDmg)
                {
                    Speak(killable, enemy);
                    return new Combo(null, tempItemList, true);
                }
            }

            foreach (LeagueSharp.Common.Spell spell in creationSpellList)
            {
                if (spell.IsReady())
                {
                    double spellDamage = spell.GetDamage(enemy, 0);
                    if (spellDamage > 0)
                    {
                        enoughDmg += spellDamage;
                        enoughMana += spell.Instance.ManaCost;
                        tempSpellList.Add(new Spell(spell.Slot.ToString(), spell.Slot));
                    }
                }
                if (enemy.Health < enoughDmg)
                {
                    if (ObjectManager.Player.Mana >= enoughMana)
                    {
                        Speak(killable, enemy);
                        return new Combo(tempSpellList, tempItemList, true);
                    }
                    return new Combo(null, null, false);
                }
            }

            if (SummonerSpells.GetIgniteSlot() != SpellSlot.Unknown && enemy.Health > enoughDmg)
            {
                enoughDmg += ObjectManager.Player.GetSummonerSpellDamage(enemy, Damage.SummonerSpell.Ignite);
                tempSpellList.Add(new Spell("Ignite", ignite.Slot));
            }
            if (enemy.Health < enoughDmg)
            {
                Speak(killable, enemy);
                return new Combo(tempSpellList, tempItemList, true);
            }
            if (killable != null)
            {
                killable.Spoken = false;
            }
            return new Combo();
        }
示例#5
0
 private void Speak(InternalKillable killable, Obj_AI_Hero hero)
 {
     if (killable != null)
     {
         if (KillableTracker.GetMenuItem("SAssembliesTrackersKillableSpeech").GetValue<bool>() && !killable.Spoken && hero.IsVisible && !hero.IsDead)
         {
             Speech.Speak("Killable " + hero.ChampionName);
             killable.Spoken = true;
         }
     }
 }
示例#6
0
        private Combo CalculateKillable(Obj_AI_Hero enemy, InternalKillable killable)
        {
            var creationItemList  = new Dictionary <Item, Damage.DamageItems>();
            var creationSpellList = new List <LeagueSharp.Common.Spell>();
            var tempSpellList     = new List <Spell>();
            var tempItemList      = new List <Item>();

            var ignite = new LeagueSharp.Common.Spell(SummonerSpells.GetIgniteSlot(), 1000);

            var q = new LeagueSharp.Common.Spell(SpellSlot.Q, 1000);
            var w = new LeagueSharp.Common.Spell(SpellSlot.W, 1000);
            var e = new LeagueSharp.Common.Spell(SpellSlot.E, 1000);
            var r = new LeagueSharp.Common.Spell(SpellSlot.R, 1000);

            creationSpellList.Add(q);
            creationSpellList.Add(w);
            creationSpellList.Add(e);
            creationSpellList.Add(r);

            var dfg        = new Item(3128, 1000, "Dfg");        //Items.Deathfire_Grasp;
            var bilgewater = new Item(3144, 1000, "Bilgewater"); //Items.Bilgewater_Cutlass;//
            var hextechgun = new Item(3146, 1000, "Hextech");    //Items.Hextech_Gunblade;//
            var blackfire  = new Item(3188, 1000, "Blackfire");  //Items.Blackfire_Torch;//
            var botrk      = new Item(3153, 1000, "Botrk");      //Items.Blade_of_the_Ruined_King;//

            creationItemList.Add(dfg, Damage.DamageItems.Dfg);
            creationItemList.Add(bilgewater, Damage.DamageItems.Bilgewater);
            creationItemList.Add(hextechgun, Damage.DamageItems.Hexgun);
            creationItemList.Add(blackfire, Damage.DamageItems.BlackFireTorch);
            creationItemList.Add(botrk, Damage.DamageItems.Botrk);

            double enoughDmg  = 0;
            double enoughMana = 0;

            foreach (var item in creationItemList)
            {
                if (item.Key.IsReady())
                {
                    enoughDmg += ObjectManager.Player.GetItemDamage(enemy, item.Value);
                    tempItemList.Add(item.Key);
                }
                if (enemy.Health < enoughDmg)
                {
                    Speak(killable, enemy);
                    return(new Combo(null, tempItemList, true));
                }
            }

            foreach (LeagueSharp.Common.Spell spell in creationSpellList)
            {
                if (spell.IsReady())
                {
                    double spellDamage = spell.GetDamage(enemy, 0);
                    if (spellDamage > 0)
                    {
                        enoughDmg  += spellDamage;
                        enoughMana += spell.Instance.ManaCost;
                        tempSpellList.Add(new Spell(spell.Slot.ToString(), spell.Slot));
                    }
                }
                if (enemy.Health < enoughDmg)
                {
                    if (ObjectManager.Player.Mana >= enoughMana)
                    {
                        Speak(killable, enemy);
                        return(new Combo(tempSpellList, tempItemList, true));
                    }
                    return(new Combo(null, null, false));
                }
            }

            if (SummonerSpells.GetIgniteSlot() != SpellSlot.Unknown && enemy.Health > enoughDmg)
            {
                enoughDmg += ObjectManager.Player.GetSummonerSpellDamage(enemy, Damage.SummonerSpell.Ignite);
                tempSpellList.Add(new Spell("Ignite", ignite.Slot));
            }
            if (enemy.Health < enoughDmg)
            {
                Speak(killable, enemy);
                return(new Combo(tempSpellList, tempItemList, true));
            }
            if (killable != null)
            {
                killable.Spoken = false;
            }
            return(new Combo());
        }