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 void Register ()=0
 
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
 
virtual bool _Validate (SpellInfo const *entry)
 
- 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
4101 {
4102 if (GetCaster())
4103 {
4105 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4106 {
4107 Aura const* aura = itr->second->GetBase();
4108 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4109 continue;
4110
4111 return SPELL_CAST_OK;
4112 }
4113 }
4114
4116 }
@ MECHANIC_BLEED
Definition: SharedDefines.h:1340
@ SPELL_FAILED_NOTHING_TO_DISPEL
Definition: SharedDefines.h:1035
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:639
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1304
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:1992
bool IsPositive() const
Definition: SpellInfo.cpp:1237
Unit * GetCaster()
Definition: SpellScript.cpp:401

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
4119 {
4120 PreventHitDefaultEffect(effIndex);
4121
4122 if (Player* player = GetCaster()->ToPlayer())
4123 {
4124 Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
4125 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4126 {
4127 Aura const* aura = itr->second->GetBase();
4128 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4129 continue;
4130
4131 player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
4132 return;
4133 }
4134 }
4135 }
Definition: Player.h:1081
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:105
uint32 GetId() const
Definition: SpellAuras.cpp:466
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.

4138 {
4141 }
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DISPEL_MECHANIC
Definition: SharedDefines.h:886
#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:4100
void HandleEffect(SpellEffIndex effIndex)
Definition: spell_item.cpp:4118

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