internal static async Task <bool> UsePomander(Pomander number, uint auraId = 0) { if (Core.Me.HasAura(Auras.ItemPenalty) && number != Pomander.Serenity) { return(false); } //cannot use pomander while under the auras of rage / lust if (Core.Me.HasAnyAura(Auras.Lust, Auras.Rage)) { return(false); } var data = DeepDungeonManager.GetInventoryItem(number); if (data.Count == 0) { return(false); } if (data.HasAura) { return(false); } if (Core.Me.HasAura(auraId) && Core.Me.GetAuraById(auraId).TimespanLeft > TimeSpan.FromMinutes(1)) { return(false); } var lockoutTimer = PomanderLockoutTimers[number]; if (!lockoutTimer.IsFinished) { return(false); } await Coroutine.Wait(5000, () => !DeepDungeonManager.IsCasting); var cnt = data.Count; await Coroutine.Wait(5000, () => !DeepDungeonManager.IsCasting); var wt = new WaitTimer(TimeSpan.FromSeconds(30)); wt.Reset(); while (cnt == data.Count && !wt.IsFinished) { Logger.Verbose($"Using Pomander: {number}"); DeepDungeonManager.UsePomander(number); await Coroutine.Sleep(150); await Coroutine.Wait(5000, () => !DeepDungeonManager.IsCasting); DeepDungeonManager.PomanderChange(); data = DeepDungeonManager.GetInventoryItem(number); } //Wait a little so we don't trigger the anti-stuck await Coroutine.Sleep(1000); //TODO this is probabbly stored somewhere in the client... switch (number) { case Pomander.Rage: PomanderState = ItemState.Rage; break; case Pomander.Lust: PomanderState = ItemState.Lust; break; case Pomander.Resolution: PomanderState = ItemState.Resolution; break; } lockoutTimer.Reset(); return(true); }
public static void UsePomander2(Pomander number) { Core.Memory.CallInjected64 <IntPtr>(Core.Memory.ImageBase + 10031088, AgentModule.GetAgentInterfaceByType <AgentDeepDungeonInformation>().Pointer, (int)number); }
public static void UsePomander(Pomander pom) { AgentModule.GetAgentInterfaceByType <AgentDeepDungeonInformation>().UsePomander(pom); Navigator.NavigationProvider.ClearStuckInfo(); // don't trigger antistuck }
public static DDInventoryItem GetInventoryItem(Pomander pom) { return(Director.DeepDungeonInventory[(byte)Constants.PomanderInventorySlot(pom)]); }
public static int PomanderInventorySlot(Pomander p) { return(SelectedDungeon.PomanderMapping[(int)p]); }
public static void UsePomander(Pomander pom) { AgentModule.GetAgentInterfaceByType <AgentDeepDungeonInformation>().UsePomander(pom); }
public static DDInventoryItem GetInventoryItem(Pomander pom) { return(Director.DeepDungeonInventory[(byte)pom - 1]); }
public static int PomanderInventorySlot(Pomander p) { return(PomanderSlots[p]); }