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

◆ DoCheckCast()

SpellCastResult spell_hun_masters_call::DoCheckCast ( )
inlineprivate
602 {
603 Pet* pet = GetCaster()->ToPlayer()->GetPet();
604 if (!pet || !pet->IsAlive())
605 return SPELL_FAILED_NO_PET;
606
607 // Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this
609 uint32 const unitflag = pet->GetUnitFlags();
610 if (pet->GetCharmerGUID())
611 result = SPELL_FAILED_CHARMED;
612 else if (unitflag & UNIT_FLAG_STUNNED)
613 result = SPELL_FAILED_STUNNED;
614 else if (unitflag & UNIT_FLAG_FLEEING)
615 result = SPELL_FAILED_FLEEING;
616 else if (unitflag & UNIT_FLAG_CONFUSED)
617 result = SPELL_FAILED_CONFUSED;
618
619 if (result != SPELL_CAST_OK)
620 return result;
621
622 Unit* target = GetExplTargetUnit();
623 if (!target)
625
626 if (!pet->IsWithinLOSInMap(target))
628
629 return SPELL_CAST_OK;
630 }
std::uint32_t uint32
Definition: Define.h:107
SpellCastResult
Definition: SharedDefines.h:948
@ SPELL_FAILED_STUNNED
Definition: SharedDefines.h:1057
@ SPELL_FAILED_BAD_TARGETS
Definition: SharedDefines.h:961
@ SPELL_FAILED_CONFUSED
Definition: SharedDefines.h:975
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
@ SPELL_FAILED_CHARMED
Definition: SharedDefines.h:973
@ SPELL_FAILED_LINE_OF_SIGHT
Definition: SharedDefines.h:996
@ SPELL_FAILED_FLEEING
Definition: SharedDefines.h:983
@ SPELL_FAILED_NO_PET
Definition: SharedDefines.h:1033
@ UNIT_FLAG_STUNNED
Definition: UnitDefines.h:247
@ UNIT_FLAG_CONFUSED
Definition: UnitDefines.h:251
@ UNIT_FLAG_FLEEING
Definition: UnitDefines.h:252
Player * ToPlayer()
Definition: Object.h:201
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:1358
Definition: Pet.h:41
Pet * GetPet() const
Definition: Player.cpp:8939
Definition: Unit.h:630
bool IsAlive() const
Definition: Unit.h:1654
UnitFlags GetUnitFlags() const
Definition: Unit.h:711
ObjectGuid GetCharmerGUID() const
Definition: Unit.h:684
Unit * GetExplTargetUnit()
Definition: SpellScript.cpp:433
Unit * GetCaster()
Definition: SpellScript.cpp:401

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
633 {
635 }
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
int32 GetEffectValue() const
Definition: SpellScript.cpp:600
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

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
638 {
640 }
@ SPELL_HUNTER_MASTERS_CALL_TRIGGERED
Definition: spell_hunter.cpp:57

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.

643 {
645
648 }
@ EFFECT_1
Definition: SharedDefines.h:32
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:781
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:855
#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:601
void HandleDummy(SpellEffIndex)
Definition: spell_hunter.cpp:632
void HandleScriptEffect(SpellEffIndex)
Definition: spell_hunter.cpp:637

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.

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

References SPELL_HUNTER_MASTERS_CALL_TRIGGERED, and _SpellScript::ValidateSpellInfo().