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 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
 
- 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
1935 {
1936 PreventHitDefaultEffect(effIndex);
1937 uint32 trapId = 0;
1938 switch (GetSpellInfo()->Effects[effIndex].MiscValue)
1939 {
1941 trapId = GO_SPIRIT_ALARM_1;
1942 break;
1944 trapId = GO_SPIRIT_ALARM_2;
1945 break;
1947 trapId = GO_SPIRIT_ALARM_3;
1948 break;
1950 trapId = GO_SPIRIT_ALARM_4;
1951 break;
1952 default:
1953 return;
1954 }
1955
1956 if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f))
1957 {
1958 trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime() / IN_MILLISECONDS);
1959 }
1960
1961 std::list<Creature*> wards;
1964 for (std::list<Creature*>::iterator itr = wards.begin(); itr != wards.end(); ++itr)
1965 {
1966 if ((*itr)->IsAlive() && (*itr)->HasAura(SPELL_STONEFORM))
1967 {
1968 (*itr)->AI()->Talk(SAY_TRAP_ACTIVATE);
1969 (*itr)->RemoveAurasDueToSpell(SPELL_STONEFORM);
1970 (*itr)->AI()->SetData(1, 1);
1971 break;
1972 }
1973 }
1974 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
std::uint32_t uint32
Definition Define.h:107
Definition Object.h:700
Definition GameObject.h:120
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:590
Unit * GetCaster()
Definition SpellScript.cpp:401
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2513
@ 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

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.

1977 {
1979 }
@ 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:1934

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.

1930 {
1932 }
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: