mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 07:22:02 -04:00
Core/PacketIO: Updated and enabled SMSG_QUEST_GIVER_QUEST_FAILED opcode
This commit is contained in:
@@ -16380,15 +16380,14 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP)
|
||||
GetSession()->SendPacket(packet.Write());
|
||||
}
|
||||
|
||||
void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
|
||||
void Player::SendQuestFailed(uint32 questID, InventoryResult reason)
|
||||
{
|
||||
if (questId)
|
||||
if (questID)
|
||||
{
|
||||
WorldPacket data(SMSG_QUEST_GIVER_QUEST_FAILED, 4 + 4);
|
||||
data << uint32(questId);
|
||||
data << uint32(reason); // failed reason (valid reasons: 4, 16, 50, 17, 74, other values show default message)
|
||||
GetSession()->SendPacket(&data);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED");
|
||||
WorldPackets::Quest::QuestGiverQuestFailed questGiverQuestFailed;
|
||||
questGiverQuestFailed.QuestID = questID;
|
||||
questGiverQuestFailed.Reason = reason; // failed reason (valid reasons: 4, 16, 50, 17, other values show default message)
|
||||
GetSession()->SendPacket(questGiverQuestFailed.Write());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1721,8 +1721,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetQuestObjectiveData(Quest const* quest, int8 storageIndex, int32 data);
|
||||
void SendQuestComplete(Quest const* quest);
|
||||
void SendQuestReward(Quest const* quest, uint32 XP);
|
||||
void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);
|
||||
void SendQuestTimerFailed(uint32 questId);
|
||||
void SendQuestFailed(uint32 questID, InventoryResult reason = EQUIP_ERR_OK);
|
||||
void SendQuestTimerFailed(uint32 questID);
|
||||
void SendCanTakeQuestResponse(QuestFailedReason reason, bool sendErrorMessage = true, std::string reasonText = "") const;
|
||||
void SendQuestConfirmAccept(Quest const* quest, Player* receiver);
|
||||
void SendPushToPartyResponse(Player* player, QuestPushReason reason);
|
||||
|
||||
@@ -530,3 +530,11 @@ WorldPacket const* WorldPackets::Quest::QuestUpdateFailedTimer::Write()
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Quest::QuestGiverQuestFailed::Write()
|
||||
{
|
||||
_worldPacket << QuestID;
|
||||
_worldPacket << Reason;
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -537,6 +537,17 @@ namespace WorldPackets
|
||||
|
||||
uint32 QuestID = 0;
|
||||
};
|
||||
|
||||
class QuestGiverQuestFailed final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
QuestGiverQuestFailed() : ServerPacket(SMSG_QUEST_GIVER_QUEST_FAILED, 8) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 QuestID = 0;
|
||||
uint32 Reason = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1518,7 +1518,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_COMPLETE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_DETAILS, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_FAILED, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_REQUEST_ITEMS, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_STATUS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
|
||||
Reference in New Issue
Block a user