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

Private Member Functions

 PrepareSpellScript (spell_midsummer_juggling_torch)
 
bool Validate (SpellInfo const *) override
 
void HandleFinish ()
 
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

◆ HandleFinish()

void spell_midsummer_juggling_torch::HandleFinish ( )
inlineprivate
1103 {
1104 Unit* caster = GetCaster();
1105 if (!caster || !caster->IsPlayer())
1106 return;
1107
1108 if (const WorldLocation* loc = GetExplTargetDest())
1109 {
1110 if (loc->GetExactDist(caster) < 3.0f)
1111 {
1112 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true);
1113 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SELF, true);
1114 }
1115 else if (loc->GetExactDist(caster) < 10.0f)
1116 {
1117 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true);
1118 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SLOW, true);
1119 }
1120 else if (loc->GetExactDist(caster) < 25.0f)
1121 {
1122 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true);
1123 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_MED, true);
1124 }
1125 else
1126 {
1127 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true);
1128 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_FAST, true);
1129 }
1130 }
1131 else
1132 {
1133 caster->CastSpell(caster, SPELL_JUGGLE_SELF, true);
1134 caster->CastSpell(caster, SPELL_TORCH_SHADOW_SELF, true);
1135 }
1136 }
bool IsPlayer() const
Definition Object.h:201
WorldLocation const * GetExplTargetDest()
Definition SpellScript.cpp:416
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:620
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1193
Definition Position.h:255
@ SPELL_TORCH_SHADOW_MED
Definition midsummer.cpp:1079
@ SPELL_TORCH_SHADOW_SELF
Definition midsummer.cpp:1077
@ SPELL_JUGGLE_FAST
Definition midsummer.cpp:1070
@ SPELL_JUGGLE_SLOW
Definition midsummer.cpp:1068
@ SPELL_JUGGLE_SELF
Definition midsummer.cpp:1067
@ SPELL_TORCH_SHADOW_SLOW
Definition midsummer.cpp:1078
@ SPELL_JUGGLE_MED
Definition midsummer.cpp:1069
@ SPELL_TORCH_SHADOW_FAST
Definition midsummer.cpp:1080

References Unit::CastSpell(), SpellScript::GetCaster(), SpellScript::GetExplTargetDest(), Object::IsPlayer(), SPELL_JUGGLE_FAST, SPELL_JUGGLE_MED, SPELL_JUGGLE_SELF, SPELL_JUGGLE_SLOW, SPELL_TORCH_SHADOW_FAST, SPELL_TORCH_SHADOW_MED, SPELL_TORCH_SHADOW_SELF, and SPELL_TORCH_SHADOW_SLOW.

Referenced by Register().

◆ PrepareSpellScript()

spell_midsummer_juggling_torch::PrepareSpellScript ( spell_midsummer_juggling_torch  )
private

◆ Register()

void spell_midsummer_juggling_torch::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1139 {
1141 }
#define SpellCastFn(F)
Definition SpellScript.h:324
HookList< CastHandler > AfterCast
Definition SpellScript.h:323
void HandleFinish()
Definition midsummer.cpp:1102

References SpellScript::AfterCast, HandleFinish(), and SpellCastFn.

◆ Validate()

bool spell_midsummer_juggling_torch::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

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