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

View File

@ -686,6 +686,7 @@ RULE_BOOL(NPC, NPCIgnoreLevelBasedHasteCaps, false, "Ignores hard coded level ba
RULE_INT(NPC, NPCHasteCap, 150, "Haste cap for non-v3(over haste) haste")
RULE_INT(NPC, NPCHastev3Cap, 25, "Haste cap for v3(over haste) haste")
RULE_STRING(NPC, ExcludedFaceTargetRaces, "52,72,73,141,233,328,329,372,376,377,378,379,380,381,382,383,404,422,423,424,425,426,428,429,445,449,460,462,463,500,501,502,503,504,505,506,507,508,509,510,511,513,514,515,516,533,534,535,536,537,538,539,540,541,542,543,544,545,546,550,551,552,553,554,555,556,557,567,573,577,586,589,590,591,592,593,595,596,599,601,616,619,621,628,629,630,633,634,635,636,665,683,684,685,691,692,693,694,702,703,705,706,707,710,711,714,720,2250,2254", "Race IDs excluded from facing target when hailed")
RULE_BOOL(NPC, ResetUnderworldMobsToSpawn, false, "Reset mobs that are under the world back to spawn point if valid. DEFAULT: False")
RULE_CATEGORY_END()
RULE_CATEGORY(Aggro)

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();