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

Private Member Functions

 PrepareSpellScript (spell_blood_council_summon_shadow_resonance)
 
void SetDest (SpellDestination &dest)
 
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 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
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ PrepareSpellScript()

spell_blood_council_summon_shadow_resonance::PrepareSpellScript ( spell_blood_council_summon_shadow_resonance  )
private

◆ Register()

void spell_blood_council_summon_shadow_resonance::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1704 {
1706 }
@ EFFECT_0
Definition SharedDefines.h:31
@ TARGET_DEST_CASTER_RANDOM
Definition SharedDefines.h:1480
#define SpellDestinationTargetSelectFn(F, I, N)
Definition SpellScript.h:364
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Definition SpellScript.h:363
void SetDest(SpellDestination &dest)
Definition boss_blood_prince_council.cpp:1673

References EFFECT_0, SpellScript::OnDestinationTargetSelect, SetDest(), SpellDestinationTargetSelectFn, and TARGET_DEST_CASTER_RANDOM.

◆ SetDest()

void spell_blood_council_summon_shadow_resonance::SetDest ( SpellDestination dest)
inlineprivate
1674 {
1675 Unit* summoner = GetCaster();
1676 float x = dest._position.GetPositionX();
1677 float y = dest._position.GetPositionY();
1678 float angle = summoner->GetAngle(x, y);
1679 if (dest._position.GetExactDist2d(summoner) > 35.0f && x > 4585.0f && y > 2716.0f && y < 2822.0f)
1680 return;
1681
1682 for (uint8 a = 0; a < 2; ++a)
1683 for (uint8 i = 6; i > 0; --i)
1684 {
1685 float destX = summoner->GetPositionX() + cos(angle + a * M_PI) * i * 10.0f;
1686 float destY = summoner->GetPositionY() + std::sin(angle + a * M_PI) * i * 10.0f;
1687 if (summoner->GetMap()->isInLineOfSight(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ() + 10.0f, destX, destY,
1689 destX > 4585.0f && destY > 2716.0f && destY < 2822.0f)
1690 {
1691 float destZ = summoner->GetMapHeight(summoner->GetPhaseMask(), destX, destY, summoner->GetPositionZ());
1692 if (std::fabs(destZ - summoner->GetPositionZ()) < 10.0f) // valid z found
1693 {
1694 dest._position.Relocate(destX, destY, destZ);
1695 return;
1696 }
1697 }
1698 }
1699
1700 dest._position.Relocate(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
1701 }
std::uint8_t uint8
Definition Define.h:109
@ LINEOFSIGHT_ALL_CHECKS
Definition Map.h:113
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, LineOfSightChecks checks, VMAP::ModelIgnoreFlags ignoreFlags) const
Definition Map.cpp:1537
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:664
uint32 GetPhaseMask() const
Definition Object.h:516
Map * GetMap() const
Definition Object.h:625
float GetMapHeight(float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
Definition Object.cpp:3085
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
float GetAngle(const Position *pos) const
Definition Position.cpp:85
void Relocate(float x, float y)
Definition Position.h:77
WorldLocation _position
Definition Spell.h:115

References SpellDestination::_position, Position::GetAngle(), SpellScript::GetCaster(), Position::GetExactDist2d(), WorldObject::GetMap(), WorldObject::GetMapHeight(), WorldObject::GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Map::isInLineOfSight(), LINEOFSIGHT_ALL_CHECKS, VMAP::Nothing, and Position::Relocate().

Referenced by Register().


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