TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
QuestPackets.cpp File Reference
#include "QuestPackets.h"
+ Include dependency graph for QuestPackets.cpp:

Functions

ByteBufferoperator<< (ByteBuffer &data, WorldPackets::Quest::QuestRewards const &questRewards)
 
ByteBufferoperator<< (ByteBuffer &data, WorldPackets::Quest::QuestGiverOfferReward const &offer)
 

Function Documentation

ByteBuffer& operator<< ( ByteBuffer data,
WorldPackets::Quest::QuestRewards const questRewards 
)
207 {
208  data << questRewards.ChoiceItemCount;
209 
210  for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
211  {
212  data << questRewards.ChoiceItems[i].ItemID;
213  data << questRewards.ChoiceItems[i].Quantity;
214  }
215 
216  data << questRewards.ItemCount;
217 
218  for (uint32 i = 0; i < QUEST_REWARD_ITEM_COUNT; ++i)
219  {
220  data << questRewards.ItemID[i];
221  data << questRewards.ItemQty[i];
222  }
223 
224  data << questRewards.Money;
225  data << questRewards.XP;
226  data << questRewards.Title;
227  data << questRewards.Talents;
228  data << questRewards.FactionFlags;
229 
230  for (uint32 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i)
231  {
232  data << questRewards.FactionID[i];
233  data << questRewards.FactionValue[i];
234  data << questRewards.FactionOverride[i];
235  }
236 
237  data << questRewards.SpellCompletionDisplayID;
238  data << questRewards.SpellCompletionID;
239 
240  for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
241  {
242  data << questRewards.CurrencyID[i];
243  data << questRewards.CurrencyQty[i];
244  }
245 
246  data << questRewards.SkillLineID;
247  data << questRewards.NumSkillUps;
248 
249  data.WriteBit(false); // Unk
250  data.FlushBits();
251 
252  return data;
253 }
void FlushBits()
Definition: ByteBuffer.h:150
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
#define QUEST_REWARD_CURRENCY_COUNT
Definition: QuestDef.h:51
uint32_t uint32
Definition: Define.h:150
#define QUEST_REWARD_CHOICES_COUNT
Definition: QuestDef.h:46
#define QUEST_REWARD_ITEM_COUNT
Definition: QuestDef.h:47
#define QUEST_REWARD_REPUTATIONS_COUNT
Definition: QuestDef.h:49

+ Here is the call graph for this function:

256 {
257  data << offer.QuestGiverGUID;
258  data << int32(offer.QuestGiverCreatureID);
259  data << int32(offer.QuestID);
260  data << int32(offer.QuestFlags[0]); // Flags
261  data << int32(offer.QuestFlags[1]); // FlagsEx
262  data << int32(offer.SuggestedPartyMembers);
263  data << offer.Rewards; // WorldPackets::Quest::QuestRewards
264 
265  data << int32(offer.Emotes.size());
266  for (WorldPackets::Quest::QuestDescEmote const& emote : offer.Emotes)
267  {
268  data << int32(emote.Type);
269  data << uint32(emote.Delay);
270  }
271 
272  data.WriteBit(offer.AutoLaunched);
273  data.FlushBits();
274 
275  return data;
276 }
void FlushBits()
Definition: ByteBuffer.h:150
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
Definition: QuestPackets.h:237
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
uint32 Delay
Definition: QuestPackets.h:241
int32 Type
Definition: QuestPackets.h:240

+ Here is the call graph for this function: