Core/PacketIO: Updated and enabled SMSG_QUEST_GIVER_INVALID_QUEST opcode
This commit is contained in:
@@ -16399,12 +16399,15 @@ void Player::SendQuestTimerFailed(uint32 quest_id)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SendCanTakeQuestResponse(QuestFailedReason msg) const
|
||||
void Player::SendCanTakeQuestResponse(QuestFailedReason reason, bool sendErrorMessage /*= true*/, std::string reasonText /*= ""*/) const
|
||||
{
|
||||
WorldPacket data(SMSG_QUEST_GIVER_INVALID_QUEST, 4);
|
||||
data << uint32(msg);
|
||||
GetSession()->SendPacket(&data);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID");
|
||||
WorldPackets::Quest::QuestGiverInvalidQuest questGiverInvalidQuest;
|
||||
|
||||
questGiverInvalidQuest.Reason = reason;
|
||||
questGiverInvalidQuest.SendErrorMessage = sendErrorMessage;
|
||||
questGiverInvalidQuest.ReasonText = reasonText;
|
||||
|
||||
GetSession()->SendPacket(questGiverInvalidQuest.Write());
|
||||
}
|
||||
|
||||
void Player::SendQuestConfirmAccept(Quest const* quest, Player* receiver)
|
||||
|
||||
@@ -1723,7 +1723,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SendQuestReward(Quest const* quest, uint32 XP);
|
||||
void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);
|
||||
void SendQuestTimerFailed(uint32 questId);
|
||||
void SendCanTakeQuestResponse(QuestFailedReason msg) const;
|
||||
void SendCanTakeQuestResponse(QuestFailedReason reason, bool sendErrorMessage = true, std::string reasonText = "") const;
|
||||
void SendQuestConfirmAccept(Quest const* quest, Player* receiver);
|
||||
void SendPushToPartyResponse(Player* player, QuestPushReason reason);
|
||||
void SendQuestUpdateAddCredit(Quest const* quest, ObjectGuid guid, QuestObjective const& obj, uint16 count);
|
||||
|
||||
@@ -509,3 +509,17 @@ void WorldPackets::Quest::QuestPushResult::Read()
|
||||
_worldPacket >> QuestID;
|
||||
_worldPacket >> Result;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Quest::QuestGiverInvalidQuest::Write()
|
||||
{
|
||||
_worldPacket << Reason;
|
||||
|
||||
_worldPacket.WriteBit(SendErrorMessage);
|
||||
_worldPacket.WriteBits(ReasonText.length(), 9);
|
||||
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
_worldPacket.WriteString(ReasonText);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -515,6 +515,18 @@ namespace WorldPackets
|
||||
uint32 QuestID = 0;
|
||||
uint8 Result = 0;
|
||||
};
|
||||
|
||||
class QuestGiverInvalidQuest final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
QuestGiverInvalidQuest() : ServerPacket(SMSG_QUEST_GIVER_INVALID_QUEST, 16 + 1) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 Reason = 0;
|
||||
bool SendErrorMessage = false;
|
||||
std::string ReasonText;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1514,7 +1514,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_COMPLETION_NPC_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_INVALID_QUEST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_INVALID_QUEST, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user