示例#1
0
 private static bool ShouldBlockSpell(Database.ActiveItem item)
 {
     if (PUC.Player.HasBuff("itemfrozenfist", true))
     {
         return(true);
     }
     if (PUC.Player.HasBuff("lichbane", true))
     {
         return(true);
     }
     if (PUC.Player.HasBuff("sheen", true))
     {
         return(true);
     }
     return(!item.IsReady());
 }
示例#2
0
            private static void CheckUseage(Database.ActiveItem item)
            {
                if (!item.IsReady() || !item.IsEnabled())
                {
                    return;
                }
                switch (item.TypeItem)
                {
                case Database.ActiveItem.ItemType.Buff:
                    break;

                case Database.ActiveItem.ItemType.OnHit:
                    // Inside SpellBlock
                    break;

                case Database.ActiveItem.ItemType.Cleanse:

                    // Dervish Blade, Mercurial Scimitar, Quicksilver Sash
                    if (item.Id == 3137 || item.Id == 3139 || item.Id == 3140)
                    {
                        if (BuffnamesCC.Any(bufftype => PUC.Player.HasBuffOfType(bufftype) && PUC.Menu.Item("act_debuff_" + bufftype).GetValue <bool>() && CleanseIsDown()))
                        {
                            item.CastItem();
                        }
                    }
                    if (item.Id == 3137 || item.Id == 3140)
                    {
                        if (BuffnamesExtendet.Any(bufftype => PUC.Player.HasBuffOfType(bufftype) && PUC.Menu.Item("act_debuff_" + bufftype).GetValue <bool>() && CleanseIsDown()))
                        {
                            item.CastItem();
                        }
                    }
                    // Mikael's Crucible
                    if (item.Id == 3222)
                    {
                        var friend = PUC.AllHerosFriend.FirstOrDefault(hero => !hero.IsDead && hero.Distance(PUC.Player) < 750 && (BuffnamesCC.Any(hero.HasBuffOfType)));
                        if (friend == null)
                        {
                            return;
                        }
                        item.CastItem(friend);
                    }
                    break;

                case Database.ActiveItem.ItemType.Offensive:
                    // Muramana
                    if (item.Id == 3042 || item.Id == 3043)
                    {
                        var muramanaActive = false;
                        var muramanaNeeded = false;
                        if (PUC.Player.Buffs.Any(buff => PUC.Player.HasBuff(item.Name)))
                        {
                            muramanaActive = true;
                        }
                        if (Orbwalker.CurrentMode == Orbwalker.Mode.Combo &&
                            PUC.Menu.Item("act_item_" + item.Id + "_useCombo").GetValue <bool>() ||
                            Orbwalker.CurrentMode == Orbwalker.Mode.Harass &&
                            PUC.Menu.Item("act_item_" + item.Id + "_useHarass").GetValue <bool>())
                        {
                            if (Utility.CountEnemysInRange((int)PUC.Player.AttackRange + 100) >= 1)
                            {
                                muramanaNeeded = true;
                            }
                        }
                        if ((muramanaNeeded && !muramanaActive) || (!muramanaNeeded && muramanaActive))
                        {
                            item.CastItem();
                        }
                    }
                    // Youmuu's Ghostblade
                    if (item.Id == 3142)
                    {
                        if (Orbwalker.CurrentMode == Orbwalker.Mode.Combo &&
                            PUC.Menu.Item("act_item_" + item.Id + "_useCombo").GetValue <bool>() ||
                            Orbwalker.CurrentMode == Orbwalker.Mode.Harass &&
                            PUC.Menu.Item("act_item_" + item.Id + "_useHarass").GetValue <bool>())
                        {
                            if (TargetSelector.GetAATarget() != null)
                            {
                                item.CastItem();
                            }
                        }
                    }
                    // List below
                    if (item.Id == 3077 || item.Id == 3074 || item.Id == 3146 || item.Id == 3144 || item.Id == 3153 || item.Id == 3128)
                    {
                        var range   = 0;
                        var onenemy = true;
                        switch (item.Id)
                        {
                        case 3074:
                        case 3077:
                            range   = 400;
                            onenemy = false;
                            break;

                        case 3146:
                            range = 700;
                            break;

                        case 3153:
                        case 3144:
                            range = 450;
                            break;

                        case 3128:
                            range = 750;
                            break;
                        }

                        if (Orbwalker.CurrentMode == Orbwalker.Mode.Combo &&
                            PUC.Menu.Item("act_item_" + item.Id + "_useCombo").GetValue <bool>() ||
                            Orbwalker.CurrentMode == Orbwalker.Mode.Harass &&
                            PUC.Menu.Item("act_item_" + item.Id + "_useHarass").GetValue <bool>())
                        {
                            if (TargetSelector.GetTarget(range) != null)
                            {
                                if (onenemy)
                                {
                                    item.CastItem(TargetSelector.GetTarget(range));
                                }
                                else
                                {
                                    item.CastItem();
                                }
                            }
                        }
                    }
                    break;
                }
            }