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

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

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

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

◆ SetDest()

void spell_blood_council_summon_shadow_resonance::SetDest ( SpellDestination dest)
inlineprivate
1658 {
1659 Unit* summoner = GetCaster();
1660 float x = dest._position.GetPositionX();
1661 float y = dest._position.GetPositionY();
1662 float angle = summoner->GetAngle(x, y);
1663 if (dest._position.GetExactDist2d(summoner) > 35.0f && x > 4585.0f && y > 2716.0f && y < 2822.0f)
1664 return;
1665
1666 for (uint8 a = 0; a < 2; ++a)
1667 for (uint8 i = 6; i > 0; --i)
1668 {
1669 float destX = summoner->GetPositionX() + cos(angle + a * M_PI) * i * 10.0f;
1670 float destY = summoner->GetPositionY() + std::sin(angle + a * M_PI) * i * 10.0f;
1671 if (summoner->GetMap()->isInLineOfSight(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ() + 10.0f, destX, destY,
1673 destX > 4585.0f && destY > 2716.0f && destY < 2822.0f)
1674 {
1675 float destZ = summoner->GetMapHeight(summoner->GetPhaseMask(), destX, destY, summoner->GetPositionZ());
1676 if (std::fabs(destZ - summoner->GetPositionZ()) < 10.0f) // valid z found
1677 {
1678 dest._position.Relocate(destX, destY, destZ);
1679 return;
1680 }
1681 }
1682 }
1683
1684 dest._position.Relocate(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
1685 }
std::uint8_t uint8
Definition: Define.h:109
@ LINEOFSIGHT_ALL_CHECKS
Definition: Map.h:198
uint32 GetPhaseMask() const
Definition: Object.h:446
Map * GetMap() const
Definition: Object.h:531
float GetMapHeight(float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
Definition: Object.cpp:3118
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:166
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
float GetAngle(const Position *pos) const
Definition: Position.cpp:77
void Relocate(float x, float y)
Definition: Position.h:73
Definition: Unit.h:630
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:2438
WorldLocation _position
Definition: Spell.h:103
Unit * GetCaster()
Definition: SpellScript.cpp:401

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().