diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 3b4a676f..344a969b 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -667,7 +667,7 @@ AiPlayerbot.IncrementalGearInit = 1 AiPlayerbot.MinEnchantingBotLevel = 60 # Enable expansion limitation for bot enchants -# If enabled, bots will not use TBC enchants until level 61 or WotLK enchanges until level 71 +# If enabled, bots will not use TBC enchants until level 61 or WotLK enchants until level 71 # Default: 1 (enabled) AiPlayerbot.LimitEnchantExpansion = 1 @@ -699,6 +699,10 @@ AiPlayerbot.AutoUpgradeEquip = 1 # Default: 0 (disabled) AiPlayerbot.HunterWolfPet = 0 +# Prohibit hunter bots from creating pets with any family ID listed below in ExcludedHunterPetFamilies +# See the creature_family database table for all pet families by ID (note: ID for spiders is 3) +AiPlayerbot.ExcludedHunterPetFamilies = "" + # # # diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 8db503ac..4d9f3935 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -630,6 +630,9 @@ bool PlayerbotAIConfig::Initialize() sPlayerbotDungeonSuggestionMgr->LoadDungeonSuggestions(); } + excludedHunterPetFamilies.clear(); + LoadList>(sConfigMgr->GetOption("AiPlayerbot.ExcludedHunterPetFamilies", ""), excludedHunterPetFamilies); + LOG_INFO("server.loading", "---------------------------------------"); LOG_INFO("server.loading", " AI Playerbots initialized "); LOG_INFO("server.loading", "---------------------------------------"); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 620288a3..54d8b007 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -406,6 +406,8 @@ public: bool restrictHealerDPS = false; std::vector restrictedHealerDPSMaps; bool IsRestrictedHealerDPSMap(uint32 mapId) const; + + std::vector excludedHunterPetFamilies; }; #define sPlayerbotAIConfig PlayerbotAIConfig::instance() diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index 6c2c0fe3..0fe95176 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -895,6 +895,7 @@ void PlayerbotFactory::InitPet() std::vector ids; CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates(); + for (CreatureTemplateContainer::const_iterator itr = creatures->begin(); itr != creatures->end(); ++itr) { if (!itr->second.IsTameable(bot->CanTameExoticPets())) @@ -910,6 +911,12 @@ void PlayerbotFactory::InitPet() if (onlyWolf && itr->second.family != CREATURE_FAMILY_WOLF) continue; + // Exclude configured pet families + if (std::find(sPlayerbotAIConfig->excludedHunterPetFamilies.begin(), + sPlayerbotAIConfig->excludedHunterPetFamilies.end(), + itr->second.family) != sPlayerbotAIConfig->excludedHunterPetFamilies.end()) + continue; + ids.push_back(itr->first); }