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
 
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 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< 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

Constructor & Destructor Documentation

◆ spell_halion_damage_aoe_summon()

spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon ( uint32  explosionSpell,
uint32  auraSpell 
)
inline
972: SpellScript(), _explosionSpell(explosionSpell), _auraSpell(auraSpell) { }
Definition SpellScript.h:182
uint32 _auraSpell
Definition boss_halion.cpp:1010
uint32 _explosionSpell
Definition boss_halion.cpp:1009

Member Function Documentation

◆ HandleSummon()

void spell_halion_damage_aoe_summon::HandleSummon ( SpellEffIndex  effIndex)
inline
975 {
976 PreventHitDefaultEffect(effIndex);
977 Unit* caster = GetCaster();
978 uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue);
979 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
980 uint32 duration = uint32(GetSpellInfo()->GetDuration());
981
982 Position pos = caster->GetPosition();
983 if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id))
984 {
985 bool heroic = summon->GetMap()->IsHeroic();
986 bool raid = summon->GetMap()->Is25ManRaid();
987
988 if (heroic)
989 summon->SetPhaseMask(0x01 | 0x20, true);
990 else if (summon->GetEntry() == NPC_COMBUSTION)
991 summon->SetPhaseMask(0x01, true);
992 else
993 summon->SetPhaseMask(0x20, true);
994
995 summon->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, GetSpellValue()->EffectBasePoints[EFFECT_1], summon);
996 summon->CastSpell(summon, _auraSpell, true);
997
998 int32 damage = int32((1500 + (GetSpellValue()->EffectBasePoints[EFFECT_1] * 1250)) * (heroic ? 1.25f : 1.0f) * (raid ? 1.5f : 1.0f));
1000 }
1001 }
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:126
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:121
@ SPELL_SCALE_AURA
Definition boss_halion.cpp:69
Definition Creature.h:47
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:2246
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:416
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:595
SpellValue const * GetSpellValue()
Definition SpellScript.cpp:662
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:665
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:1429
Map * GetMap() const
Definition Object.h:637
@ 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:1945

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.

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

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.

967 {
969 }
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: