From 90aa76e3c341dc4db653446fbb92e464a5e23762 Mon Sep 17 00:00:00 2001 From: Atidot3 Date: Sun, 28 Jul 2024 13:50:50 +0200 Subject: [PATCH] Polish bot chatting --- src/strategy/actions/SuggestWhatToDoAction.cpp | 9 +++++---- src/strategy/generic/EmoteStrategy.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/strategy/actions/SuggestWhatToDoAction.cpp b/src/strategy/actions/SuggestWhatToDoAction.cpp index dc9241f8..6ebf6802 100644 --- a/src/strategy/actions/SuggestWhatToDoAction.cpp +++ b/src/strategy/actions/SuggestWhatToDoAction.cpp @@ -93,7 +93,7 @@ void SuggestWhatToDoAction::specificQuest() placeholders["%role"] = chat->FormatClass(bot, AiFactory::GetPlayerSpecTab(bot)); placeholders["%quest"] = chat->FormatQuest(quest); - spam(BOT_TEXT2("suggest_quest", placeholders), urand(0, 1) ? eTalkType::General : 0, urand(0, 2), urand(0, 2)); + spam(BOT_TEXT2("suggest_quest", placeholders), urand(0, 1) ? eTalkType::General : eTalkType::LookingForGroup, urand(0, 2), urand(0, 2)); } void SuggestWhatToDoAction::grindMaterials() @@ -225,7 +225,7 @@ void SuggestWhatToDoAction::something() out << entry->area_name[_dbc_locale]; placeholders["%zone"] = out.str(); - spam(BOT_TEXT2("suggest_something", placeholders), urand(0, 1) ? eTalkType::General : 0, urand(0, 2), urand(0, 2)); + spam(BOT_TEXT2("suggest_something", placeholders), eTalkType::General, !urand(0, 2), !urand(0, 3)); } void SuggestWhatToDoAction::spam(std::string msg, uint8 flags, bool worldChat, bool guild) @@ -413,7 +413,7 @@ bool SuggestDungeonAction::Execute(Event event) itemout << allowedInstances[urand(0, allowedInstances.size() - 1)]; placeholders["%instance"] = itemout.str(); - spam(BOT_TEXT2("suggest_instance", placeholders), urand(0, 1) ? eTalkType::LookingForGroup : 0, urand(0, 2), urand(0, 2)); + spam(BOT_TEXT2("suggest_instance", placeholders), urand(0, 1) ? eTalkType::LookingForGroup : eTalkType::General, urand(0, 2), urand(0, 2)); return true; } @@ -480,6 +480,7 @@ bool SuggestTradeAction::Execute(Event event) placeholders["%item"] = chat->FormatItem(proto, count); placeholders["%gold"] = chat->formatMoney(price); - spam(BOT_TEXT2("suggest_sell", placeholders), urand(0, 1) ? eTalkType::Trade : 0, urand(0, 1), urand(0, 5)); + + spam(BOT_TEXT2("suggest_sell", placeholders), urand(0, 1) ? eTalkType::Trade : eTalkType::General, !urand(0, 2), urand(0, 5)); return true; } diff --git a/src/strategy/generic/EmoteStrategy.cpp b/src/strategy/generic/EmoteStrategy.cpp index 002fdc41..6f8a35d9 100644 --- a/src/strategy/generic/EmoteStrategy.cpp +++ b/src/strategy/generic/EmoteStrategy.cpp @@ -9,7 +9,7 @@ void EmoteStrategy::InitTriggers(std::vector& triggers) { if (sPlayerbotAIConfig->randomBotEmote) { - triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("emote", 1.0f), nullptr))); + triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("emote", 10.0f), nullptr))); triggers.push_back(new TriggerNode("receive text emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr))); triggers.push_back(new TriggerNode("receive emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr))); }