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

Public Member Functions

 spell_halion_damage_aoe_summon_SpellScript (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 ()
 

Public Attributes

uint32 _explosionSpell
 
uint32 _auraSpell
 
- 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
 

Private Member Functions

 PrepareSpellScript (spell_halion_damage_aoe_summon_SpellScript)
 

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)
 
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_SpellScript()

spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon_SpellScript::spell_halion_damage_aoe_summon_SpellScript ( uint32  explosionSpell,
uint32  auraSpell 
)
inline
1039: SpellScript(), _explosionSpell(explosionSpell), _auraSpell(auraSpell) { }
Definition: SpellScript.h:182

Member Function Documentation

◆ HandleSummon()

void spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon_SpellScript::HandleSummon ( SpellEffIndex  effIndex)
inline
1042 {
1043 PreventHitDefaultEffect(effIndex);
1044 Unit* caster = GetCaster();
1045 uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue);
1046 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
1047 uint32 duration = uint32(GetSpellInfo()->GetDuration());
1048
1049 Position pos = caster->GetPosition();
1050 if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id))
1051 {
1052 bool heroic = summon->GetMap()->IsHeroic();
1053 bool raid = summon->GetMap()->Is25ManRaid();
1054
1055 if (heroic)
1056 summon->SetPhaseMask(0x01 | 0x20, true);
1057 else if (summon->GetEntry() == NPC_COMBUSTION)
1058 summon->SetPhaseMask(0x01, true);
1059 else
1060 summon->SetPhaseMask(0x20, true);
1061
1062 summon->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, GetSpellValue()->EffectBasePoints[EFFECT_1], summon);
1063 summon->CastSpell(summon, _auraSpell, true);
1064
1065 int32 damage = int32((1500 + (GetSpellValue()->EffectBasePoints[EFFECT_1] * 1250)) * (heroic ? 1.25f : 1.0f) * (raid ? 1.5f : 1.0f));
1066 caster->CastCustomSpell(_explosionSpell, SPELLVALUE_BASE_POINT0, damage, caster);
1067 }
1068 }
std::int32_t int32
Definition: Define.h:104
std::uint32_t uint32
Definition: Define.h:108
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:119
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:114
@ SPELL_SCALE_AURA
Definition: boss_halion.cpp:66
@ NPC_COMBUSTION
Definition: ruby_sanctum.h:85
@ EFFECT_1
Definition: SharedDefines.h:31
Definition: Creature.h:46
Map * GetMap() const
Definition: Object.h:517
Definition: Position.h:28
void GetPosition(float &x, float &y) const
Definition: Position.h:122
Definition: Unit.h:1290
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:1226
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:2129
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:1885

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::spell_halion_damage_aoe_summon_SpellScript::PrepareSpellScript ( spell_halion_damage_aoe_summon_SpellScript  )
private

◆ Register()

void spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon_SpellScript::Register ( )
inlineoverridevirtual

Implements _SpellScript.

1071 {
1073 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SUMMON
Definition: SharedDefines.h:778
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void HandleSummon(SpellEffIndex effIndex)
Definition: boss_halion.cpp:1041

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

Member Data Documentation

◆ _auraSpell

uint32 spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon_SpellScript::_auraSpell

Referenced by HandleSummon().

◆ _explosionSpell

uint32 spell_halion_damage_aoe_summon::spell_halion_damage_aoe_summon_SpellScript::_explosionSpell

Referenced by HandleSummon().