mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Fix rpg move far (#822)
* Fix rpg move far * Don't go innkeeper with diff zone
This commit is contained in:
parent
2b758c9624
commit
1ed6645119
@ -3130,7 +3130,7 @@ void PlayerbotFactory::InitReagents()
|
|||||||
items.push_back({17030, 40}); // Ankh
|
items.push_back({17030, 40}); // Ankh
|
||||||
break;
|
break;
|
||||||
case CLASS_WARLOCK:
|
case CLASS_WARLOCK:
|
||||||
items.push_back({6265, 10}); // shard
|
items.push_back({6265, 20}); // shard
|
||||||
break;
|
break;
|
||||||
case CLASS_PRIEST:
|
case CLASS_PRIEST:
|
||||||
if (level >= 48 && level < 60)
|
if (level >= 48 && level < 60)
|
||||||
|
|||||||
@ -198,6 +198,10 @@ WorldPosition NewRpgStatusUpdateAction::SelectRandomInnKeeperPos()
|
|||||||
if (bot->GetMapId() != loc.GetMapId())
|
if (bot->GetMapId() != loc.GetMapId())
|
||||||
continue;
|
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;
|
float range = bot->GetLevel() <= 5 ? 500.0f : 2500.0f;
|
||||||
if (bot->GetExactDist(loc) < range)
|
if (bot->GetExactDist(loc) < range)
|
||||||
{
|
{
|
||||||
@ -246,13 +250,13 @@ bool NewRpgGoFarAwayPosAction::MoveFarTo(WorldPosition dest)
|
|||||||
float dis = rand_norm() * pathFinderDis;
|
float dis = rand_norm() * pathFinderDis;
|
||||||
float dx = x + cos(angle) * dis;
|
float dx = x + cos(angle) * dis;
|
||||||
float dy = y + sin(angle) * dis;
|
float dy = y + sin(angle) * dis;
|
||||||
float dz = z + 5.0f;
|
float dz = z + 0.5f;
|
||||||
bot->UpdateAllowedPositionZ(dx, dy, dz);
|
bot->UpdateAllowedPositionZ(dx, dy, dz);
|
||||||
PathGenerator path(bot);
|
PathGenerator path(bot);
|
||||||
path.CalculatePath(dx, dy, dz);
|
path.CalculatePath(dx, dy, dz);
|
||||||
PathType type = path.GetPathType();
|
PathType type = path.GetPathType();
|
||||||
|
|
||||||
bool canReach = type == PATHFIND_INCOMPLETE || type == PATHFIND_NORMAL;
|
bool canReach = type == PATHFIND_NORMAL;
|
||||||
|
|
||||||
if (canReach && fabs(delta) <= minDelta)
|
if (canReach && fabs(delta) <= minDelta)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user