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

Private Member Functions

 PrepareSpellScript (spell_quest_dragonmaw_race_generic)
 
bool Load () override
 
SpellCastResult RelocateDest ()
 
void ChangeDest (SpellEffIndex effIndex)
 
void Register () override
 

Private Attributes

float _x
 
float _y
 
float _z
 

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

◆ ChangeDest()

void spell_quest_dragonmaw_race_generic::ChangeDest ( SpellEffIndex  effIndex)
inlineprivate
483 {
484 PreventHitDefaultEffect(effIndex);
485 Unit* caster = GetCaster();
486 if (Creature* trigger = caster->SummonCreature(23356, _x, _y, _z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1500))
487 {
488 trigger->CastSpell(trigger, GetSpellInfo()->Effects[effIndex].TriggerSpell, true);
489 if (GetSpellInfo()->Effects[effIndex].TriggerSpell == 41064)
490 trigger->CastSpell(trigger, 41284, true);
491 }
492 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
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, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2343
Definition: Unit.h:1302
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetCaster()
Definition: SpellScript.cpp:401
float _z
Definition: spell_quest.cpp:501
float _x
Definition: spell_quest.cpp:501
float _y
Definition: spell_quest.cpp:501

References _x, _y, _z, SpellScript::GetCaster(), SpellScript::GetSpellInfo(), SpellScript::PreventHitDefaultEffect(), WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN.

Referenced by Register().

◆ Load()

bool spell_quest_dragonmaw_race_generic::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

465 {
466 _x = _y = _z = 0.0f;
467 return true;
468 }

References _x, _y, and _z.

◆ PrepareSpellScript()

spell_quest_dragonmaw_race_generic::PrepareSpellScript ( spell_quest_dragonmaw_race_generic  )
private

◆ Register()

void spell_quest_dragonmaw_race_generic::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

495 {
498 }
#define SpellCheckCastFn(F)
Definition: SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_TRIGGER_MISSILE
Definition: SharedDefines.h:810
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:328
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void ChangeDest(SpellEffIndex effIndex)
Definition: spell_quest.cpp:482
SpellCastResult RelocateDest()
Definition: spell_quest.cpp:470

References ChangeDest(), EFFECT_0, SpellScript::OnCheckCast, SpellScript::OnEffectHit, RelocateDest(), SPELL_EFFECT_TRIGGER_MISSILE, SpellCheckCastFn, and SpellEffectFn.

◆ RelocateDest()

SpellCastResult spell_quest_dragonmaw_race_generic::RelocateDest ( )
inlineprivate
471 {
472 Unit* caster = GetCaster();
473 float o = Position::NormalizeOrientation(caster->GetOrientation() + frand(0.0f, 2 * M_PI));
474 float dist = frand(5.0f, 30.0f);
475 _x = caster->GetPositionX() + dist * cos(o);
476 _y = caster->GetPositionY() + dist * std::sin(o);
477 _z = caster->GetPositionZ() + frand(-10.0f, 15.0f);
478 GetSpell()->m_targets.SetDst(_x, _y, _z, 0.0f, caster->GetMapId());
479 return SPELL_CAST_OK;
480 }
float frand(float min, float max)
Definition: Random.cpp:57
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
static float NormalizeOrientation(float o)
Definition: Position.h:233
float GetPositionZ() const
Definition: Position.h:119
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
uint32 GetMapId() const
Definition: Position.h:276
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
Definition: Spell.cpp:405
SpellCastTargets m_targets
Definition: Spell.h:527
Spell * GetSpell()
Definition: SpellScript.h:442

References _x, _y, _z, frand(), SpellScript::GetCaster(), WorldLocation::GetMapId(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), SpellScript::GetSpell(), Spell::m_targets, Position::NormalizeOrientation(), SpellCastTargets::SetDst(), and SPELL_CAST_OK.

Referenced by Register().

Member Data Documentation

◆ _x

float spell_quest_dragonmaw_race_generic::_x
private

Referenced by ChangeDest(), Load(), and RelocateDest().

◆ _y

float spell_quest_dragonmaw_race_generic::_y
private

Referenced by ChangeDest(), Load(), and RelocateDest().

◆ _z

float spell_quest_dragonmaw_race_generic::_z
private

Referenced by ChangeDest(), Load(), and RelocateDest().