add rule and consolidate logic

This commit is contained in:
Trust
2025-01-26 20:45:58 -05:00
parent 3ab671e7fe
commit 2bf0533194
2 changed files with 10 additions and 7 deletions
+9 -7
View File
@@ -596,13 +596,15 @@ bool NPC::Process()
}
// If mobs are under the world, move them back to spawn point.
if (!IsEngaged() && IsTrackable()) {
if (GetZ() <= zone->newzone_data.underworld) {
if (respawn2) {
Teleport(glm::vec3(respawn2->GetX(), respawn2->GetY(), respawn2->GetZ()));
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true);
}
}
if (
RuleB(NPC, ResetUnderworldMobsToSpawn) &&
!IsEngaged() &&
IsTrackable() &&
GetZ() <= zone->newzone_data.underworld &&
respawn2
) {
Teleport(glm::vec3(respawn2->GetX(), respawn2->GetY(), respawn2->GetZ()));
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0, true);
}
SpellProcess();