From 1ed6645119c9736e70a326bd3d8afc8061f9848f Mon Sep 17 00:00:00 2001 From: Yunfan Li <56597220+liyunfan1223@users.noreply.github.com> Date: Sat, 28 Dec 2024 01:11:39 +0800 Subject: [PATCH] Fix rpg move far (#822) * Fix rpg move far * Don't go innkeeper with diff zone --- src/factory/PlayerbotFactory.cpp | 2 +- src/strategy/rpg/NewRpgAction.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index 04f2fc9a..ab9da381 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -3130,7 +3130,7 @@ void PlayerbotFactory::InitReagents() items.push_back({17030, 40}); // Ankh break; case CLASS_WARLOCK: - items.push_back({6265, 10}); // shard + items.push_back({6265, 20}); // shard break; case CLASS_PRIEST: if (level >= 48 && level < 60) diff --git a/src/strategy/rpg/NewRpgAction.cpp b/src/strategy/rpg/NewRpgAction.cpp index 925585ba..e9fdcec2 100644 --- a/src/strategy/rpg/NewRpgAction.cpp +++ b/src/strategy/rpg/NewRpgAction.cpp @@ -197,7 +197,11 @@ WorldPosition NewRpgStatusUpdateAction::SelectRandomInnKeeperPos() { if (bot->GetMapId() != loc.GetMapId()) continue; - + + if (bot->GetMap()->GetZoneId(bot->GetPhaseMask(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ()) != + bot->GetZoneId()) + continue; + float range = bot->GetLevel() <= 5 ? 500.0f : 2500.0f; if (bot->GetExactDist(loc) < range) { @@ -246,13 +250,13 @@ bool NewRpgGoFarAwayPosAction::MoveFarTo(WorldPosition dest) float dis = rand_norm() * pathFinderDis; float dx = x + cos(angle) * dis; float dy = y + sin(angle) * dis; - float dz = z + 5.0f; + float dz = z + 0.5f; bot->UpdateAllowedPositionZ(dx, dy, dz); PathGenerator path(bot); path.CalculatePath(dx, dy, dz); PathType type = path.GetPathType(); - bool canReach = type == PATHFIND_INCOMPLETE || type == PATHFIND_NORMAL; + bool canReach = type == PATHFIND_NORMAL; if (canReach && fabs(delta) <= minDelta) {