feat: add DoEmote for /dance /wave /bow and 30+ emote commands

DoEmote(token) maps emote token strings to TextEmote DBC IDs and
sends them via sendTextEmote. Supports 30+ common emotes: WAVE,
BOW, DANCE, CHEER, CHICKEN, CRY, EAT, FLEX, KISS, LAUGH, POINT,
ROAR, RUDE, SALUTE, SHY, SILLY, SIT, SLEEP, SPIT, THANK, CLAP,
KNEEL, LAY, NO, YES, BEG, ANGRY, FAREWELL, HELLO, WELCOME, etc.

Targets the current target if one exists.
This commit is contained in:
Kelsi 2026-03-23 03:12:30 -07:00
parent a503d09d9b
commit 2f68282afc

View file

@ -5182,6 +5182,31 @@ void LuaEngine::registerCoreAPI() {
if (gh) gh->requestPvpLog();
return 0;
}},
// --- Emotes ---
{"DoEmote", [](lua_State* L) -> int {
auto* gh = getGameHandler(L);
const char* token = luaL_checkstring(L, 1);
if (!gh) return 0;
std::string t(token);
for (char& c : t) c = static_cast<char>(std::toupper(static_cast<unsigned char>(c)));
// Map common emote tokens to DBC TextEmote IDs
static const std::unordered_map<std::string, uint32_t> emoteMap = {
{"WAVE", 67}, {"BOW", 2}, {"DANCE", 10}, {"CHEER", 5},
{"CHICKEN", 6}, {"CRY", 8}, {"EAT", 14}, {"DRINK", 13},
{"FLEX", 16}, {"KISS", 22}, {"LAUGH", 23}, {"POINT", 30},
{"ROAR", 34}, {"RUDE", 36}, {"SALUTE", 37}, {"SHY", 40},
{"SILLY", 41}, {"SIT", 42}, {"SLEEP", 43}, {"SPIT", 44},
{"THANK", 52}, {"CLAP", 7}, {"KNEEL", 21}, {"LAY", 24},
{"NO", 28}, {"YES", 70}, {"BEG", 1}, {"ANGRY", 64},
{"FAREWELL", 15}, {"HELLO", 18}, {"WELCOME", 68},
};
auto it = emoteMap.find(t);
uint64_t target = gh->hasTarget() ? gh->getTargetGuid() : 0;
if (it != emoteMap.end()) {
gh->sendTextEmote(it->second, target);
}
return 0;
}},
// --- Social (Friend/Ignore) ---
{"AddFriend", [](lua_State* L) -> int {
auto* gh = getGameHandler(L);