From 7881d6609a538451eabb99811660b7005d1a3910 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 16 Jul 2017 22:34:22 -0500 Subject: [PATCH 01/11] Make sure we send client updates for heading or animation changes while still --- zone/client_packet.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index f2906e093..e8ae68e69 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -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)); From 78d95cab89d971343c22c29256dd4b2120eec5c9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 16 Jul 2017 23:55:15 -0500 Subject: [PATCH 02/11] Fix logic loop issue with NPC pathing in zones with .path files, this creates a new rule in place of the old and a new one will be automatically created in the database --- common/ruletypes.h | 2 +- zone/pathing.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index fe385b18f..a51a224b0 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -290,7 +290,7 @@ RULE_BOOL(Pathing, AggroReturnToGrid, true) // Enable pathing for aggroed roamin RULE_BOOL(Pathing, Guard, true) // Enable pathing for mobs moving to their guard point. RULE_BOOL(Pathing, Find, true) // Enable pathing for FindPerson requests from the client. RULE_BOOL(Pathing, Fear, true) // Enable pathing for fear -RULE_REAL(Pathing, ZDiffThreshold, 10) // If a mob las LOS to it's target, it will run to it if the Z difference is < this. +RULE_REAL(Pathing, ZDiffThresholdNew, 80) // If a mob las LOS to it's target, it will run to it if the Z difference is < this. RULE_INT(Pathing, LOSCheckFrequency, 1000) // A mob will check for LOS to it's target this often (milliseconds). RULE_INT(Pathing, RouteUpdateFrequencyShort, 1000) // How often a new route will be calculated if the target has moved. RULE_INT(Pathing, RouteUpdateFrequencyLong, 5000) // How often a new route will be calculated if the target has moved. diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 25d996eac..009c1a152 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -759,7 +759,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa Log(Logs::Detail, Logs::None, " 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 @@ -851,7 +851,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa Log(Logs::Detail, Logs::None, " 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 @@ -888,7 +888,7 @@ 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))) { + (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) { Log(Logs::Detail, Logs::None, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; @@ -1039,7 +1039,7 @@ 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))) { + (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) { Log(Logs::Detail, Logs::None, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) @@ -1143,7 +1143,7 @@ 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)) { + if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThresholdNew)) { 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", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); @@ -1215,7 +1215,7 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To) } else { - if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { + if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThresholdNew)) { Log(Logs::Detail, Logs::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", std::abs(NewZ - best_z2)); From a83edb83bad31ffa681a62ebac623879391f56c7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 18 Jul 2017 15:26:20 -0500 Subject: [PATCH 03/11] Change eqemu_server.pl to use new map download methodology --- utils/scripts/eqemu_server.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/scripts/eqemu_server.pl b/utils/scripts/eqemu_server.pl index ef7e56a35..42d956edd 100644 --- a/utils/scripts/eqemu_server.pl +++ b/utils/scripts/eqemu_server.pl @@ -1454,7 +1454,7 @@ sub map_files_fetch_bulk{ get_remote_file("http://github.com/Akkadius/EQEmuMaps/archive/master.zip", "maps/maps.zip", 1); unzip('maps/maps.zip', 'maps/'); my @files; - my $start_dir = "maps/EQEmuMaps-master/maps"; + my $start_dir = "maps/EQEmuMaps-master/"; find( sub { push @files, $File::Find::name unless -d; }, $start_dir @@ -2179,4 +2179,5 @@ sub generate_random_password { map $alphanumeric[rand @alphanumeric], 0..$passwordsize; return $randpassword; -} \ No newline at end of file +} + From 7cda4aaa2c0fb6cd7c4a7674c22a93dd42456ac6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 18 Jul 2017 19:09:28 -0500 Subject: [PATCH 04/11] Fix some pathing logic that is using Z to match a node reach when it is error prone in certain scenarios Fixed a decent amount of path logging --- common/eqemu_logsys.h | 4 +- zone/pathing.cpp | 134 +++++++++++++++++++++--------------------- zone/waypoints.cpp | 4 +- 3 files changed, 72 insertions(+), 70 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 7ae5a0296..56542c07d 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -87,6 +87,7 @@ enum LogCategory { Client_Login, Headless_Client, HP_Update, + FixZ, MaxCategoryID /* Don't Remove this*/ }; @@ -138,7 +139,8 @@ static const char* LogCategoryName[LogCategory::MaxCategoryID] = { "Login Server", "Client Login", "Headless Client", - "HP Update" + "HP Update", + "FixZ" }; } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 009c1a152..5fe4a7e57 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -206,7 +206,7 @@ glm::vec3 PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque 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 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 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 noderoute; @@ -384,7 +384,7 @@ std::deque 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 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 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 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,17 +746,17 @@ 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, ZDiffThresholdNew))) { @@ -764,18 +764,18 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa 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,11 +844,11 @@ 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, ZDiffThresholdNew))) { @@ -856,18 +856,18 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa 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. @@ -889,23 +889,23 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) { - Log(Logs::Detail, Logs::None, " Checking for short LOS at distance %8.3f.", Distance); + 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,7 +945,7 @@ 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()); @@ -953,7 +953,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa // Check if we have reached a path node. if(NodeLoc == From) { - 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; } @@ -1040,22 +1040,22 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) { - Log(Logs::Detail, Logs::None, " Checking for long LOS at distance %8.3f.", Distance); + 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; @@ -1144,14 +1144,14 @@ bool PathManager::NoHazards(glm::vec3 From, glm::vec3 To) float NewZ = zone->zonemap->FindBestZ(MidPoint, nullptr); if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThresholdNew)) { - 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", + 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, ZDiffThresholdNew)) { - Log(Logs::Detail, Logs::None, + 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); } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 15ab630ca..c56f0daaf 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -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; From 20b6c2f556b4ff9c8c3b311f921ca7e989d1c6cd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 18 Jul 2017 19:16:41 -0500 Subject: [PATCH 05/11] One more NodeLoc compare adjustment --- zone/pathing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 5fe4a7e57..0bc054d58 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -951,7 +951,7 @@ 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 // Check if we have reached a path node. - if(NodeLoc == From) + if(NodeLoc.x == From.x && NodeLoc.y == From.y) { Log(Logs::Detail, Logs::Pathing, " Arrived at node %i, moving to next one.\n", Route.front()); From ec77e3a6fd2e2529a7e8e2b329a0c5d08faec9bf Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 19 Jul 2017 02:17:08 -0400 Subject: [PATCH 06/11] Add show_name and untargetable to npc_types fixes #637 Note the bodytype hack is still there since I was having issues with some npcs still showing names --- common/eq_packet_structs.h | 1 + common/patches/rof.cpp | 2 +- common/patches/rof2.cpp | 2 +- common/patches/sod.cpp | 2 +- common/patches/sof.cpp | 10 +++++----- common/patches/uf.cpp | 2 +- utils/sql/git/required/2017_07_19_show_name.sql | 3 +++ zone/client.cpp | 1 + zone/entity.cpp | 4 ++++ zone/npc.cpp | 2 ++ zone/zonedb.cpp | 6 +++++- zone/zonedump.h | 2 ++ 12 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 utils/sql/git/required/2017_07_19_show_name.sql diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index c234e303a..6e853b4bd 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -305,6 +305,7 @@ union uint8 DestructibleUnk8; uint32 DestructibleUnk9; bool targetable_with_hotkey; + bool show_name; }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 23e521a57..7ce6f900f 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -3930,7 +3930,7 @@ namespace RoF if (strlen(emu->suffix)) PacketSize += strlen(emu->suffix) + 1; - bool ShowName = 1; + bool ShowName = emu->show_name; if (emu->bodytype >= 66) { emu->race = 127; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 5befaf08c..30efa95b9 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -4086,7 +4086,7 @@ namespace RoF2 PacketSize += strlen(emu->DestructibleString) + 1; } - bool ShowName = 1; + bool ShowName = emu->show_name; if (emu->bodytype >= 66) { emu->race = 127; diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index f6d85f2bb..276f939e5 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -2560,7 +2560,7 @@ namespace SoD PacketSize += strlen(emu->DestructibleString) + 1; } - bool ShowName = 1; + bool ShowName = emu->show_name; if (emu->bodytype >= 66) { emu->race = 127; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 44f093044..77d65ce16 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -2097,7 +2097,7 @@ namespace SoF int k; for (r = 0; r < entrycount; r++, eq++, emu++) { - eq->showname = 1; //New Field - Toggles Name Display on or off - 0 = off, 1 = on + eq->showname = emu->show_name ? 1 : 0; //New Field - Toggles Name Display on or off - 0 = off, 1 = on eq->linkdead = 0; //New Field - Toggles LD on or off after name - 0 = off, 1 = on eq->statue = 0; //New Field - 1 freezes animation eq->showhelm = emu->showhelm; @@ -2136,10 +2136,10 @@ namespace SoF eq->findable = emu->findable; if (emu->bodytype >= 66) { - eq->bodytype = 11; //non-targetable - eq->showname = 0; //no visible name - eq->race = 127; //invisible man - eq->gender = 0; //invisible men are gender 0 + eq->bodytype = 11; //non-targetable + eq->showname = 0; //no visible name + eq->race = 127; //invisible man + eq->gender = 0; //invisible men are gender 0 } else { diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index b6d251953..8b0c86cc5 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -2844,7 +2844,7 @@ namespace UF PacketSize += strlen(emu->DestructibleString) + 1; } - bool ShowName = 1; + bool ShowName = emu->show_name; if (emu->bodytype >= 66) { emu->race = 127; diff --git a/utils/sql/git/required/2017_07_19_show_name.sql b/utils/sql/git/required/2017_07_19_show_name.sql new file mode 100644 index 000000000..e5bda11cf --- /dev/null +++ b/utils/sql/git/required/2017_07_19_show_name.sql @@ -0,0 +1,3 @@ +ALTER TABLE `npc_types` ADD COLUMN `show_name` TINYINT(2) NOT NULL DEFAULT 1; +ALTER TABLE `npc_types` ADD COLUMN `untargetable` TINYINT(2) NOT NULL DEFAULT 0; +UPDATE `npc_types` SET `show_name` = 0, `untargetable` = 1 WHERE `bodytype` >= 66; diff --git a/zone/client.cpp b/zone/client.cpp index 12988450b..4866013a3 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -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); diff --git a/zone/entity.cpp b/zone/entity.cpp index 52eb41165..e9d8139a7 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -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(); diff --git a/zone/npc.cpp b/zone/npc.cpp index 8ddd9b2e3..a4e6c4214 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -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) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index d647dcbf7..c90b30ce7 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -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. diff --git a/zone/zonedump.h b/zone/zonedump.h index 713bfca7e..2bd78c2d8 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -133,6 +133,8 @@ struct NPCType uint8 legtexture; uint8 feettexture; bool ignore_despawn; + bool show_name; // should default on + bool untargetable; }; namespace player_lootitem { From 12bed1462ff403e019b6564532a3d5eb02f25ad2 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 19 Jul 2017 12:59:02 -0400 Subject: [PATCH 07/11] Forgot to update manifest last night --- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/version.h b/common/version.h index 2391862a1..a1cfbce16 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9112 +#define CURRENT_BINARY_DATABASE_VERSION 9113 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 5586b9848..8070c328e 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -366,6 +366,7 @@ 9110|2017_04_10_graveyard.sql|show index from graveyard WHERE key_name = 'zone_id_nonunique'|empty| 9111|2017_06_24_saylink_index.sql|SHOW INDEX FROM `saylink` WHERE `key_name` = 'phrase_index'|empty| 9112|2017_06_24_rule_values_expand.sql|SHOW COLUMNS FROM rule_values WHERE Field = 'rule_value' and Type = 'varchar(30)'|empty| +9113|2017_07_19_show_name.sql|SHOW COLUMNS FROM `npc_types` LIKE 'show_name'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not From d8bbd85abb2f976adc8f9eaa5809a33e0883bfe1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 21 Jul 2017 00:46:12 -0500 Subject: [PATCH 08/11] Fix issue with clients logging in locally on the same subnet --- world/client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/world/client.cpp b/world/client.cpp index 4fd157088..aaf7d4c9c 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1281,6 +1281,10 @@ void Client::Clearance(int8 response) } else { zs_addr = zs->GetIP().c_str(); + if (!zs_addr[0]) { + zs_addr = WorldConfig::get()->LocalAddress.c_str(); + } + if(strcmp(zs_addr, "127.0.0.1") == 0) { Log(Logs::Detail, Logs::World_Server, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str()); From aa8a2ea41bde4d49d483efbf16b2ba33eefee878 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Fri, 21 Jul 2017 14:56:51 -0400 Subject: [PATCH 09/11] Repair fear pathing to ignore Z aspects and allow FixZ and pathing to handle it. Added the true flag for ResistCheck.Charisma so the proper Charisma bonuses are applied. --- zone/fearpath.cpp | 30 +++++++----------------------- zone/spell_effects.cpp | 2 +- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index ea5bb16d9..e0217bd5e 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -152,28 +152,12 @@ void Mob::CalculateNewFearpoint() Log(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection."); } - int loop = 0; - float ranx, rany, ranz; - currently_fleeing = false; - while (loop < 100) //Max 100 tries - { - int ran = 250 - (loop*2); - loop++; - ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); - rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); - ranz = FindGroundZ(ranx,rany); - if (ranz == -999999) - continue; - float fdist = ranz - GetZ(); - if (fdist >= -12 && fdist <= 12 && CheckCoordLosNoZLeaps(GetX(),GetY(),GetZ(),ranx,rany,ranz)) - { - currently_fleeing = true; - break; - } - } - if (currently_fleeing) - m_FearWalkTarget = glm::vec3(ranx, rany, ranz); - else //Break fear - BuffFadeByEffect(SE_Fear); + int ran = 250; + float ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); + float rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); + + m_FearWalkTarget = glm::vec3(ranx, rany, GetZ()); + + currently_fleeing = true; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 42b50edf3..2f0d65907 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -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; From a36b37b1ea1724d43aa777e8f13e6cca9d353c5c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 21 Jul 2017 16:53:27 -0500 Subject: [PATCH 10/11] Adjust syntax --- zone/fearpath.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index e0217bd5e..6632cc6fa 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -153,11 +153,11 @@ void Mob::CalculateNewFearpoint() } int ran = 250; - float ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); - float rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); - - m_FearWalkTarget = glm::vec3(ranx, rany, GetZ()); - - currently_fleeing = true; + float ranx = GetX() + zone->random.Int(0, ran - 1) - zone->random.Int(0, ran - 1); + float rany = GetY() + zone->random.Int(0, ran - 1)-zone->random.Int(0, ran - 1); + + m_FearWalkTarget = glm::vec3(ranx, rany, GetZ()); + + currently_fleeing = true; } From e84799e15b9948873ffcab26f335ed9c353e8187 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sat, 22 Jul 2017 12:45:21 -0400 Subject: [PATCH 11/11] Went back to older fearpath, only kept change where pathing issues can't cause the fear spell to be dropped. --- zone/fearpath.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index e0217bd5e..4d39717b5 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -152,12 +152,26 @@ void Mob::CalculateNewFearpoint() Log(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection."); } - int ran = 250; - float ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); - float rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); - - m_FearWalkTarget = glm::vec3(ranx, rany, GetZ()); - - currently_fleeing = true; + int loop = 0; + float ranx, rany, ranz; + currently_fleeing = false; + while (loop < 100) //Max 100 tries + { + int ran = 250 - (loop*2); + loop++; + ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); + rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); + ranz = FindGroundZ(ranx,rany); + if (ranz == -999999) + continue; + float fdist = ranz - GetZ(); + if (fdist >= -12 && fdist <= 12 && CheckCoordLosNoZLeaps(GetX(),GetY(),GetZ(),ranx,rany,ranz)) + { + currently_fleeing = true; + break; + } + } + if (currently_fleeing) + m_FearWalkTarget = glm::vec3(ranx, rany, ranz); }