/// <summary> /// buffs the start of the level /// </summary> /// <returns></returns> private async Task <bool> BuffCurrentFloor() { //do not buff the floor if there is a boss... if (DeepDungeonManager.BossFloor) { return(false); } if ((!PartyManager.IsInParty || PartyManager.IsPartyLeader) && (Core.Me.HasAura(Auras.Amnesia) || Core.Me.HasAura(Auras.ItemPenalty) || Core.Me.HasAura(Auras.NoAutoHeal)) || (DeepDungeonManager.GetMagiciteCount() > 0 && Core.Me.HasAura(Auras.UnMagicked))) { await UsePomander(Pomander.Serenity); } if (await Traps()) { return(true); } if (await UsePomander(Pomander.Fortune)) { return(true); } if (await Inuit()) { return(true); } await Constants.SelectedDungeon.BuffCurrentFloor(); return(await BuffNextFloor()); }
/// <summary> /// Uses a pomander of witching when there are 3 mobs in combat around us /// </summary> /// <returns></returns> private async Task <bool> UseWitching() { if ( !DeepDungeonManager.BossFloor && DeepDungeonManager.GetInventoryItem(Pomander.Witching).Count > 0 && GameObjectManager.NumberOfAttackers >= 3 && !GameObjectManager.Attackers.Any(i => i.HasAura(Auras.Frog) || i.HasAura(Auras.Imp) || i.HasAura(Auras.Chicken)) //Toad && (!PartyManager.IsInParty || PartyManager.IsPartyLeader) ) { Logger.Info("Witching debug: {0} {1} {2} {3} {4}", !DeepDungeonManager.BossFloor, DeepDungeonManager.GetInventoryItem(Pomander.Witching).Count, GameObjectManager.NumberOfAttackers, !GameObjectManager.Attackers.Any(i => i.HasAura(Auras.Frog) || i.HasAura(Auras.Imp) || i.HasAura(Auras.Chicken)), (!PartyManager.IsInParty || PartyManager.IsPartyLeader) ); await CommonTasks.StopMoving("Use Pomander"); var res = await Tasks.Coroutines.Common.UsePomander(Pomander.Witching); await Coroutine.Yield(); return(res); } return(false); }
public override async Task <bool> BuffCurrentFloor() { if (DeepDungeonManager.GetInventoryItem(Pomander.Frailty).Count > 1) { return(await UsePomander(Pomander.Frailty)); } return(false); }
/// <summary> /// Player pomander buffs /// </summary> /// <returns></returns> private static async Task <bool> BuffMe() { if (Core.Me.HasAura(Auras.ItemPenalty)) { return(false); } if (CombatTargeting.Instance.LastEntities.Count() > 4) { return(await UsePomander(Pomander.Petrification)); } if (DeepDungeonManager.GetInventoryItem(Pomander.Petrification).Count == 3) { return(await UsePomander(Pomander.Petrification)); } if (await UsePomander(Pomander.Raising)) { return(true); } if (await UsePomander(Pomander.Intuition)) { return(true); } if (!Settings.Instance.SaveSteel || DeepDungeonManager.GetInventoryItem(Pomander.Steel).Count > 1) { if (await UsePomander(Pomander.Steel, Auras.Steel)) { return(true); } } if (!Settings.Instance.SaveStr || DeepDungeonManager.GetInventoryItem(Pomander.Strength).Count > 1) { if (await UsePomander(Pomander.Strength, Auras.Strength)) { return(true); } } if (Core.Me.HasAura(Auras.Pox)) { if (await UsePomander(Pomander.Purity)) { return(true); } } return(false); }
private void SetupDetour() { //if we are not on the lobby & we have already reloaded detour for this floor return if (_floorId == DeepDungeonManager.Level) { return; } _floorId = DeepDungeonManager.Level; uint map = Constants.Maps[WorldManager.RawZoneId]; if (_detourLevel != map) { _detourLevel = map; _walls = LoadWalls(map); } //load the map Walls = new Dictionary <uint, bool>(); _traps = new List <uint>(); Traps = new List <Vector3>(); _map = new List <Vector3>(); Logger.Verbose("Updating navigation {0}", map); wallList.Clear(); trapList.Clear(); _activeWalls = FindWalls(); WallCheck(); Logger.Debug("Game objects: unit \t NpcID \t ObjID"); GameObjectManager.Update(); //IEnumerable<GameObject> units = GameObjectManager.GameObjects; //foreach (GameObject unit in GameObjectManager.GameObjects) // Logger.Debug("Game object: {0,-25} - {1,20} - {2, 15}", unit.Name, unit.NpcId, unit.ObjectId); Logger.Debug($"{DeepDungeonManager.GetInventoryItems2()}"); /* * foreach (uint unit in activeWalls) * { * Logger.Debug("WallHash: {0,-25}", unit); * } * * Logger.Debug("Auras"); * foreach (var a in DeepDungeonManager.GetInventoryItems()) * { * Logger.Debug("Items ID: {0} Count: {1}", a.Id, a.Count); * }*/ }
public override async Task <bool> BuffMe() { if (GameObjectManager.Attackers.Count > 3) { return(await UsePomander(Pomander.Petrification)); } if (DeepDungeonManager.GetInventoryItem(Pomander.Petrification).Count == 3) { return(await UsePomander(Pomander.Petrification)); } return(false); }
public override async Task <bool> BuffBoss() { if ((PartyManager.IsInParty && PartyManager.IsPartyLeader) || !PartyManager.IsInParty) { if (DeepDungeonManager.GetMagiciteCount() >= 1) { Logger.Warn("Magicite >= 1"); DeepDungeonManager.CastMagicite(); await Coroutine.Sleep(500); } } return(await UsePomander(Pomander.Frailty)); }
public override async Task <bool> BuffMe() { if (CombatTargeting.Instance.LastEntities.Count > 4) { return(await UsePomander(Pomander.Petrification)); } if (DeepDungeonManager.GetInventoryItem(Pomander.Petrification).Count == 3) { return(await UsePomander(Pomander.Petrification)); } return(false); }
internal void Pulse() { if (CommonBehaviors.IsLoading) { return; } if (!DutyManager.InInstance) { return; } if (DeepDungeonManager.Director.TimeLeftInDungeon == TimeSpan.Zero) { return; } if (!Constants.InDeepDungeon) { return; } if (_floor != DeepDungeonManager.Level) { Logger.Info("Level has Changed. Clearing Targets"); _floor = DeepDungeonManager.Level; Blacklist.Clear(i => i.Flags == (BlacklistFlags)DeepDungeonManager.Level); DeepDungeonManager.PomanderChange(); } using (new PerformanceLogger("Targeting Pulse", true)) { LastEntities = new ReadOnlyCollection <GameObject>(GetObjectsByWeight()); } if (_lastPulse + TimeSpan.FromSeconds(5) < DateTime.Now) { Logger.Verbose($"Found {LastEntities.Count} Targets"); if (!LastEntities.Any()) { if (!GameObjectManager.GameObjects.Any(r => r.NpcId == EntityNames.OfPassage && !FloorExit.blackList.Contains(r.ObjectId))) { FloorExit.blackList.Clear(); } } _lastPulse = DateTime.Now; } }
public void Tick() { if (CommonBehaviors.IsLoading) { return; } if (!Constants.InDeepDungeon) { return; } DeepDungeonManager.HaveMainPomander = DeepDungeonManager.GetInventoryItem(Pomander.Lust).Count > 0 && DeepDungeonManager.GetInventoryItem(Pomander.Strength).Count > 0 && DeepDungeonManager.GetInventoryItem(Pomander.Steel).Count > 0; }
private static async Task LustLogic() { var lust = false; var itm = DeepDungeonManager.GetInventoryItem(Pomander.Lust); Logger.Info("[LUST] Item Count: {0}", itm.Count); //we are inside the dungeon, should be ok to use InParty here. if (PartyManager.IsInParty) { Logger.Info("In A Party. Doing Lust Logic..."); var lustFound = false; foreach (var k in PartyManager.AllMembers) { if (!k.Class.IsHealer() && !k.Class.IsTank()) { lustFound = true; if (k.IsMe) { lust = true; } break; } } Logger.Info("Party Lust status: {0} :: {1} :: {2}", !lust, !lustFound, PartyManager.IsPartyLeader); if (!lust && !lustFound) { lust = PartyManager.IsPartyLeader; } if (!PartyManager.IsPartyLeader && itm.Count > 0) { lust = true; } } else { Logger.Info("Solo Lust Logic"); lust = true; } if (lust) { Logger.Info("Use Pomander Debug: [HasAura: {0}]", itm.HasAura); await UsePomander(Pomander.Lust, Auras.Lust); } }
/// <summary> /// Player pomander buffs /// </summary> /// <returns></returns> private static async Task <bool> BuffMe() { if (Core.Me.HasAura(Auras.ItemPenalty)) { return(false); } await Constants.SelectedDungeon.BuffMe(); if (await UsePomander(Pomander.Raising)) { return(true); } if (await UsePomander(Pomander.Intuition)) { return(true); } if (DeepDungeonManager.GetInventoryItem(Pomander.Steel).Count > 1) { if (await UsePomander(Pomander.Steel, Auras.Steel)) { return(true); } } if (DeepDungeonManager.GetInventoryItem(Pomander.Strength).Count > 1) { if (await UsePomander(Pomander.Strength, Auras.Strength)) { return(true); } } if (Core.Me.HasAura(Auras.Pox)) { if (await UsePomander(Pomander.Purity)) { return(true); } } return(false); }
/// <summary> /// buffs the start of the level /// </summary> /// <returns></returns> private async Task <bool> BuffCurrentFloor() { //do not buff the floor if there is a boss... if (DeepDungeonManager.BossFloor) { return(false); } if (PartyManager.IsPartyLeader && (Core.Me.HasAura(Auras.Amnesia) || Core.Me.HasAura(Auras.ItemPenalty) || Core.Me.HasAura(Auras.NoAutoHeal))) { await UsePomander(Pomander.Serenity); } if (await Traps()) { return(true); } if (await UsePomander(Pomander.Fortune)) { return(true); } // if (await UsePomander(Pomander.Rage)) // return true; if (await Inuit()) { return(true); } //if (await UsePomander(Pomander.Intuition)) return true; //SaveFrailty if (!Settings.Instance.SaveFrailty || DeepDungeonManager.GetInventoryItem(Pomander.Frailty).Count > 1) { if (await UsePomander(Pomander.Frailty)) { return(true); } } return(await BuffNextFloor()); }
public override async Task <bool> BuffCurrentFloor() { if ((PartyManager.IsInParty && PartyManager.IsPartyLeader) || !PartyManager.IsInParty) { if (DeepDungeonManager.GetMagiciteCount() >= 1) { Logger.Warn("Magicite >= 1"); DeepDungeonManager.CastMagicite(); await Coroutine.Sleep(500); } } if (DeepDungeonManager.GetInventoryItem(Pomander.Frailty).Count > 1) { return(await UsePomander(Pomander.Frailty)); } return(false); }
private bool HaveMainPomander() { return(DeepDungeonManager.GetInventoryItem(Pomander.Lust).Count > 0 && DeepDungeonManager.GetInventoryItem(Pomander.Strength).Count > 0 && DeepDungeonManager.GetInventoryItem(Pomander.Steel).Count > 0); }
/// <summary> /// buff the stuff /// </summary> /// <returns></returns> private async Task <bool> BuffBoss() { if (DeepDungeonManager.BossFloor && !Core.Me.InCombat) { if (Core.Me.HasAura(Auras.Lust) || _runbuf) { return(false); } _runbuf = true; if (Core.Me.HasAura(Auras.Enervation) || Core.Me.HasAura(Auras.Silence)) { return(true); } if (!DeepDungeonManager.PortalActive) { await UsePomander(Pomander.Strength, Auras.Strength); await UsePomander(Pomander.Steel, Auras.Steel); var lust = false; var itm = DeepDungeonManager.GetInventoryItem(Pomander.Lust); Logger.Info("[LUST] Item Count: {0}", itm.Count); //we are inside the dungeon, should be ok to use InParty here. if (PartyManager.IsInParty) { Logger.Info("In A Party. Doing Lust Logic..."); var lustFound = false; foreach (var k in PartyManager.AllMembers) { if (!k.Class.IsHealer() && !k.Class.IsTank()) { lustFound = true; if (k.IsMe) { lust = true; } break; } } Logger.Info("Party Lust status: {0} :: {1} :: {2}", !lust, !lustFound, PartyManager.IsPartyLeader); if (!lust && !lustFound) { lust = PartyManager.IsPartyLeader; } } else { Logger.Info("Solo Lust Logic"); lust = true; } if (lust) { Logger.Info("Use Pomander Debug: [HasAura: {0}]", itm.HasAura); await UsePomander(Pomander.Lust, Auras.Lust); } } } else { _runbuf = false; return(await BuffMe()); } return(false); }
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); }
/// <summary> /// Handles opening treasure coffers or opening an exit portal /// </summary> /// <returns></returns> internal async Task <bool> TreasureOrExit() { var tries = 0; var npcid = Target.Unit.NpcId; if (Target.Location.Distance2D(Core.Me.Location) >= 3) { await CommonTasks.MoveAndStop(new MoveToParameters(Target.Location, Target.Name), 2.5f, true); return(true); } pomanderCapped = false; //Unsubscribe first to prevent subscriptions from persisting //GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied; // GamelogManager.MessageRecevied += GamelogManagerOnMessageRecevied; while (!DeepDungeonCombined.StopPlz && Target.Unit != null && Target.Unit.IsValid && tries < 3) { try { //if we are a transformed we can't open a chest if (Constants.AuraTransformed) { Logger.Warn("Unable to open chest. Waiting for aura to end..."); await CommonTasks.StopMoving("Waiting on aura to end"); await Coroutine.Wait(TimeSpan.FromSeconds(30), () => !Constants.AuraTransformed || Core.Me.InCombat || DeepDungeonCombined.StopPlz); return(true); } await Coroutine.Yield(); if (Core.Me.HasAura(Auras.Lust)) { await Tasks.Common.CancelAura(Auras.Lust); } Logger.Verbose("Attempting to interact with: {0} ({1} / 3)", Target.Name, tries + 1); if (!PartyManager.IsInParty || PartyManager.IsPartyLeader || PartyManager.IsInParty && Constants.IsExitObject(Target.Unit)) { await CommonTasks.StopMoving("Interacting with chest"); if (!await ObjectInteraction(Target.Unit)) { break; } } else { await CommonTasks.StopMoving("Waiting for leader to use chest"); } await Coroutine.Sleep(700); if (!Target.Unit.IsValid) { break; } if (!Target.Unit.IsTargetable) { break; } if (SelectYesno.IsOpen) { break; } } finally { tries++; DeepDungeonManager.PomanderChange(); } } GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied; await Coroutine.Wait(500, () => SelectYesno.IsOpen); //if this is an exit if (SelectYesno.IsOpen) { SelectYesno.ClickYes(); await Coroutine.Sleep(1000); Logger.Verbose("Is window open : {0}", DeepDungeonResult.Instance.IsOpen); if (DeepDungeonResult.Instance.IsOpen) { Logger.Verbose("Calling Close"); await Coroutine.Sleep(2000); DeepDungeonResult.Instance.SendAction(1, 3, uint.MaxValue); DeepTracker.EndRun(false); } await Coroutine.Wait(TimeSpan.MaxValue, () => DeepDungeonCombined.StopPlz || QuestLogManager.InCutscene || NowLoading.IsVisible); return(true); } if (Target.Unit != null && Target.Unit.IsValid) { Blacklist.Add(Target.Unit.ObjectId, TimeSpan.FromMinutes(5), $"Tried to Interact with the Target {tries} times"); } Poi.Clear($"Tried to Interact with the Target {tries} times"); return(false); }