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
2760 {
2761 PreventHitDefaultEffect(effIndex);
2762 Player* target = GetHitPlayer();
2763 if (!target)
2764 return;
2765
2766 uint8 _reduceAmount = 0;
2767 switch (GetSpellInfo()->Id)
2768 {
2770 _reduceAmount = 9;
2771 break;
2773 _reduceAmount = 12;
2774 break;
2776 _reduceAmount = 3;
2777 break;
2779 _reduceAmount = 3;
2780 break;
2782 _reduceAmount = 2;
2783 break;
2784 case 64168 /*SPELL_LUNATIC_GAZE*/:
2785 _reduceAmount = 2;
2786 break;
2787 case 64164 /*SPELL_YS_LUNATIC_GAZE*/:
2788 _reduceAmount = 4;
2789 break;
2791 // Teleported out of brain
2792 if (target->GetPositionZ() > 300.0f)
2793 return;
2794 else
2795 target->CastSpell(target, SPELL_CANCEL_ILLUSION_AURA, true); // else we are underground, remove illusion aura and teleport outside
2796 _reduceAmount = 100;
2797 break;
2798 }
2799
2800 if (Aura* aur = target->GetAura(SPELL_SANITY))
2801 {
2802 if ((aur->GetStackAmount() - _reduceAmount) <= 20)
2803 target->CastSpell(target, 63752 /*SANITY_SCREEN_EFFECT*/, true);
2804 aur->ModStackAmount(-_reduceAmount);
2805 }
2806 }
std::uint8_t uint8
Definition: Define.h:110
@ SPELL_BRAIN_LINK_DAMAGE
Definition: boss_yoggsaron.cpp:81
@ SPELL_SANITY
Definition: boss_yoggsaron.cpp:54
@ SPELL_CANCEL_ILLUSION_AURA
Definition: boss_yoggsaron.cpp:129
@ SPELL_MALADY_OF_THE_MIND
Definition: boss_yoggsaron.cpp:78
@ SPELL_MALADY_OF_THE_MIND_TRIGGER
Definition: boss_yoggsaron.cpp:79
@ SPELL_SARA_PSYCHOSIS_10
Definition: boss_yoggsaron.cpp:76
@ SPELL_SARA_PSYCHOSIS_25
Definition: boss_yoggsaron.cpp:77
@ SPELL_INDUCE_MADNESS
Definition: boss_yoggsaron.cpp:121
float GetPositionZ() const
Definition: Position.h:119
Definition: Player.h:1056
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5519
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.

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

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