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

◆ HandleFinish()

void spell_midsummer_juggling_torch::HandleFinish ( )
inlineprivate
1111 {
1112 Unit* caster = GetCaster();
1113 if (!caster || !caster->IsPlayer())
1114 return;
1115
1116 if (WorldLocation const* loc = GetExplTargetDest())
1117 {
1118 if (loc->GetExactDist(caster) < 3.0f)
1119 {
1120 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true);
1121 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SELF, true);
1122 }
1123 else if (loc->GetExactDist(caster) < 10.0f)
1124 {
1125 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true);
1126 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SLOW, true);
1127 }
1128 else if (loc->GetExactDist(caster) < 25.0f)
1129 {
1130 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true);
1131 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_MED, true);
1132 }
1133 else
1134 {
1135 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true);
1136 caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_FAST, true);
1137 }
1138 }
1139 else
1140 {
1141 caster->CastSpell(caster, SPELL_JUGGLE_SELF, true);
1142 caster->CastSpell(caster, SPELL_TORCH_SHADOW_SELF, true);
1143 }
1144 }
bool IsPlayer() const
Definition Object.h:207
WorldLocation const * GetExplTargetDest()
Definition SpellScript.cpp:421
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:665
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:1372
Definition Position.h:256
@ SPELL_TORCH_SHADOW_MED
Definition midsummer.cpp:1087
@ SPELL_TORCH_SHADOW_SELF
Definition midsummer.cpp:1085
@ SPELL_JUGGLE_FAST
Definition midsummer.cpp:1078
@ SPELL_JUGGLE_SLOW
Definition midsummer.cpp:1076
@ SPELL_JUGGLE_SELF
Definition midsummer.cpp:1075
@ SPELL_TORCH_SHADOW_SLOW
Definition midsummer.cpp:1086
@ SPELL_JUGGLE_MED
Definition midsummer.cpp:1077
@ SPELL_TORCH_SHADOW_FAST
Definition midsummer.cpp:1088

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.

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

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: