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
1937 {
1938 PreventHitDefaultEffect(effIndex);
1939 uint32 trapId = 0;
1940 switch (GetSpellInfo()->Effects[effIndex].MiscValue)
1941 {
1943 trapId = GO_SPIRIT_ALARM_1;
1944 break;
1946 trapId = GO_SPIRIT_ALARM_2;
1947 break;
1949 trapId = GO_SPIRIT_ALARM_3;
1950 break;
1952 trapId = GO_SPIRIT_ALARM_4;
1953 break;
1954 default:
1955 return;
1956 }
1957
1958 if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f))
1959 {
1960 trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime() / IN_MILLISECONDS);
1961 }
1962
1963 std::list<Creature*> wards;
1966 for (std::list<Creature*>::iterator itr = wards.begin(); itr != wards.end(); ++itr)
1967 {
1968 if ((*itr)->IsAlive() && (*itr)->HasAura(SPELL_STONEFORM))
1969 {
1970 (*itr)->AI()->Talk(SAY_TRAP_ACTIVATE);
1971 (*itr)->RemoveAurasDueToSpell(SPELL_STONEFORM);
1972 (*itr)->AI()->SetData(1, 1);
1973 break;
1974 }
1975 }
1976 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
std::uint32_t uint32
Definition: Define.h:107
@ SAY_TRAP_ACTIVATE
Definition: icecrown_citadel.cpp:67
@ EVENT_AWAKEN_WARD_4
Definition: icecrown_citadel.cpp:277
@ EVENT_AWAKEN_WARD_1
Definition: icecrown_citadel.cpp:274
@ EVENT_AWAKEN_WARD_3
Definition: icecrown_citadel.cpp:276
@ EVENT_AWAKEN_WARD_2
Definition: icecrown_citadel.cpp:275
@ NPC_DEATHBOUND_WARD
Definition: icecrown_citadel.h:175
@ SPELL_STONEFORM
Definition: icecrown_citadel.h:51
@ GO_SPIRIT_ALARM_1
Definition: icecrown_citadel.h:379
@ GO_SPIRIT_ALARM_3
Definition: icecrown_citadel.h:381
@ GO_SPIRIT_ALARM_2
Definition: icecrown_citadel.h:380
@ GO_SPIRIT_ALARM_4
Definition: icecrown_citadel.h:382
Definition: GameObject.h:120
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2511
Definition: Object.h:703
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.

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

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.

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

References SPELL_STONEFORM, and _SpellScript::ValidateSpellInfo().