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 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

◆ HandleFinish()

void spell_midsummer_juggling_torch::HandleFinish ( )
inlineprivate
1173 {
1174 Unit* caster = GetCaster();
1175 if (!caster || !caster->IsPlayer())
1176 return;
1177
1178 if (const WorldLocation* loc = GetExplTargetDest())
1179 {
1180 if (loc->GetExactDist(caster) < 3.0f)
1181 {
1182 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true);
1183 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SELF, true);
1184 }
1185 else if (loc->GetExactDist(caster) < 10.0f)
1186 {
1187 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true);
1188 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SLOW, true);
1189 }
1190 else if (loc->GetExactDist(caster) < 25.0f)
1191 {
1192 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true);
1193 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_MED, true);
1194 }
1195 else
1196 {
1197 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true);
1198 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_FAST, true);
1199 }
1200 }
1201 else
1202 {
1203 caster->CastSpell(caster, SPELL_JUGGLE_SELF, true);
1204 caster->CastSpell(caster, SPELL_TORCH_SHADOW_SELF, true);
1205 }
1206 }
@ SPELL_TORCH_SHADOW_MED
Definition: midsummer.cpp:1149
@ SPELL_TORCH_SHADOW_SELF
Definition: midsummer.cpp:1147
@ SPELL_JUGGLE_FAST
Definition: midsummer.cpp:1140
@ SPELL_JUGGLE_SLOW
Definition: midsummer.cpp:1138
@ SPELL_JUGGLE_SELF
Definition: midsummer.cpp:1137
@ SPELL_TORCH_SHADOW_SLOW
Definition: midsummer.cpp:1148
@ SPELL_JUGGLE_MED
Definition: midsummer.cpp:1139
@ SPELL_TORCH_SHADOW_FAST
Definition: midsummer.cpp:1150
bool IsPlayer() const
Definition: Object.h:200
Definition: Position.h:250
Definition: Unit.h:630
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:1167
WorldLocation const * GetExplTargetDest()
Definition: SpellScript.cpp:416
Unit * GetCaster()
Definition: SpellScript.cpp:401

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.

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

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

◆ Validate()

bool spell_midsummer_juggling_torch::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual