31 TC_LOG_ERROR(
"scripts",
"Spell `{}` did not pass Validate() function of script `{}` - script will be not added to the spell", entry->
Id,
m_scriptName);
47 TC_LOG_ERROR(
"scripts.spells",
"SpellScriptBase::ValidateSpellInfo: Spell {} does not exist.", spellId);
59 TC_LOG_ERROR(
"scripts.spells",
"SpellScriptBase::ValidateSpellEffect: Spell {} does not exist.", spellId);
63 if (spellInfo->
GetEffects().size() <= effectIndex)
65 TC_LOG_ERROR(
"scripts.spells",
"SpellScriptBase::ValidateSpellEffect: Spell {} does not have EFFECT_{}.", spellId,
uint32(effectIndex));
92#ifdef TRINITY_API_USE_DYNAMIC_LINKING
95 m_moduleReference =
sScriptMgr->AcquireModuleReferenceOfScriptName(scriptname);
131 if (CheckEffect(spellInfo, i))
137 if (CheckEffect(spellInfo, _effIndex))
138 mask |= 1 << _effIndex;
145 return (GetAffectedEffectsMask(spellInfo) & 1 << effIndex) != 0;
153 return "EFFECT_FIRST_FOUND";
156 return "Invalid Value";
181 if (spellInfo->
GetEffects().size() <= effIndex)
184 if (!spellEffectInfo.
Effect && !_effName)
186 if (!spellEffectInfo.
Effect)
192 :
EffectHook(effectIndex), _targetType(targetType), _area(area), _dest(dest) { }
208 if (spellInfo->
GetEffects().size() <= effIndex)
228 return _area || _dest;
279 if (!hook.GetAffectedEffectsMask(entry))
280 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
283 if (!hook.GetAffectedEffectsMask(entry))
284 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
287 if (!hook.GetAffectedEffectsMask(entry))
288 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
291 if (!hook.GetAffectedEffectsMask(entry))
292 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
295 if (!hook.GetAffectedEffectsMask(entry))
296 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectSuccessfulDispel` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
299 if (!hook.GetAffectedEffectsMask(entry))
300 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
303 if (!hook.GetAffectedEffectsMask(entry))
304 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
307 if (!hook.GetAffectedEffectsMask(entry))
308 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnDestinationTargetSelect` of SpellScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
319 TC_LOG_ERROR(
"scripts",
"Spell `{}` script `{}` does not have a damage effect - handler bound to hook `CalcDamage` of SpellScript won't be executed", entry->
Id,
m_scriptName);
328 TC_LOG_ERROR(
"scripts",
"Spell `{}` script `{}` does not have a damage effect - handler bound to hook `CalcHealing` of SpellScript won't be executed", entry->
Id,
m_scriptName);
482 TC_LOG_ERROR(
"scripts",
"Script: `{}` Spell: `{}`: function SpellScript::GetUnitTargetCountForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)",
493 TC_LOG_ERROR(
"scripts",
"Script: `{}` Spell: `{}`: function SpellScript::GetUnitTargetIndexForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)",
504 TC_LOG_ERROR(
"scripts",
"Script: `{}` Spell: `{}`: function SpellScript::GetGameObjectTargetCountForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)",
515 TC_LOG_ERROR(
"scripts",
"Script: `{}` Spell: `{}`: function SpellScript::GetItemTargetCountForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)",
526 TC_LOG_ERROR(
"scripts",
"Script: `{}` Spell: `{}`: function SpellScript::GetCorpseTargetCountForEffect was called, but function has no effect in current hook! (spell has not selected targets yet)",
675 if (!aura || (aura->
IsRemoved() && !withRemoved))
829 for (
auto itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
831 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->
Id,
m_scriptName);
833 for (
auto itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
835 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->
Id,
m_scriptName);
837 for (
auto itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr)
839 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->
Id,
m_scriptName);
841 for (
auto itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
842 if (!itr->GetAffectedEffectsMask(entry))
843 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
845 for (
auto itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr)
846 if (!itr->GetAffectedEffectsMask(entry))
847 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
849 for (
auto itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr)
850 if (!itr->GetAffectedEffectsMask(entry))
851 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
853 for (
auto itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr)
854 if (!itr->GetAffectedEffectsMask(entry))
855 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
857 for (
auto itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr)
858 if (!itr->GetAffectedEffectsMask(entry))
859 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
861 for (
auto itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr)
862 if (!itr->GetAffectedEffectsMask(entry))
863 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
865 for (
auto itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr)
866 if (!itr->GetAffectedEffectsMask(entry))
867 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
869 for (
auto itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr)
870 if (!itr->GetAffectedEffectsMask(entry))
871 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
873 for (
auto itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr)
874 if (!itr->GetAffectedEffectsMask(entry))
875 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
877 for (
auto itr = DoEffectCalcCritChance.begin(); itr != DoEffectCalcCritChance.end(); ++itr)
878 if (!itr->GetAffectedEffectsMask(entry))
879 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcCritChance` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
882 if (!hook.GetAffectedEffectsMask(entry))
883 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcDamageAndHealing` of AuraScript won't be executed", entry->
Id, hook.ToString(),
m_scriptName);
885 for (
auto itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr)
886 if (!itr->GetAffectedEffectsMask(entry))
887 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
889 for (
auto itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr)
890 if (!itr->GetAffectedEffectsMask(entry))
891 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
893 for (
auto itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr)
894 if (!itr->GetAffectedEffectsMask(entry))
895 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
897 for (
auto itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr)
898 if (!itr->GetAffectedEffectsMask(entry))
899 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
901 for (
auto itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr)
902 if (!itr->GetAffectedEffectsMask(entry))
903 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
905 for (
auto itr = DoCheckProc.begin(); itr != DoCheckProc.end(); ++itr)
907 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoCheckProc` of AuraScript won't be executed", entry->
Id,
m_scriptName);
909 for (
auto itr = DoCheckEffectProc.begin(); itr != DoCheckEffectProc.end(); ++itr)
910 if (!itr->GetAffectedEffectsMask(entry))
911 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoCheckEffectProc` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
913 for (
auto itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr)
915 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoPrepareProc` of AuraScript won't be executed", entry->
Id,
m_scriptName);
917 for (
auto itr = OnProc.begin(); itr != OnProc.end(); ++itr)
919 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `OnProc` of AuraScript won't be executed", entry->
Id,
m_scriptName);
921 for (
auto itr = AfterProc.begin(); itr != AfterProc.end(); ++itr)
923 TC_LOG_ERROR(
"scripts",
"Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `AfterProc` of AuraScript won't be executed", entry->
Id,
m_scriptName);
925 for (
auto itr = OnEffectProc.begin(); itr != OnEffectProc.end(); ++itr)
926 if (!itr->GetAffectedEffectsMask(entry))
927 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectProc` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
929 for (
auto itr = AfterEffectProc.begin(); itr != AfterEffectProc.end(); ++itr)
930 if (!itr->GetAffectedEffectsMask(entry))
931 TC_LOG_ERROR(
"scripts",
"Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectProc` of AuraScript won't be executed", entry->
Id, itr->ToString(),
m_scriptName);
937 :
EffectHook(effIndex), _auraType(auraType) { }
945 if (spellInfo->
GetEffects().size() <= effIndex)
1012 ABORT_MSG(
"AuraScript::_IsDefaultActionPrevented is called in a wrong place");
#define MAX_SPELL_EFFECTS
#define STRING_VIEW_FMT_ARG(str)
#define TC_LOG_ERROR(filterType__, message__,...)
#define EFFECT_FIRST_FOUND
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_WEAPON_DAMAGE
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_HEAL_MECHANICAL
@ SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
@ TARGET_SELECT_CATEGORY_CONE
@ TARGET_SELECT_CATEGORY_AREA
@ TARGET_SELECT_CATEGORY_DEFAULT
@ TARGET_SELECT_CATEGORY_NEARBY
@ TARGET_SELECT_CATEGORY_LINE
@ TARGET_SELECT_CATEGORY_CHANNEL
@ TARGET_OBJECT_TYPE_UNIT_AND_DEST
@ TARGET_OBJECT_TYPE_DEST
@ TARGET_REFERENCE_TYPE_TARGET
@ TARGET_REFERENCE_TYPE_CASTER
@ AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC
@ AURA_SCRIPT_HOOK_EFFECT_CALC_DAMAGE_AND_HEALING
@ AURA_SCRIPT_HOOK_EFFECT_REMOVE
@ AURA_SCRIPT_HOOK_EFFECT_CALC_CRIT_CHANCE
@ AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD
@ AURA_SCRIPT_HOOK_PREPARE_PROC
@ AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY
@ AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE
@ AURA_SCRIPT_HOOK_AFTER_PROC
@ AURA_SCRIPT_HOOK_EFFECT_MANASHIELD
@ AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB
@ AURA_SCRIPT_HOOK_EFFECT_APPLY
@ AURA_SCRIPT_HOOK_EFFECT_PERIODIC
@ AURA_SCRIPT_HOOK_EFFECT_AFTER_PROC
@ AURA_SCRIPT_HOOK_EFFECT_ABSORB
@ AURA_SCRIPT_HOOK_EFFECT_PROC
@ AURA_SCRIPT_HOOK_EFFECT_SPLIT
@ AURA_SCRIPT_HOOK_CHECK_PROC
@ AURA_SCRIPT_HOOK_ENTER_LEAVE_COMBAT
@ SPELL_SCRIPT_STATE_NONE
@ SPELL_SCRIPT_STATE_LOADING
@ SPELL_SCRIPT_STATE_UNLOADING
@ SPELL_SCRIPT_STATE_REGISTRATION
#define HOOK_SPELL_HIT_START
#define HOOK_SPELL_HIT_END
@ SPELL_SCRIPT_HOOK_AFTER_CAST
@ SPELL_SCRIPT_HOOK_AFTER_HIT
@ SPELL_SCRIPT_HOOK_EFFECT_SUCCESSFUL_DISPEL
@ SPELL_SCRIPT_HOOK_CALC_HEALING
@ SPELL_SCRIPT_HOOK_EFFECT_LAUNCH
@ SPELL_SCRIPT_HOOK_BEFORE_HIT
@ SPELL_SCRIPT_HOOK_CALC_DAMAGE
@ SPELL_SCRIPT_HOOK_CHECK_CAST
@ SPELL_SCRIPT_HOOK_EFFECT_LAUNCH_TARGET
@ SPELL_SCRIPT_HOOK_EFFECT_HIT_TARGET
@ SPELL_SCRIPT_HOOK_CALC_CRIT_CHANCE
@ SPELL_SCRIPT_HOOK_ON_CAST
std::string ToString() const
EffectBase & operator=(EffectBase const &right)=delete
EffectBase(uint8 effIndex, uint16 auraType)
bool CheckEffect(SpellInfo const *spellInfo, uint8 effIndex) const override
bool _defaultActionPrevented
uint8 _currentScriptState
AuraApplication const * _auraApplication
void PreventDefaultAction()
AuraObjectType GetType() const
void _PrepareScriptCall(AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
void SetMaxDuration(int32 duration)
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
AuraApplication const * m_auraApplication
bool ModCharges(int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool m_defaultActionPrevented
SpellInfo const * GetSpellInfo() const
WorldObject * GetOwner() const
uint8 CalcMaxCharges() const
int32 GetMaxDuration() const
time_t GetApplyTime() const
void SetCharges(uint8 charges)
void SetDuration(int32 duration, bool withMods=false)
bool DropCharge(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
bool HasEffectType(AuraType type) const
bool _Validate(SpellInfo const *entry) override
ObjectGuid GetCasterGUID() const
bool IsDeathPersistent() const
GameObject * GetGObjCaster() const
Difficulty GetCastDifficulty() const
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
ScriptStateStack m_scriptStates
int32 CalcMaxDuration() const
void SetStackAmount(uint8 num)
Unit * GetUnitOwner() const
bool _IsDefaultActionPrevented() const
bool HasEffect(uint8 effIndex) const
uint8 GetStackAmount() const
DynamicObject * GetDynobjOwner() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
int32 GetMaxDuration() const
void SetStackAmount(uint8 num)
Unit * GetUnitOwner() const
void RefreshDuration(bool withMods=false)
DynamicObject * GetDynobjOwner() const
ObjectGuid GetCasterGUID() const
bool HasEffect(uint8 effIndex) const
WorldObject * GetOwner() const
bool ModCharges(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
int32 GetDuration() const
bool IsDeathPersistent() const
bool HasEffectType(AuraType type) const
AuraEffect * GetEffect(uint32 index) const
uint8 CalcMaxCharges(Unit *caster) const
void SetCharges(uint8 charges)
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
int32 CalcMaxDuration() const
void SetDuration(int32 duration, bool withMods=false)
AuraObjectType GetType() const
uint8 GetStackAmount() const
SpellInfo const * GetSpellInfo() const
void SetMaxDuration(int32 duration)
Difficulty GetCastDifficulty() const
time_t GetApplyTime() const
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
bool DropCharge(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
GameObject * ToGameObject()
WorldObject * GetObjectTarget() const
GameObject * GetGOTarget() const
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
Item * GetItemTarget() const
Unit * GetUnitTarget() const
WorldLocation const * GetDstPos() const
static constexpr SpellEffectValue MaxValue
static constexpr SpellEffectValue MinValue
SpellImplicitTargetInfo TargetA
SpellImplicitTargetInfo TargetB
SpellTargetReferenceTypes GetReferenceType() const
SpellTargetSelectionCategories GetSelectionCategory() const
SpellTargetObjectTypes GetObjectType() const
Targets GetTarget() const
bool HasEffect(SpellEffectName effect) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
std::vector< SpellEffectInfo > const & GetEffects() const
bool HasAreaAuraEffect() const
bool IsEffectAffected(SpellInfo const *spellInfo, uint8 effIndex) const
EffectHook(uint8 effIndex)
uint32 GetAffectedEffectsMask(SpellInfo const *spellInfo) const
EffectHook & operator=(EffectHook const &right)=delete
std::string EffIndexToString() const
HookList & operator+=(T &&t) noexcept
uint8 m_currentScriptState
void _Init(std::string const &scriptname, uint32 spellId)
virtual void Register()=0
virtual bool Validate(SpellInfo const *spellInfo)
std::string_view m_scriptName
static bool ValidateSpellInfoImpl(Iterator begin, Iterator end)
static bool ValidateSpellEffectImpl(uint32 spellId, SpellEffIndex effectIndex)
virtual ~SpellScriptBase()
SpellScriptBase() noexcept
std::string_view GetScriptName() const
virtual bool _Validate(SpellInfo const *entry)
bool CheckEffect(SpellInfo const *spellInfo, uint8 effIndex) const override
EffectBase & operator=(EffectBase const &right)=delete
EffectBase(uint8 effIndex, uint16 effName)
std::string ToString() const
std::string ToString() const
bool CheckEffect(SpellInfo const *spellInfo, uint8 effIndex) const override
TargetHook(uint8 effectIndex, uint16 targetType, bool area, bool dest)
TargetHook & operator=(TargetHook const &right)=delete
HookList< DamageAndHealingCalcHandler > CalcDamage
WorldLocation * GetHitDest() const
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Aura * GetHitAura(bool dynObjAura=false, bool withRemoved=false) const
int32 GetHitDamage() const
int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const
bool IsInEffectHook() const
void SetEffectVariance(float variance)
void SetEffectValue(SpellEffectValue value)
SpellEffectValue GetEffectValue() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
int32 GetEffectValueAsInt() const
void CreateItem(uint32 itemId, ItemContext context)
uint32 m_hitPreventDefaultEffectMask
bool IsInTargetHook() const
uint32 m_hitPreventEffectMask
bool IsAfterTargetSelectionPhase() const
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
SpellInfo const * GetTriggeringSpell() const
Unit * GetHitUnit() const
SpellValue const * GetSpellValue() const
bool IsInHitPhase() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Corpse * GetHitCorpse() const
void PreventHitEffect(SpellEffIndex effIndex)
Item * GetCastItem() const
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
bool _Validate(SpellInfo const *entry) override
void SetExplTargetDest(WorldLocation const &loc)
void SetCustomCastResultMessage(SpellCustomErrors result)
void FinishCast(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr)
WorldObject * GetExplTargetWorldObject() const
HookList< EffectHandler > OnEffectLaunchTarget
Item * GetHitItem() const
int64 GetItemTargetCountForEffect(SpellEffIndex effect) const
Difficulty GetCastDifficulty() const
int32 GetUnitTargetIndexForEffect(ObjectGuid const &target, SpellEffIndex effect) const
void SetHitDamage(int32 damage)
HookList< EffectHandler > OnEffectSuccessfulDispel
WorldLocation const * GetExplTargetDest() const
bool IsInCheckCastHook() const
HookList< EffectHandler > OnEffectLaunch
void SetHitHeal(int32 heal)
HookList< DamageAndHealingCalcHandler > CalcHealing
GameObject * GetExplTargetGObj() const
GameObject * GetGObjCaster() const
Item * GetExplTargetItem() const
bool IsInModifiableHook() const
Unit * GetExplTargetUnit() const
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
void _PrepareScriptCall(SpellScriptHookType hookType)
SpellInfo const * GetSpellInfo() const
float GetEffectVariance() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Unit * GetOriginalCaster() const
GameObject * GetHitGObj() const
SpellInfo const * GetSpellInfo() const
GameObject * gameObjTarget
int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const
SpellCastTargets m_targets
Difficulty GetCastDifficulty() const
std::vector< TargetInfo > m_UniqueTargetInfo
int64 GetItemTargetCountForEffect(SpellEffIndex effect) const
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
void DoCreateItem(uint32 itemId, ItemContext context=ItemContext::NONE, std::vector< int32 > const *bonusListIDs=nullptr)
SpellEffectValue effectValue
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
SpellCustomErrors m_customError
SpellEffectInfo const * effectInfo
SpellInfo const * m_triggeredByAuraSpell
WorldObject * GetCaster() const
Unit * GetOriginalCaster() const
WorldLocation * destTarget
int32 GetUnitTargetIndexForEffect(ObjectGuid const &target, SpellEffIndex effect) const
SpellValue *const m_spellValue
void finish(SpellCastResult result=SPELL_CAST_OK)
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
std::string StringFormat(FormatString< Args... > fmt, Args &&... args) noexcept
Default TC string format function.