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

Private Member Functions

 PrepareSpellScript (spell_sindragosa_s_fury)
 
bool Load () override
 
void SelectDest ()
 
void CountTargets (std::list< WorldObject * > &targets)
 
void HandleDummy (SpellEffIndex effIndex)
 
void Register () override
 

Private Attributes

uint32 _targetCount
 

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
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
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 bool Validate (SpellInfo const *)
 
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< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CountTargets()

void spell_sindragosa_s_fury::CountTargets ( std::list< WorldObject * > &  targets)
inlineprivate
808 {
809 _targetCount = targets.size();
810 }
uint32 _targetCount
Definition boss_sindragosa.cpp:840

References _targetCount.

Referenced by Register().

◆ HandleDummy()

void spell_sindragosa_s_fury::HandleDummy ( SpellEffIndex  effIndex)
inlineprivate
813 {
814 PreventHitDefaultEffect(effIndex);
815
816 if (!GetHitUnit()->IsAlive() || (GetHitUnit()->IsPlayer() && GetHitUnit()->ToPlayer()->IsGameMaster()) || !_targetCount)
817 return;
818
819 float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
820 float ResistFactor = ((resistance * 2.0f) / (resistance + 510.0f));
821 if (ResistFactor > 0.9f)
822 ResistFactor = 0.9f;
823
824 uint32 damage = uint32( (GetEffectValue() / _targetCount) * (1.0f - ResistFactor));
825
826 SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo(), GetSpellInfo()->SchoolMask);
827 damageInfo.damage = damage;
829 GetCaster()->DealSpellDamage(&damageInfo, false);
830 }
std::uint32_t uint32
Definition Define.h:107
SpellSchoolMask
Definition SharedDefines.h:283
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:416
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:595
int32 GetEffectValue() const
Definition SpellScript.cpp:605
Unit * GetHitUnit()
Definition SpellScript.cpp:453
Unit * GetCaster()
Definition SpellScript.cpp:401
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss, Spell const *spell=nullptr)
Definition Unit.cpp:1652
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:6487
Definition Unit.h:509

References _targetCount, SpellNonMeleeDamage::damage, Unit::DealSpellDamage(), SpellScript::GetCaster(), SpellScript::GetEffectValue(), SpellScript::GetHitUnit(), SpellScript::GetSpellInfo(), SpellScript::PreventHitDefaultEffect(), and Unit::SendSpellNonMeleeDamageLog().

Referenced by Register().

◆ Load()

bool spell_sindragosa_s_fury::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

783 {
784 _targetCount = 0;
785
786 // This script should execute only in Icecrown Citadel
787 if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap())
788 if (instance->GetInstanceScript())
789 if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName))
790 return true;
791
792 return false;
793 }
#define sObjectMgr
Definition ObjectMgr.h:1731
Definition Map.h:724
#define ICCScriptName
Definition icecrown_citadel.h:30

References _targetCount, SpellScript::GetCaster(), ICCScriptName, and sObjectMgr.

◆ PrepareSpellScript()

spell_sindragosa_s_fury::PrepareSpellScript ( spell_sindragosa_s_fury  )
private

◆ Register()

void spell_sindragosa_s_fury::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

833 {
837 }
@ EFFECT_1
Definition SharedDefines.h:32
@ SPELL_EFFECT_DUMMY
Definition SharedDefines.h:769
@ TARGET_UNIT_DEST_AREA_ENTRY
Definition SharedDefines.h:1421
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
#define SpellCastFn(F)
Definition SpellScript.h:324
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
HookList< CastHandler > BeforeCast
Definition SpellScript.h:319
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void CountTargets(std::list< WorldObject * > &targets)
Definition boss_sindragosa.cpp:807
void SelectDest()
Definition boss_sindragosa.cpp:795
void HandleDummy(SpellEffIndex effIndex)
Definition boss_sindragosa.cpp:812

References SpellScript::BeforeCast, CountTargets(), EFFECT_1, HandleDummy(), SpellScript::OnEffectHitTarget, SpellScript::OnObjectAreaTargetSelect, SelectDest(), SPELL_EFFECT_DUMMY, SpellCastFn, SpellEffectFn, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_DEST_AREA_ENTRY.

◆ SelectDest()

void spell_sindragosa_s_fury::SelectDest ( )
inlineprivate
796 {
797 if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest()))
798 {
799 float destX = float(rand_norm()) * 75.0f + 4350.0f;
800 float destY = float(rand_norm()) * 75.0f + 2450.0f;
801 float destZ = 205.0f; // random number close to ground, get exact in next call
802 GetCaster()->UpdateGroundPositionZ(destX, destY, destZ);
803 dest->Relocate(destX, destY, destZ);
804 }
805 }
double rand_norm()
Definition Random.cpp:85
WorldLocation const * GetExplTargetDest()
Definition SpellScript.cpp:421
Definition Position.h:256
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition Object.cpp:1595
Definition Position.h:27

References SpellScript::GetCaster(), SpellScript::GetExplTargetDest(), rand_norm(), and WorldObject::UpdateGroundPositionZ().

Referenced by Register().

Member Data Documentation

◆ _targetCount

uint32 spell_sindragosa_s_fury::_targetCount
private

Referenced by CountTargets(), HandleDummy(), and Load().


The documentation for this class was generated from the following file: