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

Private Member Functions

 PrepareSpellScript (spell_hun_masters_call)
 
bool Validate (SpellInfo const *) override
 
SpellCastResult DoCheckCast ()
 
void HandleDummy (SpellEffIndex)
 
void HandleScriptEffect (SpellEffIndex)
 
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

◆ DoCheckCast()

SpellCastResult spell_hun_masters_call::DoCheckCast ( )
inlineprivate
619 {
620 Pet* pet = GetCaster()->ToPlayer()->GetPet();
621 if (!pet || !pet->IsAlive())
622 return SPELL_FAILED_NO_PET;
623
624 // Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this
626 uint32 const unitflag = pet->GetUnitFlags();
627 if (pet->GetCharmerGUID())
628 result = SPELL_FAILED_CHARMED;
629 else if (unitflag & UNIT_FLAG_STUNNED)
630 result = SPELL_FAILED_STUNNED;
631 else if (unitflag & UNIT_FLAG_FLEEING)
632 result = SPELL_FAILED_FLEEING;
633 else if (unitflag & UNIT_FLAG_CONFUSED)
634 result = SPELL_FAILED_CONFUSED;
635
636 if (result != SPELL_CAST_OK)
637 return result;
638
639 Unit* target = GetExplTargetUnit();
640 if (!target)
642
643 if (!pet->IsWithinLOSInMap(target))
645
646 return SPELL_CAST_OK;
647 }
std::uint32_t uint32
Definition Define.h:107
SpellCastResult
Definition SharedDefines.h:936
@ SPELL_FAILED_STUNNED
Definition SharedDefines.h:1045
@ SPELL_FAILED_BAD_TARGETS
Definition SharedDefines.h:949
@ SPELL_FAILED_CONFUSED
Definition SharedDefines.h:963
@ SPELL_CAST_OK
Definition SharedDefines.h:1126
@ SPELL_FAILED_CHARMED
Definition SharedDefines.h:961
@ SPELL_FAILED_LINE_OF_SIGHT
Definition SharedDefines.h:984
@ SPELL_FAILED_FLEEING
Definition SharedDefines.h:971
@ SPELL_FAILED_NO_PET
Definition SharedDefines.h:1021
@ UNIT_FLAG_STUNNED
Definition UnitDefines.h:275
@ UNIT_FLAG_CONFUSED
Definition UnitDefines.h:279
@ UNIT_FLAG_FLEEING
Definition UnitDefines.h:280
Player * ToPlayer()
Definition Object.h:208
Definition Pet.h:41
Pet * GetPet() const
Definition Player.cpp:9149
Unit * GetExplTargetUnit()
Definition SpellScript.cpp:438
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:665
bool IsAlive() const
Definition Unit.h:1796
UnitFlags GetUnitFlags() const
Definition Unit.h:747
ObjectGuid GetCharmerGUID() const
Definition Unit.h:720
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1412

References SpellScript::GetCaster(), Unit::GetCharmerGUID(), SpellScript::GetExplTargetUnit(), Player::GetPet(), Unit::GetUnitFlags(), Unit::IsAlive(), WorldObject::IsWithinLOSInMap(), SPELL_CAST_OK, SPELL_FAILED_BAD_TARGETS, SPELL_FAILED_CHARMED, SPELL_FAILED_CONFUSED, SPELL_FAILED_FLEEING, SPELL_FAILED_LINE_OF_SIGHT, SPELL_FAILED_NO_PET, SPELL_FAILED_STUNNED, Object::ToPlayer(), UNIT_FLAG_CONFUSED, UNIT_FLAG_FLEEING, and UNIT_FLAG_STUNNED.

Referenced by Register().

◆ HandleDummy()

void spell_hun_masters_call::HandleDummy ( SpellEffIndex  )
inlineprivate
650 {
652 }
int32 GetEffectValue() const
Definition SpellScript.cpp:605
Unit * GetHitUnit()
Definition SpellScript.cpp:453
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

References Unit::CastSpell(), SpellScript::GetCaster(), SpellScript::GetEffectValue(), SpellScript::GetHitUnit(), Player::GetPet(), and Object::ToPlayer().

Referenced by Register().

◆ HandleScriptEffect()

void spell_hun_masters_call::HandleScriptEffect ( SpellEffIndex  )
inlineprivate
655 {
657 }
@ SPELL_HUNTER_MASTERS_CALL_TRIGGERED
Definition spell_hunter.cpp:53

References Unit::CastSpell(), SpellScript::GetHitUnit(), and SPELL_HUNTER_MASTERS_CALL_TRIGGERED.

Referenced by Register().

◆ PrepareSpellScript()

spell_hun_masters_call::PrepareSpellScript ( spell_hun_masters_call  )
private

◆ Register()

void spell_hun_masters_call::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

660 {
662
665 }
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition SharedDefines.h:769
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition SharedDefines.h:843
#define SpellCheckCastFn(F)
Definition SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< CheckCastHandler > OnCheckCast
Definition SpellScript.h:328
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
SpellCastResult DoCheckCast()
Definition spell_hunter.cpp:618
void HandleDummy(SpellEffIndex)
Definition spell_hunter.cpp:649
void HandleScriptEffect(SpellEffIndex)
Definition spell_hunter.cpp:654

References DoCheckCast(), EFFECT_0, EFFECT_1, HandleDummy(), HandleScriptEffect(), SpellScript::OnCheckCast, SpellScript::OnEffectHitTarget, SPELL_EFFECT_DUMMY, SPELL_EFFECT_SCRIPT_EFFECT, SpellCheckCastFn, and SpellEffectFn.

◆ Validate()

bool spell_hun_masters_call::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

614 {
616 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SPELL_HUNTER_MASTERS_CALL_TRIGGERED, and _SpellScript::ValidateSpellInfo().


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