From a91aa3e39240d9e2ffad9e6777bd9825276921b2 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 15 Dec 2024 16:46:44 +0800 Subject: [PATCH] New rpg bug fix that preventing bots from long distance movement --- src/PlayerbotAI.cpp | 6 +++--- src/RandomPlayerbotMgr.cpp | 2 +- src/strategy/rpg/NewRpgAction.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 4abb5b1b..1d3ef76f 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -720,7 +720,7 @@ void PlayerbotAI::HandleTeleportAck() // SetNextCheckDelay(urand(2000, 5000)); if (sPlayerbotAIConfig->applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId(), true); - Reset(); + Reset(true); } SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); @@ -769,14 +769,14 @@ void PlayerbotAI::Reset(bool full) ->setTarget(sTravelMgr->nullTravelDestination, sTravelMgr->nullWorldPosition, true); aiObjectContext->GetValue("travel target")->Get()->setStatus(TRAVEL_STATUS_EXPIRED); aiObjectContext->GetValue("travel target")->Get()->setExpireIn(1000); + rpgInfo = NewRpgInfo(); } aiObjectContext->GetValue("ignore rpg target")->Get().clear(); bot->GetMotionMaster()->Clear(); - // bot->CleanupAfterTaxiFlight(); + InterruptSpell(); - rpgInfo = NewRpgInfo(); if (full) { diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index 407f5323..1774473b 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -1495,7 +1495,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache() } LOG_INFO("playerbots", ">> {} locations for level collected.", collected_locs); - LOG_INFO("playerbots", "Preparing innkeepers locations for level collected"); + LOG_INFO("playerbots", "Preparing innkeepers locations for level collected..."); if (sPlayerbotAIConfig->enableNewRpgStrategy) { results = WorldDatabase.Query( diff --git a/src/strategy/rpg/NewRpgAction.cpp b/src/strategy/rpg/NewRpgAction.cpp index 94d8aeae..925585ba 100644 --- a/src/strategy/rpg/NewRpgAction.cpp +++ b/src/strategy/rpg/NewRpgAction.cpp @@ -44,7 +44,7 @@ bool NewRpgStatusUpdateAction::Execute(Event event) } } // IDLE -> GO_INNKEEPER - else if (bot->GetLevel() >= 6 && roll <= 45) + else if (bot->GetLevel() >= 6 && roll <= 40) { WorldPosition pos = SelectRandomInnKeeperPos(); if (pos != WorldPosition() && bot->GetExactDist(pos) > 50.0f)