From 960401cc2b219dbaf0a07cbc1077dd3e26718762 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Feb 2014 19:32:33 +0300 Subject: Add new crazy move A command for show pet emotes. New command: E. it accept argument for emote number or "?" for random emote. --- src/being/localplayer.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 84b18774c..8a2f86421 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -62,6 +62,7 @@ #include "net/chathandler.h" #include "net/inventoryhandler.h" #include "net/net.h" +#include "net/pethandler.h" #include "net/playerhandler.h" #include "resources/iteminfo.h" @@ -2983,26 +2984,32 @@ void LocalPlayer::crazyMoveA() pickUpItems(); } // emote - else if (mMoveProgram[mCrazyMoveState] == 'e') + else if (mMoveProgram[mCrazyMoveState] == 'e' + || mMoveProgram[mCrazyMoveState] == 'E') { mCrazyMoveState ++; const signed char emo = mMoveProgram[mCrazyMoveState]; + unsigned char emoteId = 0; if (emo == '?') { srand(tick_time); - emote(static_cast(1 + (rand() % EmoteDB::size()))); + emoteId = static_cast( + 1 + (rand() % EmoteDB::size())); } else { - unsigned char emoteId = 0; if (emo >= '0' && emo <= '9') emoteId = static_cast(emo - '0' + 1); else if (emo >= 'a' && emo <= 'z') emoteId = static_cast(emo - 'a' + 11); else if (emo >= 'A' && emo <= 'Z') emoteId = static_cast(emo - 'A' + 37); - emote(emoteId); + } + if (mMoveProgram[mCrazyMoveState] == 'e') + emote(emoteId); + else + Net::getPetHandler()->emote(emoteId, 0); mCrazyMoveState ++; } -- cgit v1.2.3-70-g09d2