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

◆ HandleEvent()

void spell_icc_sprit_alarm::HandleEvent ( SpellEffIndex  effIndex)
inlineprivate
1936 {
1937 PreventHitDefaultEffect(effIndex);
1938 uint32 trapId = 0;
1939 switch (GetSpellInfo()->Effects[effIndex].MiscValue)
1940 {
1942 trapId = GO_SPIRIT_ALARM_1;
1943 break;
1945 trapId = GO_SPIRIT_ALARM_2;
1946 break;
1948 trapId = GO_SPIRIT_ALARM_3;
1949 break;
1951 trapId = GO_SPIRIT_ALARM_4;
1952 break;
1953 default:
1954 return;
1955 }
1956
1957 if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f))
1958 {
1959 trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime() / IN_MILLISECONDS);
1960 }
1961
1962 std::list<Creature*> wards;
1965 for (std::list<Creature*>::iterator itr = wards.begin(); itr != wards.end(); ++itr)
1966 {
1967 if ((*itr)->IsAlive() && (*itr)->HasAura(SPELL_STONEFORM))
1968 {
1969 (*itr)->AI()->Talk(SAY_TRAP_ACTIVATE);
1970 (*itr)->RemoveAurasDueToSpell(SPELL_STONEFORM);
1971 (*itr)->AI()->SetData(1, 1);
1972 break;
1973 }
1974 }
1975 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
std::uint32_t uint32
Definition: Define.h:107
@ SAY_TRAP_ACTIVATE
Definition: icecrown_citadel.cpp:66
@ EVENT_AWAKEN_WARD_4
Definition: icecrown_citadel.cpp:276
@ EVENT_AWAKEN_WARD_1
Definition: icecrown_citadel.cpp:273
@ EVENT_AWAKEN_WARD_3
Definition: icecrown_citadel.cpp:275
@ EVENT_AWAKEN_WARD_2
Definition: icecrown_citadel.cpp:274
@ NPC_DEATHBOUND_WARD
Definition: icecrown_citadel.h:181
@ SPELL_STONEFORM
Definition: icecrown_citadel.h:57
@ GO_SPIRIT_ALARM_1
Definition: icecrown_citadel.h:385
@ GO_SPIRIT_ALARM_3
Definition: icecrown_citadel.h:387
@ GO_SPIRIT_ALARM_2
Definition: icecrown_citadel.h:386
@ GO_SPIRIT_ALARM_4
Definition: icecrown_citadel.h:388
Definition: GameObject.h:121
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2500
Definition: Object.h:696
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetCaster()
Definition: SpellScript.cpp:401

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.

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

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.

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

References SPELL_STONEFORM, and _SpellScript::ValidateSpellInfo().