fix current_zone_name incorrect values + refactoring guild broadcast simplier + refactoring randomTalk to actually use area / zone general etc

This commit is contained in:
Atidot3
2024-07-28 18:42:51 +02:00
parent 90aa76e3c3
commit 06a63aa730
6 changed files with 43 additions and 40 deletions

View File

@@ -423,13 +423,14 @@ bool StoreLootAction::Execute(Event event)
if (guild)
{
std::map<std::string, std::string> placeholders;
placeholders["%name"] = chat->FormatItem(proto);
std::string toSay = "";
if (urand(0, 3))
guild->BroadcastToGuild(bot->GetSession(), false, BOT_TEXT2("Yay I looted %name!", placeholders), LANG_UNIVERSAL);
toSay = "Yay I looted " + chat->FormatItem(proto) + " !";
else
guild->BroadcastToGuild(bot->GetSession(), false, BOT_TEXT2("Guess who got a %name? Me!", placeholders), LANG_UNIVERSAL);
toSay = "Guess who got a " + chat->FormatItem(proto) + " ? Me !";
guild->BroadcastToGuild(bot->GetSession(), false, toSay, LANG_UNIVERSAL);
}
}