Merge branch 'master' into eqemu_config_json

This commit is contained in:
Akkadius
2017-07-23 00:55:06 -05:00
23 changed files with 124 additions and 98 deletions
+1
View File
@@ -1944,6 +1944,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.guildID = GuildID();
// ns->spawn.linkdead = IsLD() ? 1 : 0;
// ns->spawn.pvp = GetPVP() ? 1 : 0;
ns->spawn.show_name = true;
strcpy(ns->spawn.title, m_pp.title);
+7 -4
View File
@@ -4599,14 +4599,14 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
}
}
float new_heading = EQ19toFloat(ppu->heading);
int32 new_animation = ppu->animation;
/* Update internal server position from what the client has sent */
m_Position.x = ppu->x_pos;
m_Position.y = ppu->y_pos;
m_Position.z = ppu->z_pos;
m_Position.w = EQ19toFloat(ppu->heading);
animation = ppu->animation;
/* Visual Debugging */
if (RuleB(Character, OPClientUpdateVisualDebug)) {
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading);
@@ -4615,7 +4615,10 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
}
/* Only feed real time updates when client is moving */
if (is_client_moving) {
if (is_client_moving || new_heading != m_Position.w || new_animation != animation) {
animation = ppu->animation;
m_Position.w = EQ19toFloat(ppu->heading);
/* Broadcast update to other clients */
auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
+4
View File
@@ -659,6 +659,8 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
QueueClients(npc, app);
npc->SendArmorAppearance();
npc->SetAppearance(npc->GetGuardPointAnim(),false);
if (!npc->IsTargetable())
npc->SendTargetable(false);
safe_delete(app);
} else {
auto ns = new NewSpawn_Struct;
@@ -799,6 +801,8 @@ void EntityList::CheckSpawnQueue()
NPC *pnpc = it->second;
pnpc->SendArmorAppearance();
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
if (!pnpc->IsTargetable())
pnpc->SendTargetable(false);
}
safe_delete(outapp);
iterator.RemoveCurrent();
-2
View File
@@ -173,7 +173,5 @@ void Mob::CalculateNewFearpoint()
}
if (currently_fleeing)
m_FearWalkTarget = glm::vec3(ranx, rany, ranz);
else //Break fear
BuffFadeByEffect(SE_Fear);
}
+2
View File
@@ -375,6 +375,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if
CalcBonuses();
raid_target = d->raid_target;
ignore_despawn = d->ignore_despawn;
m_targetable = !d->untargetable;
}
NPC::~NPC()
@@ -1906,6 +1907,7 @@ void NPC::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.is_npc = 1;
UpdateActiveLight();
ns->spawn.light = GetActiveLightType();
ns->spawn.show_name = NPCTypedata->show_name;
}
void NPC::PetOnSpawn(NewSpawn_Struct* ns)
+74 -74
View File
@@ -206,7 +206,7 @@ glm::vec3 PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ)
std::deque<int> PathManager::FindRoute(int startID, int endID)
{
Log(Logs::Detail, Logs::None, "FindRoute from node %i to %i", startID, endID);
Log(Logs::Detail, Logs::Pathing, "FindRoute from node %i to %i", startID, endID);
memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount);
@@ -329,7 +329,7 @@ std::deque<int> PathManager::FindRoute(int startID, int endID)
}
}
Log(Logs::Detail, Logs::None, "Unable to find a route.");
Log(Logs::Detail, Logs::Pathing, "Unable to find a route.");
return Route;
}
@@ -351,7 +351,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b)
std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
{
Log(Logs::Detail, Logs::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
Log(Logs::Detail, Logs::Pathing, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
std::deque<int> noderoute;
@@ -384,7 +384,7 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{
Log(Logs::Detail, Logs::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
Log(Logs::Detail, Logs::Pathing, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
{
@@ -394,11 +394,11 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
}
if(ClosestPathNodeToStart <0 ) {
Log(Logs::Detail, Logs::None, "No LOS to any starting Path Node within range.");
Log(Logs::Detail, Logs::Pathing, "No LOS to any starting Path Node within range.");
return noderoute;
}
Log(Logs::Detail, Logs::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart);
Log(Logs::Detail, Logs::Pathing, "Closest Path Node To Start: %2d", ClosestPathNodeToStart);
// Find the nearest PathNode the end point has LOS to
@@ -421,8 +421,8 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{
Log(Logs::Detail, Logs::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id);
Log(Logs::Detail, Logs::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)",
Log(Logs::Detail, Logs::Pathing, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id);
Log(Logs::Detail, Logs::Pathing, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)",
End.x, End.y, End.z,
PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z);
@@ -434,11 +434,11 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
}
if(ClosestPathNodeToEnd < 0) {
Log(Logs::Detail, Logs::None, "No LOS to any end Path Node within range.");
Log(Logs::Detail, Logs::Pathing, "No LOS to any end Path Node within range.");
return noderoute;
}
Log(Logs::Detail, Logs::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd);
Log(Logs::Detail, Logs::Pathing, "Closest Path Node To End: %2d", ClosestPathNodeToEnd);
if(ClosestPathNodeToStart == ClosestPathNodeToEnd)
{
@@ -673,7 +673,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(To == From)
return To;
Log(Logs::Detail, Logs::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z);
Log(Logs::Detail, Logs::Pathing, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z);
if(From == PathingLastPosition)
{
@@ -681,7 +681,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if((PathingLoopCount > 5) && !IsRooted())
{
Log(Logs::Detail, Logs::None, "appears to be stuck. Teleporting them to next position.", GetName());
Log(Logs::Detail, Logs::Pathing, "appears to be stuck. Teleporting them to next position.", GetName());
if(Route.empty())
{
@@ -721,7 +721,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// If we are already pathing, and the destination is the same as before ...
if(SameDestination)
{
Log(Logs::Detail, Logs::None, " Still pathing to the same destination.");
Log(Logs::Detail, Logs::Pathing, " Still pathing to the same destination.");
// Get the coordinates of the first path node we are going to.
NextNode = Route.front();
@@ -730,9 +730,9 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// May need to refine this as rounding errors may mean we never have equality
// We have reached the path node.
if(NodeLoc == From)
if(NodeLoc.x == From.x && NodeLoc.y == From.y)
{
Log(Logs::Detail, Logs::None, " Arrived at node %i", NextNode);
Log(Logs::Detail, Logs::Pathing, " Arrived at node %i", NextNode);
NodeReached = true;
@@ -746,36 +746,36 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// target, and we may run past the target if we don't check LOS at this point.
int RouteSize = Route.size();
Log(Logs::Detail, Logs::None, "Route size is %i", RouteSize);
Log(Logs::Detail, Logs::Pathing, "Route size is %i", RouteSize);
if((RouteSize == 2)
|| ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
&& PathingLOSCheckTimer->Check()))
{
Log(Logs::Detail, Logs::None, " Checking distance to target.");
Log(Logs::Detail, Logs::Pathing, " Checking distance to target.");
float Distance = VectorDistanceNoRoot(From, To);
Log(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
Log(Logs::Detail, Logs::Pathing, " Distance between From and To (NoRoot) is %8.3f", Distance);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS;
else
PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS");
Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{
Log(Logs::Detail, Logs::None, " No hazards. Running directly to target.");
Log(Logs::Detail, Logs::Pathing, " No hazards. Running directly to target.");
Route.clear();
return To;
}
else
{
Log(Logs::Detail, Logs::None, " Continuing on node path.");
Log(Logs::Detail, Logs::Pathing, " Continuing on node path.");
}
}
else
@@ -801,7 +801,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(Route.empty())
{
Log(Logs::Detail, Logs::None, "Missing node after teleport.");
Log(Logs::Detail, Logs::Pathing, "Missing node after teleport.");
return To;
}
@@ -811,7 +811,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
Teleport(NodeLoc);
Log(Logs::Detail, Logs::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Log(Logs::Detail, Logs::Pathing, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Route.pop_front();
@@ -822,7 +822,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
}
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
Log(Logs::Detail, Logs::None, " Now moving to node %i", NextNode);
Log(Logs::Detail, Logs::Pathing, " Now moving to node %i", NextNode);
return zone->pathing->GetPathNodeCoordinates(NextNode);
}
@@ -830,7 +830,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
{
// we have run all the nodes, all that is left is the direct path from the last node
// to the destination
Log(Logs::Detail, Logs::None, " Reached end of node path, running direct to target.");
Log(Logs::Detail, Logs::Pathing, " Reached end of node path, running direct to target.");
return To;
}
@@ -844,30 +844,30 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
&& PathingLOSCheckTimer->Check())
{
Log(Logs::Detail, Logs::None, " Checking distance to target.");
Log(Logs::Detail, Logs::Pathing, " Checking distance to target.");
float Distance = VectorDistanceNoRoot(From, To);
Log(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
Log(Logs::Detail, Logs::Pathing, " Distance between From and To (NoRoot) is %8.3f", Distance);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS;
else
PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS");
Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{
Log(Logs::Detail, Logs::None, " No hazards. Running directly to target.");
Log(Logs::Detail, Logs::Pathing, " No hazards. Running directly to target.");
Route.clear();
return To;
}
else
{
Log(Logs::Detail, Logs::None, " Continuing on node path.");
Log(Logs::Detail, Logs::Pathing, " Continuing on node path.");
}
}
else
@@ -879,7 +879,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
{
// We get here if we were already pathing, but our destination has now changed.
//
Log(Logs::Detail, Logs::None, " Target has changed position.");
Log(Logs::Detail, Logs::Pathing, " Target has changed position.");
// Update our record of where we are going to.
PathingDestination = To;
// Check if we now have LOS etc to the new destination.
@@ -888,24 +888,24 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
float Distance = VectorDistanceNoRoot(From, To);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
Log(Logs::Detail, Logs::None, " Checking for short LOS at distance %8.3f.", Distance);
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
Log(Logs::Detail, Logs::Pathing, " Checking for short LOS at distance %8.3f.", Distance);
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS;
else
PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS");
Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{
Log(Logs::Detail, Logs::None, " No hazards. Running directly to target.");
Log(Logs::Detail, Logs::Pathing, " No hazards. Running directly to target.");
Route.clear();
return To;
}
else
{
Log(Logs::Detail, Logs::None, " Continuing on node path.");
Log(Logs::Detail, Logs::Pathing, " Continuing on node path.");
}
}
}
@@ -916,19 +916,19 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
{
if(!PathingRouteUpdateTimerShort->Check())
{
Log(Logs::Detail, Logs::None, "Short route update timer not yet expired.");
Log(Logs::Detail, Logs::Pathing, "Short route update timer not yet expired.");
return zone->pathing->GetPathNodeCoordinates(Route.front());
}
Log(Logs::Detail, Logs::None, "Short route update timer expired.");
Log(Logs::Detail, Logs::Pathing, "Short route update timer expired.");
}
else
{
if(!PathingRouteUpdateTimerLong->Check())
{
Log(Logs::Detail, Logs::None, "Long route update timer not yet expired.");
Log(Logs::Detail, Logs::Pathing, "Long route update timer not yet expired.");
return zone->pathing->GetPathNodeCoordinates(Route.front());
}
Log(Logs::Detail, Logs::None, "Long route update timer expired.");
Log(Logs::Detail, Logs::Pathing, "Long route update timer expired.");
}
// We are already pathing, destination changed, no LOS. Find the nearest node to our destination.
@@ -937,7 +937,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// Destination unreachable via pathing, return direct route.
if(DestinationPathNode == -1)
{
Log(Logs::Detail, Logs::None, " Unable to find path node for new destination. Running straight to target.");
Log(Logs::Detail, Logs::Pathing, " Unable to find path node for new destination. Running straight to target.");
Route.clear();
return To;
}
@@ -945,15 +945,15 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// one, we will carry on on our path.
if(DestinationPathNode == Route.back())
{
Log(Logs::Detail, Logs::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode);
Log(Logs::Detail, Logs::Pathing, " Same destination Node (%i). Continue with current path.", DestinationPathNode);
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
// May need to refine this as rounding errors may mean we never have equality
// Check if we have reached a path node.
if(NodeLoc == From)
if(NodeLoc.x == From.x && NodeLoc.y == From.y)
{
Log(Logs::Detail, Logs::None, " Arrived at node %i, moving to next one.\n", Route.front());
Log(Logs::Detail, Logs::Pathing, " Arrived at node %i, moving to next one.\n", Route.front());
NodeReached = true;
@@ -976,7 +976,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(Route.empty())
{
Log(Logs::Detail, Logs::None, "Missing node after teleport.");
Log(Logs::Detail, Logs::Pathing, "Missing node after teleport.");
return To;
}
@@ -986,7 +986,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
Teleport(NodeLoc);
Log(Logs::Detail, Logs::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Log(Logs::Detail, Logs::Pathing, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Route.pop_front();
@@ -996,7 +996,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
NextNode = Route.front();
}
// Return the coords of our next path node on the route.
Log(Logs::Detail, Logs::None, " Now moving to node %i", NextNode);
Log(Logs::Detail, Logs::Pathing, " Now moving to node %i", NextNode);
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
@@ -1004,7 +1004,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
}
else
{
Log(Logs::Detail, Logs::None, " Reached end of path grid. Running direct to target.");
Log(Logs::Detail, Logs::Pathing, " Reached end of path grid. Running direct to target.");
return To;
}
}
@@ -1012,7 +1012,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
}
else
{
Log(Logs::Detail, Logs::None, " Target moved. End node is different. Clearing route.");
Log(Logs::Detail, Logs::Pathing, " Target moved. End node is different. Clearing route.");
Route.clear();
// We will now fall through to get a new route.
@@ -1022,11 +1022,11 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
}
Log(Logs::Detail, Logs::None, " Our route list is empty.");
Log(Logs::Detail, Logs::Pathing, " Our route list is empty.");
if((SameDestination) && !PathingLOSCheckTimer->Check())
{
Log(Logs::Detail, Logs::None, " Destination same as before, LOS check timer not reached. Returning To.");
Log(Logs::Detail, Logs::Pathing, " Destination same as before, LOS check timer not reached. Returning To.");
return To;
}
@@ -1039,23 +1039,23 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
float Distance = VectorDistanceNoRoot(From, To);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
Log(Logs::Detail, Logs::None, " Checking for long LOS at distance %8.3f.", Distance);
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
Log(Logs::Detail, Logs::Pathing, " Checking for long LOS at distance %8.3f.", Distance);
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS;
else
PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS");
Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{
Log(Logs::Detail, Logs::None, "Target is reachable. Running directly there.");
Log(Logs::Detail, Logs::Pathing, "Target is reachable. Running directly there.");
return To;
}
}
Log(Logs::Detail, Logs::None, " Calculating new route to target.");
Log(Logs::Detail, Logs::Pathing, " Calculating new route to target.");
Route = zone->pathing->FindRoute(From, To);
@@ -1063,14 +1063,14 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(Route.empty())
{
Log(Logs::Detail, Logs::None, " No route available, running direct.");
Log(Logs::Detail, Logs::Pathing, " No route available, running direct.");
return To;
}
if(SameDestination && (Route.front() == PathingLastNodeVisited))
{
Log(Logs::Detail, Logs::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited.");
Log(Logs::Detail, Logs::Pathing, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited.");
Route.clear();
@@ -1078,7 +1078,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
}
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
Log(Logs::Detail, Logs::None, " New route determined, heading for node %i", Route.front());
Log(Logs::Detail, Logs::Pathing, " New route determined, heading for node %i", Route.front());
PathingLoopCount = 0;
@@ -1119,7 +1119,7 @@ int PathManager::FindNearestPathNode(glm::vec3 Position)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{
Log(Logs::Detail, Logs::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
Log(Logs::Detail, Logs::Pathing, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
{
@@ -1129,7 +1129,7 @@ int PathManager::FindNearestPathNode(glm::vec3 Position)
}
if(ClosestPathNodeToStart <0 ) {
Log(Logs::Detail, Logs::None, "No LOS to any starting Path Node within range.");
Log(Logs::Detail, Logs::Pathing, "No LOS to any starting Path Node within range.");
return -1;
}
return ClosestPathNodeToStart;
@@ -1143,15 +1143,15 @@ bool PathManager::NoHazards(glm::vec3 From, glm::vec3 To)
float NewZ = zone->zonemap->FindBestZ(MidPoint, nullptr);
if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) {
Log(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThresholdNew)) {
Log(Logs::Detail, Logs::Pathing, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
return false;
}
else
{
Log(Logs::Detail, Logs::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
Log(Logs::Detail, Logs::Pathing, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
}
@@ -1182,7 +1182,7 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
glm::vec3 TestPoint(curx, cury, curz);
float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr);
if (std::abs(NewZ - last_z) > 5.0f) {
Log(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f",
Log(Logs::Detail, Logs::Pathing, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f",
From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z);
return false;
}
@@ -1210,20 +1210,20 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
}
if (best_z2 == -999990)
{
Log(Logs::Detail, Logs::None, " HAZARD DETECTED, really deep water/lava!");
Log(Logs::Detail, Logs::Pathing, " HAZARD DETECTED, really deep water/lava!");
return false;
}
else
{
if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) {
Log(Logs::Detail, Logs::None,
if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThresholdNew)) {
Log(Logs::Detail, Logs::Pathing,
" HAZARD DETECTED, water is fairly deep at %8.3f units deep",
std::abs(NewZ - best_z2));
return false;
}
else
{
Log(Logs::Detail, Logs::None,
Log(Logs::Detail, Logs::Pathing,
" HAZARD NOT DETECTED, water is shallow at %8.3f units deep",
std::abs(NewZ - best_z2));
}
@@ -1231,12 +1231,12 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
}
else
{
Log(Logs::Detail, Logs::None, "Hazard point not in water or lava!");
Log(Logs::Detail, Logs::Pathing, "Hazard point not in water or lava!");
}
}
else
{
Log(Logs::Detail, Logs::None, "No water map loaded for hazards!");
Log(Logs::Detail, Logs::Pathing, "No water map loaded for hazards!");
}
curx += stepx;
@@ -1291,7 +1291,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho)
if(d && !d->IsDoorOpen() )
{
Log(Logs::Detail, Logs::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName());
Log(Logs::Detail, Logs::Pathing, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName());
d->ForceOpen(ForWho);
}
+1 -1
View File
@@ -3640,7 +3640,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_Fear: {
if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) {
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster);
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster,0,0,true);
if (resist_check == 100)
break;
+2 -2
View File
@@ -855,7 +855,7 @@ void Mob::FixZ() {
Log(
Logs::Moderate,
Logs::Pathing,
Logs::FixZ,
"Mob::FixZ() (%s) returned %4.3f at %4.3f, %4.3f, %4.3f - Took %lf",
this->GetCleanName(),
new_z,
@@ -875,7 +875,7 @@ void Mob::FixZ() {
if (RuleB(Map, MobZVisualDebug))
this->SendAppearanceEffect(103, 0, 0, 0, 0);
Log(Logs::General, Logs::Debug, "%s is failing to find Z %f", this->GetCleanName(), std::abs(m_Position.z - new_z));
Log(Logs::General, Logs::FixZ, "%s is failing to find Z %f", this->GetCleanName(), std::abs(m_Position.z - new_z));
}
last_z = m_Position.z;
+5 -1
View File
@@ -1967,7 +1967,9 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
"npc_types.handtexture, "
"npc_types.legtexture, "
"npc_types.feettexture, "
"npc_types.ignore_despawn "
"npc_types.ignore_despawn, "
"npc_types.show_name, "
"npc_types.untargetable "
"FROM npc_types %s",
where_condition.c_str()
);
@@ -2143,6 +2145,8 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
temp_npctype_data->legtexture = atoi(row[95]);
temp_npctype_data->feettexture = atoi(row[96]);
temp_npctype_data->ignore_despawn = atoi(row[97]) == 1 ? true : false;
temp_npctype_data->show_name = atoi(row[98]) != 0 ? true : false;
temp_npctype_data->untargetable = atoi(row[99]) != 0 ? true : false;
// If NPC with duplicate NPC id already in table,
// free item we attempted to add.
+2
View File
@@ -133,6 +133,8 @@ struct NPCType
uint8 legtexture;
uint8 feettexture;
bool ignore_despawn;
bool show_name; // should default on
bool untargetable;
};
namespace player_lootitem {