[Rule] Remove hard coded initial aggro in favor or an adjustable Rule (#4333)

* [Rule] Remove hard coded initial aggro in favor or an adjustable Rule

* Adjustments per comments
This commit is contained in:
Fryguy 2024-05-26 06:56:36 -04:00 committed by GitHub
parent f70078d62a
commit fccb205a1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View File

@ -664,6 +664,8 @@ RULE_BOOL(Aggro, NPCAggroMaxDistanceEnabled, true, "If enabled, NPC's will drop
RULE_BOOL(Aggro, AggroPlayerPets, false, "If enabled, NPCs will aggro player pets")
RULE_BOOL(Aggro, UndeadAlwaysAggro, true, "should undead always aggro?")
RULE_INT(Aggro, BardAggroCap, 40, "per song bard aggro cap.")
RULE_INT(Aggro, InitialAggroBonus, 100, "Initial Aggro Bonus, Default: 100")
RULE_INT(Aggro, InitialPetAggroBonus, 100, "Initial Pet Aggro Bonus, Default 100")
RULE_CATEGORY_END()
RULE_CATEGORY(TaskSystem)

View File

@ -3089,12 +3089,16 @@ void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bo
// Spell Casting Subtlety etc
int64 hatemod = 100 + other->spellbonuses.hatemod + other->itembonuses.hatemod + other->aabonuses.hatemod;
if (hatemod < 1)
if (hatemod < 1) {
hatemod = 1;
}
hate = ((hate * (hatemod)) / 100);
}
else {
hate += 100; // 100 bonus initial aggro
} else {
if (IsCharmed()){
hate += RuleI(Aggro, InitialPetAggroBonus);
} else {
hate += RuleI(Aggro, InitialAggroBonus);
}
}
// Pet that is /pet hold on will not add to their hate list if they're not engaged