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
1170 {
1171 Unit* caster = GetCaster();
1172 if (!caster || !caster->IsPlayer())
1173 return;
1174
1175 if (const WorldLocation* loc = GetExplTargetDest())
1176 {
1177 if (loc->GetExactDist(caster) < 3.0f)
1178 {
1179 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true);
1180 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SELF, true);
1181 }
1182 else if (loc->GetExactDist(caster) < 10.0f)
1183 {
1184 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true);
1185 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SLOW, true);
1186 }
1187 else if (loc->GetExactDist(caster) < 25.0f)
1188 {
1189 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true);
1190 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_MED, true);
1191 }
1192 else
1193 {
1194 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true);
1195 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_FAST, true);
1196 }
1197 }
1198 else
1199 {
1200 caster->CastSpell(caster, SPELL_JUGGLE_SELF, true);
1201 caster->CastSpell(caster, SPELL_TORCH_SHADOW_SELF, true);
1202 }
1203 }
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:1179
Definition Position.h:255
@ SPELL_TORCH_SHADOW_MED
Definition midsummer.cpp:1146
@ SPELL_TORCH_SHADOW_SELF
Definition midsummer.cpp:1144
@ SPELL_JUGGLE_FAST
Definition midsummer.cpp:1137
@ SPELL_JUGGLE_SLOW
Definition midsummer.cpp:1135
@ SPELL_JUGGLE_SELF
Definition midsummer.cpp:1134
@ SPELL_TORCH_SHADOW_SLOW
Definition midsummer.cpp:1145
@ SPELL_JUGGLE_MED
Definition midsummer.cpp:1136
@ SPELL_TORCH_SHADOW_FAST
Definition midsummer.cpp:1147

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.

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

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: