summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
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