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

Private Member Functions

 PrepareSpellScript (spell_igb_cannon_blast)
 
bool Validate (SpellInfo const *) override
 
bool Load () override
 
void CalculatePower ()
 
void PreventPowerGainOnHit (SpellEffIndex effIndex)
 
void Register () override
 

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

Member Function Documentation

◆ CalculatePower()

void spell_igb_cannon_blast::CalculatePower ( )
inlineprivate
2313 {
2314 Unit* caster = GetCaster();
2315 if (!caster)
2316 return;
2317
2318 SpellInfo const* spellInfo = GetSpellInfo();
2319 if (!spellInfo)
2320 return;
2321
2322 // Check if the effect is energize
2323 if (spellInfo->Effects[EFFECT_1].Effect == SPELL_EFFECT_ENERGIZE)
2324 {
2325 int32 energizeAmount = spellInfo->Effects[EFFECT_1].CalcValue(caster);
2326
2327 // Apply the power gain directly to the caster
2328 caster->ModifyPower(POWER_ENERGY, energizeAmount);
2329 }
2330
2331 if (caster->GetPower(POWER_ENERGY) >= 100)
2332 {
2333 caster->CastSpell(caster, SPELL_OVERHEAT, true);
2334 if (Vehicle* vehicle = caster->GetVehicleKit())
2335 if (Unit* passenger = vehicle->GetPassenger(0))
2336 sCreatureTextMgr->SendChat(caster->ToCreature(), SAY_OVERHEAT, passenger);
2337 }
2338
2339 }
#define sCreatureTextMgr
Definition CreatureTextMgr.h:110
std::int32_t int32
Definition Define.h:103
@ EFFECT_1
Definition SharedDefines.h:32
@ POWER_ENERGY
Definition SharedDefines.h:283
@ SPELL_EFFECT_ENERGIZE
Definition SharedDefines.h:819
@ SPELL_OVERHEAT
Definition boss_icecrown_gunship_battle.cpp:186
@ SAY_OVERHEAT
Definition boss_icecrown_gunship_battle.cpp:73
Creature * ToCreature()
Definition Object.h:206
Definition SpellInfo.h:316
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:393
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:411
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:650
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:14237
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1194
uint32 GetPower(Powers power) const
Definition Unit.h:1097
Vehicle * GetVehicleKit() const
Definition Unit.h:1879
Definition Vehicle.h:28

References Unit::CastSpell(), EFFECT_1, SpellInfo::Effects, SpellScript::GetCaster(), Unit::GetPower(), SpellScript::GetSpellInfo(), Unit::GetVehicleKit(), Unit::ModifyPower(), POWER_ENERGY, SAY_OVERHEAT, sCreatureTextMgr, SPELL_EFFECT_ENERGIZE, SPELL_OVERHEAT, and Object::ToCreature().

Referenced by Register().

◆ Load()

bool spell_igb_cannon_blast::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

2308 {
2309 return GetCaster()->IsCreature();
2310 }
bool IsCreature() const
Definition Object.h:205

References SpellScript::GetCaster(), and Object::IsCreature().

◆ PrepareSpellScript()

spell_igb_cannon_blast::PrepareSpellScript ( spell_igb_cannon_blast  )
private

◆ PreventPowerGainOnHit()

void spell_igb_cannon_blast::PreventPowerGainOnHit ( SpellEffIndex  effIndex)
inlineprivate
2342 {
2343 PreventHitDefaultEffect(effIndex);
2344 }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:590

References SpellScript::PreventHitDefaultEffect().

Referenced by Register().

◆ Register()

void spell_igb_cannon_blast::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2347 {
2350
2351 }
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
#define SpellCastFn(F)
Definition SpellScript.h:324
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
HookList< CastHandler > OnCast
Definition SpellScript.h:321
void PreventPowerGainOnHit(SpellEffIndex effIndex)
Definition boss_icecrown_gunship_battle.cpp:2341
void CalculatePower()
Definition boss_icecrown_gunship_battle.cpp:2312

References CalculatePower(), EFFECT_1, SpellScript::OnCast, SpellScript::OnEffectHitTarget, PreventPowerGainOnHit(), SPELL_EFFECT_ENERGIZE, SpellCastFn, and SpellEffectFn.

◆ Validate()

bool spell_igb_cannon_blast::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_OVERHEAT, and _SpellScript::ValidateSpellInfo().


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