mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Add config to disable hunters from generating specified pet families (#1485)
* Add config to disable hunters from generating specified pet families * Fixed unrelated typo in config
This commit is contained in:
@@ -667,7 +667,7 @@ AiPlayerbot.IncrementalGearInit = 1
|
|||||||
AiPlayerbot.MinEnchantingBotLevel = 60
|
AiPlayerbot.MinEnchantingBotLevel = 60
|
||||||
|
|
||||||
# Enable expansion limitation for bot enchants
|
# 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)
|
# Default: 1 (enabled)
|
||||||
AiPlayerbot.LimitEnchantExpansion = 1
|
AiPlayerbot.LimitEnchantExpansion = 1
|
||||||
|
|
||||||
@@ -699,6 +699,10 @@ AiPlayerbot.AutoUpgradeEquip = 1
|
|||||||
# Default: 0 (disabled)
|
# Default: 0 (disabled)
|
||||||
AiPlayerbot.HunterWolfPet = 0
|
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 = ""
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -630,6 +630,9 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
sPlayerbotDungeonSuggestionMgr->LoadDungeonSuggestions();
|
sPlayerbotDungeonSuggestionMgr->LoadDungeonSuggestions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
excludedHunterPetFamilies.clear();
|
||||||
|
LoadList<std::vector<uint32>>(sConfigMgr->GetOption<std::string>("AiPlayerbot.ExcludedHunterPetFamilies", ""), excludedHunterPetFamilies);
|
||||||
|
|
||||||
LOG_INFO("server.loading", "---------------------------------------");
|
LOG_INFO("server.loading", "---------------------------------------");
|
||||||
LOG_INFO("server.loading", " AI Playerbots initialized ");
|
LOG_INFO("server.loading", " AI Playerbots initialized ");
|
||||||
LOG_INFO("server.loading", "---------------------------------------");
|
LOG_INFO("server.loading", "---------------------------------------");
|
||||||
|
|||||||
@@ -406,6 +406,8 @@ public:
|
|||||||
bool restrictHealerDPS = false;
|
bool restrictHealerDPS = false;
|
||||||
std::vector<uint32> restrictedHealerDPSMaps;
|
std::vector<uint32> restrictedHealerDPSMaps;
|
||||||
bool IsRestrictedHealerDPSMap(uint32 mapId) const;
|
bool IsRestrictedHealerDPSMap(uint32 mapId) const;
|
||||||
|
|
||||||
|
std::vector<uint32> excludedHunterPetFamilies;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define sPlayerbotAIConfig PlayerbotAIConfig::instance()
|
#define sPlayerbotAIConfig PlayerbotAIConfig::instance()
|
||||||
|
|||||||
@@ -895,6 +895,7 @@ void PlayerbotFactory::InitPet()
|
|||||||
std::vector<uint32> ids;
|
std::vector<uint32> ids;
|
||||||
|
|
||||||
CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates();
|
CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates();
|
||||||
|
|
||||||
for (CreatureTemplateContainer::const_iterator itr = creatures->begin(); itr != creatures->end(); ++itr)
|
for (CreatureTemplateContainer::const_iterator itr = creatures->begin(); itr != creatures->end(); ++itr)
|
||||||
{
|
{
|
||||||
if (!itr->second.IsTameable(bot->CanTameExoticPets()))
|
if (!itr->second.IsTameable(bot->CanTameExoticPets()))
|
||||||
@@ -910,6 +911,12 @@ void PlayerbotFactory::InitPet()
|
|||||||
if (onlyWolf && itr->second.family != CREATURE_FAMILY_WOLF)
|
if (onlyWolf && itr->second.family != CREATURE_FAMILY_WOLF)
|
||||||
continue;
|
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);
|
ids.push_back(itr->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user