コード例 #1
0
 public void UseItem(int id, Obj_AI_Hero target = null)
 {
     if (Items.HasItem(id) && Items.CanUseItem(id))
     {
         Items.UseItem(id, target);
     }
 }
コード例 #2
0
        public static float GetItemsDamage(Obj_AI_Hero target)
        {
            double damage = 0;

            if (Items.HasItem(odins.Id) && Items.CanUseItem(odins.Id))
            {
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.OdingVeils);
            }
            if (Items.HasItem(hexgun.Id) && Items.CanUseItem(hexgun.Id))
            {
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.Hexgun);
            }
            if (Items.HasItem(lich.Id) && Items.CanUseItem(lich.Id))
            {
                damage += player.CalcDamage(target, Damage.DamageType.Magical, player.BaseAttackDamage * 0.75 + player.FlatMagicDamageMod * 0.5);
            }
            if (Items.HasItem(Dfg.Id) && Items.CanUseItem(Dfg.Id))
            {
                damage  = damage * 1.2;
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.Dfg);
            }
            if (Items.HasItem(Bft.Id) && Items.CanUseItem(Bft.Id))
            {
                damage  = damage * 1.2;
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.BlackFireTorch);
            }
            if (Items.HasItem(tiamat.Id) && Items.CanUseItem(tiamat.Id))
            {
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.Tiamat);
            }
            if (Items.HasItem(hydra.Id) && Items.CanUseItem(hydra.Id))
            {
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.Hydra);
            }
            if (Items.HasItem(bilgewater.Id) && Items.CanUseItem(bilgewater.Id))
            {
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.Bilgewater);
            }
            if (Items.HasItem(botrk.Id) && Items.CanUseItem(botrk.Id))
            {
                damage += Damage.GetItemDamage(player, target, Damage.DamageItems.Botrk);
            }
            if (Items.HasItem(sheen.Id) && (Items.CanUseItem(sheen.Id) || player.HasBuff("sheen", true)))
            {
                damage += player.CalcDamage(target, Damage.DamageType.Physical, player.BaseAttackDamage);
            }
            if (Items.HasItem(gaunlet.Id) && Items.CanUseItem(gaunlet.Id))
            {
                damage += player.CalcDamage(target, Damage.DamageType.Physical, player.BaseAttackDamage * 1.25);
            }
            if (Items.HasItem(trinity.Id) && Items.CanUseItem(trinity.Id))
            {
                damage += player.CalcDamage(target, Damage.DamageType.Physical, player.BaseAttackDamage * 2);
            }
            return((float)damage);
        }
コード例 #3
0
 public static void castHydra(Obj_AI_Hero target)
 {
     if (player.Distance(target) < hydra.Range && !LeagueSharp.Common.Orbwalking.CanAttack())
     {
         if (Items.HasItem(tiamat.Id) && Items.CanUseItem(tiamat.Id))
         {
             Items.UseItem(tiamat.Id);
         }
         if (Items.HasItem(hydra.Id) && Items.CanUseItem(hydra.Id))
         {
             Items.UseItem(hydra.Id);
         }
     }
 }
コード例 #4
0
ファイル: Items.cs プロジェクト: riwalry1/AIO
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!Program.getKeyBindItem(ItemMenu, "UseItems"))
            {
                return;
            }

            foreach (var item in ItemList.
                     Where(x =>
                           LCItems.HasItem(x.Id) &&
                           LCItems.CanUseItem(x.Id)))
            {
                if (Program.getCheckBoxItem(ItemMenu, "Use" + item.Name))
                {
                    UseItem(item.Id, item.Range);
                }
            }
        }
コード例 #5
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!config.IsActive("UseItems"))
            {
                return;
            }

            foreach (var item in ItemList.
                     Where(x =>
                           LCItems.HasItem(x.Id) &&
                           LCItems.CanUseItem(x.Id)))
            {
                if (config.IsBool("Use" + item.Name))
                {
                    UseItem(item.Id, item.Range);
                }
            }
        }
コード例 #6
0
        public static void UseItems(Obj_AI_Hero target)
        {
            if (player.BaseSkinName != "Renekton")
            {
                castHydra(target);
            }
            if (Items.HasItem(hexmk2.Id) && Items.CanUseItem(hexmk2.Id))
            {
                if (ARAMSimulator.balance > -50)
                {
                    hexmk2.Cast(target.Position);
                }
                else
                {
                    hexmk2.Cast(player.Position.Extend(ARAMSimulator.fromNex.Position, 677));
                }
            }

            if (Items.HasItem(Zhonya.Id) && Items.CanUseItem(Zhonya.Id))
            {
                if (player.HealthPercent < 30 && ARAMSimulator.balance < -60)
                {
                    Items.UseItem(Zhonya.Id);
                }
            }
            if (Items.HasItem(locket.Id) && Items.CanUseItem(locket.Id))
            {
                if (player.HealthPercent < 80 && player.CountEnemiesInRange(550) > 0)
                {
                    Items.UseItem(locket.Id);
                }
            }
            if (Items.HasItem(randuins.Id) && Items.CanUseItem(randuins.Id))
            {
                if (player.Distance(target) < randuins.Range && player.Distance(target) > player.AttackRange + 100)
                {
                    Items.UseItem(randuins.Id);
                }
            }
            if (Items.HasItem(odins.Id) && Items.CanUseItem(odins.Id))
            {
                if (player.Distance(target) < odins.Range &&
                    (player.CountEnemiesInRange(odins.Range) > 1 ||
                     target.Health < Damage.GetItemDamage(player, target, Damage.DamageItems.OdingVeils)))
                {
                    Items.UseItem(odins.Id);
                }
            }
            if (Items.HasItem(bilgewater.Id) && Items.CanUseItem(bilgewater.Id))
            {
                bilgewater.Cast(target);
            }
            if (Items.HasItem(botrk.Id) && Items.CanUseItem(botrk.Id) && (player.Health < player.MaxHealth / 2 || Damage.GetItemDamage(player, target, Damage.DamageItems.Botrk) < target.Health))
            {
                botrk.Cast(target);
            }
            if (Items.HasItem(hexgun.Id) && Items.CanUseItem(hexgun.Id))
            {
                hexgun.Cast(target);
            }
            if (Items.HasItem(Dfg.Id) && Items.CanUseItem(Dfg.Id))
            {
                Dfg.Cast(target);
            }
            if (Items.HasItem(Bft.Id) && Items.CanUseItem(Bft.Id))
            {
                Bft.Cast(target);
            }
            if (Items.HasItem(youmuu.Id) && Items.CanUseItem(youmuu.Id) && player.Distance(target) < player.AttackRange + 50)
            {
                youmuu.Cast();
            }
            if (Items.HasItem(banner.Id) && Items.CanUseItem(banner.Id))
            {
                var min = MinionManager.GetMinions(500, MinionTypes.Ranged, MinionTeam.Ally).FirstOrDefault();
                if (min != null && min.HealthPercent > 75)
                {
                    banner.Cast(min);
                }
            }
            if (Items.HasItem(hexmk1.Id) && Items.CanUseItem(hexmk1.Id))
            {
                hexmk1.Cast(target.Position);
            }
        }
コード例 #7
0
 public bool CanUseItem(int id)
 {
     return(Items.HasItem(id) && Items.CanUseItem(id));
 }
コード例 #8
0
ファイル: ItemHandler.cs プロジェクト: spofa/GoodGuyJodu
        public static void UseItems(Obj_AI_Hero target)
        {
            if (player.BaseSkinName != "Renekton")
            {
                castHydra(target);
            }

            if (Items.HasItem(Zhonya.Id) && Items.CanUseItem(Zhonya.Id))
            {
                if (player.HealthPercent < 30 && ARAMSimulator.balance < -60)
                {
                    Items.UseItem(Zhonya.Id);
                }
            }
            if (Items.HasItem(locket.Id) && Items.CanUseItem(locket.Id))
            {
                if (player.HealthPercent < 80 && player.CountEnemiesInRange(550) > 0)
                {
                    Items.UseItem(locket.Id);
                }
            }
            if (Items.HasItem(randuins.Id) && Items.CanUseItem(randuins.Id))
            {
                if (player.Distance(target) < randuins.Range && player.Distance(target) > player.AttackRange + 100)
                {
                    Items.UseItem(randuins.Id);
                }
            }
            if (Items.HasItem(odins.Id) && Items.CanUseItem(odins.Id))
            {
                if (player.Distance(target) < odins.Range &&
                    (player.CountEnemiesInRange(odins.Range) > 1 ||
                     target.Health < Damage.GetItemDamage(player, target, Damage.DamageItems.OdingVeils)))
                {
                    Items.UseItem(odins.Id);
                }
            }
            if (Items.HasItem(bilgewater.Id) && Items.CanUseItem(bilgewater.Id))
            {
                bilgewater.Cast(target);
            }
            if (Items.HasItem(botrk.Id) && Items.CanUseItem(botrk.Id) && (player.Health < player.MaxHealth / 2 || Damage.GetItemDamage(player, target, Damage.DamageItems.Botrk) < target.Health))
            {
                botrk.Cast(target);
            }
            if (Items.HasItem(hexgun.Id) && Items.CanUseItem(hexgun.Id))
            {
                hexgun.Cast(target);
            }
            if (Items.HasItem(Dfg.Id) && Items.CanUseItem(Dfg.Id))
            {
                Dfg.Cast(target);
            }
            if (Items.HasItem(Bft.Id) && Items.CanUseItem(Bft.Id))
            {
                Bft.Cast(target);
            }
            if (Items.HasItem(youmuu.Id) && Items.CanUseItem(youmuu.Id) && player.Distance(target) < player.AttackRange + 50)
            {
                youmuu.Cast();
            }
        }