summaryrefslogtreecommitdiff
path: root/src/actions/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-25 22:06:39 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-25 22:07:05 +0300
commit192b8db5c67860ec9a67d19d9529b01794ae1c83 (patch)
tree20713692df12ae3a4cece7f9bd174239a0294639 /src/actions/commands.cpp
parent393865bc4af7d3a7f96ff66480f6b7f7085fb41f (diff)
downloadmanaplus-192b8db5c67860ec9a67d19d9529b01794ae1c83.tar.gz
manaplus-192b8db5c67860ec9a67d19d9529b01794ae1c83.tar.bz2
manaplus-192b8db5c67860ec9a67d19d9529b01794ae1c83.tar.xz
manaplus-192b8db5c67860ec9a67d19d9529b01794ae1c83.zip
Add command and action for show homunculus/mercenary emotes.
New chat command: /homunemote emote /mercemote emote
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r--src/actions/commands.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index c879916a1..25be294a0 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -22,6 +22,7 @@
#include "actormanager.h"
#include "configuration.h"
+#include "emoteshortcut.h"
#include "game.h"
#include "inventory.h"
#include "item.h"
@@ -817,4 +818,33 @@ impHandler(homunTalk)
return true;
}
+impHandler(homunEmote)
+{
+ if (!serverFeatures->haveTalkPet())
+ return false;
+
+ if (event.action >= InputAction::HOMUN_EMOTE_1
+ && event.action <= InputAction::HOMUN_EMOTE_48)
+ {
+ const int emotion = event.action - InputAction::HOMUN_EMOTE_1;
+ if (emoteShortcut)
+ homunculusHandler->emote(emoteShortcut->getEmote(emotion));
+ if (Game::instance())
+ Game::instance()->setValidSpeed();
+ return true;
+ }
+
+ return false;
+}
+
+impHandler(commandHomunEmote)
+{
+ if (!serverFeatures->haveTalkPet())
+ return false;
+
+ homunculusHandler->emote(static_cast<uint8_t>(
+ atoi(event.args.c_str())));
+ return true;
+}
+
} // namespace Actions