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

@@ -41,13 +41,14 @@ bool XpGainAction::Execute(Event event)
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
if (guild)
{
std::map<std::string, std::string> placeholders;
placeholders["%name"] = creature->GetName();
std::string toSay = "";
if (urand(0, 3))
guild->BroadcastToGuild(bot->GetSession(), false, BOT_TEXT2("Wow I just killed %name!", placeholders), LANG_UNIVERSAL);
toSay = "Wow I just killed " + creature->GetName() + " !";
else
guild->BroadcastToGuild(bot->GetSession(), false, BOT_TEXT2("Awesome that %name went down quickly!", placeholders), LANG_UNIVERSAL);
toSay = "Awesome that " + creature->GetName() + " went down quickly !";
guild->BroadcastToGuild(bot->GetSession(), false, toSay, LANG_UNIVERSAL);
}
}
}