AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_icc_geist_alarm::spell_icc_geist_alarm_SpellScript Class Reference
Inheritance diagram for spell_icc_geist_alarm::spell_icc_geist_alarm_SpellScript:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_icc_geist_alarm_SpellScript)
 
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_geist_alarm::spell_icc_geist_alarm_SpellScript::HandleEvent ( SpellEffIndex  effIndex)
inlineprivate
2023 {
2024 PreventHitDefaultEffect(effIndex);
2025 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
2026 {
2027 Position p = {4356.77f, 2971.90f, 360.52f, M_PI / 2};
2028 if (Creature* l = instance->instance->SummonCreature(NPC_VENGEFUL_FLESHREAPER, p))
2029 {
2030 bool hasTarget = false;
2031 Unit* target = nullptr;
2032 if ((target = l->SelectNearestTarget(20.0f)))
2033 hasTarget = true;
2034 else
2035 {
2036 target = l->SelectNearestTarget(120.0f);
2037 l->GetMotionMaster()->MoveJump(l->GetPositionX(), l->GetPositionY() + 55.0f, l->GetPositionZ(), 20.0f, 6.0f);
2038 }
2039 l->AI()->Talk(0);
2040 l->AI()->AttackStart(target);
2041 l->AddThreat(target, 1.0f);
2042 for (uint8 i = 0; i < 5; ++i)
2043 {
2044 float dist = 2.0f + rand_norm() * 4.0f;
2045 float angle = rand_norm() * 2 * M_PI;
2046 Position pos(p);
2047 l->MovePosition(pos, dist, angle);
2049 {
2050 c->AI()->AttackStart(l->GetVictim());
2051 c->AddThreat(l->GetVictim(), 1.0f);
2052 if (!hasTarget)
2053 c->GetMotionMaster()->MoveJump(c->GetPositionX(), c->GetPositionY() + 55.0f, c->GetPositionZ(), 20.0f, 6.0f);
2054 }
2055 }
2056 }
2057 }
2058 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
constexpr auto MINUTE
Definition: Common.h:56
std::uint8_t uint8
Definition: Define.h:110
double rand_norm()
Definition: Random.cpp:77
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:45
@ NPC_VENGEFUL_FLESHREAPER
Definition: icecrown_citadel.h:367
Definition: Creature.h:46
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr) const
Definition: Object.cpp:2303
Definition: Position.h:28
Definition: Unit.h:1290
MotionMaster * GetMotionMaster()
Definition: Unit.h:2530
Definition: InstanceScript.h:140
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition: MotionMaster.h:225
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetCaster()
Definition: SpellScript.cpp:401

References SpellScript::GetCaster(), Unit::GetMotionMaster(), IN_MILLISECONDS, MINUTE, MotionMaster::MoveJump(), NPC_VENGEFUL_FLESHREAPER, SpellScript::PreventHitDefaultEffect(), rand_norm(), WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT.

Referenced by Register().

◆ PrepareSpellScript()

spell_icc_geist_alarm::spell_icc_geist_alarm_SpellScript::PrepareSpellScript ( spell_icc_geist_alarm_SpellScript  )
private

◆ Register()

void spell_icc_geist_alarm::spell_icc_geist_alarm_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2061 {
2063 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_2
Definition: SharedDefines.h:32
@ SPELL_EFFECT_SEND_EVENT
Definition: SharedDefines.h:811
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void HandleEvent(SpellEffIndex effIndex)
Definition: icecrown_citadel.cpp:2022

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