From d3d32942774378e81601669c8e2b49d2420bcc45 Mon Sep 17 00:00:00 2001 From: BenDol Date: Thu, 7 Aug 2014 07:17:16 +1200 Subject: [PATCH] Added missing premium trigger opcode. --- src/client/protocolcodes.h | 1 + src/client/protocolgame.h | 1 + src/client/protocolgameparse.cpp | 22 ++++++++++++++++++---- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/client/protocolcodes.h b/src/client/protocolcodes.h index 14a83a4e..b4c0482b 100644 --- a/src/client/protocolcodes.h +++ b/src/client/protocolcodes.h @@ -107,6 +107,7 @@ namespace Proto { GameServerCreatureType = 149, GameServerEditText = 150, GameServerEditList = 151, + GameServerPremiumTrigger = 158, // 1038 GameServerPlayerDataBasic = 159, // 950 GameServerPlayerData = 160, GameServerPlayerSkills = 161, diff --git a/src/client/protocolgame.h b/src/client/protocolgame.h index ccbab188..34f31620 100644 --- a/src/client/protocolgame.h +++ b/src/client/protocolgame.h @@ -178,6 +178,7 @@ private: void parseCreatureUnpass(const InputMessagePtr& msg); void parseEditText(const InputMessagePtr& msg); void parseEditList(const InputMessagePtr& msg); + void parsePremiumTrigger(const InputMessagePtr& msg); void parsePlayerInfo(const InputMessagePtr& msg); void parsePlayerStats(const InputMessagePtr& msg); void parsePlayerSkills(const InputMessagePtr& msg); diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 2ab2a9be..4a60f48a 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -207,6 +207,10 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg) case Proto::GameServerEditList: parseEditList(msg); break; + // PROTOCOL>=1038 + case Proto::GameServerPremiumTrigger: + parsePremiumTrigger(msg); + break; case Proto::GameServerPlayerData: parsePlayerStats(msg); break; @@ -1019,6 +1023,16 @@ void ProtocolGame::parseEditList(const InputMessagePtr& msg) g_game.processEditList(id, doorId, text); } +void ProtocolGame::parsePremiumTrigger(const InputMessagePtr& msg) +{ + int triggerCount = msg->getU8(); + std::vector triggers; + for(int i=0;igetU8()); + } + bool something = msg->getU8() == 1; +} + void ProtocolGame::parsePlayerInfo(const InputMessagePtr& msg) { bool premium = msg->getU8(); // premium @@ -2036,11 +2050,11 @@ ItemPtr ProtocolGame::getItem(const InputMessagePtr& msg, int id) if(g_game.getFeature(Otc::GameItemAnimationPhase)) { if(item->getAnimationPhases() > 1) { - // 0xfe => random phase - // 0xff => async? + // 0x00 => automatic phase + // 0xFE => random phase + // 0xFF => async phase msg->getU8(); - // Remove async since OTB file in server is configured so every item with animationPhase > 1 is a random phase item. - //item->setAsync(msg->getU8() == 0xff); + //item->setPhase(msg->getU8()); } }