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 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
 
- 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
980: SpellScript(), _explosionSpell(explosionSpell), _auraSpell(auraSpell) { }
Definition SpellScript.h:182
uint32 _auraSpell
Definition boss_halion.cpp:1018
uint32 _explosionSpell
Definition boss_halion.cpp:1017

Member Function Documentation

◆ HandleSummon()

void spell_halion_damage_aoe_summon::HandleSummon ( SpellEffIndex  effIndex)
inline
983 {
984 PreventHitDefaultEffect(effIndex);
985 Unit* caster = GetCaster();
986 uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue);
987 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
988 uint32 duration = uint32(GetSpellInfo()->GetDuration());
989
990 Position pos = caster->GetPosition();
991 if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id))
992 {
993 bool heroic = summon->GetMap()->IsHeroic();
994 bool raid = summon->GetMap()->Is25ManRaid();
995
996 if (heroic)
997 summon->SetPhaseMask(0x01 | 0x20, true);
998 else if (summon->GetEntry() == NPC_COMBUSTION)
999 summon->SetPhaseMask(0x01, true);
1000 else
1001 summon->SetPhaseMask(0x20, true);
1002
1003 summon->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, GetSpellValue()->EffectBasePoints[EFFECT_1], summon);
1004 summon->CastSpell(summon, _auraSpell, true);
1005
1006 int32 damage = int32((1500 + (GetSpellValue()->EffectBasePoints[EFFECT_1] * 1250)) * (heroic ? 1.25f : 1.0f) * (raid ? 1.5f : 1.0f));
1007 caster->CastCustomSpell(_explosionSpell, SPELLVALUE_BASE_POINT0, damage, caster);
1008 }
1009 }
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
@ EFFECT_1
Definition SharedDefines.h:32
@ SPELLVALUE_AURA_STACK
Definition SpellDefines.h:118
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:113
@ SPELL_SCALE_AURA
Definition boss_halion.cpp:68
Definition Creature.h:43
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 Unit.h:636
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:1235
Map * GetMap() const
Definition Object.h:536
@ NPC_COMBUSTION
Definition ruby_sanctum.h:78
Definition Position.h:27
void GetPosition(float &x, float &y) const
Definition Position.h:126
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.

1012 {
1014 }
@ 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:982

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.

975 {
977 }
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().


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