From ab2420d89ad120d90dcfe2861d5c9dbb8287b011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Tue, 21 Mar 2023 13:10:29 -0600 Subject: [PATCH] Reduce chat spam once more --- src/PlayerbotAI.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 6625d774..2f50ffee 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -714,17 +714,13 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) return; // Reduce chat spam - if (isRandomBot && HasManyPlayersNearby() && urand(0, 10)) + if (HasRealPlayerMaster()) return; - if (isRandomBot && (msgtype == CHAT_MSG_SAY || msgtype == CHAT_MSG_YELL) && urand(0, 10)) + if (isRandomBot && urand(0, 20)) return; - if (isRandomBot && HasRealPlayerMaster() && urand(0, 5)) - return; - - - if (!message.empty() && ((isRandomBot && !isPaused && (!urand(0, 20) || (!urand(0, 10) && message.find(bot->GetName()) != std::string::npos))) || (!isRandomBot && (isMentioned || msgtype != CHAT_MSG_CHANNEL || !urand(0, 4))))) + if (!message.empty() && ((isRandomBot && !isPaused && (!urand(0, 20) || (!urand(0, 10) && message.find(bot->GetName()) != std::string::npos))) || (!isRandomBot && (isMentioned || !urand(0, 4))))) { QueueChatResponse(msgtype, guid1, ObjectGuid(), message, chanName, name); GetAiObjectContext()->GetValue("last said", "chat")->Set(time(0) + urand(5, 25));