From a2073779f05ab764ef55f1c7d6261dbf1d4768ab Mon Sep 17 00:00:00 2001 From: sanctum32 Date: Mon, 18 Nov 2013 07:07:45 +0200 Subject: [PATCH] [12734] Implemented CMSG_SET_PET_SLOT (original author @Dramacydal) --- src/game/Opcodes.cpp | 1 + src/game/Opcodes.h | 3 ++- src/game/Pet.h | 6 +++--- src/game/PetHandler.cpp | 15 +++++++++++++++ src/game/WorldSession.h | 1 + src/shared/revision_nr.h | 2 +- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index eb1e78fe1..357bf3ad5 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1409,4 +1409,5 @@ void InitializeOpcodes() OPCODE(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); OPCODE(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); OPCODE(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); + OPCODE(CMSG_SET_PET_SLOT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetPetSlotOpcode ); }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index ffcee06ec..bd6f9a73f 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1426,7 +1426,8 @@ enum Opcodes SMSG_PVP_OPTIONS_ENABLED = 0x50A1, // 4.3.4 15595 CMSG_REQUEST_HOTFIX = 0x2401, // 4.3.4 15595 SMSG_DB_REPLY = 0x38A4, // 4.3.4 15595 - CMSG_OBJECT_UPDATE_FAILED = 0x3808, // 4.3.4 15595 + CMSG_OBJECT_UPDATE_FAILED = 0x3808, // 4.3.4 15595 + CMSG_SET_PET_SLOT = 0x3A04, // 4.3.4 15595 }; #define MAX_OPCODE_TABLE_SIZE 0xFFFF diff --git a/src/game/Pet.h b/src/game/Pet.h index b068fa56b..f4a289ead 100644 --- a/src/game/Pet.h +++ b/src/game/Pet.h @@ -34,15 +34,15 @@ enum PetType MAX_PET_TYPE = 5 }; -#define MAX_PET_STABLES 4 +#define MAX_PET_STABLES 20 // stored in character_pet.slot enum PetSaveMode { PET_SAVE_AS_DELETED = -1, // not saved in fact PET_SAVE_AS_CURRENT = 0, // in current slot (with player) - PET_SAVE_FIRST_STABLE_SLOT = 1, - PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT + PET_SAVE_FIRST_STABLE_SLOT = 5, + PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES + PET_SAVE_FIRST_STABLE_SLOT - 1, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT PET_SAVE_NOT_IN_SLOT = 100, // for avoid conflict with stable size grow will use 100 PET_SAVE_REAGENTS = 101 // PET_SAVE_NOT_IN_SLOT with reagents return }; diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 36676a538..307726781 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -761,3 +761,18 @@ void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket& recv_data) _player->SendTalentsInfoData(true); } + +void WorldSession::HandleSetPetSlotOpcode(WorldPacket& recv_data) +{ + DEBUG_LOG("CMSG_SET_PET_SLOT"); + + uint32 petNumber; + uint8 slot; + ObjectGuid guid; + + recv_data >> petNumber >> slot; + recv_data.ReadGuidMask<3, 2, 0, 7, 5, 6, 1, 4>(guid); + recv_data.ReadGuidBytes<5, 3, 1, 7, 4, 0, 6, 2>(guid); + + DEBUG_LOG("PetNumber: %u slot: %u guid: %s", petNumber, slot, guid.GetString().c_str()); ++} diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 45e3c1881..66f63c760 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -557,6 +557,7 @@ class MANGOS_DLL_SPEC WorldSession void HandlePetitionDeclineOpcode(WorldPacket& recv_data); void HandleOfferPetitionOpcode(WorldPacket& recv_data); void HandleTurnInPetitionOpcode(WorldPacket& recv_data); + void HandleSetPetSlotOpcode(WorldPacket& recv_data); void HandleGuildQueryOpcode(WorldPacket& recvPacket); void HandleGuildCreateOpcode(WorldPacket& recvPacket); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f02dd32e6..b3e4dd748 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12733" + #define REVISION_NR "12734" #endif // __REVISION_NR_H__