diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index b611f620..d319b05f 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -1002,23 +1002,26 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) if (lang == LANG_ADDON) return; - if (message.starts_with(sPlayerbotAIConfig->toxicLinksPrefix) - && (GetChatHelper()->ExtractAllItemIds(message).size() > 0 || GetChatHelper()->ExtractAllQuestIds(message).size() > 0) - && sPlayerbotAIConfig->toxicLinksRepliesChance) - { - if (urand(0, 50) > 0 || urand(1, 100) > sPlayerbotAIConfig->toxicLinksRepliesChance) - { - return; - } - } - else if ((GetChatHelper()->ExtractAllItemIds(message).count(19019) && sPlayerbotAIConfig->thunderfuryRepliesChance)) - { - if (urand(0, 60) > 0 || urand(1, 100) > sPlayerbotAIConfig->thunderfuryRepliesChance) - { - return; - } - } - else + // Disable since ExtractAllItemIds bad performance + // if (message.starts_with(sPlayerbotAIConfig->toxicLinksPrefix) && + // (GetChatHelper()->ExtractAllItemIds(message).size() > 0 || + // GetChatHelper()->ExtractAllQuestIds(message).size() > 0) && + // sPlayerbotAIConfig->toxicLinksRepliesChance) + // { + // if (urand(0, 50) > 0 || urand(1, 100) > sPlayerbotAIConfig->toxicLinksRepliesChance) + // { + // return; + // } + // } + // else if ((GetChatHelper()->ExtractAllItemIds(message).count(19019) && + // sPlayerbotAIConfig->thunderfuryRepliesChance)) + // { + // if (urand(0, 60) > 0 || urand(1, 100) > sPlayerbotAIConfig->thunderfuryRepliesChance) + // { + // return; + // } + // } + // else { if (isFromFreeBot && urand(0, 20)) return; @@ -2782,7 +2785,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, // break; // } // } - + if (target->IsImmunedToSpell(spellInfo)) { if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) diff --git a/src/strategy/actions/AcceptQuestAction.cpp b/src/strategy/actions/AcceptQuestAction.cpp index 72abeef9..fcbd2438 100644 --- a/src/strategy/actions/AcceptQuestAction.cpp +++ b/src/strategy/actions/AcceptQuestAction.cpp @@ -88,7 +88,7 @@ bool AcceptQuestAction::Execute(Event event) std::stringstream ss; ss << "AcceptQuestAction {" << qInfo->GetTitle() << "} - {" << std::to_string(qInfo->GetQuestId()) << "}"; LOG_INFO("playerbots", "{}", ss.str().c_str()); - botAI->TellMaster(ss.str()); + // botAI->TellMaster(ss.str()); } return hasAccept; diff --git a/src/strategy/actions/SayAction.cpp b/src/strategy/actions/SayAction.cpp index afd18353..6bf973ab 100644 --- a/src/strategy/actions/SayAction.cpp +++ b/src/strategy/actions/SayAction.cpp @@ -205,20 +205,21 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32& type, uint32& guid1, uint return; } - //toxic links - if (msg.starts_with(sPlayerbotAIConfig->toxicLinksPrefix) - && (GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllItemIds(msg).size() > 0 || GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllQuestIds(msg).size() > 0)) - { - HandleToxicLinksReply(bot, chatChannelSource, msg, name); - return; - } + // Disable since ExtractAllItemIds bad performance + // //toxic links + // if (msg.starts_with(sPlayerbotAIConfig->toxicLinksPrefix) + // && (GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllItemIds(msg).size() > 0 || GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllQuestIds(msg).size() > 0)) + // { + // HandleToxicLinksReply(bot, chatChannelSource, msg, name); + // return; + // } - //thunderfury - if (GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllItemIds(msg).count(19019)) - { - HandleThunderfuryReply(bot, chatChannelSource, msg, name); - return; - } + // //thunderfury + // if (GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllItemIds(msg).count(19019)) + // { + // HandleThunderfuryReply(bot, chatChannelSource, msg, name); + // return; + // } auto messageRepy = GenerateReplyMessage(bot, msg, guid1, name); SendGeneralResponse(bot, chatChannelSource, messageRepy, name); @@ -316,6 +317,8 @@ bool ChatReplyAction::HandleToxicLinksReply(Player* bot, ChatChannelSource chatC } bool ChatReplyAction::HandleWTBItemsReply(Player* bot, ChatChannelSource chatChannelSource, std::string& msg, std::string& name) { + // Disable since ExtractAllItemIds bad performance + return false; auto messageItemIds = GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllItemIds(msg); if (messageItemIds.empty()) @@ -409,6 +412,8 @@ bool ChatReplyAction::HandleWTBItemsReply(Player* bot, ChatChannelSource chatCha } bool ChatReplyAction::HandleLFGQuestsReply(Player* bot, ChatChannelSource chatChannelSource, std::string& msg, std::string& name) { + // Disable since ExtractAllQuestIds bad performance + return false; auto messageQuestIds = GET_PLAYERBOT_AI(bot)->GetChatHelper()->ExtractAllQuestIds(msg); if (messageQuestIds.empty())