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

#include <SpellScript.h>

Classes

class  CastHandler
 
class  CheckCastHandler
 
class  DestinationTargetSelectHandler
 
class  EffectHandler
 
class  HitHandler
 
class  ObjectAreaTargetSelectHandler
 
class  ObjectTargetSelectHandler
 
class  TargetHook
 

Public Member Functions

bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo constGetSpellInfo ()
 
SpellValue constGetSpellValue ()
 
SpellEffectInfo constGetEffectInfo (SpellEffIndex) const
 
WorldLocation constGetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
SpellEffectInfo constGetEffectInfo () const
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo constGetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
virtual void _Register ()
 
virtual void _Unload ()
 
virtual void _Init (std::string const *scriptname, uint32 spellId)
 
std::string const_GetScriptName () const
 
virtual void Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 

Public Attributes

HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< EffectHandlerOnEffectSuccessfulDispel
 
HookList< HitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList
< ObjectAreaTargetSelectHandler
OnObjectAreaTargetSelect
 
HookList
< ObjectTargetSelectHandler
OnObjectTargetSelect
 
HookList
< DestinationTargetSelectHandler
OnDestinationTargetSelect
 

Private Attributes

Spellm_spell
 
uint8 m_hitPreventEffectMask
 
uint8 m_hitPreventDefaultEffectMask
 

Additional Inherited Members

- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string constm_scriptName
 
uint32 m_scriptSpellId
 

Member Function Documentation

void SpellScript::_FinishScriptCall ( )
363 {
365 }
Definition: SpellScript.h:47
uint8 m_currentScriptState
Definition: SpellScript.h:105

+ Here is the caller graph for this function:

void SpellScript::_InitHit ( )
352 {
355 }
uint8 m_hitPreventEffectMask
Definition: SpellScript.h:270
uint8 m_hitPreventDefaultEffectMask
Definition: SpellScript.h:271
bool SpellScript::_IsDefaultEffectPrevented ( SpellEffIndex  effIndex)
inline
261 { return (m_hitPreventDefaultEffectMask & (1 << effIndex)) != 0; }
uint8 m_hitPreventDefaultEffectMask
Definition: SpellScript.h:271
bool SpellScript::_IsEffectPrevented ( SpellEffIndex  effIndex)
inline
260 { return (m_hitPreventEffectMask & (1 << effIndex)) != 0; }
uint8 m_hitPreventEffectMask
Definition: SpellScript.h:270
bool SpellScript::_Load ( Spell spell)
343 {
344  m_spell = spell;
346  bool load = Load();
348  return load;
349 }
SpellScriptHookType
Definition: SpellScript.h:127
Definition: SpellScript.h:49
void _FinishScriptCall()
Definition: SpellScript.cpp:362
Spell * m_spell
Definition: SpellScript.h:269
void _PrepareScriptCall(SpellScriptHookType hookType)
Definition: SpellScript.cpp:357
virtual bool Load()
Definition: SpellScript.h:120

+ Here is the call graph for this function:

void SpellScript::_PrepareScriptCall ( SpellScriptHookType  hookType)
358 {
359  m_currentScriptState = hookType;
360 }
uint8 m_currentScriptState
Definition: SpellScript.h:105

+ Here is the caller graph for this function:

bool SpellScript::_Validate ( SpellInfo const entry)
overridevirtual

Reimplemented from _SpellScript.

306 {
307  for (std::list<EffectHandler>::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr)
308  if (!(*itr).GetAffectedEffectsMask(entry))
309  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
310 
311  for (std::list<EffectHandler>::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr)
312  if (!(*itr).GetAffectedEffectsMask(entry))
313  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
314 
315  for (std::list<EffectHandler>::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr)
316  if (!(*itr).GetAffectedEffectsMask(entry))
317  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
318 
319  for (std::list<EffectHandler>::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr)
320  if (!(*itr).GetAffectedEffectsMask(entry))
321  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
322 
323  for (std::list<EffectHandler>::iterator itr = OnEffectSuccessfulDispel.begin(); itr != OnEffectSuccessfulDispel.end(); ++itr)
324  if (!(*itr).GetAffectedEffectsMask(entry))
325  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSuccessfulDispel` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
326 
327  for (std::list<ObjectAreaTargetSelectHandler>::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr)
328  if (!(*itr).GetAffectedEffectsMask(entry))
329  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
330 
331  for (std::list<ObjectTargetSelectHandler>::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr)
332  if (!(*itr).GetAffectedEffectsMask(entry))
333  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
334 
335  for (std::list<DestinationTargetSelectHandler>::iterator itr = OnDestinationTargetSelect.begin(); itr != OnDestinationTargetSelect.end(); ++itr)
336  if (!(*itr).GetAffectedEffectsMask(entry))
337  TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnDestinationTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
338 
339  return _SpellScript::_Validate(entry);
340 }
virtual bool _Validate(SpellInfo const *entry)
Definition: SpellScript.cpp:24
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:310
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:294
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Definition: SpellScript.h:320
HookList< EffectHandler > OnEffectLaunchTarget
Definition: SpellScript.h:293
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
Definition: SpellScript.h:315
HookList< EffectHandler > OnEffectSuccessfulDispel
Definition: SpellScript.h:296
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
std::string const * m_scriptName
Definition: SpellScript.h:106
HookList< EffectHandler > OnEffectLaunch
Definition: SpellScript.h:292
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::CreateItem ( uint32  effIndex,
uint32  itemId 
)
628 {
629  m_spell->DoCreateItem(effIndex, itemId);
630 }
Spell * m_spell
Definition: SpellScript.h:269
void DoCreateItem(uint32 i, uint32 itemtype, std::vector< int32 > const &bonusListIDs=std::vector< int32 >())
Definition: SpellEffects.cpp:1403

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::FinishCast ( SpellCastResult  result)
638 {
639  m_spell->SendCastResult(result);
640  m_spell->finish(result == SPELL_CAST_OK);
641 }
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, OpcodeServer opcode=SMSG_CAST_FAILED, uint32 *misc=nullptr)
Definition: Spell.cpp:3732
Spell * m_spell
Definition: SpellScript.h:269
void finish(bool ok=true)
Definition: Spell.cpp:3620
Definition: SharedDefines.h:1538

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Unit * SpellScript::GetCaster ( )
395 {
396  return m_spell->GetCaster();
397 }
Unit * GetCaster() const
Definition: Spell.h:612
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the call graph for this function:

Item * SpellScript::GetCastItem ( )
623 {
624  return m_spell->m_CastItem;
625 }
Item * m_CastItem
Definition: Spell.h:548
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the caller graph for this function:

SpellEffectInfo const * SpellScript::GetEffectInfo ( SpellEffIndex  effIndex) const
660 {
661  return m_spell->GetEffect(effIndex);
662 }
SpellEffectInfo const * GetEffect(uint32 index) const
Definition: Spell.h:624
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the call graph for this function:

SpellEffectInfo const * SpellScript::GetEffectInfo ( ) const
594 {
595  ASSERT(IsInEffectHook(), "Script: `%s` Spell: `%u`: function SpellScript::GetEffectInfo was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
596 
597  return m_spell->effectInfo;
598 }
SpellEffectInfo const * effectInfo
Definition: Spell.h:697
bool IsInEffectHook() const
Definition: SpellScript.cpp:389
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 SpellScript::GetEffectValue ( ) const
601 {
602  if (!IsInEffectHook())
603  {
604  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetEffectValue was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
605  return 0;
606  }
607 
608  return m_spell->damage;
609 }
bool IsInEffectHook() const
Definition: SpellScript.cpp:389
Spell * m_spell
Definition: SpellScript.h:269
int32 damage
Definition: Spell.h:694
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

WorldLocation const * SpellScript::GetExplTargetDest ( )
410 {
411  if (m_spell->m_targets.HasDst())
412  return m_spell->m_targets.GetDstPos();
413  return NULL;
414 }
SpellCastTargets m_targets
Definition: Spell.h:584
arena_t NULL
Definition: jemalloc_internal.h:624
WorldLocation const * GetDstPos() const
Definition: Spell.cpp:372
Spell * m_spell
Definition: SpellScript.h:269
bool HasDst() const
Definition: Spell.h:229

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GameObject * SpellScript::GetExplTargetGObj ( )
432 {
433  return m_spell->m_targets.GetGOTarget();
434 }
SpellCastTargets m_targets
Definition: Spell.h:584
Spell * m_spell
Definition: SpellScript.h:269
GameObject * GetGOTarget() const
Definition: Spell.cpp:248

+ Here is the call graph for this function:

Item * SpellScript::GetExplTargetItem ( )
437 {
438  return m_spell->m_targets.GetItemTarget();
439 }
SpellCastTargets m_targets
Definition: Spell.h:584
Item * GetItemTarget() const
Definition: Spell.h:203
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the call graph for this function:

Unit * SpellScript::GetExplTargetUnit ( )
427 {
428  return m_spell->m_targets.GetUnitTarget();
429 }
Unit * GetUnitTarget() const
Definition: Spell.cpp:222
SpellCastTargets m_targets
Definition: Spell.h:584
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WorldObject * SpellScript::GetExplTargetWorldObject ( )
422 {
424 }
SpellCastTargets m_targets
Definition: Spell.h:584
Spell * m_spell
Definition: SpellScript.h:269
WorldObject * GetObjectTarget() const
Definition: Spell.cpp:282

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Aura * SpellScript::GetHitAura ( )
548 {
549  if (!IsInTargetHook())
550  {
551  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
552  return NULL;
553  }
554  if (!m_spell->m_spellAura)
555  return NULL;
556  if (m_spell->m_spellAura->IsRemoved())
557  return NULL;
558  return m_spell->m_spellAura;
559 }
arena_t NULL
Definition: jemalloc_internal.h:624
Aura * m_spellAura
Definition: Spell.h:699
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
bool IsRemoved() const
Definition: SpellAuras.h:201
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Creature * SpellScript::GetHitCreature ( )
452 {
453  if (!IsInTargetHook())
454  {
455  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
456  return NULL;
457  }
458  if (m_spell->unitTarget)
459  return m_spell->unitTarget->ToCreature();
460  else
461  return NULL;
462 }
arena_t NULL
Definition: jemalloc_internal.h:624
Spell * m_spell
Definition: SpellScript.h:269
Unit * unitTarget
Definition: Spell.h:690
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
Creature * ToCreature()
Definition: Object.h:194
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 SpellScript::GetHitDamage ( )
508 {
509  if (!IsInTargetHook())
510  {
511  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
512  return 0;
513  }
514  return m_spell->m_damage;
515 }
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
int32 m_damage
Definition: Spell.h:709
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WorldLocation * SpellScript::GetHitDest ( )
498 {
499  if (!IsInEffectHook())
500  {
501  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitDest was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
502  return NULL;
503  }
504  return m_spell->destTarget;
505 }
bool IsInEffectHook() const
Definition: SpellScript.cpp:389
arena_t NULL
Definition: jemalloc_internal.h:624
WorldLocation * destTarget
Definition: Spell.h:693
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GameObject * SpellScript::GetHitGObj ( )
488 {
489  if (!IsInTargetHook())
490  {
491  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
492  return NULL;
493  }
494  return m_spell->gameObjTarget;
495 }
GameObject * gameObjTarget
Definition: Spell.h:692
arena_t NULL
Definition: jemalloc_internal.h:624
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 SpellScript::GetHitHeal ( )
528 {
529  if (!IsInTargetHook())
530  {
531  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
532  return 0;
533  }
534  return m_spell->m_healing;
535 }
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
int32 m_healing
Definition: Spell.h:710

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Item * SpellScript::GetHitItem ( )
478 {
479  if (!IsInTargetHook())
480  {
481  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
482  return NULL;
483  }
484  return m_spell->itemTarget;
485 }
arena_t NULL
Definition: jemalloc_internal.h:624
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
Item * itemTarget
Definition: Spell.h:691
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

Player * SpellScript::GetHitPlayer ( )
465 {
466  if (!IsInTargetHook())
467  {
468  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
469  return NULL;
470  }
471  if (m_spell->unitTarget)
472  return m_spell->unitTarget->ToPlayer();
473  else
474  return NULL;
475 }
arena_t NULL
Definition: jemalloc_internal.h:624
Player * ToPlayer()
Definition: Object.h:191
Spell * m_spell
Definition: SpellScript.h:269
Unit * unitTarget
Definition: Spell.h:690
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Unit * SpellScript::GetHitUnit ( )
442 {
443  if (!IsInTargetHook())
444  {
445  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
446  return NULL;
447  }
448  return m_spell->unitTarget;
449 }
arena_t NULL
Definition: jemalloc_internal.h:624
Spell * m_spell
Definition: SpellScript.h:269
Unit * unitTarget
Definition: Spell.h:690
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

Unit * SpellScript::GetOriginalCaster ( )
400 {
401  return m_spell->GetOriginalCaster();
402 }
Spell * m_spell
Definition: SpellScript.h:269
Unit * GetOriginalCaster() const
Definition: Spell.h:613

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Spell* SpellScript::GetSpell ( )
inline
403 { return m_spell; }
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the caller graph for this function:

SpellInfo const * SpellScript::GetSpellInfo ( )
405 {
406  return m_spell->GetSpellInfo();
407 }
Spell * m_spell
Definition: SpellScript.h:269
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:614

+ Here is the call graph for this function:

SpellValue const * SpellScript::GetSpellValue ( )
655 {
656  return m_spell->m_spellValue;
657 }
SpellValue *const m_spellValue
Definition: Spell.h:649
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the caller graph for this function:

SpellInfo const * SpellScript::GetTriggeringSpell ( )
633 {
635 }
SpellInfo const * m_triggeredByAuraSpell
Definition: Spell.h:826
Spell * m_spell
Definition: SpellScript.h:269

+ Here is the caller graph for this function:

bool SpellScript::IsInCheckCastHook ( ) const
368 {
370 }
uint8 m_currentScriptState
Definition: SpellScript.h:105
Definition: SpellScript.h:140

+ Here is the caller graph for this function:

bool SpellScript::IsInEffectHook ( ) const
390 {
392 }
uint8 m_currentScriptState
Definition: SpellScript.h:105
Definition: SpellScript.h:132
Definition: SpellScript.h:129

+ Here is the caller graph for this function:

bool SpellScript::IsInHitPhase ( ) const
385 {
387 }
#define HOOK_SPELL_HIT_END
Definition: SpellScript.h:147
uint8 m_currentScriptState
Definition: SpellScript.h:105
#define HOOK_SPELL_HIT_START
Definition: SpellScript.h:146

+ Here is the caller graph for this function:

bool SpellScript::IsInTargetHook ( ) const
372 {
373  switch (m_currentScriptState)
374  {
380  return true;
381  }
382  return false;
383 }
Definition: SpellScript.h:135
uint8 m_currentScriptState
Definition: SpellScript.h:105
Definition: SpellScript.h:136
Definition: SpellScript.h:130
Definition: SpellScript.h:134
Definition: SpellScript.h:132

+ Here is the caller graph for this function:

void SpellScript::PreventHitAura ( )
562 {
563  if (!IsInTargetHook())
564  {
565  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
566  return;
567  }
568  if (m_spell->m_spellAura)
570 }
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
Aura * m_spellAura
Definition: Spell.h:699
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::PreventHitDamage ( )
inline
397 { SetHitDamage(0); }
void SetHitDamage(int32 damage)
Definition: SpellScript.cpp:517

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::PreventHitDefaultEffect ( SpellEffIndex  effIndex)
584 {
585  if (!IsInHitPhase() && !IsInEffectHook())
586  {
587  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
588  return;
589  }
590  m_hitPreventDefaultEffectMask |= 1 << effIndex;
591 }
bool IsInEffectHook() const
Definition: SpellScript.cpp:389
uint8 m_hitPreventDefaultEffectMask
Definition: SpellScript.h:271
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
bool IsInHitPhase() const
Definition: SpellScript.cpp:384
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

void SpellScript::PreventHitEffect ( SpellEffIndex  effIndex)
573 {
574  if (!IsInHitPhase() && !IsInEffectHook())
575  {
576  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
577  return;
578  }
579  m_hitPreventEffectMask |= 1 << effIndex;
580  PreventHitDefaultEffect(effIndex);
581 }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:583
uint8 m_hitPreventEffectMask
Definition: SpellScript.h:270
bool IsInEffectHook() const
Definition: SpellScript.cpp:389
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
bool IsInHitPhase() const
Definition: SpellScript.cpp:384
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::PreventHitHeal ( )
inline
402 { SetHitHeal(0); }
void SetHitHeal(int32 heal)
Definition: SpellScript.cpp:537

+ Here is the call graph for this function:

void SpellScript::SetCustomCastResultMessage ( SpellCustomErrors  result)
644 {
645  if (!IsInCheckCastHook())
646  {
647  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId);
648  return;
649  }
650 
651  m_spell->m_customError = result;
652 }
bool IsInCheckCastHook() const
Definition: SpellScript.cpp:367
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
SpellCustomErrors m_customError
Definition: Spell.h:586

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::SetEffectValue ( int32  value)
612 {
613  if (!IsInEffectHook())
614  {
615  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetEffectValue was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
616  return;
617  }
618 
619  m_spell->damage = value;
620 }
bool IsInEffectHook() const
Definition: SpellScript.cpp:389
Spell * m_spell
Definition: SpellScript.h:269
int32 damage
Definition: Spell.h:694
uint32 m_scriptSpellId
Definition: SpellScript.h:107
std::string const * m_scriptName
Definition: SpellScript.h:106
const FieldDescriptor value
Definition: descriptor.h:1522
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::SetExplTargetDest ( WorldLocation loc)
417 {
418  m_spell->m_targets.SetDst(loc);
419 }
SpellCastTargets m_targets
Definition: Spell.h:584
Spell * m_spell
Definition: SpellScript.h:269
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
Definition: Spell.cpp:377

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::SetHitDamage ( int32  damage)
518 {
519  if (!IsInTargetHook())
520  {
521  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
522  return;
523  }
524  m_spell->m_damage = damage;
525 }
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
int32 m_damage
Definition: Spell.h:709
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SpellScript::SetHitHeal ( int32  heal)
538 {
539  if (!IsInTargetHook())
540  {
541  TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
542  return;
543  }
544  m_spell->m_healing = heal;
545 }
Spell * m_spell
Definition: SpellScript.h:269
uint32 m_scriptSpellId
Definition: SpellScript.h:107
bool IsInTargetHook() const
Definition: SpellScript.cpp:371
std::string const * m_scriptName
Definition: SpellScript.h:106
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
int32 m_healing
Definition: Spell.h:710

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

HookList<CastHandler> SpellScript::AfterCast
HookList<HitHandler> SpellScript::AfterHit
HookList<CastHandler> SpellScript::BeforeCast
HookList<HitHandler> SpellScript::BeforeHit
uint8 SpellScript::m_hitPreventDefaultEffectMask
private
uint8 SpellScript::m_hitPreventEffectMask
private
Spell* SpellScript::m_spell
private
HookList<CastHandler> SpellScript::OnCast
HookList<CheckCastHandler> SpellScript::OnCheckCast
HookList<DestinationTargetSelectHandler> SpellScript::OnDestinationTargetSelect
HookList<EffectHandler> SpellScript::OnEffectHit
HookList<EffectHandler> SpellScript::OnEffectHitTarget
HookList<EffectHandler> SpellScript::OnEffectLaunch
HookList<EffectHandler> SpellScript::OnEffectLaunchTarget
HookList<EffectHandler> SpellScript::OnEffectSuccessfulDispel
HookList<HitHandler> SpellScript::OnHit
HookList<ObjectAreaTargetSelectHandler> SpellScript::OnObjectAreaTargetSelect
HookList<ObjectTargetSelectHandler> SpellScript::OnObjectTargetSelect

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