diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index c4cbea4fb..bde77822b 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -379,7 +379,8 @@ struct NewZone_Struct { /*0708*/ uint32 FastRegenHP; /*0712*/ uint32 FastRegenMana; /*0716*/ uint32 FastRegenEndurance; -/*0720*/ +/*0720*/ uint32 NPCAggroMaxDist; +/*0724*/ }; /* diff --git a/common/version.h b/common/version.h index a6ea279c5..a7e066ab1 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9126 +#define CURRENT_BINARY_DATABASE_VERSION 9127 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9019 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index d0efc8d74..e84395a54 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -380,6 +380,7 @@ 9124|2018_07_09_tasks.sql|SHOW COLUMNS FROM `tasks` LIKE 'type'|empty| 9125|2018_07_20_task_emote.sql|SHOW COLUMNS FROM `tasks` LIKE 'completion_emote'|empty| 9126|2018_09_07_FastRegen.sql|SHOW COLUMNS FROM `zone` LIKE 'fast_regen_hp'|empty| +9127|2018_09_07_NPCMaxAggroDist.sql|SHOW COLUMNS FROM `zone` LIKE 'npc_max_aggro_dist'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2018_09_07_NPCMaxAggroDist.sql b/utils/sql/git/required/2018_09_07_NPCMaxAggroDist.sql new file mode 100644 index 000000000..239a483a5 --- /dev/null +++ b/utils/sql/git/required/2018_09_07_NPCMaxAggroDist.sql @@ -0,0 +1 @@ +ALTER TABLE `zone` ADD `npc_max_aggro_dist` INT NOT NULL DEFAULT '600'; diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 5fd422035..766929c97 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1194,7 +1194,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 (hate_list_cleanup_timer.Check()) { - hate_list.RemoveStaleEntries(600000, 600.0f); + hate_list.RemoveStaleEntries(600000, static_cast(zone->newzone_data.NPCAggroMaxDist)); if (hate_list.IsHateListEmpty()) { AI_Event_NoLongerEngaged(); zone->DelAggroMob(); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index b08b0d32d..cced38aac 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -146,7 +146,8 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "gravity, " // 56 "fast_regen_hp, " // 57 "fast_regen_mana, " // 58 - "fast_regen_endurance " // 59 + "fast_regen_endurance, " // 59 + "npc_max_aggro_dist " // 60 "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); @@ -194,6 +195,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zone_data->FastRegenHP = atoi(row[57]); zone_data->FastRegenMana = atoi(row[58]); zone_data->FastRegenEndurance = atoi(row[59]); + zone_data->NPCAggroMaxDist = atoi(row[60]); int bindable = 0; bindable = atoi(row[31]);