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
589 {
590 Pet* pet = GetCaster()->ToPlayer()->GetPet();
591 if (!pet || !pet->IsAlive())
592 return SPELL_FAILED_NO_PET;
593
594 // Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this
596 uint32 const unitflag = pet->GetUnitFlags();
597 if (pet->GetCharmerGUID())
598 result = SPELL_FAILED_CHARMED;
599 else if (unitflag & UNIT_FLAG_STUNNED)
600 result = SPELL_FAILED_STUNNED;
601 else if (unitflag & UNIT_FLAG_FLEEING)
602 result = SPELL_FAILED_FLEEING;
603 else if (unitflag & UNIT_FLAG_CONFUSED)
604 result = SPELL_FAILED_CONFUSED;
605
606 if (result != SPELL_CAST_OK)
607 return result;
608
609 Unit* target = GetExplTargetUnit();
610 if (!target)
612
613 if (!pet->IsWithinLOSInMap(target))
615
616 return SPELL_CAST_OK;
617 }
std::uint32_t uint32
Definition: Define.h:108
@ UNIT_FLAG_STUNNED
Definition: Unit.h:466
@ UNIT_FLAG_CONFUSED
Definition: Unit.h:470
@ UNIT_FLAG_FLEEING
Definition: Unit.h:471
SpellCastResult
Definition: SharedDefines.h:920
@ SPELL_FAILED_STUNNED
Definition: SharedDefines.h:1029
@ SPELL_FAILED_BAD_TARGETS
Definition: SharedDefines.h:933
@ SPELL_FAILED_CONFUSED
Definition: SharedDefines.h:947
@ SPELL_CAST_OK
Definition: SharedDefines.h:1110
@ SPELL_FAILED_CHARMED
Definition: SharedDefines.h:945
@ SPELL_FAILED_LINE_OF_SIGHT
Definition: SharedDefines.h:968
@ SPELL_FAILED_FLEEING
Definition: SharedDefines.h:955
@ SPELL_FAILED_NO_PET
Definition: SharedDefines.h:1005
Player * ToPlayer()
Definition: Object.h:195
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:1347
Definition: Pet.h:40
Pet * GetPet() const
Definition: Player.cpp:8784
Definition: Unit.h:1290
bool IsAlive() const
Definition: Unit.h:1808
UnitFlags GetUnitFlags() const
Definition: Unit.h:1479
ObjectGuid GetCharmerGUID() const
Definition: Unit.h:1820
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
620 {
622 }
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:1169
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
625 {
627 }
@ 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.

630 {
632
635 }
#define SpellCheckCastFn(F)
Definition: SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:753
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:827
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:328
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
SpellCastResult DoCheckCast()
Definition: spell_hunter.cpp:588
void HandleDummy(SpellEffIndex)
Definition: spell_hunter.cpp:619
void HandleScriptEffect(SpellEffIndex)
Definition: spell_hunter.cpp:624

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.

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

References SPELL_HUNTER_MASTERS_CALL_TRIGGERED, and _SpellScript::ValidateSpellInfo().