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

Private Member Functions

 PrepareSpellScript (spell_yogg_saron_sanity_reduce_SpellScript)
 
void HandleScriptEffect (SpellEffIndex effIndex)
 
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

◆ HandleScriptEffect()

void spell_yogg_saron_sanity_reduce::spell_yogg_saron_sanity_reduce_SpellScript::HandleScriptEffect ( SpellEffIndex  effIndex)
inlineprivate
2758 {
2759 PreventHitDefaultEffect(effIndex);
2760 Player* target = GetHitPlayer();
2761 if (!target)
2762 return;
2763
2764 uint8 _reduceAmount = 0;
2765 switch (GetSpellInfo()->Id)
2766 {
2768 _reduceAmount = 9;
2769 break;
2771 _reduceAmount = 12;
2772 break;
2774 _reduceAmount = 3;
2775 break;
2777 _reduceAmount = 3;
2778 break;
2780 _reduceAmount = 2;
2781 break;
2782 case 64168 /*SPELL_LUNATIC_GAZE*/:
2783 _reduceAmount = 2;
2784 break;
2785 case 64164 /*SPELL_YS_LUNATIC_GAZE*/:
2786 _reduceAmount = 4;
2787 break;
2789 // Teleported out of brain
2790 if (target->GetPositionZ() > 300.0f)
2791 return;
2792 else
2793 target->CastSpell(target, SPELL_CANCEL_ILLUSION_AURA, true); // else we are underground, remove illusion aura and teleport outside
2794 _reduceAmount = 100;
2795 break;
2796 }
2797
2798 if (Aura* aur = target->GetAura(SPELL_SANITY))
2799 {
2800 if ((aur->GetStackAmount() - _reduceAmount) <= 20)
2801 target->CastSpell(target, 63752 /*SANITY_SCREEN_EFFECT*/, true);
2802 aur->ModStackAmount(-_reduceAmount);
2803 }
2804 }
std::uint8_t uint8
Definition: Define.h:110
@ SPELL_BRAIN_LINK_DAMAGE
Definition: boss_yoggsaron.cpp:79
@ SPELL_SANITY
Definition: boss_yoggsaron.cpp:52
@ SPELL_CANCEL_ILLUSION_AURA
Definition: boss_yoggsaron.cpp:127
@ SPELL_MALADY_OF_THE_MIND
Definition: boss_yoggsaron.cpp:76
@ SPELL_MALADY_OF_THE_MIND_TRIGGER
Definition: boss_yoggsaron.cpp:77
@ SPELL_SARA_PSYCHOSIS_10
Definition: boss_yoggsaron.cpp:74
@ SPELL_SARA_PSYCHOSIS_25
Definition: boss_yoggsaron.cpp:75
@ SPELL_INDUCE_MADNESS
Definition: boss_yoggsaron.cpp:119
float GetPositionZ() const
Definition: Position.h:119
Definition: Player.h:1046
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5499
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
Definition: SpellAuras.h:87
Player * GetHitPlayer()
Definition: SpellScript.cpp:471
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590

References Unit::CastSpell(), Unit::GetAura(), SpellScript::GetHitPlayer(), Position::GetPositionZ(), SpellScript::GetSpellInfo(), SpellScript::PreventHitDefaultEffect(), SPELL_BRAIN_LINK_DAMAGE, SPELL_CANCEL_ILLUSION_AURA, SPELL_INDUCE_MADNESS, SPELL_MALADY_OF_THE_MIND, SPELL_MALADY_OF_THE_MIND_TRIGGER, SPELL_SANITY, SPELL_SARA_PSYCHOSIS_10, and SPELL_SARA_PSYCHOSIS_25.

Referenced by Register().

◆ PrepareSpellScript()

spell_yogg_saron_sanity_reduce::spell_yogg_saron_sanity_reduce_SpellScript::PrepareSpellScript ( spell_yogg_saron_sanity_reduce_SpellScript  )
private

◆ Register()

void spell_yogg_saron_sanity_reduce::spell_yogg_saron_sanity_reduce_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2807 {
2809 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
#define EFFECT_FIRST_FOUND
Definition: SharedDefines.h:36
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:827
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleScriptEffect(SpellEffIndex effIndex)
Definition: boss_yoggsaron.cpp:2757

References EFFECT_FIRST_FOUND, HandleScriptEffect(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_SCRIPT_EFFECT, and SpellEffectFn.