[Pathing] More z-clip improvements, Wurm and Spectral Iksar race adjustments (#2988)

This commit is contained in:
Chris Miles 2023-02-24 20:27:28 -06:00 committed by GitHub
parent 0cbfad975d
commit e103422ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -1073,9 +1073,15 @@ void Mob::AI_Process() {
if (engaged) {
if (IsNPC() && m_z_clip_check_timer.Check()) {
auto t = GetTarget();
if (t && DistanceNoZ(GetPosition(), t->GetPosition()) < 75 && std::abs(GetPosition().z - t->GetPosition().z) > 15 && !CheckLosFN(t)) {
GMMove(t->GetPosition().x, t->GetPosition().y, t->GetPosition().z, t->GetPosition().w);
FaceTarget(t);
if (t) {
float self_z = GetZ() - GetZOffset();
float target_z = t->GetPosition().z - t->GetZOffset();
if (DistanceNoZ(GetPosition(), t->GetPosition()) < 75 &&
std::abs(self_z - target_z) >= 25 && !CheckLosFN(t)) {
float new_z = FindDestGroundZ(t->GetPosition());
GMMove(t->GetPosition().x, t->GetPosition().y, new_z + GetZOffset(), t->GetPosition().w, false);
FaceTarget(t);
}
}
}

View File

@ -159,6 +159,9 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
if (race == RACE_LAVA_DRAGON_49) {
size = 5;
}
if (race == RACE_WURM_158) {
size = 15;
}
taunting = false;
proximity = nullptr;

View File

@ -934,6 +934,7 @@ float Mob::GetZOffset() const {
case RACE_AMYGDALAN_663:
offset = 5.0f;
break;
case RACE_SPECTRAL_IKSAR_147:
case RACE_SANDMAN_664:
offset = 4.0f;
break;