From 969c0bbbfa736b2fb4eacb8f2c54c7983966bfa0 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 5 Jan 2016 16:58:09 +0200 Subject: [PATCH] Fix documentation indentation and implement emote state method. Closes https://github.com/ElunaLuaEngine/Eluna/issues/181 --- LuaFunctions.cpp | 1 + PlayerMethods.h | 16 ++++++------ UnitMethods.h | 13 ++++++++++ WorldObjectMethods.h | 62 ++++++++++++++++++++++---------------------- 4 files changed, 53 insertions(+), 39 deletions(-) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index ad99c32719..9a32d03ace 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -389,6 +389,7 @@ ElunaRegister UnitMethods[] = { "InterruptSpell", &LuaUnit::InterruptSpell }, { "SendChatMessageToPlayer", &LuaUnit::SendChatMessageToPlayer }, { "Emote", &LuaUnit::Emote }, + { "EmoteState", &LuaUnit::EmoteState }, { "CountPctFromCurHealth", &LuaUnit::CountPctFromCurHealth }, { "CountPctFromMaxHealth", &LuaUnit::CountPctFromMaxHealth }, { "Dismount", &LuaUnit::Dismount }, diff --git a/PlayerMethods.h b/PlayerMethods.h index 839f288494..72883dc070 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -3927,10 +3927,10 @@ namespace LuaPlayer } /** - * Starts a cinematic for the [Player] - * - * @param uint32 CinematicSequenceId : entry of a cinematic - */ + * Starts a cinematic for the [Player] + * + * @param uint32 CinematicSequenceId : entry of a cinematic + */ int SendCinematicStart(Eluna* /*E*/, lua_State* L, Player* player) { uint32 CinematicSequenceId = Eluna::CHECKVAL(L, 2); @@ -3940,10 +3940,10 @@ namespace LuaPlayer } /** - * Starts a movie for the [Player] - * - * @param uint32 MovieId : entry of a movie - */ + * Starts a movie for the [Player] + * + * @param uint32 MovieId : entry of a movie + */ int SendMovieStart(Eluna* /*E*/, lua_State* L, Player* player) { uint32 MovieId = Eluna::CHECKVAL(L, 2); diff --git a/UnitMethods.h b/UnitMethods.h index b7bf8bbbb8..6e24979826 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1947,6 +1947,19 @@ namespace LuaUnit return 0; } + /** + * Makes the [Unit] perform the given emote continuously. + * + * @param uint32 emoteId + */ + int EmoteState(Eluna* /*E*/, lua_State* L, Unit* unit) + { + uint32 emoteId = Eluna::CHECKVAL(L, 2); + + unit->SetUInt32Value(UNIT_NPC_EMOTESTATE, emoteId); + return 0; + } + /** * Returns calculated percentage from Health * diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index dca25846ac..202c27edc7 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -836,16 +836,16 @@ namespace LuaWorldObject } /** - * The [WorldObject] plays music to a [Player] - * - * If no [Player] provided it will play the music to everyone near. - * This method does not interrupt previously played music. - * - * See also [WorldObject:PlayDistanceSound], [WorldObject:PlayDirectSound] - * - * @param uint32 music : entry of a music - * @param [Player] player = nil : [Player] to play the music to - */ + * The [WorldObject] plays music to a [Player] + * + * If no [Player] provided it will play the music to everyone near. + * This method does not interrupt previously played music. + * + * See also [WorldObject:PlayDistanceSound], [WorldObject:PlayDirectSound] + * + * @param uint32 music : entry of a music + * @param [Player] player = nil : [Player] to play the music to + */ int PlayMusic(Eluna* /*E*/, lua_State* L, WorldObject* obj) { uint32 musicid = Eluna::CHECKVAL(L, 2); @@ -861,16 +861,16 @@ namespace LuaWorldObject } /** - * The [WorldObject] plays a sound to a [Player] - * - * If no [Player] provided it will play the sound to everyone near. - * This method will play sound and does not interrupt prvious sound. - * - * See also [WorldObject:PlayDistanceSound], [WorldObject:PlayMusic] - * - * @param uint32 sound : entry of a sound - * @param [Player] player = nil : [Player] to play the sound to - */ + * The [WorldObject] plays a sound to a [Player] + * + * If no [Player] provided it will play the sound to everyone near. + * This method will play sound and does not interrupt prvious sound. + * + * See also [WorldObject:PlayDistanceSound], [WorldObject:PlayMusic] + * + * @param uint32 sound : entry of a sound + * @param [Player] player = nil : [Player] to play the sound to + */ int PlayDirectSound(Eluna* /*E*/, lua_State* L, WorldObject* obj) { uint32 soundId = Eluna::CHECKVAL(L, 2); @@ -886,17 +886,17 @@ namespace LuaWorldObject } /** - * The [WorldObject] plays a sound to a [Player] - * - * If no [Player] it will play the sound to everyone near. - * Sound will fade the further you are from the [WorldObject]. - * This method interrupts previously playing sound. - * - * See also [WorldObject:PlayDirectSound], [WorldObject:PlayMusic] - * - * @param uint32 sound : entry of a sound - * @param [Player] player = nil : [Player] to play the sound to - */ + * The [WorldObject] plays a sound to a [Player] + * + * If no [Player] it will play the sound to everyone near. + * Sound will fade the further you are from the [WorldObject]. + * This method interrupts previously playing sound. + * + * See also [WorldObject:PlayDirectSound], [WorldObject:PlayMusic] + * + * @param uint32 sound : entry of a sound + * @param [Player] player = nil : [Player] to play the sound to + */ int PlayDistanceSound(Eluna* /*E*/, lua_State* L, WorldObject* obj) { uint32 soundId = Eluna::CHECKVAL(L, 2);