diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index 52c9f16a..4db06db2 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -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(std::toupper(static_cast(c))); + // Map common emote tokens to DBC TextEmote IDs + static const std::unordered_map 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);