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
465 {
466 Player* caster = GetCaster()->ToPlayer();
467 //immediately finishes the cooldown on certain Rogue abilities
468
469 bool hasGlyph = caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION);
470 PlayerSpellMap const& spellMap = caster->GetSpellMap();
471 for (PlayerSpellMap::const_iterator itr = spellMap.begin(); itr != spellMap.end(); ++itr)
472 {
473 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
474 if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
475 {
476 if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
477 spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint
478 {
479 SpellCooldowns::iterator citr = caster->GetSpellCooldownMap().find(spellInfo->Id);
480 if (citr != caster->GetSpellCooldownMap().end() && citr->second.needSendToClient)
481 caster->RemoveSpellCooldown(spellInfo->Id, true);
482 else
483 caster->RemoveSpellCooldown(spellInfo->Id, false);
484 }
485 else if (hasGlyph)
486 {
487 if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
488 spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
489 (spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
491 {
492 SpellCooldowns::iterator citr = caster->GetSpellCooldownMap().find(spellInfo->Id);
493 if (citr != caster->GetSpellCooldownMap().end() && citr->second.needSendToClient)
494 caster->RemoveSpellCooldown(spellInfo->Id, true);
495 else
496 caster->RemoveSpellCooldown(spellInfo->Id, false);
497 }
498 }
499 }
500 }
501 }
std::unordered_map< uint32, PlayerSpell * > PlayerSpellMap
Definition: Player.h:194
@ 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
@ SPELL_ROGUE_GLYPH_OF_PREPARATION
Definition: spell_rogue.cpp:36
@ SPELLFAMILY_ROGUE
Definition: SharedDefines.h:3536
Player * ToPlayer()
Definition: Object.h:195
Definition: Player.h:1056
PlayerSpellMap const & GetSpellMap() const
Definition: Player.h:1739
SpellCooldowns const & GetSpellCooldownMap() const
Definition: Player.h:1742
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition: Player.cpp:3475
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636
Definition: SpellInfo.h:314
flag96 SpellFamilyFlags
Definition: SpellInfo.h:386
uint32 Id
Definition: SpellInfo.h:318
uint32 SpellFamilyName
Definition: SpellInfo.h:385
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.

455 {
456 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
457 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
TypeID GetTypeId() const
Definition: Object.h:121

References SpellScript::GetCaster(), Object::GetTypeId(), and TYPEID_PLAYER.

◆ PrepareSpellScript()

spell_rog_preparation::PrepareSpellScript ( spell_rog_preparation  )
private

◆ Register()

void spell_rog_preparation::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

504 {
506 }
#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:464

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

◆ Validate()

bool spell_rog_preparation::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_ROGUE_GLYPH_OF_PREPARATION, and _SpellScript::ValidateSpellInfo().