示例#1
0
        private static void UseItem(Obj_AI_Base target, DzItem item)
        {
            if (!Items.HasItem(item.Id) || !Items.CanUseItem(item.Id))
            {
                return;
            }
            switch (item.Mode)
            {
            case ItemMode.Targeted:
                Items.UseItem(item.Id, target);
                break;

            case ItemMode.NoTarget:
                Items.UseItem(item.Id, ObjectManager.Player);
                break;

            case ItemMode.Skillshot:
                if (item.CustomInput == null)
                {
                    return;
                }
                PredictionOutput customPred = Prediction.GetPrediction(item.CustomInput);
                if (customPred.Hitchance >= GetHitchance())
                {
                    Items.UseItem(item.Id, customPred.CastPosition);
                }
                break;
            }
        }
示例#2
0
 private static SpellSlot GetItemSpellSlot(DzItem item)
 {
     foreach (var it in ObjectManager.Player.InventoryItems.Where(it => (int)it.Id == item.Id))
     {
         return(it.SpellSlot != SpellSlot.Unknown ? it.SpellSlot : SpellSlot.Unknown);
     }
     return(SpellSlot.Unknown);
 }
示例#3
0
 private static SpellSlot GetItemSpellSlot(DzItem item)
 {
     foreach (var it in ObjectManager.Player.InventoryItems.Where(it => (int) it.Id == item.Id))
     {
         return it.SpellSlot != SpellSlot.Unknown ? it.SpellSlot : SpellSlot.Unknown;
     }
     return SpellSlot.Unknown;
 }
示例#4
0
 private static void UseItem(Obj_AI_Base target, DzItem item)
 {
     if (!Items.HasItem(item.Id) || !Items.CanUseItem(item.Id))
     {
         return;
     }
     switch (item.Mode)
     {
         case ItemMode.Targeted:
             Items.UseItem(item.Id, target);
             break;
         case ItemMode.NoTarget:
             Items.UseItem(item.Id, ObjectManager.Player);
             break;
         case ItemMode.Skillshot:
             if (item.CustomInput == null)
             {
                 return;
             }
             PredictionOutput customPred = Prediction.GetPrediction(item.CustomInput);
             if (customPred.Hitchance >= GetHitchance())
             {
                 Items.UseItem(item.Id, customPred.CastPosition);
             }
             break;
     }
 }