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
4338 {
4339 if (GetCaster())
4340 {
4342 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4343 {
4344 Aura const* aura = itr->second->GetBase();
4345 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4346 continue;
4347
4348 return SPELL_CAST_OK;
4349 }
4350 }
4351
4353 }
@ MECHANIC_BLEED
Definition SharedDefines.h:1328
@ SPELL_FAILED_NOTHING_TO_DISPEL
Definition SharedDefines.h:1023
@ SPELL_CAST_OK
Definition SharedDefines.h:1126
Definition SpellAuras.h:87
uint8 GetCasterLevel() const
Definition SpellAuras.h:154
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:100
uint64 GetAllEffectsMechanicMask() const
Definition SpellInfo.cpp:1899
bool IsPositive() const
Definition SpellInfo.cpp:1269
Unit * GetCaster()
Definition SpellScript.cpp:401
boost::container::flat_multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:674
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1384

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
4356 {
4357 PreventHitDefaultEffect(effIndex);
4358
4359 if (Player* player = GetCaster()->ToPlayer())
4360 {
4361 Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
4362 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4363 {
4364 Aura const* aura = itr->second->GetBase();
4365 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4366 continue;
4367
4368 player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
4369 return;
4370 }
4371 }
4372 }
ObjectGuid GetCasterGUID() const
Definition SpellAuras.h:105
uint32 GetId() const
Definition SpellAuras.cpp:410
Definition Player.h:1086
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.

4375 {
4378 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_DISPEL_MECHANIC
Definition SharedDefines.h:874
#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:4337
void HandleEffect(SpellEffIndex effIndex)
Definition spell_item.cpp:4355

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: