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
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
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< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- 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
4355 {
4356 if (GetCaster())
4357 {
4359 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4360 {
4361 Aura const* aura = itr->second->GetBase();
4362 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4363 continue;
4364
4365 return SPELL_CAST_OK;
4366 }
4367 }
4368
4370 }
@ 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:88
uint8 GetCasterLevel() const
Definition SpellAuras.h:155
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:101
uint64 GetAllEffectsMechanicMask() const
Definition SpellInfo.cpp:1926
bool IsPositive() const
Definition SpellInfo.cpp:1282
Unit * GetCaster()
Definition SpellScript.cpp:401
boost::container::flat_multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:674
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1388

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
4373 {
4374 PreventHitDefaultEffect(effIndex);
4375
4376 if (Player* player = GetCaster()->ToPlayer())
4377 {
4378 Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
4379 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4380 {
4381 Aura const* aura = itr->second->GetBase();
4382 if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
4383 continue;
4384
4385 player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
4386 return;
4387 }
4388 }
4389 }
ObjectGuid GetCasterGUID() const
Definition SpellAuras.h:106
uint32 GetId() const
Definition SpellAuras.cpp:410
Definition Player.h:1086
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:595

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.

4392 {
4395 }
@ 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:4354
void HandleEffect(SpellEffIndex effIndex)
Definition spell_item.cpp:4372

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: