Пример #1
0
        public static void UseItems(List <Obj_AI_Base> enemies, bool ks)
        {
            #region Item Initialization
            InventorySlot QSS = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Quick Silver Sash")) ? JarvanIV.GetItem(ItemId.Quicksilver_Sash) : null,
                          MercurialsScimitar = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Mercurials Scimitar")) ? JarvanIV.GetItem(ItemId.Mercurial_Scimitar) : null,
                          RavenousHydra      = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Ravenous Hydra")) ? JarvanIV.GetItem(ItemId.Ravenous_Hydra) : null,
                          TitanicHydra       = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Titanic Hydra")) ? JarvanIV.GetItem(ItemId.Titanic_Hydra) : null,
                          Tiamat             = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Tiamat")) ? JarvanIV.GetItem(ItemId.Tiamat) : null,
                          Youmuus            = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Youmuus")) ? JarvanIV.GetItem(ItemId.Youmuus_Ghostblade) : null,
                          BOTRK             = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Blade of the Ruined King")) ? JarvanIV.GetItem(ItemId.Blade_of_the_Ruined_King) : null,
                          BilgewaterCutlass = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Bilgewater Cutlass")) ? JarvanIV.GetItem(ItemId.Bilgewater_Cutlass) : null,
                          HextechGunblade   = (MenuHandler.GetCheckboxValue(MenuHandler.Items, "Use Hextech Gunblade")) ? JarvanIV.GetItem(ItemId.Hextech_Gunblade) : null;
            #endregion

            #region QSS
            if (!hasDoneActionThisTick &&
                QSS.MeetsCriteria() &&
                JarvanIV.CanCancleCC())
            {
                hasDoneActionThisTick = QSS.Cast();
            }
            #endregion

            #region Mercurials Scimitar
            if (!hasDoneActionThisTick &&
                MercurialsScimitar.MeetsCriteria() &&
                JarvanIV.CanCancleCC())
            {
                hasDoneActionThisTick = MercurialsScimitar.Cast();
            }
            #endregion

            #region Ravenous Hydra
            if (!hasDoneActionThisTick &&
                RavenousHydra.MeetsCriteria() &&
                JarvanIV.IsAutoCanceling(enemies) &&
                enemies.Where(a => a.IsInRange(JarvanIV, 400)).FirstOrDefault() != null &&
                (!ks || enemies.Where(a => a.MeetsCriteria() && a.Health <= DamageLibrary.GetItemDamage(JarvanIV, a, ItemId.Ravenous_Hydra)).FirstOrDefault() != null))
            {
                hasDoneActionThisTick = RavenousHydra.Cast();
            }
            #endregion

            #region Titanic Hydra
            if (!hasDoneActionThisTick &&
                TitanicHydra.MeetsCriteria() &&
                enemies.Where(a => a.IsInRange(JarvanIV, JarvanIV.GetAutoAttackRange())).FirstOrDefault() != null &&
                JarvanIV.IsAutoCanceling(enemies) &&
                (!ks || enemies.Where(a => a.MeetsCriteria() && a.Health <= DamageLibrary.GetItemDamage(JarvanIV, a, ItemId.Titanic_Hydra)).FirstOrDefault() != null))
            {
                hasDoneActionThisTick = TitanicHydra.Cast();
            }
            #endregion

            #region Tiamat
            if (!hasDoneActionThisTick &&
                Tiamat.MeetsCriteria() &&
                JarvanIV.IsAutoCanceling(enemies) &&
                enemies.Where(a => a.IsInRange(JarvanIV, 400)).FirstOrDefault() != null &&
                (!ks || enemies.Where(a => a.MeetsCriteria() && a.Health <= DamageLibrary.GetItemDamage(JarvanIV, a, ItemId.Tiamat)).FirstOrDefault() != null))
            {
                hasDoneActionThisTick = Tiamat.Cast();
            }
            #endregion

            #region Youmuus
            if (!hasDoneActionThisTick &&
                Youmuus.MeetsCriteria() &&
                JarvanIV.CountEnemyHeroesInRangeWithPrediction((int)JarvanIV.GetAutoAttackRange(), 0) >= 1)
            {
                hasDoneActionThisTick = Youmuus.Cast();
            }
            #endregion

            //all targeted spells that must be used on champions must be called after this
            enemies = enemies.Where(a => a.Type == GameObjectType.AIHeroClient).ToList();
            var target = enemies.OrderBy(a => a.Health).FirstOrDefault();

            #region Hextech Gunblade
            if (!hasDoneActionThisTick &&
                target != null &&
                HextechGunblade.MeetsCriteria() &&
                enemies.Where(a => a.IsInRange(JarvanIV, 700)).FirstOrDefault() != null &&
                (!ks || enemies.Where(a => a.MeetsCriteria() && a.Health <= DamageLibrary.GetItemDamage(JarvanIV, a, ItemId.Hextech_Gunblade)).FirstOrDefault() != null))
            {
                hasDoneActionThisTick = HextechGunblade.Cast(target);
            }
            #endregion

            #region BOTRK
            if (!hasDoneActionThisTick &&
                target != null &&
                BOTRK.MeetsCriteria() &&
                enemies.Where(a => a.IsInRange(JarvanIV, 550)).FirstOrDefault() != null &&
                (!ks || enemies.Where(a => a.MeetsCriteria() && a.Health <= DamageLibrary.GetItemDamage(JarvanIV, a, ItemId.Blade_of_the_Ruined_King)).FirstOrDefault() != null))
            {
                hasDoneActionThisTick = BOTRK.Cast(target);
            }
            #endregion

            #region Bilgewater Cutlass
            if (!hasDoneActionThisTick &&
                target != null &&
                BilgewaterCutlass.MeetsCriteria() &&
                enemies.Where(a => a.IsInRange(JarvanIV, 550)).FirstOrDefault() != null &&
                (!ks || enemies.Where(a => a.MeetsCriteria() && a.Health <= DamageLibrary.GetItemDamage(JarvanIV, a, ItemId.Bilgewater_Cutlass)).FirstOrDefault() != null))
            {
                hasDoneActionThisTick = BilgewaterCutlass.Cast(target);
            }
            #endregion
        }