Core/Quest: Fix and enable CMSG_QUEST_CONFIRM_ACCEPT

Core/Protocol: Add CMSG_QUEST_POI_QUERY opcode
This commit is contained in:
Nay committed 2011-12-22 04:34:26 +00:00
1 parent 9fe7bedd10
commit 41b0a9ec86
4 files changed
+23 -13

No files matched your search

+1 -1
View File
@@ -628,7 +628,7 @@ enum NPCFlags
{
UNIT_NPC_FLAG_NONE = 0x00000000,
UNIT_NPC_FLAG_GOSSIP = 0x00000001, // 100%
UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // guessed, probably ok
UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // 100%
UNIT_NPC_FLAG_UNK1 = 0x00000004,
UNIT_NPC_FLAG_UNK2 = 0x00000008,
UNIT_NPC_FLAG_TRAINER = 0x00000010, // 100%
@@ -449,16 +449,26 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
}
}
void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
{
uint32 quest;
recv_data >> quest;
uint64 questGiverGuid;
uint32 questId;
uint32 unkInt;
recvData >> questGiverGuid>> questId >> unkInt;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest);
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = %u", questId);
if (const Quest* pQuest = sObjectMgr->GetQuestTemplate(quest))
if (IS_UNIT_GUID(questGiverGuid))
if (!GetPlayer()->GetNPCIfCanInteractWith(questGiverGuid, UNIT_NPC_FLAG_QUESTGIVER))
return;
if (IS_GAMEOBJECT_GUID(questGiverGuid))
if (!GetPlayer()->GetGameObjectIfCanInteractWith(questGiverGuid, GAMEOBJECT_TYPE_QUESTGIVER))
return;
// Can items be quest giver?
if (const Quest* quest = sObjectMgr->GetQuestTemplate(questId))
{
if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
return;
Player* pOriginalPlayer = ObjectAccessor::FindPlayer(_player->GetDivider());
@@ -466,7 +476,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
if (!pOriginalPlayer)
return;
if (pQuest->IsRaidQuest())
if (quest->IsRaidQuest())
{
if (!_player->IsInSameRaidWith(pOriginalPlayer))
return;
@@ -477,8 +487,8 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
return;
}
if (_player->CanAddQuest(pQuest, true))
_player->AddQuest(pQuest, NULL); // NULL, this prevent DB script from duplicate running
if (_player->CanAddQuest(quest, true))
_player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running
_player->SetDivider(0);
}
@@ -765,7 +775,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
SendPacket(&data);
}
void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recv_data*/)
void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recvData*/)
{
size_t rew_count = _player->GetRewardedQuestCount();
+1 -1
View File
@@ -473,7 +473,7 @@ void InitOpcodes()
DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
//DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
//DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
//DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept );
DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept );
//DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
//DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty );
DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode );
+1 -1
View File
@@ -350,7 +350,7 @@ enum Opcodes
CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB,
CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6,
CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF,
CMSG_QUEST_POI_QUERY = 0x00,
CMSG_QUEST_POI_QUERY = 0x12A5,
CMSG_QUEST_CONFIRM_ACCEPT = 0xC63,
CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, // byte unk, byte race
CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB,