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

Public Member Functions

 spell_halion_damage_aoe_summon (uint32 explosionSpell, uint32 auraSpell)
 
void HandleSummon (SpellEffIndex effIndex)
 
void Register () override
 
- 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 ()
 

Private Member Functions

 PrepareSpellScript (spell_halion_damage_aoe_summon)
 
bool Validate (SpellInfo const *) override
 

Private Attributes

uint32 _explosionSpell
 
uint32 _auraSpell
 

Additional Inherited Members

- 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

Constructor & Destructor Documentation

◆ spell_halion_damage_aoe_summon()

spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon ( uint32  explosionSpell,
uint32  auraSpell 
)
inline
979: SpellScript(), _explosionSpell(explosionSpell), _auraSpell(auraSpell) { }
Definition: SpellScript.h:182
uint32 _auraSpell
Definition: boss_halion.cpp:1017
uint32 _explosionSpell
Definition: boss_halion.cpp:1016

Member Function Documentation

◆ HandleSummon()

void spell_halion_damage_aoe_summon::HandleSummon ( SpellEffIndex  effIndex)
inline
982 {
983 PreventHitDefaultEffect(effIndex);
984 Unit* caster = GetCaster();
985 uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue);
986 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
987 uint32 duration = uint32(GetSpellInfo()->GetDuration());
988
989 Position pos = caster->GetPosition();
990 if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id))
991 {
992 bool heroic = summon->GetMap()->IsHeroic();
993 bool raid = summon->GetMap()->Is25ManRaid();
994
995 if (heroic)
996 summon->SetPhaseMask(0x01 | 0x20, true);
997 else if (summon->GetEntry() == NPC_COMBUSTION)
998 summon->SetPhaseMask(0x01, true);
999 else
1000 summon->SetPhaseMask(0x20, true);
1001
1002 summon->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, GetSpellValue()->EffectBasePoints[EFFECT_1], summon);
1003 summon->CastSpell(summon, _auraSpell, true);
1004
1005 int32 damage = int32((1500 + (GetSpellValue()->EffectBasePoints[EFFECT_1] * 1250)) * (heroic ? 1.25f : 1.0f) * (raid ? 1.5f : 1.0f));
1006 caster->CastCustomSpell(_explosionSpell, SPELLVALUE_BASE_POINT0, damage, caster);
1007 }
1008 }
std::int32_t int32
Definition: Define.h:103
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_SCALE_AURA
Definition: boss_halion.cpp:67
@ NPC_COMBUSTION
Definition: ruby_sanctum.h:78
@ EFFECT_1
Definition: SharedDefines.h:32
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:118
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:113
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
Definition: Creature.h:43
Map * GetMap() const
Definition: Object.h:536
Definition: Position.h:27
void GetPosition(float &x, float &y) const
Definition: Position.h:121
Definition: Unit.h:630
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1224
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2174
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
SpellValue const * GetSpellValue()
Definition: SpellScript.cpp:657
Unit * GetCaster()
Definition: SpellScript.cpp:401
Definition: DBCStructure.h:1908

References _auraSpell, _explosionSpell, Unit::CastCustomSpell(), EFFECT_1, SpellScript::GetCaster(), WorldObject::GetMap(), Position::GetPosition(), SpellScript::GetSpellInfo(), SpellScript::GetSpellValue(), NPC_COMBUSTION, SpellScript::PreventHitDefaultEffect(), SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, SPELLVALUE_BASE_POINT0, sSummonPropertiesStore, and Map::SummonCreature().

Referenced by Register().

◆ PrepareSpellScript()

spell_halion_damage_aoe_summon::PrepareSpellScript ( spell_halion_damage_aoe_summon  )
private

◆ Register()

void spell_halion_damage_aoe_summon::Register ( )
inlineoverridevirtual

Implements _SpellScript.

1011 {
1013 }
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_SUMMON
Definition: SharedDefines.h:806
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void HandleSummon(SpellEffIndex effIndex)
Definition: boss_halion.cpp:981

References EFFECT_0, HandleSummon(), SpellScript::OnEffectHit, SPELL_EFFECT_SUMMON, and SpellEffectFn.

◆ Validate()

bool spell_halion_damage_aoe_summon::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_SCALE_AURA, and _SpellScript::ValidateSpellInfo().

Member Data Documentation

◆ _auraSpell

uint32 spell_halion_damage_aoe_summon::_auraSpell
private

Referenced by HandleSummon().

◆ _explosionSpell

uint32 spell_halion_damage_aoe_summon::_explosionSpell
private

Referenced by HandleSummon().