AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_item_luffa Class Reference
Inheritance diagram for spell_item_luffa:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_item_luffa)
 
SpellCastResult CheckCast ()
 
void HandleEffect (SpellEffIndex effIndex)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
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 const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
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)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
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 bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CheckCast()

SpellCastResult spell_item_luffa::CheckCast ( )
inlineprivate
4146 {
4147 if (GetCaster())
4148 {
4150 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4151 {
4152 Aura const* aura = itr->second->GetBase();
4153 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4154 continue;
4155
4156 return SPELL_CAST_OK;
4157 }
4158 }
4159
4161 }
@ MECHANIC_BLEED
Definition SharedDefines.h:1351
@ SPELL_FAILED_NOTHING_TO_DISPEL
Definition SharedDefines.h:1046
@ SPELL_CAST_OK
Definition SharedDefines.h:1149
Definition SpellAuras.h:87
uint8 GetCasterLevel() const
Definition SpellAuras.h:154
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:100
uint32 GetAllEffectsMechanicMask() const
Definition SpellInfo.cpp:2003
bool IsPositive() const
Definition SpellInfo.cpp:1237
Unit * GetCaster()
Definition SpellScript.cpp:401
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:629
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1308

References SpellInfo::GetAllEffectsMechanicMask(), Unit::GetAppliedAuras(), SpellScript::GetCaster(), Aura::GetCasterLevel(), Aura::GetSpellInfo(), SpellInfo::IsPositive(), MECHANIC_BLEED, SPELL_CAST_OK, and SPELL_FAILED_NOTHING_TO_DISPEL.

Referenced by Register().

◆ HandleEffect()

void spell_item_luffa::HandleEffect ( SpellEffIndex  effIndex)
inlineprivate
4164 {
4165 PreventHitDefaultEffect(effIndex);
4166
4167 if (Player* player = GetCaster()->ToPlayer())
4168 {
4169 Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
4170 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4171 {
4172 Aura const* aura = itr->second->GetBase();
4173 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4174 continue;
4175
4176 player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
4177 return;
4178 }
4179 }
4180 }
ObjectGuid GetCasterGUID() const
Definition SpellAuras.h:105
uint32 GetId() const
Definition SpellAuras.cpp:466
Definition Player.h:1072
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:590

References SpellInfo::GetAllEffectsMechanicMask(), SpellScript::GetCaster(), Aura::GetCasterGUID(), Aura::GetCasterLevel(), Aura::GetId(), Aura::GetSpellInfo(), SpellInfo::IsPositive(), MECHANIC_BLEED, and SpellScript::PreventHitDefaultEffect().

Referenced by Register().

◆ PrepareSpellScript()

spell_item_luffa::PrepareSpellScript ( spell_item_luffa  )
private

◆ Register()

void spell_item_luffa::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

4183 {
4186 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_DISPEL_MECHANIC
Definition SharedDefines.h:897
#define SpellCheckCastFn(F)
Definition SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< CheckCastHandler > OnCheckCast
Definition SpellScript.h:328
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
SpellCastResult CheckCast()
Definition spell_item.cpp:4145
void HandleEffect(SpellEffIndex effIndex)
Definition spell_item.cpp:4163

References CheckCast(), EFFECT_0, HandleEffect(), SpellScript::OnCheckCast, SpellScript::OnEffectHitTarget, SPELL_EFFECT_DISPEL_MECHANIC, SpellCheckCastFn, and SpellEffectFn.


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