diff --git a/changelog.txt b/changelog.txt index 0614ff4a8..b561c34ab 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 7/1/2017 == +Akkadius: Resolve issues with NPC's hopping to the ceiling in small corridors +Akkadius: Improved grounding issues with NPC's during combat +Akkadius: Improved scenarios where NPC's need to be dragged out of the ground - they should correct themselves far more consistently + - Scenarios where an NPC is coming up from the bottom floor, or from the top floor, they will correct much better + - A video of these tests can be found here: https://www.youtube.com/watch?v=HtC7bVNM7ZQ&feature=youtu.be + == 6/28/2017 == Akkadius: Fixed issues with Z correctness when NPCs are pathing on normal grids Akkadius: Fixed issues with Z correctness when NPCs are engaged with players following diff --git a/zone/mob.h b/zone/mob.h index bb07679c8..aa4b3fb29 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -492,6 +492,7 @@ public: inline const float GetTarVZ() const { return m_TargetV.z; } inline const float GetTarVector() const { return tar_vector; } inline const uint8 GetTarNDX() const { return tar_ndx; } + inline const int8 GetFlyMode() const { return flymode; } bool IsBoat() const; //Group diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 20d22c42f..58d685df4 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -998,9 +998,16 @@ void Mob::AI_Process() { /* Fix Z when following during pull, not when engaged and stationary */ if (moving && fix_z_timer_engaged.Check()) - if(this->GetTarget()) - if(DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()) > 50) + if (this->GetTarget()) { + /* If we are engaged, moving and following client, let's look for best Z more often */ + if (DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()) > 50) { this->FixZ(); + } + /* If we are close to client and our Z differences aren't big, match the client */ + else if (std::abs(this->GetZ() - this->GetTarget()->GetZ()) < 20){ + this->m_Position.z = this->GetTarget()->GetZ(); + } + } if (!(m_PlayerState & static_cast(PlayerState::Aggressive))) SendAddPlayerState(PlayerState::Aggressive); diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 2271bced0..c034c1578 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -879,8 +879,8 @@ void Mob::FixZ() { if (!RuleB(Watermap, CheckForWaterWhenMoving) || !zone->HasWaterMap() || (zone->HasWaterMap() && !zone->watermap->InWater(glm::vec3(m_Position)))) { - - float new_z = this->FindGroundZ(m_Position.x, m_Position.y, 10); + /* Any more than 5 in the offset makes NPC's hop/snap to ceiling in small corridors */ + float new_z = this->FindGroundZ(m_Position.x, m_Position.y, 5); auto duration = timer.elapsed();