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

Private Member Functions

 PrepareSpellScript (spell_q13007_iron_colossus)
 
bool Validate (SpellInfo const *) override
 
void HandleDummy (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 Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
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
 
virtual bool _Validate (SpellInfo const *entry)
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleDummy()

void spell_q13007_iron_colossus::HandleDummy ( SpellEffIndex  effIndex)
inlineprivate
641 {
642 PreventHitDefaultEffect(effIndex);
643 Creature* caster = GetCaster()->ToCreature();
644 if (!caster)
645 return;
646
648 {
649 caster->CastSpell(caster, SPELL_JORMUNGAR_SUBMERGE_VISUAL, true);
652 caster->SetControlled(false, UNIT_STATE_ROOT);
653 for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
654 caster->m_spells[i] = 0;
655
656 caster->m_spells[0] = SPELL_JORMUNGAR_EMERGE;
657 }
658 else
659 {
663 caster->SetControlled(true, UNIT_STATE_ROOT);
664
665 if (CreatureTemplate const* ct = sObjectMgr->GetCreatureTemplate(caster->GetEntry()))
666 for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
667 caster->m_spells[i] = ct->spells[i];
668 }
669
670 if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
671 player->VehicleSpellInitialize();
672 }
std::uint8_t uint8
Definition: Define.h:109
#define sObjectMgr
Definition: ObjectMgr.h:1623
static constexpr uint32 MAX_CREATURE_SPELLS
Definition: Unit.h:45
@ UNIT_STATE_ROOT
Definition: UnitDefines.h:159
@ UNIT_FLAG_DISABLE_MOVE
Definition: UnitDefines.h:231
@ SPELL_JORMUNGAR_SUBMERGE_VISUAL
Definition: zone_storm_peaks.cpp:627
@ SPELL_COLOSSUS_GROUND_SLAM
Definition: zone_storm_peaks.cpp:628
@ SPELL_JORMUNGAR_EMERGE
Definition: zone_storm_peaks.cpp:626
@ SPELL_JORMUNGAR_SUBMERGE
Definition: zone_storm_peaks.cpp:625
@ IMMUNITY_ID
Definition: SharedDefines.h:1400
Definition: Creature.h:46
uint32 m_spells[MAX_CREATURE_SPELLS]
Definition: Creature.h:251
Definition: CreatureData.h:189
uint32 GetEntry() const
Definition: Object.h:112
Creature * ToCreature()
Definition: Object.h:202
Definition: Player.h:1064
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13346
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10578
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:17990
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:1168
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetCaster()
Definition: SpellScript.cpp:401

References Unit::ApplySpellImmune(), Unit::CastSpell(), SpellScript::GetCaster(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), Object::GetEntry(), SpellScript::GetSpellInfo(), IMMUNITY_ID, Creature::m_spells, MAX_CREATURE_SPELLS, SpellScript::PreventHitDefaultEffect(), Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), Unit::SetControlled(), Unit::SetUnitFlag(), sObjectMgr, SPELL_COLOSSUS_GROUND_SLAM, SPELL_JORMUNGAR_EMERGE, SPELL_JORMUNGAR_SUBMERGE, SPELL_JORMUNGAR_SUBMERGE_VISUAL, Object::ToCreature(), UNIT_FLAG_DISABLE_MOVE, and UNIT_STATE_ROOT.

Referenced by Register().

◆ PrepareSpellScript()

spell_q13007_iron_colossus::PrepareSpellScript ( spell_q13007_iron_colossus  )
private

◆ Register()

void spell_q13007_iron_colossus::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

675 {
677 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:781
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleDummy(SpellEffIndex effIndex)
Definition: zone_storm_peaks.cpp:640

References EFFECT_0, HandleDummy(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_DUMMY, and SpellEffectFn.

◆ Validate()

bool spell_q13007_iron_colossus::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_COLOSSUS_GROUND_SLAM, SPELL_JORMUNGAR_SUBMERGE_VISUAL, and _SpellScript::ValidateSpellInfo().