Add rule Aggro:NPCAggroMaxDistanceEnabled - enabled by default

If enabled, NPC's will drop aggro beyond 600 units or what is defined at the zone level
This commit is contained in:
Akkadius
2018-05-25 22:41:46 -05:00
parent add0c4de47
commit 05ae8c8219
4 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -487,6 +487,10 @@ void Mob::AI_Start(uint32 iMoveDelay) {
AI_feign_remember_timer = std::unique_ptr<Timer>(new Timer(AIfeignremember_delay));
AI_scan_door_open_timer = std::unique_ptr<Timer>(new Timer(AI_scan_door_open_interval));
if(!RuleB(Aggro, NPCAggroMaxDistanceEnabled)) {
hate_list_cleanup_timer.Disable();
}
if (CastToNPC()->WillAggroNPCs())
AI_scan_area_timer = std::unique_ptr<Timer>(new Timer(RandomTimer(RuleI(NPC, NPCToNPCAggroTimerMin), RuleI(NPC, NPCToNPCAggroTimerMax))));
@@ -1163,7 +1167,7 @@ void Mob::AI_Process() {
// NPCs will forget people after 10 mins of not interacting with them or out of range
// both of these maybe zone specific, hardcoded for now
if (mHateListCleanup.Check()) {
if (hate_list_cleanup_timer.Check()) {
hate_list.RemoveStaleEntries(600000, 600.0f);
if (hate_list.IsHateListEmpty()) {
AI_Event_NoLongerEngaged();