diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-17 15:32:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-17 15:32:42 +0300 |
commit | 0d355e3126ab7e0a88bd8e54ce724498f6828c01 (patch) | |
tree | dccbf92259f29f2dbf6ee8fc72f831c8917ee7b2 /src | |
parent | d7a4988bffc489e9584def3ce65ebe2b8f4ca0b0 (diff) | |
download | plus-0d355e3126ab7e0a88bd8e54ce724498f6828c01.tar.gz plus-0d355e3126ab7e0a88bd8e54ce724498f6828c01.tar.bz2 plus-0d355e3126ab7e0a88bd8e54ce724498f6828c01.tar.xz plus-0d355e3126ab7e0a88bd8e54ce724498f6828c01.zip |
eathena: add pet emote command.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/pets.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/pethandler.cpp | 8 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp index fa413227f..109da80cd 100644 --- a/src/actions/pets.cpp +++ b/src/actions/pets.cpp @@ -85,6 +85,9 @@ impHandler(setPetName) impHandler(petEmote) { + if (!serverFeatures->haveTalkPet()) + return false; + if (event.action >= InputAction::PET_EMOTE_1 && event.action <= InputAction::PET_EMOTE_48) { diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index 29e48ba04..6d1167198 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -121,12 +121,8 @@ void PetHandler::spawn(const Being *const being A_UNUSED, void PetHandler::emote(const uint8_t emoteId, const int petId A_UNUSED) { - mRandCounter ++; - if (mRandCounter > 10000) - mRandCounter = 1000; - - chatHandler->talk(strprintf("\302\202\302e%dz%d", - static_cast<int>(emoteId), mRandCounter), GENERAL_CHANNEL); + createOutPacket(CMSG_PET_EMOTE); + outMsg.writeInt8(emoteId, "emote id"); } void PetHandler::catchPet(const Being *const being) const diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index e2d1d9b7e..a02495b19 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -513,6 +513,7 @@ #define CMSG_PET_SELECT_EGG 0x01a7 #define CMSG_PET_MENU_ACTION 0x01a1 #define CMSG_PET_TALK 0x0b0c +#define CMSG_PET_EMOTE 0x0b0d #define CMSG_MERCENARY_ACTION 0x029f #define CMSG_HOMUNCULUS_SET_NAME 0x0231 |