diff --git a/sql/330/1_account_data.sql b/sql/330/1_account_data.sql new file mode 100644 index 000000000..d13feab73 --- /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 dcb16bff8..8f1d74d0b 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 d1697be0e..fce5a2478 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,79 +840,61 @@ 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 ); + + ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(roll->itemid); + player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); } } } } - 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 = 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 { SendLootAllPassed(NumberOfPlayers, *roll); @@ -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 6b365a0de..2d59de813 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 855f1845c..a905d7bca 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 88102af49..290baf8dd 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 16b71f512..5241f8f73 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 f26fb3bea..185b4afde 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[]);