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

Private Member Functions

 PrepareSpellScript (spell_icc_sprit_alarm)
 
bool Validate (SpellInfo const *) override
 
void HandleEvent (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
 
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 ()
 
- 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

Member Function Documentation

◆ HandleEvent()

void spell_icc_sprit_alarm::HandleEvent ( SpellEffIndex  effIndex)
inlineprivate
2711 {
2712 PreventHitDefaultEffect(effIndex);
2713 uint32 trapId = 0;
2714 switch (GetSpellInfo()->Effects[effIndex].MiscValue)
2715 {
2717 trapId = GO_SPIRIT_ALARM_1;
2718 break;
2720 trapId = GO_SPIRIT_ALARM_2;
2721 break;
2723 trapId = GO_SPIRIT_ALARM_3;
2724 break;
2726 trapId = GO_SPIRIT_ALARM_4;
2727 break;
2728 default:
2729 return;
2730 }
2731
2732 if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f))
2733 {
2734 trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime() / IN_MILLISECONDS);
2735 }
2736
2737 std::list<Creature*> wards;
2740 for (std::list<Creature*>::iterator itr = wards.begin(); itr != wards.end(); ++itr)
2741 {
2742 if ((*itr)->IsAlive() && (*itr)->HasAura(SPELL_STONEFORM))
2743 {
2744 (*itr)->AI()->Talk(SAY_TRAP_ACTIVATE);
2745 (*itr)->RemoveAurasDueToSpell(SPELL_STONEFORM);
2746 (*itr)->AI()->SetData(1, 1);
2747 break;
2748 }
2749 }
2750 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
std::uint32_t uint32
Definition Define.h:107
Definition Object.h:860
Definition GameObject.h:120
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:416
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:595
Unit * GetCaster()
Definition SpellScript.cpp:401
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2619
@ SAY_TRAP_ACTIVATE
Definition icecrown_citadel.cpp:70
@ EVENT_AWAKEN_WARD_4
Definition icecrown_citadel.cpp:324
@ EVENT_AWAKEN_WARD_1
Definition icecrown_citadel.cpp:321
@ EVENT_AWAKEN_WARD_3
Definition icecrown_citadel.cpp:323
@ EVENT_AWAKEN_WARD_2
Definition icecrown_citadel.cpp:322
@ NPC_DEATHBOUND_WARD
Definition icecrown_citadel.h:180
@ SPELL_STONEFORM
Definition icecrown_citadel.h:51
@ GO_SPIRIT_ALARM_1
Definition icecrown_citadel.h:399
@ GO_SPIRIT_ALARM_3
Definition icecrown_citadel.h:401
@ GO_SPIRIT_ALARM_2
Definition icecrown_citadel.h:400
@ GO_SPIRIT_ALARM_4
Definition icecrown_citadel.h:402

References EVENT_AWAKEN_WARD_1, EVENT_AWAKEN_WARD_2, EVENT_AWAKEN_WARD_3, EVENT_AWAKEN_WARD_4, SpellScript::GetCaster(), WorldObject::GetCreatureListWithEntryInGrid(), SpellScript::GetSpellInfo(), GO_SPIRIT_ALARM_1, GO_SPIRIT_ALARM_2, GO_SPIRIT_ALARM_3, GO_SPIRIT_ALARM_4, IN_MILLISECONDS, NPC_DEATHBOUND_WARD, SpellScript::PreventHitDefaultEffect(), SAY_TRAP_ACTIVATE, and SPELL_STONEFORM.

Referenced by Register().

◆ PrepareSpellScript()

spell_icc_sprit_alarm::PrepareSpellScript ( spell_icc_sprit_alarm  )
private

◆ Register()

void spell_icc_sprit_alarm::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2753 {
2755 }
@ EFFECT_2
Definition SharedDefines.h:33
@ SPELL_EFFECT_SEND_EVENT
Definition SharedDefines.h:827
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectHit
Definition SpellScript.h:335
void HandleEvent(SpellEffIndex effIndex)
Definition icecrown_citadel.cpp:2710

References EFFECT_2, HandleEvent(), SpellScript::OnEffectHit, SPELL_EFFECT_SEND_EVENT, and SpellEffectFn.

◆ Validate()

bool spell_icc_sprit_alarm::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_STONEFORM, and _SpellScript::ValidateSpellInfo().


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