[Rule] Undead Aggro (#3881)

* [Rule] Undead Aggro

Add rule for undead aggro and check for undead at aggro check time

* Add Rule

* Requested Change
This commit is contained in:
Fryguy 2024-01-07 12:13:30 -05:00 committed by GitHub
parent b83373491e
commit 611122833d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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() &&