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

Private Member Functions

 PrepareSpellScript (spell_icc_geist_alarm)
 
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 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< 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_geist_alarm::HandleEvent ( SpellEffIndex  effIndex)
inlineprivate
2763 {
2764 PreventHitDefaultEffect(effIndex);
2765 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
2766 {
2767 Position p = {4356.77f, 2971.90f, 360.52f, M_PI / 2};
2768 if (Creature* l = instance->instance->SummonCreature(NPC_VENGEFUL_FLESHREAPER, p))
2769 {
2770 bool hasTarget = false;
2771 Unit* target = nullptr;
2772 if ((target = l->SelectNearestTarget(20.0f)))
2773 hasTarget = true;
2774 else
2775 {
2776 target = l->SelectNearestTarget(120.0f);
2777 l->GetMotionMaster()->MoveJump(l->GetPositionX(), l->GetPositionY() + 55.0f, l->GetPositionZ(), 20.0f, 6.0f);
2778 }
2779 l->AI()->Talk(0);
2780 l->AI()->AttackStart(target);
2781 l->AddThreat(target, 1.0f);
2782 for (uint8 i = 0; i < 5; ++i)
2783 {
2784 float dist = 2.0f + rand_norm() * 4.0f;
2785 float angle = rand_norm() * 2 * M_PI;
2786 Position pos(p);
2787 l->MovePosition(pos, dist, angle);
2789 {
2790 c->AI()->AttackStart(l->GetVictim());
2791 c->AddThreat(l->GetVictim(), 1.0f);
2792 if (!hasTarget)
2793 c->GetMotionMaster()->MoveJump(c->GetPositionX(), c->GetPositionY() + 55.0f, c->GetPositionZ(), 20.0f, 6.0f);
2794 }
2795 }
2796 }
2797 }
2798 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
constexpr auto MINUTE
Definition Common.h:47
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:53
double rand_norm()
Definition Random.cpp:85
Definition Creature.h:47
Definition InstanceScript.h:143
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition MotionMaster.h:257
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:595
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:665
MotionMaster * GetMotionMaster()
Definition Unit.h:1761
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2453
@ NPC_VENGEFUL_FLESHREAPER
Definition icecrown_citadel.h:391
Definition Position.h:27

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::PrepareSpellScript ( spell_icc_geist_alarm  )
private

◆ Register()

void spell_icc_geist_alarm::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2801 {
2803 }
@ 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:2762

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


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