Enable Vashjir bot travel and fix walkable adventure outings
This commit is contained in:
1 parent
30d606cb92
commit
bc621c1d74
44 files changed
+2450
-33
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include "AdventureVashjir.h"
|
||||
#include "AdventureAreaMgr.h"
|
||||
#include "ConditionMgr.h"
|
||||
#include "ClientlessTravelGraphMgr.h"
|
||||
@@ -891,6 +892,8 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
auto const& node=pair.second;
|
||||
if(node.MapId!=player->GetMapId() || !RescueNodeAllowed(node) ||
|
||||
!sAdventureAreaMgr->AllowsNode(player,node))continue;
|
||||
Position localFrom,localTo;localFrom.Relocate(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ());localTo.Relocate(node.X,node.Y,node.Z);
|
||||
if(!AdventureVashjir::LocalLinkAllowed(player,node.MapId,localFrom,localTo))continue;
|
||||
float dx=node.X-player->GetPositionX(),dy=node.Y-player->GetPositionY(),dz=node.Z-player->GetPositionZ();
|
||||
startNodes.emplace_back(std::sqrt(dx*dx+dy*dy+dz*dz),pair.first);
|
||||
}
|
||||
@@ -1239,7 +1242,7 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
for(std::size_t i=1;i<points.size();++i)
|
||||
{
|
||||
Position p,q;p.Relocate(points[i-1][0],points[i-1][1],points[i-1][2]);q.Relocate(points[i][0],points[i][1],points[i][2]);
|
||||
if(!sAdventureAreaMgr->AllowsSegment(player,from.MapId,p,q))return false;
|
||||
if(!AdventureVashjir::LocalLinkAllowed(player,from.MapId,p,q) || !sAdventureAreaMgr->AllowsSegment(player,from.MapId,p,q))return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -1359,7 +1362,9 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
candidate.Point = point;
|
||||
bool const groundExitExhausted = blockedBridgeKeys &&
|
||||
blockedBridgeKeys->count("ground_exit_edge:" + identity);
|
||||
candidate.LocalCost = locationGoal && !groundExitExhausted && dsq <= locationAccessRadius*locationAccessRadius
|
||||
Position exitPosition,goalPosition;exitPosition.Relocate(point.X,point.Y,point.Z);goalPosition.Relocate(goalX,goalY,goalZ);
|
||||
candidate.LocalCost = locationGoal && !groundExitExhausted && dsq <= locationAccessRadius*locationAccessRadius &&
|
||||
AdventureVashjir::LocalLinkAllowed(player,goalMap,exitPosition,goalPosition)
|
||||
? groundCost(std::sqrt(dsq)) : std::numeric_limits<float>::infinity();
|
||||
|
||||
// A recorded edge can contain hundreds of samples. Calling
|
||||
@@ -1544,7 +1549,10 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
bool const sourcePortal = candidateNode.Key.rfind("portal_at_", 0) == 0 &&
|
||||
candidateNode.Key.size() >= 7 &&
|
||||
candidateNode.Key.compare(candidateNode.Key.size() - 7, 7, "_source") == 0;
|
||||
if (!sourcePortal && candidateNode.MapId == locationGoal->MapId)
|
||||
Position candidatePosition,locationPosition;candidatePosition.Relocate(candidateNode.X,candidateNode.Y,candidateNode.Z);
|
||||
locationPosition.Relocate(locationGoal->X,locationGoal->Y,locationGoal->Z);
|
||||
if (!sourcePortal && candidateNode.MapId == locationGoal->MapId &&
|
||||
AdventureVashjir::LocalLinkAllowed(player,candidateNode.MapId,candidatePosition,locationPosition))
|
||||
{
|
||||
float dx = candidateNode.X - locationGoal->X;
|
||||
float dy = candidateNode.Y - locationGoal->Y;
|
||||
|
||||
Reference in new issue
Block a user