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

Private Member Functions

 PrepareSpellScript (spell_rog_preparation)
 
bool Load () override
 
bool Validate (SpellInfo const *) 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 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

◆ HandleDummy()

void spell_rog_preparation::HandleDummy ( SpellEffIndex  )
inlineprivate
450 {
451 Player* caster = GetCaster()->ToPlayer();
452 //immediately finishes the cooldown on certain Rogue abilities
453
454 bool hasGlyph = caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION);
455 PlayerSpellMap const& spellMap = caster->GetSpellMap();
456 for (PlayerSpellMap::const_iterator itr = spellMap.begin(); itr != spellMap.end(); ++itr)
457 {
458 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
459 if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
460 {
461 if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
462 spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint
463 {
464 SpellCooldowns::iterator citr = caster->GetSpellCooldownMap().find(spellInfo->Id);
465 if (citr != caster->GetSpellCooldownMap().end() && citr->second.needSendToClient)
466 caster->RemoveSpellCooldown(spellInfo->Id, true);
467 else
468 caster->RemoveSpellCooldown(spellInfo->Id, false);
469 }
470 else if (hasGlyph)
471 {
472 if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
473 spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
474 (spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
476 {
477 SpellCooldowns::iterator citr = caster->GetSpellCooldownMap().find(spellInfo->Id);
478 if (citr != caster->GetSpellCooldownMap().end() && citr->second.needSendToClient)
479 caster->RemoveSpellCooldown(spellInfo->Id, true);
480 else
481 caster->RemoveSpellCooldown(spellInfo->Id, false);
482 }
483 }
484 }
485 }
486 }
@ SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT
Definition: SpellMgr.h:55
@ SPELLFAMILYFLAG_ROGUE_KICK
Definition: SpellMgr.h:57
@ SPELLFAMILYFLAG1_ROGUE_DISMANTLE
Definition: SpellMgr.h:58
@ SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP
Definition: SpellMgr.h:56
@ SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY
Definition: SpellMgr.h:59
@ SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY
Definition: SpellMgr.h:60
#define sSpellMgr
Definition: SpellMgr.h:825
std::unordered_map< uint32, PlayerSpell * > PlayerSpellMap
Definition: Player.h:193
@ SPELL_ROGUE_GLYPH_OF_PREPARATION
Definition: spell_rogue.cpp:36
@ SPELLFAMILY_ROGUE
Definition: SharedDefines.h:3536
Player * ToPlayer()
Definition: Object.h:198
Definition: Player.h:1063
PlayerSpellMap const & GetSpellMap() const
Definition: Player.h:1752
SpellCooldowns const & GetSpellCooldownMap() const
Definition: Player.h:1755
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition: Player.cpp:3502
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5649
Definition: SpellInfo.h:316
flag96 SpellFamilyFlags
Definition: SpellInfo.h:388
uint32 Id
Definition: SpellInfo.h:320
uint32 SpellFamilyName
Definition: SpellInfo.h:387
Unit * GetCaster()
Definition: SpellScript.cpp:401

References SpellScript::GetCaster(), Player::GetSpellCooldownMap(), Player::GetSpellMap(), Unit::HasAura(), SpellInfo::Id, Player::RemoveSpellCooldown(), SPELL_ROGUE_GLYPH_OF_PREPARATION, SPELLFAMILY_ROGUE, SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY, SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP, SPELLFAMILYFLAG1_ROGUE_DISMANTLE, SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY, SPELLFAMILYFLAG_ROGUE_KICK, SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, sSpellMgr, and Object::ToPlayer().

Referenced by Register().

◆ Load()

bool spell_rog_preparation::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

440 {
441 return GetCaster()->IsPlayer();
442 }
bool IsPlayer() const
Definition: Object.h:197

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

◆ PrepareSpellScript()

spell_rog_preparation::PrepareSpellScript ( spell_rog_preparation  )
private

◆ Register()

void spell_rog_preparation::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

489 {
491 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:781
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleDummy(SpellEffIndex)
Definition: spell_rogue.cpp:449

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

◆ Validate()

bool spell_rog_preparation::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

445 {
447 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:125

References SPELL_ROGUE_GLYPH_OF_PREPARATION, and _SpellScript::ValidateSpellInfo().