From 611122833d946592e0a68f14d3eb131e87c572fd Mon Sep 17 00:00:00 2001 From: Fryguy Date: Sun, 7 Jan 2024 12:13:30 -0500 Subject: [PATCH] [Rule] Undead Aggro (#3881) * [Rule] Undead Aggro Add rule for undead aggro and check for undead at aggro check time * Add Rule * Requested Change --- common/ruletypes.h | 1 + zone/aggro.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 3b92b6aa5..e887b14c1 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -605,6 +605,7 @@ RULE_INT(Aggro, ClientAggroCheckIdleInterval, 6000, "Interval in which clients a RULE_REAL(Aggro, PetAttackRange, 40000.0, "Maximum squared range /pet attack works at default is 200") RULE_BOOL(Aggro, NPCAggroMaxDistanceEnabled, true, "If enabled, NPC's will drop aggro beyond 600 units or what is defined at the zone level") RULE_BOOL(Aggro, AggroPlayerPets, false, "If enabled, NPCs will aggro player pets") +RULE_BOOL(Aggro, UndeadAlwaysAggro, true, "should undead always aggro?") RULE_CATEGORY_END() RULE_CATEGORY(TaskSystem) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index ada93ac97..d3d98489d 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -524,7 +524,8 @@ bool Mob::CheckWillAggro(Mob *mob) { } else { if ( ( - GetINT() <= RuleI(Aggro, IntAggroThreshold) || + (RuleB(Aggro, UndeadAlwaysAggro) && GetBodyType() == BT_Undead) || + (GetINT() <= RuleI(Aggro, IntAggroThreshold)) || AlwaysAggro() || ( mob->IsClient() &&