diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 94765f34..a859c9dd 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -143,6 +143,7 @@ bool PlayerbotAIConfig::Initialize() randomBotTalk = sConfigMgr->GetOption("AiPlayerbot.RandomBotTalk", false); randomBotEmote = sConfigMgr->GetOption("AiPlayerbot.RandomBotEmote", false); randomBotSuggestDungeons = sConfigMgr->GetOption("AiPlayerbot.RandomBotSuggestDungeons", true); + randomBotGuildTalk = sConfigMgr->GetOption("AiPlayerbot.RandomBotGuildTalk", false); suggestDungeonsInLowerCaseRandomly = sConfigMgr->GetOption("AiPlayerbot.SuggestDungeonsInLowerCaseRandomly", false); randomBotJoinBG = sConfigMgr->GetOption("AiPlayerbot.RandomBotJoinBG", true); randomBotAutoJoinBG = sConfigMgr->GetOption("AiPlayerbot.RandomBotAutoJoinBG", false); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index c008c051..129daee3 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -98,6 +98,7 @@ class PlayerbotAIConfig bool randomBotTalk; bool randomBotEmote; bool randomBotSuggestDungeons; + bool randomBotGuildTalk; bool suggestDungeonsInLowerCaseRandomly; bool randomBotJoinBG; bool randomBotAutoJoinBG; diff --git a/src/strategy/actions/AutoLearnSpellAction.cpp b/src/strategy/actions/AutoLearnSpellAction.cpp index 4ef4f1e8..24205a64 100644 --- a/src/strategy/actions/AutoLearnSpellAction.cpp +++ b/src/strategy/actions/AutoLearnSpellAction.cpp @@ -36,7 +36,7 @@ void AutoLearnSpellAction::LearnSpells(std::ostringstream* out) if (sPlayerbotAIConfig->autoLearnQuestSpells && sRandomPlayerbotMgr->IsRandomBot(bot))// || (!botAI->GetMaster() && sRandomPlayerbotMgr->IsRandomBot(bot))) LearnQuestSpells(out); - if (sPlayerbotAIConfig->randomBotTalk) + if (sPlayerbotAIConfig->randomBotGuildTalk) { Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); if (guild) diff --git a/src/strategy/actions/LootAction.cpp b/src/strategy/actions/LootAction.cpp index ff383ef7..10ae1ccc 100644 --- a/src/strategy/actions/LootAction.cpp +++ b/src/strategy/actions/LootAction.cpp @@ -417,7 +417,7 @@ bool StoreLootAction::Execute(Event event) if (proto->Quality >= ITEM_QUALITY_RARE && !urand(0, 1) && botAI->HasStrategy("emote", BOT_STATE_NON_COMBAT)) botAI->PlayEmote(TEXT_EMOTE_CHEER); - if (sPlayerbotAIConfig->randomBotTalk && bot->GetGuildId() && urand(0, 10) && proto->Quality >= ITEM_QUALITY_RARE) + if (sPlayerbotAIConfig->randomBotGuildTalk && bot->GetGuildId() && urand(0, 10) && proto->Quality >= ITEM_QUALITY_RARE) { Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); diff --git a/src/strategy/actions/SayAction.cpp b/src/strategy/actions/SayAction.cpp index e299736d..2bcca877 100644 --- a/src/strategy/actions/SayAction.cpp +++ b/src/strategy/actions/SayAction.cpp @@ -674,7 +674,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32 else if (type == CHAT_MSG_GUILD) { - if (!bot->GetGuildId()) + if (!bot->GetGuildId() || !sPlayerbotAIConfig->randomBotGuildTalk) return; Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); diff --git a/src/strategy/actions/SuggestWhatToDoAction.cpp b/src/strategy/actions/SuggestWhatToDoAction.cpp index e9006fc6..776c1ac9 100644 --- a/src/strategy/actions/SuggestWhatToDoAction.cpp +++ b/src/strategy/actions/SuggestWhatToDoAction.cpp @@ -306,13 +306,13 @@ void SuggestWhatToDoAction::spam(std::string msg, uint8 flags, bool worldChat, b if (Channel* worldChannel = cMgr->GetChannel("World", bot)) worldChannel->Say(bot->GetGUID(), msg.c_str(), LANG_UNIVERSAL); } + } - if (guild && bot->GetGuildId()) - { - Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); - if (guild) - guild->BroadcastToGuild(bot->GetSession(), false, msg.c_str(), LANG_UNIVERSAL); - } + if (sPlayerbotAIConfig->randomBotGuildTalk && guild && bot->GetGuildId()) + { + Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); + if (guild) + guild->BroadcastToGuild(bot->GetSession(), false, msg.c_str(), LANG_UNIVERSAL); } } @@ -355,6 +355,8 @@ bool SuggestDungeonAction::Execute(Event event) { // TODO: use sPlayerbotDungeonSuggestionMgr + if (!sPlayerbotAIConfig->randomBotSuggestDungeons || bot->GetGroup()) return false; + if (instances.empty()) { instances["Ragefire Chasm"] = 15; diff --git a/src/strategy/actions/XpGainAction.cpp b/src/strategy/actions/XpGainAction.cpp index 39ff7d4f..8dc98ca6 100644 --- a/src/strategy/actions/XpGainAction.cpp +++ b/src/strategy/actions/XpGainAction.cpp @@ -33,7 +33,7 @@ bool XpGainAction::Execute(Event event) p >> groupBonus; // 8 group bonus } - if (sPlayerbotAIConfig->randomBotTalk && bot->GetGuildId() && urand(0, 10)) + if (sPlayerbotAIConfig->randomBotGuildTalk && bot->GetGuildId() && urand(0, 10)) { Creature* creature = botAI->GetCreature(guid); if (creature && (creature->isElite() || creature->isWorldBoss() || creature->GetLevel() > 61 || creature->GetLevel() > bot->GetLevel() + 4))