From 8b0ac4a1bde592834f44989bb6820a763ab02a47 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Tue, 6 Oct 2009 13:44:48 +0400 Subject: [PATCH 01/46] Added support for 3.3.0 PTR client. --- src/game/BattleGroundMgr.cpp | 5 +-- src/game/DBCStructure.h | 64 +++++++++++++++++++----------------- src/game/DBCfmt.h | 8 ++--- src/game/GossipDef.cpp | 13 ++++++++ src/game/Mail.cpp | 1 + src/game/MiscHandler.cpp | 8 +++-- src/game/Object.cpp | 2 +- src/game/Opcodes.cpp | 4 +++ src/game/Opcodes.h | 6 +++- src/game/Player.cpp | 2 +- src/game/Player.h | 14 ++++---- src/game/QueryHandler.cpp | 1 - src/game/UpdateFields.h | 2 +- src/game/WorldSession.cpp | 4 +-- src/realmd/AuthCodes.h | 4 +-- 15 files changed, 83 insertions(+), 55 deletions(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index b885595aa62..ea0686abfc1 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1712,8 +1712,9 @@ void BattleGroundMgr::CreateInitialBattleGrounds() } if (MinLvl == 0 || MaxLvl == 0 || MinLvl > MaxLvl) { - MinLvl = bl->minlvl; - MaxLvl = bl->maxlvl; + // TODO: fix me + MinLvl = 0;//bl->minlvl; + MaxLvl = 80;//bl->maxlvl; } start1 = fields[5].GetUInt32(); diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index ce364eba9bc..4c14bf9627a 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -567,16 +567,12 @@ struct BattlemasterListEntry uint32 id; // 0 int32 mapid[8]; // 1-8 mapid uint32 type; // 9 (3 - BG, 4 - arena) - uint32 minlvl; // 10 - uint32 maxlvl; // 11 - uint32 maxplayersperteam; // 12 - // 13 minplayers - // 14 0 or 9 - // 15 - char* name[16]; // 16-31 - // 32 string flag, unused - // 33 unused - //uint32 unk; // 34 new 3.1 + uint32 maxplayersperteam; // 10 + //uint32 unk1; // 11 (0 or 1) + char* name[16]; // 12-27 + // 28 string flag, unused + // 29 unused + //uint32 unk2; // 30 new 3.1 }; #define MAX_OUTFIT_ITEMS 24 @@ -784,10 +780,14 @@ struct FactionEntry int32 BaseRepValue[4]; // 10-13 m_reputationBase uint32 ReputationFlags[4]; // 14-17 m_reputationFlags uint32 team; // 18 m_parentFactionID - char* name[16]; // 19-34 m_name_lang - // 35 string flags - //char* description[16]; // 36-51 m_description_lang - // 52 string flags + //float unk1; // 19 + //float unk2; // 20 + //uint32 unk3 // 21 + //uint32 unk4; // 22 + char* name[16]; // 23-38 m_name_lang + // 39 string flags + //char* description[16]; // 40-55 m_description_lang + // 56 string flags }; struct FactionTemplateEntry @@ -1077,23 +1077,24 @@ struct MapEntry uint32 MapID; // 0 //char* internalname; // 1 unused uint32 map_type; // 2 - // 3 0 or 1 for battlegrounds (not arenas) - char* name[16]; // 4-19 - // 20 name flags, unused - uint32 linked_zone; // 21 common zone for instance and continent map - //char* hordeIntro[16]; // 23-37 text for PvP Zones - // 38 intro text flags - //char* allianceIntro[16]; // 39-54 text for PvP Zones - // 55 intro text flags - uint32 multimap_id; // 56 - // 57 - int32 entrance_map; // 58 map_id of entrance map - float entrance_x; // 59 entrance x coordinate (if exist single entry) - float entrance_y; // 60 entrance y coordinate (if exist single entry) - // 61 -1, 0 and 720 - uint32 addon; // 62 (0-original maps,1-tbc addon) - // 63 some kind of time? - //uint32 maxPlayers; // 64 max players + //uint32 unk_330; // 3 + // 4 0 or 1 for battlegrounds (not arenas) + char* name[16]; // 5-20 + // 21 name flags, unused + uint32 linked_zone; // 22 common zone for instance and continent map + //char* hordeIntro[16]; // 23-38 text for PvP Zones + // 39 intro text flags + //char* allianceIntro[16]; // 40-55 text for PvP Zones + // 56 intro text flags + uint32 multimap_id; // 57 + // 58 + int32 entrance_map; // 59 map_id of entrance map + float entrance_x; // 60 entrance x coordinate (if exist single entry) + float entrance_y; // 61 entrance y coordinate (if exist single entry) + // 62 -1, 0 and 720 + uint32 addon; // 63 (0-original maps,1-tbc addon) + // 64 some kind of time? + //uint32 maxPlayers; // 65 max players // Helpers uint32 Expansion() const { return addon; } @@ -1423,6 +1424,7 @@ struct SpellEntry //uint32 PowerDisplayId; // 234 PowerDisplay.dbc, new in 3.1 //float unk_320_4[3]; // 235-237 3.2.0 //uint32 spellDescriptionVariableID; // 238 3.2.0 + //uint32 SpellDifficultyId; // 239 3.3.0 // helpers int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); } diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 32c18ecfa30..a0943b026a5 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -27,7 +27,7 @@ const char AreaTriggerEntryfmt[]="niffffffff"; const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx"; const char BankBagSlotPricesEntryfmt[]="ni"; const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii"; -const char BattlemasterListEntryfmt[]="niiiiiiiiiiiixxxssssssssssssssssxxx"; +const char BattlemasterListEntryfmt[]="niiiiiiiiiixssssssssssssssssxxx"; const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char CharTitlesEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx"; @@ -44,7 +44,7 @@ const char DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; const char DurabilityQualityfmt[]="nf"; const char EmotesEntryfmt[]="nxxiiix"; const char EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx"; -const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiissssssssssssssssxxxxxxxxxxxxxxxxxx"; +const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiixxxxssssssssssssssssxxxxxxxxxxxxxxxxxx"; const char FactionTemplateEntryfmt[]="niiiiiiiiiiiii"; const char GameObjectDisplayInfofmt[]="nxxxxxxxxxxxxxxxxxx"; const char GemPropertiesEntryfmt[]="nixxi"; @@ -72,7 +72,7 @@ const char ItemRandomSuffixfmt[]="nxxxxxxxxxxxxxxxxxxiiiiiiiiii"; const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -const char MapEntryfmt[]="nxixssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxixx"; +const char MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxixx"; const char MapDifficultyEntryfmt[]="diixxxxxxxxxxxxxxxxxiix"; const char MovieEntryfmt[]="nxx"; const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx"; @@ -84,7 +84,7 @@ const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellCastTimefmt[]="nixx"; const char SpellDurationfmt[]="niii"; -const char SpellEntryfmt[]="niiiiiiiiiixixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxx"; +const char SpellEntryfmt[]="niiiiiiiiiixixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxxx"; const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx"; const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiixxx"; const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 7a221a59fa7..8d18c6cca57 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -572,11 +572,14 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) // rewarded honor points data << uint32(MaNGOS::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); + data << float(1); // weird honor multiplier data << uint32(pQuest->GetSrcItemId()); // source item id data << uint32(pQuest->GetFlags() & 0xFFFF); // quest flags data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(pQuest->GetPlayersSlain()); // players slain data << uint32(pQuest->GetBonusTalents()); // bonus talents + data << uint32(0); // bonus arena points + data << uint32(0); // unknown int iI; @@ -601,6 +604,15 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) } } + for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // reward factions ids + data << uint32(0); + + for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // columnid+1 QuestFactionReward.dbc? + data << uint32(0); + + for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // unk (0) + data << uint32(0); + data << pQuest->GetPointMapId(); data << pQuest->GetPointX(); data << pQuest->GetPointY(); @@ -610,6 +622,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << Objectives; data << Details; data << EndText; + data << uint8(0); // some string for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) { diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index 98b85dbbdba..9d51c869d6d 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -313,6 +313,7 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data ) uint32 mailId; recv_data >> mailbox; recv_data >> mailId; + recv_data.read_skip(); // 3.3.0 if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 776277d2a0a..fef107afc8e 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1518,13 +1518,17 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode( WorldPacket & recv_data ) sLog.outDebug("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); //recv_data.hexlike(); - recv_data.read_skip(); // guid + uint64 guid; + if(!recv_data.readPackGUID(guid)) + return; + recv_data.read_skip(); // unk MovementInfo movementInfo; + movementInfo.guid = guid; ReadMovementInfo(recv_data, &movementInfo); - recv_data.read_skip(); // unk2 + recv_data.read_skip(); // unk2 _player->m_movementInfo.SetMovementFlags(movementInfo.GetMovementFlags()); } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 222b8efad06..a1276b93eb3 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -325,7 +325,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2 } // 0x02200000 - if((flags2 & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (unk_flags & 0x20)) + if((flags2 & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (unk_flags & 0x20)) { if(GetTypeId() == TYPEID_PLAYER) *data << (float)((Player*)this)->m_movementInfo.s_pitch; diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 78fbcef0aa3..6b85bb666f6 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1299,4 +1299,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4F6*/ { "CMSG_WORLD_STATE_UI_TIMER_UPDATE", STATUS_LOGGEDIN, &WorldSession::HandleWorldStateUITimerUpdate }, /*0x4F7*/ { "SMSG_WORLD_STATE_UI_TIMER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4F8*/ { "CMSG_UNKNOWN_1272", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4F9*/ { "UMSG_UNKNOWN_1273", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4FA*/ { "SMSG_UNKNOWN_1274", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4FB*/ { "UMSG_UNKNOWN_1275", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4FC*/ { "SMSG_UNKNOWN_1276", STATUS_NEVER, &WorldSession::Handle_ServerSide }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 66b52fa5427..21cbb3c8705 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1307,7 +1307,11 @@ enum Opcodes CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F6, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F7, CMSG_UNKNOWN_1272 = 0x4F8, // called from lua: CreateCharacter, paid race change - NUM_MSG_TYPES = 0x4F9 + UMSG_UNKNOWN_1273 = 0x4F9, // not found 10522 + SMSG_UNKNOWN_1274 = 0x4FA, // uint8 + UMSG_UNKNOWN_1275 = 0x4FB, // not found 10522 + SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10522 + NUM_MSG_TYPES = 0x4FD }; /// Player state diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 18555134056..1769c99bdaf 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18268,7 +18268,7 @@ void Player::SendInitialPacketsBeforeAddToMap() // set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment if(HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY) || isInFlight()) - m_movementInfo.AddMovementFlag(MOVEMENTFLAG_FLYING2); + m_movementInfo.AddMovementFlag(MOVEMENTFLAG_FLYING); m_mover = this; } diff --git a/src/game/Player.h b/src/game/Player.h index 20835baf119..5d5b384cf63 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -748,14 +748,14 @@ enum MovementFlags MOVEMENTFLAG_LEVITATING = 0x00000400, MOVEMENTFLAG_FLY_UNK1 = 0x00000800, MOVEMENTFLAG_JUMPING = 0x00001000, - MOVEMENTFLAG_UNK4 = 0x00002000, - MOVEMENTFLAG_FALLING = 0x00004000, + MOVEMENTFLAG_FALLING = 0x00002000, + MOVEMENTFLAG_UNK4 = 0x00004000, // 0x8000, 0x10000, 0x20000, 0x40000, 0x80000, 0x100000 MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also - MOVEMENTFLAG_FLY_UP = 0x00400000, - MOVEMENTFLAG_CAN_FLY = 0x00800000, - MOVEMENTFLAG_FLYING = 0x01000000, - MOVEMENTFLAG_FLYING2 = 0x02000000, // Actual flying mode + MOVEMENTFLAG_FLY_UP = 0x00400000, // swim up also + MOVEMENTFLAG_FLY_DOWN = 0x00800000, // swim down also + MOVEMENTFLAG_CAN_FLY = 0x01000000, // can fly in 3.3? + MOVEMENTFLAG_FLYING = 0x02000000, // Actual flying mode MOVEMENTFLAG_SPLINE = 0x04000000, // used for flight paths MOVEMENTFLAG_SPLINE2 = 0x08000000, // used for flight paths MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water @@ -803,7 +803,7 @@ struct MovementInfo // flags that use in movement check for example at spell casting MovementFlags const movementFlagsMask = MovementFlags( - MOVEMENTFLAG_FORWARD |MOVEMENTFLAG_BACKWARD |MOVEMENTFLAG_STRAFE_LEFT|MOVEMENTFLAG_STRAFE_RIGHT| + MOVEMENTFLAG_FORWARD |MOVEMENTFLAG_BACKWARD |MOVEMENTFLAG_STRAFE_LEFT |MOVEMENTFLAG_STRAFE_RIGHT| MOVEMENTFLAG_PITCH_UP|MOVEMENTFLAG_PITCH_DOWN|MOVEMENTFLAG_FLY_UNK1 | MOVEMENTFLAG_JUMPING |MOVEMENTFLAG_FALLING |MOVEMENTFLAG_FLY_UP | MOVEMENTFLAG_FLYING |MOVEMENTFLAG_SPLINE diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index e7ae81462bd..82ef1580d37 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -156,7 +156,6 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data ) CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry); if (ci) { - std::string Name, SubName; Name = ci->Name; SubName = ci->SubName; diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 4240e6a4ae1..751343104de 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 3, 2, 2, 10505 +// Auto generated for version 0, 3, 0, 10522 enum EObjectFields { diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 3a7c611817f..19ce9cb8eff 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -738,7 +738,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi) data >> mi->t_seat; } - if((mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2))) || (mi->unk1 & 0x20)) + if((mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING))) || (mi->unk1 & 0x20)) { data >> mi->s_pitch; } @@ -783,7 +783,7 @@ void WorldSession::WriteMovementInfo(WorldPacket *data, MovementInfo *mi) *data << mi->t_seat; } - if((mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2))) || (mi->unk1 & 0x20)) + if((mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING))) || (mi->unk1 & 0x20)) { *data << mi->s_pitch; } diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 7df23ad420a..fcc8232329d 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.2.2a client build 10505... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10522... -#define EXPECTED_MANGOS_CLIENT_BUILD {10505, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10522, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 84247e3ad48adeacd9ca3390358cf7debfdbb2c6 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 10 Oct 2009 17:29:25 +0400 Subject: [PATCH 02/46] Updated to client build 10554. --- src/game/Opcodes.cpp | 2 ++ src/game/Opcodes.h | 14 ++++++++------ src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 6b85bb666f6..f7bb4cc7da7 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1303,4 +1303,6 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4FA*/ { "SMSG_UNKNOWN_1274", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FB*/ { "UMSG_UNKNOWN_1275", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4FC*/ { "SMSG_UNKNOWN_1276", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4FD*/ { "SMSG_UNKNOWN_1277", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4FE*/ { "UMSG_UNKNOWN_1278", STATUS_NEVER, &WorldSession::Handle_NULL }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 21cbb3c8705..fcdb96dbdc0 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -543,7 +543,7 @@ enum Opcodes CMSG_GM_NUKE = 0x1FA, MSG_RANDOM_ROLL = 0x1FB, SMSG_ENVIRONMENTALDAMAGELOG = 0x1FC, - CMSG_RWHOIS_OBSOLETE = 0x1FD, + CMSG_PLAYER_DIFFICULTY_CHANGE = 0x1FD, SMSG_RWHOIS = 0x1FE, MSG_LOOKING_FOR_GROUP = 0x1FF, CMSG_SET_LOOKING_FOR_GROUP = 0x200, @@ -560,7 +560,7 @@ enum Opcodes CMSG_UPDATE_ACCOUNT_DATA = 0x20B, SMSG_UPDATE_ACCOUNT_DATA = 0x20C, SMSG_CLEAR_FAR_SIGHT_IMMEDIATE = 0x20D, - SMSG_POWERGAINLOG_OBSOLETE = 0x20E, + SMSG_PLAYER_DIFFICULTY_CHANGE = 0x20E, CMSG_GM_TEACH = 0x20F, CMSG_GM_CREATE_ITEM_TARGET = 0x210, CMSG_GMTICKET_GETTICKET = 0x211, @@ -1307,11 +1307,13 @@ enum Opcodes CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F6, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F7, CMSG_UNKNOWN_1272 = 0x4F8, // called from lua: CreateCharacter, paid race change - UMSG_UNKNOWN_1273 = 0x4F9, // not found 10522 + UMSG_UNKNOWN_1273 = 0x4F9, // not found 10554 SMSG_UNKNOWN_1274 = 0x4FA, // uint8 - UMSG_UNKNOWN_1275 = 0x4FB, // not found 10522 - SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10522 - NUM_MSG_TYPES = 0x4FD + UMSG_UNKNOWN_1275 = 0x4FB, // not found 10554 + SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10554 + SMSG_UNKNOWN_1277 = 0x4FD, // loot related? + UMSG_UNKNOWN_1278 = 0x4FE, // not found 10554 + NUM_MSG_TYPES = 0x4FF }; /// Player state diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 751343104de..fe238e7660a 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10522 +// Auto generated for version 0, 3, 0, 10554 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index fcc8232329d..88e315c4fee 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10522... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10554... -#define EXPECTED_MANGOS_CLIENT_BUILD {10522, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10554, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 7faf1df104f22f8e893f7fb309be40f68364d4c9 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 14 Oct 2009 17:26:39 +0400 Subject: [PATCH 03/46] Updated to latest PTR build 10571. --- src/game/GossipDef.cpp | 12 +++++++----- src/game/Opcodes.cpp | 2 ++ src/game/Opcodes.h | 4 +++- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- src/realmd/AuthSocket.cpp | 10 +++++----- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 8d18c6cca57..3093651de00 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -548,6 +548,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << uint32(pQuest->GetQuestId()); // quest id data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details) data << uint32(pQuest->GetQuestLevel()); // may be 0, static data, in other cases must be used dynamic level: Player::GetQuestLevel + data << uint32(0); // min level data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log data << uint32(pQuest->GetType()); // quest type @@ -560,6 +561,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << uint32(0); // RequiredOpositeRepValue, required faction value with another (oposite) faction (objective) data << uint32(pQuest->GetNextQuestInChain()); // client will request this quest from NPC, if not 0 + data << uint32(0); // unk 3.3.0 if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) data << uint32(0); // Hide money rewarded @@ -570,9 +572,9 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) data << uint32(pQuest->GetRewSpellCast()); // casted spell - // rewarded honor points + // rewarded honor points (raw) data << uint32(MaNGOS::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); - data << float(1); // weird honor multiplier + data << float(0); // new reward honor (multipled by ~62 at client side) data << uint32(pQuest->GetSrcItemId()); // source item id data << uint32(pQuest->GetFlags() & 0xFFFF); // quest flags data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) @@ -607,10 +609,10 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // reward factions ids data << uint32(0); - for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // columnid+1 QuestFactionReward.dbc? + for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // columnid in QuestFactionReward.dbc (zero based)? data << uint32(0); - for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // unk (0) + for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // reward reputation override? data << uint32(0); data << pQuest->GetPointMapId(); @@ -622,7 +624,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << Objectives; data << Details; data << EndText; - data << uint8(0); // some string + data << uint8(0); // Return to text for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) { diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index f7bb4cc7da7..1a31d35c36c 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1305,4 +1305,6 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4FC*/ { "SMSG_UNKNOWN_1276", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FD*/ { "SMSG_UNKNOWN_1277", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FE*/ { "UMSG_UNKNOWN_1278", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4FF*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x500*/ { "SMSG_QUERY_QUESTS_COMPLETED_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index fcdb96dbdc0..3224ad0c93e 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1313,7 +1313,9 @@ enum Opcodes SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10554 SMSG_UNKNOWN_1277 = 0x4FD, // loot related? UMSG_UNKNOWN_1278 = 0x4FE, // not found 10554 - NUM_MSG_TYPES = 0x4FF + CMSG_QUERY_QUESTS_COMPLETED = 0x4FF, // lua: QueryQuestsCompleted + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x500, // response to 0x4FF + NUM_MSG_TYPES = 0x501 }; /// Player state diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index fe238e7660a..99e2f9df3fd 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10554 +// Auto generated for version 0, 3, 0, 10571 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 88e315c4fee..9f869d094d5 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10554... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10571... -#define EXPECTED_MANGOS_CLIENT_BUILD {10554, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10571, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build diff --git a/src/realmd/AuthSocket.cpp b/src/realmd/AuthSocket.cpp index bac58488848..912e2682a5c 100644 --- a/src/realmd/AuthSocket.cpp +++ b/src/realmd/AuthSocket.cpp @@ -348,6 +348,11 @@ bool AuthSocket::_HandleLogonChallenge() buf[buf.size() - 1] = 0; sAuthLogonChallenge_C *ch = (sAuthLogonChallenge_C*)&buf[0]; + ///- Read the remaining of the packet + ibuf.Read((char *)&buf[4], remaining); + DEBUG_LOG("[AuthChallenge] got full packet, %#04x bytes", ch->size); + DEBUG_LOG("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); + // BigEndian code, nop in little endian case // size already converted EndianConvert(*((uint32*)(&ch->gamename[0]))); @@ -358,11 +363,6 @@ bool AuthSocket::_HandleLogonChallenge() EndianConvert(ch->timezone_bias); EndianConvert(ch->ip); - ///- Read the remaining of the packet - ibuf.Read((char *)&buf[4], remaining); - DEBUG_LOG("[AuthChallenge] got full packet, %#04x bytes", ch->size); - DEBUG_LOG("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); - ByteBuffer pkt; _login = (const char*)ch->I; From 52d63fcfc877afbe0cb17a024df9300e482e4b15 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 14 Oct 2009 19:25:07 +0400 Subject: [PATCH 04/46] Fixed startup crash caused by missing achievement criteria type. --- src/game/DBCEnums.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 8d28b555abd..4291d3d7739 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -196,8 +196,8 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112, ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, - // 0..114 => 115 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 115, + // 0..115 => 116 criteria types total + ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 116, }; enum AreaFlags From fa7292e2e2b0f93e7d5763c95d29995aaf184f1b Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 17 Oct 2009 02:52:42 +0400 Subject: [PATCH 05/46] Updated to latest PTR build 10596. --- src/game/Opcodes.cpp | 5 +- src/game/Opcodes.h | 9 +- src/game/UpdateFields.h | 411 ++++++++++++++++++++-------------------- src/realmd/AuthCodes.h | 4 +- 4 files changed, 216 insertions(+), 213 deletions(-) diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 1a31d35c36c..27f45cbc901 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1305,6 +1305,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4FC*/ { "SMSG_UNKNOWN_1276", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FD*/ { "SMSG_UNKNOWN_1277", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FE*/ { "UMSG_UNKNOWN_1278", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4FF*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x500*/ { "SMSG_QUERY_QUESTS_COMPLETED_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4FF*/ { "CMSG_READY_FOR_ACCOUNT_DATA_TIMES", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x500*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x501*/ { "SMSG_QUERY_QUESTS_COMPLETED_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 3224ad0c93e..80b63331e87 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1312,10 +1312,11 @@ enum Opcodes UMSG_UNKNOWN_1275 = 0x4FB, // not found 10554 SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10554 SMSG_UNKNOWN_1277 = 0x4FD, // loot related? - UMSG_UNKNOWN_1278 = 0x4FE, // not found 10554 - CMSG_QUERY_QUESTS_COMPLETED = 0x4FF, // lua: QueryQuestsCompleted - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x500, // response to 0x4FF - NUM_MSG_TYPES = 0x501 + UMSG_UNKNOWN_1278 = 0x4FE, // not found 10596 + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x4FF, // lua: ReadyForAccountDataTimes + CMSG_QUERY_QUESTS_COMPLETED = 0x500, // lua: QueryQuestsCompleted + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x501, // response to 0x4FF + NUM_MSG_TYPES = 0x502 }; /// Player state diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 99e2f9df3fd..9e30fbf2cb6 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10571 +// Auto generated for version 0, 3, 0, 10596 enum EObjectFields { @@ -186,210 +186,211 @@ enum EUnitFields PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC PLAYER_QUEST_LOG_1_1 = UNIT_END + 0x000A, // Size: 1, Type: INT, Flags: PARTY_MEMBER PLAYER_QUEST_LOG_1_2 = UNIT_END + 0x000B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x000E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0010, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_2_4 = UNIT_END + 0x0011, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_3_1 = UNIT_END + 0x0012, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_3_2 = UNIT_END + 0x0013, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_3_3 = UNIT_END + 0x0014, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_3_4 = UNIT_END + 0x0015, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_4_1 = UNIT_END + 0x0016, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_4_2 = UNIT_END + 0x0017, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_4_3 = UNIT_END + 0x0018, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_4_4 = UNIT_END + 0x0019, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_5_1 = UNIT_END + 0x001A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_5_2 = UNIT_END + 0x001B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_5_3 = UNIT_END + 0x001C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_5_4 = UNIT_END + 0x001D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_6_1 = UNIT_END + 0x001E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_6_2 = UNIT_END + 0x001F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_6_3 = UNIT_END + 0x0020, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_6_4 = UNIT_END + 0x0021, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_7_1 = UNIT_END + 0x0022, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_7_2 = UNIT_END + 0x0023, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_7_3 = UNIT_END + 0x0024, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_7_4 = UNIT_END + 0x0025, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_8_1 = UNIT_END + 0x0026, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_8_2 = UNIT_END + 0x0027, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_8_3 = UNIT_END + 0x0028, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_8_4 = UNIT_END + 0x0029, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_9_1 = UNIT_END + 0x002A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_9_2 = UNIT_END + 0x002B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_9_3 = UNIT_END + 0x002C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_9_4 = UNIT_END + 0x002D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_10_1 = UNIT_END + 0x002E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_10_2 = UNIT_END + 0x002F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_10_3 = UNIT_END + 0x0030, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_10_4 = UNIT_END + 0x0031, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_11_1 = UNIT_END + 0x0032, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_11_2 = UNIT_END + 0x0033, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_11_3 = UNIT_END + 0x0034, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_11_4 = UNIT_END + 0x0035, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_12_1 = UNIT_END + 0x0036, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_12_2 = UNIT_END + 0x0037, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_12_3 = UNIT_END + 0x0038, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_12_4 = UNIT_END + 0x0039, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_13_1 = UNIT_END + 0x003A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_13_2 = UNIT_END + 0x003B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_13_3 = UNIT_END + 0x003C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_13_4 = UNIT_END + 0x003D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_14_1 = UNIT_END + 0x003E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_14_2 = UNIT_END + 0x003F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_14_3 = UNIT_END + 0x0040, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_14_4 = UNIT_END + 0x0041, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_15_1 = UNIT_END + 0x0042, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_15_2 = UNIT_END + 0x0043, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_15_3 = UNIT_END + 0x0044, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_15_4 = UNIT_END + 0x0045, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_16_1 = UNIT_END + 0x0046, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_16_2 = UNIT_END + 0x0047, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_16_3 = UNIT_END + 0x0048, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_16_4 = UNIT_END + 0x0049, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_17_1 = UNIT_END + 0x004A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_17_2 = UNIT_END + 0x004B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_17_3 = UNIT_END + 0x004C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_17_4 = UNIT_END + 0x004D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_18_1 = UNIT_END + 0x004E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_18_2 = UNIT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_18_3 = UNIT_END + 0x0050, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_18_4 = UNIT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_19_1 = UNIT_END + 0x0052, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_19_2 = UNIT_END + 0x0053, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_19_3 = UNIT_END + 0x0054, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_19_4 = UNIT_END + 0x0055, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_20_1 = UNIT_END + 0x0056, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_20_2 = UNIT_END + 0x0057, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_20_3 = UNIT_END + 0x0058, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_20_4 = UNIT_END + 0x0059, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_21_1 = UNIT_END + 0x005A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_21_2 = UNIT_END + 0x005B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_21_3 = UNIT_END + 0x005C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_21_4 = UNIT_END + 0x005D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_22_1 = UNIT_END + 0x005E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_22_2 = UNIT_END + 0x005F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_22_3 = UNIT_END + 0x0060, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_22_4 = UNIT_END + 0x0061, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_23_1 = UNIT_END + 0x0062, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_23_2 = UNIT_END + 0x0063, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_23_3 = UNIT_END + 0x0064, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_23_4 = UNIT_END + 0x0065, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_24_1 = UNIT_END + 0x0066, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_24_2 = UNIT_END + 0x0067, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_24_3 = UNIT_END + 0x0068, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_24_4 = UNIT_END + 0x0069, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_25_1 = UNIT_END + 0x006A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_25_2 = UNIT_END + 0x006B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x006C, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_QUEST_LOG_25_4 = UNIT_END + 0x006D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END + 0x006E, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UNIT_END + 0x006F, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_2_ENTRYID = UNIT_END + 0x0070, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UNIT_END + 0x0071, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_3_ENTRYID = UNIT_END + 0x0072, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UNIT_END + 0x0073, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_4_ENTRYID = UNIT_END + 0x0074, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UNIT_END + 0x0075, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_5_ENTRYID = UNIT_END + 0x0076, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UNIT_END + 0x0077, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_6_ENTRYID = UNIT_END + 0x0078, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UNIT_END + 0x0079, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_7_ENTRYID = UNIT_END + 0x007A, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UNIT_END + 0x007B, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_8_ENTRYID = UNIT_END + 0x007C, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UNIT_END + 0x007D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_9_ENTRYID = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UNIT_END + 0x007F, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_10_ENTRYID = UNIT_END + 0x0080, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UNIT_END + 0x0081, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_11_ENTRYID = UNIT_END + 0x0082, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UNIT_END + 0x0083, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_12_ENTRYID = UNIT_END + 0x0084, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UNIT_END + 0x0085, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_13_ENTRYID = UNIT_END + 0x0086, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UNIT_END + 0x0087, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_14_ENTRYID = UNIT_END + 0x0088, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UNIT_END + 0x0089, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_15_ENTRYID = UNIT_END + 0x008A, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UNIT_END + 0x008B, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x008C, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UNIT_END + 0x008D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_17_ENTRYID = UNIT_END + 0x008E, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UNIT_END + 0x008F, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_18_ENTRYID = UNIT_END + 0x0090, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UNIT_END + 0x0091, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_19_ENTRYID = UNIT_END + 0x0092, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UNIT_END + 0x0093, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_CHOSEN_TITLE = UNIT_END + 0x0094, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_FAKE_INEBRIATION = UNIT_END + 0x0095, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x0096, // Size: 46, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x00C4, // Size: 32, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x00E4, // Size: 56, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x011C, // Size: 14, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x012A, // Size: 24, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_KEYRING_SLOT_1 = UNIT_END + 0x0142, // Size: 64, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_CURRENCYTOKEN_SLOT_1 = UNIT_END + 0x0182, // Size: 64, Type: LONG, Flags: PRIVATE - PLAYER_FARSIGHT = UNIT_END + 0x01C2, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01C4, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01C6, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01C8, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_KNOWN_CURRENCIES = UNIT_END + 0x01CA, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER_XP = UNIT_END + 0x01CC, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01CD, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x01CE, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_CHARACTER_POINTS1 = UNIT_END + 0x034E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_CHARACTER_POINTS2 = UNIT_END + 0x034F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_TRACK_CREATURES = UNIT_END + 0x0350, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_TRACK_RESOURCES = UNIT_END + 0x0351, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x0352, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x0353, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x0354, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_EXPERTISE = UNIT_END + 0x0355, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x0356, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x0357, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x0358, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x0359, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x035A, // Size: 7, Type: FLOAT, Flags: PRIVATE - PLAYER_SHIELD_BLOCK = UNIT_END + 0x0361, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x0362, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x0363, // Size: 128, Type: BYTES, Flags: PRIVATE - PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x03E3, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_COINAGE = UNIT_END + 0x03E4, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x03E5, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x03EC, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x03F3, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x03FA, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x03FB, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x03FC, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x03FD, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x03FE, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BYTES = UNIT_END + 0x03FF, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_AMMO_ID = UNIT_END + 0x0400, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SELF_RES_SPELL = UNIT_END + 0x0401, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x0402, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x0403, // Size: 12, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x040F, // Size: 12, Type: INT, Flags: PRIVATE - PLAYER_FIELD_KILLS = UNIT_END + 0x041B, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_FIELD_TODAY_CONTRIBUTION = UNIT_END + 0x041C, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_YESTERDAY_CONTRIBUTION = UNIT_END + 0x041D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_LIFETIME_HONORBALE_KILLS = UNIT_END + 0x041E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BYTES2 = UNIT_END + 0x041F, // Size: 1, Type: 6, Flags: PRIVATE - PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x0420, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x0421, // Size: 25, Type: INT, Flags: PRIVATE - PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x043A, // Size: 21, Type: INT, Flags: PRIVATE - PLAYER_FIELD_HONOR_CURRENCY = UNIT_END + 0x044F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_ARENA_CURRENCY = UNIT_END + 0x0450, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x0451, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x0452, // Size: 25, Type: INT, Flags: PRIVATE - PLAYER_RUNE_REGEN_1 = UNIT_END + 0x046B, // Size: 4, Type: FLOAT, Flags: PRIVATE - PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x046F, // Size: 3, Type: INT, Flags: PRIVATE - PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x0472, // Size: 6, Type: INT, Flags: PRIVATE - PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x0478, // Size: 6, Type: INT, Flags: PRIVATE - PLAYER_GLYPHS_ENABLED = UNIT_END + 0x047E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_PADDING = UNIT_END + 0x047F, // Size: 1, Type: INT, Flags: NONE - PLAYER_END = UNIT_END + 0x0480, + PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000C, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000E, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x0010, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0011, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_2_5 = UNIT_END + 0x0013, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_3_1 = UNIT_END + 0x0014, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_3_2 = UNIT_END + 0x0015, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_3_3 = UNIT_END + 0x0016, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_3_5 = UNIT_END + 0x0018, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_4_1 = UNIT_END + 0x0019, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_4_2 = UNIT_END + 0x001A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_4_3 = UNIT_END + 0x001B, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_4_5 = UNIT_END + 0x001D, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_5_1 = UNIT_END + 0x001E, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_5_2 = UNIT_END + 0x001F, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_5_3 = UNIT_END + 0x0020, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_5_5 = UNIT_END + 0x0022, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_6_1 = UNIT_END + 0x0023, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_6_2 = UNIT_END + 0x0024, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_6_3 = UNIT_END + 0x0025, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_6_5 = UNIT_END + 0x0027, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_7_1 = UNIT_END + 0x0028, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_7_2 = UNIT_END + 0x0029, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_7_3 = UNIT_END + 0x002A, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_7_5 = UNIT_END + 0x002C, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_8_1 = UNIT_END + 0x002D, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_8_2 = UNIT_END + 0x002E, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_8_3 = UNIT_END + 0x002F, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_8_5 = UNIT_END + 0x0031, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_9_1 = UNIT_END + 0x0032, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_9_2 = UNIT_END + 0x0033, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_9_3 = UNIT_END + 0x0034, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_9_5 = UNIT_END + 0x0036, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_10_1 = UNIT_END + 0x0037, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_10_2 = UNIT_END + 0x0038, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_10_3 = UNIT_END + 0x0039, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_10_5 = UNIT_END + 0x003B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_11_1 = UNIT_END + 0x003C, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_11_2 = UNIT_END + 0x003D, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_11_3 = UNIT_END + 0x003E, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_11_5 = UNIT_END + 0x0040, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_12_1 = UNIT_END + 0x0041, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_12_2 = UNIT_END + 0x0042, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_12_3 = UNIT_END + 0x0043, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_12_5 = UNIT_END + 0x0045, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_13_1 = UNIT_END + 0x0046, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_13_2 = UNIT_END + 0x0047, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_13_3 = UNIT_END + 0x0048, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_13_5 = UNIT_END + 0x004A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_14_1 = UNIT_END + 0x004B, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_14_2 = UNIT_END + 0x004C, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_14_3 = UNIT_END + 0x004D, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_14_5 = UNIT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_15_1 = UNIT_END + 0x0050, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_15_2 = UNIT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_15_3 = UNIT_END + 0x0052, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_15_5 = UNIT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_16_1 = UNIT_END + 0x0055, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_16_2 = UNIT_END + 0x0056, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_16_3 = UNIT_END + 0x0057, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_16_5 = UNIT_END + 0x0059, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_17_1 = UNIT_END + 0x005A, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_17_2 = UNIT_END + 0x005B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_17_3 = UNIT_END + 0x005C, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_17_5 = UNIT_END + 0x005E, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_18_1 = UNIT_END + 0x005F, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_18_2 = UNIT_END + 0x0060, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_18_3 = UNIT_END + 0x0061, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_18_5 = UNIT_END + 0x0063, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_19_1 = UNIT_END + 0x0064, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_19_2 = UNIT_END + 0x0065, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_19_3 = UNIT_END + 0x0066, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_19_5 = UNIT_END + 0x0068, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_20_1 = UNIT_END + 0x0069, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_20_2 = UNIT_END + 0x006A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_20_3 = UNIT_END + 0x006B, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_20_5 = UNIT_END + 0x006D, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_21_1 = UNIT_END + 0x006E, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_21_2 = UNIT_END + 0x006F, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_21_3 = UNIT_END + 0x0070, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_21_5 = UNIT_END + 0x0072, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_22_1 = UNIT_END + 0x0073, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_22_2 = UNIT_END + 0x0074, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_22_3 = UNIT_END + 0x0075, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_22_5 = UNIT_END + 0x0077, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_23_1 = UNIT_END + 0x0078, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_23_2 = UNIT_END + 0x0079, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_23_3 = UNIT_END + 0x007A, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_23_5 = UNIT_END + 0x007C, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_24_1 = UNIT_END + 0x007D, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_24_2 = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_24_3 = UNIT_END + 0x007F, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_24_5 = UNIT_END + 0x0081, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_25_1 = UNIT_END + 0x0082, // Size: 1, Type: INT, Flags: PARTY_MEMBER + PLAYER_QUEST_LOG_25_2 = UNIT_END + 0x0083, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x0084, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_QUEST_LOG_25_5 = UNIT_END + 0x0086, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END + 0x0087, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UNIT_END + 0x0088, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_2_ENTRYID = UNIT_END + 0x0089, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UNIT_END + 0x008A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_3_ENTRYID = UNIT_END + 0x008B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UNIT_END + 0x008C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_4_ENTRYID = UNIT_END + 0x008D, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UNIT_END + 0x008E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_5_ENTRYID = UNIT_END + 0x008F, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UNIT_END + 0x0090, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_6_ENTRYID = UNIT_END + 0x0091, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UNIT_END + 0x0092, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_7_ENTRYID = UNIT_END + 0x0093, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UNIT_END + 0x0094, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_8_ENTRYID = UNIT_END + 0x0095, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UNIT_END + 0x0096, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_9_ENTRYID = UNIT_END + 0x0097, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UNIT_END + 0x0098, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_10_ENTRYID = UNIT_END + 0x0099, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UNIT_END + 0x009A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_11_ENTRYID = UNIT_END + 0x009B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UNIT_END + 0x009C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_12_ENTRYID = UNIT_END + 0x009D, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UNIT_END + 0x009E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_13_ENTRYID = UNIT_END + 0x009F, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UNIT_END + 0x00A0, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_14_ENTRYID = UNIT_END + 0x00A1, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UNIT_END + 0x00A2, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_15_ENTRYID = UNIT_END + 0x00A3, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UNIT_END + 0x00A4, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x00A5, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UNIT_END + 0x00A6, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_17_ENTRYID = UNIT_END + 0x00A7, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UNIT_END + 0x00A8, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_18_ENTRYID = UNIT_END + 0x00A9, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UNIT_END + 0x00AA, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_19_ENTRYID = UNIT_END + 0x00AB, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UNIT_END + 0x00AC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_CHOSEN_TITLE = UNIT_END + 0x00AD, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_FAKE_INEBRIATION = UNIT_END + 0x00AE, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_FIELD_PAD_0 = UNIT_END + 0x00AF, // Size: 1, Type: INT, Flags: NONE + PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x00B0, // Size: 46, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x00DE, // Size: 32, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x00FE, // Size: 56, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x0136, // Size: 14, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x0144, // Size: 24, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_KEYRING_SLOT_1 = UNIT_END + 0x015C, // Size: 64, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_CURRENCYTOKEN_SLOT_1 = UNIT_END + 0x019C, // Size: 64, Type: LONG, Flags: PRIVATE + PLAYER_FARSIGHT = UNIT_END + 0x01DC, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E2, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_KNOWN_CURRENCIES = UNIT_END + 0x01E4, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER_XP = UNIT_END + 0x01E6, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01E7, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x01E8, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_CHARACTER_POINTS1 = UNIT_END + 0x0368, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_CHARACTER_POINTS2 = UNIT_END + 0x0369, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_TRACK_CREATURES = UNIT_END + 0x036A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_TRACK_RESOURCES = UNIT_END + 0x036B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x036C, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x036D, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x036E, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_EXPERTISE = UNIT_END + 0x036F, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x0370, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x0371, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x0372, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x0373, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x0374, // Size: 7, Type: FLOAT, Flags: PRIVATE + PLAYER_SHIELD_BLOCK = UNIT_END + 0x037B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x037C, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x037D, // Size: 128, Type: BYTES, Flags: PRIVATE + PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x03FD, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_COINAGE = UNIT_END + 0x03FE, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x03FF, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x0406, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x040D, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x0414, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x0415, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x0416, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x0417, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x0418, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BYTES = UNIT_END + 0x0419, // Size: 1, Type: BYTES, Flags: PRIVATE + PLAYER_AMMO_ID = UNIT_END + 0x041A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SELF_RES_SPELL = UNIT_END + 0x041B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x041C, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x041D, // Size: 12, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x0429, // Size: 12, Type: INT, Flags: PRIVATE + PLAYER_FIELD_KILLS = UNIT_END + 0x0435, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_FIELD_TODAY_CONTRIBUTION = UNIT_END + 0x0436, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_YESTERDAY_CONTRIBUTION = UNIT_END + 0x0437, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_LIFETIME_HONORBALE_KILLS = UNIT_END + 0x0438, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BYTES2 = UNIT_END + 0x0439, // Size: 1, Type: 6, Flags: PRIVATE + PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x043A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x043B, // Size: 25, Type: INT, Flags: PRIVATE + PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x0454, // Size: 21, Type: INT, Flags: PRIVATE + PLAYER_FIELD_HONOR_CURRENCY = UNIT_END + 0x0469, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_ARENA_CURRENCY = UNIT_END + 0x046A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x046B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x046C, // Size: 25, Type: INT, Flags: PRIVATE + PLAYER_RUNE_REGEN_1 = UNIT_END + 0x0485, // Size: 4, Type: FLOAT, Flags: PRIVATE + PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x0489, // Size: 3, Type: INT, Flags: PRIVATE + PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x048C, // Size: 6, Type: INT, Flags: PRIVATE + PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x0492, // Size: 6, Type: INT, Flags: PRIVATE + PLAYER_GLYPHS_ENABLED = UNIT_END + 0x0498, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_PADDING = UNIT_END + 0x0499, // Size: 1, Type: INT, Flags: NONE + PLAYER_END = UNIT_END + 0x049A, }; enum EGameObjectFields diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 9f869d094d5..3b9c8845c3c 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10571... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10596... -#define EXPECTED_MANGOS_CLIENT_BUILD {10571, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10596, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 0635c58a9e6322f051ca681de4d671de66a33909 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 21 Oct 2009 23:48:42 +0400 Subject: [PATCH 06/46] Updated to latest PTR client 10623. Fixed build on VS 2010 Beta 2. --- src/shared/Database/SqlOperations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/Database/SqlOperations.cpp b/src/shared/Database/SqlOperations.cpp index d47e85d67b5..f707dd1f2a2 100644 --- a/src/shared/Database/SqlOperations.cpp +++ b/src/shared/Database/SqlOperations.cpp @@ -107,7 +107,7 @@ bool SqlQueryHolder::SetQuery(size_t index, const char *sql) } /// not executed yet, just stored (it's not called a holder for nothing) - m_queries[index] = SqlResultPair(strdup(sql), NULL); + m_queries[index] = SqlResultPair(strdup(sql), (QueryResult*)NULL); return true; } From 77228032acb508067fdbe493d6947c512b5739b3 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 21 Oct 2009 23:50:25 +0400 Subject: [PATCH 07/46] Added lost changes. --- src/realmd/AuthCodes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 3b9c8845c3c..93a29ae6795 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10596... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10623... -#define EXPECTED_MANGOS_CLIENT_BUILD {10596, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10623, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 1aaadbdcb902d52734c38385540229b4bf463f60 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 22 Oct 2009 18:49:40 +0400 Subject: [PATCH 08/46] Some quest fixes. --- src/game/GossipDef.cpp | 39 +++++++++++++++++++++++----- src/game/Opcodes.h | 48 +++++++++++++++++------------------ src/game/Player.cpp | 5 ++-- src/game/Player.h | 56 +++++++++++++++++++++++------------------ src/game/UpdateFields.h | 2 +- 5 files changed, 92 insertions(+), 58 deletions(-) diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 3093651de00..9e0ce99df55 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -419,8 +419,6 @@ void PlayerMenu::SendQuestGiverStatus( uint8 questStatus, uint64 npcGUID ) void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID, bool ActivateAccept ) { - WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size - std::string Title = pQuest->GetTitle(); std::string Details = pQuest->GetDetails(); std::string Objectives = pQuest->GetObjectives(); @@ -443,16 +441,18 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID } } + WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size data << uint64(npcGUID); data << uint64(0); // wotlk, something todo with quest sharing? data << uint32(pQuest->GetQuestId()); data << Title; data << Details; data << Objectives; - data << uint32(ActivateAccept); + data << uint8(ActivateAccept ? 1 : 0); data << uint32(pQuest->GetSuggestedPlayers()); data << uint8(0); // new wotlk data << uint8(0); // new 3.1 + data << uint8(0); // new 3.3.0 if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { @@ -493,12 +493,25 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID data << uint32(pQuest->GetRewOrReqMoney()); } + data << uint32(0); // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10*MaNGOS::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); + data << float(0); // new 3.3.0 data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) data << uint32(pQuest->GetRewSpellCast()); // casted spell data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(pQuest->GetBonusTalents()); // bonus talents + data << uint32(0); + data << uint32(0); + + for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + data << uint32(0); + + for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + data << uint32(0); + + for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + data << uint32(0); data << uint32(QUEST_EMOTE_COUNT); for (uint32 i=0; i < QUEST_EMOTE_COUNT; ++i) @@ -679,12 +692,12 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, WorldPacket data( SMSG_QUESTGIVER_OFFER_REWARD, 50 ); // guess size - data << npcGUID; - data << pQuest->GetQuestId(); + data << uint64(npcGUID); + data << uint32(pQuest->GetQuestId()); data << Title; data << OfferRewardText; - data << uint32( EnableNext ); + data << uint8(EnableNext ? 1 : 0); data << uint32(0); // unk uint32 EmoteCount = 0; @@ -731,15 +744,29 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, data << uint32(0); } + data << uint32(0); data << uint32(pQuest->GetRewOrReqMoney()); // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10*MaNGOS::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); + data << float(0); data << uint32(0x08); // unused by client? data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) data << uint32(pQuest->GetRewSpellCast()); // casted spell data << uint32(0); // unknown data << uint32(pQuest->GetBonusTalents()); // bonus talents + data << uint32(0); + data << uint32(0); + + for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids + data << uint32(0); + + for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid in QuestFactionReward.dbc (zero based)? + data << uint32(0); + + for(int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override? + data << uint32(0); + pSession->SendPacket( &data ); sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId() ); } diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 80b63331e87..323d8b5cac0 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -545,7 +545,7 @@ enum Opcodes SMSG_ENVIRONMENTALDAMAGELOG = 0x1FC, CMSG_PLAYER_DIFFICULTY_CHANGE = 0x1FD, SMSG_RWHOIS = 0x1FE, - MSG_LOOKING_FOR_GROUP = 0x1FF, + MSG_LOOKING_FOR_GROUP = 0x1FF, // uint32, uint8, uint32, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32,uint32} CMSG_SET_LOOKING_FOR_GROUP = 0x200, CMSG_UNLEARN_SPELL = 0x201, CMSG_UNLEARN_SKILL = 0x202, @@ -894,29 +894,29 @@ enum Opcodes MSG_MOVE_START_ASCEND = 0x359, MSG_MOVE_STOP_ASCEND = 0x35A, SMSG_ARENA_TEAM_STATS = 0x35B, - CMSG_LFG_SET_AUTOJOIN = 0x35C, - CMSG_LFG_CLEAR_AUTOJOIN = 0x35D, - CMSG_LFM_SET_AUTOFILL = 0x35E, - CMSG_LFM_CLEAR_AUTOFILL = 0x35F, - CMSG_ACCEPT_LFG_MATCH = 0x360, - CMSG_DECLINE_LFG_MATCH = 0x361, - CMSG_CANCEL_PENDING_LFG = 0x362, - CMSG_CLEAR_LOOKING_FOR_GROUP = 0x363, - CMSG_CLEAR_LOOKING_FOR_MORE = 0x364, - CMSG_SET_LOOKING_FOR_MORE = 0x365, - CMSG_SET_LFG_COMMENT = 0x366, - SMSG_LFG_TIMEDOUT = 0x367, - SMSG_LFG_OTHER_TIMEDOUT = 0x368, - SMSG_LFG_AUTOJOIN_FAILED = 0x369, - SMSG_LFG_AUTOJOIN_FAILED_NO_PLAYER = 0x36A, - SMSG_LFG_LEADER_IS_LFM = 0x36B, - SMSG_LFG_UPDATE = 0x36C, - SMSG_LFG_UPDATE_LFM = 0x36D, - SMSG_LFG_UPDATE_LFG = 0x36E, - SMSG_LFG_UPDATE_QUEUED = 0x36F, - SMSG_LFG_PENDING_INVITE = 0x370, - SMSG_LFG_PENDING_MATCH = 0x371, - SMSG_LFG_PENDING_MATCH_DONE = 0x372, + CMSG_LFG_SET_AUTOJOIN = 0x35C, // CMSG JoinLFG + CMSG_LFG_CLEAR_AUTOJOIN = 0x35D, // CMSG LeaveLFG + CMSG_LFM_SET_AUTOFILL = 0x35E, // CMSG SearchLFGJoin + CMSG_LFM_CLEAR_AUTOFILL = 0x35F, // CMSG SearchLFGLeave + CMSG_ACCEPT_LFG_MATCH = 0x360, // SMSG uint32, uint32, if(uint8) { uint32 count, for(count) { uint64} }, uint32 count2, uint32, for(count2) { uint64, uint32 flags, if(flags & 0x2) {string}, if(flags & 0x10) {for(3) uint8}, if(flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for(count3) {uint64, uint32 flags, if(flags & 0x1) {uint8, uint8, uint8, for(3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if(flags&0x2) string, if(flags&0x4) uint8, if(flags&0x8) uint64, if(flags&0x10) uint8, if(flags&0x20) uint32, if(flags&0x40) uint8, if(flags& 0x80) {uint64, uint32}} + CMSG_DECLINE_LFG_MATCH = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for(uint8) {uint32,uint8,uint8,uint8,uint8} + CMSG_CANCEL_PENDING_LFG = 0x362, // CMSG AcceptProposal, RejectProposal + CMSG_CLEAR_LOOKING_FOR_GROUP = 0x363, // SMSG uint32, uint8, for(uint8) uint32, uint8, for(uint8) { uint64, uint8, uint32, uint8, } + CMSG_CLEAR_LOOKING_FOR_MORE = 0x364, // SMSG uint32 unk, uint32, if(unk==6) { uint8 count, for(count) uint64 } + CMSG_SET_LOOKING_FOR_MORE = 0x365, // SMSG uint32, uint32, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 + CMSG_SET_LFG_COMMENT = 0x366, // CMSG SetLFGComment + SMSG_LFG_TIMEDOUT = 0x367, // SMSG uint8, if(uint8) { uint8, uint8, uint8, uint8, if(uint8) uint32, string} + SMSG_LFG_OTHER_TIMEDOUT = 0x368, // SMSG uint8, if(uint8) { uint8, uint8, uint8, for(3) uint8, uint8, if(uint8) for(uint8) uint32, string} + SMSG_LFG_AUTOJOIN_FAILED = 0x369, // SMSG uint8 + SMSG_LFG_AUTOJOIN_FAILED_NO_PLAYER = 0x36A, // CMSG SetLFGRoles + SMSG_LFG_LEADER_IS_LFM = 0x36B, // CMSG SetLFGNeeds + SMSG_LFG_UPDATE = 0x36C, // CMSG SetLFGBootVote + SMSG_LFG_UPDATE_LFM = 0x36D, // SMSG uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 + SMSG_LFG_UPDATE_LFG = 0x36E, // CMSG RequestLFDPlayerLockInfo + SMSG_LFG_UPDATE_QUEUED = 0x36F, // SMSG uint8, for(uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32, uint32}}, uint32, for(uint32) {uint32,uint32} + SMSG_LFG_PENDING_INVITE = 0x370, // CMSG LFGTeleport + SMSG_LFG_PENDING_MATCH = 0x371, // CMSG RequestLFDPartyLockInfo + SMSG_LFG_PENDING_MATCH_DONE = 0x372, // SMSG uint8, for(uint8) uint64 SMSG_TITLE_EARNED = 0x373, CMSG_SET_TITLE = 0x374, CMSG_CANCEL_MOUNT_AURA = 0x375, diff --git a/src/game/Player.cpp b/src/game/Player.cpp index a7bbcc4a0f4..a91668bdd7d 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3733,7 +3733,7 @@ void Player::InitVisibleBits() updateVisualBits.SetBit(PLAYER_GUILD_TIMESTAMP); // PLAYER_QUEST_LOG_x also visible bit on official (but only on party/raid)... - for(uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_25_2; i += 4) + for(uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_25_2; i += MAX_QUEST_OFFSET) updateVisualBits.SetBit(i); // Players visible items are not inventory stuff @@ -13864,6 +13864,7 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive data << uint32(10*MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills())); data << uint32(pQuest->GetBonusTalents()); // bonus talents + data << uint32(0); GetSession()->SendPacket( &data ); if (pQuest->GetQuestCompleteScript() != 0) @@ -13951,7 +13952,7 @@ void Player::SendQuestUpdateAddItem( Quest const* pQuest, uint32 item_idx, uint3 void Player::SendQuestUpdateAddCreatureOrGo( Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint32 old_count, uint32 add_count ) { - assert(old_count + add_count < 256 && "mob/GO count store in 8 bits 2^8 = 256 (0..256)"); + assert(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)"); int32 entry = pQuest->ReqCreatureOrGOId[ creatureOrGO_idx ]; if (entry < 0) diff --git a/src/game/Player.h b/src/game/Player.h index 8cb49f0331e..ed4ee3b7695 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -548,13 +548,13 @@ typedef std::map QuestStatusMap; enum QuestSlotOffsets { - QUEST_ID_OFFSET = 0, - QUEST_STATE_OFFSET = 1, - QUEST_COUNTS_OFFSET = 2, - QUEST_TIME_OFFSET = 3 + QUEST_ID_OFFSET = 0, + QUEST_STATE_OFFSET = 1, + QUEST_COUNTS_OFFSET = 2, // 2 and 3 + QUEST_TIME_OFFSET = 4 }; -#define MAX_QUEST_OFFSET 4 +#define MAX_QUEST_OFFSET 5 enum QuestSlotStateMask { @@ -1320,31 +1320,37 @@ class MANGOS_DLL_SPEC Player : public Unit void ResetDailyQuestStatus(); uint16 FindQuestSlot( uint32 quest_id ) const; - uint32 GetQuestSlotQuestId(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_ID_OFFSET); } - uint32 GetQuestSlotState(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_STATE_OFFSET); } - uint32 GetQuestSlotCounters(uint16 slot)const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET); } - uint8 GetQuestSlotCounter(uint16 slot,uint8 counter) const { return GetByteValue(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET,counter); } - uint32 GetQuestSlotTime(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_TIME_OFFSET); } - void SetQuestSlot(uint16 slot,uint32 quest_id, uint32 timer = 0) + uint32 GetQuestSlotQuestId(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_ID_OFFSET); } + uint32 GetQuestSlotState(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_STATE_OFFSET); } + uint16 GetQuestSlotCounter(uint16 slot, uint8 counter) const { return (uint16)(GetUInt64Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET) >> (counter * 16)); } + uint32 GetQuestSlotTime(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_TIME_OFFSET); } + void SetQuestSlot(uint16 slot, uint32 quest_id, uint32 timer = 0) { - SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_ID_OFFSET,quest_id); - SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_STATE_OFFSET,0); - SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET,0); - SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_TIME_OFFSET,timer); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_ID_OFFSET, quest_id); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_STATE_OFFSET, 0); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET, 0); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET + 1, 0); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_TIME_OFFSET, timer); } - void SetQuestSlotCounter(uint16 slot,uint8 counter,uint8 count) { SetByteValue(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET,counter,count); } - void SetQuestSlotState(uint16 slot,uint32 state) { SetFlag(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_STATE_OFFSET,state); } - void RemoveQuestSlotState(uint16 slot,uint32 state) { RemoveFlag(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_STATE_OFFSET,state); } - void SetQuestSlotTimer(uint16 slot,uint32 timer) { SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot*MAX_QUEST_OFFSET + QUEST_TIME_OFFSET,timer); } - void SwapQuestSlot(uint16 slot1,uint16 slot2) + void SetQuestSlotCounter(uint16 slot, uint8 counter, uint16 count) { - for (int i = 0; i < MAX_QUEST_OFFSET ; ++i ) + uint64 val = GetUInt64Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET); + val &= ~((uint64)0xFFFF << (counter * 16)); + val |= ((uint64)count << (counter * 16)); + SetUInt64Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_COUNTS_OFFSET, val); + } + void SetQuestSlotState(uint16 slot, uint32 state) { SetFlag(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_STATE_OFFSET, state); } + void RemoveQuestSlotState(uint16 slot, uint32 state) { RemoveFlag(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_STATE_OFFSET, state); } + void SetQuestSlotTimer(uint16 slot, uint32 timer) { SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_TIME_OFFSET, timer); } + void SwapQuestSlot(uint16 slot1, uint16 slot2) + { + for (int i = 0; i < MAX_QUEST_OFFSET; ++i) { - uint32 temp1 = GetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET *slot1 + i); - uint32 temp2 = GetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET *slot2 + i); + uint32 temp1 = GetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET * slot1 + i); + uint32 temp2 = GetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET * slot2 + i); - SetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET *slot1 + i, temp2); - SetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET *slot2 + i, temp1); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET * slot1 + i, temp2); + SetUInt32Value(PLAYER_QUEST_LOG_1_1 + MAX_QUEST_OFFSET * slot2 + i, temp1); } } uint32 GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry); diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 9e30fbf2cb6..526913c41ff 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -187,7 +187,7 @@ enum EUnitFields PLAYER_QUEST_LOG_1_1 = UNIT_END + 0x000A, // Size: 1, Type: INT, Flags: PARTY_MEMBER PLAYER_QUEST_LOG_1_2 = UNIT_END + 0x000B, // Size: 1, Type: INT, Flags: PRIVATE PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000C, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000E, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_QUEST_LOG_1_5 = UNIT_END + 0x000E, // Size: 1, Type: INT, Flags: PRIVATE PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PARTY_MEMBER PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x0010, // Size: 1, Type: INT, Flags: PRIVATE PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0011, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE From 7a722b8d790dcd41e5ccd285f0eadf726cbafed0 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 22 Oct 2009 21:12:45 +0400 Subject: [PATCH 09/46] Added missing ReqItem 5 and 6 to database. --- sql/330/01_quest_template.sql | 5 +++ src/game/GossipDef.cpp | 20 ++++------ src/game/Level3.cpp | 6 +-- src/game/ObjectMgr.cpp | 40 +++++++++---------- src/game/Player.cpp | 28 ++++++------- src/game/QuestDef.cpp | 74 ++++++++++++++++++----------------- src/game/QuestDef.h | 9 +++-- src/game/QuestHandler.cpp | 4 +- 8 files changed, 96 insertions(+), 90 deletions(-) create mode 100644 sql/330/01_quest_template.sql diff --git a/sql/330/01_quest_template.sql b/sql/330/01_quest_template.sql new file mode 100644 index 00000000000..ccf7e98b6ae --- /dev/null +++ b/sql/330/01_quest_template.sql @@ -0,0 +1,5 @@ +alter table `quest_template` + add column `ReqItemId5` mediumint(8) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemId4`, + add column `ReqItemId6` mediumint(8) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemId5`, + add column `ReqItemCount5` smallint(5) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemCount4`, + add column `ReqItemCount6` smallint(5) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemCount5`; diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 9e0ce99df55..04d753d81f6 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -532,8 +532,8 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) Details = pQuest->GetDetails(); Objectives = pQuest->GetObjectives(); EndText = pQuest->GetEndText(); - for (int i=0;iObjectiveText[i]; + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + ObjectiveText[i] = pQuest->ObjectiveText[i]; int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) @@ -550,9 +550,9 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty()) EndText=ql->EndText[loc_idx]; - for (int i=0;iObjectiveText[i].size() > loc_idx && !ql->ObjectiveText[i][loc_idx].empty()) - ObjectiveText[i]=ql->ObjectiveText[i][loc_idx]; + ObjectiveText[i] = ql->ObjectiveText[i][loc_idx]; } } @@ -654,17 +654,12 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << uint32(pQuest->ReqSourceId[iI]); } - for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) + for (iI = 0; iI < QUEST_ITEM_OBJECTIVES_COUNT; ++iI) { data << uint32(pQuest->ReqItemId[iI]); data << uint32(pQuest->ReqItemCount[iI]); } - data << uint32(0); // TODO: 5 item objective - data << uint32(0); - data << uint32(0); // TODO: 6 item objective - data << uint32(0); - for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) data << ObjectiveText[iI]; @@ -824,9 +819,10 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID data << uint32( pQuest->GetReqItemsCount() ); ItemPrototype const *pItem; - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if ( !pQuest->ReqItemId[i] ) continue; + if ( !pQuest->ReqItemId[i] ) + continue; pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemCount[i]); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 0b9a21aaa50..ec9706652cf 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4794,7 +4794,7 @@ bool ChatHandler::HandleQuestComplete(const char* args) } // Add quest items for quests that require items - for(uint8 x = 0; x < QUEST_OBJECTIVES_COUNT; ++x) + for(uint8 x = 0; x < QUEST_ITEM_OBJECTIVES_COUNT; ++x) { uint32 id = pQuest->ReqItemId[x]; uint32 count = pQuest->ReqItemCount[x]; @@ -4804,11 +4804,11 @@ bool ChatHandler::HandleQuestComplete(const char* args) uint32 curItemCount = player->GetItemCount(id,true); ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, id, count-curItemCount ); + uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, id, count - curItemCount ); if( msg == EQUIP_ERR_OK ) { Item* item = player->StoreNewItem( dest, id, true); - player->SendNewItem(item,count-curItemCount,true,false); + player->SendNewItem(item,count-curItemCount, true, false); } } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index f21cfdbd18a..9a7ba0cd8e2 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3225,31 +3225,31 @@ void ObjectMgr::LoadQuests() "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, SrcItemId, SrcItemCount, SrcSpell," // 29 30 31 32 33 34 35 36 37 38 "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4," - // 39 40 41 42 43 44 45 46 - "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4," - // 47 48 49 50 51 52 53 54 + // 39 40 41 42 43 44 45 46 47 48 49 50 + "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6," + // 51 52 53 54 55 56 57 58 "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4," - // 55 56 57 58 59 60 61 62 + // 59 60 61 62 63 64 65 66 "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4," - // 63 64 65 66 + // 67 68 69 70 "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4," - // 67 68 69 70 71 72 + // 71 72 73 74 75 76 "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6," - // 73 74 75 76 77 78 + // 77 78 79 80 81 82 "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6," - // 79 80 81 82 83 84 85 86 + // 83 84 85 86 87 88 89 90 "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4," - // 87 88 89 90 91 92 93 94 95 96 + // 91 92 93 94 95 96 97 98 99 100 "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5," - // 97 98 99 100 101 102 103 104 105 106 107 + // 101 102 103 104 105 106 107 108 109 110 111 "RewHonorableKills, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," - // 108 109 110 111 112 113 114 115 + // 112 113 114 115 116 117 118 119 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4," - // 116 117 118 119 120 121 + // 120 121 122 123 124 125 "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," - // 122 123 124 125 + // 126 127 128 129 "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," - // 126 127 + // 130 131 "StartScript, CompleteScript" " FROM quest_template"); if(result == NULL) @@ -3503,15 +3503,15 @@ void ObjectMgr::LoadQuests() } } - for(int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j ) + for(int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j ) { uint32 id = qinfo->ReqItemId[j]; if(id) { - if(qinfo->ReqItemCount[j]==0) + if(qinfo->ReqItemCount[j] == 0) { sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done for this requirement } @@ -3520,14 +3520,14 @@ void ObjectMgr::LoadQuests() if(!sItemStorage.LookupEntry(id)) { sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } - else if(qinfo->ReqItemCount[j]>0) + else if(qinfo->ReqItemCount[j] > 0) { sLog.outErrorDb("Quest %u has `ReqItemId%d` = 0 but `ReqItemCount%d` = %u, quest can't be done.", - qinfo->GetQuestId(),j+1,j+1,qinfo->ReqItemCount[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->ReqItemCount[j]); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 028cdb0c8a6..e01544759e0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -12418,9 +12418,9 @@ bool Player::CanCompleteQuest( uint32 quest_id ) if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if( qInfo->ReqItemCount[i]!= 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i] ) + if( qInfo->ReqItemCount[i] != 0 && q_status.m_itemcount[i] < qInfo->ReqItemCount[i] ) return false; } } @@ -12468,8 +12468,8 @@ bool Player::CanCompleteRepeatableQuest( Quest const *pQuest ) return false; if (pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER) ) - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i]) ) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i]) ) return false; if( !CanRewardQuest(pQuest, false) ) @@ -12495,9 +12495,9 @@ bool Player::CanRewardQuest( Quest const *pQuest, bool msg ) // prevent receive reward with quest items in bank if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if( pQuest->ReqItemCount[i]!= 0 && + if( pQuest->ReqItemCount[i] != 0 && GetItemCount(pQuest->ReqItemId[i]) < pQuest->ReqItemCount[i] ) { if(msg) @@ -12577,7 +12577,7 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver ) if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) questStatusData.m_itemcount[i] = 0; } @@ -12675,7 +12675,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver uint32 quest_id = pQuest->GetQuestId(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i ) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i ) { if (pQuest->ReqItemId[i]) DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true); @@ -13381,12 +13381,12 @@ void Player::AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& ques { if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) { - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { uint32 reqitemcount = pQuest->ReqItemCount[i]; if( reqitemcount != 0 ) { - uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i],true); + uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i], true); questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount); if (questStatusData.uState != QUEST_NEW) questStatusData.uState = QUEST_CHANGED; @@ -13460,7 +13460,7 @@ void Player::ItemAddedQuestCheck( uint32 entry, uint32 count ) if( !qInfo || !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) continue; - for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { uint32 reqitem = qInfo->ReqItemId[j]; if ( reqitem == entry ) @@ -13497,7 +13497,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count ) if( !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) continue; - for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { uint32 reqitem = qInfo->ReqItemId[j]; if ( reqitem == entry ) @@ -13509,7 +13509,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count ) if( q_status.m_status != QUEST_STATUS_COMPLETE ) curitemcount = q_status.m_itemcount[j]; else - curitemcount = GetItemCount(entry,true); + curitemcount = GetItemCount(entry, true); if ( curitemcount < reqitemcount + count ) { uint32 remitemcount = ( curitemcount <= reqitemcount ? count : count + reqitemcount - curitemcount); @@ -13799,7 +13799,7 @@ bool Player::HasQuestForItem( uint32 itemid ) const // There should be no mixed ReqItem/ReqSource drop // This part for ReqItem drop - for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) { if(itemid == qinfo->ReqItemId[j] && q_status.m_itemcount[j] < qinfo->ReqItemCount[j] ) return true; diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index 8c71d83ac31..5a53e5252a2 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -61,74 +61,74 @@ Quest::Quest(Field * questRecord) for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ObjectiveText[i] = questRecord[35+i].GetCppString(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) ReqItemId[i] = questRecord[39+i].GetUInt32(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqItemCount[i] = questRecord[43+i].GetUInt32(); + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + ReqItemCount[i] = questRecord[45+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceId[i] = questRecord[47+i].GetUInt32(); + ReqSourceId[i] = questRecord[51+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - ReqSourceCount[i] = questRecord[51+i].GetUInt32(); + ReqSourceCount[i] = questRecord[55+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOId[i] = questRecord[55+i].GetInt32(); + ReqCreatureOrGOId[i] = questRecord[59+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqCreatureOrGOCount[i] = questRecord[59+i].GetUInt32(); + ReqCreatureOrGOCount[i] = questRecord[63+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ReqSpell[i] = questRecord[63+i].GetUInt32(); + ReqSpell[i] = questRecord[67+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemId[i] = questRecord[67+i].GetUInt32(); + RewChoiceItemId[i] = questRecord[71+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewChoiceItemCount[i] = questRecord[73+i].GetUInt32(); + RewChoiceItemCount[i] = questRecord[77+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemId[i] = questRecord[79+i].GetUInt32(); + RewItemId[i] = questRecord[83+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewItemCount[i] = questRecord[83+i].GetUInt32(); + RewItemCount[i] = questRecord[87+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepFaction[i] = questRecord[87+i].GetUInt32(); + RewRepFaction[i] = questRecord[91+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewRepValue[i] = questRecord[92+i].GetInt32(); - - RewHonorableKills = questRecord[97].GetUInt32(); - RewOrReqMoney = questRecord[98].GetInt32(); - RewMoneyMaxLevel = questRecord[99].GetUInt32(); - RewSpell = questRecord[100].GetUInt32(); - RewSpellCast = questRecord[101].GetUInt32(); - RewMailTemplateId = questRecord[102].GetUInt32(); - RewMailDelaySecs = questRecord[103].GetUInt32(); - PointMapId = questRecord[104].GetUInt32(); - PointX = questRecord[105].GetFloat(); - PointY = questRecord[106].GetFloat(); - PointOpt = questRecord[107].GetUInt32(); + RewRepValue[i] = questRecord[96+i].GetInt32(); + + RewHonorableKills = questRecord[101].GetUInt32(); + RewOrReqMoney = questRecord[102].GetInt32(); + RewMoneyMaxLevel = questRecord[103].GetUInt32(); + RewSpell = questRecord[104].GetUInt32(); + RewSpellCast = questRecord[105].GetUInt32(); + RewMailTemplateId = questRecord[106].GetUInt32(); + RewMailDelaySecs = questRecord[107].GetUInt32(); + PointMapId = questRecord[108].GetUInt32(); + PointX = questRecord[109].GetFloat(); + PointY = questRecord[110].GetFloat(); + PointOpt = questRecord[111].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[108+i].GetUInt32(); + DetailsEmote[i] = questRecord[112+i].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmoteDelay[i] = questRecord[112+i].GetUInt32(); + DetailsEmoteDelay[i] = questRecord[116+i].GetUInt32(); - IncompleteEmote = questRecord[116].GetUInt32(); - CompleteEmote = questRecord[117].GetUInt32(); + IncompleteEmote = questRecord[120].GetUInt32(); + CompleteEmote = questRecord[121].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[118+i].GetInt32(); + OfferRewardEmote[i] = questRecord[122+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmoteDelay[i] = questRecord[122+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[126+i].GetInt32(); - QuestStartScript = questRecord[126].GetUInt32(); - QuestCompleteScript = questRecord[127].GetUInt32(); + QuestStartScript = questRecord[130].GetUInt32(); + QuestCompleteScript = questRecord[131].GetUInt32(); QuestFlags |= SpecialFlags << 16; @@ -137,10 +137,14 @@ Quest::Quest(Field * questRecord) m_rewitemscount = 0; m_rewchoiceitemscount = 0; - for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { if ( ReqItemId[i] ) ++m_reqitemscount; + } + + for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) + { if ( ReqCreatureOrGOId[i] ) ++m_reqCreatureOrGOcount; } diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index d8dc4fabfdb..546a5dcc5de 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -32,6 +32,7 @@ class ObjectMgr; #define MAX_QUEST_LOG_SIZE 25 #define QUEST_OBJECTIVES_COUNT 4 +#define QUEST_ITEM_OBJECTIVES_COUNT 6 #define QUEST_SOURCE_ITEM_IDS_COUNT 4 #define QUEST_REWARD_CHOICES_COUNT 6 #define QUEST_REWARDS_COUNT 4 @@ -231,8 +232,8 @@ class Quest // multiple values std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; - uint32 ReqItemId[QUEST_OBJECTIVES_COUNT]; - uint32 ReqItemCount[QUEST_OBJECTIVES_COUNT]; + uint32 ReqItemId[QUEST_ITEM_OBJECTIVES_COUNT]; + uint32 ReqItemCount[QUEST_ITEM_OBJECTIVES_COUNT]; uint32 ReqSourceId[QUEST_SOURCE_ITEM_IDS_COUNT]; uint32 ReqSourceCount[QUEST_SOURCE_ITEM_IDS_COUNT]; int32 ReqCreatureOrGOId[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject @@ -332,7 +333,7 @@ struct QuestStatusData : m_status(QUEST_STATUS_NONE),m_rewarded(false), m_explored(false), m_timer(0), uState(QUEST_NEW) { - memset(m_itemcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32)); + memset(m_itemcount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint32)); memset(m_creatureOrGOcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32)); } @@ -342,7 +343,7 @@ struct QuestStatusData uint32 m_timer; QuestUpdateState uState; - uint32 m_itemcount[ QUEST_OBJECTIVES_COUNT ]; + uint32 m_itemcount[ QUEST_ITEM_OBJECTIVES_COUNT ]; uint32 m_creatureOrGOcount[ QUEST_OBJECTIVES_COUNT ]; }; #endif diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index ad42c75b73f..a93b65880f6 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -193,7 +193,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data ) // destroy not required for quest finish quest starting item bool destroyItem = true; - for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount > 0)) { @@ -203,7 +203,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data ) } if(destroyItem) - _player->DestroyItem(((Item*)pObject)->GetBagSlot(),((Item*)pObject)->GetSlot(),true); + _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true); break; } From ff7af1813807d80d24e877faf3b81be944038c3e Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 24 Oct 2009 19:38:37 +0400 Subject: [PATCH 10/46] Updated to latest PTR client build 10676. --- sql/330/01_quest_template.sql | 5 ---- src/game/GossipDef.cpp | 4 +-- src/game/Group.cpp | 49 +++++++++++++++++++++++++++++++++-- src/game/Group.h | 15 +++++++---- src/game/GroupHandler.cpp | 2 +- src/game/LFGHandler.cpp | 5 ++-- src/game/LootMgr.h | 5 +++- src/game/MiscHandler.cpp | 8 ++++++ src/game/Opcodes.cpp | 33 +++++++++++------------ src/game/Opcodes.h | 25 +++++++++--------- src/game/Player.h | 3 ++- src/game/QueryHandler.cpp | 19 ++++++++++++++ src/game/UpdateFields.h | 2 +- src/game/WorldSession.cpp | 1 + src/game/WorldSession.h | 2 ++ src/realmd/AuthCodes.h | 4 +-- 16 files changed, 132 insertions(+), 50 deletions(-) delete mode 100644 sql/330/01_quest_template.sql diff --git a/sql/330/01_quest_template.sql b/sql/330/01_quest_template.sql deleted file mode 100644 index ccf7e98b6ae..00000000000 --- a/sql/330/01_quest_template.sql +++ /dev/null @@ -1,5 +0,0 @@ -alter table `quest_template` - add column `ReqItemId5` mediumint(8) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemId4`, - add column `ReqItemId6` mediumint(8) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemId5`, - add column `ReqItemCount5` smallint(5) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemCount4`, - add column `ReqItemCount6` smallint(5) UNSIGNED DEFAULT '0' NOT NULL after `ReqItemCount5`; diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 04d753d81f6..d1cd1452bb1 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -574,7 +574,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) data << uint32(0); // RequiredOpositeRepValue, required faction value with another (oposite) faction (objective) data << uint32(pQuest->GetNextQuestInChain()); // client will request this quest from NPC, if not 0 - data << uint32(0); // unk 3.3.0 + data << uint32(0); // column index in QuestXP.dbc (row based on quest level) if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) data << uint32(0); // Hide money rewarded @@ -622,7 +622,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // reward factions ids data << uint32(0); - for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // columnid in QuestFactionReward.dbc (zero based)? + for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // column index in QuestFactionReward.dbc? data << uint32(0); for(iI = 0; iI < QUEST_REPUTATIONS_COUNT; ++iI) // reward reputation override? diff --git a/src/game/Group.cpp b/src/game/Group.cpp index bf4d5d36093..44095c52859 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -479,7 +479,7 @@ void Group::Disband(bool hideDestroy) void Group::SendLootStartRoll(uint32 CountDown, const Roll &r) { - WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4)); + WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1)); data << uint64(r.itemGUID); // guid of rolled item data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for @@ -487,6 +487,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r) data << uint32(r.itemRandomPropId); // item random property ID data << uint32(r.itemCount); // items in stack data << uint32(CountDown); // the countdown time to choose "need" or "greed" + data << uint8(ALL_ROLL_TYPE_MASK); // roll type mask for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { @@ -750,8 +751,15 @@ void Group::CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 N itr->second = GREED; } break; + case ROLL_DISENCHANT: // player choose Disenchant + { + SendLootRoll(0, playerGUID, 128, ROLL_DISENCHANT, *roll); + ++roll->totalDisenchant; + itr->second = DISENCHANT; + } + break; } - if (roll->totalPass + roll->totalGreed + roll->totalNeed >= roll->totalPlayersRolling) + if (roll->totalPass + roll->totalNeed + roll->totalGreed + roll->totalDisenchant >= roll->totalPlayersRolling) { CountTheRoll(rollI, NumberOfPlayers); } @@ -872,6 +880,39 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) } } } + else if(roll->totalDisenchant > 0) + { + uint8 maxresul = 0; + uint64 maxguid = (*roll->playerVote.begin()).first; + Player *player; + + for( Roll::PlayerVote::const_iterator itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) + { + if (itr->second != DISENCHANT) + continue; + + uint8 randomN = urand(1, 99); + SendLootRoll(0, itr->first, randomN, ROLL_DISENCHANT, *roll); + if (maxresul < randomN) + { + maxguid = itr->first; + maxresul = randomN; + } + } + SendLootRollWon(0, maxguid, maxresul, ROLL_DISENCHANT, *roll); + player = objmgr.GetPlayer(maxguid); + + if(player && player->GetSession()) + { + LootItem *item = &(roll->getLoot()->items[roll->itemSlot]); + item->is_looted = true; + roll->getLoot()->NotifyItemRemoved(roll->itemSlot); + --roll->getLoot()->unlootedCount; + + ItemPrototype const *pProto = objmgr.GetItemPrototype(roll->itemid); + player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); + } + } else { SendLootAllPassed(NumberOfPlayers, *roll); @@ -976,6 +1017,7 @@ void Group::SendUpdate() data << (uint8)(onlineState); data << (uint8)(citr2->group); // groupid data << (uint8)(citr2->assistant?0x01:0); // 0x2 main assist, 0x4 main tank + data << uint8(0); // 3.3 } data << uint64(m_leaderGuid); // leader guid @@ -986,6 +1028,7 @@ void Group::SendUpdate() data << (uint8)m_lootThreshold; // loot threshold data << (uint8)m_dungeonDifficulty; // Dungeon Difficulty data << (uint8)m_raidDifficulty; // Raid Difficulty + data << uint8(0); // 3.3 } player->GetSession()->SendPacket( &data ); } @@ -1236,6 +1279,8 @@ void Group::_removeRolls(const uint64 &guid) --roll->totalNeed; if (itr2->second == PASS) --roll->totalPass; + if (itr2->second == DISENCHANT) + --roll->totalDisenchant; if (itr2->second != NOT_VALID) --roll->totalPlayersRolling; diff --git a/src/game/Group.h b/src/game/Group.h index 04110366b12..6b365a0dec0 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -37,8 +37,9 @@ enum RollVote PASS = 0, NEED = 1, GREED = 2, - NOT_EMITED_YET = 3, - NOT_VALID = 4 + DISENCHANT = 3, + NOT_EMITED_YET = 4, + NOT_VALID = 5 }; enum GroupMemberOnlineStatus @@ -54,10 +55,13 @@ enum GroupMemberOnlineStatus MEMBER_STATUS_UNK5 = 0x0080, // never seen }; -enum GroupType +enum GroupType // group type flags? { GROUPTYPE_NORMAL = 0, - GROUPTYPE_RAID = 1 + GROUPTYPE_BG = 1, + GROUPTYPE_RAID = 2, + GROUPTYPE_BGRAID = 3, + GROUPTYPE_LFD = 4 }; class BattleGround; @@ -100,7 +104,7 @@ class Roll : public LootValidatorRef public: Roll(uint64 _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count), - totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0) {} + totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalDisenchant(0), totalPass(0), itemSlot(0) {} ~Roll() { } void setLoot(Loot *pLoot) { link(pLoot, this); } Loot *getLoot() { return getTarget(); } @@ -116,6 +120,7 @@ class Roll : public LootValidatorRef uint8 totalPlayersRolling; uint8 totalNeed; uint8 totalGreed; + uint8 totalDisenchant; uint8 totalPass; uint8 itemSlot; }; diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index 74c9e04be8e..ddd92b8316c 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -461,7 +461,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode( WorldPacket & recv_data ) } else // target icon update { - if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) + if(group->isRaidGroup() && !group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) return; uint64 guid; diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index a325afee5a0..c0753663a65 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -427,9 +427,10 @@ void WorldSession::HandleLfgSetRoles(WorldPacket &recv_data) void WorldSession::SendLfgUpdate(uint8 unk1, uint8 unk2, uint8 unk3) { - WorldPacket data(SMSG_LFG_UPDATE, 3); + // disabled + /*WorldPacket data(SMSG_LFG_UPDATE, 3); data << uint8(unk1); data << uint8(unk2); data << uint8(unk3); - SendPacket(&data); + SendPacket(&data);*/ } diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h index 1381c120641..b8ce00e9a57 100644 --- a/src/game/LootMgr.h +++ b/src/game/LootMgr.h @@ -31,9 +31,12 @@ enum RollType ROLL_PASS = 0, ROLL_NEED = 1, ROLL_GREED = 2, - MAX_ROLL_TYPE = 3 + ROLL_DISENCHANT = 3, + MAX_ROLL_TYPE = 4 }; +#define ALL_ROLL_TYPE_MASK 0x0F + #define MAX_NR_LOOT_ITEMS 16 // note: the client cannot show more than 16 items total #define MAX_NR_QUEST_ITEMS 32 diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 7ee982172e1..14dc8be388c 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1567,3 +1567,11 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& recv_data) data << uint32(time(NULL)); SendPacket(&data); } + +void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& recv_data) +{ + // empty opcode + sLog.outDebug("WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); + + SendAccountDataTimes(GLOBAL_CACHE_MASK); +} diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 27f45cbc901..84e03703558 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -509,8 +509,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x1E0*/ { "CMSG_SETSHEATHED", STATUS_LOGGEDIN, &WorldSession::HandleSetSheathedOpcode }, /*0x1E1*/ { "SMSG_COOLDOWN_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x1E2*/ { "SMSG_SPELL_DELAYED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x1E3*/ { "CMSG_PLAYER_MACRO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x1E4*/ { "SMSG_PLAYER_MACRO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x1E3*/ { "CMSG_QUEST_POI_QUERY", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x1E4*/ { "SMSG_QUEST_POI_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x1E5*/ { "CMSG_GHOST", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x1E6*/ { "CMSG_GM_INVIS", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x1E7*/ { "SMSG_INVALID_PROMOTION_CODE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -535,7 +535,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x1FA*/ { "CMSG_GM_NUKE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x1FB*/ { "MSG_RANDOM_ROLL", STATUS_LOGGEDIN, &WorldSession::HandleRandomRollOpcode }, /*0x1FC*/ { "SMSG_ENVIRONMENTALDAMAGELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x1FD*/ { "CMSG_RWHOIS_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x1FD*/ { "CMSG_PLAYER_DIFFICULTY_CHANGE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x1FE*/ { "SMSG_RWHOIS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x1FF*/ { "MSG_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLookingForGroup }, /*0x200*/ { "CMSG_SET_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleSetLfgOpcode }, @@ -552,7 +552,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x20B*/ { "CMSG_UPDATE_ACCOUNT_DATA", STATUS_AUTHED, &WorldSession::HandleUpdateAccountData}, /*0x20C*/ { "SMSG_UPDATE_ACCOUNT_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x20D*/ { "SMSG_CLEAR_FAR_SIGHT_IMMEDIATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x20E*/ { "SMSG_POWERGAINLOG_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x20E*/ { "SMSG_PLAYER_DIFFICULTY_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x20F*/ { "CMSG_GM_TEACH", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x210*/ { "CMSG_GM_CREATE_ITEM_TARGET", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x211*/ { "CMSG_GMTICKET_GETTICKET", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketGetTicketOpcode }, @@ -892,7 +892,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x35F*/ { "CMSG_LFM_CLEAR_AUTOFILL", STATUS_LOGGEDIN, &WorldSession::HandleLfmClearAutoFillOpcode }, /*0x360*/ { "CMSG_ACCEPT_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x361*/ { "CMSG_DECLINE_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x362*/ { "CMSG_CANCEL_PENDING_LFG", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x362*/ { "CMSG_LFG_PROPOSAL_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x363*/ { "CMSG_CLEAR_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearOpcode }, /*0x364*/ { "CMSG_CLEAR_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleLfmClearOpcode }, /*0x365*/ { "CMSG_SET_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleSetLfmOpcode }, @@ -900,14 +900,14 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x367*/ { "SMSG_LFG_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x368*/ { "SMSG_LFG_OTHER_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x369*/ { "SMSG_LFG_AUTOJOIN_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x36A*/ { "SMSG_LFG_AUTOJOIN_FAILED_NO_PLAYER", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x36B*/ { "SMSG_LFG_LEADER_IS_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x36C*/ { "SMSG_LFG_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x36A*/ { "CMSG_LFG_SET_ROLES", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x36B*/ { "CMSG_LFG_SET_NEEDS", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x36C*/ { "CMSG_LFG_SET_BOOT_VOTE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x36D*/ { "SMSG_LFG_UPDATE_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x36E*/ { "SMSG_LFG_UPDATE_LFG", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x36F*/ { "SMSG_LFG_UPDATE_QUEUED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x370*/ { "SMSG_LFG_PENDING_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x371*/ { "SMSG_LFG_PENDING_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x36E*/ { "CMSG_LFD_PLAYER_LOCK_INFO_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x36F*/ { "SMSG_LFG_PLAYER_LOCK_INFO_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x370*/ { "CMSG_LFG_TELEPORT", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x371*/ { "CMSG_LFD_PARTY_LOCK_INFO_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x372*/ { "SMSG_LFG_PENDING_MATCH_DONE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x373*/ { "SMSG_TITLE_EARNED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x374*/ { "CMSG_SET_TITLE", STATUS_LOGGEDIN, &WorldSession::HandleSetTitleOpcode }, @@ -1267,8 +1267,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4D6*/ { "SMSG_EQUIPMENT_SET_USE_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4D7*/ { "UMSG_UNKNOWN_1239", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4D8*/ { "SMSG_UNKNOWN_1240", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4D9*/ { "CMSG_UNKNOWN_1241", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4DA*/ { "SMSG_UNKNOWN_1242", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4D9*/ { "CMSG_CHAR_FACTION_CHANGE", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4DA*/ { "SMSG_CHAR_FACTION_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4DB*/ { "UMSG_UNKNOWN_1243", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4DC*/ { "UMSG_UNKNOWN_1244", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4DD*/ { "UMSG_UNKNOWN_1245", STATUS_NEVER, &WorldSession::Handle_NULL }, @@ -1305,7 +1305,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4FC*/ { "SMSG_UNKNOWN_1276", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FD*/ { "SMSG_UNKNOWN_1277", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FE*/ { "UMSG_UNKNOWN_1278", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4FF*/ { "CMSG_READY_FOR_ACCOUNT_DATA_TIMES", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x500*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4FF*/ { "CMSG_READY_FOR_ACCOUNT_DATA_TIMES", STATUS_AUTHED, &WorldSession::HandleReadyForAccountDataTimes }, + /*0x500*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_LOGGEDIN, &WorldSession::HandleQueryQuestsCompleted }, /*0x501*/ { "SMSG_QUERY_QUESTS_COMPLETED_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x502*/ { "CMSG_GM_REPORT_LAG", STATUS_NEVER, &WorldSession::Handle_NULL }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 323d8b5cac0..c1f1ca8da2b 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -900,22 +900,22 @@ enum Opcodes CMSG_LFM_CLEAR_AUTOFILL = 0x35F, // CMSG SearchLFGLeave CMSG_ACCEPT_LFG_MATCH = 0x360, // SMSG uint32, uint32, if(uint8) { uint32 count, for(count) { uint64} }, uint32 count2, uint32, for(count2) { uint64, uint32 flags, if(flags & 0x2) {string}, if(flags & 0x10) {for(3) uint8}, if(flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for(count3) {uint64, uint32 flags, if(flags & 0x1) {uint8, uint8, uint8, for(3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if(flags&0x2) string, if(flags&0x4) uint8, if(flags&0x8) uint64, if(flags&0x10) uint8, if(flags&0x20) uint32, if(flags&0x40) uint8, if(flags& 0x80) {uint64, uint32}} CMSG_DECLINE_LFG_MATCH = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for(uint8) {uint32,uint8,uint8,uint8,uint8} - CMSG_CANCEL_PENDING_LFG = 0x362, // CMSG AcceptProposal, RejectProposal + CMSG_LFG_PROPOSAL_RESULT = 0x362, // CMSG AcceptProposal, RejectProposal CMSG_CLEAR_LOOKING_FOR_GROUP = 0x363, // SMSG uint32, uint8, for(uint8) uint32, uint8, for(uint8) { uint64, uint8, uint32, uint8, } CMSG_CLEAR_LOOKING_FOR_MORE = 0x364, // SMSG uint32 unk, uint32, if(unk==6) { uint8 count, for(count) uint64 } - CMSG_SET_LOOKING_FOR_MORE = 0x365, // SMSG uint32, uint32, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 + CMSG_SET_LOOKING_FOR_MORE = 0x365, // SMSG uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 CMSG_SET_LFG_COMMENT = 0x366, // CMSG SetLFGComment - SMSG_LFG_TIMEDOUT = 0x367, // SMSG uint8, if(uint8) { uint8, uint8, uint8, uint8, if(uint8) uint32, string} + SMSG_LFG_TIMEDOUT = 0x367, // SMSG uint8, if(uint8) { uint8, uint8, uint8, uint8, if(uint8) for(uint8) uint32, string} SMSG_LFG_OTHER_TIMEDOUT = 0x368, // SMSG uint8, if(uint8) { uint8, uint8, uint8, for(3) uint8, uint8, if(uint8) for(uint8) uint32, string} SMSG_LFG_AUTOJOIN_FAILED = 0x369, // SMSG uint8 - SMSG_LFG_AUTOJOIN_FAILED_NO_PLAYER = 0x36A, // CMSG SetLFGRoles - SMSG_LFG_LEADER_IS_LFM = 0x36B, // CMSG SetLFGNeeds - SMSG_LFG_UPDATE = 0x36C, // CMSG SetLFGBootVote + CMSG_LFG_SET_ROLES = 0x36A, // CMSG SetLFGRoles + CMSG_LFG_SET_NEEDS = 0x36B, // CMSG SetLFGNeeds + CMSG_LFG_SET_BOOT_VOTE = 0x36C, // CMSG SetLFGBootVote SMSG_LFG_UPDATE_LFM = 0x36D, // SMSG uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 - SMSG_LFG_UPDATE_LFG = 0x36E, // CMSG RequestLFDPlayerLockInfo - SMSG_LFG_UPDATE_QUEUED = 0x36F, // SMSG uint8, for(uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32, uint32}}, uint32, for(uint32) {uint32,uint32} - SMSG_LFG_PENDING_INVITE = 0x370, // CMSG LFGTeleport - SMSG_LFG_PENDING_MATCH = 0x371, // CMSG RequestLFDPartyLockInfo + CMSG_LFD_PLAYER_LOCK_INFO_REQUEST = 0x36E, // CMSG RequestLFDPlayerLockInfo + SMSG_LFG_PLAYER_LOCK_INFO_RESPONSE = 0x36F, // SMSG uint8, for(uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32, uint32}}, uint32, for(uint32) {uint32,uint32} + CMSG_LFG_TELEPORT = 0x370, // CMSG LFGTeleport + CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x371, // CMSG RequestLFDPartyLockInfo SMSG_LFG_PENDING_MATCH_DONE = 0x372, // SMSG uint8, for(uint8) uint64 SMSG_TITLE_EARNED = 0x373, CMSG_SET_TITLE = 0x374, @@ -1242,7 +1242,7 @@ enum Opcodes SMSG_UNKNOWN_1205 = 0x4B5, // refund something CMSG_CORPSE_MAP_POSITION_QUERY = 0x4B6, // CMSG, uint32 CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x4B7, // SMSG, 3*float+float - CMSG_LFG_SET_ROLES = 0x4B8, // CMSG, empty, lua: SetLFGRoles + CMSG_LFG_SET_ROLES_2 = 0x4B8, // CMSG, empty, lua: SetLFGRoles UMSG_UNKNOWN_1209 = 0x4B9, // not found CMSG_UNKNOWN_1210 = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp SMSG_UNKNOWN_1211 = 0x4BB, // SMSG, calendar related @@ -1316,7 +1316,8 @@ enum Opcodes CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x4FF, // lua: ReadyForAccountDataTimes CMSG_QUERY_QUESTS_COMPLETED = 0x500, // lua: QueryQuestsCompleted SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x501, // response to 0x4FF - NUM_MSG_TYPES = 0x502 + CMSG_GM_REPORT_LAG = 0x502, // lua: GMReportLag + NUM_MSG_TYPES = 0x503 }; /// Player state diff --git a/src/game/Player.h b/src/game/Player.h index ed4ee3b7695..d2ef251de72 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -322,7 +322,8 @@ enum LfgType LFG_TYPE_RAID = 2, LFG_TYPE_QUEST = 3, LFG_TYPE_ZONE = 4, - LFG_TYPE_HEROIC_DUNGEON = 5 + LFG_TYPE_HEROIC_DUNGEON = 5, + LFG_TYPE_RANDOM_DUNGEON = 6 }; enum LfgRoles diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 82ef1580d37..963490f3ce5 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -467,3 +467,22 @@ void WorldSession::HandleCorpseMapPositionQuery( WorldPacket & recv_data ) data << float(0); SendPacket(&data); } + +void WorldSession::HandleQueryQuestsCompleted( WorldPacket & recv_data ) +{ + uint32 count = 0; + + WorldPacket data(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, 4+4*count); + data << count; + + for(QuestStatusMap::const_iterator itr = _player->getQuestStatusMap().begin(); itr != _player->getQuestStatusMap().end(); ++itr) + { + if(itr->second.m_rewarded) + { + data << uint32(itr->first); + count++; + } + } + data.put(0, count); + SendPacket(&data); +} diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 526913c41ff..3422bb20f3c 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10596 +// Auto generated for version 0, 3, 0, 10676 enum EObjectFields { diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 413e19b3eb0..78886e3dcba 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -921,6 +921,7 @@ void WorldSession::SendAddonsInfo() string (16 bytes) string (16 bytes) uint32 + uint32 }*/ SendPacket(&data); diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index cf8ca9cb538..afd9a1e41df 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -732,6 +732,8 @@ class MANGOS_DLL_SPEC WorldSession void HandleEquipmentSetDelete(WorldPacket& recv_data); void HandleEquipmentSetUse(WorldPacket& recv_data); void HandleWorldStateUITimerUpdate(WorldPacket& recv_data); + void HandleReadyForAccountDataTimes(WorldPacket& recv_data); + void HandleQueryQuestsCompleted(WorldPacket& recv_data); private: // private trade methods void moveItems(Item* myItems[], Item* hisItems[]); diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 93a29ae6795..6d252ee44e2 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10623... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10676... -#define EXPECTED_MANGOS_CLIENT_BUILD {10623, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10676, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From c515c1d6e0c289d406d2699d59f86aba2bb485c0 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Mon, 26 Oct 2009 01:08:26 +0300 Subject: [PATCH 11/46] Added some comments. --- src/game/DBCStructure.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index abd03699d8a..372039021a3 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1488,20 +1488,13 @@ struct SpellShapeshiftEntry //uint32 NameFlags; // 18 unused uint32 flags1; // 19 int32 creatureType; // 20 <=0 humanoid, other normal creature types - //uint32 unk1; // 21 unused + //uint32 unk1; // 21 unused, related to next field uint32 attackSpeed; // 22 //uint32 modelID; // 23 unused, alliance modelid (where horde case?) - //uint32 unk2; // 24 unused - //uint32 unk3; // 25 unused - //uint32 unk4; // 26 unused - //uint32 unk5; // 27 unused - //uint32 unk6; // 28 unused - //uint32 unk7; // 29 unused - //uint32 unk8; // 30 unused - //uint32 unk9; // 31 unused - //uint32 unk10; // 32 unused - //uint32 unk11; // 33 unused - //uint32 unk12; // 34 unused + //uint32 unk2; // 24 unused, also modelid (single case) + //uint32 unk3; // 25 unused, all zeros + //uint32 unk4; // 26 unused, all zeros + //uint32 spellids[8]; // 27-34 unused }; struct SpellDurationEntry From eee42e2f5821775412d70f8ad0c5fb19d3f71126 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 28 Oct 2009 05:29:49 +0300 Subject: [PATCH 12/46] Updated to latest PTR build 10712. --- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 3422bb20f3c..b5b59a7d982 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10676 +// Auto generated for version 0, 3, 0, 10712 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 6d252ee44e2..1e181541183 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10676... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10712... -#define EXPECTED_MANGOS_CLIENT_BUILD {10676, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10712, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From a88aee18e86334de9168da9ca63b4244d6a421e6 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 4 Nov 2009 05:19:17 +0300 Subject: [PATCH 13/46] Updated to latest PTR build 10747. --- src/game/GossipDef.cpp | 1 + src/game/Opcodes.cpp | 3 +++ src/game/Opcodes.h | 7 +++++-- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 3d8791a4c75..9013b90f31f 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -652,6 +652,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) } data << uint32(pQuest->ReqCreatureOrGOCount[iI]); data << uint32(pQuest->ReqSourceId[iI]); + data << uint32(0); // req source count? } for (iI = 0; iI < QUEST_ITEM_OBJECTIVES_COUNT; ++iI) diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 84e03703558..8d97e679546 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1309,4 +1309,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x500*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_LOGGEDIN, &WorldSession::HandleQueryQuestsCompleted }, /*0x501*/ { "SMSG_QUERY_QUESTS_COMPLETED_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x502*/ { "CMSG_GM_REPORT_LAG", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x503*/ { "UMSG_UNKNOWN_1283", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x504*/ { "UMSG_UNKNOWN_1284", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x505*/ { "UMSG_UNKNOWN_1285", STATUS_NEVER, &WorldSession::Handle_NULL }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index c1f1ca8da2b..ffffa69d718 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1315,9 +1315,12 @@ enum Opcodes UMSG_UNKNOWN_1278 = 0x4FE, // not found 10596 CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x4FF, // lua: ReadyForAccountDataTimes CMSG_QUERY_QUESTS_COMPLETED = 0x500, // lua: QueryQuestsCompleted - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x501, // response to 0x4FF + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x501, // response to 0x500 CMSG_GM_REPORT_LAG = 0x502, // lua: GMReportLag - NUM_MSG_TYPES = 0x503 + UMSG_UNKNOWN_1283 = 0x503, + UMSG_UNKNOWN_1284 = 0x504, + UMSG_UNKNOWN_1285 = 0x505, + NUM_MSG_TYPES = 0x506 }; /// Player state diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index b5b59a7d982..aa2ba6dde30 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10712 +// Auto generated for version 0, 3, 0, 10747 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 1e181541183..07ad4a08be3 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10712... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10747... -#define EXPECTED_MANGOS_CLIENT_BUILD {10712, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10747, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 60e8e77e67e9a311a8cbd2522cce039d3ad84620 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Fri, 6 Nov 2009 11:24:45 +0300 Subject: [PATCH 14/46] Updated to latest client PTR build 10772. --- src/game/Mail.cpp | 2 +- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index 24463acf868..146d576689f 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -535,7 +535,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data ) uint8 item_count = (*itr)->items.size(); // max count is MAX_MAIL_ITEMS (12) - size_t next_mail_size = 2+4+1+8+4*8+((*itr)->subject.size()+1)+1+item_count*(1+4+4+6*3*4+4+4+1+4+4+4); + size_t next_mail_size = 2+4+1+((*itr)->messageType == MAIL_NORMAL ? 8 : 4)+4*8+((*itr)->subject.size()+1)+1+item_count*(1+4+4+7*3*4+4+4+4+4+4+4+1); if(data.wpos()+next_mail_size > maxPacketSize) { diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index aa2ba6dde30..27573bf888a 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10747 +// Auto generated for version 0, 3, 0, 10772 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 07ad4a08be3..5812918fea7 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10747... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10772... -#define EXPECTED_MANGOS_CLIENT_BUILD {10747, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10772, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 6ae24c1183aed3795dc0b729185497a4750388f1 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sun, 8 Nov 2009 22:06:53 +0300 Subject: [PATCH 15/46] Fixed scaling stats for new heirloom item added in patch 3.3. --- src/game/DBCStructure.h | 7 ++++--- src/game/DBCfmt.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 1a09aa1d484..4103aeeb23d 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1174,19 +1174,20 @@ struct ScalingStatValuesEntry uint32 dpsMod[6]; // 10-15 DPS mod for level uint32 spellBonus; // 16 spell power for level uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3] - //uint32 unk1; // 18 all fields equal to 0 - //uint32 unk2; // 19 unk, probably also Armor for level + uint32 ssdMultiplier3; // 18 3.3 + //uint32 unk2; // 19 unk, probably also Armor for level (flag 0x80000?) uint32 armorMod2[4]; // 20-23 Armor for level uint32 getssdMultiplier(uint32 mask) const { - if (mask & 0x001F) + if (mask & 0x4001F) { if(mask & 0x00000001) return ssdMultiplier[0]; if(mask & 0x00000002) return ssdMultiplier[1]; if(mask & 0x00000004) return ssdMultiplier[2]; if(mask & 0x00000008) return ssdMultiplier2; if(mask & 0x00000010) return ssdMultiplier[3]; + if(mask & 0x00040000) return ssdMultiplier3; } return 0; } diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 8da251572f7..c3e71f67610 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -78,7 +78,7 @@ const char MovieEntryfmt[]="nxx"; const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx"; const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii"; -const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiixxiiii"; +const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiixiiii"; const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; From b54e5e328bd9d16e254fa4f6f60b3420e3c9e700 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Tue, 10 Nov 2009 17:34:53 +0300 Subject: [PATCH 16/46] Removed empty line. --- src/game/Player.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index a7fe5ea17fe..7a1571b2abe 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2358,7 +2358,6 @@ void Player::GiveXP(uint32 xp, Unit* victim) xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f)); } - // XP resting bonus for kill uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0; From 5c323c5b0412e397ada14646611e81cb02482f21 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 12 Nov 2009 16:40:37 +0300 Subject: [PATCH 17/46] - Compile fix and update to latest PTR build 10805. --- src/game/Group.cpp | 4 ++-- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/Group.cpp b/src/game/Group.cpp index ba3913ecf94..d1697be0ea9 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -900,7 +900,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) } } SendLootRollWon(0, maxguid, maxresul, ROLL_DISENCHANT, *roll); - player = objmgr.GetPlayer(maxguid); + player = sObjectMgr.GetPlayer(maxguid); if(player && player->GetSession()) { @@ -909,7 +909,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) roll->getLoot()->NotifyItemRemoved(roll->itemSlot); --roll->getLoot()->unlootedCount; - ItemPrototype const *pProto = objmgr.GetItemPrototype(roll->itemid); + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(roll->itemid); player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); } } diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 27573bf888a..f326e18a2ba 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10772 +// Auto generated for version 0, 3, 0, 10805 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 5812918fea7..36be06e4724 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10772... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10805... -#define EXPECTED_MANGOS_CLIENT_BUILD {10772, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10805, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From f754a1bd2d12eac97b2c45c87e942c3a291c464e Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 14 Nov 2009 16:22:41 +0300 Subject: [PATCH 18/46] - Some updates. --- sql/330/1_account_data.sql | 2 + src/game/DBCEnums.h | 6 ++- src/game/Group.cpp | 80 ++++++++++++++------------------------ src/game/Group.h | 3 +- src/game/Opcodes.cpp | 24 ++++++------ src/game/Opcodes.h | 18 ++++----- src/game/QueryHandler.cpp | 9 +++++ src/game/WorldSession.h | 1 + 8 files changed, 68 insertions(+), 75 deletions(-) create mode 100644 sql/330/1_account_data.sql diff --git a/sql/330/1_account_data.sql b/sql/330/1_account_data.sql new file mode 100644 index 00000000000..d13feab7359 --- /dev/null +++ b/sql/330/1_account_data.sql @@ -0,0 +1,2 @@ +ALTER table account_data change `data` `data` longblob NOT NULL; +ALTER table character_account_data change `data` `data` longblob NOT NULL; diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index dcb16bff803..8f1d74d0b32 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -196,8 +196,10 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112, ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, - // 0..115 => 116 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 116, + ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, + ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, + // 0..119 => 120 criteria types total + ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 120, }; enum AreaFlags diff --git a/src/game/Group.cpp b/src/game/Group.cpp index d1697be0ea9..fce5a247828 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -754,12 +754,12 @@ void Group::CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 N case ROLL_DISENCHANT: // player choose Disenchant { SendLootRoll(0, playerGUID, 128, ROLL_DISENCHANT, *roll); - ++roll->totalDisenchant; + ++roll->totalGreed; itr->second = DISENCHANT; } break; } - if (roll->totalPass + roll->totalNeed + roll->totalGreed + roll->totalDisenchant >= roll->totalPlayersRolling) + if (roll->totalPass + roll->totalNeed + roll->totalGreed >= roll->totalPlayersRolling) { CountTheRoll(rollI, NumberOfPlayers); } @@ -840,78 +840,60 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) uint8 maxresul = 0; uint64 maxguid = (*roll->playerVote.begin()).first; Player *player; + RollVote rollvote; Roll::PlayerVote::iterator itr; for (itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) { - if (itr->second != GREED) + if (itr->second != GREED && itr->second != DISENCHANT) continue; uint8 randomN = urand(1, 99); - SendLootRoll(0, itr->first, randomN, ROLL_GREED, *roll); + SendLootRoll(0, itr->first, randomN, itr->second, *roll); if (maxresul < randomN) { maxguid = itr->first; maxresul = randomN; + rollvote = itr->second; } } - SendLootRollWon(0, maxguid, maxresul, ROLL_GREED, *roll); + SendLootRollWon(0, maxguid, maxresul, rollvote, *roll); player = sObjectMgr.GetPlayer(maxguid); if(player && player->GetSession()) { player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul); - ItemPosCountVec dest; LootItem *item = &(roll->getLoot()->items[roll->itemSlot]); - uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count ); - if ( msg == EQUIP_ERR_OK ) + + if(rollvote == GREED) + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count ); + if ( msg == EQUIP_ERR_OK ) + { + item->is_looted = true; + roll->getLoot()->NotifyItemRemoved(roll->itemSlot); + --roll->getLoot()->unlootedCount; + player->StoreNewItem( dest, roll->itemid, true, item->randomPropertyId); + } + else + { + item->is_blocked = false; + player->SendEquipError( msg, NULL, NULL ); + } + } + else if(rollvote == DISENCHANT) { item->is_looted = true; roll->getLoot()->NotifyItemRemoved(roll->itemSlot); --roll->getLoot()->unlootedCount; - player->StoreNewItem( dest, roll->itemid, true, item->randomPropertyId); - } - else - { - item->is_blocked = false; - player->SendEquipError( msg, NULL, NULL ); - } - } - } - } - else if(roll->totalDisenchant > 0) - { - uint8 maxresul = 0; - uint64 maxguid = (*roll->playerVote.begin()).first; - Player *player; - - for( Roll::PlayerVote::const_iterator itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) - { - if (itr->second != DISENCHANT) - continue; - uint8 randomN = urand(1, 99); - SendLootRoll(0, itr->first, randomN, ROLL_DISENCHANT, *roll); - if (maxresul < randomN) - { - maxguid = itr->first; - maxresul = randomN; + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(roll->itemid); + player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); + } } } - SendLootRollWon(0, maxguid, maxresul, ROLL_DISENCHANT, *roll); - player = sObjectMgr.GetPlayer(maxguid); - - if(player && player->GetSession()) - { - LootItem *item = &(roll->getLoot()->items[roll->itemSlot]); - item->is_looted = true; - roll->getLoot()->NotifyItemRemoved(roll->itemSlot); - --roll->getLoot()->unlootedCount; - - ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(roll->itemid); - player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); - } } else { @@ -1273,14 +1255,12 @@ void Group::_removeRolls(const uint64 &guid) if(itr2 == roll->playerVote.end()) continue; - if (itr2->second == GREED) + if (itr2->second == GREED || itr2->second == DISENCHANT) --roll->totalGreed; if (itr2->second == NEED) --roll->totalNeed; if (itr2->second == PASS) --roll->totalPass; - if (itr2->second == DISENCHANT) - --roll->totalDisenchant; if (itr2->second != NOT_VALID) --roll->totalPlayersRolling; diff --git a/src/game/Group.h b/src/game/Group.h index 6b365a0dec0..2d59de81379 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -104,7 +104,7 @@ class Roll : public LootValidatorRef public: Roll(uint64 _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count), - totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalDisenchant(0), totalPass(0), itemSlot(0) {} + totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0) {} ~Roll() { } void setLoot(Loot *pLoot) { link(pLoot, this); } Loot *getLoot() { return getTarget(); } @@ -120,7 +120,6 @@ class Roll : public LootValidatorRef uint8 totalPlayersRolling; uint8 totalNeed; uint8 totalGreed; - uint8 totalDisenchant; uint8 totalPass; uint8 itemSlot; }; diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 855f1845cec..a905d7bca36 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -509,7 +509,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x1E0*/ { "CMSG_SETSHEATHED", STATUS_LOGGEDIN, &WorldSession::HandleSetSheathedOpcode }, /*0x1E1*/ { "SMSG_COOLDOWN_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x1E2*/ { "SMSG_SPELL_DELAYED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x1E3*/ { "CMSG_QUEST_POI_QUERY", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x1E3*/ { "CMSG_QUEST_POI_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleQuestPOIQuery }, /*0x1E4*/ { "SMSG_QUEST_POI_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x1E5*/ { "CMSG_GHOST", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x1E6*/ { "CMSG_GM_INVIS", STATUS_NEVER, &WorldSession::Handle_NULL }, @@ -886,16 +886,16 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x359*/ { "MSG_MOVE_START_ASCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes }, /*0x35A*/ { "MSG_MOVE_STOP_ASCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes }, /*0x35B*/ { "SMSG_ARENA_TEAM_STATS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x35C*/ { "CMSG_LFG_SET_AUTOJOIN", STATUS_AUTHED, &WorldSession::HandleLfgSetAutoJoinOpcode }, - /*0x35D*/ { "CMSG_LFG_CLEAR_AUTOJOIN", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearAutoJoinOpcode }, - /*0x35E*/ { "CMSG_LFM_SET_AUTOFILL", STATUS_AUTHED, &WorldSession::HandleLfmSetAutoFillOpcode }, - /*0x35F*/ { "CMSG_LFM_CLEAR_AUTOFILL", STATUS_LOGGEDIN, &WorldSession::HandleLfmClearAutoFillOpcode }, - /*0x360*/ { "CMSG_ACCEPT_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x361*/ { "CMSG_DECLINE_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x362*/ { "CMSG_LFG_PROPOSAL_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x363*/ { "CMSG_CLEAR_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearOpcode }, - /*0x364*/ { "CMSG_CLEAR_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleLfmClearOpcode }, - /*0x365*/ { "CMSG_SET_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleSetLfmOpcode }, + /*0x35C*/ { "CMSG_LFG_JOIN", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetAutoJoinOpcode }, + /*0x35D*/ { "CMSG_LFG_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearAutoJoinOpcode }, + /*0x35E*/ { "CMSG_SEARCH_LFG_JOIN", STATUS_LOGGEDIN, &WorldSession::HandleLfmSetAutoFillOpcode }, + /*0x35F*/ { "CMSG_SEARCH_LFG_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleLfmClearAutoFillOpcode }, + /*0x360*/ { "SMSG_ACCEPT_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x361*/ { "SMSG_DECLINE_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x362*/ { "CMSG_LFG_PROPOSAL_RESULT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL }, + /*0x363*/ { "SMSG_CLEAR_LOOKING_FOR_GROUP", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x364*/ { "SMSG_CLEAR_LOOKING_FOR_MORE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x365*/ { "SMSG_SET_LOOKING_FOR_MORE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x366*/ { "CMSG_SET_LFG_COMMENT", STATUS_LOGGEDIN, &WorldSession::HandleSetLfgCommentOpcode }, /*0x367*/ { "SMSG_LFG_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x368*/ { "SMSG_LFG_OTHER_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -1234,7 +1234,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4B5*/ { "SMSG_UNKNOWN_1205", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4B6*/ { "CMSG_CORPSE_MAP_POSITION_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCorpseMapPositionQuery }, /*0x4B7*/ { "CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4B8*/ { "CMSG_LFG_SET_ROLES", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetRoles }, + /*0x4B8*/ { "CMSG_LFG_SET_ROLES_2", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetRoles }, /*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 }, diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 88102af493e..290baf8dda0 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -894,16 +894,16 @@ enum Opcodes MSG_MOVE_START_ASCEND = 0x359, MSG_MOVE_STOP_ASCEND = 0x35A, SMSG_ARENA_TEAM_STATS = 0x35B, - CMSG_LFG_SET_AUTOJOIN = 0x35C, // CMSG JoinLFG - CMSG_LFG_CLEAR_AUTOJOIN = 0x35D, // CMSG LeaveLFG - CMSG_LFM_SET_AUTOFILL = 0x35E, // CMSG SearchLFGJoin - CMSG_LFM_CLEAR_AUTOFILL = 0x35F, // CMSG SearchLFGLeave - CMSG_ACCEPT_LFG_MATCH = 0x360, // SMSG uint32, uint32, if(uint8) { uint32 count, for(count) { uint64} }, uint32 count2, uint32, for(count2) { uint64, uint32 flags, if(flags & 0x2) {string}, if(flags & 0x10) {for(3) uint8}, if(flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for(count3) {uint64, uint32 flags, if(flags & 0x1) {uint8, uint8, uint8, for(3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if(flags&0x2) string, if(flags&0x4) uint8, if(flags&0x8) uint64, if(flags&0x10) uint8, if(flags&0x20) uint32, if(flags&0x40) uint8, if(flags& 0x80) {uint64, uint32}} - CMSG_DECLINE_LFG_MATCH = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for(uint8) {uint32,uint8,uint8,uint8,uint8} + CMSG_LFG_JOIN = 0x35C, // CMSG JoinLFG + CMSG_LFG_LEAVE = 0x35D, // CMSG LeaveLFG + CMSG_SEARCH_LFG_JOIN = 0x35E, // CMSG SearchLFGJoin + CMSG_SEARCH_LFG_LEAVE = 0x35F, // CMSG SearchLFGLeave + SMSG_ACCEPT_LFG_MATCH = 0x360, // SMSG uint32, uint32, if(uint8) { uint32 count, for(count) { uint64} }, uint32 count2, uint32, for(count2) { uint64, uint32 flags, if(flags & 0x2) {string}, if(flags & 0x10) {for(3) uint8}, if(flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for(count3) {uint64, uint32 flags, if(flags & 0x1) {uint8, uint8, uint8, for(3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if(flags&0x2) string, if(flags&0x4) uint8, if(flags&0x8) uint64, if(flags&0x10) uint8, if(flags&0x20) uint32, if(flags&0x40) uint8, if(flags& 0x80) {uint64, uint32}} + SMSG_DECLINE_LFG_MATCH = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for(uint8) {uint32,uint8,uint8,uint8,uint8} CMSG_LFG_PROPOSAL_RESULT = 0x362, // CMSG AcceptProposal, RejectProposal - CMSG_CLEAR_LOOKING_FOR_GROUP = 0x363, // SMSG uint32, uint8, for(uint8) uint32, uint8, for(uint8) { uint64, uint8, uint32, uint8, } - CMSG_CLEAR_LOOKING_FOR_MORE = 0x364, // SMSG uint32 unk, uint32, if(unk==6) { uint8 count, for(count) uint64 } - CMSG_SET_LOOKING_FOR_MORE = 0x365, // SMSG uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 + SMSG_CLEAR_LOOKING_FOR_GROUP = 0x363, // SMSG uint32, uint8, for(uint8) uint32, uint8, for(uint8) { uint64, uint8, uint32, uint8, } + SMSG_CLEAR_LOOKING_FOR_MORE = 0x364, // SMSG uint32 unk, uint32, if(unk==6) { uint8 count, for(count) uint64 } + SMSG_SET_LOOKING_FOR_MORE = 0x365, // SMSG uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 CMSG_SET_LFG_COMMENT = 0x366, // CMSG SetLFGComment SMSG_LFG_TIMEDOUT = 0x367, // SMSG uint8, if(uint8) { uint8, uint8, uint8, uint8, if(uint8) for(uint8) uint32, string} SMSG_LFG_OTHER_TIMEDOUT = 0x368, // SMSG uint8, if(uint8) { uint8, uint8, uint8, for(3) uint8, uint8, if(uint8) for(uint8) uint32, string} diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 16b71f512d5..5241f8f7371 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -486,3 +486,12 @@ void WorldSession::HandleQueryQuestsCompleted( WorldPacket & recv_data ) data.put(0, count); SendPacket(&data); } + +void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) +{ + recv_data.read_skip(); + + WorldPacket data(SMSG_QUEST_POI_QUERY_RESPONSE, 4); + data << uint32(0); // count + SendPacket(&data); +} diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index f26fb3bea32..185b4afde65 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -728,6 +728,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleWorldStateUITimerUpdate(WorldPacket& recv_data); void HandleReadyForAccountDataTimes(WorldPacket& recv_data); void HandleQueryQuestsCompleted(WorldPacket& recv_data); + void HandleQuestPOIQuery(WorldPacket& recv_data); private: // private trade methods void moveItems(Item* myItems[], Item* hisItems[]); From 0d5147636273d76a05c73e553fa96f56a72d022a Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 14 Nov 2009 19:56:01 +0300 Subject: [PATCH 19/46] - Implemented quest POI's. May be not perfect, but it works :P --- sql/330/2_quest_poi.sql | 43 ++++++++++++++++++++++++++ src/game/ObjectMgr.cpp | 59 ++++++++++++++++++++++++++++++++++++ src/game/ObjectMgr.h | 34 +++++++++++++++++++++ src/game/QueryHandler.cpp | 63 +++++++++++++++++++++++++++++++++++++-- src/game/World.cpp | 3 ++ 5 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 sql/330/2_quest_poi.sql diff --git a/sql/330/2_quest_poi.sql b/sql/330/2_quest_poi.sql new file mode 100644 index 00000000000..03e3360eb52 --- /dev/null +++ b/sql/330/2_quest_poi.sql @@ -0,0 +1,43 @@ +DROP TABLE IF EXIST `quest_poi`; +CREATE TABLE `quest_poi` ( + `questid` int(11) unsigned NOT NULL DEFAULT '0', + `objIndex` int(11) NOT NULL DEFAULT '0', + `mapId` int(11) unsigned NOT NULL DEFAULT '0', + `unk1` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`questid`,`objIndex`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +DROP TABLE IF EXIST `quest_poi_points`; +CREATE TABLE `quest_poi_points` ( + `questId` int(11) unsigned NOT NULL DEFAULT '0', + `objIndex` int(11) NOT NULL DEFAULT '0', + `x` int(11) NOT NULL DEFAULT '0', + `y` int(11) NOT NULL DEFAULT '0', + KEY `idx` (`questId`,`objIndex`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- Sample data for quest 456 +INSERT INTO quest_poi VALUES (456, 0, 1, 0); +INSERT INTO quest_poi VALUES (456, 1, 1, 0); +INSERT INTO quest_poi VALUES (456, -1, 1, 0); + +INSERT INTO quest_poi_points VALUES (456, 0, 0x28CF, 0x0217); +INSERT INTO quest_poi_points VALUES (456, 0, 0x29F4, 0x02AA); +INSERT INTO quest_poi_points VALUES (456, 0, 0x2841, 0x0398); +INSERT INTO quest_poi_points VALUES (456, 0, 0x2806, 0x034C); +INSERT INTO quest_poi_points VALUES (456, 0, 0x281B, 0x02DE); +INSERT INTO quest_poi_points VALUES (456, 0, 0x283C, 0x029B); +INSERT INTO quest_poi_points VALUES (456, 0, 0x284C, 0x028A); +INSERT INTO quest_poi_points VALUES (456, 0, 0x28B0, 0x0228); + +INSERT INTO quest_poi_points VALUES (456, 1, 0x28A0, 0x0258); +INSERT INTO quest_poi_points VALUES (456, 1, 0x290E, 0x0366); +INSERT INTO quest_poi_points VALUES (456, 1, 0x28CA, 0x03BC); +INSERT INTO quest_poi_points VALUES (456, 1, 0x288F, 0x03F6); +INSERT INTO quest_poi_points VALUES (456, 1, 0x284D, 0x03B8); +INSERT INTO quest_poi_points VALUES (456, 1, 0x2828, 0x0395); +INSERT INTO quest_poi_points VALUES (456, 1, 0x2806, 0x034C); +INSERT INTO quest_poi_points VALUES (456, 1, 0x281B, 0x02DE); +INSERT INTO quest_poi_points VALUES (456, 1, 0x284C, 0x028A); + +INSERT INTO quest_poi_points VALUES (456, -1, 0x2859, 0x033A); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 11b577fdd94..1a6b7809f49 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -6380,6 +6380,65 @@ void ObjectMgr::LoadPointsOfInterest() sLog.outString(">> Loaded %u Points of Interest definitions", count); } +void ObjectMgr::LoadQuestPOI() +{ + uint32 count = 0; + + // 0 1 2 3 + QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1 FROM quest_poi"); + + if(!result) + { + barGoLink bar(1); + + bar.step(); + + sLog.outString(); + sLog.outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); + return; + } + + barGoLink bar(result->GetRowCount()); + + do + { + Field *fields = result->Fetch(); + bar.step(); + + uint32 questId = fields[0].GetUInt32(); + int32 objIndex = fields[1].GetInt32(); + uint32 mapId = fields[2].GetUInt32(); + uint32 unk1 = fields[3].GetUInt32(); + + QuestPOI POI(objIndex, mapId, unk1); + + QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND objIndex='%i'", questId, objIndex); + + if(points) + { + do + { + Field *pointFields = points->Fetch(); + int32 x = pointFields[0].GetInt32(); + int32 y = pointFields[1].GetInt32(); + QuestPOIPoint point(x, y); + POI.points.push_back(point); + } while (points->NextRow()); + + delete points; + } + + mQuestPOIMap[questId].push_back(POI); + + ++count; + } while (result->NextRow()); + + delete result; + + sLog.outString(); + sLog.outString(">> Loaded %u quest POI definitions", count); +} + void ObjectMgr::LoadNPCSpellClickSpells() { uint32 count = 0; diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index e4c90aadbcf..6946b25939d 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -216,6 +216,29 @@ struct PointOfInterest std::string icon_name; }; +struct QuestPOIPoint +{ + int32 x; + int32 y; + + QuestPOIPoint() : x(0), y(0) {} + QuestPOIPoint(int32 _x, int32 _y) : x(_x), y(_y) {} +}; + +struct QuestPOI +{ + int32 ObjectiveIndex; + uint32 MapId; + uint32 Unk1; + std::vector points; + + QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0) {} + QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1) {} +}; + +typedef std::vector QuestPOIVector; +typedef UNORDERED_MAP QuestPOIMap; + #define WEATHER_SEASONS 4 struct WeatherSeasonChances { @@ -479,6 +502,14 @@ class ObjectMgr return NULL; } + QuestPOIVector const* GetQuestPOIVector(uint32 questId) + { + QuestPOIMap::const_iterator itr = mQuestPOIMap.find(questId); + if(itr != mQuestPOIMap.end()) + return &itr->second; + return NULL; + } + void LoadGuilds(); void LoadArenaTeams(); void LoadGroups(); @@ -551,6 +582,7 @@ class ObjectMgr void LoadReputationOnKill(); void LoadPointsOfInterest(); + void LoadQuestPOI(); void LoadNPCSpellClickSpells(); @@ -843,6 +875,8 @@ class ObjectMgr PointOfInterestMap mPointsOfInterest; + QuestPOIMap mQuestPOIMap; + WeatherZoneMap mWeatherZoneMap; //character reserved names diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 5241f8f7371..1d425a34148 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -489,9 +489,66 @@ void WorldSession::HandleQueryQuestsCompleted( WorldPacket & recv_data ) void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) { - recv_data.read_skip(); + uint32 count; + recv_data >> count; // quest count, max=25 - WorldPacket data(SMSG_QUEST_POI_QUERY_RESPONSE, 4); - data << uint32(0); // count + if(count >= MAX_QUEST_LOG_SIZE) + return; + + WorldPacket data(SMSG_QUEST_POI_QUERY_RESPONSE, 4+(4+4)*count); + data << uint32(count); // count + + for(int i = 0; i < count; ++i) + { + uint32 questId; + recv_data >> questId; // quest id + + bool questOk = false; + + uint16 questSlot = _player->FindQuestSlot(questId); + + if(questSlot != MAX_QUEST_LOG_SIZE) + questOk =_player->GetQuestSlotQuestId(questSlot) == questId; + + if(questOk) + { + QuestPOIVector const *POI = sObjectMgr.GetQuestPOIVector(questId); + + if(POI) + { + data << uint32(questId); // quest ID + data << uint32(POI->size()); // POI count + + int index = 0; + for(QuestPOIVector::const_iterator itr = POI->begin(); itr != POI->end(); ++itr) + { + data << uint32(index); // POI index + data << int32(itr->ObjectiveIndex); // objective index + data << uint32(itr->MapId); // mapid + data << uint32(itr->Unk1); // unknown + data << uint32(itr->points.size()); // POI points count + + for(std::vector::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2) + { + data << int32(itr2->x); // POI point x + data << int32(itr2->y); // POI point y + } + ++index; + } + } + else + { + data << uint32(questId); // quest ID + data << uint32(0); // POI count + } + } + else + { + data << uint32(questId); // quest ID + data << uint32(0); // POI count + } + } + + data.hexlike(); SendPacket(&data); } diff --git a/src/game/World.cpp b/src/game/World.cpp index 4491e4cf54f..b931196d726 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1284,6 +1284,9 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading Quests..." ); sObjectMgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables + sLog.outString( "Loading Quest POI" ); + sObjectMgr.LoadQuestPOI(); + sLog.outString( "Loading Quests Relations..." ); sLog.outString(); sObjectMgr.LoadQuestRelations(); // must be after quest load From 227c42a59ffadf3fca9e0bc20f61fe8ddfa827c6 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Mon, 16 Nov 2009 02:01:09 +0300 Subject: [PATCH 20/46] - Fixed SMSG_GROUP_LIST opcode once again (I hope so). - Fixed typos in SQL update. - Added some nice comments. --- sql/330/2_quest_poi.sql | 4 ++-- src/game/Group.cpp | 46 ++++++++++++++++++++++++----------------- src/game/Group.h | 12 ++++++----- src/game/Player.cpp | 2 +- 4 files changed, 37 insertions(+), 27 deletions(-) diff --git a/sql/330/2_quest_poi.sql b/sql/330/2_quest_poi.sql index 03e3360eb52..b3b8dd2b067 100644 --- a/sql/330/2_quest_poi.sql +++ b/sql/330/2_quest_poi.sql @@ -1,4 +1,4 @@ -DROP TABLE IF EXIST `quest_poi`; +DROP TABLE IF EXISTS `quest_poi`; CREATE TABLE `quest_poi` ( `questid` int(11) unsigned NOT NULL DEFAULT '0', `objIndex` int(11) NOT NULL DEFAULT '0', @@ -7,7 +7,7 @@ CREATE TABLE `quest_poi` ( PRIMARY KEY (`questid`,`objIndex`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -DROP TABLE IF EXIST `quest_poi_points`; +DROP TABLE IF EXISTS `quest_poi_points`; CREATE TABLE `quest_poi_points` ( `questId` int(11) unsigned NOT NULL DEFAULT '0', `objIndex` int(11) NOT NULL DEFAULT '0', diff --git a/src/game/Group.cpp b/src/game/Group.cpp index fce5a247828..f5a0094c25d 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -364,8 +364,9 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method) } else { - data.Initialize(SMSG_GROUP_LIST, 24); - data << uint64(0) << uint64(0) << uint64(0); + data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8); + data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0); + data << uint64(0) << uint32(0) << uint32(0) << uint64(0); player->GetSession()->SendPacket(&data); } @@ -447,8 +448,9 @@ void Group::Disband(bool hideDestroy) } else { - data.Initialize(SMSG_GROUP_LIST, 24); - data << uint64(0) << uint64(0) << uint64(0); + data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8); + data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0); + data << uint64(0) << uint32(0) << uint32(0) << uint64(0); player->GetSession()->SendPacket(&data); } @@ -979,11 +981,17 @@ void Group::SendUpdate() continue; // guess size WorldPacket data(SMSG_GROUP_LIST, (1+1+1+1+8+4+GetMembersCount()*20)); - data << (uint8)m_groupType; // group type - data << (uint8)(isBGGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup? - data << (uint8)(citr->group); // groupid - data << (uint8)(citr->assistant?0x01:0); // 0x2 main assist, 0x4 main tank + data << uint8(m_groupType); // group type (flags in 3.3) + data << uint8(isBGGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup? + data << uint8(citr->group); // groupid + data << uint8(citr->assistant ? 0x01 : 0x00); // 0x2 main assist, 0x4 main tank + if(m_groupType & GROUPTYPE_LFD) + { + data << uint8(0); + data << uint32(0); + } data << uint64(0x50000000FFFFFFFELL); // related to voice chat? + data << uint32(0); // 3.3, may be some kind of time data << uint32(GetMembersCount()-1); for(member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2) { @@ -994,23 +1002,23 @@ void Group::SendUpdate() onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0); data << citr2->name; - data << (uint64)citr2->guid; + data << uint64(citr2->guid); // online-state - data << (uint8)(onlineState); - data << (uint8)(citr2->group); // groupid - data << (uint8)(citr2->assistant?0x01:0); // 0x2 main assist, 0x4 main tank - data << uint8(0); // 3.3 + data << uint8(onlineState); + data << uint8(citr2->group); // groupid + data << uint8(citr2->assistant?0x01:0); // 0x2 main assist, 0x4 main tank + data << uint8(0); // 3.3, role? } data << uint64(m_leaderGuid); // leader guid if(GetMembersCount()-1) { - data << (uint8)m_lootMethod; // loot method - data << (uint64)m_looterGuid; // looter guid - data << (uint8)m_lootThreshold; // loot threshold - data << (uint8)m_dungeonDifficulty; // Dungeon Difficulty - data << (uint8)m_raidDifficulty; // Raid Difficulty - data << uint8(0); // 3.3 + data << uint8(m_lootMethod); // loot method + data << uint64(m_looterGuid); // looter guid + data << uint8(m_lootThreshold); // loot threshold + data << uint8(m_dungeonDifficulty); // Dungeon Difficulty + data << uint8(m_raidDifficulty); // Raid Difficulty + data << uint8(0); // 3.3, dynamic difficulty? } player->GetSession()->SendPacket( &data ); } diff --git a/src/game/Group.h b/src/game/Group.h index 2d59de81379..b66ddbbcc25 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -57,11 +57,13 @@ enum GroupMemberOnlineStatus enum GroupType // group type flags? { - GROUPTYPE_NORMAL = 0, - GROUPTYPE_BG = 1, - GROUPTYPE_RAID = 2, - GROUPTYPE_BGRAID = 3, - GROUPTYPE_LFD = 4 + GROUPTYPE_NORMAL = 0x00, + GROUPTYPE_BG = 0x01, + GROUPTYPE_RAID = 0x02, + GROUPTYPE_BGRAID = GROUPTYPE_BG | GROUPTYPE_RAID, // mask + // 0x04? + GROUPTYPE_LFD = 0x08, + // 0x10, leave/change group?, I saw this flag when leaving group and after leaving BG while in group }; class BattleGround; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e84392e18cf..b9405a11d57 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20743,4 +20743,4 @@ void Player::SendDuelCountdown(uint32 counter) WorldPacket data(SMSG_DUEL_COUNTDOWN, 4); data << uint32(counter); // seconds GetSession()->SendPacket(&data); -} \ No newline at end of file +} From daa707e83a9112cc892e3642129ea85ae6736ef8 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 18 Nov 2009 03:50:19 +0300 Subject: [PATCH 21/46] - Updated to latest PTR build 10835. --- src/game/Group.cpp | 2 +- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/Group.cpp b/src/game/Group.cpp index f5a0094c25d..07c5036882c 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -991,7 +991,7 @@ void Group::SendUpdate() data << uint32(0); } data << uint64(0x50000000FFFFFFFELL); // related to voice chat? - data << uint32(0); // 3.3, may be some kind of time + data << uint32(0); // 3.3, this value increments every time SMSG_GROUP_LIST is sent data << uint32(GetMembersCount()-1); for(member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2) { diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index f326e18a2ba..a90047f836d 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10805 +// Auto generated for version 0, 3, 0, 10835 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 36be06e4724..a18bcf88e28 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10805... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10835... -#define EXPECTED_MANGOS_CLIENT_BUILD {10805, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10835, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 82d23aa3d9ffb341e90698c863dae919cbd10e9b Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Mon, 30 Nov 2009 01:29:45 +0300 Subject: [PATCH 22/46] Updated to latest PTR build. --- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index a90047f836d..e3146cfc5b2 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10835 +// Auto generated for version 0, 3, 0, 10894 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index a18bcf88e28..1f97ab6ce5d 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10835... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10894... -#define EXPECTED_MANGOS_CLIENT_BUILD {10835, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10894, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 60fab2cc73265c3d6fd346c41a13ea31cf14df9c Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 2 Dec 2009 13:26:13 +0300 Subject: [PATCH 23/46] - Updated to latest PTR build 10952. - Fixed SMSG_BATTLEFIELD_LIST packet. --- src/game/BattleGroundMgr.cpp | 6 ++++-- src/game/QueryHandler.cpp | 2 +- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index d7ec7365707..912b858df19 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1883,15 +1883,17 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint6 if(bgTypeId == BATTLEGROUND_AA) // arena { *data << uint8(4); // unk + *data << uint8(0); // unk *data << uint32(0); // unk (count?) } else // battleground { - *data << uint8(0x00); // unk, different for each bg type + *data << uint8(0); // unk, different for each bg type + *data << uint8(0); // unk size_t count_pos = data->wpos(); uint32 count = 0; - *data << uint32(0x00); // number of bg instances + *data << uint32(0); // number of bg instances uint32 queue_id = plr->GetBattleGroundQueueIdFromLevel(); for(std::set::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end();++itr) diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 126d62c9c14..a1e063b0f54 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -474,7 +474,7 @@ void WorldSession::HandleQueryQuestsCompleted( WorldPacket & recv_data ) uint32 count = 0; WorldPacket data(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, 4+4*count); - data << count; + data << uint32(count); for(QuestStatusMap::const_iterator itr = _player->getQuestStatusMap().begin(); itr != _player->getQuestStatusMap().end(); ++itr) { diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index e3146cfc5b2..6cac80128ef 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10894 +// Auto generated for version 0, 3, 0, 10952 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 1f97ab6ce5d..9d2a982bd65 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10894... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10952... -#define EXPECTED_MANGOS_CLIENT_BUILD {10894, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10952, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 6e98b93016208f72cdaad7e7ba329f902a5cf97b Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 2 Dec 2009 17:57:47 +0300 Subject: [PATCH 24/46] - Some changes in quest POI packet. --- src/game/QueryHandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index a1e063b0f54..62f37645b62 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -527,6 +527,9 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << int32(itr->ObjectiveIndex); // objective index data << uint32(itr->MapId); // mapid data << uint32(itr->Unk1); // unknown + data << uint32(0); + data << uint32(0); + data << uint32(0); data << uint32(itr->points.size()); // POI points count for(std::vector::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2) From a538eaa9dc55178100c6191c955c68b60e47b005 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 3 Dec 2009 18:09:09 +0300 Subject: [PATCH 25/46] Updated to latest PTR build 10958. --- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index 6cac80128ef..d7ec26b4019 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10952 +// Auto generated for version 0, 3, 0, 10958 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 9d2a982bd65..72d8b013d5d 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10952... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10958... -#define EXPECTED_MANGOS_CLIENT_BUILD {10952, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {10958, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 4c582b5908933c0c2c597bf12d3e8943a8105f37 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 3 Dec 2009 19:22:12 +0300 Subject: [PATCH 26/46] - Quest POI fix. --- sql/330/2_quest_poi.sql | 9 ++++++--- src/game/ObjectMgr.cpp | 9 ++++++--- src/game/ObjectMgr.h | 7 +++++-- src/game/QueryHandler.cpp | 6 +++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/sql/330/2_quest_poi.sql b/sql/330/2_quest_poi.sql index b3b8dd2b067..92c4b81ce4d 100644 --- a/sql/330/2_quest_poi.sql +++ b/sql/330/2_quest_poi.sql @@ -4,6 +4,9 @@ CREATE TABLE `quest_poi` ( `objIndex` int(11) NOT NULL DEFAULT '0', `mapId` int(11) unsigned NOT NULL DEFAULT '0', `unk1` int(11) unsigned NOT NULL DEFAULT '0', + `unk2` int(11) unsigned NOT NULL DEFAULT '0', + `unk3` int(11) unsigned NOT NULL DEFAULT '0', + `unk4` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`questid`,`objIndex`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -17,9 +20,9 @@ CREATE TABLE `quest_poi_points` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- Sample data for quest 456 -INSERT INTO quest_poi VALUES (456, 0, 1, 0); -INSERT INTO quest_poi VALUES (456, 1, 1, 0); -INSERT INTO quest_poi VALUES (456, -1, 1, 0); +INSERT INTO quest_poi VALUES (456, 0, 1, 0, 0, 0, 0); +INSERT INTO quest_poi VALUES (456, 1, 1, 0, 0, 0, 0); +INSERT INTO quest_poi VALUES (456, -1, 1, 0, 0, 0, 0); INSERT INTO quest_poi_points VALUES (456, 0, 0x28CF, 0x0217); INSERT INTO quest_poi_points VALUES (456, 0, 0x29F4, 0x02AA); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index b978bffa4ec..8bc9e779c9a 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -6357,8 +6357,8 @@ void ObjectMgr::LoadQuestPOI() { uint32 count = 0; - // 0 1 2 3 - QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1 FROM quest_poi"); + // 0 1 2 3 4 5 6 + QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1, unk2, unk3, unk4 FROM quest_poi"); if(!result) { @@ -6382,8 +6382,11 @@ void ObjectMgr::LoadQuestPOI() int32 objIndex = fields[1].GetInt32(); uint32 mapId = fields[2].GetUInt32(); uint32 unk1 = fields[3].GetUInt32(); + uint32 unk2 = fields[4].GetUInt32(); + uint32 unk3 = fields[5].GetUInt32(); + uint32 unk4 = fields[6].GetUInt32(); - QuestPOI POI(objIndex, mapId, unk1); + QuestPOI POI(objIndex, mapId, unk1, unk2, unk3, unk4); QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND objIndex='%i'", questId, objIndex); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 6946b25939d..6f50c730509 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -230,10 +230,13 @@ struct QuestPOI int32 ObjectiveIndex; uint32 MapId; uint32 Unk1; + uint32 Unk2; + uint32 Unk3; + uint32 Unk4; std::vector points; - QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0) {} - QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1) {} + QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0), Unk2(0), Unk3(0), Unk4(0) {} + QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1, uint32 unk2, uint32 unk3, uint32 unk4) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1), Unk2(unk2), Unk3(unk3), Unk4(unk4) {} }; typedef std::vector QuestPOIVector; diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 62f37645b62..7170420e2d1 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -527,9 +527,9 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << int32(itr->ObjectiveIndex); // objective index data << uint32(itr->MapId); // mapid data << uint32(itr->Unk1); // unknown - data << uint32(0); - data << uint32(0); - data << uint32(0); + data << uint32(itr->Unk2); // unknown + data << uint32(itr->Unk3); // unknown + data << uint32(itr->Unk4); // unknown data << uint32(itr->points.size()); // POI points count for(std::vector::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2) From 25840f49c47859714f93164a53bbc4dc2c332a28 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 16 Dec 2009 02:44:50 +0300 Subject: [PATCH 27/46] - Updated to latest client build 11159. - May be fixed BG queues (not tested). --- src/game/BattleGroundMgr.cpp | 63 ++++-------------------------------- src/game/UpdateFields.h | 2 +- src/realmd/AuthCodes.h | 4 +-- 3 files changed, 10 insertions(+), 59 deletions(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 912b858df19..2b31e90a467 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1241,75 +1241,26 @@ void BattleGroundMgr::Update(uint32 diff) void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype) { - // we can be in 3 queues in same time... + // we can be in 2 queues in same time... if (StatusID == 0 || !bg) { - data->Initialize(SMSG_BATTLEFIELD_STATUS, 4*3); - *data << uint32(QueueSlot); // queue id (0...2) + data->Initialize(SMSG_BATTLEFIELD_STATUS, 4+8); + *data << uint32(QueueSlot); // queue id (0...1) *data << uint64(0); return; } - data->Initialize(SMSG_BATTLEFIELD_STATUS, (4+1+1+4+2+4+1+4+4+4)); - *data << uint32(QueueSlot); // queue id (0...2) - player can be in 3 queues in time + data->Initialize(SMSG_BATTLEFIELD_STATUS, (4+8+1+1+4+1+4+4+4)); + *data << uint32(QueueSlot); // queue id (0...1) - player can be in 2 queues in time // uint64 in client *data << uint64( uint64(arenatype) | (uint64(0x0D) << 8) | (uint64(bg->GetTypeID()) << 16) | (uint64(0x1F90) << 48) ); + *data << uint8(0); // 3.3.0 + *data << uint8(0); // 3.3.0 *data << uint32(bg->GetClientInstanceID()); // alliance/horde for BG and skirmish/rated for Arenas // following displays the minimap-icon 0 = faction icon 1 = arenaicon *data << uint8(bg->isRated()); -/* *data << uint8(arenatype ? arenatype : bg->GetArenaType()); // team type (0=BG, 2=2x2, 3=3x3, 5=5x5), for arenas // NOT PROPER VALUE IF ARENA ISN'T RUNNING YET!!!! - switch(bg->GetTypeID()) // value depends on bg id - { - case BATTLEGROUND_AV: - *data << uint8(1); - break; - case BATTLEGROUND_WS: - *data << uint8(2); - break; - case BATTLEGROUND_AB: - *data << uint8(3); - break; - case BATTLEGROUND_NA: - *data << uint8(4); - break; - case BATTLEGROUND_BE: - *data << uint8(5); - break; - case BATTLEGROUND_AA: - *data << uint8(6); - break; - case BATTLEGROUND_EY: - *data << uint8(7); - break; - case BATTLEGROUND_RL: - *data << uint8(8); - break; - case BATTLEGROUND_SA: - *data << uint8(9); - break; - case BATTLEGROUND_DS: - *data << uint8(10); - break; - case BATTLEGROUND_RV: - *data << uint8(11); - break; - default: // unknown - *data << uint8(0); - break; - } - - if (bg->isArena() && (StatusID == STATUS_WAIT_QUEUE)) - *data << uint32(BATTLEGROUND_AA); // all arenas I don't think so. - else - *data << uint32(bg->GetTypeID()); // BG id from DBC - - *data << uint16(0x1F90); // unk value 8080 - *data << uint32(bg->GetInstanceID()); // instance id - - *data << uint8(bg->isArena()); // minimap-icon 0=faction 1=arena -*/ *data << uint32(StatusID); // status switch(StatusID) { diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index d7ec26b4019..677a8c4da6a 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 0, 10958 +// Auto generated for version 3, 3, 0, 11159 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 72d8b013d5d..2ca888e96ab 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -66,9 +66,9 @@ enum LoginResult // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0 client build 10958... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.0a client build 11159... -#define EXPECTED_MANGOS_CLIENT_BUILD {10958, 0} +#define EXPECTED_MANGOS_CLIENT_BUILD {11159, 0} // At update excepted builds please update if need define DEFAULT_MAX_LEVEL // in DBCEnum.h to default max player level expected by build From 836ff4fd03fa5aaf4fecaa7caa4ed388e88e29ae Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 17 Dec 2009 14:46:07 +0300 Subject: [PATCH 28/46] Fix. --- src/game/Group.cpp | 10 +++++----- src/game/GroupHandler.cpp | 16 ++++++++-------- src/game/SharedDefines.h | 5 +++-- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/game/Group.cpp b/src/game/Group.cpp index ab76bae099d..6978c4de543 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -922,9 +922,9 @@ void Group::SetTargetIcon(uint8 id, uint64 guid) m_targetIcons[id] = guid; WorldPacket data(MSG_RAID_TARGET_UPDATE, (2+8)); - data << (uint8)0; - data << id; - data << guid; + data << uint8(0); + data << uint8(id); + data << uint64(guid); BroadcastPacket(&data, true); } @@ -964,8 +964,8 @@ void Group::SendTargetIconList(WorldSession *session) if(m_targetIcons[i] == 0) continue; - data << (uint8)i; - data << m_targetIcons[i]; + data << uint8(i); + data << uint64(m_targetIcons[i]); } session->SendPacket(&data); diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index b5f202be932..a2fd7d3afd6 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -407,11 +407,11 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) /** error handling **/ /********************/ - // everything's fine, do it + // everything is fine, do it WorldPacket data(MSG_MINIMAP_PING, (8+4+4)); - data << GetPlayer()->GetGUID(); - data << x; - data << y; + data << uint64(GetPlayer()->GetGUID()); + data << float(x); + data << float(y); GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID()); } @@ -432,10 +432,10 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) //sLog.outDebug("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll); WorldPacket data(MSG_RANDOM_ROLL, 4+4+4+8); - data << minimum; - data << maximum; - data << roll; - data << GetPlayer()->GetGUID(); + data << uint32(minimum); + data << uint32(maximum); + data << uint32(roll); + data << uint64(GetPlayer()->GetGUID()); if(GetPlayer()->GetGroup()) GetPlayer()->GetGroup()->BroadcastPacket(&data, false); else diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 6edbf5ba695..d3ccd7f81b6 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2358,10 +2358,11 @@ enum ChatMsg CHAT_MSG_RESTRICTED = 0x2E, CHAT_MSG_BN = 0x2F, CHAT_MSG_ACHIEVEMENT = 0x30, - CHAT_MSG_GUILD_ACHIEVEMENT = 0x31 + CHAT_MSG_GUILD_ACHIEVEMENT = 0x31, + CHAT_MSG_PARTY_LEADER = 0x32 // guessed }; -#define MAX_CHAT_MSG_TYPE 0x32 +#define MAX_CHAT_MSG_TYPE 0x33 enum ChatLinkColors { From 11c3eb26a4969044933a0c93fed81e34a9d3ed7f Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 17 Dec 2009 18:57:35 +0300 Subject: [PATCH 29/46] Guild bank hopefully fixed. --- src/game/CharacterHandler.cpp | 20 ++- src/game/Guild.cpp | 249 +++++++++++++--------------------- src/game/Guild.h | 12 +- src/game/GuildHandler.cpp | 23 ++-- src/game/ObjectMgr.cpp | 6 +- src/game/Player.cpp | 18 ++- 6 files changed, 126 insertions(+), 202 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index c704920913d..329cb0ea5e6 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -643,22 +643,21 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder) if(guild) { data.Initialize(SMSG_GUILD_EVENT, (2+guild->GetMOTD().size()+1)); - data << (uint8)GE_MOTD; - data << (uint8)1; + data << uint8(GE_MOTD); + data << uint8(1); data << guild->GetMOTD(); SendPacket(&data); DEBUG_LOG( "WORLD: Sent guild-motd (SMSG_GUILD_EVENT)" ); + guild->DisplayGuildBankTabsInfo(this); + data.Initialize(SMSG_GUILD_EVENT, (5+10)); // we guess size - data<<(uint8)GE_SIGNED_ON; - data<<(uint8)1; - data<GetName(); - data<GetGUID(); + data << uint8(GE_SIGNED_ON); + data << uint8(1); + data << pCurrChar->GetName(); + data << pCurrChar->GetGUID(); guild->BroadcastPacket(&data); DEBUG_LOG( "WORLD: Sent guild-signed-on (SMSG_GUILD_EVENT)" ); - - // Increment online members of the guild - guild->IncOnlineMemberCount(); } else { @@ -673,9 +672,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder) data << uint32(0); SendPacket(&data); - if(!pCurrChar->isAlive()) - pCurrChar->SendCorpseReclaimDelay(true); - pCurrChar->SendInitialPacketsBeforeAddToMap(); //Show cinematic at the first time that player login diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index b7bed388499..93a459db7e3 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -45,15 +45,12 @@ Guild::Guild() m_CreatedMonth = 0; m_CreatedDay = 0; - m_EventLogLoaded = false; - m_GuildBankLoaded = false; - m_OnlineMembers = 0; m_GuildBankMoney = 0; m_PurchasedTabs = 0; m_GuildEventLogNextGuid = 0; m_GuildBankEventLogNextGuid_Money = 0; - for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; i++) + for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i) m_GuildBankEventLogNextGuid_Item[i] = 0; } @@ -305,9 +302,9 @@ bool Guild::LoadRanksFromDB(QueryResult *guildRanksResult) continue; } - if (guildId > m_Id) - //we loaded all ranks for this guild already, break cycle + if (guildId > m_Id) //we loaded all ranks for this guild already, break cycle break; + uint32 rankID = fields[1].GetUInt32(); std::string rankName = fields[2].GetCppString(); uint32 rankRights = fields[3].GetUInt32(); @@ -316,12 +313,12 @@ bool Guild::LoadRanksFromDB(QueryResult *guildRanksResult) if (rankID != m_Ranks.size()) // guild_rank.ids are sequence 0,1,2,3.. broken_ranks = true; - //first rank is guildmaster, prevent loss leader rights + // first rank is guildmaster, prevent loss leader rights if (m_Ranks.empty()) rankRights |= GR_RIGHT_ALL; - AddRank(rankName,rankRights,rankMoney); - }while( guildRanksResult->NextRow() ); + AddRank(rankName, rankRights, rankMoney); + } while( guildRanksResult->NextRow() ); if (m_Ranks.size() < GUILD_RANKS_MIN_COUNT) // if too few ranks, renew them { @@ -419,7 +416,7 @@ bool Guild::LoadMembersFromDB(QueryResult *guildMembersResult) members[GUID_LOPART(guid)] = newmember; - }while (guildMembersResult->NextRow()); + } while (guildMembersResult->NextRow()); if (members.empty()) return false; @@ -580,7 +577,7 @@ void Guild::BroadcastToOfficers(WorldSession *session, const std::string& msg, u for(MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { WorldPacket data; - ChatHandler::FillMessageData(&data, session, CHAT_MSG_OFFICER, language, NULL, 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, session, CHAT_MSG_OFFICER, language, NULL, 0, msg.c_str(), NULL); Player *pl = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)); @@ -789,7 +786,7 @@ void Guild::Query(WorldSession *session) data << m_Id; data << m_Name; - for (size_t i = 0 ; i < 10; ++i) // show always 10 ranks + for (size_t i = 0 ; i < GUILD_RANKS_MAX_COUNT; ++i) // show always 10 ranks { if (i < m_Ranks.size()) data << m_Ranks[i].Name; @@ -826,14 +823,6 @@ void Guild::UpdateLogoutTime(uint64 guid) return; itr->second.LogoutTime = time(NULL); - - if (m_OnlineMembers > 0) - --m_OnlineMembers; - else - { - UnloadGuildBank(); - UnloadGuildEventLog(); - } } // ************************************************* @@ -842,10 +831,6 @@ void Guild::UpdateLogoutTime(uint64 guid) // Display guild eventlog void Guild::DisplayGuildEventLog(WorldSession *session) { - // Load guild eventlog, if not already done - if (!m_EventLogLoaded) - LoadGuildEventLogFromDB(); - // Sending result WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 0); // count, max count == 100 @@ -872,10 +857,6 @@ void Guild::DisplayGuildEventLog(WorldSession *session) // Load guild eventlog from DB void Guild::LoadGuildEventLogFromDB() { - // Return if already loaded - if (m_EventLogLoaded) - return; - // 0 1 2 3 4 5 QueryResult *result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp FROM guild_eventlog WHERE guildid=%u ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, GUILD_EVENTLOG_MAX_RECORDS); if (!result) @@ -908,18 +889,6 @@ void Guild::LoadGuildEventLogFromDB() } while( result->NextRow() ); delete result; - - m_EventLogLoaded = true; -} - -// Unload guild eventlog -void Guild::UnloadGuildEventLog() -{ - if (!m_EventLogLoaded) - return; - - m_GuildEventLog.clear(); - m_EventLogLoaded = false; } // Add entry to guild eventlog @@ -953,20 +922,20 @@ void Guild::DisplayGuildBankContent(WorldSession *session, uint8 TabId) { GuildBankTab const* tab = m_TabListMap[TabId]; - if (!IsMemberHaveRights(session->GetPlayer()->GetGUIDLow(),TabId,GUILD_BANK_RIGHT_VIEW_TAB)) + if (!IsMemberHaveRights(session->GetPlayer()->GetGUIDLow(), TabId, GUILD_BANK_RIGHT_VIEW_TAB)) return; - WorldPacket data(SMSG_GUILD_BANK_LIST,1200); + WorldPacket data(SMSG_GUILD_BANK_LIST, 1200); data << uint64(GetGuildBankMoney()); data << uint8(TabId); // remaining slots for today data << uint32(GetMemberSlotWithdrawRem(session->GetPlayer()->GetGUIDLow(), TabId)); - data << uint8(0); // Tell client this is a tab content packet + data << uint8(0); // Tell client that there's no tab info in this packet data << uint8(GUILD_BANK_MAX_SLOTS); - for (int i=0; iSendPacket(&data); @@ -974,14 +943,14 @@ void Guild::DisplayGuildBankContent(WorldSession *session, uint8 TabId) sLog.outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } -void Guild::DisplayGuildBankMoneyUpdate() +void Guild::DisplayGuildBankMoneyUpdate(WorldSession *session) { WorldPacket data(SMSG_GUILD_BANK_LIST, 8+1+4+1+1); data << uint64(GetGuildBankMoney()); data << uint8(0); // TabId, default 0 - data << uint32(0); // slot withdrow, default 0 - data << uint8(0); // Tell client this is a tab content packet + data << uint32(GetMemberSlotWithdrawRem(session->GetPlayer()->GetGUIDLow(), 0)); + data << uint8(0); // Tell that there's no tab info in this packet data << uint8(0); // not send items BroadcastPacket(&data); @@ -992,25 +961,24 @@ void Guild::DisplayGuildBankContentUpdate(uint8 TabId, int32 slot1, int32 slot2) { GuildBankTab const* tab = m_TabListMap[TabId]; - WorldPacket data(SMSG_GUILD_BANK_LIST,1200); + WorldPacket data(SMSG_GUILD_BANK_LIST, 1200); data << uint64(GetGuildBankMoney()); data << uint8(TabId); - // remaining slots for today size_t rempos = data.wpos(); - data << uint32(0); // will be filled later - data << uint8(0); // Tell client this is a tab content packet + data << uint32(0); // item withdraw amount, will be filled later + data << uint8(0); // Tell client that there's no tab info in this packet if (slot2 == -1) // single item in slot1 { - data << uint8(1); + data << uint8(1); // item count AppendDisplayGuildBankSlot(data, tab, slot1); } else // 2 items (in slot1 and slot2) { - data << uint8(2); + data << uint8(2); // item count if (slot1 > slot2) std::swap(slot1,slot2); @@ -1040,15 +1008,14 @@ void Guild::DisplayGuildBankContentUpdate(uint8 TabId, GuildItemPosCountVec cons { GuildBankTab const* tab = m_TabListMap[TabId]; - WorldPacket data(SMSG_GUILD_BANK_LIST,1200); + WorldPacket data(SMSG_GUILD_BANK_LIST, 1200); data << uint64(GetGuildBankMoney()); data << uint8(TabId); - // remaining slots for today size_t rempos = data.wpos(); - data << uint32(0); // will be filled later - data << uint8(0); // Tell client this is a tab content packet + data << uint32(0); // item withdraw amount, will be filled later + data << uint8(0); // Tell client that there's no tab info in this packet data << uint8(slots.size()); // updates count @@ -1084,16 +1051,12 @@ Item* Guild::GetItem(uint8 TabId, uint8 SlotId) void Guild::DisplayGuildBankTabsInfo(WorldSession *session) { - // Time to load bank if not already done - if (!m_GuildBankLoaded) - LoadGuildBankFromDB(); - WorldPacket data(SMSG_GUILD_BANK_LIST, 500); data << uint64(GetGuildBankMoney()); data << uint8(0); // TabInfo packet must be for TabId 0 - data << uint32(0xFFFFFFFF); // bit 9 must be set for this packet to work - data << uint8(1); // Tell Client this is a TabInfo packet + data << uint32(GetMemberSlotWithdrawRem(session->GetPlayer()->GetGUIDLow(), 0)); + data << uint8(1); // Tell client that this packet includes tab info data << uint8(m_PurchasedTabs); // here is the number of tabs @@ -1148,17 +1111,11 @@ uint32 Guild::GetBankRights(uint32 rankId, uint8 TabId) const } // ************************************************* -// Guild bank loading/unloading related +// Guild bank loading related -// This load should be called when the bank is first accessed by a guild member +// This load should be called on startup only void Guild::LoadGuildBankFromDB() { - if (m_GuildBankLoaded) - return; - - m_GuildBankLoaded = true; - LoadGuildBankEventLogFromDB(); - // 0 1 2 3 QueryResult *result = CharacterDatabase.PQuery("SELECT TabId, TabName, TabIcon, TabText FROM guild_bank_tab WHERE guildid='%u' ORDER BY TabId", m_Id); if (!result) @@ -1235,29 +1192,6 @@ void Guild::LoadGuildBankFromDB() delete result; } -// This unload should be called when the last member of the guild gets offline -void Guild::UnloadGuildBank() -{ - if (!m_GuildBankLoaded) - return; - for (uint8 i = 0 ; i < m_PurchasedTabs ; ++i ) - { - for (uint8 j = 0 ; j < GUILD_BANK_MAX_SLOTS ; ++j) - { - if (m_TabListMap[i]->Slots[j]) - { - m_TabListMap[i]->Slots[j]->RemoveFromWorld(); - delete m_TabListMap[i]->Slots[j]; - } - } - delete m_TabListMap[i]; - } - m_TabListMap.clear(); - - UnloadGuildBankEventLog(); - m_GuildBankLoaded = false; -} - // ************************************************* // Money deposit/withdraw related @@ -1330,7 +1264,7 @@ bool Guild::IsMemberHaveRights(uint32 LowGuid, uint8 TabId, uint32 rights) const if (itr->second.RankId == GR_GUILDMASTER) return true; - return (GetBankRights(itr->second.RankId,TabId) & rights)==rights; + return (GetBankRights(itr->second.RankId,TabId) & rights) == rights; } uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId) @@ -1342,7 +1276,7 @@ uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId) if (itr->second.RankId == GR_GUILDMASTER) return WITHDRAW_SLOT_UNLIMITED; - if ((GetBankRights(itr->second.RankId,TabId) & GUILD_BANK_RIGHT_VIEW_TAB)!=GUILD_BANK_RIGHT_VIEW_TAB) + if ((GetBankRights(itr->second.RankId,TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB) return 0; uint32 curTime = uint32(time(NULL)/MINUTE); @@ -1350,7 +1284,7 @@ uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId) { itr->second.BankResetTimeTab[TabId] = curTime; itr->second.BankRemSlotsTab[TabId] = GetBankSlotPerDay(itr->second.RankId, TabId); - CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeTab%u='%u',BankRemSlotsTab%u='%u' WHERE guildid='%u' AND guid='%u'", + CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeTab%u='%u', BankRemSlotsTab%u='%u' WHERE guildid='%u' AND guid='%u'", uint32(TabId), itr->second.BankResetTimeTab[TabId], uint32(TabId), itr->second.BankRemSlotsTab[TabId], m_Id, LowGuid); } return itr->second.BankRemSlotsTab[TabId]; @@ -1371,7 +1305,7 @@ uint32 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid) { itr->second.BankResetTimeMoney = curTime; itr->second.BankRemMoney = GetBankMoneyPerDay(itr->second.RankId); - CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='%u',BankRemMoney='%u' WHERE guildid='%u' AND guid='%u'", + CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='%u', BankRemMoney='%u' WHERE guildid='%u' AND guid='%u'", itr->second.BankResetTimeMoney, itr->second.BankRemMoney, m_Id, LowGuid); } return itr->second.BankRemMoney; @@ -1496,7 +1430,7 @@ void Guild::LoadGuildBankEventLogFromDB() //uint32 configCount = sWorld.getConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT); //cycle through all purchased guild bank item tabs - for (uint32 tabId = 0; tabId < m_PurchasedTabs; tabId++) + for (uint32 tabId = 0; tabId < m_PurchasedTabs; ++tabId) { // 0 1 2 3 4 5 6 QueryResult *result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog WHERE guildid='%u' AND TabId='%u' ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, tabId, GUILD_BANK_MAX_LOGS); @@ -1576,14 +1510,6 @@ void Guild::LoadGuildBankEventLogFromDB() delete result; } -void Guild::UnloadGuildBankEventLog() -{ - m_GuildBankEventLog_Money.clear(); - - for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i) - m_GuildBankEventLog_Item[i].clear(); -} - void Guild::DisplayGuildBankLogs(WorldSession *session, uint8 TabId) { if (TabId > GUILD_BANK_MAX_TABS) @@ -1709,23 +1635,30 @@ void Guild::AppendDisplayGuildBankSlot( WorldPacket& data, GuildBankTab const *t data << uint32(entry); if (entry) { - // random item property id +8 - data << (uint32) pItem->GetItemRandomPropertyId(); + data << uint32(0); // 3.3.0 (0x8000, 0x8020) + data << uint32(pItem->GetItemRandomPropertyId()); // random item property id + 8 + if (pItem->GetItemRandomPropertyId()) - // SuffixFactor +4 - data << (uint32) pItem->GetItemSuffixFactor(); - // +12 // ITEM_FIELD_STACK_COUNT - data << uint32(pItem->GetCount()); - data << uint32(0); // +16 // Unknown value - data << uint8(0); // unknown 2.4.2 - if (uint32 Enchant0 = pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)) + data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor + 4 + + data << uint32(pItem->GetCount()); // +12 ITEM_FIELD_STACK_COUNT + data << uint32(0); // +16 Unknown value + data << uint8(0); // +20 + + uint8 enchCount = 0; + size_t enchCountPos = data.wpos(); + + data << uint8(enchCount); // number of enchantments + for(uint32 i = PERM_ENCHANTMENT_SLOT; i < MAX_ENCHANTMENT_SLOT; ++i) { - data << uint8(1); // number of enchantments (max 3) why max 3? - data << uint8(PERM_ENCHANTMENT_SLOT); // enchantment slot (range: 0:2) - data << uint32(Enchant0); // enchantment id + if(uint32 enchId = pItem->GetEnchantmentId(EnchantmentSlot(i))) + { + data << uint8(i); + data << uint32(enchId); + ++enchCount; + } } - else - data << uint8(0); // no enchantments (0) + data.put(enchCountPos, enchCount); } } @@ -1745,11 +1678,11 @@ Item* Guild::StoreItem(uint8 tabId, GuildItemPosCountVec const& dest, Item* pIte if (itr == dest.end()) { - lastItem = _StoreItem(tabId,slot,pItem,count,false); + lastItem = _StoreItem(tabId, slot, pItem, count, false); break; } - lastItem = _StoreItem(tabId,slot,pItem,count,true); + lastItem = _StoreItem(tabId, slot, pItem, count, true); } return lastItem; @@ -1781,7 +1714,7 @@ Item* Guild::_StoreItem( uint8 tab, uint8 slot, Item *pItem, uint32 count, bool pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); AddGBankItemToDB(GetId(), tab, slot, pItem->GetGUIDLow(), pItem->GetEntry()); pItem->FSetState(ITEM_NEW); - pItem->SaveToDB(); // not in onventory and can be save standalone + pItem->SaveToDB(); // not in inventory and can be save standalone return pItem; } @@ -1789,7 +1722,7 @@ Item* Guild::_StoreItem( uint8 tab, uint8 slot, Item *pItem, uint32 count, bool { pItem2->SetCount( pItem2->GetCount() + count ); pItem2->FSetState(ITEM_CHANGED); - pItem2->SaveToDB(); // not in onventory and can be save standalone + pItem2->SaveToDB(); // not in inventory and can be save standalone if (!clone) { @@ -1842,7 +1775,7 @@ uint8 Guild::_CanStoreItem_InSpecificSlot( uint8 tab, uint8 slot, GuildItemPosCo if (need_space > count) need_space = count; - GuildItemPosCount newPosition = GuildItemPosCount(slot,need_space); + GuildItemPosCount newPosition = GuildItemPosCount(slot, need_space); if (!newPosition.isContainedIn(dest)) { dest.push_back(newPosition); @@ -1854,7 +1787,7 @@ uint8 Guild::_CanStoreItem_InSpecificSlot( uint8 tab, uint8 slot, GuildItemPosCo uint8 Guild::_CanStoreItem_InTab( uint8 tab, GuildItemPosCountVec &dest, uint32& count, bool merge, Item* pSrcItem, uint8 skip_slot ) const { - for (uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; j++) + for (uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; ++j) { // skip specific slot already processed in first called _CanStoreItem_InSpecificSlot if (j == skip_slot) @@ -1878,7 +1811,7 @@ uint8 Guild::_CanStoreItem_InTab( uint8 tab, GuildItemPosCountVec &dest, uint32& if (need_space > count) need_space = count; - GuildItemPosCount newPosition = GuildItemPosCount(j,need_space); + GuildItemPosCount newPosition = GuildItemPosCount(j, need_space); if (!newPosition.isContainedIn(dest)) { dest.push_back(newPosition); @@ -1895,7 +1828,7 @@ uint8 Guild::_CanStoreItem_InTab( uint8 tab, GuildItemPosCountVec &dest, uint32& if (need_space > count) need_space = count; - GuildItemPosCount newPosition = GuildItemPosCount(j,need_space); + GuildItemPosCount newPosition = GuildItemPosCount(j, need_space); if (!newPosition.isContainedIn(dest)) { dest.push_back(newPosition); @@ -1930,12 +1863,12 @@ uint8 Guild::CanStoreItem( uint8 tab, uint8 slot, GuildItemPosCountVec &dest, ui return EQUIP_ERR_OK; } - // not specific slot or have spece for partly store only in specific slot + // not specific slot or have space for partly store only in specific slot // search stack in tab for merge to if (pItem->GetMaxStackCount() > 1) { - uint8 res = _CanStoreItem_InTab(tab,dest,count,true,pItem,slot); + uint8 res = _CanStoreItem_InTab(tab, dest, count, true, pItem, slot); if (res != EQUIP_ERR_OK) return res; @@ -1944,7 +1877,7 @@ uint8 Guild::CanStoreItem( uint8 tab, uint8 slot, GuildItemPosCountVec &dest, ui } // search free slot in bag for place to - uint8 res = _CanStoreItem_InTab(tab,dest,count,false,pItem,slot); + uint8 res = _CanStoreItem_InTab(tab, dest, count, false, pItem, slot); if (res != EQUIP_ERR_OK) return res; @@ -1966,7 +1899,7 @@ void Guild::SetGuildBankTabText(uint8 TabId, std::string text) if (m_TabListMap[TabId]->Text == text) return; - utf8truncate(text,500); // DB and client size limitation + utf8truncate(text, 500); // DB and client size limitation m_TabListMap[TabId]->Text = text; @@ -2023,7 +1956,7 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT if (SplitedAmount) { // Bank -> Bank item split (in empty or non empty slot GuildItemPosCountVec dest; - uint8 msg = CanStoreItem(BankTabDst,BankTabSlotDst,dest,SplitedAmount,pItemSrc,false); + uint8 msg = CanStoreItem(BankTabDst, BankTabSlotDst, dest, SplitedAmount, pItemSrc, false); if (msg != EQUIP_ERR_OK) { pl->SendEquipError( msg, pItemSrc, NULL ); @@ -2044,13 +1977,13 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT pItemSrc->SetCount( pItemSrc->GetCount() - SplitedAmount ); pItemSrc->FSetState(ITEM_CHANGED); pItemSrc->SaveToDB(); // not in inventory and can be save standalone - StoreItem(BankTabDst,dest,pNewItem); + StoreItem(BankTabDst, dest, pNewItem); CharacterDatabase.CommitTransaction(); } else // non split { GuildItemPosCountVec gDest; - uint8 msg = CanStoreItem(BankTabDst,BankTabSlotDst,gDest,pItemSrc->GetCount(),pItemSrc,false); + uint8 msg = CanStoreItem(BankTabDst,BankTabSlotDst,gDest,pItemSrc->GetCount(), pItemSrc, false); if (msg == EQUIP_ERR_OK) // merge to { CharacterDatabase.BeginTransaction(); @@ -2063,7 +1996,7 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT else // swap { gDest.clear(); - msg = CanStoreItem(BankTabDst,BankTabSlotDst,gDest,pItemSrc->GetCount(),pItemSrc,true); + msg = CanStoreItem(BankTabDst, BankTabSlotDst, gDest, pItemSrc->GetCount(), pItemSrc, true); if (msg != EQUIP_ERR_OK) { pl->SendEquipError( msg, pItemSrc, NULL ); @@ -2071,7 +2004,7 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT } GuildItemPosCountVec gSrc; - msg = CanStoreItem(BankTab,BankTabSlot,gSrc,pItemDst->GetCount(),pItemDst,true); + msg = CanStoreItem(BankTab, BankTabSlot, gSrc, pItemDst->GetCount(), pItemDst, true); if (msg != EQUIP_ERR_OK) { pl->SendEquipError( msg, pItemDst, NULL ); @@ -2101,9 +2034,9 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT CharacterDatabase.CommitTransaction(); } } - DisplayGuildBankContentUpdate(BankTab,BankTabSlot,BankTab == BankTabDst ? BankTabSlotDst : -1); + DisplayGuildBankContentUpdate(BankTab, BankTabSlot, BankTab == BankTabDst ? BankTabSlotDst : -1); if (BankTab != BankTabDst) - DisplayGuildBankContentUpdate(BankTabDst,BankTabSlotDst); + DisplayGuildBankContentUpdate(BankTabDst, BankTabSlotDst); } @@ -2152,7 +2085,7 @@ void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, u pItemBank->SetCount(pItemBank->GetCount()-SplitedAmount); pItemBank->FSetState(ITEM_CHANGED); pItemBank->SaveToDB(); // not in inventory and can be save standalone - pl->MoveItemToInventory(dest,pNewItem,true); + pl->MoveItemToInventory(dest, pNewItem, true); pl->SaveInventoryAndGoldToDB(); MemberItemWithdraw(BankTab, pl->GetGUIDLow()); @@ -2173,7 +2106,7 @@ void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, u LogBankEvent(GUILD_BANK_LOG_WITHDRAW_ITEM, BankTab, pl->GetGUIDLow(), pItemBank->GetEntry(), pItemBank->GetCount()); RemoveItem(BankTab, BankTabSlot); - pl->MoveItemToInventory(dest,pItemBank,true); + pl->MoveItemToInventory(dest, pItemBank, true); pl->SaveInventoryAndGoldToDB(); MemberItemWithdraw(BankTab, pl->GetGUIDLow()); @@ -2225,7 +2158,7 @@ void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, u { sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )", pl->GetName(),pl->GetSession()->GetAccountId(), - pItemChar->GetProto()->Name1,pItemChar->GetEntry(),pItemChar->GetCount(), + pItemChar->GetProto()->Name1, pItemChar->GetEntry(), pItemChar->GetCount(), m_Id); } } @@ -2244,14 +2177,14 @@ void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, u if (pItemChar) StoreItem(BankTab, gDest, pItemChar); - pl->MoveItemToInventory(iDest,pItemBank,true); + pl->MoveItemToInventory(iDest, pItemBank, true); pl->SaveInventoryAndGoldToDB(); MemberItemWithdraw(BankTab, pl->GetGUIDLow()); CharacterDatabase.CommitTransaction(); } } - DisplayGuildBankContentUpdate(BankTab,BankTabSlot); + DisplayGuildBankContentUpdate(BankTab, BankTabSlot); } @@ -2281,7 +2214,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, if (SplitedAmount) { // Char -> Bank split to empty or non-empty slot (partly move) GuildItemPosCountVec dest; - uint8 msg = CanStoreItem(BankTab,BankTabSlot,dest,SplitedAmount,pItemChar,false); + uint8 msg = CanStoreItem(BankTab, BankTabSlot, dest, SplitedAmount, pItemChar, false); if (msg != EQUIP_ERR_OK) { pl->SendEquipError( msg, pItemChar, NULL ); @@ -2300,7 +2233,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, { sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )", pl->GetName(),pl->GetSession()->GetAccountId(), - pItemChar->GetProto()->Name1,pItemChar->GetEntry(),SplitedAmount,m_Id); + pItemChar->GetProto()->Name1, pItemChar->GetEntry(), SplitedAmount, m_Id); } CharacterDatabase.BeginTransaction(); @@ -2313,12 +2246,12 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, StoreItem(BankTab, dest, pNewItem); CharacterDatabase.CommitTransaction(); - DisplayGuildBankContentUpdate(BankTab,dest); + DisplayGuildBankContentUpdate(BankTab, dest); } else // Char -> Bank swap with empty or non-empty (move) { GuildItemPosCountVec dest; - uint8 msg = CanStoreItem(BankTab,BankTabSlot,dest,pItemChar->GetCount(),pItemChar,false); + uint8 msg = CanStoreItem(BankTab, BankTabSlot, dest, pItemChar->GetCount(), pItemChar, false); if (msg == EQUIP_ERR_OK) // merge { // logging item move to bank @@ -2326,7 +2259,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, { sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )", pl->GetName(),pl->GetSession()->GetAccountId(), - pItemChar->GetProto()->Name1,pItemChar->GetEntry(),pItemChar->GetCount(), + pItemChar->GetProto()->Name1, pItemChar->GetEntry(), pItemChar->GetCount(), m_Id); } @@ -2336,11 +2269,11 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, pl->MoveItemFromInventory(PlayerBag, PlayerSlot, true); pItemChar->DeleteFromInventoryDB(); - StoreItem(BankTab,dest,pItemChar); + StoreItem(BankTab, dest, pItemChar); pl->SaveInventoryAndGoldToDB(); CharacterDatabase.CommitTransaction(); - DisplayGuildBankContentUpdate(BankTab,dest); + DisplayGuildBankContentUpdate(BankTab, dest); } else // Char <-> Bank swap items (posible NULL bank item) { @@ -2356,7 +2289,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, } GuildItemPosCountVec gDest; - msg = CanStoreItem(BankTab,BankTabSlot,gDest,pItemChar->GetCount(),pItemChar,true); + msg = CanStoreItem(BankTab, BankTabSlot, gDest, pItemChar->GetCount(), pItemChar, true); if (msg != EQUIP_ERR_OK) { pl->SendEquipError( msg, pItemChar, NULL ); @@ -2376,7 +2309,7 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, { sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )", pl->GetName(),pl->GetSession()->GetAccountId(), - pItemChar->GetProto()->Name1,pItemChar->GetEntry(),pItemChar->GetCount(), + pItemChar->GetProto()->Name1, pItemChar->GetEntry(), pItemChar->GetCount(), m_Id); } @@ -2390,22 +2323,22 @@ void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, if (pItemBank) RemoveItem(BankTab, BankTabSlot); - StoreItem(BankTab,gDest,pItemChar); + StoreItem(BankTab, gDest, pItemChar); if (pItemBank) - pl->MoveItemToInventory(iDest,pItemBank,true); + pl->MoveItemToInventory(iDest, pItemBank, true); pl->SaveInventoryAndGoldToDB(); if (pItemBank) MemberItemWithdraw(BankTab, pl->GetGUIDLow()); CharacterDatabase.CommitTransaction(); - DisplayGuildBankContentUpdate(BankTab,gDest); + DisplayGuildBankContentUpdate(BankTab, gDest); } } } bool GuildItemPosCount::isContainedIn(GuildItemPosCountVec const &vec) const { - for(GuildItemPosCountVec::const_iterator itr = vec.begin(); itr != vec.end();++itr) + for(GuildItemPosCountVec::const_iterator itr = vec.begin(); itr != vec.end(); ++itr) if (itr->Slot == this->Slot) return true; diff --git a/src/game/Guild.h b/src/game/Guild.h index f75a86ae386..87b1f39b204 100644 --- a/src/game/Guild.h +++ b/src/game/Guild.h @@ -383,14 +383,13 @@ class Guild void UpdateLogoutTime(uint64 guid); // Guild EventLog void LoadGuildEventLogFromDB(); - void UnloadGuildEventLog(); void DisplayGuildEventLog(WorldSession *session); void LogGuildEvent(uint8 EventType, uint32 PlayerGuid1, uint32 PlayerGuid2, uint8 NewRank); // ** Guild bank ** // Content & item deposit/withdraw void DisplayGuildBankContent(WorldSession *session, uint8 TabId); - void DisplayGuildBankMoneyUpdate(); + void DisplayGuildBankMoneyUpdate(WorldSession *session); void SwapItems( Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankTabDst, uint8 BankTabSlotDst, uint32 SplitedAmount); void MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 PlayerBag, uint8 PlayerSlot, uint32 SplitedAmount); @@ -406,11 +405,8 @@ class Guild uint32 GetBankRights(uint32 rankId, uint8 TabId) const; bool IsMemberHaveRights(uint32 LowGuid, uint8 TabId,uint32 rights) const; bool CanMemberViewTab(uint32 LowGuid, uint8 TabId) const; - // Load/unload + // Load void LoadGuildBankFromDB(); - void UnloadGuildBank(); - bool IsGuildBankLoaded() const { return m_GuildBankLoaded; } - void IncOnlineMemberCount() { ++m_OnlineMembers; } // Money deposit/withdraw void SendMoneyInfo(WorldSession *session, uint32 LowGuid); bool MemberMoneyWithdraw(uint32 amount, uint32 LowGuid); @@ -428,7 +424,6 @@ class Guild bool LoadBankRightsFromDB(QueryResult *guildBankTabRightsResult); // Guild Bank Event Logs void LoadGuildBankEventLogFromDB(); - void UnloadGuildBankEventLog(); void DisplayGuildBankLogs(WorldSession *session, uint8 TabId); void LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uint32 ItemOrMoney, uint8 ItemStackCount=0, uint8 DestTabId=0); bool AddGBankItemToDB(uint32 GuildId, uint32 BankTab , uint32 BankTabSlot , uint32 GUIDLow, uint32 Entry ); @@ -469,9 +464,6 @@ class Guild uint32 m_GuildBankEventLogNextGuid_Money; uint32 m_GuildBankEventLogNextGuid_Item[GUILD_BANK_MAX_TABS]; - bool m_GuildBankLoaded; - bool m_EventLogLoaded; - uint32 m_OnlineMembers; uint64 m_GuildBankMoney; uint8 m_PurchasedTabs; diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index b113b0caf7a..604199d5430 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -887,7 +887,7 @@ void WorldSession::HandleGuildBankQueryTab( WorldPacket & recv_data ) if (!pGuild) return; - if (!pGuild->IsGuildBankLoaded() || TabId >= pGuild->GetPurchasedTabs()) + if (TabId >= pGuild->GetPurchasedTabs()) return; // Let's update the amount of gold the player can withdraw before displaying the content @@ -921,7 +921,7 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data ) if (!pGuild) return; - if (!pGuild->IsGuildBankLoaded() || !pGuild->GetPurchasedTabs()) + if (!pGuild->GetPurchasedTabs()) return; CharacterDatabase.BeginTransaction(); @@ -944,7 +944,7 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data ) pGuild->DisplayGuildBankTabsInfo(this); pGuild->DisplayGuildBankContent(this, 0); - pGuild->DisplayGuildBankMoneyUpdate(); + pGuild->DisplayGuildBankMoneyUpdate(this); } void WorldSession::HandleGuildBankWithdrawMoney( WorldPacket & recv_data ) @@ -969,7 +969,7 @@ void WorldSession::HandleGuildBankWithdrawMoney( WorldPacket & recv_data ) if(!pGuild) return; - if (!pGuild->IsGuildBankLoaded() || !pGuild->GetPurchasedTabs()) + if (!pGuild->GetPurchasedTabs()) return; if (pGuild->GetGuildBankMoney()SendMoneyInfo(this, GetPlayer()->GetGUIDLow()); pGuild->DisplayGuildBankTabsInfo(this); pGuild->DisplayGuildBankContent(this, 0); - pGuild->DisplayGuildBankMoneyUpdate(); + pGuild->DisplayGuildBankMoneyUpdate(this); } void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data ) @@ -1026,7 +1026,7 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data ) } Guild *pGuild = sObjectMgr.GetGuildById(GuildId); - if (!pGuild || !pGuild->IsGuildBankLoaded()) + if (!pGuild) { recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet return; @@ -1128,7 +1128,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data ) return; // m_PurchasedTabs = 0 when buying Tab 0, that is why this check can be made - if (!pGuild->IsGuildBankLoaded() || TabId != pGuild->GetPurchasedTabs()) + if (TabId != pGuild->GetPurchasedTabs()) return; uint32 TabCost = GetGuildBankTabPrice(TabId) * GOLD; @@ -1177,7 +1177,7 @@ void WorldSession::HandleGuildBankUpdateTab( WorldPacket & recv_data ) if (!pGuild) return; - if (!pGuild->IsGuildBankLoaded() || TabId >= pGuild->GetPurchasedTabs()) + if (TabId >= pGuild->GetPurchasedTabs()) return; pGuild->SetGuildBankTabInfo(TabId, Name, IconIndex); @@ -1200,9 +1200,6 @@ void WorldSession::HandleGuildBankLogQuery( WorldPacket & recv_data ) if (!pGuild) return; - if (!pGuild->IsGuildBankLoaded()) - return; - // GUILD_BANK_MAX_TABS send by client for money log if (TabId >= pGuild->GetPurchasedTabs() && TabId != GUILD_BANK_MAX_TABS) return; @@ -1225,7 +1222,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) if (!pGuild) return; - if (!pGuild->IsGuildBankLoaded() || TabId >= pGuild->GetPurchasedTabs()) + if (TabId >= pGuild->GetPurchasedTabs()) return; pGuild->SendGuildBankTabText(this, TabId); @@ -1248,7 +1245,7 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data) if (!pGuild) return; - if (!pGuild->IsGuildBankLoaded() || TabId >= pGuild->GetPurchasedTabs()) + if (TabId >= pGuild->GetPurchasedTabs()) return; pGuild->SetGuildBankTabText(TabId, Text); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index ca0db12f2c5..213168c8462 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3021,9 +3021,11 @@ void ObjectMgr::LoadGuilds() delete newGuild; continue; } + newGuild->LoadGuildEventLogFromDB(); + newGuild->LoadGuildBankEventLogFromDB(); + newGuild->LoadGuildBankFromDB(); AddGuild(newGuild); - - }while( result->NextRow() ); + } while( result->NextRow() ); delete result; delete guildRanksResult; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5d2f1d59436..f2d48252479 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18713,8 +18713,6 @@ void Player::SendInitialPacketsBeforeAddToMap() { GetSocial()->SendSocialList(); - // guild bank list wtf? - // Homebind WorldPacket data(SMSG_BINDPOINTUPDATE, 5*4); data << m_homebindX << m_homebindY << m_homebindZ; @@ -18725,11 +18723,13 @@ void Player::SendInitialPacketsBeforeAddToMap() // SMSG_SET_PROFICIENCY // SMSG_SET_PCT_SPELL_MODIFIER // SMSG_SET_FLAT_SPELL_MODIFIER - // SMSG_UPDATE_AURA_DURATION SendTalentsInfoData(false); - // SMSG_INSTANCE_DIFFICULTY + data.Initialize(SMSG_INSTANCE_DIFFICULTY, 4+4); + data << uint32(0); + data << uint32(0); + GetSession()->SendPacket(&data); SendInitialSpells(); @@ -18739,11 +18739,16 @@ void Player::SendInitialPacketsBeforeAddToMap() SendInitialActionButtons(); m_reputationMgr.SendInitialReputations(); - // SMSG_INIT_WORLD_STATES - m_achievementMgr.SendAllAchievementData(); + + if(!isAlive()) + SendCorpseReclaimDelay(true); + + SendInitWorldStates(GetZoneId(), GetAreaId()); SendEquipmentSetList(); + m_achievementMgr.SendAllAchievementData(); + data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4); data << uint32(secsToTimeBitFields(sWorld.GetGameTime())); data << (float)0.01666667f; // game speed @@ -18752,7 +18757,6 @@ void Player::SendInitialPacketsBeforeAddToMap() // SMSG_TALENTS_INFO x 2 for pet (unspent points and talents in separate packets...) // SMSG_PET_GUIDS - // SMSG_UPDATE_WORLD_STATE // SMSG_POWER_UPDATE // set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment From 9d78254362e952dd6e006967e936e0b0f301ae3d Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Fri, 18 Dec 2009 00:10:48 +0300 Subject: [PATCH 30/46] Removed useless code. Mail loading triggered at login by client anyway. --- src/game/Mail.cpp | 62 +++++++++++++++++------------------------- src/game/ObjectMgr.cpp | 2 +- src/game/Player.cpp | 9 ++---- src/game/Player.h | 2 -- 4 files changed, 28 insertions(+), 47 deletions(-) diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index fda9b771473..0246336350f 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -513,10 +513,6 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data ) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; - // load players mails, and mailed items - if(!_player->m_mailsLoaded) - _player->_LoadMail(); - // client can't work with packets > max int16 value const uint32 maxPacketSize = 32767; @@ -728,9 +724,6 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/ ) { WorldPacket data(MSG_QUERY_NEXT_MAIL_TIME, 8); - if(!_player->m_mailsLoaded) - _player->_LoadMail(); - if( _player->unReadMails > 0 ) { data << uint32(0); // float @@ -957,41 +950,36 @@ void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sende { pReceiver->AddNewMailDeliverTime(deliver_time); - if (pReceiver->IsMailsLoaded()) + Mail *m = new Mail; + m->messageID = mailId; + m->mailTemplateId = GetMailTemplateId(); + m->subject = GetSubject(); + m->itemTextId = GetBodyId(); + m->money = GetMoney(); + m->COD = GetCOD(); + + for(MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) { - Mail *m = new Mail; - m->messageID = mailId; - m->mailTemplateId = GetMailTemplateId(); - m->subject = GetSubject(); - m->itemTextId = GetBodyId(); - m->money = GetMoney(); - m->COD = GetCOD(); - - for(MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) - { - Item* item = mailItemIter->second; - m->AddItem(item->GetGUIDLow(), item->GetEntry()); - } + Item* item = mailItemIter->second; + m->AddItem(item->GetGUIDLow(), item->GetEntry()); + } - m->messageType = sender.GetMailMessageType(); - m->stationery = sender.GetStationery(); - m->sender = sender.GetSenderId(); - m->receiver = receiver.GetPlayerGUIDLow(); - m->expire_time = expire_time; - m->deliver_time = deliver_time; - m->checked = checked; - m->state = MAIL_STATE_UNCHANGED; + m->messageType = sender.GetMailMessageType(); + m->stationery = sender.GetStationery(); + m->sender = sender.GetSenderId(); + m->receiver = receiver.GetPlayerGUIDLow(); + m->expire_time = expire_time; + m->deliver_time = deliver_time; + m->checked = checked; + m->state = MAIL_STATE_UNCHANGED; - pReceiver->AddMail(m); // to insert new mail to beginning of maillist + pReceiver->AddMail(m); // to insert new mail to beginning of maillist - if (!m_items.empty()) - { - for(MailItemMap::iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) - pReceiver->AddMItem(mailItemIter->second); - } + if (!m_items.empty()) + { + for(MailItemMap::iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) + pReceiver->AddMItem(mailItemIter->second); } - else if (!m_items.empty()) - deleteIncludedItems(); } else if (!m_items.empty()) deleteIncludedItems(); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 213168c8462..428bea4f148 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -4810,7 +4810,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) Player *pl = 0; if (serverUp) pl = GetPlayer((uint64)m->receiver); - if (pl && pl->m_mailsLoaded) + if (pl) { //this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail //his in mailbox and he has already listed his mails ) delete m; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f2d48252479..5ed43ea457c 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -412,7 +412,6 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa rest_type=REST_TYPE_NO; ////////////////////Rest System///////////////////// - m_mailsLoaded = false; m_mailsUpdated = false; unReadMails = 0; m_nextMailDelivereTime = 0; @@ -14891,8 +14890,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // apply original stats mods before spell loading or item equipment that call before equip _RemoveStatsMods() - //mails are loaded only when needed ;-) - when player in game click on mailbox. - //_LoadMail(); + // Mail + _LoadMail(); _LoadAuras(holder->GetResult(PLAYER_LOGIN_QUERY_LOADAURAS), time_diff); _LoadGlyphAuras(); @@ -15514,7 +15513,6 @@ void Player::_LoadMail() } while( result->NextRow() ); delete result; } - m_mailsLoaded = true; } void Player::LoadPet() @@ -16333,9 +16331,6 @@ void Player::_SaveInventory() void Player::_SaveMail() { - if (!m_mailsLoaded) - return; - for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) { Mail *m = (*itr); diff --git a/src/game/Player.h b/src/game/Player.h index 7b3d09e3b51..edeb2bd69c1 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1455,7 +1455,6 @@ class MANGOS_DLL_SPEC Player : public Unit static void Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair); static void SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint32 zone,uint64 guid); - bool m_mailsLoaded; bool m_mailsUpdated; void SendPetTameFailure(PetTameFailureReason reason); @@ -1506,7 +1505,6 @@ class MANGOS_DLL_SPEC Player : public Unit void SendNewMail(); void UpdateNextMailTimeAndUnreads(); void AddNewMailDeliverTime(time_t deliver_time); - bool IsMailsLoaded() const { return m_mailsLoaded; } void RemoveMail(uint32 id); From 6df6a375c1d21aa8ef3a905eb67e4d835b6d7e16 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Fri, 18 Dec 2009 02:48:16 +0300 Subject: [PATCH 31/46] Chat fix. --- src/game/ChatHandler.cpp | 132 ++++++++++++++++++++------------------- src/game/Guild.cpp | 2 +- src/game/WorldSession.h | 1 + 3 files changed, 71 insertions(+), 64 deletions(-) diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index d043af46f0e..f4c7ef8071c 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -73,7 +73,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) return; } - //sLog.outDebug("CHAT: packet received. type %u, lang %u", type, lang ); + sLog.outDebug("CHAT: packet received. type %u, lang %u", type, lang ); // prevent talking at unknown language (cheating) LanguageDesc const* langDesc = GetLanguageDescByID(lang); @@ -87,7 +87,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) // also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language) Unit::AuraList const& langAuras = _player->GetAurasByType(SPELL_AURA_COMPREHEND_LANGUAGE); bool foundAura = false; - for(Unit::AuraList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i) + for(Unit::AuraList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i) { if((*i)->GetModifier()->m_miscvalue == int32(lang)) { @@ -149,7 +149,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) if (!_player->CanSpeak()) { std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); - SendNotification(GetMangosString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str()); + SendNotification(GetMangosString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); return; } @@ -163,7 +163,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) case CHAT_MSG_EMOTE: case CHAT_MSG_YELL: { - std::string msg = ""; + std::string msg; recv_data >> msg; if(msg.empty()) @@ -200,9 +200,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) if(!normalizePlayerName(to)) { - WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1)); - data<GetSession()->GetSecurity() : SEC_PLAYER; if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers())) { - WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1)); - data<GetTeam(); if( sidea != sideb ) { - WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1)); - data<Whisper(msg, lang,player->GetGUID()); + GetPlayer()->Whisper(msg, lang, player->GetGUID()); } break; case CHAT_MSG_PARTY: + case CHAT_MSG_PARTY_LEADER: { - std::string msg = ""; + std::string msg; recv_data >> msg; if(msg.empty()) @@ -252,18 +247,24 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) // if player is in battleground, he cannot say to battleground members by /p Group *group = GetPlayer()->GetOriginalGroup(); - // so if player hasn't OriginalGroup and his player->GetGroup() is BG raid, then return - if( !group && (!(group = GetPlayer()->GetGroup()) || group->isBGGroup()) ) + if(!group) + { + group = _player->GetGroup(); + if(!group || group->isBGGroup()) + return; + } + + if((type == CHAT_MSG_PARTY_LEADER) && !group->IsLeader(_player->GetGUID())) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_PARTY, lang, NULL, 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID())); - } - break; + } break; + case CHAT_MSG_GUILD: { - std::string msg = ""; + std::string msg; recv_data >> msg; if(msg.empty()) @@ -279,17 +280,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) break; if (GetPlayer()->GetGuildId()) - { - Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId()); - if (guild) + if (Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId())) guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); - } + } break; - break; - } case CHAT_MSG_OFFICER: { - std::string msg = ""; + std::string msg; recv_data >> msg; if(msg.empty()) @@ -305,16 +302,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) break; if (GetPlayer()->GetGuildId()) - { - Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId()); - if (guild) + if (Guild *guild = sObjectMgr.GetGuildById(GetPlayer()->GetGuildId())) guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); - } - break; - } + } break; + case CHAT_MSG_RAID: { - std::string msg=""; + std::string msg; recv_data >> msg; if(msg.empty()) @@ -331,17 +325,20 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) // if player is in battleground, he cannot say to battleground members by /ra Group *group = GetPlayer()->GetOriginalGroup(); - // so if player hasn't OriginalGroup and his player->GetGroup() is BG raid or his group isn't raid, then return - if ((!group && !(group = GetPlayer()->GetGroup())) || group->isBGGroup() || !group->isRaidGroup()) - return; + if(!group) + { + group = GetPlayer()->GetGroup(); + if(!group || group->isBGGroup() || !group->isRaidGroup()) + return; + } WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_RAID_LEADER: { - std::string msg=""; + std::string msg; recv_data >> msg; if(msg.empty()) @@ -358,16 +355,21 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) // if player is in battleground, he cannot say to battleground members by /ra Group *group = GetPlayer()->GetOriginalGroup(); - if ((!group && !(group = GetPlayer()->GetGroup())) || group->isBGGroup() || !group->isRaidGroup()) - return; + if(!group) + { + group = GetPlayer()->GetGroup(); + if(!group || group->isBGGroup() || !group->isRaidGroup() || !group->IsLeader(_player->GetGUID())) + return; + } WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; + case CHAT_MSG_RAID_WARNING: { - std::string msg=""; + std::string msg; recv_data >> msg; if (!processChatmessageFurtherAfterSecurityChecks(msg, lang)) @@ -382,13 +384,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) WorldPacket data; //in battleground, raid warning is sent only to players in battleground - code is ok - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, "", 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_BATTLEGROUND: { - std::string msg=""; + std::string msg; recv_data >> msg; if (!processChatmessageFurtherAfterSecurityChecks(msg, lang)) @@ -397,19 +399,19 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) if(msg.empty()) break; - //battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() + // battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() Group *group = GetPlayer()->GetGroup(); if(!group || !group->isBGGroup()) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_BATTLEGROUND_LEADER: { - std::string msg=""; + std::string msg; recv_data >> msg; if (!processChatmessageFurtherAfterSecurityChecks(msg, lang)) @@ -418,21 +420,20 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) if(msg.empty()) break; - //battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() + // battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() Group *group = GetPlayer()->GetGroup(); if(!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID())) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(),NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_CHANNEL: { - std::string channel = "", msg = ""; + std::string channel, msg; recv_data >> channel; - recv_data >> msg; if (!processChatmessageFurtherAfterSecurityChecks(msg, lang)) @@ -442,10 +443,8 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) break; if(ChannelMgr* cMgr = channelMgr(_player->GetTeam())) - { - if(Channel *chn = cMgr->GetChannel(channel,_player)) - chn->Say(_player->GetGUID(),msg.c_str(),lang); - } + if(Channel *chn = cMgr->GetChannel(channel, _player)) + chn->Say(_player->GetGUID(), msg.c_str(), lang); } break; case CHAT_MSG_AFK: @@ -542,7 +541,7 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data ) if (!GetPlayer()->CanSpeak()) { std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); - SendNotification(GetMangosString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str()); + SendNotification(GetMangosString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); return; } @@ -581,16 +580,16 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data ) MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); MaNGOS::LocalizedPacketDo emote_do(emote_builder); - MaNGOS::PlayerDistWorker > emote_worker(GetPlayer(),sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),emote_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(emote_worker); + MaNGOS::PlayerDistWorker > emote_worker(GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); + TypeContainerVisitor>, WorldTypeMapContainer> message(emote_worker); CellLock cell_lock(cell, p); cell_lock->Visit(cell_lock, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); //Send scripted event call - if (unit && unit->GetTypeId()==TYPEID_UNIT && ((Creature*)unit)->AI()) - ((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(),text_emote); + if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI()) + ((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(), text_emote); } void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data ) @@ -607,6 +606,13 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data ) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetGUID(), GetPlayer()->GetName(),NULL); + ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetGUID(), GetPlayer()->GetName(), NULL); player->GetSession()->SendPacket(&data); } + +void WorldSession::SendPlayerNotFoundNotice(std::string name) +{ + WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, name.size()+1); + data << name; + SendPacket(&data); +} diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 93a459db7e3..027d5227694 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -572,7 +572,7 @@ void Guild::BroadcastToGuild(WorldSession *session, const std::string& msg, uint void Guild::BroadcastToOfficers(WorldSession *session, const std::string& msg, uint32 language) { - if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(),GR_RIGHT_OFFCHATSPEAK)) + if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(), GR_RIGHT_OFFCHATSPEAK)) { for(MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 7f8528ba438..f2064ca84cb 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -561,6 +561,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleQuestPushResult(WorldPacket& recvPacket); bool processChatmessageFurtherAfterSecurityChecks(std::string&, uint32); + void SendPlayerNotFoundNotice(std::string name); void HandleMessagechatOpcode(WorldPacket& recvPacket); void HandleTextEmoteOpcode(WorldPacket& recvPacket); void HandleChatIgnoredOpcode(WorldPacket& recvPacket); From 46654a2b782bed10330d497906029a6278cd8cc1 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Fri, 18 Dec 2009 02:48:47 +0300 Subject: [PATCH 32/46] Response enum fix. --- src/game/SharedDefines.h | 73 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index d3ccd7f81b6..bfb9e1c2766 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2520,42 +2520,43 @@ enum ResponseCodes CHAR_CREATE_CHARACTER_SWAP_FACTION = 0x42, CHAR_CREATE_CHARACTER_RACE_ONLY = 0x43, CHAR_CREATE_CHARACTER_GOLD_LIMIT = 0x44, - - CHAR_DELETE_IN_PROGRESS = 0x45, - CHAR_DELETE_SUCCESS = 0x46, - CHAR_DELETE_FAILED = 0x47, - CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x48, - CHAR_DELETE_FAILED_GUILD_LEADER = 0x49, - CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x4A, - - CHAR_LOGIN_IN_PROGRESS = 0x4B, - CHAR_LOGIN_SUCCESS = 0x4C, - CHAR_LOGIN_NO_WORLD = 0x4D, - CHAR_LOGIN_DUPLICATE_CHARACTER = 0x4E, - CHAR_LOGIN_NO_INSTANCES = 0x4F, - CHAR_LOGIN_FAILED = 0x50, - CHAR_LOGIN_DISABLED = 0x51, - CHAR_LOGIN_NO_CHARACTER = 0x52, - CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x53, - CHAR_LOGIN_LOCKED_BY_BILLING = 0x54, - - CHAR_NAME_SUCCESS = 0x55, - CHAR_NAME_FAILURE = 0x56, - CHAR_NAME_NO_NAME = 0x57, - CHAR_NAME_TOO_SHORT = 0x58, - CHAR_NAME_TOO_LONG = 0x59, - CHAR_NAME_INVALID_CHARACTER = 0x5A, - CHAR_NAME_MIXED_LANGUAGES = 0x5B, - CHAR_NAME_PROFANE = 0x5C, - CHAR_NAME_RESERVED = 0x5D, - CHAR_NAME_INVALID_APOSTROPHE = 0x5E, - CHAR_NAME_MULTIPLE_APOSTROPHES = 0x5F, - CHAR_NAME_THREE_CONSECUTIVE = 0x60, - CHAR_NAME_INVALID_SPACE = 0x61, - CHAR_NAME_CONSECUTIVE_SPACES = 0x62, - CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x63, - CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x64, - CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x65 + CHAR_CREATE_FORCE_LOGIN = 0x45, + + CHAR_DELETE_IN_PROGRESS = 0x46, + CHAR_DELETE_SUCCESS = 0x47, + CHAR_DELETE_FAILED = 0x48, + CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x49, + CHAR_DELETE_FAILED_GUILD_LEADER = 0x4A, + CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x4B, + + CHAR_LOGIN_IN_PROGRESS = 0x4C, + CHAR_LOGIN_SUCCESS = 0x4D, + CHAR_LOGIN_NO_WORLD = 0x4E, + CHAR_LOGIN_DUPLICATE_CHARACTER = 0x4F, + CHAR_LOGIN_NO_INSTANCES = 0x50, + CHAR_LOGIN_FAILED = 0x51, + CHAR_LOGIN_DISABLED = 0x52, + CHAR_LOGIN_NO_CHARACTER = 0x53, + CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x54, + CHAR_LOGIN_LOCKED_BY_BILLING = 0x55, + + CHAR_NAME_SUCCESS = 0x56, + CHAR_NAME_FAILURE = 0x57, + CHAR_NAME_NO_NAME = 0x58, + CHAR_NAME_TOO_SHORT = 0x59, + CHAR_NAME_TOO_LONG = 0x5A, + CHAR_NAME_INVALID_CHARACTER = 0x5B, + CHAR_NAME_MIXED_LANGUAGES = 0x5C, + CHAR_NAME_PROFANE = 0x5D, + CHAR_NAME_RESERVED = 0x5E, + CHAR_NAME_INVALID_APOSTROPHE = 0x5F, + CHAR_NAME_MULTIPLE_APOSTROPHES = 0x60, + CHAR_NAME_THREE_CONSECUTIVE = 0x61, + CHAR_NAME_INVALID_SPACE = 0x62, + CHAR_NAME_CONSECUTIVE_SPACES = 0x63, + CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x64, + CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x65, + CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x66 }; /// Ban function modes From af9fc17d4761dfd2b6d95cb9230495c0c5885a9e Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 19 Dec 2009 21:04:03 +0300 Subject: [PATCH 33/46] Don't send account data times twice. --- src/game/Opcodes.h | 4 ++-- src/game/World.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index f766fe43fdf..f9ec92cedfb 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1225,7 +1225,7 @@ enum Opcodes CMSG_QUERY_VEHICLE_STATUS = 0x4A4, // not found UMSG_UNKNOWN_1189 = 0x4A5, // not found, old SMSG_PET_GUIDS SMSG_UNKNOWN_1190 = 0x4A6, // smsg unk, "You can't do that yet" - SMSG_UNKNOWN_1191 = 0x4A7, // smsg guid+uint32 (vehicle) + SMSG_UNKNOWN_1191 = 0x4A7, // smsg guid+uint32 (vehicle) EVENT_PLAYER_GAINS_VEHICLE_DATA/EVENT_PLAYER_LOSES_VEHICLE_DATA CMSG_UNKNOWN_1192 = 0x4A8, // cmsg uint64 CMSG_EJECT_PASSENGER = 0x4A9, // cmsg uint64 SMSG_PET_GUIDS = 0x4AA, // shifted+5 @@ -1263,7 +1263,7 @@ enum Opcodes UMSG_UNKNOWN_1226 = 0x4CA, // not found 3.2 UMSG_UNKNOWN_1227 = 0x4CB, // not found 3.2 UMSG_UNKNOWN_1228 = 0x4CC, // not found 3.2 - SMSG_UNKNOWN_1229 = 0x4CD, // SMSG, any opcode? + SMSG_UNKNOWN_1229 = 0x4CD, // SMSG, handles any opcode SMSG_UNKNOWN_1230 = 0x4CE, // SMSG, movement related CMSG_UNKNOWN_1231_ACK = 0x4CF, // movement related SMSG_UNKNOWN_1232 = 0x4D0, // SMSG, movement related diff --git a/src/game/World.cpp b/src/game/World.cpp index 156ca563a8f..36d53bd3c91 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -245,8 +245,6 @@ World::AddSession_ (WorldSession* s) pkt << uint32(getConfig(CONFIG_CLIENTCACHE_VERSION)); s->SendPacket(&pkt); - s->SendAccountDataTimes(GLOBAL_CACHE_MASK); - s->SendTutorialsData(); UpdateMaxSessionCounters (); From 1f8a27e1d58330d4b951378123fa8c737631e702 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sun, 20 Dec 2009 06:11:51 +0300 Subject: [PATCH 34/46] Fixed some structs. --- src/game/Chat.cpp | 6 +++--- src/game/DBCEnums.h | 12 ++++++------ src/game/DBCStructure.h | 10 +++++----- src/game/Player.cpp | 2 +- src/game/SharedDefines.h | 15 ++++++++------- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index f510fc0e4b9..4d2d315a485 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1721,7 +1721,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin case CHAT_MSG_MONSTER_EMOTE: case CHAT_MSG_RAID_BOSS_WHISPER: case CHAT_MSG_RAID_BOSS_EMOTE: - case CHAT_MSG_BN: + case CHAT_MSG_BATTLENET: { *data << uint64(speaker->GetGUID()); *data << uint32(0); // 2.1.0 @@ -1740,7 +1740,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin return; } default: - if (type != CHAT_MSG_REPLY && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) + if (type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) target_guid = 0; // only for CHAT_MSG_WHISPER_INFORM used original value target_guid break; } @@ -1757,7 +1757,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin *data << uint64(target_guid); *data << uint32(messageLength); *data << message; - if(session != 0 && type != CHAT_MSG_REPLY && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) + if(session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) *data << uint8(session->GetPlayer()->chatTag()); else *data << uint8(0); diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index a5d4cf181d3..e458fb02160 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -285,13 +285,13 @@ enum FactionMasks // if none flags set then non-aggressive creature }; -enum MapTypes +enum MapTypes // Lua_IsInInstance { - MAP_COMMON = 0, - MAP_INSTANCE = 1, - MAP_RAID = 2, - MAP_BATTLEGROUND = 3, - MAP_ARENA = 4 + MAP_COMMON = 0, // none + MAP_INSTANCE = 1, // party + MAP_RAID = 2, // raid + MAP_BATTLEGROUND = 3, // pvp + MAP_ARENA = 4 // arena }; enum AbilytyLearnType diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index ec3e92ce962..5356a995c00 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1077,7 +1077,7 @@ struct MapEntry uint32 MapID; // 0 //char* internalname; // 1 unused uint32 map_type; // 2 - //uint32 unk_330; // 3 + //uint32 unk_330; // 3 some kind of flags (0x100 - CAN_CHANGE_PLAYER_DIFFICULTY) // 4 0 or 1 for battlegrounds (not arenas) char* name[16]; // 5-20 // 21 name flags, unused @@ -1086,13 +1086,13 @@ struct MapEntry // 39 intro text flags //char* allianceIntro[16]; // 40-55 text for PvP Zones // 56 intro text flags - uint32 multimap_id; // 57 - // 58 + uint32 multimap_id; // 57 index in LoadingScreens.dbc + // 58 BattlefieldMapIconScale int32 entrance_map; // 59 map_id of entrance map float entrance_x; // 60 entrance x coordinate (if exist single entry) float entrance_y; // 61 entrance y coordinate (if exist single entry) - // 62 -1, 0 and 720 - uint32 addon; // 63 (0-original maps,1-tbc addon) + // 62 time of day override + uint32 addon; // 63 expansion // 64 some kind of time? //uint32 maxPlayers; // 65 max players diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5ed43ea457c..431ed123b01 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16962,7 +16962,7 @@ void Player::Whisper(const std::string& text, uint32 language,uint64 receiver) if (language != LANG_ADDON) { data.Initialize(SMSG_MESSAGECHAT, 200); - rPlayer->BuildPlayerChat(&data, CHAT_MSG_REPLY, text, language); + rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, text, language); GetSession()->SendPacket(&data); } } diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index bfb9e1c2766..a35898ae326 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2317,8 +2317,8 @@ enum ChatMsg CHAT_MSG_OFFICER = 0x05, CHAT_MSG_YELL = 0x06, CHAT_MSG_WHISPER = 0x07, - CHAT_MSG_WHISPER_INFORM = 0x08, // WHISPER_FOREIGN? - CHAT_MSG_REPLY = 0x09, // WHISPER_INFORM? + CHAT_MSG_WHISPER_FOREIGN = 0x08, + CHAT_MSG_WHISPER_INFORM = 0x09, CHAT_MSG_EMOTE = 0x0A, CHAT_MSG_TEXT_EMOTE = 0x0B, CHAT_MSG_MONSTER_SAY = 0x0C, @@ -2350,19 +2350,20 @@ enum ChatMsg CHAT_MSG_BG_SYSTEM_HORDE = 0x26, CHAT_MSG_RAID_LEADER = 0x27, CHAT_MSG_RAID_WARNING = 0x28, - CHAT_MSG_RAID_BOSS_WHISPER = 0x29, - CHAT_MSG_RAID_BOSS_EMOTE = 0x2A, + CHAT_MSG_RAID_BOSS_EMOTE = 0x29, + CHAT_MSG_RAID_BOSS_WHISPER = 0x2A, CHAT_MSG_FILTERED = 0x2B, CHAT_MSG_BATTLEGROUND = 0x2C, CHAT_MSG_BATTLEGROUND_LEADER = 0x2D, CHAT_MSG_RESTRICTED = 0x2E, - CHAT_MSG_BN = 0x2F, + CHAT_MSG_BATTLENET = 0x2F, CHAT_MSG_ACHIEVEMENT = 0x30, CHAT_MSG_GUILD_ACHIEVEMENT = 0x31, - CHAT_MSG_PARTY_LEADER = 0x32 // guessed + CHAT_MSG_ARENA_POINTS = 0x32, + CHAT_MSG_PARTY_LEADER = 0x33 }; -#define MAX_CHAT_MSG_TYPE 0x33 +#define MAX_CHAT_MSG_TYPE 0x34 enum ChatLinkColors { From 7ace9d99d5a03af7bdedf6e2056d1e9a177a13ad Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Mon, 21 Dec 2009 17:05:54 +0300 Subject: [PATCH 35/46] More enum/struct fixes. --- src/game/DBCStructure.h | 14 +++++++------- src/game/Opcodes.h | 28 ++++++++++++++-------------- src/game/SpellAuraDefines.h | 12 +++++++++++- src/game/SpellAuras.cpp | 12 +++++++++++- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 5356a995c00..bad244e6c6d 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -568,11 +568,11 @@ struct BattlemasterListEntry int32 mapid[8]; // 1-8 mapid uint32 type; // 9 (3 - BG, 4 - arena) uint32 maxplayersperteam; // 10 - //uint32 unk1; // 11 (0 or 1) + //uint32 canJoinAsGroup; // 11 (0 or 1) char* name[16]; // 12-27 // 28 string flag, unused - // 29 unused - //uint32 unk2; // 30 new 3.1 + //uint32 maxGroupSize // 29 maxGroupSize? + //uint32 HolidayWorldStateId; // 30 new 3.1 }; #define MAX_OUTFIT_ITEMS 24 @@ -1077,8 +1077,8 @@ struct MapEntry uint32 MapID; // 0 //char* internalname; // 1 unused uint32 map_type; // 2 - //uint32 unk_330; // 3 some kind of flags (0x100 - CAN_CHANGE_PLAYER_DIFFICULTY) - // 4 0 or 1 for battlegrounds (not arenas) + //uint32 mapFlags; // 3 some kind of flags (0x100 - CAN_CHANGE_PLAYER_DIFFICULTY) + //uint32 isPvP; // 4 0 or 1 for battlegrounds (not arenas) char* name[16]; // 5-20 // 21 name flags, unused uint32 linked_zone; // 22 common zone for instance and continent map @@ -1087,11 +1087,11 @@ struct MapEntry //char* allianceIntro[16]; // 40-55 text for PvP Zones // 56 intro text flags uint32 multimap_id; // 57 index in LoadingScreens.dbc - // 58 BattlefieldMapIconScale + //float BattlefieldMapIconScale; // 58 BattlefieldMapIconScale int32 entrance_map; // 59 map_id of entrance map float entrance_x; // 60 entrance x coordinate (if exist single entry) float entrance_y; // 61 entrance y coordinate (if exist single entry) - // 62 time of day override + //uint32 timeOfDayOverride; // 62 time of day override uint32 addon; // 63 expansion // 64 some kind of time? //uint32 maxPlayers; // 65 max players diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index f9ec92cedfb..2320ac851cf 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -402,7 +402,7 @@ enum Opcodes CMSG_DUEL_CANCELLED = 0x16D, SMSG_MOUNTRESULT = 0x16E, SMSG_DISMOUNTRESULT = 0x16F, - SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x170, + SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x170, // ERR_REMOVE_FROM_PVP_QUEUE_* events CMSG_MOUNTSPECIAL_ANIM = 0x171, SMSG_MOUNTSPECIAL_ANIM = 0x172, SMSG_PET_TAME_FAILURE = 0x173, @@ -1236,16 +1236,16 @@ enum Opcodes UMSG_UNKNOWN_1199 = 0x4AF, // not found UMSG_UNKNOWN_1200 = 0x4B0, // not found UMSG_UNKNOWN_1201 = 0x4B1, // not found - SMSG_UNKNOWN_1202 = 0x4B2, // refund something + SMSG_UNKNOWN_1202 = 0x4B2, // refund item info CMSG_ITEM_REFUND_INFO_REQUEST = 0x4B3, // refund request? CMSG_UNKNOWN_1204 = 0x4B4, // lua: ContainerRefundItemPurchase - SMSG_UNKNOWN_1205 = 0x4B5, // refund something + SMSG_UNKNOWN_1205 = 0x4B5, // refund item result CMSG_CORPSE_MAP_POSITION_QUERY = 0x4B6, // CMSG, uint32 CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x4B7, // SMSG, 3*float+float CMSG_LFG_SET_ROLES_2 = 0x4B8, // CMSG, empty, lua: SetLFGRoles UMSG_UNKNOWN_1209 = 0x4B9, // not found CMSG_UNKNOWN_1210 = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp - SMSG_UNKNOWN_1211 = 0x4BB, // SMSG, calendar related + SMSG_UNKNOWN_1211 = 0x4BB, // SMSG, calendar related EVENT_CALENDAR_ACTION_PENDING SMSG_EQUIPMENT_SET_LIST = 0x4BC, // SMSG, equipment manager list? CMSG_EQUIPMENT_SET_SAVE = 0x4BD, // CMSG, lua: SaveEquipmentSet CMSG_UNKNOWN_1214 = 0x4BE, // CMSG, missle? @@ -1257,7 +1257,7 @@ enum Opcodes UMSG_UNKNOWN_1220 = 0x4C4, // not found 3.2 UMSG_UNKNOWN_1221 = 0x4C5, // not found 3.2 UMSG_UNKNOWN_1222 = 0x4C6, // not found 3.2 - SMSG_UNKNOWN_1223 = 0x4C7, // uint64, arena pet? 3.2 + SMSG_UNKNOWN_1223 = 0x4C7, // uint64, EVENT_ARENA_OPPONENT_UPDATE SMSG_UNKNOWN_1224 = 0x4C8, // uint32 "Can't modify arena team while queued or in a match." 3.2 UMSG_UNKNOWN_1225 = 0x4C9, // not found 3.2 UMSG_UNKNOWN_1226 = 0x4CA, // not found 3.2 @@ -1274,23 +1274,23 @@ enum Opcodes CMSG_EQUIPMENT_SET_USE = 0x4D5, // CMSG, lua: UseEquipmentSet SMSG_EQUIPMENT_SET_USE_RESULT = 0x4D6, // SMSG, UseEquipmentSetResult? UMSG_UNKNOWN_1239 = 0x4D7, // not found 3.2 - SMSG_UNKNOWN_1240 = 0x4D8, // SMSG, uint64, string + SMSG_UNKNOWN_1240 = 0x4D8, // SMSG, uint64, string, doing nothing CMSG_CHAR_FACTION_CHANGE = 0x4D9, // lua: CreateCharacter (PFC client response) SMSG_CHAR_FACTION_CHANGE = 0x4DA, // response to 1241 (PFC server response) UMSG_UNKNOWN_1243 = 0x4DB, // not found 3.2 UMSG_UNKNOWN_1244 = 0x4DC, // not found 3.2 UMSG_UNKNOWN_1245 = 0x4DD, // not found 3.2 - SMSG_UNKNOWN_1246 = 0x4DE, // uint32, BattlefieldMgrEntryInvite + SMSG_UNKNOWN_1246 = 0x4DE, // uint32, EVENT_BATTLEFIELD_MGR_ENTRY_INVITE CMSG_UNKNOWN_1247 = 0x4DF, // lua: BattlefieldMgrEntryInviteResponse - SMSG_UNKNOWN_1248 = 0x4E0, // uint32, uint8, uint8 - SMSG_UNKNOWN_1249 = 0x4E1, // uint32 BattlefieldMgrQueueInvite + SMSG_UNKNOWN_1248 = 0x4E0, // uint32, uint8, uint8 EVENT_BATTLEFIELD_MGR_ENTERED + SMSG_UNKNOWN_1249 = 0x4E1, // uint32 EVENT_BATTLEFIELD_MGR_QUEUE_INVITE CMSG_UNKNOWN_1250 = 0x4E2, // lua: BattlefieldMgrQueueInviteResponse CMSG_UNKNOWN_1251 = 0x4E3, // lua: BattlefieldMgrQueueRequest - SMSG_UNKNOWN_1252 = 0x4E4, // uint32, uint8 queue full/can't join - SMSG_UNKNOWN_1253 = 0x4E5, // uint32 wintergrasp is full, you'll be ejected soon - SMSG_UNKNOWN_1254 = 0x4E6, // uint32, uint32, uint8 + SMSG_UNKNOWN_1252 = 0x4E4, // uint32, uint8 EVENT_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE + SMSG_UNKNOWN_1253 = 0x4E5, // uint32 EVENT_BATTLEFIELD_MGR_EJECT_PENDING + SMSG_UNKNOWN_1254 = 0x4E6, // uint32, uint32, uint8 EVENT_BATTLEFIELD_MGR_EJECTED CMSG_UNKNOWN_1255 = 0x4E7, // lua: BattlefieldMgrExitRequest - SMSG_UNKNOWN_1256 = 0x4E8, // uint32, uint32 + SMSG_UNKNOWN_1256 = 0x4E8, // uint32, uint32 EVENT_BATTLEFIELD_MGR_STATE_CHANGE UMSG_UNKNOWN_1257 = 0x4E9, // not found 3.2 UMSG_UNKNOWN_1258 = 0x4EA, // not found 3.2 MSG_SET_RAID_DIFFICULTY = 0x4EB, // lua: SetRaidDifficulty @@ -1308,7 +1308,7 @@ enum Opcodes SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F7, CMSG_UNKNOWN_1272 = 0x4F8, // called from lua: CreateCharacter, paid race change UMSG_UNKNOWN_1273 = 0x4F9, // not found 10554 - SMSG_UNKNOWN_1274 = 0x4FA, // uint8 + SMSG_UNKNOWN_1274 = 0x4FA, // uint8 EVENT_TALENTS_INVOLUNTARILY_RESET UMSG_UNKNOWN_1275 = 0x4FB, // not found 10554 SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10554 SMSG_UNKNOWN_1277 = 0x4FD, // loot related? diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 3407999e637..0f5bb64373e 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -349,7 +349,17 @@ enum AuraType SPELL_AURA_304 = 304, SPELL_AURA_MOD_MINIMUM_SPEED = 305, SPELL_AURA_306 = 306, - TOTAL_AURAS = 307 + SPELL_AURA_307 = 307, + SPELL_AURA_308 = 308, + SPELL_AURA_309 = 309, + SPELL_AURA_310 = 310, + SPELL_AURA_311 = 311, + SPELL_AURA_312 = 312, + SPELL_AURA_313 = 313, + SPELL_AURA_314 = 314, + SPELL_AURA_315 = 315, + SPELL_AURA_316 = 316, + TOTAL_AURAS = 317 }; enum AreaAuraType diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 337340650cc..e31a280203a 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -356,7 +356,17 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNULL, //303 17 spells &Aura::HandleNULL, //304 2 spells (alcohol effect?) &Aura::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED - &Aura::HandleNULL //306 1 spell + &Aura::HandleNULL, //306 1 spell + &Aura::HandleNULL, //307 absorb healing? + &Aura::HandleNULL, //308 new aura for hunter traps + &Aura::HandleNULL, //309 absorb healing? + &Aura::HandleNULL, //310 pet avoidance passive? + &Aura::HandleNULL, //311 0 spells in 3.3 + &Aura::HandleNULL, //312 0 spells in 3.3 + &Aura::HandleNULL, //313 0 spells in 3.3 + &Aura::HandleNULL, //314 1 test spell (reduce duration of silince/magic) + &Aura::HandleNULL, //315 underwater walking + &Aura::HandleNULL //316 makes haste affect HOT/DOT ticks }; static AuraType const frozenAuraTypes[] = { SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_NONE }; From 19f6897049336403a189edae50eb58b7bb61ea06 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Tue, 22 Dec 2009 05:12:40 +0300 Subject: [PATCH 36/46] Fixed/updated some enums/packets. --- src/game/GMTicketHandler.cpp | 12 +-- src/game/Item.h | 172 ++++++++++++++++++----------------- src/game/Map.cpp | 3 - src/game/Player.cpp | 51 ++++++----- src/game/Player.h | 10 +- src/game/QueryHandler.cpp | 13 ++- src/game/QuestDef.h | 23 ++--- src/game/World.h | 2 + src/game/WorldSession.h | 1 + 9 files changed, 153 insertions(+), 134 deletions(-) diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index a2868ad62da..4807baa786e 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -45,10 +45,7 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text) void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ ) { - WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); - data << (uint32)time(NULL); - data << (uint32)0; - SendPacket( &data ); + SendQueryTimeResponse(); GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()); if(ticket) @@ -105,12 +102,9 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) sTicketMgr.Create(_player->GetGUIDLow(), ticketText.c_str()); - WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); - data << (uint32)time(NULL); - data << (uint32)0; - SendPacket( &data ); + SendQueryTimeResponse(); - data.Initialize( SMSG_GMTICKET_CREATE, 4 ); + WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating) SendPacket( &data ); DEBUG_LOG("update the ticket"); diff --git a/src/game/Item.h b/src/game/Item.h index 59aa86f6d9a..5e4a7792723 100644 --- a/src/game/Item.h +++ b/src/game/Item.h @@ -39,89 +39,95 @@ struct ItemSetEffect enum InventoryChangeFailure { EQUIP_ERR_OK = 0, - EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, - EQUIP_ERR_ERR_CANT_EQUIP_SKILL = 2, - EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT = 3, - EQUIP_ERR_BAG_FULL = 4, - EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG = 5, - EQUIP_ERR_CANT_TRADE_EQUIP_BAGS = 6, - EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE = 7, - EQUIP_ERR_NO_REQUIRED_PROFICIENCY = 8, - EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE = 9, - EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM = 10, - EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM2 = 11, - EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE2 = 12, - EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED = 13, - EQUIP_ERR_CANT_DUAL_WIELD = 14, - EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG = 15, - EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 = 16, - EQUIP_ERR_CANT_CARRY_MORE_OF_THIS = 17, - EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE3 = 18, - EQUIP_ERR_ITEM_CANT_STACK = 19, - EQUIP_ERR_ITEM_CANT_BE_EQUIPPED = 20, - EQUIP_ERR_ITEMS_CANT_BE_SWAPPED = 21, - EQUIP_ERR_SLOT_IS_EMPTY = 22, - EQUIP_ERR_ITEM_NOT_FOUND = 23, - EQUIP_ERR_CANT_DROP_SOULBOUND = 24, - EQUIP_ERR_OUT_OF_RANGE = 25, - EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT = 26, - EQUIP_ERR_COULDNT_SPLIT_ITEMS = 27, - EQUIP_ERR_MISSING_REAGENT = 28, - EQUIP_ERR_NOT_ENOUGH_MONEY = 29, - EQUIP_ERR_NOT_A_BAG = 30, - EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS = 31, - EQUIP_ERR_DONT_OWN_THAT_ITEM = 32, - EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER = 33, - EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT = 34, - EQUIP_ERR_TOO_FAR_AWAY_FROM_BANK = 35, - EQUIP_ERR_ITEM_LOCKED = 36, - EQUIP_ERR_YOU_ARE_STUNNED = 37, - EQUIP_ERR_YOU_ARE_DEAD = 38, - EQUIP_ERR_CANT_DO_RIGHT_NOW = 39, - EQUIP_ERR_INT_BAG_ERROR = 40, - EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER2 = 41, - EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH = 42, - EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED = 43, - EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED = 44, - EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED = 45, - EQUIP_ERR_BOUND_CANT_BE_WRAPPED = 46, - EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED = 47, - EQUIP_ERR_BAGS_CANT_BE_WRAPPED = 48, - EQUIP_ERR_ALREADY_LOOTED = 49, - EQUIP_ERR_INVENTORY_FULL = 50, - EQUIP_ERR_BANK_FULL = 51, - EQUIP_ERR_ITEM_IS_CURRENTLY_SOLD_OUT = 52, - EQUIP_ERR_BAG_FULL3 = 53, - EQUIP_ERR_ITEM_NOT_FOUND2 = 54, - EQUIP_ERR_ITEM_CANT_STACK2 = 55, - EQUIP_ERR_BAG_FULL4 = 56, - EQUIP_ERR_ITEM_SOLD_OUT = 57, - EQUIP_ERR_OBJECT_IS_BUSY = 58, - EQUIP_ERR_NONE = 59, - EQUIP_ERR_NOT_IN_COMBAT = 60, - EQUIP_ERR_NOT_WHILE_DISARMED = 61, - EQUIP_ERR_BAG_FULL6 = 62, - EQUIP_ERR_CANT_EQUIP_RANK = 63, - EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, - EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, - EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, - EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE = 67, - EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, - EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, - EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, - EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, - EQUIP_ERR_MAIL_BOUND_ITEM = 72, - EQUIP_ERR_NO_SPLIT_WHILE_PROSPECTING = 73, - EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, - EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, - EQUIP_ERR_TOO_MUCH_GOLD = 77, - EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, - EQUIP_ERR_CANNOT_TRADE_THAT = 79, - EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80, - // no output = 81, - EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82, - // no output = 83, - // crash client = 84, + EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, // ERR_CANT_EQUIP_LEVEL_I + EQUIP_ERR_CANT_EQUIP_SKILL = 2, // ERR_CANT_EQUIP_SKILL + EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT = 3, // ERR_WRONG_SLOT + EQUIP_ERR_BAG_FULL = 4, // ERR_BAG_FULL + EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG = 5, // ERR_BAG_IN_BAG + EQUIP_ERR_CANT_TRADE_EQUIP_BAGS = 6, // ERR_TRADE_EQUIPPED_BAG + EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE = 7, // ERR_AMMO_ONLY + EQUIP_ERR_NO_REQUIRED_PROFICIENCY = 8, // ERR_PROFICIENCY_NEEDED + EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE = 9, // ERR_NO_SLOT_AVAILABLE + EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM = 10, // ERR_CANT_EQUIP_EVER + EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM2 = 11, // ERR_CANT_EQUIP_EVER + EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE2 = 12, // ERR_NO_SLOT_AVAILABLE + EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED = 13, // ERR_2HANDED_EQUIPPED + EQUIP_ERR_CANT_DUAL_WIELD = 14, // ERR_2HSKILLNOTFOUND + EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG = 15, // ERR_WRONG_BAG_TYPE + EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 = 16, // ERR_WRONG_BAG_TYPE + EQUIP_ERR_CANT_CARRY_MORE_OF_THIS = 17, // ERR_ITEM_MAX_COUNT + EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE3 = 18, // ERR_NO_SLOT_AVAILABLE + EQUIP_ERR_ITEM_CANT_STACK = 19, // ERR_CANT_STACK + EQUIP_ERR_ITEM_CANT_BE_EQUIPPED = 20, // ERR_NOT_EQUIPPABLE + EQUIP_ERR_ITEMS_CANT_BE_SWAPPED = 21, // ERR_CANT_SWAP + EQUIP_ERR_SLOT_IS_EMPTY = 22, // ERR_SLOT_EMPTY + EQUIP_ERR_ITEM_NOT_FOUND = 23, // ERR_ITEM_NOT_FOUND + EQUIP_ERR_CANT_DROP_SOULBOUND = 24, // ERR_DROP_BOUND_ITEM + EQUIP_ERR_OUT_OF_RANGE = 25, // ERR_OUT_OF_RANGE + EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT = 26, // ERR_TOO_FEW_TO_SPLIT + EQUIP_ERR_COULDNT_SPLIT_ITEMS = 27, // ERR_SPLIT_FAILED + EQUIP_ERR_MISSING_REAGENT = 28, // ERR_SPELL_FAILED_REAGENTS_GENERIC + EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // ERR_NOT_ENOUGH_MONEY + EQUIP_ERR_NOT_A_BAG = 30, // ERR_NOT_A_BAG + EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS = 31, // ERR_DESTROY_NONEMPTY_BAG + EQUIP_ERR_DONT_OWN_THAT_ITEM = 32, // ERR_NOT_OWNER + EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER = 33, // ERR_ONLY_ONE_QUIVER + EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT = 34, // ERR_NO_BANK_SLOT + EQUIP_ERR_TOO_FAR_AWAY_FROM_BANK = 35, // ERR_NO_BANK_HERE + EQUIP_ERR_ITEM_LOCKED = 36, // ERR_ITEM_LOCKED + EQUIP_ERR_YOU_ARE_STUNNED = 37, // ERR_GENERIC_STUNNED + EQUIP_ERR_YOU_ARE_DEAD = 38, // ERR_PLAYER_DEAD + EQUIP_ERR_CANT_DO_RIGHT_NOW = 39, // ERR_CLIENT_LOCKED_OUT + EQUIP_ERR_INT_BAG_ERROR = 40, // ERR_INTERNAL_BAG_ERROR + EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER2 = 41, // ERR_ONLY_ONE_BOLT + EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH = 42, // ERR_ONLY_ONE_AMMO + EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED = 43, // ERR_CANT_WRAP_STACKABLE + EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED = 44, // ERR_CANT_WRAP_EQUIPPED + EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED = 45, // ERR_CANT_WRAP_WRAPPED + EQUIP_ERR_BOUND_CANT_BE_WRAPPED = 46, // ERR_CANT_WRAP_BOUND + EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED = 47, // ERR_CANT_WRAP_UNIQUE + EQUIP_ERR_BAGS_CANT_BE_WRAPPED = 48, // ERR_CANT_WRAP_BAGS + EQUIP_ERR_ALREADY_LOOTED = 49, // ERR_LOOT_GONE + EQUIP_ERR_INVENTORY_FULL = 50, // ERR_INV_FULL + EQUIP_ERR_BANK_FULL = 51, // ERR_BAG_FULL + EQUIP_ERR_ITEM_IS_CURRENTLY_SOLD_OUT = 52, // ERR_VENDOR_SOLD_OUT + EQUIP_ERR_BAG_FULL3 = 53, // ERR_BAG_FULL + EQUIP_ERR_ITEM_NOT_FOUND2 = 54, // ERR_ITEM_NOT_FOUND + EQUIP_ERR_ITEM_CANT_STACK2 = 55, // ERR_CANT_STACK + EQUIP_ERR_BAG_FULL4 = 56, // ERR_BAG_FULL + EQUIP_ERR_ITEM_SOLD_OUT = 57, // ERR_VENDOR_SOLD_OUT + EQUIP_ERR_OBJECT_IS_BUSY = 58, // ERR_OBJECT_IS_BUSY + EQUIP_ERR_NONE = 59, // ERR_CANT_BE_DISENCHANTED + EQUIP_ERR_NOT_IN_COMBAT = 60, // ERR_NOT_IN_COMBAT + EQUIP_ERR_NOT_WHILE_DISARMED = 61, // ERR_NOT_WHILE_DISARMED + EQUIP_ERR_BAG_FULL6 = 62, // ERR_BAG_FULL + EQUIP_ERR_CANT_EQUIP_RANK = 63, // ERR_CANT_EQUIP_RANK + EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // ERR_CANT_EQUIP_REPUTATION + EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // ERR_TOO_MANY_SPECIAL_BAGS + EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // ERR_LOOT_CANT_LOOT_THAT_NOW + EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE = 67, // ERR_ITEM_UNIQUE_EQUIPPABLE + EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // ERR_VENDOR_MISSING_TURNINS + EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // ERR_NOT_ENOUGH_HONOR_POINTS + EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // ERR_NOT_ENOUGH_ARENA_POINTS + EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // ERR_ITEM_MAX_COUNT_SOCKETED + EQUIP_ERR_MAIL_BOUND_ITEM = 72, // ERR_MAIL_BOUND_ITEM + EQUIP_ERR_NO_SPLIT_WHILE_PROSPECTING = 73, // ERR_INTERNAL_BAG_ERROR + EQUIP_ERR_BAG_FULL7 = 74, // ERR_BAG_FULL + EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED + EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED + EQUIP_ERR_TOO_MUCH_GOLD = 77, // ERR_TOO_MUCH_GOLD + EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // ERR_NOT_DURING_ARENA_MATCH + EQUIP_ERR_CANNOT_TRADE_THAT = 79, // ERR_TRADE_BOUND_ITEM + EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80, // ERR_CANT_EQUIP_RATING + EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81, // EQUIP_ERR_OK, EVENT_AUTOEQUIP_BIND_CONFIRM + EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82, // ERR_NOT_SAME_ACCOUNT + EQUIP_ERR_OK2 = 83, // EQUIP_ERR_OK + EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, + EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, + EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, + EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, + EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, + EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89 }; enum BuyFailure diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 090f394d667..0e5cc17fa38 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -40,8 +40,6 @@ #include "InstanceSaveMgr.h" #include "VMapFactory.h" -#define DEFAULT_GRID_EXPIRY 300 -#define MAX_GRID_LOAD_TIME 50 #define MAX_CREATURE_ATTACK_RADIUS (45.0f * sWorld.getRate(RATE_CREATURE_AGGRO)) GridState* si_GridStates[MAX_GRID_STATE]; @@ -381,7 +379,6 @@ Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player) if (player) { - player->SendDelayResponse(MAX_GRID_LOAD_TIME); DEBUG_LOG("Player %s enter cell[%u,%u] triggers of loading grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), i_id); } else diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c6d7b986922..d2b45855818 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4174,15 +4174,6 @@ void Player::BuildPlayerRepop() SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); } -void Player::SendDelayResponse(const uint32 ml_seconds) -{ - //FIXME: is this delay time arg really need? 50msec by default in code - WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); - data << (uint32)time(NULL); - data << (uint32)0; - GetSession()->SendPacket( &data ); -} - void Player::ResurrectPlayer(float restore_percent, bool applySickness) { WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // remove spirit healer position @@ -10261,7 +10252,7 @@ uint8 Player::CanUseItem( Item *pItem, bool not_loading ) const return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; if (GetSkillValue( pProto->RequiredSkill ) < pProto->RequiredSkillRank) - return EQUIP_ERR_ERR_CANT_EQUIP_SKILL; + return EQUIP_ERR_CANT_EQUIP_SKILL; } if (pProto->RequiredSpell != 0 && !HasSpell(pProto->RequiredSpell)) @@ -10322,7 +10313,7 @@ uint8 Player::CanUseAmmo( uint32 item ) const if( GetSkillValue( pProto->RequiredSkill ) == 0 ) return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; else if( GetSkillValue( pProto->RequiredSkill ) < pProto->RequiredSkillRank ) - return EQUIP_ERR_ERR_CANT_EQUIP_SKILL; + return EQUIP_ERR_CANT_EQUIP_SKILL; } if( pProto->RequiredSpell != 0 && !HasSpell( pProto->RequiredSpell ) ) return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; @@ -11601,24 +11592,38 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del ) void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 ) { sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); - WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : (msg == EQUIP_ERR_OK ? 1 : 18))); + WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, 1+8+8+1); data << uint8(msg); if (msg != EQUIP_ERR_OK) { data << uint64(pItem ? pItem->GetGUID() : 0); data << uint64(pItem2 ? pItem2->GetGUID() : 0); - data << uint8(0); // not 0 there... + data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 - if (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I) + switch(msg) { - uint32 level = 0; - - if (pItem) - if (ItemPrototype const* proto = pItem->GetProto()) - level = proto->RequiredLevel; - - data << uint32(level); // new 2.4.0 + case EQUIP_ERR_CANT_EQUIP_LEVEL_I: + case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: + { + ItemPrototype const* proto = pItem ? pItem->GetProto() : NULL; + data << uint32(proto ? proto->RequiredLevel : 0); + } break; + case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: // no idea about this one... + { + data << uint64(0); + data << uint32(0); + data << uint64(0); + } break; + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS: + { + ItemPrototype const* proto = pItem ? pItem->GetProto() : NULL; + data << uint32(proto ? proto->ItemLimitCategory : 0); + } break; + default: + break; } } GetSession()->SendPacket(&data); @@ -18013,7 +18018,7 @@ void Player::UpdateHomebindTime(uint32 time) // hide reminder WorldPacket data(SMSG_RAID_GROUP_ONLY, 4+4); data << uint32(0); - data << uint32(0); + data << uint32(ERR_RAID_GROUP_NONE); // error used only when timer = 0 GetSession()->SendPacket(&data); } // instance is valid, reset homebind timer @@ -18036,7 +18041,7 @@ void Player::UpdateHomebindTime(uint32 time) // send message to player WorldPacket data(SMSG_RAID_GROUP_ONLY, 4+4); data << uint32(m_HomebindTimer); - data << uint32(1); + data << uint32(ERR_RAID_GROUP_NONE); // error used only when timer = 0 GetSession()->SendPacket(&data); sLog.outDebug("PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(),GetGUIDLow()); } diff --git a/src/game/Player.h b/src/game/Player.h index 29af642741e..ac398375d5c 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -394,6 +394,15 @@ struct LookingForGroup uint8 roles; }; +enum RaidGroupError +{ + ERR_RAID_GROUP_NONE = 0, + ERR_RAID_GROUP_LOWLEVEL = 1, + ERR_RAID_GROUP_ONLY = 2, + ERR_RAID_GROUP_FULL = 3, + ERR_RAID_GROUP_REQUIREMENTS_UNMATCH = 4 +}; + enum PlayerMovementType { MOVE_ROOT = 1, @@ -1805,7 +1814,6 @@ class MANGOS_DLL_SPEC Player : public Unit void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const; void DestroyForPlayer( Player *target, bool anim = false ) const; - void SendDelayResponse(const uint32); void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); // notifiers diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 7170420e2d1..a7dbb6b7d25 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -140,10 +140,7 @@ void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data ) void WorldSession::HandleQueryTimeOpcode( WorldPacket & /*recv_data*/ ) { - WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); - data << (uint32)time(NULL); - data << (uint32)0; - SendPacket( &data ); + SendQueryTimeResponse(); } /// Only _static_ data send in this packet !!! @@ -556,3 +553,11 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data.hexlike(); SendPacket(&data); } + +void WorldSession::SendQueryTimeResponse() +{ + WorldPacket data(SMSG_QUERY_TIME_RESPONSE, 4+4); + data << uint32(time(NULL)); + data << uint32(sWorld.GetNextDailyQuestsResetTime() - time(NULL)); + SendPacket(&data); +} diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index 54e95a497ff..e7310c655dd 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -59,17 +59,18 @@ enum QuestFailedReasons enum QuestShareMessages { - QUEST_PARTY_MSG_SHARING_QUEST = 0, - QUEST_PARTY_MSG_CANT_TAKE_QUEST = 1, - QUEST_PARTY_MSG_ACCEPT_QUEST = 2, - QUEST_PARTY_MSG_DECLINE_QUEST = 3, - QUEST_PARTY_MSG_BUSY = 4, - QUEST_PARTY_MSG_LOG_FULL = 5, - QUEST_PARTY_MSG_HAVE_QUEST = 6, - QUEST_PARTY_MSG_FINISH_QUEST = 7, - QUEST_PARTY_MSG_CANT_BE_SHARED_TODAY = 8, - QUEST_PARTY_MSG_SHARING_TIMER_EXPIRED = 9, - QUEST_PARTY_MSG_NOT_IN_PARTY = 10 + QUEST_PARTY_MSG_SHARING_QUEST = 0, // ERR_QUEST_PUSH_SUCCESS_S + QUEST_PARTY_MSG_CANT_TAKE_QUEST = 1, // ERR_QUEST_PUSH_INVALID_S + QUEST_PARTY_MSG_ACCEPT_QUEST = 2, // ERR_QUEST_PUSH_ACCEPTED_S + QUEST_PARTY_MSG_DECLINE_QUEST = 3, // ERR_QUEST_PUSH_DECLINED_S + QUEST_PARTY_MSG_BUSY = 4, // ERR_QUEST_PUSH_BUSY_S + QUEST_PARTY_MSG_LOG_FULL = 5, // ERR_QUEST_PUSH_LOG_FULL_S + QUEST_PARTY_MSG_HAVE_QUEST = 6, // ERR_QUEST_PUSH_ONQUEST_S + QUEST_PARTY_MSG_FINISH_QUEST = 7, // ERR_QUEST_PUSH_ALREADY_DONE_S + QUEST_PARTY_MSG_CANT_BE_SHARED_TODAY = 8, // ERR_QUEST_PUSH_NOT_DAILY_S + QUEST_PARTY_MSG_SHARING_TIMER_EXPIRED = 9, // ERR_QUEST_PUSH_TIMER_EXPIRED_S + QUEST_PARTY_MSG_NOT_IN_PARTY = 10, // ERR_QUEST_PUSH_NOT_IN_PARTY_S + QUESY_PARTY_MSG_DIFFERENT_SERVER_DAILY = 11 // ERR_QUEST_PUSH_DIFFERENT_SERVER_DAILY_S }; enum __QuestTradeSkill diff --git a/src/game/World.h b/src/game/World.h index 74c897ad6c6..c9e50272ae8 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -434,6 +434,8 @@ class World time_t const& GetGameTime() const { return m_gameTime; } /// Uptime (in secs) uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); } + /// Next daily quests reset time + time_t GetNextDailyQuestsResetTime() const { return m_NextDailyQuestReset; } /// Get the maximum skill level a player can reach uint16 GetConfigMaxSkillValue() const diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index f2064ca84cb..194f3b3cf60 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -133,6 +133,7 @@ class MANGOS_DLL_SPEC WorldSession void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res); void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2,3); void SendSetPhaseShift(uint32 phaseShift); + void SendQueryTimeResponse(); AccountTypes GetSecurity() const { return _security; } uint32 GetAccountId() const { return _accountId; } From 14fd1b847978d6952b77f61b64508afb72557d9e Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 24 Dec 2009 16:04:28 +0300 Subject: [PATCH 37/46] Updated opcodes enum. --- src/game/LFGHandler.cpp | 20 ++++----- src/game/Opcodes.cpp | 84 ++++++++++++++++++------------------ src/game/Opcodes.h | 96 ++++++++++++++++++++--------------------- 3 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index 46055f8dd36..3e595f4ec3e 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -258,44 +258,44 @@ void WorldSession::HandleLookingForGroup(WorldPacket& recv_data) void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type) { - uint32 number = 0; + /*uint32 number = 0; WorldPacket data(MSG_LOOKING_FOR_GROUP); data << uint32(type); // type data << uint32(entry); // entry from LFGDungeons.dbc data << uint8(0); - /*if(uint8) + if(uint8) { uint32 count1; for(count1) { uint64; // player guid } - }*/ + } data << uint32(0); // count2 data << uint32(0); - /*for(count2) + for(count2) { uint64 // not player guid uint32 flags; if(flags & 0x2) { - string + data << uint8(0); // string } if(flags & 0x10) { - uint8 + data << uint8(0); } if(flags & 0x20) { - for(3) + for(int i = 0; i < 3; ++i) { - uint8 + data << uint8(0); } } - }*/ + } size_t count3_pos = data.wpos(); data << uint32(0); // count3 @@ -386,7 +386,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type) data.put(count3_pos, number); // fill count placeholder - SendPacket(&data); + SendPacket(&data);*/ } void WorldSession::HandleSetLfgOpcode( WorldPacket & recv_data ) diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 50b072b95a9..4a394dd2aa9 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -537,8 +537,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x1FC*/ { "SMSG_ENVIRONMENTALDAMAGELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x1FD*/ { "CMSG_PLAYER_DIFFICULTY_CHANGE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x1FE*/ { "SMSG_RWHOIS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x1FF*/ { "MSG_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLookingForGroup }, - /*0x200*/ { "CMSG_SET_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleSetLfgOpcode }, + /*0x1FF*/ { "SMSG_LFG_COMPLETION_REWARD", STATUS_LOGGEDIN, &WorldSession::Handle_ServerSide }, + /*0x200*/ { "SMSG_LFG_ERROR", STATUS_LOGGEDIN, &WorldSession::Handle_ServerSide }, /*0x201*/ { "CMSG_UNLEARN_SPELL", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x202*/ { "CMSG_UNLEARN_SKILL", STATUS_LOGGEDIN, &WorldSession::HandleUnlearnSkillOpcode }, /*0x203*/ { "SMSG_REMOVED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -685,7 +685,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleBuybackItem }, /*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_UNHANDLED,&WorldSession::Handle_NULL }, - /*0x293*/ { "SMSG_MEETINGSTONE_LEAVE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x293*/ { "SMSG_LFG_OFFER_CONTINUE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x294*/ { "CMSG_MEETINGSTONE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x295*/ { "SMSG_MEETINGSTONE_SETQUEUE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x296*/ { "CMSG_MEETINGSTONE_INFO", STATUS_LOGGEDIN, &WorldSession::HandleMeetingStoneInfo }, @@ -725,7 +725,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x2B8*/ { "SMSG_AREA_TRIGGER_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x2B9*/ { "CMSG_SHOWING_HELM", STATUS_LOGGEDIN, &WorldSession::HandleShowingHelmOpcode }, /*0x2BA*/ { "CMSG_SHOWING_CLOAK", STATUS_LOGGEDIN, &WorldSession::HandleShowingCloakOpcode }, - /*0x2BB*/ { "SMSG_MEETINGSTONE_JOINFAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x2BB*/ { "SMSG_LFG_ROLE_CHECK_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x2BC*/ { "SMSG_PLAYER_SKINNED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x2BD*/ { "SMSG_DURABILITY_DAMAGE_DEATH", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x2BE*/ { "CMSG_SET_EXPLORATION", STATUS_NEVER, &WorldSession::Handle_NULL }, @@ -890,25 +890,25 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x35D*/ { "CMSG_LFG_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearAutoJoinOpcode }, /*0x35E*/ { "CMSG_SEARCH_LFG_JOIN", STATUS_LOGGEDIN, &WorldSession::HandleLfmSetAutoFillOpcode }, /*0x35F*/ { "CMSG_SEARCH_LFG_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleLfmClearAutoFillOpcode }, - /*0x360*/ { "SMSG_ACCEPT_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x361*/ { "SMSG_DECLINE_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x360*/ { "SMSG_UPDATE_LFG_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x361*/ { "SMSG_LFG_PROPOSAL_DECLINED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x362*/ { "CMSG_LFG_PROPOSAL_RESULT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL }, - /*0x363*/ { "SMSG_CLEAR_LOOKING_FOR_GROUP", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x364*/ { "SMSG_CLEAR_LOOKING_FOR_MORE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x365*/ { "SMSG_SET_LOOKING_FOR_MORE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x363*/ { "SMSG_LFG_ROLE_CHECK", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x364*/ { "SMSG_LFG_ROLE_CHECK_FAILED_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x365*/ { "SMSG_LFG_QUEUE_STATUS_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x366*/ { "CMSG_SET_LFG_COMMENT", STATUS_LOGGEDIN, &WorldSession::HandleSetLfgCommentOpcode }, - /*0x367*/ { "SMSG_LFG_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x368*/ { "SMSG_LFG_OTHER_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x369*/ { "SMSG_LFG_AUTOJOIN_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x367*/ { "SMSG_LFG_LFG_PROPOSAL_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x368*/ { "SMSG_LFG_LFG_PROPOSAL_INFO2", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x369*/ { "SMSG_LFG_UPDATE_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x36A*/ { "CMSG_LFG_SET_ROLES", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x36B*/ { "CMSG_LFG_SET_NEEDS", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x36C*/ { "CMSG_LFG_SET_BOOT_VOTE", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x36D*/ { "SMSG_LFG_UPDATE_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x36D*/ { "SMSG_LFG_BOOT_PROPOSAL_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x36E*/ { "CMSG_LFD_PLAYER_LOCK_INFO_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x36F*/ { "SMSG_LFG_PLAYER_LOCK_INFO_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x370*/ { "CMSG_LFG_TELEPORT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x371*/ { "CMSG_LFD_PARTY_LOCK_INFO_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x372*/ { "SMSG_LFG_PENDING_MATCH_DONE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x372*/ { "SMSG_LFG_PLAYER_LOCK_INFO_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x373*/ { "SMSG_TITLE_EARNED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x374*/ { "CMSG_SET_TITLE", STATUS_LOGGEDIN, &WorldSession::HandleSetTitleOpcode }, /*0x375*/ { "CMSG_CANCEL_MOUNT_AURA", STATUS_LOGGEDIN, &WorldSession::HandleCancelMountAuraOpcode }, @@ -1216,8 +1216,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4A5*/ { "UMSG_UNKNOWN_1189", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4A6*/ { "SMSG_UNKNOWN_1190", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4A7*/ { "SMSG_UNKNOWN_1191", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4A6*/ { "SMSG_BATTLEGROUND_INFO_THROTTLED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4A7*/ { "SMSG_PLAYER_VEHICLE_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4A8*/ { "CMSG_UNKNOWN_1192", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4A9*/ { "CMSG_EJECT_PASSENGER", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4AA*/ { "SMSG_PET_GUIDS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -1228,16 +1228,16 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4AF*/ { "UMSG_UNKNOWN_1199", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4B0*/ { "UMSG_UNKNOWN_1200", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4B1*/ { "UMSG_UNKNOWN_1201", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4B2*/ { "SMSG_UNKNOWN_1202", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4B3*/ { "CMSG_ITEM_REFUND_INFO_REQUEST", STATUS_LOGGEDIN, &WorldSession::HandleItemRefundInfoRequest }, - /*0x4B4*/ { "CMSG_UNKNOWN_1204", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4B5*/ { "SMSG_UNKNOWN_1205", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4B2*/ { "SMSG_ITEM_REFUND_INFO_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4B3*/ { "CMSG_ITEM_REFUND_INFO", STATUS_LOGGEDIN, &WorldSession::HandleItemRefundInfoRequest }, + /*0x4B4*/ { "CMSG_ITEM_REFUND", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4B5*/ { "SMSG_ITEM_REFUND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4B6*/ { "CMSG_CORPSE_MAP_POSITION_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCorpseMapPositionQuery }, /*0x4B7*/ { "CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4B8*/ { "CMSG_LFG_SET_ROLES_2", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetRoles }, /*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 }, + /*0x4BA*/ { "CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4BB*/ { "SMSG_CALENDAR_ACTION_PENDING", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*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 }, @@ -1249,8 +1249,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4C4*/ { "UMSG_UNKNOWN_1220", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4C5*/ { "UMSG_UNKNOWN_1221", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4C6*/ { "UMSG_UNKNOWN_1222", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4C7*/ { "SMSG_UNKNOWN_1223", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4C8*/ { "SMSG_UNKNOWN_1224", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4C7*/ { "SMSG_ARENA_OPPONENT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4C8*/ { "SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4C9*/ { "UMSG_UNKNOWN_1225", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4CA*/ { "UMSG_UNKNOWN_1226", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4CB*/ { "UMSG_UNKNOWN_1227", STATUS_NEVER, &WorldSession::Handle_NULL }, @@ -1272,38 +1272,38 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4DB*/ { "UMSG_UNKNOWN_1243", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4DC*/ { "UMSG_UNKNOWN_1244", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4DD*/ { "UMSG_UNKNOWN_1245", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4DE*/ { "SMSG_UNKNOWN_1246", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4DF*/ { "CMSG_UNKNOWN_1247", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4E0*/ { "SMSG_UNKNOWN_1248", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4E1*/ { "SMSG_UNKNOWN_1249", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4E2*/ { "CMSG_UNKNOWN_1250", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4E3*/ { "CMSG_UNKNOWN_1251", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4E4*/ { "SMSG_UNKNOWN_1252", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4E5*/ { "SMSG_UNKNOWN_1253", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4E6*/ { "SMSG_UNKNOWN_1254", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4E7*/ { "CMSG_UNKNOWN_1255", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4E8*/ { "SMSG_UNKNOWN_1256", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4DE*/ { "SMSG_BATTLEFIELD_MGR_ENTRY_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONS", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4E0*/ { "SMSG_BATTLEFIELD_MGR_ENTERED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4E1*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4E3*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4E4*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4E5*/ { "SMSG_BATTLEFIELD_MGR_EJECT_PENDING", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4E6*/ { "SMSG_BATTLEFIELD_MGR_EJECTED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4E7*/ { "CMSG_BATTLEFIELD_MGR_EXIT_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4E8*/ { "SMSG_BATTLEFIELD_MGR_STATE_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4E9*/ { "UMSG_UNKNOWN_1257", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4EA*/ { "UMSG_UNKNOWN_1258", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4EB*/ { "MSG_SET_RAID_DIFFICULTY", STATUS_LOGGEDIN, &WorldSession::HandleSetRaidDifficultyOpcode }, /*0x4EC*/ { "UMSG_UNKNOWN_1260", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4ED*/ { "SMSG_TOGGLE_XP_GAIN", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4EE*/ { "SMSG_UNKNOWN_1262", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4EF*/ { "SMSG_UNKNOWN_1263", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4F0*/ { "CMSG_UNKNOWN_1264", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4F1*/ { "SMSG_UNKNOWN_1265", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4EE*/ { "SMSG_GMRESPONSE_DB_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4EF*/ { "SMSG_GMRESPONSE_RECEIVED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4F0*/ { "CMSG_GMRESPONSE_RESOLVE", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4F1*/ { "SMSG_GMRESPONSE_STATUS_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4F2*/ { "UMSG_UNKNOWN_1266", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4F3*/ { "UMSG_UNKNOWN_1267", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4F4*/ { "UMSG_UNKNOWN_1268", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4F5*/ { "UMSG_UNKNOWN_1269", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4F6*/ { "CMSG_WORLD_STATE_UI_TIMER_UPDATE", STATUS_LOGGEDIN, &WorldSession::HandleWorldStateUITimerUpdate }, /*0x4F7*/ { "SMSG_WORLD_STATE_UI_TIMER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4F8*/ { "CMSG_UNKNOWN_1272", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4F8*/ { "CMSG_CHAR_RACE_CHANGE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4F9*/ { "UMSG_UNKNOWN_1273", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4FA*/ { "SMSG_UNKNOWN_1274", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4FA*/ { "SMSG_TALENTS_INVOLUNTARILY_RESET", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FB*/ { "UMSG_UNKNOWN_1275", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4FC*/ { "SMSG_UNKNOWN_1276", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4FD*/ { "SMSG_UNKNOWN_1277", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4FD*/ { "SMSG_LOOT_SLOT_CHANGED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4FE*/ { "UMSG_UNKNOWN_1278", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4FF*/ { "CMSG_READY_FOR_ACCOUNT_DATA_TIMES", STATUS_AUTHED, &WorldSession::HandleReadyForAccountDataTimes }, /*0x500*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_LOGGEDIN, &WorldSession::HandleQueryQuestsCompleted }, diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 2320ac851cf..963bbf5c57d 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -545,8 +545,8 @@ enum Opcodes SMSG_ENVIRONMENTALDAMAGELOG = 0x1FC, CMSG_PLAYER_DIFFICULTY_CHANGE = 0x1FD, SMSG_RWHOIS = 0x1FE, - MSG_LOOKING_FOR_GROUP = 0x1FF, // uint32, uint8, uint32, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32,uint32} - CMSG_SET_LOOKING_FOR_GROUP = 0x200, + SMSG_LFG_COMPLETION_REWARD = 0x1FF, // uint32, uint8, uint32, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32,uint32} + SMSG_LFG_ERROR = 0x200, // uint32 (1,2,4,6;0,5,7) CMSG_UNLEARN_SPELL = 0x201, CMSG_UNLEARN_SKILL = 0x202, SMSG_REMOVED_SPELL = 0x203, @@ -693,13 +693,13 @@ enum Opcodes CMSG_BUYBACK_ITEM = 0x290, SMSG_SERVER_MESSAGE = 0x291, CMSG_SET_SAVED_INSTANCE_EXTEND = 0x292, // lua: SetSavedInstanceExtend - SMSG_MEETINGSTONE_LEAVE = 0x293, - CMSG_MEETINGSTONE_CHEAT = 0x294, - SMSG_MEETINGSTONE_SETQUEUE = 0x295, - CMSG_MEETINGSTONE_INFO = 0x296, - SMSG_MEETINGSTONE_COMPLETE = 0x297, - SMSG_MEETINGSTONE_IN_PROGRESS = 0x298, - SMSG_MEETINGSTONE_MEMBER_ADDED = 0x299, + SMSG_LFG_OFFER_CONTINUE = 0x293, + CMSG_MEETINGSTONE_CHEAT = 0x294, // not found 3.3 + SMSG_MEETINGSTONE_SETQUEUE = 0x295, // string, showed in console + CMSG_MEETINGSTONE_INFO = 0x296, // EVENT_LFG_UPDATE + SMSG_MEETINGSTONE_COMPLETE = 0x297, // EVENT_MAIL_SHOW + SMSG_MEETINGSTONE_IN_PROGRESS = 0x298, // uint32, some UPDATE_COOLDOWN events + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x299, // uint32, errors: ERR_NOT_IN_GROUP (2,51) and ERR_NOT_IN_RAID (3,39,40) CMSG_GMTICKETSYSTEM_TOGGLE = 0x29A, CMSG_CANCEL_GROWTH_AURA = 0x29B, SMSG_CANCEL_AUTO_REPEAT = 0x29C, @@ -733,7 +733,7 @@ enum Opcodes SMSG_AREA_TRIGGER_MESSAGE = 0x2B8, CMSG_SHOWING_HELM = 0x2B9, CMSG_SHOWING_CLOAK = 0x2BA, - SMSG_MEETINGSTONE_JOINFAILED = 0x2BB, + SMSG_LFG_ROLE_CHECK_RESULT = 0x2BB, SMSG_PLAYER_SKINNED = 0x2BC, SMSG_DURABILITY_DAMAGE_DEATH = 0x2BD, CMSG_SET_EXPLORATION = 0x2BE, @@ -898,25 +898,25 @@ enum Opcodes CMSG_LFG_LEAVE = 0x35D, // CMSG LeaveLFG CMSG_SEARCH_LFG_JOIN = 0x35E, // CMSG SearchLFGJoin CMSG_SEARCH_LFG_LEAVE = 0x35F, // CMSG SearchLFGLeave - SMSG_ACCEPT_LFG_MATCH = 0x360, // SMSG uint32, uint32, if(uint8) { uint32 count, for(count) { uint64} }, uint32 count2, uint32, for(count2) { uint64, uint32 flags, if(flags & 0x2) {string}, if(flags & 0x10) {for(3) uint8}, if(flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for(count3) {uint64, uint32 flags, if(flags & 0x1) {uint8, uint8, uint8, for(3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if(flags&0x2) string, if(flags&0x4) uint8, if(flags&0x8) uint64, if(flags&0x10) uint8, if(flags&0x20) uint32, if(flags&0x40) uint8, if(flags& 0x80) {uint64, uint32}} - SMSG_DECLINE_LFG_MATCH = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for(uint8) {uint32,uint8,uint8,uint8,uint8} + SMSG_UPDATE_LFG_LIST = 0x360, // SMSG uint32, uint32, if(uint8) { uint32 count, for(count) { uint64} }, uint32 count2, uint32, for(count2) { uint64, uint32 flags, if(flags & 0x2) {string}, if(flags & 0x10) {for(3) uint8}, if(flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for(count3) {uint64, uint32 flags, if(flags & 0x1) {uint8, uint8, uint8, for(3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if(flags&0x2) string, if(flags&0x4) uint8, if(flags&0x8) uint64, if(flags&0x10) uint8, if(flags&0x20) uint32, if(flags&0x40) uint8, if(flags& 0x80) {uint64, uint32}} + SMSG_LFG_PROPOSAL_DECLINED = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for(uint8) {uint32,uint8,uint8,uint8,uint8} CMSG_LFG_PROPOSAL_RESULT = 0x362, // CMSG AcceptProposal, RejectProposal - SMSG_CLEAR_LOOKING_FOR_GROUP = 0x363, // SMSG uint32, uint8, for(uint8) uint32, uint8, for(uint8) { uint64, uint8, uint32, uint8, } - SMSG_CLEAR_LOOKING_FOR_MORE = 0x364, // SMSG uint32 unk, uint32, if(unk==6) { uint8 count, for(count) uint64 } - SMSG_SET_LOOKING_FOR_MORE = 0x365, // SMSG uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 + SMSG_LFG_ROLE_CHECK = 0x363, // SMSG uint32, uint8, for(uint8) uint32, uint8, for(uint8) { uint64, uint8, uint32, uint8, } + SMSG_LFG_ROLE_CHECK_FAILED_RESULT = 0x364, // SMSG uint32 unk, uint32, if(unk==6) { uint8 count, for(count) uint64 } + SMSG_LFG_QUEUE_STATUS_UPDATE = 0x365, // SMSG uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 CMSG_SET_LFG_COMMENT = 0x366, // CMSG SetLFGComment - SMSG_LFG_TIMEDOUT = 0x367, // SMSG uint8, if(uint8) { uint8, uint8, uint8, uint8, if(uint8) for(uint8) uint32, string} - SMSG_LFG_OTHER_TIMEDOUT = 0x368, // SMSG uint8, if(uint8) { uint8, uint8, uint8, for(3) uint8, uint8, if(uint8) for(uint8) uint32, string} - SMSG_LFG_AUTOJOIN_FAILED = 0x369, // SMSG uint8 + SMSG_LFG_LFG_PROPOSAL_INFO = 0x367, // SMSG uint8, if(uint8) { uint8, uint8, uint8, uint8, if(uint8) for(uint8) uint32, string} + SMSG_LFG_LFG_PROPOSAL_INFO2 = 0x368, // SMSG uint8, if(uint8) { uint8, uint8, uint8, for(3) uint8, uint8, if(uint8) for(uint8) uint32, string} + SMSG_LFG_UPDATE_LIST = 0x369, // SMSG uint8 CMSG_LFG_SET_ROLES = 0x36A, // CMSG SetLFGRoles CMSG_LFG_SET_NEEDS = 0x36B, // CMSG SetLFGNeeds CMSG_LFG_SET_BOOT_VOTE = 0x36C, // CMSG SetLFGBootVote - SMSG_LFG_UPDATE_LFM = 0x36D, // SMSG uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 + SMSG_LFG_BOOT_PROPOSAL_UPDATE = 0x36D, // SMSG uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 CMSG_LFD_PLAYER_LOCK_INFO_REQUEST = 0x36E, // CMSG RequestLFDPlayerLockInfo SMSG_LFG_PLAYER_LOCK_INFO_RESPONSE = 0x36F, // SMSG uint8, for(uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for(uint8) {uint32,uint32, uint32}}, uint32, for(uint32) {uint32,uint32} CMSG_LFG_TELEPORT = 0x370, // CMSG LFGTeleport CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x371, // CMSG RequestLFDPartyLockInfo - SMSG_LFG_PENDING_MATCH_DONE = 0x372, // SMSG uint8, for(uint8) uint64 + SMSG_LFG_PLAYER_LOCK_INFO_UPDATE = 0x372, // SMSG uint8, for(uint8) uint64 SMSG_TITLE_EARNED = 0x373, CMSG_SET_TITLE = 0x374, CMSG_CANCEL_MOUNT_AURA = 0x375, @@ -1224,8 +1224,8 @@ enum Opcodes SMSG_SERVER_BUCK_DATA_START = 0x4A3, // not found CMSG_QUERY_VEHICLE_STATUS = 0x4A4, // not found UMSG_UNKNOWN_1189 = 0x4A5, // not found, old SMSG_PET_GUIDS - SMSG_UNKNOWN_1190 = 0x4A6, // smsg unk, "You can't do that yet" - SMSG_UNKNOWN_1191 = 0x4A7, // smsg guid+uint32 (vehicle) EVENT_PLAYER_GAINS_VEHICLE_DATA/EVENT_PLAYER_LOSES_VEHICLE_DATA + SMSG_BATTLEGROUND_INFO_THROTTLED = 0x4A6, // empty, "You can't do that yet" + SMSG_PLAYER_VEHICLE_DATA = 0x4A7, // smsg guid+uint32 (vehicle) EVENT_PLAYER_GAINS_VEHICLE_DATA/EVENT_PLAYER_LOSES_VEHICLE_DATA CMSG_UNKNOWN_1192 = 0x4A8, // cmsg uint64 CMSG_EJECT_PASSENGER = 0x4A9, // cmsg uint64 SMSG_PET_GUIDS = 0x4AA, // shifted+5 @@ -1236,16 +1236,16 @@ enum Opcodes UMSG_UNKNOWN_1199 = 0x4AF, // not found UMSG_UNKNOWN_1200 = 0x4B0, // not found UMSG_UNKNOWN_1201 = 0x4B1, // not found - SMSG_UNKNOWN_1202 = 0x4B2, // refund item info - CMSG_ITEM_REFUND_INFO_REQUEST = 0x4B3, // refund request? - CMSG_UNKNOWN_1204 = 0x4B4, // lua: ContainerRefundItemPurchase - SMSG_UNKNOWN_1205 = 0x4B5, // refund item result + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x4B2, // refund item info + CMSG_ITEM_REFUND_INFO = 0x4B3, // refund request? + CMSG_ITEM_REFUND = 0x4B4, // lua: ContainerRefundItemPurchase + SMSG_ITEM_REFUND_RESULT = 0x4B5, // refund item result CMSG_CORPSE_MAP_POSITION_QUERY = 0x4B6, // CMSG, uint32 CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x4B7, // SMSG, 3*float+float CMSG_LFG_SET_ROLES_2 = 0x4B8, // CMSG, empty, lua: SetLFGRoles UMSG_UNKNOWN_1209 = 0x4B9, // not found - CMSG_UNKNOWN_1210 = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp - SMSG_UNKNOWN_1211 = 0x4BB, // SMSG, calendar related EVENT_CALENDAR_ACTION_PENDING + CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp + SMSG_CALENDAR_ACTION_PENDING = 0x4BB, // SMSG, calendar related EVENT_CALENDAR_ACTION_PENDING SMSG_EQUIPMENT_SET_LIST = 0x4BC, // SMSG, equipment manager list? CMSG_EQUIPMENT_SET_SAVE = 0x4BD, // CMSG, lua: SaveEquipmentSet CMSG_UNKNOWN_1214 = 0x4BE, // CMSG, missle? @@ -1257,8 +1257,8 @@ enum Opcodes UMSG_UNKNOWN_1220 = 0x4C4, // not found 3.2 UMSG_UNKNOWN_1221 = 0x4C5, // not found 3.2 UMSG_UNKNOWN_1222 = 0x4C6, // not found 3.2 - SMSG_UNKNOWN_1223 = 0x4C7, // uint64, EVENT_ARENA_OPPONENT_UPDATE - SMSG_UNKNOWN_1224 = 0x4C8, // uint32 "Can't modify arena team while queued or in a match." 3.2 + SMSG_ARENA_OPPONENT_UPDATE = 0x4C7, // uint64, EVENT_ARENA_OPPONENT_UPDATE + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4C8, // uint32 "Can't modify arena team while queued or in a match." 3.2 UMSG_UNKNOWN_1225 = 0x4C9, // not found 3.2 UMSG_UNKNOWN_1226 = 0x4CA, // not found 3.2 UMSG_UNKNOWN_1227 = 0x4CB, // not found 3.2 @@ -1280,38 +1280,38 @@ enum Opcodes UMSG_UNKNOWN_1243 = 0x4DB, // not found 3.2 UMSG_UNKNOWN_1244 = 0x4DC, // not found 3.2 UMSG_UNKNOWN_1245 = 0x4DD, // not found 3.2 - SMSG_UNKNOWN_1246 = 0x4DE, // uint32, EVENT_BATTLEFIELD_MGR_ENTRY_INVITE - CMSG_UNKNOWN_1247 = 0x4DF, // lua: BattlefieldMgrEntryInviteResponse - SMSG_UNKNOWN_1248 = 0x4E0, // uint32, uint8, uint8 EVENT_BATTLEFIELD_MGR_ENTERED - SMSG_UNKNOWN_1249 = 0x4E1, // uint32 EVENT_BATTLEFIELD_MGR_QUEUE_INVITE - CMSG_UNKNOWN_1250 = 0x4E2, // lua: BattlefieldMgrQueueInviteResponse - CMSG_UNKNOWN_1251 = 0x4E3, // lua: BattlefieldMgrQueueRequest - SMSG_UNKNOWN_1252 = 0x4E4, // uint32, uint8 EVENT_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE - SMSG_UNKNOWN_1253 = 0x4E5, // uint32 EVENT_BATTLEFIELD_MGR_EJECT_PENDING - SMSG_UNKNOWN_1254 = 0x4E6, // uint32, uint32, uint8 EVENT_BATTLEFIELD_MGR_EJECTED - CMSG_UNKNOWN_1255 = 0x4E7, // lua: BattlefieldMgrExitRequest - SMSG_UNKNOWN_1256 = 0x4E8, // uint32, uint32 EVENT_BATTLEFIELD_MGR_STATE_CHANGE + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x4DE, // uint32, EVENT_BATTLEFIELD_MGR_ENTRY_INVITE + CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE = 0x4DF, // lua: BattlefieldMgrEntryInviteResponse + SMSG_BATTLEFIELD_MGR_ENTERED = 0x4E0, // uint32, uint8, uint8 EVENT_BATTLEFIELD_MGR_ENTERED + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x4E1, // uint32 EVENT_BATTLEFIELD_MGR_QUEUE_INVITE + CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE = 0x4E2, // lua: BattlefieldMgrQueueInviteResponse + CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST = 0x4E3, // lua: BattlefieldMgrQueueRequest + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x4E4, // uint32, uint8 EVENT_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x4E5, // uint32 EVENT_BATTLEFIELD_MGR_EJECT_PENDING + SMSG_BATTLEFIELD_MGR_EJECTED = 0x4E6, // uint32, uint32, uint8 EVENT_BATTLEFIELD_MGR_EJECTED + CMSG_BATTLEFIELD_MGR_EXIT_REQUEST = 0x4E7, // lua: BattlefieldMgrExitRequest + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x4E8, // uint32, uint32 EVENT_BATTLEFIELD_MGR_STATE_CHANGE UMSG_UNKNOWN_1257 = 0x4E9, // not found 3.2 UMSG_UNKNOWN_1258 = 0x4EA, // not found 3.2 MSG_SET_RAID_DIFFICULTY = 0x4EB, // lua: SetRaidDifficulty UMSG_UNKNOWN_1260 = 0x4EC, // not found 3.2 SMSG_TOGGLE_XP_GAIN = 0x4ED, // enable/disable XP gain console message - SMSG_UNKNOWN_1262 = 0x4EE, - SMSG_UNKNOWN_1263 = 0x4EF, - CMSG_UNKNOWN_1264 = 0x4F0, // lua: GMResponseResolve - SMSG_UNKNOWN_1265 = 0x4F1, + SMSG_GMRESPONSE_DB_ERROR = 0x4EE, // empty + SMSG_GMRESPONSE_RECEIVED = 0x4EF, // uint32, uint32, string[2000], string[4000][4] + CMSG_GMRESPONSE_RESOLVE = 0x4F0, // lua: GMResponseResolve + SMSG_GMRESPONSE_STATUS_UPDATE = 0x4F1, // uint8 (1 - EVENT_GMSURVEY_DISPLAY, 0 - EVENT_UPDATE_TICKET) UMSG_UNKNOWN_1266 = 0x4F2, // not found 3.2 UMSG_UNKNOWN_1267 = 0x4F3, // not found 3.2 UMSG_UNKNOWN_1268 = 0x4F4, // not found 3.2 UMSG_UNKNOWN_1269 = 0x4F5, // not found 3.2 CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F6, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F7, - CMSG_UNKNOWN_1272 = 0x4F8, // called from lua: CreateCharacter, paid race change + CMSG_CHAR_RACE_CHANGE = 0x4F8, // called from lua: CreateCharacter, paid race change UMSG_UNKNOWN_1273 = 0x4F9, // not found 10554 - SMSG_UNKNOWN_1274 = 0x4FA, // uint8 EVENT_TALENTS_INVOLUNTARILY_RESET + SMSG_TALENTS_INVOLUNTARILY_RESET = 0x4FA, // uint8 EVENT_TALENTS_INVOLUNTARILY_RESET UMSG_UNKNOWN_1275 = 0x4FB, // not found 10554 SMSG_UNKNOWN_1276 = 0x4FC, // does nothing in 10554 - SMSG_UNKNOWN_1277 = 0x4FD, // loot related? + SMSG_LOOT_SLOT_CHANGED = 0x4FD, // EVENT_LOOT_SLOT_CHANGED UMSG_UNKNOWN_1278 = 0x4FE, // not found 10596 CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x4FF, // lua: ReadyForAccountDataTimes CMSG_QUERY_QUESTS_COMPLETED = 0x500, // lua: QueryQuestsCompleted From e0ff4406f9a6034ce46807100acba4ebd8a73b69 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 24 Dec 2009 20:18:09 +0300 Subject: [PATCH 38/46] Some new gm ticket stuff. --- sql/330/3_character_ticket.sql | 2 ++ src/game/GMTicketHandler.cpp | 46 ++++++++++++++++++++++++++---- src/game/GMTicketMgr.cpp | 10 +++---- src/game/GMTicketMgr.h | 27 ++++++++++++++++-- src/game/Language.h | 2 +- src/game/Level2.cpp | 52 ++++++++++++++++++++++++++++++++-- src/game/Opcodes.cpp | 2 +- src/game/WorldSession.h | 3 ++ 8 files changed, 126 insertions(+), 18 deletions(-) create mode 100644 sql/330/3_character_ticket.sql diff --git a/sql/330/3_character_ticket.sql b/sql/330/3_character_ticket.sql new file mode 100644 index 00000000000..74445dc0393 --- /dev/null +++ b/sql/330/3_character_ticket.sql @@ -0,0 +1,2 @@ +alter table `character_ticket` + add column `response_text` text CHARSET utf8 COLLATE utf8_general_ci NULL after `ticket_text`; diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index 4807baa786e..73d3dc03433 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -43,15 +43,34 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text) SendPacket( &data ); } +void WorldSession::SendGMResponse(GMTicket *ticket) +{ + int len = strlen(ticket->GetText())+1+strlen(ticket->GetResponse())+1; + WorldPacket data(SMSG_GMRESPONSE_RECEIVED, 4+4+len+1+1+1); + data << uint32(123); + data << uint32(456); + data << ticket->GetText(); // issue text + data << ticket->GetResponse(); // response text 1 + data << uint8(0); // response text 2 + data << uint8(0); // response text 3 + data << uint8(0); // response text 4 + SendPacket(&data); +} + void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ ) { SendQueryTimeResponse(); GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()); if(ticket) - SendGMTicketGetTicket(0x06,ticket->GetText()); + { + if(ticket->HasResponse()) + SendGMResponse(ticket); + else + SendGMTicketGetTicket(0x06, ticket->GetText()); + } else - SendGMTicketGetTicket(0x0A,0); + SendGMTicketGetTicket(0x0A, 0); } void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data ) @@ -81,18 +100,19 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) uint32 map; float x, y, z; std::string ticketText = ""; + uint8 isFollowup; recv_data >> map >> x >> y >> z; // last check 2.4.3 recv_data >> ticketText; - recv_data.read_skip(); // unk1, 0 - recv_data.read_skip(); // unk2, 1 + recv_data.read_skip(); // unk1, 11 - talk to gm, 1 - report problem + recv_data >> isFollowup; // unk2, 1 - followup ticket recv_data.read_skip(); // unk3, 0 recv_data.read_skip(); // unk4, 0 sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s", map, x, y, z, ticketText.c_str()); - if(sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow())) + if(sTicketMgr.GetGMTicket(GetPlayer()->GetGUIDLow()) && !isFollowup) { WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); data << uint32(1); // 1 - You already have GM ticket @@ -100,6 +120,9 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) return; } + if(isFollowup) + sTicketMgr.Delete(_player->GetGUIDLow()); + sTicketMgr.Create(_player->GetGUIDLow(), ticketText.c_str()); SendQueryTimeResponse(); @@ -107,7 +130,6 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating) SendPacket( &data ); - DEBUG_LOG("update the ticket"); //TODO: Guard player map HashMapHolder::MapType &m = sObjectAccessor.GetPlayers(); @@ -157,3 +179,15 @@ void WorldSession::HandleGMSurveySubmit( WorldPacket & recv_data) // TODO: chart this data in some way } + +void WorldSession::HandleGMResponseResolve(WorldPacket & recv_data) +{ + // empty opcode + sLog.outDebug("WORLD: %s", LookupOpcodeName(recv_data.GetOpcode())); + + sTicketMgr.Delete(GetPlayer()->GetGUIDLow()); + + WorldPacket data(SMSG_GMRESPONSE_STATUS_UPDATE, 1); + data << uint8(0); // ask to fill out gm survey = 1 + SendPacket(&data); +} diff --git a/src/game/GMTicketMgr.cpp b/src/game/GMTicketMgr.cpp index 50e88ebf647..5f104488750 100644 --- a/src/game/GMTicketMgr.cpp +++ b/src/game/GMTicketMgr.cpp @@ -34,8 +34,8 @@ void GMTicketMgr::LoadGMTickets() m_GMTicketMap.clear(); // For reload case QueryResult *result = CharacterDatabase.Query( - // 0 1 2 - "SELECT guid, ticket_text,UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket"); + // 0 1 2 3 + "SELECT guid, ticket_text, response_text, UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket"); if( !result ) { @@ -59,7 +59,7 @@ void GMTicketMgr::LoadGMTickets() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), time_t(fields[2].GetUInt64())); + m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), fields[2].GetCppString(), time_t(fields[3].GetUInt64())); ++count; } while (result->NextRow()); @@ -73,8 +73,8 @@ void GMTicketMgr::DeleteAll() { for(GMTicketMap::const_iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr) { - if(Player* owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER))) - owner->GetSession()->SendGMTicketGetTicket(0x0A,0); + if(Player* owner = sObjectMgr.GetPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) + owner->GetSession()->SendGMTicketGetTicket(0x0A, 0); } CharacterDatabase.PExecute("DELETE FROM character_ticket"); m_GMTicketMap.clear(); diff --git a/src/game/GMTicketMgr.h b/src/game/GMTicketMgr.h index 54e4df4283c..0a472a4641f 100644 --- a/src/game/GMTicketMgr.h +++ b/src/game/GMTicketMgr.h @@ -31,7 +31,7 @@ class GMTicket { } - GMTicket(uint32 guid, const std::string& text, time_t update) : m_guid(guid), m_text(text), m_lastUpdate(update) + GMTicket(uint32 guid, const std::string& text, const std::string& responsetext, time_t update) : m_guid(guid), m_text(text), m_responseText(responsetext), m_lastUpdate(update) { } @@ -41,6 +41,11 @@ class GMTicket return m_text.c_str(); } + const char* GetResponse() const + { + return m_responseText.c_str(); + } + uint64 GetLastUpdate() const { return m_lastUpdate; @@ -56,6 +61,18 @@ class GMTicket CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", escapedString.c_str(), m_guid); } + void SetResponseText(const char* text) + { + m_responseText = text ? text : ""; + m_lastUpdate = time(NULL); + + std::string escapedString = m_responseText; + CharacterDatabase.escape_string(escapedString); + CharacterDatabase.PExecute("UPDATE character_ticket SET response_text = '%s' WHERE guid = '%u'", escapedString.c_str(), m_guid); + } + + bool HasResponse() { return !m_responseText.empty(); } + void DeleteFromDB() const { CharacterDatabase.PExecute("DELETE FROM character_ticket WHERE guid = '%u' LIMIT 1", m_guid); @@ -69,12 +86,16 @@ class GMTicket std::string escapedString = m_text; CharacterDatabase.escape_string(escapedString); - CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, escapedString.c_str()); + std::string escapedString2 = m_responseText; + CharacterDatabase.escape_string(escapedString2); + + CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text, response_text) VALUES ('%u', '%s', '%s')", m_guid, escapedString.c_str(), escapedString2.c_str()); CharacterDatabase.CommitTransaction(); } private: uint32 m_guid; std::string m_text; + std::string m_responseText; time_t m_lastUpdate; }; typedef std::map GMTicketMap; @@ -113,7 +134,7 @@ class GMTicketMgr void Create(uint32 guid, const char* text) { - GMTicket t = GMTicket(guid, text, time(NULL)); + GMTicket t = GMTicket(guid, text, "", time(NULL)); t.SaveToDB(); m_GMTicketMap[guid] = t; } diff --git a/src/game/Language.h b/src/game/Language.h index 986f28872fe..6b16d6aaf85 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -277,7 +277,7 @@ enum MangosStrings LANG_COMMAND_TICKETVIEW = 290, LANG_COMMAND_TICKETON = 291, LANG_COMMAND_TICKETOFF = 292, - LANG_COMMAND_TICKENOTEXIST = 293, + LANG_COMMAND_TICKETNOTEXIST = 293, LANG_COMMAND_ALLTICKETDELETED = 294, LANG_COMMAND_TICKETPLAYERDEL = 295, LANG_COMMAND_TICKETDEL = 296, diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 3e28e8c8526..2f38131ec18 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -2261,6 +2261,54 @@ bool ChatHandler::HandleTicketCommand(const char* args) return true; } + // ticket respond + if(strncmp(px,"respond",8) == 0) + { + char *name = strtok(NULL, " "); + + if(!name) + { + SendSysMessage(LANG_CMD_SYNTAX); + SetSentErrorMessage(true); + return false; + } + + std::string plName = name; + uint64 guid = sObjectMgr.GetPlayerGUIDByName(plName); + + if(!guid) + { + SendSysMessage(LANG_PLAYER_NOT_FOUND); + SetSentErrorMessage(true); + return false; + } + + GMTicket* ticket = sTicketMgr.GetGMTicket(GUID_LOPART(guid)); + + if(!ticket) + { + PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST, GUID_LOPART(guid)); + SetSentErrorMessage(true); + return false; + } + + char* response = strtok(NULL, ""); + + if(!response) + { + SendSysMessage(LANG_CMD_SYNTAX); + SetSentErrorMessage(true); + return false; + } + + ticket->SetResponseText(response); + + if(Player* pl = sObjectMgr.GetPlayer(guid)) + pl->GetSession()->SendGMResponse(ticket); + + return true; + } + // ticket #num int num = atoi(px); if(num > 0) @@ -2269,7 +2317,7 @@ bool ChatHandler::HandleTicketCommand(const char* args) if(!result) { - PSendSysMessage(LANG_COMMAND_TICKENOTEXIST, num); + PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST, num); SetSentErrorMessage(true); return false; } @@ -2324,7 +2372,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args) QueryResult* result = CharacterDatabase.PQuery("SELECT guid FROM character_ticket ORDER BY ticket_id ASC "_OFFSET_,num-1); if(!result) { - PSendSysMessage(LANG_COMMAND_TICKENOTEXIST, num); + PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST, num); SetSentErrorMessage(true); return false; } diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 4a394dd2aa9..9983f7859da 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1290,7 +1290,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4ED*/ { "SMSG_TOGGLE_XP_GAIN", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4EE*/ { "SMSG_GMRESPONSE_DB_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4EF*/ { "SMSG_GMRESPONSE_RECEIVED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4F0*/ { "CMSG_GMRESPONSE_RESOLVE", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4F0*/ { "CMSG_GMRESPONSE_RESOLVE", STATUS_LOGGEDIN, &WorldSession::HandleGMResponseResolve }, /*0x4F1*/ { "SMSG_GMRESPONSE_STATUS_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4F2*/ { "UMSG_UNKNOWN_1266", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4F3*/ { "UMSG_UNKNOWN_1267", STATUS_NEVER, &WorldSession::Handle_NULL }, diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 194f3b3cf60..5a936ee8a3f 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -41,6 +41,7 @@ class WorldSocket; class QueryResult; class LoginQueryHolder; class CharacterHandler; +class GMTicket; enum AccountDataType { @@ -184,6 +185,7 @@ class MANGOS_DLL_SPEC WorldSession void SendSpiritResurrect(); void SendBindPoint(Creature* npc); void SendGMTicketGetTicket(uint32 status, char const* text); + void SendGMResponse(GMTicket *ticket); void SendAttackStop(Unit const* enemy); @@ -340,6 +342,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleGMTicketUpdateTextOpcode(WorldPacket& recvPacket); void HandleGMSurveySubmit(WorldPacket& recvPacket); + void HandleGMResponseResolve(WorldPacket& recv_data); void HandleTogglePvP(WorldPacket& recvPacket); From c4b55e030c0d5c31cb1d2a96ee9049c9f4c10283 Mon Sep 17 00:00:00 2001 From: if85myh Date: Sat, 26 Dec 2009 20:45:25 +0300 Subject: [PATCH 39/46] Make code more compatible with C++ standart strict follow compilers. Signed-off-by: VladimirMangos --- src/game/ChatHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index f4c7ef8071c..bee6715ad91 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -581,7 +581,7 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data ) MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); MaNGOS::LocalizedPacketDo emote_do(emote_builder); MaNGOS::PlayerDistWorker > emote_worker(GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); - TypeContainerVisitor>, WorldTypeMapContainer> message(emote_worker); + TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); CellLock cell_lock(cell, p); cell_lock->Visit(cell_lock, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); From f0e76a2818770da0fcf404f8787eaad56ef69e39 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 30 Dec 2009 01:13:56 +0300 Subject: [PATCH 40/46] Fixed some enums. --- src/game/ChatHandler.cpp | 2 +- src/game/GMTicketHandler.cpp | 1 + src/game/Guild.h | 19 ++++++++++--------- src/game/ItemPrototype.h | 5 ++++- src/game/Opcodes.cpp | 1 + src/game/Opcodes.h | 3 ++- src/game/QuestDef.cpp | 2 +- src/game/QuestDef.h | 18 ++++++++++-------- src/game/SharedDefines.h | 2 +- 9 files changed, 31 insertions(+), 22 deletions(-) diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index bee6715ad91..31ddecdafa0 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -581,7 +581,7 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data ) MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); MaNGOS::LocalizedPacketDo emote_do(emote_builder); MaNGOS::PlayerDistWorker > emote_worker(GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); - TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); + TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); CellLock cell_lock(cell, p); cell_lock->Visit(cell_lock, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index 73d3dc03433..e4cd9cff81d 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -32,6 +32,7 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text) data << uint32(status); // standard 0x0A, 0x06 if text present if(status == 6) { + data << uint32(123); // unk data << text; // ticket text data << uint8(0x7); // ticket category data << float(0); // tickets in queue? diff --git a/src/game/Guild.h b/src/game/Guild.h index 87b1f39b204..a8dcdc02ca8 100644 --- a/src/game/Guild.h +++ b/src/game/Guild.h @@ -117,15 +117,16 @@ enum GuildEvents GE_LEADER_CHANGED = 0x07, GE_DISBANDED = 0x08, GE_TABARDCHANGE = 0x09, - GE_UNK1 = 0x0A, // string, string - GE_UNK2 = 0x0B, - GE_SIGNED_ON = 0x0C, - GE_SIGNED_OFF = 0x0D, - GE_UNK3 = 0x0E, - GE_BANKTAB_PURCHASED= 0x0F, - GE_UNK5 = 0x10, - GE_UNK6 = 0x11, // string 0000000000002710 is 1 gold - GE_UNK7 = 0x12 + GE_UNK1 = 0x0A, // string, string EVENT_GUILD_ROSTER_UPDATE + GE_UNK2 = 0x0B, // EVENT_GUILD_ROSTER_UPDATE + GE_SIGNED_ON = 0x0C, // ERR_FRIEND_ONLINE_SS + GE_SIGNED_OFF = 0x0D, // ERR_FRIEND_OFFLINE_S + GE_UNK3 = 0x0E, // EVENT_GUILDBANKBAGSLOTS_CHANGED + GE_BANKTAB_PURCHASED= 0x0F, // EVENT_GUILDBANK_UPDATE_TABS + GE_UNK5 = 0x10, // EVENT_GUILDBANK_UPDATE_TABS + GE_UNK6 = 0x11, // EVENT_GUILDBANK_UPDATE_MONEY, string 0000000000002710 is 1 gold + GE_UNK7 = 0x12, // MSG_GUILD_BANK_MONEY_WITHDRAWN + GE_UNK8 = 0x13 // EVENT_GUILDBANK_TEXT_CHANGED }; enum PetitionTurns diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index cae4fd3f5db..4175d1fe7f8 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -108,14 +108,17 @@ enum ITEM_FLAGS ITEM_FLAGS_CONJURED = 0x00000002, ITEM_FLAGS_OPENABLE = 0x00000004, ITEM_FLAGS_WRAPPED = 0x00000008, + ITEM_FLAGS_HEROIC = 0x00000008, // weird... ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability==0) ITEM_FLAGS_TOTEM = 0x00000020, // ? ITEM_FLAGS_USABLE = 0x00000040, // ? + ITEM_FLAGS_NO_EQUIP_COOLDOWN = 0x00000080, // ? ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper + ITEM_FLAGS_IGNORE_BAG_SPACE = 0x00000400, // ignore bag space at new item creation? ITEM_FLAGS_PARTY_LOOT = 0x00000800, // determines if item is party loot or not ITEM_FLAGS_REFUNDABLE = 0x00001000, // item cost can be refunded within 2 hours after purchase ITEM_FLAGS_CHARTER = 0x00002000, // arena/guild charter - ITEM_FLAGS_REFUNDABLE_2 = 0x00008000, + ITEM_FLAGS_REFUNDABLE_2 = 0x00008000, // ? ITEM_FLAGS_PROSPECTABLE = 0x00040000, ITEM_FLAGS_UNIQUE_EQUIPPED = 0x00080000, ITEM_FLAGS_USEABLE_IN_ARENA = 0x00200000, diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 9983f7859da..802e7112866 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1312,4 +1312,5 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x503*/ { "UMSG_UNKNOWN_1283", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x504*/ { "UMSG_UNKNOWN_1284", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x505*/ { "UMSG_UNKNOWN_1285", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x506*/ { "UMSG_UNKNOWN_1286", STATUS_NEVER, &WorldSession::Handle_NULL }, }; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 963bbf5c57d..91db76b5fc2 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1320,7 +1320,8 @@ enum Opcodes UMSG_UNKNOWN_1283 = 0x503, UMSG_UNKNOWN_1284 = 0x504, UMSG_UNKNOWN_1285 = 0x505, - NUM_MSG_TYPES = 0x506 + UMSG_UNKNOWN_1285 = 0x506, + NUM_MSG_TYPES = 0x507 }; /// Player state diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index b9c068f869b..17ddba48634 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -130,7 +130,7 @@ Quest::Quest(Field * questRecord) QuestStartScript = questRecord[130].GetUInt32(); QuestCompleteScript = questRecord[131].GetUInt32(); - QuestFlags |= SpecialFlags << 16; + QuestFlags |= SpecialFlags << 24; m_reqitemscount = 0; m_reqCreatureOrGOcount = 0; diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index e7310c655dd..9d324590a3a 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -126,7 +126,7 @@ enum __QuestFlags QUEST_FLAGS_EXPLORATION = 0x00000004, // Not used currently QUEST_FLAGS_SHARABLE = 0x00000008, // Can be shared: Player::CanShareQuest() //QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently - QUEST_FLAGS_EPIC = 0x00000020, // Not used currently: Unsure of content + QUEST_FLAGS_EPIC = 0x00000020, // Not used currently - 1 quest in 3.3 QUEST_FLAGS_RAID = 0x00000040, // Not used currently QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only QUEST_FLAGS_UNK2 = 0x00000100, // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs @@ -134,20 +134,22 @@ enum __QuestFlags QUEST_FLAGS_AUTO_REWARDED = 0x00000400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side. QUEST_FLAGS_TBC_RACES = 0x00000800, // Not used currently: Blood elf/Draenei starting zone quests QUEST_FLAGS_DAILY = 0x00001000, // Used to know quest is Daily one - QUEST_FLAGS_UNK3 = 0x00002000, + QUEST_FLAGS_UNK3 = 0x00002000, // activates PvP? QUEST_FLAGS_UNK4 = 0x00004000, // ? Membership Card Renewal QUEST_FLAGS_WEEKLY = 0x00008000, // Not used currently: Weekly quests + // 0x20000 - 1 quest in 3.3, 0x40000 - 1 quest in 3.3 + QUEST_FLAGS_LOW_LEVEL = 0x00080000 // quests in starting areas // Mangos flags for set SpecialFlags in DB if required but used only at server - QUEST_MANGOS_FLAGS_REPEATABLE = 0x010000, // Set by 1 in SpecialFlags from DB - QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x020000, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL) + QUEST_MANGOS_FLAGS_REPEATABLE = 0x01000000, // Set by 1 in SpecialFlags from DB + QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x02000000, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL) QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT, // Mangos flags for internal use only - QUEST_MANGOS_FLAGS_DELIVER = 0x040000, // Internal flag computed only - QUEST_MANGOS_FLAGS_SPEAKTO = 0x080000, // Internal flag computed only - QUEST_MANGOS_FLAGS_KILL_OR_CAST = 0x100000, // Internal flag computed only - QUEST_MANGOS_FLAGS_TIMED = 0x200000, // Internal flag computed only + QUEST_MANGOS_FLAGS_DELIVER = 0x04000000, // Internal flag computed only + QUEST_MANGOS_FLAGS_SPEAKTO = 0x08000000, // Internal flag computed only + QUEST_MANGOS_FLAGS_KILL_OR_CAST = 0x10000000, // Internal flag computed only + QUEST_MANGOS_FLAGS_TIMED = 0x20000000, // Internal flag computed only }; struct QuestLocale diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 23032b34d02..60f3e82cd98 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -226,7 +226,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #define SPELL_ATTR_TRADESPELL 0x00000020 // 5 trade spells, will be added by client to a sublist of profession spell #define SPELL_ATTR_PASSIVE 0x00000040 // 6 Passive spell #define SPELL_ATTR_UNK7 0x00000080 // 7 visible? -#define SPELL_ATTR_UNK8 0x00000100 // 8 +#define SPELL_ATTR_UNK8 0x00000100 // 8 hide created item in tooltip (for effect=24) #define SPELL_ATTR_UNK9 0x00000200 // 9 #define SPELL_ATTR_ON_NEXT_SWING_2 0x00000400 // 10 on next swing 2 #define SPELL_ATTR_UNK11 0x00000800 // 11 From 9a60fd80bbc32abb9c55beb9c67264492205702c Mon Sep 17 00:00:00 2001 From: Hiram Date: Fri, 1 Jan 2010 16:52:45 +0300 Subject: [PATCH 41/46] Fixed build at branch. Signed-off-by: VladimirMangos Also fix some lines related to internal quest flags mask. --- src/game/ObjectMgr.cpp | 2 +- src/game/Opcodes.h | 2 +- src/game/QuestDef.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index df01a1a718b..a42067b2875 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3345,7 +3345,7 @@ void ObjectMgr::LoadQuests() if (qinfo->QuestFlags & ~QUEST_MANGOS_FLAGS_DB_ALLOWED) { sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", - qinfo->GetQuestId(),qinfo->QuestFlags,QUEST_MANGOS_FLAGS_DB_ALLOWED >> 16); + qinfo->GetQuestId(),qinfo->QuestFlags >> 24,QUEST_MANGOS_FLAGS_DB_ALLOWED >> 24); qinfo->QuestFlags &= QUEST_MANGOS_FLAGS_DB_ALLOWED; } diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 91db76b5fc2..807fd6e282a 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1320,7 +1320,7 @@ enum Opcodes UMSG_UNKNOWN_1283 = 0x503, UMSG_UNKNOWN_1284 = 0x504, UMSG_UNKNOWN_1285 = 0x505, - UMSG_UNKNOWN_1285 = 0x506, + UMSG_UNKNOWN_1286 = 0x506, NUM_MSG_TYPES = 0x507 }; diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index 9d324590a3a..53649cf1ab6 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -138,12 +138,12 @@ enum __QuestFlags QUEST_FLAGS_UNK4 = 0x00004000, // ? Membership Card Renewal QUEST_FLAGS_WEEKLY = 0x00008000, // Not used currently: Weekly quests // 0x20000 - 1 quest in 3.3, 0x40000 - 1 quest in 3.3 - QUEST_FLAGS_LOW_LEVEL = 0x00080000 // quests in starting areas + QUEST_FLAGS_LOW_LEVEL = 0x00080000, // quests in starting areas // Mangos flags for set SpecialFlags in DB if required but used only at server QUEST_MANGOS_FLAGS_REPEATABLE = 0x01000000, // Set by 1 in SpecialFlags from DB QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x02000000, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL) - QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT, + QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT, // Mangos flags for internal use only QUEST_MANGOS_FLAGS_DELIVER = 0x04000000, // Internal flag computed only From b9712d36d2c285be14cf7bb9bd5cc1f4c9c58cf3 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 9 Jan 2010 03:36:27 +0300 Subject: [PATCH 42/46] Use PVPDificulty.dbc for bg/arena bracket selection (levels and difficulty) --- src/game/BattleGround.cpp | 7 ++- src/game/BattleGround.h | 25 +---------- src/game/BattleGroundHandler.cpp | 48 +++++++++++++------- src/game/BattleGroundMgr.cpp | 75 ++++++++++++++++++++------------ src/game/BattleGroundMgr.h | 5 ++- src/game/DBCEnums.h | 9 ++++ src/game/DBCStores.cpp | 33 +++++++++++++- src/game/DBCStores.h | 4 ++ src/game/DBCStructure.h | 13 ++++++ src/game/DBCfmt.h | 1 + src/game/Group.cpp | 12 +++-- src/game/Group.h | 2 +- src/game/MapInstanced.cpp | 9 ++-- src/game/Player.cpp | 19 +++----- src/game/Player.h | 3 -- 15 files changed, 167 insertions(+), 98 deletions(-) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 95a9ccbfe5d..241e4bfbde0 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -1129,7 +1129,6 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac // this method is called when no players remains in battleground void BattleGround::Reset() { - SetBracketId(BG_BRACKET_ID_FIRST); SetWinner(WINNER_NONE); SetStatus(STATUS_WAIT_QUEUE); SetStartTime(0); @@ -1835,3 +1834,9 @@ bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxSc uint32 score = (m_TeamScores[team_idx] < 0) ? 0 : uint32(m_TeamScores[team_idx]); return score >= minScore && score <= maxScore; } + +void BattleGround::SetBracket( PvPDifficultyEntry const* bracketEntry ) +{ + m_BracketId = bracketEntry->GetBracketId(); + SetLevelRange(bracketEntry->minLevel,bracketEntry->maxLevel); +} \ No newline at end of file diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index bbf2895babf..da7523ac88a 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -38,6 +38,7 @@ class Player; class WorldPacket; class BattleGroundMap; +struct PvPDifficultyEntry; struct WorldSafeLocsEntry; struct BattleGroundEventIdx @@ -165,23 +166,6 @@ enum BattleGroundQueueTypeId }; #define MAX_BATTLEGROUND_QUEUE_TYPES 10 -enum BattleGroundBracketId // bracketId for level ranges -{ - BG_BRACKET_ID_FIRST = 0, - - BG_BRACKET_ID_MAX_LEVEL_19 = 0, - BG_BRACKET_ID_MAX_LEVEL_29 = 1, - BG_BRACKET_ID_MAX_LEVEL_39 = 2, - BG_BRACKET_ID_MAX_LEVEL_49 = 3, - BG_BRACKET_ID_MAX_LEVEL_59 = 4, - BG_BRACKET_ID_MAX_LEVEL_69 = 5, - BG_BRACKET_ID_MAX_LEVEL_79 = 6, - BG_BRACKET_ID_MAX_LEVEL_80 = 7, - - BG_BRACKET_ID_LAST = 7 -}; -#define MAX_BATTLEGROUND_BRACKETS 8 - enum ScoreType { SCORE_KILLING_BLOWS = 1, @@ -338,12 +322,7 @@ class BattleGround void SetName(char const* Name) { m_Name = Name; } void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; } //here we can count minlevel and maxlevel for players - void SetBracketId(BattleGroundBracketId ID) - { - m_BracketId = ID; - uint8 diff = (m_TypeID == BATTLEGROUND_AV) ? 1 : 0; - this->SetLevelRange((ID + 1) * 10 + diff, (ID + 2) * 10 - ((diff + 1) % 2)); - } + void SetBracket(PvPDifficultyEntry const* bracketEntry); void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; } void SetStatus(BattleGroundStatus Status) { m_Status = Status; } void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; } diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 0fde9951d1a..6ec38302163 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -115,7 +115,10 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data ) return; } - BattleGroundBracketId bgBracketId = _player->GetBattleGroundBracketIdFromLevel(); + // expected bracket entry + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + if (!bracketEntry) + return; // check queueing conditions if (!joinAsGroup) @@ -142,7 +145,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data ) // no group found, error if (!grp) return; - uint32 err = grp->CanJoinBattleGroundQueue(bgTypeId, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); + uint32 err = grp->CanJoinBattleGroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam()); if (err != BG_JOIN_ERR_OK) { @@ -157,8 +160,8 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data ) if (joinAsGroup /* && _player->GetGroup()*/) { sLog.outDebug("Battleground: the following players are joining as group:"); - GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bgBracketId, 0, false, isPremade, 0); - uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundBracketIdFromLevel()); + GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0); + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { Player *member = itr->getSource(); @@ -178,8 +181,8 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data ) } else { - GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bgBracketId, 0, false, isPremade, 0); - uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundBracketIdFromLevel()); + GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0); + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); // already checked if queueSlot is valid, now just get it uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId); @@ -189,7 +192,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data ) SendPacket(&data); sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } - sBattleGroundMgr.ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, _player->GetBattleGroundBracketIdFromLevel()); + sBattleGroundMgr.ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv_data*/ ) @@ -352,6 +355,11 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data ) return; } + // expected bracket entry + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + if (!bracketEntry) + return; + //some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it if (action == 1 && ginfo.ArenaType == 0) { @@ -433,7 +441,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data ) bgQueue.RemovePlayer(_player->GetGUID(), true); // player left queue, we should update it - do not update Arena Queue if (!ginfo.ArenaType) - sBattleGroundMgr.ScheduleQueueUpdate(ginfo.ArenaTeamRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, _player->GetBattleGroundBracketIdFromLevel()); + sBattleGroundMgr.ScheduleQueueUpdate(ginfo.ArenaTeamRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); SendPacket(&data); sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); break; @@ -515,7 +523,13 @@ void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ ) bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId); if (!bg) continue; - uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, _player->GetBattleGroundBracketIdFromLevel()); + + // expected bracket entry + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + if (!bracketEntry) + continue; + + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, bracketEntry->GetBracketId()); // send status in BattleGround Queue sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType); SendPacket(&data); @@ -618,7 +632,9 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) BattleGroundTypeId bgTypeId = bg->GetTypeID(); BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, arenatype); - BattleGroundBracketId bgBracketId = _player->GetBattleGroundBracketIdFromLevel(); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + if (!bracketEntry) + return; // check queueing conditions if (!asGroup) @@ -637,7 +653,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) // no group found, error if (!grp) return; - uint32 err = grp->CanJoinBattleGroundQueue(bgTypeId, bgQueueTypeId, arenatype, arenatype, (bool)isRated, arenaslot); + uint32 err = grp->CanJoinBattleGroundQueue(bg, bgQueueTypeId, arenatype, arenatype, (bool)isRated, arenaslot); if (err != BG_JOIN_ERR_OK) { SendBattleGroundOrArenaJoinError(err); @@ -685,8 +701,8 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) if (isRated) sLog.outDebug("Battleground: arena team id %u, leader %s queued with rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),arenaRating,arenatype); - GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bgBracketId, arenatype, isRated, false, arenaRating, ateamId); - uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundBracketIdFromLevel()); + GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId); + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { Player *member = itr->getSource(); @@ -707,8 +723,8 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) } else { - GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bgBracketId, arenatype, isRated, false, arenaRating, ateamId); - uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundBracketIdFromLevel()); + GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId); + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId); WorldPacket data; @@ -717,7 +733,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) SendPacket(&data); sLog.outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } - sBattleGroundMgr.ScheduleQueueUpdate(arenaRating, arenatype, bgQueueTypeId, bgTypeId, _player->GetBattleGroundBracketIdFromLevel()); + sBattleGroundMgr.ScheduleQueueUpdate(arenaRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } void WorldSession::HandleReportPvPAFK( WorldPacket & recv_data ) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 42865e5754a..7cbe1b27a4e 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -148,8 +148,10 @@ bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 de /*********************************************************/ // add group or player (grp == NULL) to bg queue with the given leader and bg specifications -GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleGroundTypeId BgTypeId, BattleGroundBracketId bracket_id, uint8 ArenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 arenateamid) +GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleGroundTypeId BgTypeId, PvPDifficultyEntry const* backetEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 arenateamid) { + BattleGroundBracketId bracketId = backetEntry->GetBracketId(); + // create new ginfo GroupQueueInfo* ginfo = new GroupQueueInfo; ginfo->BgTypeId = BgTypeId; @@ -171,7 +173,7 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleG index += BG_TEAMS_COUNT; if (ginfo->Team == HORDE) index++; - sLog.outDebug("Adding Group to BattleGroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracket_id, index); + sLog.outDebug("Adding Group to BattleGroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index); uint32 lastOnlineTime = getMSTime(); @@ -207,37 +209,37 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleG } //add GroupInfo to m_QueuedGroups - m_QueuedGroups[bracket_id][index].push_back(ginfo); + m_QueuedGroups[bracketId][index].push_back(ginfo); //announce to world, this code needs mutex if (!isRated && !isPremade && sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) { - BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId); - if (bg) + if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId)) { char const* bgName = bg->GetName(); uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; - uint32 q_min_level = (bracket_id + 1) * 10; + uint32 q_min_level = backetEntry->minLevel; + uint32 q_max_level = backetEntry->maxLevel; GroupsQueueType::const_iterator itr; - for(itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) + for(itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qAlliance += (*itr)->Players.size(); - for(itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].end(); ++itr) + for(itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_HORDE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qHorde += (*itr)->Players.size(); // Show queue status to player only (when joining queue) if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) { - ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_min_level + 10, + ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } // System message else { - sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_min_level + 10, + sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } } @@ -800,6 +802,14 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI sLog.outError("Battleground: Update: bg template not found for %u", bgTypeId); return; } + + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(),bracket_id); + if (!bracketEntry) + { + sLog.outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id); + return; + } + // get the min. players per team, properly for larger arenas as well. (must have full teams for arena matches!) uint32 MinPlayersPerTeam = bg_template->GetMinPlayersPerTeam(); uint32 MaxPlayersPerTeam = bg_template->GetMaxPlayersPerTeam(); @@ -844,7 +854,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam)) { //create new battleground - BattleGround * bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracket_id, 0, false); + BattleGround * bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, 0, false); if (!bg2) { sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId); @@ -870,7 +880,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI || (bg_template->isArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam)) ) { // we successfully created a pool - BattleGround * bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracket_id, arenaType, false); + BattleGround * bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, arenaType, false); if (!bg2) { sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId); @@ -984,8 +994,8 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI //if we have 2 teams, then start new arena and invite players! if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()) { - BattleGround* arena = NULL; - if (!(arena = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracket_id, arenaType, true))) + BattleGround* arena = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, arenaType, true); + if (!arena) { sLog.outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!"); return; @@ -1207,14 +1217,14 @@ void BattleGroundMgr::Update(uint32 diff) // it's time to force update if (m_NextRatingDiscardUpdate < diff) { - // forced update for level 70 rated arenas + // forced update for rated arenas (scan all, but skipped non rated) sLog.outDebug("BattleGroundMgr: UPDATING ARENA QUEUES"); - m_BattleGroundQueues[BATTLEGROUND_QUEUE_2v2].Update(BATTLEGROUND_AA, BG_BRACKET_ID_MAX_LEVEL_79, ARENA_TYPE_2v2, true, 0); - m_BattleGroundQueues[BATTLEGROUND_QUEUE_2v2].Update(BATTLEGROUND_AA, BG_BRACKET_ID_MAX_LEVEL_80, ARENA_TYPE_2v2, true, 0); - m_BattleGroundQueues[BATTLEGROUND_QUEUE_3v3].Update(BATTLEGROUND_AA, BG_BRACKET_ID_MAX_LEVEL_79, ARENA_TYPE_3v3, true, 0); - m_BattleGroundQueues[BATTLEGROUND_QUEUE_3v3].Update(BATTLEGROUND_AA, BG_BRACKET_ID_MAX_LEVEL_80, ARENA_TYPE_3v3, true, 0); - m_BattleGroundQueues[BATTLEGROUND_QUEUE_5v5].Update(BATTLEGROUND_AA, BG_BRACKET_ID_MAX_LEVEL_79, ARENA_TYPE_5v5, true, 0); - m_BattleGroundQueues[BATTLEGROUND_QUEUE_5v5].Update(BATTLEGROUND_AA, BG_BRACKET_ID_MAX_LEVEL_80, ARENA_TYPE_5v5, true, 0); + for(int qtype = BATTLEGROUND_QUEUE_2v2; qtype <= BATTLEGROUND_QUEUE_5v5; ++qtype) + for(int bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket) + m_BattleGroundQueues[qtype].Update( + BATTLEGROUND_AA, BattleGroundBracketId(bracket), + BattleGroundMgr::BGArenaType(BattleGroundQueueTypeId(qtype)), true, 0); + m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); } else @@ -1494,7 +1504,7 @@ uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeI } // create a new battleground that will really be used to play -BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id, uint8 arenaType, bool isRated) +BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated) { // get the template BG BattleGround *bg_template = GetBattleGroundTemplate(bgTypeId); @@ -1568,14 +1578,14 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI // generate a new instance id bg->SetInstanceID(sMapMgr.GenerateInstanceId()); // set instance id - bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, bracket_id)); + bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, bracketEntry->GetBracketId())); // reset the new bg (set status to status_wait_queue from status_none) bg->Reset(); // start the joining of the bg bg->SetStatus(STATUS_WAIT_JOIN); - bg->SetBracketId(bracket_id); + bg->SetBracket(bracketEntry); bg->SetArenaType(arenaType); bg->SetRated(isRated); @@ -1841,13 +1851,20 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint6 uint32 count = 0; *data << uint32(0); // number of bg instances - uint32 bracket_id = plr->GetBattleGroundBracketIdFromLevel(); - for(std::set::iterator itr = m_ClientBattleGroundIds[bgTypeId][bracket_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][bracket_id].end();++itr) + if(BattleGround* bgTemplate = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)) { - *data << uint32(*itr); - ++count; + // expected bracket entry + if(PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(),plr->getLevel())) + { + BattleGroundBracketId bracketId = bracketEntry->GetBracketId(); + for(std::set::iterator itr = m_ClientBattleGroundIds[bgTypeId][bracketId].begin(); itr != m_ClientBattleGroundIds[bgTypeId][bracketId].end();++itr) + { + *data << uint32(*itr); + ++count; + } + data->put( count_pos , count); + } } - data->put( count_pos , count); } } diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h index 7317dedb3e4..73352f6690a 100644 --- a/src/game/BattleGroundMgr.h +++ b/src/game/BattleGroundMgr.h @@ -22,6 +22,7 @@ #include "Common.h" #include "Policies/Singleton.h" #include "Utilities/EventProcessor.h" +#include "DBCEnums.h" #include "BattleGround.h" #include "ace/Recursive_Thread_Mutex.h" @@ -81,7 +82,7 @@ class BattleGroundQueue bool CheckPremadeMatch(BattleGroundBracketId bracket_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam); bool CheckNormalMatch(BattleGround* bg_template, BattleGroundBracketId bracket_id, uint32 minPlayers, uint32 maxPlayers); bool CheckSkirmishForSameFaction(BattleGroundBracketId bracket_id, uint32 minPlayersPerTeam); - GroupQueueInfo * AddGroup(Player* leader, Group* group, BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 ArenaTeamId = 0); + GroupQueueInfo * AddGroup(Player* leader, Group* group, BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* backetEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 ArenaTeamId = 0); void RemovePlayer(const uint64& guid, bool decreaseInvitedCount); bool IsPlayerInvited(const uint64& pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime); bool GetPlayerGroupInfoData(const uint64& guid, GroupQueueInfo* ginfo); @@ -203,7 +204,7 @@ class BattleGroundMgr BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); //there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId); - BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id, uint8 arenaType, bool isRated); + BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated); uint32 CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO); diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 973881d4676..8170f56279c 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -32,6 +32,15 @@ // also see MAX_LEVEL and GT_MAX_LEVEL define #define STRONG_MAX_LEVEL 255 +enum BattleGroundBracketId // bracketId for level ranges +{ + BG_BRACKET_ID_FIRST = 0, + BG_BRACKET_ID_LAST = 15 +}; + +// must be max value in PvPDificulty slot+1 +#define MAX_BATTLEGROUND_BRACKETS 16 + enum AreaTeams { AREATEAM_NONE = 0, diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index dd59368f08c..ff4ce881150 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -105,6 +105,7 @@ MapDifficultyMap sMapDifficultyMap; DBCStorage sMovieStore(MovieEntryfmt); DBCStorage sQuestSortStore(QuestSortEntryfmt); +DBCStorage sPvPDifficultyStore(PvPDifficultyfmt); DBCStorage sRandomPropertiesPointsStore(RandomPropertiesPointsfmt); DBCStorage sScalingStatDistributionStore(ScalingStatDistributionfmt); @@ -206,7 +207,7 @@ void LoadDBCStores(const std::string& dataPath) { std::string dbcPath = dataPath+"dbc/"; - const uint32 DBCFilesCount = 81; + const uint32 DBCFilesCount = 82; barGoLink bar( DBCFilesCount ); @@ -305,6 +306,12 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPvPDifficultyStore, dbcPath,"PvpDifficulty.dbc"); + for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) + if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) + if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) + assert(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatValuesStore, dbcPath,"ScalingStatValues.dbc"); @@ -678,6 +685,30 @@ MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) return itr != sMapDifficultyMap.end() ? &itr->second : NULL; } +PvPDifficultyEntry const* GetBattlegroundBracketByLevel( uint32 mapid, uint32 level ) +{ + // prevent out-of-range levels for dbc data + if (level > DEFAULT_MAX_LEVEL) + level = DEFAULT_MAX_LEVEL; + + for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) + if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) + if (entry->mapId == mapid && entry->minLevel <= level && entry->maxLevel >= level) + return entry; + + return NULL; +} + +PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattleGroundBracketId id) +{ + for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) + if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) + if (entry->mapId == mapid && entry->GetBracketId() == id) + return entry; + + return NULL; +} + uint32 const* GetTalentTabPages(uint32 cls) { return sTalentTabPages[cls]; diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index cb965b0f5c8..d4ff85467e2 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -60,6 +60,9 @@ MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty); uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls); +PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); +PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattleGroundBracketId id); + extern DBCStorage sAchievementStore; extern DBCStorage sAchievementCriteriaStore; extern DBCStorage sAreaStore;// recommend access using functions @@ -117,6 +120,7 @@ extern DBCStorage sMapStore; extern MapDifficultyMap sMapDifficultyMap; extern DBCStorage sMovieStore; extern DBCStorage sQuestSortStore; +//extern DBCStorage sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access extern DBCStorage sRandomPropertiesPointsStore; extern DBCStorage sScalingStatDistributionStore; extern DBCStorage sScalingStatValuesStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 8ca275afe8f..12d384ae30a 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1141,6 +1141,19 @@ struct MovieEntry //uint32 unk2; // 2 always 100 }; +struct PvPDifficultyEntry +{ + //uint32 id; // 0 m_ID + uint32 mapId; // 1 + uint32 bracketId; // 2 + uint32 minLevel; // 3 + uint32 maxLevel; // 4 + uint32 difficulty; // 5 + + // helpers + BattleGroundBracketId GetBracketId() const { return BattleGroundBracketId(bracketId); } +}; + struct QuestSortEntry { uint32 id; // 0 m_ID diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index d2814a94760..a71e9dee1c3 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -76,6 +76,7 @@ const char MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx const char MapDifficultyEntryfmt[]="diixxxxxxxxxxxxxxxxxiix"; const char MovieEntryfmt[]="nxx"; const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx"; +const char PvPDifficultyfmt[]="diiiii"; const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii"; const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiixiiii"; diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 15d85a9f645..9f88a1fb3da 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1462,7 +1462,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed ) SendUpdate(); } -uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot) +uint32 Group::CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot) { // check for min / max count uint32 memberscount = GetMembersCount(); @@ -1477,7 +1477,10 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround if(!reference) return BG_JOIN_ERR_OFFLINE_MEMBER; - BattleGroundBracketId bracket_id = reference->GetBattleGroundBracketIdFromLevel(); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(),reference->getLevel()); + if(!bracketEntry) + return BG_JOIN_ERR_OFFLINE_MEMBER; + uint32 arenaTeamId = reference->GetArenaTeamId(arenaSlot); uint32 team = reference->GetTeam(); @@ -1492,7 +1495,8 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround if(member->GetTeam() != team) return BG_JOIN_ERR_MIXED_FACTION; // not in the same battleground level braket, don't let join - if(member->GetBattleGroundBracketIdFromLevel() != bracket_id) + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId,member->getLevel()); + if(memberBracketEntry != bracketEntry) return BG_JOIN_ERR_MIXED_LEVELS; // don't let join rated matches if the arena team id doesn't match if(isRated && member->GetArenaTeamId(arenaSlot) != arenaTeamId) @@ -1501,7 +1505,7 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround if(member->InBattleGroundQueueForBattleGroundQueueType(bgQueueTypeId)) return BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE; // check for deserter debuff in case not arena queue - if(bgTypeId != BATTLEGROUND_AA && !member->CanJoinToBattleground()) + if(bgOrTemplate->GetTypeID() != BATTLEGROUND_AA && !member->CanJoinToBattleground()) return BG_JOIN_ERR_GROUP_DESERTER; // check if member can join any more battleground queues if(!member->HasFreeBattleGroundQueueId()) diff --git a/src/game/Group.h b/src/game/Group.h index da51b2b2c0a..dc22b184f21 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -257,7 +257,7 @@ class MANGOS_DLL_SPEC Group void ConvertToRaid(); void SetBattlegroundGroup(BattleGround *bg) { m_bgGroup = bg; } - uint32 CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); + uint32 CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); void ChangeMembersGroup(const uint64 &guid, const uint8 &group); void ChangeMembersGroup(Player *player, const uint8 &group); diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index 1afd2b2e9c3..e3a60e56252 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -216,11 +216,10 @@ BattleGroundMap* MapInstanced::CreateBattleGroundMap(uint32 InstanceId, BattleGr sLog.outDebug("MapInstanced::CreateBattleGroundMap: instance:%d for map:%d and bgType:%d created.", InstanceId, GetId(), bg->GetTypeID()); - // 0-59 normal spawn 60-69 difficulty_1, 70-79 difficulty_2, 80 dufficulty_3 - uint8 spawnMode = (bg->GetBracketId() > BG_BRACKET_ID_MAX_LEVEL_59) ? (bg->GetBracketId() - BG_BRACKET_ID_MAX_LEVEL_59) : 0; - // some bgs don't have different spawnmodes, with this we can stay close to dbc-data - while (!GetMapDifficultyData(GetId(), Difficulty(spawnMode))) - spawnMode--; + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel()); + + uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : REGULAR_DIFFICULTY; + BattleGroundMap *map = new BattleGroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode); ASSERT(map->IsBattleGroundOrArena()); map->SetBG(bg); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6d5f7de6df4..7201caa4ffe 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19173,24 +19173,17 @@ bool Player::GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const if(!bg) return false; - if(getLevel() < bg->GetMinLevel() || getLevel() > bg->GetMaxLevel()) + // limit check leel to dbc compatible level range + uint32 level = getLevel(); + if (level > DEFAULT_MAX_LEVEL) + level = DEFAULT_MAX_LEVEL; + + if(level < bg->GetMinLevel() || level > bg->GetMaxLevel()) return false; return true; } -BattleGroundBracketId Player::GetBattleGroundBracketIdFromLevel() const -{ - // for ranges 0 - 19, 20 - 29, 30 - 39, 40 - 49, 50 - 59, 60 - 69, 70 - 79, 80 - uint32 bracket_id = ( getLevel() / 10) - 1; - if( bracket_id >= MAX_BATTLEGROUND_BRACKETS ) - { - sLog.outError("BattleGround: too high bracket_id %u for player %u (acc: %u) with level %u", bracket_id, GetGUIDLow(), GetSession()->GetAccountId(), getLevel()); - return BG_BRACKET_ID_LAST; - } - return BattleGroundBracketId(bracket_id); -} - float Player::GetReputationPriceDiscount( Creature const* pCreature ) const { FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry(); diff --git a/src/game/Player.h b/src/game/Player.h index d8734ce286b..2bdb0c82a4d 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2016,9 +2016,6 @@ class MANGOS_DLL_SPEC Player : public Unit BattleGroundTypeId GetBattleGroundTypeId() const { return m_bgData.bgTypeID; } BattleGround* GetBattleGround() const; - - BattleGroundBracketId GetBattleGroundBracketIdFromLevel() const; - bool InBattleGroundQueue() const { for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i) From 0c64d57c60f6720bf890a973e497f65cc540d853 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 9 Jan 2010 06:58:50 +0300 Subject: [PATCH 43/46] Fixed mangos.sql data for branch and partly related code. * Drop outdated data for 1535 (old totem summon, now instant area cast) Still need implement new way work. * Restore work broken in branch glyph 45785 with updated functionality, --- sql/330/4_spell_chain.sql | 8 ++++++++ sql/330/5_spell_bonus_data.sql | 1 + sql/330/6_spell_proc_event.sql | 5 +++++ sql/mangos.sql | 13 +++++-------- src/game/SpellAuras.cpp | 9 --------- src/game/Unit.cpp | 10 ++++------ 6 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 sql/330/4_spell_chain.sql create mode 100644 sql/330/5_spell_bonus_data.sql create mode 100644 sql/330/6_spell_proc_event.sql diff --git a/sql/330/4_spell_chain.sql b/sql/330/4_spell_chain.sql new file mode 100644 index 00000000000..f911b6bf1d2 --- /dev/null +++ b/sql/330/4_spell_chain.sql @@ -0,0 +1,8 @@ +DELETE FROM spell_chain WHERE first_spell = 8443; + + +/* Desecration */ +DELETE FROM spell_chain WHERE spell_id in (55666,55667); +INSERT INTO spell_chain VALUES +(55666,0,55666,1,0), +(55667,55666,55666,2,0); diff --git a/sql/330/5_spell_bonus_data.sql b/sql/330/5_spell_bonus_data.sql new file mode 100644 index 00000000000..dbcee35ab3b --- /dev/null +++ b/sql/330/5_spell_bonus_data.sql @@ -0,0 +1 @@ +DELETE FROM spell_bonus_data WHERE entry = 8443; diff --git a/sql/330/6_spell_proc_event.sql b/sql/330/6_spell_proc_event.sql new file mode 100644 index 00000000000..6d190bf0f2d --- /dev/null +++ b/sql/330/6_spell_proc_event.sql @@ -0,0 +1,5 @@ +DELETE FROM spell_proc_event WHERE entry IN (55668,55669,55670,55667,58631,63320); + + +INSERT INTO `spell_proc_event` VALUES +(63320, 0x00000000, 5, 0x00040000, 0x00000000, 0x00008000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0); diff --git a/sql/mangos.sql b/sql/mangos.sql index 1c265f22712..19e86f3281a 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -14137,7 +14137,6 @@ INSERT INTO `spell_bonus_data` VALUES (1064, 1.34, 0, 0, 'Shaman - Chain Heal'), (421, 0.57, 0, 0, 'Shaman - Chain Lightning'), (8042, 0.3858, 0, 0, 'Shaman - Earth Shock'), -(8443, 0.2142, 0, 0, 'Shaman - Fire Nova Totem Casted by Totem'), (8050, 0.2142, 0.1, 0, 'Shaman - Flame Shock'), (8026, 0.1, 0, 0, 'Shaman - Flametongue Weapon Proc'), (8056, 0.3858, 0, 0, 'Shaman - Frost Shock'), @@ -16439,7 +16438,7 @@ INSERT INTO spell_chain VALUES (25454,10414,8042,8,0), (49230,25454,8042,9,0), (49231,49230,8042,10,0), -/*Fire Nova Totem*/ +/*Fire Nova*/ (1535,0,1535,1,0), (8498,1535,1535,2,0), (8499,8498,1535,3,0), @@ -17290,6 +17289,9 @@ INSERT INTO spell_chain VALUES (45463,49999,49998,3,0), (49923,45463,49998,4,0), (49924,49923,49998,5,0), +/* Desecration */ +(55666,0,55666,1,0), +(55667,55666,55666,2,0), /*Improved Unholy Presence*/ (50391,0,50391,1,0), (50392,50391,50391,2,0), @@ -18418,10 +18420,6 @@ INSERT INTO `spell_proc_event` VALUES (55440, 0x00000000, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (55640, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45), (55666, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(55667, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(55668, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(55669, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(55670, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (55677, 0x00000000, 6, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (55680, 0x00000000, 6, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (55689, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), @@ -18466,7 +18464,6 @@ INSERT INTO `spell_proc_event` VALUES (58616, 0x00000000, 15, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (58620, 0x00000000, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (58626, 0x00000000, 15, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(58631, 0x00000000, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (58644, 0x00000000, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (58647, 0x00000000, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (58677, 0x00000000, 15, 0x00002000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0), @@ -18530,7 +18527,7 @@ INSERT INTO `spell_proc_event` VALUES (63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(63320, 0x00000000, 5, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63320, 0x00000000, 5, 0x00040000, 0x00000000, 0x00008000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0), (63373, 0x00000000, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0), (63534, 0x00000000, 6, 0x00000040, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0), (63625, 0x00000000, 6, 0x02000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0), diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8c77e8a10df..376aa0d0caa 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1521,15 +1521,6 @@ void Aura::TriggerSpell() // case 812: break; // // Polymorphic Ray // case 6965: break; -// // Fire Nova (1-7 ranks) -// case 8350: -// case 8508: -// case 8509: -// case 11312: -// case 11313: -// case 25540: -// case 25544: -// break; // Thaumaturgy Channel case 9712: trigger_spell_id = 21029; break; // // Egan's Blaster diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1146cc6b230..3c26d5298aa 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5258,6 +5258,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu owner->CastSpell(owner,58227,true,castItem,triggeredByAura); return true; } + // Glyph of Life Tap + case 63320: + triggered_spell_id = 63321; + break; } break; } @@ -5584,12 +5588,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu triggered_spell_id = 63106; break; } - // Glyph of Life Tap - case 63320: - { - triggered_spell_id = 63321; - break; - } } break; } From 78053a114a8957dfd96ced72d6868779f1d2a255 Mon Sep 17 00:00:00 2001 From: yad02 Date: Sat, 9 Jan 2010 07:36:44 +0300 Subject: [PATCH 44/46] characters.data convertor 3.2.2a -> 3.3.0a Signed-off-by: VladimirMangos --- sql/330/7_charascters.sql | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sql/330/7_charascters.sql diff --git a/sql/330/7_charascters.sql b/sql/330/7_charascters.sql new file mode 100644 index 00000000000..7e859d26d28 --- /dev/null +++ b/sql/330/7_charascters.sql @@ -0,0 +1,62 @@ +UPDATE characters SET data = REPLACE(data,' ',' '); +UPDATE characters SET data = CONCAT(TRIM(data),' '); + +UPDATE `characters` SET `data` = CONCAT( + SUBSTRING_INDEX(`data`, ' ', 161 + 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 1), ' ', -165 + 162 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4 + 1), ' ', -165 - 4 + 162 + 4 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*2 + 1), ' ', -165 - 4*2 + 162 + 4*2 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*3 + 1), ' ', -165 - 4*3 + 162 + 4*3 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*4 + 1), ' ', -165 - 4*4 + 162 + 4*4 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*5 + 1), ' ', -165 - 4*5 + 162 + 4*5 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*6 + 1), ' ', -165 - 4*6 + 162 + 4*6 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*7 + 1), ' ', -165 - 4*7 + 162 + 4*7 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*8 + 1), ' ', -165 - 4*8 + 162 + 4*8 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*9 + 1), ' ', -165 - 4*9 + 162 + 4*9 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*10 + 1), ' ', -165 - 4*10 + 162 + 4*10 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*11 + 1), ' ', -165 - 4*11 + 162 + 4*11 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*12 + 1), ' ', -165 - 4*12 + 162 + 4*12 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*13 + 1), ' ', -165 - 4*13 + 162 + 4*13 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*14 + 1), ' ', -165 - 4*14 + 162 + 4*14 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*15 + 1), ' ', -165 - 4*15 + 162 + 4*15 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*16 + 1), ' ', -165 - 4*16 + 162 + 4*16 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*17 + 1), ' ', -165 - 4*17 + 162 + 4*17 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*18 + 1), ' ', -165 - 4*18 + 162 + 4*18 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*19 + 1), ' ', -165 - 4*19 + 162 + 4*19 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*20 + 1), ' ', -165 - 4*20 + 162 + 4*20 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*21 + 1), ' ', -165 - 4*21 + 162 + 4*21 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*22 + 1), ' ', -165 - 4*22 + 162 + 4*22 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 165 + 4*23 + 1), ' ', -165 - 4*23 + 162 + 4*23 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 298 + 1), ' ', -298 + 162 + 4*24 - 1), ' ', + '0 ', + SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 1300 + 1), ' ', -1300 + 299 - 1), ' ' + ) +WHERE length(SUBSTRING_INDEX(data, ' ', 1300)) < length(data) and length(SUBSTRING_INDEX(data, ' ', 1300+1)) >= length(data); + +UPDATE characters SET data = REPLACE(data,' ',' '); +UPDATE characters SET data = CONCAT(TRIM(data),' '); From d18dd850b6c786ca1fe5d981a0447841a60892ef Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 9 Jan 2010 21:04:08 +0300 Subject: [PATCH 45/46] Some enum fixes. --- src/game/DBCEnums.h | 30 +++++++++++++++--------------- src/game/Opcodes.h | 6 +++--- src/game/SharedDefines.h | 4 ++-- src/game/Unit.h | 14 +++++++------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 8170f56279c..73a913b749c 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -364,21 +364,21 @@ enum SummonPropType // SummonProperties.dbc, col 5 enum SummonPropFlags { - SUMMON_PROP_FLAG_NONE = 0x0000, // 1342 spells in 3.0.3 - SUMMON_PROP_FLAG_UNK1 = 0x0001, // 75 spells in 3.0.3, something unfriendly - SUMMON_PROP_FLAG_UNK2 = 0x0002, // 616 spells in 3.0.3, something friendly - SUMMON_PROP_FLAG_UNK3 = 0x0004, // 22 spells in 3.0.3, no idea... - SUMMON_PROP_FLAG_UNK4 = 0x0008, // 49 spells in 3.0.3, some mounts - SUMMON_PROP_FLAG_UNK5 = 0x0010, // 25 spells in 3.0.3, quest related? - SUMMON_PROP_FLAG_UNK6 = 0x0020, // 0 spells in 3.0.3, unused - SUMMON_PROP_FLAG_UNK7 = 0x0040, // 12 spells in 3.0.3, no idea - SUMMON_PROP_FLAG_UNK8 = 0x0080, // 4 spells in 3.0.3, no idea - SUMMON_PROP_FLAG_UNK9 = 0x0100, // 51 spells in 3.0.3, no idea, many quest related - SUMMON_PROP_FLAG_UNK10 = 0x0200, // 51 spells in 3.0.3, something defensive - SUMMON_PROP_FLAG_UNK11 = 0x0400, // 3 spells, requires something near? - SUMMON_PROP_FLAG_UNK12 = 0x0800, // 30 spells in 3.0.3, no idea - SUMMON_PROP_FLAG_UNK13 = 0x1000, // 8 spells in 3.0.3, siege vehicle - SUMMON_PROP_FLAG_UNK14 = 0x2000, // 2 spells in 3.0.3, escort? + SUMMON_PROP_FLAG_NONE = 0x0000, // 1342 spells in 3.0.3 + SUMMON_PROP_FLAG_UNK1 = 0x0001, // 75 spells in 3.0.3, something unfriendly + SUMMON_PROP_FLAG_UNK2 = 0x0002, // 616 spells in 3.0.3, something friendly + SUMMON_PROP_FLAG_UNK3 = 0x0004, // 22 spells in 3.0.3, no idea... + SUMMON_PROP_FLAG_UNK4 = 0x0008, // 49 spells in 3.0.3, some mounts + SUMMON_PROP_FLAG_UNK5 = 0x0010, // 25 spells in 3.0.3, quest related? + SUMMON_PROP_FLAG_CANT_BE_DISMISSED = 0x0020, // 0 spells in 3.0.3, unused + SUMMON_PROP_FLAG_UNK7 = 0x0040, // 12 spells in 3.0.3, no idea + SUMMON_PROP_FLAG_UNK8 = 0x0080, // 4 spells in 3.0.3, no idea + SUMMON_PROP_FLAG_UNK9 = 0x0100, // 51 spells in 3.0.3, no idea, many quest related + SUMMON_PROP_FLAG_UNK10 = 0x0200, // 51 spells in 3.0.3, something defensive + SUMMON_PROP_FLAG_UNK11 = 0x0400, // 3 spells, requires something near? + SUMMON_PROP_FLAG_UNK12 = 0x0800, // 30 spells in 3.0.3, no idea + SUMMON_PROP_FLAG_UNK13 = 0x1000, // 8 spells in 3.0.3, siege vehicle + SUMMON_PROP_FLAG_UNK14 = 0x2000, // 2 spells in 3.0.3, escort? }; #endif diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index d649fe6901e..f2fcac99647 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1154,8 +1154,8 @@ enum Opcodes CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x45D, SMSG_SPLINE_SET_PITCH_RATE = 0x45E, SMSG_MOVE_ABANDON_TRANSPORT = 0x45F, - MSG_MOVE_ABANDON_TRANSPORT = 0x460, - CMSG_MOVE_ABANDON_TRANSPORT_ACK = 0x461, + SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x460, + SMSG_CALENDAR_UPDATE_INVITE_LIST2 = 0x461, CMSG_UPDATE_MISSILE_TRAJECTORY = 0x462, SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x463, SMSG_TRIGGER_MOVIE = 0x464, @@ -1171,7 +1171,7 @@ enum Opcodes CMSG_COMPLETE_ACHIEVEMENT_CHEAT = 0x46E, SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x46F, CMSG_SET_CRITERIA_CHEAT = 0x470, - SMSG_GROUP_SWAP_FAILED = 0x471, + SMSG_CALENDAR_UPDATE_INVITE_LIST3 = 0x471, CMSG_UNITANIMTIER_CHEAT = 0x472, CMSG_CHAR_CUSTOMIZE = 0x473, SMSG_CHAR_CUSTOMIZE = 0x474, diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 04bb4ebf161..db31834809a 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -222,10 +222,10 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilites have this flag #define SPELL_ATTR_ON_NEXT_SWING_1 0x00000004 // 2 on next swing #define SPELL_ATTR_UNK3 0x00000008 // 3 not set in 3.0.3 -#define SPELL_ATTR_UNK4 0x00000010 // 4 +#define SPELL_ATTR_UNK4 0x00000010 // 4 isAbility #define SPELL_ATTR_TRADESPELL 0x00000020 // 5 trade spells, will be added by client to a sublist of profession spell #define SPELL_ATTR_PASSIVE 0x00000040 // 6 Passive spell -#define SPELL_ATTR_UNK7 0x00000080 // 7 visible? +#define SPELL_ATTR_UNK7 0x00000080 // 7 can't be linked in chat? #define SPELL_ATTR_UNK8 0x00000100 // 8 hide created item in tooltip (for effect=24) #define SPELL_ATTR_UNK9 0x00000200 // 9 #define SPELL_ATTR_ON_NEXT_SWING_2 0x00000400 // 10 on next swing 2 diff --git a/src/game/Unit.h b/src/game/Unit.h index e10869456a1..56a80343c5e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -141,7 +141,7 @@ enum UnitStandStateType UNIT_STAND_STATE_SUBMERGED = 9 }; -// byte flag value (UNIT_FIELD_BYTES_1,2) +// byte flags value (UNIT_FIELD_BYTES_1,2) enum UnitStandFlags { UNIT_STAND_FLAGS_UNK1 = 0x01, @@ -161,7 +161,7 @@ enum UnitBytes1_Flags UNIT_BYTE1_FLAG_ALL = 0xFF }; -// high byte (3 from 0..3) of UNIT_FIELD_BYTES_2 +// byte value (UNIT_FIELD_BYTES_2,3) enum ShapeshiftForm { FORM_NONE = 0x00, @@ -197,7 +197,7 @@ enum ShapeshiftForm FORM_SPIRITOFREDEMPTION = 0x20, }; -// low byte ( 0 from 0..3 ) of UNIT_FIELD_BYTES_2 +// byte value (UNIT_FIELD_BYTES_2,0) enum SheathState { SHEATH_STATE_UNARMED = 0, // non prepared weapon @@ -207,7 +207,7 @@ enum SheathState #define MAX_SHEATH_STATE 3 -// byte (1 from 0..3) of UNIT_FIELD_BYTES_2 +// byte flags value (UNIT_FIELD_BYTES_2,1) enum UnitPVPStateFlags { UNIT_BYTE2_FLAG_PVP = 0x01, @@ -220,11 +220,11 @@ enum UnitPVPStateFlags UNIT_BYTE2_FLAG_UNK7 = 0x80 }; -// byte (2 from 0..3) of UNIT_FIELD_BYTES_2 +// byte flags value (UNIT_FIELD_BYTES_2,2) enum UnitRename { - UNIT_RENAME_NOT_ALLOWED = 0x02, - UNIT_RENAME_ALLOWED = 0x03 + UNIT_CAN_BE_RENAMED = 0x01, + UNIT_CAN_BE_ABANDONED = 0x02, }; #define CREATURE_MAX_SPELLS 4 From 4ae102c0404b6aa9373011e14274659c7764fa99 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sat, 9 Jan 2010 21:47:16 +0300 Subject: [PATCH 46/46] Compile fix. --- src/game/Pet.cpp | 10 +++++----- src/game/PetHandler.cpp | 4 ++-- src/game/SpellEffects.cpp | 27 +++++++++++++++------------ 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index f4da5c69509..a264c312af2 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -136,7 +136,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool } PetType pet_type = PetType(fields[18].GetUInt8()); - if(pet_type==HUNTER_PET) + if(pet_type == HUNTER_PET) { CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(petentry); if(!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets())) @@ -210,7 +210,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool case HUNTER_PET: SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); SetSheath(SHEATH_STATE_MELEE); - SetByteValue(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_RENAME_NOT_ALLOWED : UNIT_RENAME_ALLOWED); + SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED); SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); // this enables popup window (pet abandon, cancel) @@ -409,8 +409,8 @@ void Pet::SavePetToDB(PetSaveMode mode) << uint32(m_charmInfo->GetReactState()) << ", " << uint32(mode) << ", '" << name.c_str() << "', " - << uint32((GetByteValue(UNIT_FIELD_BYTES_2, 2) == UNIT_RENAME_ALLOWED)?0:1) << ", " - << (curhealth<1?1:curhealth) << ", " + << uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ", " + << (curhealth < 1 ? 1 : curhealth) << ", " << curmana << ", " << GetPower(POWER_HAPPINESS) << ", '"; @@ -784,7 +784,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) { SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); SetSheath(SHEATH_STATE_MELEE); - SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED); + SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED); SetUInt32Value(UNIT_MOD_CAST_SPEED, creature->GetUInt32Value(UNIT_MOD_CAST_SPEED)); } return true; diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index f6a919649b2..1d3053123cb 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -439,7 +439,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data ) Pet* pet = _player->GetMap()->GetPet(petguid); // check it! if( !pet || pet->getPetType() != HUNTER_PET || - pet->GetByteValue(UNIT_FIELD_BYTES_2, 2) != UNIT_RENAME_ALLOWED || + !pet->HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) || pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo() ) return; @@ -461,7 +461,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data ) if(_player->GetGroup()) _player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME); - pet->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED); + pet->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); if(isdeclined) { diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e29eaccde15..37e02dd14b3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4328,13 +4328,13 @@ void Spell::EffectSummonPet(uint32 i) Pet* NewSummon = new Pet; // petentry==0 for hunter "call pet" (current pet summoned if any) - if(m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->LoadPetFromDB((Player*)m_caster,petentry)) + if(m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->LoadPetFromDB((Player*)m_caster, petentry)) { - if(NewSummon->getPetType()==SUMMON_PET) + if(NewSummon->getPetType() == SUMMON_PET) { // Remove Demonic Sacrifice auras (known pet) Unit::AuraList const& auraClassScripts = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();) + for(Unit::AuraList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();) { if((*itr)->GetModifier()->m_miscvalue == 2228) { @@ -4360,7 +4360,7 @@ void Spell::EffectSummonPet(uint32 i) if(!cInfo) { - sLog.outError("EffectSummonPet: creature entry %u not found.",petentry); + sLog.outError("EffectSummonPet: creature entry %u not found.", petentry); delete NewSummon; return; } @@ -4415,7 +4415,7 @@ void Spell::EffectSummonPet(uint32 i) // this enables popup window (pet dismiss, cancel), hunter pet additional flags set later if(m_caster->GetTypeId() == TYPEID_PLAYER) - NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE); + NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); if(m_caster->IsPvP()) NewSummon->SetPvP(true); @@ -4425,13 +4425,13 @@ void Spell::EffectSummonPet(uint32 i) NewSummon->InitLevelupSpellsForLevel(); NewSummon->InitTalentForLevel(); - if(NewSummon->getPetType()==SUMMON_PET) + if(NewSummon->getPetType() == SUMMON_PET) { // Remove Demonic Sacrifice auras (new pet) Unit::AuraList const& auraClassScripts = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();) + for(Unit::AuraList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();) { - if((*itr)->GetModifier()->m_miscvalue==2228) + if((*itr)->GetModifier()->m_miscvalue == 2228) { m_caster->RemoveAurasDueToSpell((*itr)->GetId()); itr = auraClassScripts.begin(); @@ -4441,12 +4441,15 @@ void Spell::EffectSummonPet(uint32 i) } // generate new name for summon pet - std::string new_name=sObjectMgr.GeneratePetName(petentry); + std::string new_name = sObjectMgr.GeneratePetName(petentry); if(!new_name.empty()) NewSummon->SetName(new_name); } - else if(NewSummon->getPetType()==HUNTER_PET) - NewSummon->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED); + else if(NewSummon->getPetType() == HUNTER_PET) + { + NewSummon->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); + NewSummon->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_ABANDONED); + } NewSummon->AIM_Initialize(); NewSummon->SetHealth(NewSummon->GetMaxHealth()); @@ -6953,7 +6956,7 @@ void Spell::EffectRenamePet(uint32 /*eff_idx*/) !((Creature*)unitTarget)->isPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET) return; - unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED); + unitTarget->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); } void Spell::EffectPlayMusic(uint32 i)