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

Private Member Functions

 PrepareSpellScript (spell_rog_killing_spree_SpellScript)
 
bool Validate (SpellInfo const *) override
 
SpellCastResult CheckCast ()
 
void FilterTargets (std::list< WorldObject * > &targets)
 
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

◆ CheckCast()

SpellCastResult spell_rog_killing_spree::spell_rog_killing_spree_SpellScript::CheckCast ( )
inlineprivate
300 {
301 // Kologarn area, Killing Spree should not work
302 if (GetCaster()->GetMapId() == 603 /*Ulduar*/ && GetCaster()->GetDistance2d(1766.936f, -24.748f) < 50.0f)
304 return SPELL_CAST_OK;
305 }
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
Definition: SharedDefines.h:1094
@ SPELL_CAST_OK
Definition: SharedDefines.h:1110
Unit * GetCaster()
Definition: SpellScript.cpp:401

References SpellScript::GetCaster(), SPELL_CAST_OK, and SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW.

Referenced by Register().

◆ FilterTargets()

void spell_rog_killing_spree::spell_rog_killing_spree_SpellScript::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
308 {
309 if (targets.empty() || GetCaster()->GetVehicleBase() || GetCaster()->HasUnitState(UNIT_STATE_ROOT))
311 else
312 {
313 // Added attribute not breaking stealth, removes auras here
316 }
317 }
@ UNIT_STATE_ROOT
Definition: Unit.h:335
@ AURA_INTERRUPT_FLAG_SPELL_ATTACK
Definition: SpellDefines.h:57
@ AURA_INTERRUPT_FLAG_CAST
Definition: SpellDefines.h:46
@ SPELL_FAILED_OUT_OF_RANGE
Definition: SharedDefines.h:1018
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5096
void FinishCast(SpellCastResult result)
Definition: SpellScript.cpp:635

References AURA_INTERRUPT_FLAG_CAST, AURA_INTERRUPT_FLAG_SPELL_ATTACK, SpellScript::FinishCast(), SpellScript::GetCaster(), Unit::RemoveAurasWithInterruptFlags(), SPELL_FAILED_OUT_OF_RANGE, and UNIT_STATE_ROOT.

Referenced by Register().

◆ HandleDummy()

void spell_rog_killing_spree::spell_rog_killing_spree_SpellScript::HandleDummy ( SpellEffIndex  )
inlineprivate
320 {
321 if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
322 {
323 if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName(KillingSpreeScriptName)))
324 script->AddTarget(GetHitUnit());
325 }
326 }
#define KillingSpreeScriptName
Definition: spell_rogue.cpp:284
@ SPELL_ROGUE_KILLING_SPREE
Definition: spell_rogue.cpp:37
Definition: SpellAuras.h:87
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

References SpellScript::GetCaster(), SpellScript::GetHitUnit(), KillingSpreeScriptName, and SPELL_ROGUE_KILLING_SPREE.

Referenced by Register().

◆ PrepareSpellScript()

spell_rog_killing_spree::spell_rog_killing_spree_SpellScript::PrepareSpellScript ( spell_rog_killing_spree_SpellScript  )
private

◆ Register()

void spell_rog_killing_spree::spell_rog_killing_spree_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

329 {
333 }
#define SpellCheckCastFn(F)
Definition: SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
@ EFFECT_1
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:753
@ TARGET_UNIT_DEST_AREA_ENEMY
Definition: SharedDefines.h:1393
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:328
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void FilterTargets(std::list< WorldObject * > &targets)
Definition: spell_rogue.cpp:307
void HandleDummy(SpellEffIndex)
Definition: spell_rogue.cpp:319
SpellCastResult CheckCast()
Definition: spell_rogue.cpp:299

References CheckCast(), EFFECT_1, FilterTargets(), HandleDummy(), SpellScript::OnCheckCast, SpellScript::OnEffectHitTarget, SpellScript::OnObjectAreaTargetSelect, SPELL_EFFECT_DUMMY, SpellCheckCastFn, SpellEffectFn, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_DEST_AREA_ENEMY.

◆ Validate()

bool spell_rog_killing_spree::spell_rog_killing_spree_SpellScript::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_ROGUE_KILLING_SPREE, and _SpellScript::ValidateSpellInfo().