From 192b8db5c67860ec9a67d19d9529b01794ae1c83 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Feb 2015 22:06:39 +0300 Subject: Add command and action for show homunculus/mercenary emotes. New chat command: /homunemote emote /mercemote emote --- src/actions/commands.cpp | 30 ++++++++++++++++++++++++++++++ src/actions/commands.h | 2 ++ 2 files changed, 32 insertions(+) (limited to 'src/actions') 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( + 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 -- cgit v1.2.3-60-g2f50