diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index a6b1428ad..5cebb3a2a 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -636,6 +636,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) DEBUG_LOG( "WORLD: Sent motd (SMSG_MOTD)" ); } + data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4); + data << uint32(0); + data << uint32(0); + SendPacket(&data); + //QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); QueryResult *resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD); @@ -721,7 +726,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) ObjectAccessor::Instance().AddObject(pCurrChar); //sLog.outDebug("Player %s added to Map.",pCurrChar->GetName()); - pCurrChar->GetSocial()->SendSocialList(); pCurrChar->SendInitialPacketsAfterAddToMap(); @@ -1206,20 +1210,22 @@ void WorldSession::HandleRemoveGlyph( WorldPacket & recv_data ) uint32 slot; recv_data >> slot; - if(slot > MAX_GLYPH_SLOT_INDEX) + if(slot < MAX_GLYPH_SLOT_INDEX) { - sLog.outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); + if(uint32 glyph = _player->GetGlyph(slot)) + { + if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph)) + { + _player->RemoveAurasDueToSpell(gp->SpellId); + _player->SetGlyph(slot, 0); + _player->SendTalentsInfoData(false); + } + } + return; } - if(uint32 glyph = _player->GetGlyph(slot)) - { - if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph)) - { - _player->RemoveAurasDueToSpell(gp->SpellId); - _player->SetGlyph(slot, 0); - } - } + sLog.outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); } void WorldSession::HandleCharCustomize(WorldPacket& recv_data) @@ -1316,3 +1322,9 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) data << uint8(facialHair); SendPacket(&data); } + +void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) +{ + sLog.outDebug("CMSG_EQUIPMENT_SET_SAVE"); + recv_data.hexlike(); +} diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 04f87b058..22e756f11 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1238,13 +1238,13 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4B9*/ { "UMSG_UNKNOWN_1209", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4BA*/ { "CMSG_UNKNOWN_1210", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4BB*/ { "SMSG_UNKNOWN_1211", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4BC*/ { "SMSG_UNKNOWN_1212", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4BD*/ { "CMSG_UNKNOWN_1213", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4BC*/ { "SMSG_EQUIPMENT_SET_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4BD*/ { "CMSG_EQUIPMENT_SET_SAVE", STATUS_LOGGEDIN, &WorldSession::HandleEquipmentSetSave }, /*0x4BE*/ { "CMSG_UNKNOWN_1214", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4BF*/ { "SMSG_UNKNOWN_1215", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4C0*/ { "SMSG_UNKNOWN_1216", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4C1*/ { "CMSG_UNKNOWN_1217", STATUS_LOGGEDIN, &WorldSession::HandleLearnPreviewTalents }, - /*0x4C2*/ { "CMSG_UNKNOWN_1218", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4C0*/ { "SMSG_TALENTS_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4C1*/ { "CMSG_LEARN_PREVIEW_TALENTS", STATUS_LOGGEDIN, &WorldSession::HandleLearnPreviewTalents }, + /*0x4C2*/ { "CMSG_LEARN_PREVIEW_TALENTS_PET", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4C3*/ { "UMSG_UNKNOWN_1219", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4C4*/ { "UMSG_UNKNOWN_1220", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4C5*/ { "UMSG_UNKNOWN_1221", STATUS_NEVER, &WorldSession::Handle_NULL }, diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 7b13c358d..967980c43 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1246,13 +1246,13 @@ enum Opcodes UMSG_UNKNOWN_1209 = 0x4B9, // not found CMSG_UNKNOWN_1210 = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp SMSG_UNKNOWN_1211 = 0x4BB, // SMSG, calendar related - SMSG_UNKNOWN_1212 = 0x4BC, // SMSG, equipment manager list? - CMSG_UNKNOWN_1213 = 0x4BD, // CMSG, lua: SaveEquipmentSet + SMSG_EQUIPMENT_SET_LIST = 0x4BC, // SMSG, equipment manager list? + CMSG_EQUIPMENT_SET_SAVE = 0x4BD, // CMSG, lua: SaveEquipmentSet CMSG_UNKNOWN_1214 = 0x4BE, // CMSG, missle? SMSG_UNKNOWN_1215 = 0x4BF, // SMSG, uint64, uint8, 3 x float - SMSG_UNKNOWN_1216 = 0x4C0, // SMSG, talents related - CMSG_UNKNOWN_1217 = 0x4C1, // CMSG, lua: LearnPreviewTalents (for player?) - CMSG_UNKNOWN_1218 = 0x4C2, // CMSG, lua: LearnPreviewTalents (for pet?) + SMSG_TALENTS_INFO = 0x4C0, // SMSG, talents related + CMSG_LEARN_PREVIEW_TALENTS = 0x4C1, // CMSG, lua: LearnPreviewTalents (for player?) + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x4C2, // CMSG, lua: LearnPreviewTalents (for pet?) UMSG_UNKNOWN_1219 = 0x4C3, // not found UMSG_UNKNOWN_1220 = 0x4C4, // not found UMSG_UNKNOWN_1221 = 0x4C5, // not found diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f7b54854b..6cc1e12b9 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14738,7 +14738,7 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff) void Player::_LoadGlyphAuras() { - for (uint8 i = 0; i <= MAX_GLYPH_SLOT_INDEX; ++i) + for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) { if (uint32 glyph = GetGlyph(i)) { @@ -18073,6 +18073,8 @@ void Player::SendInitialPacketsBeforeAddToMap() data << uint32(0); // unknown, may be rest state time or experience GetSession()->SendPacket(&data); + GetSocial()->SendSocialList(); + // Homebind data.Initialize(SMSG_BINDPOINTUPDATE, 5*4); data << m_homebindX << m_homebindY << m_homebindZ; @@ -18084,12 +18086,12 @@ void Player::SendInitialPacketsBeforeAddToMap() // SMSG_UPDATE_AURA_DURATION // tutorial stuff - data.Initialize(SMSG_TUTORIAL_FLAGS, 8*4); + /*data.Initialize(SMSG_TUTORIAL_FLAGS, 8*4); for (int i = 0; i < 8; ++i) data << uint32( GetTutorialInt(i) ); - GetSession()->SendPacket(&data); + GetSession()->SendPacket(&data);*/ - SendTalentInfoData(false); + SendTalentsInfoData(false); SendInitialSpells(); data.Initialize(SMSG_SEND_UNLEARN_SPELLS, 4); @@ -18098,11 +18100,23 @@ void Player::SendInitialPacketsBeforeAddToMap() SendInitialActionButtons(); SendInitialReputations(); + SendInitWorldStates(); m_achievementMgr.SendAllAchievementData(); UpdateZone(GetZoneId()); - SendInitWorldStates(); - // SMSG_SET_AURA_SINGLE + // equipment manager! + data.Initialize(SMSG_EQUIPMENT_SET_LIST); + data << uint32(0); // count + /*for(count) + { + data << uint8(0); // PGUID, equipment set guid? + data << uint32(0); // counter(0,1,...)? + data << uint8(0); // string set name + data << uint8(0); // string icon name + for(uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) + data << uint8(0); // item GUID? + }*/ + GetSession()->SendPacket(&data); data.Initialize(SMSG_LOGIN_SETTIMESPEED, 8); data << uint32(secsToTimeBitFields(sWorld.GetGameTime())); @@ -19686,9 +19700,9 @@ void Player::BuildPetTalentsInfoData(WorldPacket *data) }*/ } -void Player::SendTalentInfoData(bool pet) +void Player::SendTalentsInfoData(bool pet) { - WorldPacket data(SMSG_UNKNOWN_1216, 50); + WorldPacket data(SMSG_TALENTS_INFO, 50); data << uint8(pet); if(pet) BuildPetTalentsInfoData(&data); diff --git a/src/game/Player.h b/src/game/Player.h index 7404fb61c..86fefeb6d 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1463,7 +1463,7 @@ class MANGOS_DLL_SPEC Player : public Unit void InitTalentForLevel(); void BuildPlayerTalentsInfoData(WorldPacket *data); void BuildPetTalentsInfoData(WorldPacket *data); - void SendTalentInfoData(bool pet); + void SendTalentsInfoData(bool pet); void LearnTalent(uint32 talentId, uint32 talentRank); void LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank); diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 47105c009..9902ef34c 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -40,7 +40,7 @@ void WorldSession::SendNameQueryOpcode(Player *p) // guess size WorldPacket data( SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10) ); - data << uint64(p->GetGUID()); // player guid + data.append(p->GetPackGUID()); // player guid data << uint8(0); // added in 3.1 data << p->GetName(); // played name data << uint8(0); // realm name for cross realm BG usage @@ -100,7 +100,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32 // guess size WorldPacket data( SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+1+10) ); - data << uint64(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); + data.appendPackGUID(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); data << uint8(0); // added in 3.1 data << name; data << uint8(0); diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index b0d6d9844..b4c2cfd55 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -440,7 +440,7 @@ enum ItemQualities #define SPELL_ATTR_EX6_UNK30 0x40000000 // 30 not set in 3.0.3 #define SPELL_ATTR_EX6_UNK31 0x80000000 // 31 not set in 3.0.3 -#define MAX_GLYPH_SLOT_INDEX 5 +#define MAX_GLYPH_SLOT_INDEX 6 enum SheathTypes { diff --git a/src/game/SkillHandler.cpp b/src/game/SkillHandler.cpp index f66ac1a47..32a2340fe 100644 --- a/src/game/SkillHandler.cpp +++ b/src/game/SkillHandler.cpp @@ -36,7 +36,7 @@ void WorldSession::HandleLearnTalentOpcode( WorldPacket & recv_data ) recv_data >> talent_id >> requested_rank; _player->LearnTalent(talent_id, requested_rank); - _player->SendTalentInfoData(false); + _player->SendTalentsInfoData(false); } void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) @@ -59,7 +59,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) _player->LearnTalent(talentId, talentRank); } - _player->SendTalentInfoData(false); + _player->SendTalentsInfoData(false); } void WorldSession::HandleTalentWipeOpcode( WorldPacket & recv_data ) @@ -90,6 +90,7 @@ void WorldSession::HandleTalentWipeOpcode( WorldPacket & recv_data ) return; } + _player->SendTalentsInfoData(false); unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect" } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d2aeb433f..31eedaac3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5353,16 +5353,6 @@ void Spell::EffectApplyGlyph(uint32 i) Player *player = (Player*)m_caster; - // remove old glyph - if(uint32 oldglyph = player->GetGlyph(m_glyphIndex)) - { - if(GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) - { - player->RemoveAurasDueToSpell(old_gp->SpellId); - player->SetGlyph(m_glyphIndex, 0); - } - } - // apply new one if(uint32 glyph = m_spellInfo->EffectMiscValue[i]) { @@ -5377,9 +5367,19 @@ void Spell::EffectApplyGlyph(uint32 i) } } + // remove old glyph + if(uint32 oldglyph = player->GetGlyph(m_glyphIndex)) + { + if(GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) + { + player->RemoveAurasDueToSpell(old_gp->SpellId); + player->SetGlyph(m_glyphIndex, 0); + } + } + player->CastSpell(m_caster, gp->SpellId, true); player->SetGlyph(m_glyphIndex, glyph); - player->SendTalentInfoData(false); + player->SendTalentsInfoData(false); } } } diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 4bed0cf74..6ace0b362 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -671,6 +671,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleRemoveGlyph(WorldPacket& recv_data); void HandleCharCustomize(WorldPacket& recv_data); void HandleInspectAchievements(WorldPacket& recv_data); + void HandleEquipmentSetSave(WorldPacket& recv_data); private: // private trade methods void moveItems(Item* myItems[], Item* hisItems[]); diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 5b7574b27..570d38ebc 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -996,6 +996,12 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) if (sAddOnHandler.BuildAddonPacket (&recvPacket, &SendAddonPacked)) SendPacket (SendAddonPacked); + // TODO: fix it! + WorldPacket data(SMSG_TUTORIAL_FLAGS, 4*8); + for(uint32 i = 0; i < 8; ++i) + data << uint32(-1); + SendPacket(data); + return 0; }