summaryrefslogtreecommitdiff
path: root/src/actions
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
parent393865bc4af7d3a7f96ff66480f6b7f7085fb41f (diff)
downloadmv-192b8db5c67860ec9a67d19d9529b01794ae1c83.tar.gz
mv-192b8db5c67860ec9a67d19d9529b01794ae1c83.tar.bz2
mv-192b8db5c67860ec9a67d19d9529b01794ae1c83.tar.xz
mv-192b8db5c67860ec9a67d19d9529b01794ae1c83.zip
Add command and action for show homunculus/mercenary emotes.
New chat command: /homunemote emote /mercemote emote
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp30
-rw-r--r--src/actions/commands.h2
2 files changed, 32 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
diff --git a/src/actions/commands.h b/src/actions/commands.h
index de09f2633..6417dd32e 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -80,6 +80,8 @@ namespace Actions
decHandler(leaveParty);
decHandler(warp);
decHandler(homunTalk);
+ decHandler(homunEmote);
+ decHandler(commandHomunEmote);
} // namespace Actions
#undef decHandler