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

Private Member Functions

 PrepareSpellScript (spell_dru_wild_growth)
 
bool Validate (SpellInfo const *spellInfo) override
 
void FilterTargets (std::list< WorldObject * > &targets)
 
void SetTargets (std::list< WorldObject * > &targets)
 
void Register () override
 

Private Attributes

std::list< WorldObject * > _targets
 

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 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

◆ FilterTargets()

void spell_dru_wild_growth::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
1196 {
1197 targets.remove_if(Acore::RaidCheck(GetCaster(), false));
1198
1199 uint32 const maxTargets = GetCaster()->HasAura(SPELL_DRUID_GLYPH_OF_WILD_GROWTH) ? 6 : 5;
1200
1201 if (targets.size() > maxTargets)
1202 {
1203 targets.sort(Acore::HealthPctOrderPred());
1204 targets.resize(maxTargets);
1205 }
1206
1207 _targets = targets;
1208 }
std::uint32_t uint32
Definition Define.h:107
Definition Unit.h:2297
Definition GridNotifiers.h:1751
Unit * GetCaster()
Definition SpellScript.cpp:401
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5764
std::list< WorldObject * > _targets
Definition spell_druid.cpp:1222
@ SPELL_DRUID_GLYPH_OF_WILD_GROWTH
Definition spell_druid.cpp:34

References _targets, SpellScript::GetCaster(), Unit::HasAura(), and SPELL_DRUID_GLYPH_OF_WILD_GROWTH.

Referenced by Register().

◆ PrepareSpellScript()

spell_dru_wild_growth::PrepareSpellScript ( spell_dru_wild_growth  )
private

◆ Register()

void spell_dru_wild_growth::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1216 {
1219 }
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ TARGET_UNIT_DEST_AREA_ALLY
Definition SharedDefines.h:1439
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void SetTargets(std::list< WorldObject * > &targets)
Definition spell_druid.cpp:1210
void FilterTargets(std::list< WorldObject * > &targets)
Definition spell_druid.cpp:1195

References EFFECT_0, EFFECT_1, FilterTargets(), SpellScript::OnObjectAreaTargetSelect, SetTargets(), SpellObjectAreaTargetSelectFn, and TARGET_UNIT_DEST_AREA_ALLY.

◆ SetTargets()

void spell_dru_wild_growth::SetTargets ( std::list< WorldObject * > &  targets)
inlineprivate
1211 {
1212 targets = _targets;
1213 }

References _targets.

Referenced by Register().

◆ Validate()

bool spell_dru_wild_growth::Validate ( SpellInfo const *  spellInfo)
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1189 {
1190 if (spellInfo->Effects[EFFECT_2].IsEffect() || spellInfo->Effects[EFFECT_2].CalcValue() <= 0)
1191 return false;
1192 return true;
1193 }
@ EFFECT_2
Definition SharedDefines.h:33

References EFFECT_2, and SpellInfo::Effects.

Member Data Documentation

◆ _targets

std::list<WorldObject*> spell_dru_wild_growth::_targets
private

Referenced by FilterTargets(), and SetTargets().


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