diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-06-24 23:12:03 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-06-24 23:12:03 +0200 |
| commit | 2ad96f06f03d8319daf4b142f5b343081133e939 (patch) | |
| tree | 8006113fe32dfc806dd84a8c8717e45ff6bc601e /src/server/game/Server | |
| parent | 103a6998fc2cefa6976ef5b148fac5d38828114f (diff) | |
Core/PacketIO: Updated quest packets
Diffstat (limited to 'src/server/game/Server')
| -rw-r--r-- | src/server/game/Server/Packets/QuestPackets.cpp | 104 | ||||
| -rw-r--r-- | src/server/game/Server/Packets/QuestPackets.h | 41 | ||||
| -rw-r--r-- | src/server/game/Server/Protocol/Opcodes.cpp | 12 |
3 files changed, 94 insertions, 63 deletions
diff --git a/src/server/game/Server/Packets/QuestPackets.cpp b/src/server/game/Server/Packets/QuestPackets.cpp index 803da693c95..2b77ad3d8a1 100644 --- a/src/server/game/Server/Packets/QuestPackets.cpp +++ b/src/server/game/Server/Packets/QuestPackets.cpp @@ -77,10 +77,13 @@ WorldPacket const* WorldPackets::Quest::QueryQuestInfoResponse::Write() _worldPacket << int32(Info.RewardMoneyDifficulty); _worldPacket << float(Info.RewardMoneyMultiplier); _worldPacket << int32(Info.RewardBonusMoney); - _worldPacket << int32(Info.RewardDisplaySpell); + _worldPacket.append(Info.RewardDisplaySpell, QUEST_REWARD_DISPLAY_SPELL_COUNT); _worldPacket << int32(Info.RewardSpell); _worldPacket << int32(Info.RewardHonor); _worldPacket << float(Info.RewardKillHonor); + _worldPacket << int32(Info.RewardArtifactXPDifficulty); + _worldPacket << float(Info.RewardArtifactXPMultiplier); + _worldPacket << int32(Info.RewardArtifactCategoryID); _worldPacket << int32(Info.StartItem); _worldPacket << uint32(Info.Flags); _worldPacket << uint32(Info.FlagsEx); @@ -106,7 +109,6 @@ WorldPacket const* WorldPackets::Quest::QueryQuestInfoResponse::Write() _worldPacket << int32(Info.POIPriority); _worldPacket << int32(Info.RewardTitle); - _worldPacket << int32(Info.RewardTalents); _worldPacket << int32(Info.RewardArenaPoints); _worldPacket << int32(Info.RewardSkillLineID); _worldPacket << int32(Info.RewardNumSkillUps); @@ -117,8 +119,9 @@ WorldPacket const* WorldPackets::Quest::QueryQuestInfoResponse::Write() for (uint32 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i) { _worldPacket << int32(Info.RewardFactionID[i]); - _worldPacket << int32(Info.RewardFactionValue[i]); _worldPacket << int32(Info.RewardFactionOverride[i]); + _worldPacket << int32(Info.RewardFactionValue[i]); + _worldPacket << int32(Info.RewardFactionCapIn[i]); } _worldPacket << int32(Info.RewardFactionFlags); @@ -137,6 +140,18 @@ WorldPacket const* WorldPackets::Quest::QueryQuestInfoResponse::Write() _worldPacket << int32(Info.Objectives.size()); _worldPacket << int32(Info.AllowableRaces); + _worldPacket << int32(Info.QuestRewardID); + + _worldPacket.WriteBits(Info.LogTitle.size(), 9); + _worldPacket.WriteBits(Info.LogDescription.size(), 12); + _worldPacket.WriteBits(Info.QuestDescription.size(), 12); + _worldPacket.WriteBits(Info.AreaDescription.size(), 9); + _worldPacket.WriteBits(Info.PortraitGiverText.size(), 10); + _worldPacket.WriteBits(Info.PortraitGiverName.size(), 8); + _worldPacket.WriteBits(Info.PortraitTurnInText.size(), 10); + _worldPacket.WriteBits(Info.PortraitTurnInName.size(), 8); + _worldPacket.WriteBits(Info.QuestCompletionLog.size(), 11); + _worldPacket.FlushBits(); for (QuestObjective const& questObjective : Info.Objectives) { @@ -158,17 +173,6 @@ WorldPacket const* WorldPackets::Quest::QueryQuestInfoResponse::Write() _worldPacket.WriteString(questObjective.Description); } - _worldPacket.WriteBits(Info.LogTitle.size(), 9); - _worldPacket.WriteBits(Info.LogDescription.size(), 12); - _worldPacket.WriteBits(Info.QuestDescription.size(), 12); - _worldPacket.WriteBits(Info.AreaDescription.size(), 9); - _worldPacket.WriteBits(Info.PortraitGiverText.size(), 10); - _worldPacket.WriteBits(Info.PortraitGiverName.size(), 8); - _worldPacket.WriteBits(Info.PortraitTurnInText.size(), 10); - _worldPacket.WriteBits(Info.PortraitTurnInName.size(), 8); - _worldPacket.WriteBits(Info.QuestCompletionLog.size(), 11); - _worldPacket.FlushBits(); - _worldPacket.WriteString(Info.LogTitle); _worldPacket.WriteString(Info.LogDescription); _worldPacket.WriteString(Info.QuestDescription); @@ -205,48 +209,53 @@ WorldPacket const* WorldPackets::Quest::QuestUpdateAddPvPCredit::Write() ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Quest::QuestRewards const& questRewards) { - data << questRewards.ChoiceItemCount; + data << int32(questRewards.ChoiceItemCount); for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { - data << questRewards.ChoiceItems[i].ItemID; - data << questRewards.ChoiceItems[i].Quantity; + data << int32(questRewards.ChoiceItems[i].ItemID); + data << int32(questRewards.ChoiceItems[i].Quantity); } - data << questRewards.ItemCount; + data << int32(questRewards.ItemCount); for (uint32 i = 0; i < QUEST_REWARD_ITEM_COUNT; ++i) { - data << questRewards.ItemID[i]; - data << questRewards.ItemQty[i]; + data << int32(questRewards.ItemID[i]); + data << int32(questRewards.ItemQty[i]); } - data << questRewards.Money; - data << questRewards.XP; - data << questRewards.Title; - data << questRewards.Talents; - data << questRewards.FactionFlags; + data << int32(questRewards.Money); + data << int32(questRewards.XP); + data << int32(questRewards.ArtifactXP); + data << int32(questRewards.Honor); + data << int32(questRewards.Title); + data << int32(questRewards.FactionFlags); for (uint32 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i) { - data << questRewards.FactionID[i]; - data << questRewards.FactionValue[i]; - data << questRewards.FactionOverride[i]; + data << int32(questRewards.FactionID[i]); + data << int32(questRewards.FactionOverride[i]); + data << int32(questRewards.FactionValue[i]); + data << int32(questRewards.FactionCapIn[i]); } - data << questRewards.SpellCompletionDisplayID; - data << questRewards.SpellCompletionID; + for (uint32 i = 0; i < QUEST_REWARD_DISPLAY_SPELL_COUNT; ++i) + data << int32(questRewards.SpellCompletionDisplayID[i]); + + data << int32(questRewards.SpellCompletionID); for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) { - data << questRewards.CurrencyID[i]; - data << questRewards.CurrencyQty[i]; + data << int32(questRewards.CurrencyID[i]); + data << int32(questRewards.CurrencyQty[i]); } - data << questRewards.SkillLineID; - data << questRewards.NumSkillUps; + data << int32(questRewards.SkillLineID); + data << int32(questRewards.NumSkillUps); + data << int32(questRewards.RewardID); - data.WriteBit(false); // Unk + data.WriteBit(questRewards.IsBoostSpell); data.FlushBits(); return data; @@ -260,8 +269,6 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Quest::QuestGiverOfferRew data << int32(offer.QuestFlags[0]); // Flags data << int32(offer.QuestFlags[1]); // FlagsEx data << int32(offer.SuggestedPartyMembers); - data << offer.Rewards; // WorldPackets::Quest::QuestRewards - data << int32(offer.Emotes.size()); for (WorldPackets::Quest::QuestDescEmote const& emote : offer.Emotes) { @@ -272,6 +279,8 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Quest::QuestGiverOfferRew data.WriteBit(offer.AutoLaunched); data.FlushBits(); + data << offer.Rewards; // WorldPackets::Quest::QuestRewards + return data; } @@ -310,15 +319,15 @@ void WorldPackets::Quest::QuestGiverChooseReward::Read() WorldPacket const* WorldPackets::Quest::QuestGiverQuestComplete::Write() { _worldPacket << int32(QuestID); + _worldPacket << int32(XPReward); + _worldPacket << int64(MoneyReward); _worldPacket << int32(SkillLineIDReward); - _worldPacket << int32(MoneyReward); _worldPacket << int32(NumSkillUpsReward); - _worldPacket << int32(XPReward); - _worldPacket << int32(TalentReward); _worldPacket << ItemReward; - _worldPacket.WriteBit(UseQuestReward); _worldPacket.WriteBit(LaunchGossip); + _worldPacket.WriteBit(LaunchQuest); + _worldPacket.WriteBit(HideChatMessage); _worldPacket.FlushBits(); return &_worldPacket; @@ -342,10 +351,11 @@ WorldPacket const* WorldPackets::Quest::QuestGiverQuestDetails::Write() _worldPacket << uint32(QuestFlags[0]); // Flags _worldPacket << uint32(QuestFlags[1]); // FlagsEx _worldPacket << int32(PortraitTurnIn); - _worldPacket << int32(LearnSpells.size()); + _worldPacket << uint32(LearnSpells.size()); _worldPacket << Rewards; // WorldPackets::Quest::QuestRewards _worldPacket << int32(DescEmotes.size()); _worldPacket << int32(Objectives.size()); + _worldPacket << int32(QuestStartItemID); for (int32 spell : LearnSpells) _worldPacket << int32(spell); @@ -374,6 +384,8 @@ WorldPacket const* WorldPackets::Quest::QuestGiverQuestDetails::Write() _worldPacket.WriteBit(DisplayPopup); _worldPacket.WriteBit(StartCheat); _worldPacket.WriteBit(AutoLaunched); + _worldPacket.WriteBit(CanIgnoreQuest); + _worldPacket.WriteBit(IsQuestIgnored); _worldPacket.FlushBits(); _worldPacket.WriteString(QuestTitle); @@ -406,6 +418,7 @@ WorldPacket const* WorldPackets::Quest::QuestGiverRequestItems::Write() { _worldPacket << int32(obj.ObjectID); _worldPacket << int32(obj.Amount); + _worldPacket << uint32(obj.Flags); } for (QuestCurrency const& cur : Currency) @@ -415,6 +428,7 @@ WorldPacket const* WorldPackets::Quest::QuestGiverRequestItems::Write() } _worldPacket.WriteBit(AutoLaunched); + _worldPacket.WriteBit(CanIgnoreQuest); _worldPacket.FlushBits(); _worldPacket.WriteBits(QuestTitle.size(), 9); @@ -458,6 +472,9 @@ WorldPacket const* WorldPackets::Quest::QuestGiverQuestList::Write() _worldPacket << uint32(GreetEmoteDelay); _worldPacket << uint32(GreetEmoteType); _worldPacket << uint32(GossipTexts.size()); + _worldPacket.WriteBits(Greeting.size(), 11); + _worldPacket.FlushBits(); + for (GossipTextData const& gossip : GossipTexts) { _worldPacket << uint32(gossip.QuestID); @@ -466,13 +483,12 @@ WorldPacket const* WorldPackets::Quest::QuestGiverQuestList::Write() _worldPacket << uint32(gossip.QuestFlags); _worldPacket << uint32(gossip.QuestFlagsEx); _worldPacket.WriteBit(gossip.Repeatable); + _worldPacket.WriteBit(gossip.IsQuestIgnored); _worldPacket.WriteBits(gossip.QuestTitle.size(), 9); _worldPacket.FlushBits(); _worldPacket.WriteString(gossip.QuestTitle); } - _worldPacket.WriteBits(Greeting.size(), 11); - _worldPacket.FlushBits(); _worldPacket.WriteString(Greeting); return &_worldPacket; diff --git a/src/server/game/Server/Packets/QuestPackets.h b/src/server/game/Server/Packets/QuestPackets.h index b321b4076a5..2585c2f871c 100644 --- a/src/server/game/Server/Packets/QuestPackets.h +++ b/src/server/game/Server/Packets/QuestPackets.h @@ -121,10 +121,13 @@ namespace WorldPackets int32 RewardMoneyDifficulty = 0; float RewardMoneyMultiplier = 1.0f; int32 RewardBonusMoney = 0; - int32 RewardDisplaySpell = 0; // reward spell, this spell will be displayed (icon) + int32 RewardDisplaySpell[QUEST_REWARD_DISPLAY_SPELL_COUNT] = {}; // reward spell, this spell will be displayed (icon) int32 RewardSpell = 0; int32 RewardHonor = 0; float RewardKillHonor = 0.0f; + int32 RewardArtifactXPDifficulty = 0; + float RewardArtifactXPMultiplier = 0.0f; + int32 RewardArtifactCategoryID = 0; int32 StartItem = 0; uint32 Flags = 0; uint32 FlagsEx = 0; @@ -138,7 +141,6 @@ namespace WorldPackets std::string QuestDescription; std::string AreaDescription; int32 RewardTitle = 0; // new 2.4.0, player gets this title (id from CharTitles) - int32 RewardTalents = 0; int32 RewardArenaPoints = 0; int32 RewardSkillLineID = 0; // reward skill id int32 RewardNumSkillUps = 0; // reward skill points @@ -154,6 +156,7 @@ namespace WorldPackets int32 CompleteSoundKitID = 0; int32 AreaGroupID = 0; int32 TimeAllowed = 0; + int32 QuestRewardID = 0; std::vector<QuestObjective> Objectives; int32 RewardItems[QUEST_REWARD_ITEM_COUNT] = {}; int32 RewardAmount[QUEST_REWARD_ITEM_COUNT] = {}; @@ -163,6 +166,7 @@ namespace WorldPackets int32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT] = {}; int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = {}; int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = {}; + int32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = {}; int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT] = {}; int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = {}; }; @@ -217,21 +221,25 @@ namespace WorldPackets int32 ItemCount = 0; int32 Money = 0; int32 XP = 0; + int32 ArtifactXP = 0; + int32 Honor = 0; int32 Title = 0; - int32 Talents = 0; int32 FactionFlags = 0; - int32 SpellCompletionDisplayID = 0; + int32 SpellCompletionDisplayID[QUEST_REWARD_DISPLAY_SPELL_COUNT] = {}; int32 SpellCompletionID = 0; int32 SkillLineID = 0; int32 NumSkillUps = 0; + int32 RewardID = 0; QuestChoiceItem ChoiceItems[QUEST_REWARD_CHOICES_COUNT]; int32 ItemID[QUEST_REWARD_ITEM_COUNT] = {}; int32 ItemQty[QUEST_REWARD_ITEM_COUNT] = {}; int32 FactionID[QUEST_REWARD_REPUTATIONS_COUNT] = {}; int32 FactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = {}; int32 FactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = {}; + int32 FactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = {}; int32 CurrencyID[QUEST_REWARD_CURRENCY_COUNT] = {}; int32 CurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = {}; + bool IsBoostSpell = false; }; struct QuestDescEmote @@ -291,14 +299,15 @@ namespace WorldPackets WorldPacket const* Write() override; - bool UseQuestReward = false; + int32 QuestID = 0; + int32 XPReward = 0; + int64 MoneyReward = 0; int32 SkillLineIDReward = 0; - int32 MoneyReward = 0; int32 NumSkillUpsReward = 0; - int32 XPReward = 0; - int32 QuestID = 0; - int32 TalentReward = 0; - bool LaunchGossip = 0; + bool UseQuestReward = false; + bool LaunchGossip = false; + bool LaunchQuest = false; + bool HideChatMessage = false; WorldPackets::Item::ItemInstance ItemReward; }; @@ -341,6 +350,7 @@ namespace WorldPackets std::vector<int32> LearnSpells; int32 PortraitTurnIn = 0; int32 PortraitGiver = 0; + int32 QuestStartItemID = 0; std::string PortraitGiverText; std::string PortraitGiverName; std::string PortraitTurnInText; @@ -351,13 +361,16 @@ namespace WorldPackets bool DisplayPopup = false; bool StartCheat = false; bool AutoLaunched = false; + bool CanIgnoreQuest = false; + bool IsQuestIgnored = false; }; struct QuestObjectiveCollect { - QuestObjectiveCollect(int32 objectID = 0, int32 amount = 0) : ObjectID(objectID), Amount(amount) { } + QuestObjectiveCollect(int32 objectID = 0, int32 amount = 0, uint32 flags = 0) : ObjectID(objectID), Amount(amount), Flags(flags) { } int32 ObjectID; int32 Amount; + uint32 Flags; }; struct QuestCurrency @@ -388,6 +401,7 @@ namespace WorldPackets uint32 QuestFlags[2] = {}; std::string QuestTitle; std::string CompletionText; + bool CanIgnoreQuest = false; }; class QuestGiverRequestReward final : public ClientPacket @@ -437,14 +451,15 @@ namespace WorldPackets struct GossipTextData { - GossipTextData(uint32 questID, uint32 questType, uint32 questLevel, uint32 questFlags, uint32 questFlagsEx, bool repeatable, std::string questTitle) : - QuestID(questID), QuestType(questType), QuestLevel(questLevel), QuestFlags(questFlags), QuestFlagsEx(questFlagsEx), Repeatable(repeatable), QuestTitle(questTitle) { } + GossipTextData(uint32 questID, uint32 questType, uint32 questLevel, uint32 questFlags, uint32 questFlagsEx, bool repeatable, bool ignored, std::string questTitle) : + QuestID(questID), QuestType(questType), QuestLevel(questLevel), QuestFlags(questFlags), QuestFlagsEx(questFlagsEx), Repeatable(repeatable), IsQuestIgnored(ignored), QuestTitle(questTitle) { } uint32 QuestID; uint32 QuestType; uint32 QuestLevel; uint32 QuestFlags; uint32 QuestFlagsEx; bool Repeatable; + bool IsQuestIgnored; std::string QuestTitle; }; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f6a5f035732..811c8eb067d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1513,19 +1513,19 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PETITION_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PET_NAME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PLAYER_NAME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_QUEST_INFO_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_QUEST_INFO_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_QUEST_REWARD_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_COMPLETION_NPC_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); 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_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_COMPLETE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_QUEST_DETAILS, STATUS_UNHANDLED, 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); 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_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_REQUEST_ITEMS, STATUS_UNHANDLED, 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); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_GIVER_STATUS_MULTIPLE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_IGNORED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); |
