TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpellCastTargets Class Reference

#include <Spell.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 GetOrigUnitTargetGUID () const
 
void SetOrigUnitTarget (Unit *target)
 
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 constGetSrc () const
 
Position constGetSrcPos () 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 constGetDst () const
 
WorldLocation constGetDstPos () 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 (Unit *caster)
 
void OutDebug () const
 
std::string GetTargetString () const
 

Private Attributes

uint32 m_targetMask
 
WorldObjectm_objectTarget
 
Itemm_itemTarget
 
ObjectGuid m_origObjectTargetGUID
 
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::SpellCastTargets ( )
112  : m_targetMask(0), m_objectTarget(nullptr), m_itemTarget(nullptr),
113  m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f)
114 {
115 }
uint32 m_itemTargetEntry
Definition: Spell.h:256
float m_speed
Definition: Spell.h:261
Item * m_itemTarget
Definition: Spell.h:250
uint32 m_targetMask
Definition: Spell.h:246
WorldObject * m_objectTarget
Definition: Spell.h:249
float m_pitch
Definition: Spell.h:261
SpellCastTargets::SpellCastTargets ( Unit caster,
WorldPackets::Spells::SpellCastRequest const spellCastRequest 
)
117  :
118  m_targetMask(spellCastRequest.Target.Flags), m_objectTarget(nullptr), m_itemTarget(nullptr),
119  m_objectTargetGUID(spellCastRequest.Target.Unit), m_itemTargetGUID(spellCastRequest.Target.Item),
120  m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f), m_strTarget(spellCastRequest.Target.Name)
121 {
122  if (spellCastRequest.Target.SrcLocation)
123  {
124  m_src._transportGUID = spellCastRequest.Target.SrcLocation->Transport;
125  Position* pos;
127  pos = &m_src._transportOffset;
128  else
129  pos = &m_src._position;
130 
131  pos->Relocate(spellCastRequest.Target.SrcLocation->Location);
132  if (spellCastRequest.Target.Orientation)
133  pos->SetOrientation(*spellCastRequest.Target.Orientation);
134  }
135 
136  if (spellCastRequest.Target.DstLocation)
137  {
138  m_dst._transportGUID = spellCastRequest.Target.DstLocation->Transport;
139  Position* pos;
141  pos = &m_dst._transportOffset;
142  else
143  pos = &m_dst._position;
144 
145  pos->Relocate(spellCastRequest.Target.DstLocation->Location);
146  if (spellCastRequest.Target.Orientation)
147  pos->SetOrientation(*spellCastRequest.Target.Orientation);
148  }
149 
150  SetPitch(spellCastRequest.MissileTrajectory.Pitch);
151  SetSpeed(spellCastRequest.MissileTrajectory.Speed);
152 
153  Update(caster);
154 }
uint32 m_itemTargetEntry
Definition: Spell.h:256
Position _transportOffset
Definition: Spell.h:130
SpellDestination m_src
Definition: Spell.h:258
float m_speed
Definition: Spell.h:261
void SetOrientation(float orientation)
Definition: Position.h:99
WorldLocation _position
Definition: Spell.h:128
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
void SetPitch(float pitch)
Definition: Spell.h:233
SpellDestination m_dst
Definition: Spell.h:259
void Relocate(float x, float y)
Definition: Position.h:67
ObjectGuid _transportGUID
Definition: Spell.h:129
Item * m_itemTarget
Definition: Spell.h:250
uint32 m_targetMask
Definition: Spell.h:246
void Update(Unit *caster)
Definition: Spell.cpp:424
void SetSpeed(float speed)
Definition: Spell.h:235
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255
Definition: Position.h:27
WorldObject * m_objectTarget
Definition: Spell.h:249
bool IsEmpty() const
Definition: ObjectGuid.h:242
std::string m_strTarget
Definition: Spell.h:262
float m_pitch
Definition: Spell.h:261

+ Here is the call graph for this function:

SpellCastTargets::~SpellCastTargets ( )
156 { }

Member Function Documentation

Corpse * SpellCastTargets::GetCorpseTarget ( ) const
275 {
276  if (m_objectTarget)
277  return m_objectTarget->ToCorpse();
278 
279  return NULL;
280 }
arena_t NULL
Definition: jemalloc_internal.h:624
Corpse * ToCorpse()
Definition: Object.h:203
WorldObject * m_objectTarget
Definition: Spell.h:249

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ObjectGuid SpellCastTargets::GetCorpseTargetGUID ( ) const
267 {
269  return m_objectTargetGUID;
270 
271  return ObjectGuid::Empty;
272 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
bool IsCorpse() const
Definition: ObjectGuid.h:254

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float SpellCastTargets::GetDist2d ( ) const
inline
SpellDestination m_src
Definition: Spell.h:258
WorldLocation _position
Definition: Spell.h:128
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:137
SpellDestination m_dst
Definition: Spell.h:259

+ Here is the caller graph for this function:

SpellDestination const * SpellCastTargets::GetDst ( ) const
368 {
369  return &m_dst;
370 }
SpellDestination m_dst
Definition: Spell.h:259

+ Here is the caller graph for this function:

WorldLocation const * SpellCastTargets::GetDstPos ( ) const
373 {
374  return &m_dst._position;
375 }
WorldLocation _position
Definition: Spell.h:128
SpellDestination m_dst
Definition: Spell.h:259

+ Here is the caller graph for this function:

GameObject * SpellCastTargets::GetGOTarget ( ) const
249 {
250  if (m_objectTarget)
251  return m_objectTarget->ToGameObject();
252 
253  return NULL;
254 }
arena_t NULL
Definition: jemalloc_internal.h:624
GameObject * ToGameObject()
Definition: Object.h:200
WorldObject * m_objectTarget
Definition: Spell.h:249

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ObjectGuid SpellCastTargets::GetGOTargetGUID ( ) const
241 {
243  return m_objectTargetGUID;
244 
245  return ObjectGuid::Empty;
246 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
bool IsAnyTypeGameObject() const
Definition: ObjectGuid.h:257

+ Here is the call graph for this function:

Item* SpellCastTargets::GetItemTarget ( ) const
inline
203 { return m_itemTarget; }
Item * m_itemTarget
Definition: Spell.h:250

+ Here is the caller graph for this function:

uint32 SpellCastTargets::GetItemTargetEntry ( ) const
inline
204 { return m_itemTargetEntry; }
uint32 m_itemTargetEntry
Definition: Spell.h:256

+ Here is the caller graph for this function:

ObjectGuid SpellCastTargets::GetItemTargetGUID ( ) const
inline
202 { return m_itemTargetGUID; }
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255

+ Here is the caller graph for this function:

WorldObject * SpellCastTargets::GetObjectTarget ( ) const
283 {
284  return m_objectTarget;
285 }
WorldObject * m_objectTarget
Definition: Spell.h:249

+ Here is the caller graph for this function:

ObjectGuid SpellCastTargets::GetObjectTargetGUID ( ) const
288 {
289  return m_objectTargetGUID;
290 }
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254

+ Here is the caller graph for this function:

ObjectGuid SpellCastTargets::GetOrigUnitTargetGUID ( ) const
193 {
195  {
196  case HighGuid::Player:
197  case HighGuid::Vehicle:
198  case HighGuid::Creature:
199  case HighGuid::Pet:
200  return m_origObjectTargetGUID;
201  default:
202  return ObjectGuid();
203  }
204 }
ObjectGuid m_origObjectTargetGUID
Definition: Spell.h:253
HighGuid GetHigh() const
Definition: ObjectGuid.h:217
Definition: ObjectGuid.h:189

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float SpellCastTargets::GetPitch ( ) const
inline
232 { return m_pitch; }
float m_pitch
Definition: Spell.h:261

+ Here is the caller graph for this function:

float SpellCastTargets::GetSpeed ( ) const
inline
234 { return m_speed; }
float m_speed
Definition: Spell.h:261
float SpellCastTargets::GetSpeedXY ( ) const
inline
238 { return m_speed * std::cos(m_pitch); }
float m_speed
Definition: Spell.h:261
float m_pitch
Definition: Spell.h:261

+ Here is the caller graph for this function:

float SpellCastTargets::GetSpeedZ ( ) const
inline
239 { return m_speed * std::sin(m_pitch); }
float m_speed
Definition: Spell.h:261
float m_pitch
Definition: Spell.h:261

+ Here is the caller graph for this function:

SpellDestination const * SpellCastTargets::GetSrc ( ) const
329 {
330  return &m_src;
331 }
SpellDestination m_src
Definition: Spell.h:258
Position const * SpellCastTargets::GetSrcPos ( ) const
334 {
335  return &m_src._position;
336 }
SpellDestination m_src
Definition: Spell.h:258
WorldLocation _position
Definition: Spell.h:128

+ Here is the caller graph for this function:

uint32 SpellCastTargets::GetTargetMask ( ) const
inline
179 { return m_targetMask; }
uint32 m_targetMask
Definition: Spell.h:246

+ Here is the caller graph for this function:

std::string SpellCastTargets::GetTargetString ( ) const
inline
243 { return m_strTarget; }
std::string m_strTarget
Definition: Spell.h:262
Unit * SpellCastTargets::GetUnitTarget ( ) const
223 {
224  if (m_objectTarget)
225  return m_objectTarget->ToUnit();
226 
227  return NULL;
228 }
arena_t NULL
Definition: jemalloc_internal.h:624
WorldObject * m_objectTarget
Definition: Spell.h:249
Unit * ToUnit()
Definition: Object.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ObjectGuid SpellCastTargets::GetUnitTargetGUID ( ) const
215 {
217  return m_objectTargetGUID;
218 
219  return ObjectGuid::Empty;
220 }
bool IsUnit() const
Definition: ObjectGuid.h:250
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SpellCastTargets::HasDst ( ) const
inline
229 { return (GetTargetMask() & TARGET_FLAG_DEST_LOCATION) != 0; }
Definition: SpellInfo.h:54
uint32 GetTargetMask() const
Definition: Spell.h:179

+ Here is the caller graph for this function:

bool SpellCastTargets::HasSrc ( ) const
inline
228 { return (GetTargetMask() & TARGET_FLAG_SOURCE_LOCATION) != 0; }
Definition: SpellInfo.h:53
uint32 GetTargetMask() const
Definition: Spell.h:179

+ Here is the caller graph for this function:

bool SpellCastTargets::HasTraj ( ) const
inline
230 { return m_speed != 0; }
float m_speed
Definition: Spell.h:261

+ Here is the caller graph for this function:

void SpellCastTargets::ModDst ( Position const pos)
408 {
410  m_dst.Relocate(pos);
411 }
SpellDestination m_dst
Definition: Spell.h:259
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54
void Relocate(Position const &pos)
Definition: Spell.cpp:93
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::ModDst ( SpellDestination const spellDest)
414 {
416  m_dst = spellDest;
417 }
SpellDestination m_dst
Definition: Spell.h:259
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54
#define ASSERT
Definition: Errors.h:55
void SpellCastTargets::ModSrc ( Position const pos)
357 {
359  m_src.Relocate(pos);
360 }
SpellDestination m_src
Definition: Spell.h:258
Definition: SpellInfo.h:53
uint32 m_targetMask
Definition: Spell.h:246
void Relocate(Position const &pos)
Definition: Spell.cpp:93
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::OutDebug ( ) const
466 {
467  if (!m_targetMask)
468  TC_LOG_DEBUG("spells", "No targets");
469 
470  TC_LOG_DEBUG("spells", "target mask: %u", m_targetMask);
472  TC_LOG_DEBUG("spells", "Object target: %s", m_objectTargetGUID.ToString().c_str());
474  TC_LOG_DEBUG("spells", "Item target: %s", m_itemTargetGUID.ToString().c_str());
476  TC_LOG_DEBUG("spells", "Trade item target: %s", m_itemTargetGUID.ToString().c_str());
478  TC_LOG_DEBUG("spells", "Source location: transport guid:%s trans offset: %s position: %s", m_src._transportGUID.ToString().c_str(), m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str());
480  TC_LOG_DEBUG("spells", "Destination location: transport guid:%s trans offset: %s position: %s", m_dst._transportGUID.ToString().c_str(), m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str());
482  TC_LOG_DEBUG("spells", "String: %s", m_strTarget.c_str());
483  TC_LOG_DEBUG("spells", "speed: %f", m_speed);
484  TC_LOG_DEBUG("spells", "pitch: %f", m_pitch);
485 }
Definition: SpellInfo.h:61
Definition: SpellInfo.h:77
Position _transportOffset
Definition: Spell.h:130
SpellDestination m_src
Definition: Spell.h:258
float m_speed
Definition: Spell.h:261
WorldLocation _position
Definition: Spell.h:128
Definition: SpellInfo.h:53
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
SpellDestination m_dst
Definition: Spell.h:259
ObjectGuid _transportGUID
Definition: Spell.h:129
std::string ToString() const
Definition: Position.cpp:160
Definition: SpellInfo.h:78
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:52
Definition: SpellInfo.h:54
Definition: SpellInfo.h:60
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255
Definition: SpellInfo.h:75
std::string ToString() const
Definition: ObjectGuid.cpp:99
std::string m_strTarget
Definition: Spell.h:262
float m_pitch
Definition: Spell.h:261

+ Here is the call graph for this function:

void SpellCastTargets::RemoveDst ( )
420 {
422 }
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54

+ Here is the caller graph for this function:

void SpellCastTargets::RemoveObjectTarget ( )
293 {
297 }
Definition: SpellInfo.h:77
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SpellInfo.h:78
uint32 m_targetMask
Definition: Spell.h:246
void Clear()
Definition: ObjectGuid.h:215
WorldObject * m_objectTarget
Definition: Spell.h:249
Definition: SpellInfo.h:75

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::RemoveSrc ( )
363 {
365 }
Definition: SpellInfo.h:53
uint32 m_targetMask
Definition: Spell.h:246

+ Here is the caller graph for this function:

void SpellCastTargets::SetDst ( float  x,
float  y,
float  z,
float  orientation,
uint32  mapId = MAPID_INVALID 
)
378 {
379  m_dst = SpellDestination(x, y, z, orientation, mapId);
381 }
Definition: Spell.h:118
SpellDestination m_dst
Definition: Spell.h:259
G3D::int16 z
Definition: Vector3int16.h:46
uint32 m_targetMask
Definition: Spell.h:246
G3D::int16 y
Definition: Vector2int16.h:38
Definition: SpellInfo.h:54
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

void SpellCastTargets::SetDst ( Position const pos)
384 {
385  m_dst = SpellDestination(pos);
387 }
Definition: Spell.h:118
SpellDestination m_dst
Definition: Spell.h:259
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54
void SpellCastTargets::SetDst ( WorldObject const wObj)
390 {
391  m_dst = SpellDestination(wObj);
393 }
Definition: Spell.h:118
SpellDestination m_dst
Definition: Spell.h:259
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54
void SpellCastTargets::SetDst ( SpellDestination const spellDest)
396 {
397  m_dst = spellDest;
399 }
SpellDestination m_dst
Definition: Spell.h:259
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54
void SpellCastTargets::SetDst ( SpellCastTargets const spellTargets)
402 {
403  m_dst = spellTargets.m_dst;
405 }
SpellDestination m_dst
Definition: Spell.h:259
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:54
void SpellCastTargets::SetGOTarget ( GameObject target)
257 {
258  if (!target)
259  return;
260 
261  m_objectTarget = target;
262  m_objectTargetGUID = target->GetGUID();
264 }
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
uint32 m_targetMask
Definition: Spell.h:246
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: SpellInfo.h:59
WorldObject * m_objectTarget
Definition: Spell.h:249

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::SetItemTarget ( Item item)
300 {
301  if (!item)
302  return;
303 
304  m_itemTarget = item;
305  m_itemTargetGUID = item->GetGUID();
306  m_itemTargetEntry = item->GetEntry();
308 }
uint32 m_itemTargetEntry
Definition: Spell.h:256
Item * m_itemTarget
Definition: Spell.h:250
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:52
ObjectGuid const & GetGUID() const
Definition: Object.h:105
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::SetOrigUnitTarget ( Unit target)
207 {
208  if (!target)
209  return;
210 
211  m_origObjectTargetGUID = target->GetGUID();
212 }
ObjectGuid m_origObjectTargetGUID
Definition: Spell.h:253
ObjectGuid const & GetGUID() const
Definition: Object.h:105

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::SetPitch ( float  pitch)
inline
233 { m_pitch = pitch; }
float m_pitch
Definition: Spell.h:261

+ Here is the caller graph for this function:

void SpellCastTargets::SetSpeed ( float  speed)
inline
235 { m_speed = speed; }
float m_speed
Definition: Spell.h:261

+ Here is the caller graph for this function:

void SpellCastTargets::SetSrc ( float  x,
float  y,
float  z 
)
339 {
340  m_src = SpellDestination(x, y, z);
342 }
SpellDestination m_src
Definition: Spell.h:258
Definition: SpellInfo.h:53
Definition: Spell.h:118
G3D::int16 z
Definition: Vector3int16.h:46
uint32 m_targetMask
Definition: Spell.h:246
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

void SpellCastTargets::SetSrc ( Position const pos)
345 {
346  m_src = SpellDestination(pos);
348 }
SpellDestination m_src
Definition: Spell.h:258
Definition: SpellInfo.h:53
Definition: Spell.h:118
uint32 m_targetMask
Definition: Spell.h:246
void SpellCastTargets::SetSrc ( WorldObject const wObj)
351 {
352  m_src = SpellDestination(wObj);
354 }
SpellDestination m_src
Definition: Spell.h:258
Definition: SpellInfo.h:53
Definition: Spell.h:118
uint32 m_targetMask
Definition: Spell.h:246
void SpellCastTargets::SetTargetFlag ( SpellCastTargetFlags  flag)
inline
182 { m_targetMask |= flag; }
uint32 m_targetMask
Definition: Spell.h:246

+ Here is the caller graph for this function:

void SpellCastTargets::SetTargetMask ( uint32  newMask)
inline
180 { m_targetMask = newMask; }
uint32 m_targetMask
Definition: Spell.h:246
void SpellCastTargets::SetTradeItemTarget ( Player caster)
311 {
313  m_itemTargetEntry = 0;
315 
316  Update(caster);
317 }
uint32 m_itemTargetEntry
Definition: Spell.h:256
uint32 m_targetMask
Definition: Spell.h:246
void Update(Unit *caster)
Definition: Spell.cpp:424
static ObjectGuid const TradeItem
Definition: ObjectGuid.h:197
Definition: SpellInfo.h:60
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::SetUnitTarget ( Unit target)
231 {
232  if (!target)
233  return;
234 
235  m_objectTarget = target;
236  m_objectTargetGUID = target->GetGUID();
238 }
Definition: SpellInfo.h:49
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
uint32 m_targetMask
Definition: Spell.h:246
ObjectGuid const & GetGUID() const
Definition: Object.h:105
WorldObject * m_objectTarget
Definition: Spell.h:249

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::Update ( Unit caster)
425 {
427 
428  m_itemTarget = NULL;
429  if (caster->GetTypeId() == TYPEID_PLAYER)
430  {
431  Player* player = caster->ToPlayer();
433  m_itemTarget = player->GetItemByGuid(m_itemTargetGUID);
435  {
437  if (TradeData* pTrade = player->GetTradeData())
438  m_itemTarget = pTrade->GetTraderData()->GetItem(TRADE_SLOT_NONTRADED);
439  }
440 
441  if (m_itemTarget)
443  }
444 
445  // update positions by transport move
446  if (HasSrc() && !m_src._transportGUID.IsEmpty())
447  {
449  {
450  m_src._position.Relocate(transport);
452  }
453  }
454 
455  if (HasDst() && !m_dst._transportGUID.IsEmpty())
456  {
458  {
459  m_dst._position.Relocate(transport);
461  }
462  }
463 }
uint32 m_itemTargetEntry
Definition: Spell.h:256
Position _transportOffset
Definition: Spell.h:130
void RelocateOffset(Position const &offset)
Definition: Position.cpp:32
SpellDestination m_src
Definition: Spell.h:258
WorldLocation _position
Definition: Spell.h:128
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Object.h:423
bool HasSrc() const
Definition: Spell.h:228
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
Definition: ObjectAccessor.cpp:79
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
SpellDestination m_dst
Definition: Spell.h:259
void Relocate(float x, float y)
Definition: Position.h:67
ObjectGuid _transportGUID
Definition: Spell.h:129
Item * m_itemTarget
Definition: Spell.h:250
bool HasDst() const
Definition: Spell.h:229
Definition: TradeData.h:34
Definition: TradeData.h:27
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:52
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
static ObjectGuid const TradeItem
Definition: ObjectGuid.h:197
Definition: SpellInfo.h:60
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255
WorldObject * m_objectTarget
Definition: Spell.h:249
uint32 GetEntry() const
Definition: Object.h:107
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::UpdateTradeSlotItem ( )
320 {
322  {
325  }
326 }
uint32 m_itemTargetEntry
Definition: Spell.h:256
Item * m_itemTarget
Definition: Spell.h:250
uint32 m_targetMask
Definition: Spell.h:246
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: SpellInfo.h:60
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellCastTargets::Write ( WorldPackets::Spells::SpellTargetData data)
159 {
160  data.Flags = m_targetMask;
161 
163  data.Unit = m_objectTargetGUID;
164 
166  data.Item = m_itemTarget->GetGUID();
167 
169  {
170  data.SrcLocation = boost::in_place();
171  data.SrcLocation->Transport = m_src._transportGUID; // relative position guid here - transport for example
173  data.SrcLocation->Location = m_src._transportOffset;
174  else
175  data.SrcLocation->Location = m_src._position;
176  }
177 
179  {
180  data.DstLocation = boost::in_place();
181  data.DstLocation->Transport = m_dst._transportGUID; // relative position guid here - transport for example
183  data.DstLocation->Location = m_dst._transportOffset;
184  else
185  data.DstLocation->Location = m_dst._position;
186  }
187 
189  data.Name = m_strTarget;
190 }
Definition: SpellInfo.h:61
Definition: SpellInfo.h:64
Definition: SpellInfo.h:49
Position _transportOffset
Definition: Spell.h:130
Optional< TargetLocation > SrcLocation
Definition: SpellPackets.h:228
SpellDestination m_src
Definition: Spell.h:258
WorldLocation _position
Definition: Spell.h:128
ObjectGuid Unit
Definition: SpellPackets.h:226
Definition: SpellInfo.h:57
Definition: SpellInfo.h:53
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
Definition: SpellInfo.h:63
Optional< TargetLocation > DstLocation
Definition: SpellPackets.h:229
SpellDestination m_dst
Definition: Spell.h:259
ObjectGuid _transportGUID
Definition: Spell.h:129
ObjectGuid Item
Definition: SpellPackets.h:227
Item * m_itemTarget
Definition: Spell.h:250
uint32 Flags
Definition: SpellPackets.h:225
uint32 m_targetMask
Definition: Spell.h:246
Definition: SpellInfo.h:52
Definition: SpellInfo.h:54
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: SpellInfo.h:60
Definition: SpellInfo.h:59
std::string Name
Definition: SpellPackets.h:231
bool IsEmpty() const
Definition: ObjectGuid.h:242
std::string m_strTarget
Definition: Spell.h:262

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

SpellDestination SpellCastTargets::m_dst
private
Item* SpellCastTargets::m_itemTarget
private
uint32 SpellCastTargets::m_itemTargetEntry
private
ObjectGuid SpellCastTargets::m_itemTargetGUID
private
WorldObject* SpellCastTargets::m_objectTarget
private
ObjectGuid SpellCastTargets::m_objectTargetGUID
private
ObjectGuid SpellCastTargets::m_origObjectTargetGUID
private
float SpellCastTargets::m_pitch
private
float SpellCastTargets::m_speed
private
SpellDestination SpellCastTargets::m_src
private
std::string SpellCastTargets::m_strTarget
private
uint32 SpellCastTargets::m_targetMask
private

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