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

Private Member Functions

 PrepareSpellScript (spell_hun_readiness)
 
bool Load () override
 
void HandleDummy (SpellEffIndex)
 
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 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

◆ HandleDummy()

void spell_hun_readiness::HandleDummy ( SpellEffIndex  )
inlineprivate
678 {
679 Player* caster = GetCaster()->ToPlayer();
680 // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
681
682 // force removal of the disarm cooldown
684
685 SpellCooldowns& cooldowns = caster->GetSpellCooldownMap();
686
687 std::set<std::pair<uint32, bool>> spellsToRemove;
688 std::set<uint32> categoriesToRemove;
689
690 for (auto const& [spellId, cooldown] : cooldowns)
691 {
692 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
693 if (spellInfo
694 && spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER
695 && spellInfo->Id != SPELL_HUNTER_READINESS
696 && spellInfo->Id != SPELL_HUNTER_BESTIAL_WRATH
697 && spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU)
698 {
699 if (spellInfo->RecoveryTime > 0)
700 spellsToRemove.insert(std::make_pair(spellInfo->Id, cooldown.needSendToClient));
701
702 if (spellInfo->CategoryRecoveryTime > 0)
703 categoriesToRemove.insert(spellInfo->GetCategory());
704 }
705 }
706
707 // we can't remove spell cooldowns while iterating.
708 for (auto const& [spellId, sendToClient] : spellsToRemove)
709 caster->RemoveSpellCooldown(spellId, sendToClient);
710 for (auto const& category : categoriesToRemove)
711 caster->RemoveCategoryCooldown(category);
712 }
std::map< uint32, SpellCooldown > SpellCooldowns
Definition Player.h:209
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3795
#define sSpellMgr
Definition SpellMgr.h:836
Player * ToPlayer()
Definition Object.h:202
Definition Player.h:1084
SpellCooldowns const & GetSpellCooldownMap() const
Definition Player.h:1790
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3513
Definition SpellInfo.h:340
uint32 GetCategory() const
Definition SpellInfo.cpp:880
uint32 RecoveryTime
Definition SpellInfo.h:372
uint32 Id
Definition SpellInfo.h:344
uint32 CategoryRecoveryTime
Definition SpellInfo.h:373
uint32 SpellFamilyName
Definition SpellInfo.h:411
Unit * GetCaster()
Definition SpellScript.cpp:401
@ SPELL_HUNTER_CHIMERA_SHOT_SCORPID
Definition spell_hunter.cpp:49
@ SPELL_HUNTER_READINESS
Definition spell_hunter.cpp:61
@ SPELL_DRAENEI_GIFT_OF_THE_NAARU
Definition spell_hunter.cpp:66
@ SPELL_HUNTER_BESTIAL_WRATH
Definition spell_hunter.cpp:46

References SpellInfo::CategoryRecoveryTime, SpellScript::GetCaster(), SpellInfo::GetCategory(), Player::GetSpellCooldownMap(), SpellInfo::Id, SpellInfo::RecoveryTime, Player::RemoveCategoryCooldown(), Player::RemoveSpellCooldown(), SPELL_DRAENEI_GIFT_OF_THE_NAARU, SPELL_HUNTER_BESTIAL_WRATH, SPELL_HUNTER_CHIMERA_SHOT_SCORPID, SPELL_HUNTER_READINESS, SPELLFAMILY_HUNTER, SpellInfo::SpellFamilyName, sSpellMgr, and Object::ToPlayer().

Referenced by Register().

◆ Load()

bool spell_hun_readiness::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

673 {
674 return GetCaster()->IsPlayer();
675 }
bool IsPlayer() const
Definition Object.h:201

References SpellScript::GetCaster(), and Object::IsPlayer().

◆ PrepareSpellScript()

spell_hun_readiness::PrepareSpellScript ( spell_hun_readiness  )
private

◆ Register()

void spell_hun_readiness::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

715 {
717 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition SharedDefines.h:769
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
void HandleDummy(SpellEffIndex)
Definition spell_hunter.cpp:677

References EFFECT_0, HandleDummy(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_DUMMY, and SpellEffectFn.


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