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); }
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.Skillshot: var customPred = Prediction.GetPrediction(item.CustomInput); if (customPred.Hitchance >= GetHitchance()) { Items.UseItem(item.Id, customPred.CastPosition); } break; } }
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; }