TrinityCore
SpellCastTargets Class Reference

#include <SpellDefines.h>

Public Member Functions

 SpellCastTargets ()
 
 SpellCastTargets (Unit *caster, WorldPackets::Spells::SpellCastRequest const &spellCastRequest)
 
 ~SpellCastTargets ()
 
void Write (WorldPackets::Spells::SpellTargetData &data)
 
uint32 GetTargetMask () const
 
void SetTargetMask (uint32 newMask)
 
void SetTargetFlag (SpellCastTargetFlags flag)
 
ObjectGuid GetUnitTargetGUID () const
 
UnitGetUnitTarget () const
 
void SetUnitTarget (Unit *target)
 
ObjectGuid GetGOTargetGUID () const
 
GameObjectGetGOTarget () const
 
void SetGOTarget (GameObject *target)
 
ObjectGuid GetCorpseTargetGUID () const
 
CorpseGetCorpseTarget () const
 
WorldObjectGetObjectTarget () const
 
ObjectGuid GetObjectTargetGUID () const
 
void RemoveObjectTarget ()
 
ObjectGuid GetItemTargetGUID () const
 
ItemGetItemTarget () const
 
uint32 GetItemTargetEntry () const
 
void SetItemTarget (Item *item)
 
void SetTradeItemTarget (Player *caster)
 
void UpdateTradeSlotItem ()
 
SpellDestination const * GetSrc () const
 
Position const * GetSrcPos () const
 
void SetSrc (float x, float y, float z)
 
void SetSrc (Position const &pos)
 
void SetSrc (WorldObject const &wObj)
 
void ModSrc (Position const &pos)
 
void RemoveSrc ()
 
SpellDestination const * GetDst () const
 
WorldLocation const * GetDstPos () const
 
void SetDst (float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
 
void SetDst (Position const &pos)
 
void SetDst (WorldObject const &wObj)
 
void SetDst (SpellDestination const &spellDest)
 
void SetDst (SpellCastTargets const &spellTargets)
 
void ModDst (Position const &pos)
 
void ModDst (SpellDestination const &spellDest)
 
void RemoveDst ()
 
bool HasSrc () const
 
bool HasDst () const
 
bool HasTraj () const
 
float GetPitch () const
 
void SetPitch (float pitch)
 
float GetSpeed () const
 
void SetSpeed (float speed)
 
float GetDist2d () const
 
float GetSpeedXY () const
 
float GetSpeedZ () const
 
void Update (WorldObject *caster)
 
std::string GetTargetString () const
 

Private Attributes

uint32 m_targetMask
 
WorldObjectm_objectTarget
 
Itemm_itemTarget
 
ObjectGuid m_objectTargetGUID
 
ObjectGuid m_itemTargetGUID
 
uint32 m_itemTargetEntry
 
SpellDestination m_src
 
SpellDestination m_dst
 
float m_pitch
 
float m_speed
 
std::string m_strTarget
 

Constructor & Destructor Documentation

◆ SpellCastTargets() [1/2]

SpellCastTargets::SpellCastTargets ( )
122  : m_targetMask(0), m_objectTarget(nullptr), m_itemTarget(nullptr),
123  m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f)
124 {
125 }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
float m_speed
Definition: SpellDefines.h:407
Item * m_itemTarget
Definition: SpellDefines.h:397
uint32 m_targetMask
Definition: SpellDefines.h:393
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
float m_pitch
Definition: SpellDefines.h:407

◆ SpellCastTargets() [2/2]

SpellCastTargets::SpellCastTargets ( Unit caster,
WorldPackets::Spells::SpellCastRequest const &  spellCastRequest 
)
127  :
128  m_targetMask(spellCastRequest.Target.Flags), m_objectTarget(nullptr), m_itemTarget(nullptr),
129  m_objectTargetGUID(spellCastRequest.Target.Unit), m_itemTargetGUID(spellCastRequest.Target.Item),
130  m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f), m_strTarget(spellCastRequest.Target.Name)
131 {
132  if (spellCastRequest.Target.SrcLocation)
133  {
134  m_src._transportGUID = spellCastRequest.Target.SrcLocation->Transport;
135  Position* pos;
137  pos = &m_src._transportOffset;
138  else
139  pos = &m_src._position;
140 
141  pos->Relocate(spellCastRequest.Target.SrcLocation->Location);
142  if (spellCastRequest.Target.Orientation)
143  pos->SetOrientation(*spellCastRequest.Target.Orientation);
144  }
145 
146  if (spellCastRequest.Target.DstLocation)
147  {
148  m_dst._transportGUID = spellCastRequest.Target.DstLocation->Transport;
149  Position* pos;
151  pos = &m_dst._transportOffset;
152  else
153  pos = &m_dst._position;
154 
155  pos->Relocate(spellCastRequest.Target.DstLocation->Location);
156  if (spellCastRequest.Target.Orientation)
157  pos->SetOrientation(*spellCastRequest.Target.Orientation);
158  }
159 
160  SetPitch(spellCastRequest.MissileTrajectory.Pitch);
161  SetSpeed(spellCastRequest.MissileTrajectory.Speed);
162 
163  Update(caster);
164 }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
Position _transportOffset
Definition: SpellDefines.h:318
SpellDestination m_src
Definition: SpellDefines.h:404
float m_speed
Definition: SpellDefines.h:407
void SetOrientation(float orientation)
Definition: Position.h:72
WorldLocation _position
Definition: SpellDefines.h:316
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
void Update(WorldObject *caster)
Definition: Spell.cpp:422
void SetPitch(float pitch)
Definition: SpellDefines.h:381
SpellDestination m_dst
Definition: SpellDefines.h:405
void Relocate(float x, float y)
Definition: Position.h:64
ObjectGuid _transportGUID
Definition: SpellDefines.h:317
Item * m_itemTarget
Definition: SpellDefines.h:397
uint32 m_targetMask
Definition: SpellDefines.h:393
void SetSpeed(float speed)
Definition: SpellDefines.h:383
bool IsEmpty() const
Definition: ObjectGuid.h:310
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:401
Definition: Position.h:27
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
std::string m_strTarget
Definition: SpellDefines.h:408
float m_pitch
Definition: SpellDefines.h:407
+ Here is the call graph for this function:

◆ ~SpellCastTargets()

SpellCastTargets::~SpellCastTargets ( )
166 { }

Member Function Documentation

◆ GetCorpseTarget()

Corpse * SpellCastTargets::GetCorpseTarget ( ) const
263 {
264  if (m_objectTarget)
265  return m_objectTarget->ToCorpse();
266 
267  return nullptr;
268 }
static Corpse * ToCorpse(Object *o)
Definition: Object.h:222
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCorpseTargetGUID()

ObjectGuid SpellCastTargets::GetCorpseTargetGUID ( ) const
255 {
257  return m_objectTargetGUID;
258 
259  return ObjectGuid::Empty;
260 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:265
bool IsCorpse() const
Definition: ObjectGuid.h:322
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDist2d()

float SpellCastTargets::GetDist2d ( ) const
inline
SpellDestination m_src
Definition: SpellDefines.h:404
WorldLocation _position
Definition: SpellDefines.h:316
SpellDestination m_dst
Definition: SpellDefines.h:405
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:107
+ Here is the caller graph for this function:

◆ GetDst()

SpellDestination const * SpellCastTargets::GetDst ( ) const
356 {
357  return &m_dst;
358 }
SpellDestination m_dst
Definition: SpellDefines.h:405
+ Here is the caller graph for this function:

◆ GetDstPos()

WorldLocation const * SpellCastTargets::GetDstPos ( ) const
361 {
362  return &m_dst._position;
363 }
WorldLocation _position
Definition: SpellDefines.h:316
SpellDestination m_dst
Definition: SpellDefines.h:405
+ Here is the caller graph for this function:

◆ GetGOTarget()

GameObject * SpellCastTargets::GetGOTarget ( ) const
237 {
238  if (m_objectTarget)
239  return m_objectTarget->ToGameObject();
240 
241  return nullptr;
242 }
static GameObject * ToGameObject(Object *o)
Definition: Object.h:216
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGOTargetGUID()

ObjectGuid SpellCastTargets::GetGOTargetGUID ( ) const
229 {
231  return m_objectTargetGUID;
232 
233  return ObjectGuid::Empty;
234 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:265
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
bool IsAnyTypeGameObject() const
Definition: ObjectGuid.h:325
+ Here is the call graph for this function:

◆ GetItemTarget()

Item* SpellCastTargets::GetItemTarget ( ) const
inline
351 { return m_itemTarget; }
Item * m_itemTarget
Definition: SpellDefines.h:397
+ Here is the caller graph for this function:

◆ GetItemTargetEntry()

uint32 SpellCastTargets::GetItemTargetEntry ( ) const
inline
352 { return m_itemTargetEntry; }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
+ Here is the caller graph for this function:

◆ GetItemTargetGUID()

ObjectGuid SpellCastTargets::GetItemTargetGUID ( ) const
inline
350 { return m_itemTargetGUID; }
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:401
+ Here is the caller graph for this function:

◆ GetObjectTarget()

WorldObject * SpellCastTargets::GetObjectTarget ( ) const
271 {
272  return m_objectTarget;
273 }
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
+ Here is the caller graph for this function:

◆ GetObjectTargetGUID()

ObjectGuid SpellCastTargets::GetObjectTargetGUID ( ) const
276 {
277  return m_objectTargetGUID;
278 }
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
+ Here is the caller graph for this function:

◆ GetPitch()

float SpellCastTargets::GetPitch ( ) const
inline
380 { return m_pitch; }
float m_pitch
Definition: SpellDefines.h:407
+ Here is the caller graph for this function:

◆ GetSpeed()

float SpellCastTargets::GetSpeed ( ) const
inline
382 { return m_speed; }
float m_speed
Definition: SpellDefines.h:407

◆ GetSpeedXY()

float SpellCastTargets::GetSpeedXY ( ) const
inline
386 { return m_speed * std::cos(m_pitch); }
float m_speed
Definition: SpellDefines.h:407
float m_pitch
Definition: SpellDefines.h:407
+ Here is the caller graph for this function:

◆ GetSpeedZ()

float SpellCastTargets::GetSpeedZ ( ) const
inline
387 { return m_speed * std::sin(m_pitch); }
float m_speed
Definition: SpellDefines.h:407
float m_pitch
Definition: SpellDefines.h:407
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSrc()

SpellDestination const * SpellCastTargets::GetSrc ( ) const
317 {
318  return &m_src;
319 }
SpellDestination m_src
Definition: SpellDefines.h:404

◆ GetSrcPos()

Position const * SpellCastTargets::GetSrcPos ( ) const
322 {
323  return &m_src._position;
324 }
SpellDestination m_src
Definition: SpellDefines.h:404
WorldLocation _position
Definition: SpellDefines.h:316
+ Here is the caller graph for this function:

◆ GetTargetMask()

uint32 SpellCastTargets::GetTargetMask ( ) const
inline
330 { return m_targetMask; }
uint32 m_targetMask
Definition: SpellDefines.h:393
+ Here is the caller graph for this function:

◆ GetTargetString()

std::string SpellCastTargets::GetTargetString ( ) const
inline
390 { return m_strTarget; }
std::string m_strTarget
Definition: SpellDefines.h:408

◆ GetUnitTarget()

Unit * SpellCastTargets::GetUnitTarget ( ) const
211 {
212  if (m_objectTarget)
213  return m_objectTarget->ToUnit();
214 
215  return nullptr;
216 }
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
static Unit * ToUnit(Object *o)
Definition: Object.h:210
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetUnitTargetGUID()

ObjectGuid SpellCastTargets::GetUnitTargetGUID ( ) const
203 {
205  return m_objectTargetGUID;
206 
207  return ObjectGuid::Empty;
208 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:265
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
bool IsUnit() const
Definition: ObjectGuid.h:318
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasDst()

bool SpellCastTargets::HasDst ( ) const
418 {
419  return (GetTargetMask() & TARGET_FLAG_DEST_LOCATION) != 0;
420 }
uint32 GetTargetMask() const
Definition: SpellDefines.h:330
Definition: SpellDefines.h:277
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasSrc()

bool SpellCastTargets::HasSrc ( ) const
413 {
414  return (GetTargetMask() & TARGET_FLAG_SOURCE_LOCATION) != 0;
415 }
uint32 GetTargetMask() const
Definition: SpellDefines.h:330
Definition: SpellDefines.h:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasTraj()

bool SpellCastTargets::HasTraj ( ) const
inline
378 { return m_speed != 0; }
float m_speed
Definition: SpellDefines.h:407
+ Here is the caller graph for this function:

◆ ModDst() [1/2]

void SpellCastTargets::ModDst ( Position const &  pos)
396 {
398  m_dst.Relocate(pos);
399 }
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
void Relocate(Position const &pos)
Definition: Spell.cpp:103
Definition: SpellDefines.h:277
#define ASSERT
Definition: Errors.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ModDst() [2/2]

void SpellCastTargets::ModDst ( SpellDestination const &  spellDest)
402 {
404  m_dst = spellDest;
405 }
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277
#define ASSERT
Definition: Errors.h:68

◆ ModSrc()

void SpellCastTargets::ModSrc ( Position const &  pos)
345 {
347  m_src.Relocate(pos);
348 }
SpellDestination m_src
Definition: SpellDefines.h:404
uint32 m_targetMask
Definition: SpellDefines.h:393
void Relocate(Position const &pos)
Definition: Spell.cpp:103
#define ASSERT
Definition: Errors.h:68
Definition: SpellDefines.h:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveDst()

void SpellCastTargets::RemoveDst ( )
408 {
410 }
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277
+ Here is the caller graph for this function:

◆ RemoveObjectTarget()

void SpellCastTargets::RemoveObjectTarget ( )
281 {
282  m_objectTarget = nullptr;
285 }
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
Definition: SpellDefines.h:301
Definition: SpellDefines.h:298
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:300
void Clear()
Definition: ObjectGuid.h:277
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveSrc()

void SpellCastTargets::RemoveSrc ( )
351 {
353 }
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:276
+ Here is the caller graph for this function:

◆ SetDst() [1/5]

void SpellCastTargets::SetDst ( float  x,
float  y,
float  z,
float  orientation,
uint32  mapId = MAPID_INVALID 
)
366 {
367  m_dst = SpellDestination(x, y, z, orientation, mapId);
369 }
Definition: SpellDefines.h:305
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277
+ Here is the caller graph for this function:

◆ SetDst() [2/5]

void SpellCastTargets::SetDst ( Position const &  pos)
372 {
373  m_dst = SpellDestination(pos);
375 }
Definition: SpellDefines.h:305
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277

◆ SetDst() [3/5]

void SpellCastTargets::SetDst ( WorldObject const &  wObj)
378 {
379  m_dst = SpellDestination(wObj);
381 }
Definition: SpellDefines.h:305
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277

◆ SetDst() [4/5]

void SpellCastTargets::SetDst ( SpellDestination const &  spellDest)
384 {
385  m_dst = spellDest;
387 }
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277

◆ SetDst() [5/5]

void SpellCastTargets::SetDst ( SpellCastTargets const &  spellTargets)
390 {
391  m_dst = spellTargets.m_dst;
393 }
SpellDestination m_dst
Definition: SpellDefines.h:405
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:277

◆ SetGOTarget()

void SpellCastTargets::SetGOTarget ( GameObject target)
245 {
246  if (!target)
247  return;
248 
249  m_objectTarget = target;
250  m_objectTargetGUID = target->GetGUID();
252 }
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
Definition: SpellDefines.h:282
uint32 m_targetMask
Definition: SpellDefines.h:393
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetItemTarget()

void SpellCastTargets::SetItemTarget ( Item item)
288 {
289  if (!item)
290  return;
291 
292  m_itemTarget = item;
293  m_itemTargetGUID = item->GetGUID();
294  m_itemTargetEntry = item->GetEntry();
296 }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
Item * m_itemTarget
Definition: SpellDefines.h:397
uint32 m_targetMask
Definition: SpellDefines.h:393
uint32 GetEntry() const
Definition: Object.h:158
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:401
Definition: SpellDefines.h:275
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPitch()

void SpellCastTargets::SetPitch ( float  pitch)
inline
381 { m_pitch = pitch; }
float m_pitch
Definition: SpellDefines.h:407
+ Here is the caller graph for this function:

◆ SetSpeed()

void SpellCastTargets::SetSpeed ( float  speed)
inline
383 { m_speed = speed; }
float m_speed
Definition: SpellDefines.h:407
+ Here is the caller graph for this function:

◆ SetSrc() [1/3]

void SpellCastTargets::SetSrc ( float  x,
float  y,
float  z 
)
327 {
328  m_src = SpellDestination(x, y, z);
330 }
SpellDestination m_src
Definition: SpellDefines.h:404
Definition: SpellDefines.h:305
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:276
+ Here is the caller graph for this function:

◆ SetSrc() [2/3]

void SpellCastTargets::SetSrc ( Position const &  pos)
333 {
334  m_src = SpellDestination(pos);
336 }
SpellDestination m_src
Definition: SpellDefines.h:404
Definition: SpellDefines.h:305
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:276

◆ SetSrc() [3/3]

void SpellCastTargets::SetSrc ( WorldObject const &  wObj)
339 {
340  m_src = SpellDestination(wObj);
342 }
SpellDestination m_src
Definition: SpellDefines.h:404
Definition: SpellDefines.h:305
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:276

◆ SetTargetFlag()

void SpellCastTargets::SetTargetFlag ( SpellCastTargetFlags  flag)
inline
333 { m_targetMask |= flag; }
uint32 m_targetMask
Definition: SpellDefines.h:393
+ Here is the caller graph for this function:

◆ SetTargetMask()

void SpellCastTargets::SetTargetMask ( uint32  newMask)
inline
331 { m_targetMask = newMask; }
uint32 m_targetMask
Definition: SpellDefines.h:393

◆ SetTradeItemTarget()

void SpellCastTargets::SetTradeItemTarget ( Player caster)
299 {
301  m_itemTargetEntry = 0;
303 
304  Update(caster);
305 }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
Definition: SpellDefines.h:283
void Update(WorldObject *caster)
Definition: Spell.cpp:422
uint32 m_targetMask
Definition: SpellDefines.h:393
static ObjectGuid const TradeItem
Definition: ObjectGuid.h:267
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:401
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetUnitTarget()

void SpellCastTargets::SetUnitTarget ( Unit target)
219 {
220  if (!target)
221  return;
222 
223  m_objectTarget = target;
224  m_objectTargetGUID = target->GetGUID();
226 }
Definition: SpellDefines.h:272
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
uint32 m_targetMask
Definition: SpellDefines.h:393
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update()

void SpellCastTargets::Update ( WorldObject caster)
423 {
425 
426  m_itemTarget = nullptr;
427  if (caster->GetTypeId() == TYPEID_PLAYER)
428  {
429  Player* player = caster->ToPlayer();
433  {
435  if (TradeData* pTrade = player->GetTradeData())
436  m_itemTarget = pTrade->GetTraderData()->GetItem(TRADE_SLOT_NONTRADED);
437  }
438 
439  if (m_itemTarget)
441  }
442 
443  // update positions by transport move
444  if (HasSrc() && !m_src._transportGUID.IsEmpty())
445  {
447  {
448  m_src._position.Relocate(transport);
450  }
451  }
452 
453  if (HasDst() && !m_dst._transportGUID.IsEmpty())
454  {
456  {
457  m_dst._position.Relocate(transport);
459  }
460  }
461 }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
static Player * ToPlayer(Object *o)
Definition: Object.h:198
Position _transportOffset
Definition: SpellDefines.h:318
Definition: SpellDefines.h:283
TypeID GetTypeId() const
Definition: Object.h:170
void RelocateOffset(Position const &offset)
Definition: Position.cpp:34
SpellDestination m_src
Definition: SpellDefines.h:404
WorldLocation _position
Definition: SpellDefines.h:316
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
bool HasSrc() const
Definition: Spell.cpp:412
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
Definition: Object.h:430
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
Definition: ObjectAccessor.cpp:101
SpellDestination m_dst
Definition: SpellDefines.h:405
void Relocate(float x, float y)
Definition: Position.h:64
ObjectGuid _transportGUID
Definition: SpellDefines.h:317
Item * m_itemTarget
Definition: SpellDefines.h:397
Definition: TradeData.h:34
Definition: TradeData.h:27
uint32 m_targetMask
Definition: SpellDefines.h:393
bool HasDst() const
Definition: Spell.cpp:417
uint32 GetEntry() const
Definition: Object.h:158
Item * GetItemByGuid(ObjectGuid guid) const
Definition: Player.cpp:10014
bool IsEmpty() const
Definition: ObjectGuid.h:310
Definition: ObjectGuid.h:40
static ObjectGuid const TradeItem
Definition: ObjectGuid.h:267
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:401
TradeData * GetTradeData() const
Definition: Player.h:1508
Definition: SpellDefines.h:275
WorldObject * m_objectTarget
Definition: SpellDefines.h:396
Definition: Player.h:1131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateTradeSlotItem()

void SpellCastTargets::UpdateTradeSlotItem ( )
308 {
310  {
313  }
314 }
uint32 m_itemTargetEntry
Definition: SpellDefines.h:402
Definition: SpellDefines.h:283
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
Item * m_itemTarget
Definition: SpellDefines.h:397
uint32 m_targetMask
Definition: SpellDefines.h:393
uint32 GetEntry() const
Definition: Object.h:158
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:401
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Write()

void SpellCastTargets::Write ( WorldPackets::Spells::SpellTargetData data)
169 {
170  data.Flags = m_targetMask;
171 
173  data.Unit = m_objectTargetGUID;
174 
176  data.Item = m_itemTarget->GetGUID();
177 
179  {
180  data.SrcLocation.emplace();
181  data.SrcLocation->Transport = m_src._transportGUID; // relative position guid here - transport for example
183  data.SrcLocation->Location = m_src._transportOffset;
184  else
185  data.SrcLocation->Location = m_src._position;
186  }
187 
189  {
190  data.DstLocation.emplace();
191  data.DstLocation->Transport = m_dst._transportGUID; // relative position guid here - transport for example
193  data.DstLocation->Location = m_dst._transportOffset;
194  else
195  data.DstLocation->Location = m_dst._position;
196  }
197 
199  data.Name = m_strTarget;
200 }
Definition: SpellDefines.h:287
Position _transportOffset
Definition: SpellDefines.h:318
Definition: SpellDefines.h:283
Optional< TargetLocation > SrcLocation
Definition: SpellPackets.h:236
SpellDestination m_src
Definition: SpellDefines.h:404
Definition: SpellDefines.h:272
WorldLocation _position
Definition: SpellDefines.h:316
ObjectGuid Unit
Definition: SpellPackets.h:234
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:400
Definition: SpellDefines.h:282
Optional< TargetLocation > DstLocation
Definition: SpellPackets.h:237
SpellDestination m_dst
Definition: SpellDefines.h:405
ObjectGuid _transportGUID
Definition: SpellDefines.h:317
ObjectGuid Item
Definition: SpellPackets.h:235
Item * m_itemTarget
Definition: SpellDefines.h:397
Definition: SpellDefines.h:286
uint32 Flags
Definition: SpellPackets.h:233
uint32 m_targetMask
Definition: SpellDefines.h:393
Definition: SpellDefines.h:280
bool IsEmpty() const
Definition: ObjectGuid.h:310
Definition: SpellDefines.h:277
Definition: SpellDefines.h:284
Definition: SpellDefines.h:275
std::string Name
Definition: SpellPackets.h:240
std::string m_strTarget
Definition: SpellDefines.h:408
Definition: SpellDefines.h:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_dst

SpellDestination SpellCastTargets::m_dst
private

◆ m_itemTarget

Item* SpellCastTargets::m_itemTarget
private

◆ m_itemTargetEntry

uint32 SpellCastTargets::m_itemTargetEntry
private

◆ m_itemTargetGUID

ObjectGuid SpellCastTargets::m_itemTargetGUID
private

◆ m_objectTarget

WorldObject* SpellCastTargets::m_objectTarget
private

◆ m_objectTargetGUID

ObjectGuid SpellCastTargets::m_objectTargetGUID
private

◆ m_pitch

float SpellCastTargets::m_pitch
private

◆ m_speed

float SpellCastTargets::m_speed
private

◆ m_src

SpellDestination SpellCastTargets::m_src
private

◆ m_strTarget

std::string SpellCastTargets::m_strTarget
private

◆ m_targetMask

uint32 SpellCastTargets::m_targetMask
private

The documentation for this class was generated from the following files: