From 09463feb8f4f330843cf2b469404dde9b8fd7b55 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sat, 27 May 2023 23:59:59 +0800 Subject: [PATCH] movement, disable hearthstone --- .../actions/CheckMountStateAction.cpp | 18 +++++----- src/strategy/actions/MovementActions.cpp | 34 +++++++++---------- src/strategy/generic/CombatStrategy.cpp | 2 +- src/strategy/generic/MaintenanceStrategy.cpp | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/strategy/actions/CheckMountStateAction.cpp b/src/strategy/actions/CheckMountStateAction.cpp index 099c442b..0a5510ee 100644 --- a/src/strategy/actions/CheckMountStateAction.cpp +++ b/src/strategy/actions/CheckMountStateAction.cpp @@ -46,21 +46,21 @@ bool CheckMountStateAction::Execute(Event event) if (!bot->GetGroup() || bot->GetGroup()->GetLeaderGUID() != master->GetGUID()) return false; - bool farFromMaster = sServerFacade->GetDistance2d(bot, master) > sPlayerbotAIConfig->sightDistance; + // bool farFromMaster = sServerFacade->GetDistance2d(bot, master) > sPlayerbotAIConfig->sightDistance; if (master->IsMounted() && !bot->IsMounted() && noattackers) { return Mount(); } - if (!bot->IsMounted() && (chasedistance || (farFromMaster && botAI->HasStrategy("follow", BOT_STATE_NON_COMBAT))) && !bot->IsInCombat() && !dps) - return Mount(); + // if (!bot->IsMounted() && (chasedistance || (farFromMaster && botAI->HasStrategy("follow", BOT_STATE_NON_COMBAT))) && !bot->IsInCombat() && !dps) + // return Mount(); - if (!bot->IsFlying() && ((!farFromMaster && !master->IsMounted()) || attackdistance) && bot->IsMounted()) - { - WorldPacket emptyPacket; - bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); - return true; - } + // if (!bot->IsFlying() && ((!farFromMaster && !master->IsMounted()) || attackdistance) && bot->IsMounted()) + // { + // WorldPacket emptyPacket; + // bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); + // return true; + // } return false; } diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 604c8515..4978f83a 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -382,23 +382,23 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, } } - if (pathType == TravelNodePathType::teleportSpell && entry) - { - if (entry == 8690) - { - if (!bot->HasSpellCooldown(8690)) - { - return botAI->DoSpecificAction("hearthstone", Event("move action")); - } - else - { - movePath.clear(); - AI_VALUE(LastMovement&, "last movement").setPath(movePath); - LOG_DEBUG("playerbots", "bot->HasSpellCooldown(8690)"); - return false; - } - } - } + // if (pathType == TravelNodePathType::teleportSpell && entry) + // { + // if (entry == 8690) + // { + // if (!bot->HasSpellCooldown(8690)) + // { + // return botAI->DoSpecificAction("hearthstone", Event("move action")); + // } + // else + // { + // movePath.clear(); + // AI_VALUE(LastMovement&, "last movement").setPath(movePath); + // LOG_DEBUG("playerbots", "bot->HasSpellCooldown(8690)"); + // return false; + // } + // } + // } //if (!isTransport && bot->GetTransport()) // bot->GetTransport()->RemovePassenger(bot); diff --git a/src/strategy/generic/CombatStrategy.cpp b/src/strategy/generic/CombatStrategy.cpp index 765621a6..39064765 100644 --- a/src/strategy/generic/CombatStrategy.cpp +++ b/src/strategy/generic/CombatStrategy.cpp @@ -12,7 +12,7 @@ void CombatStrategy::InitTriggers(std::vector &triggers) triggers.push_back(new TriggerNode("mounted", NextAction::array(0, new NextAction("check mount state", 54), nullptr))); triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", 55), nullptr))); triggers.push_back(new TriggerNode("combat stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("combat long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr))); + // triggers.push_back(new TriggerNode("combat long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr))); } diff --git a/src/strategy/generic/MaintenanceStrategy.cpp b/src/strategy/generic/MaintenanceStrategy.cpp index f2da0d53..46b1f044 100644 --- a/src/strategy/generic/MaintenanceStrategy.cpp +++ b/src/strategy/generic/MaintenanceStrategy.cpp @@ -19,6 +19,6 @@ void MaintenanceStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("enchant random item", 1.0f), nullptr))); triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("smart destroy item", 1.0f), nullptr))); triggers.push_back(new TriggerNode("move stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("move long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr))); + // triggers.push_back(new TriggerNode("move long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr))); }