TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
spell_omega_stance_spider_effect::spell_omega_stance_spider_effect_SpellScript Class Reference

Private Member Functions

 PrepareSpellScript (spell_omega_stance_spider_effect_SpellScript)
 
void SetDestPosition (SpellEffIndex effIndex)
 
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 constGetSpellInfo ()
 
SpellValue constGetSpellValue ()
 
SpellEffectInfo constGetEffectInfo (SpellEffIndex) const
 
WorldLocation constGetExplTargetDest ()
 
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)
 
SpellEffectInfo constGetEffectInfo () const
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo constGetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
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 ()
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< EffectHandlerOnEffectSuccessfulDispel
 
HookList< HitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList
< ObjectAreaTargetSelectHandler
OnObjectAreaTargetSelect
 
HookList
< ObjectTargetSelectHandler
OnObjectTargetSelect
 
HookList
< DestinationTargetSelectHandler
OnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string constm_scriptName
 
uint32 m_scriptSpellId
 

Member Function Documentation

spell_omega_stance_spider_effect::spell_omega_stance_spider_effect_SpellScript::PrepareSpellScript ( spell_omega_stance_spider_effect_SpellScript  )
private
void spell_omega_stance_spider_effect::spell_omega_stance_spider_effect_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

551  {
553  }
void SetDestPosition(SpellEffIndex effIndex)
Definition: boss_anraphet.cpp:534
Definition: SharedDefines.h:28
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
Definition: SharedDefines.h:1013
HookList< EffectHandler > OnEffectLaunch
Definition: SpellScript.h:292

+ Here is the call graph for this function:

void spell_omega_stance_spider_effect::spell_omega_stance_spider_effect_SpellScript::SetDestPosition ( SpellEffIndex  effIndex)
inlineprivate

TODO: Remove this once we find a general rule for WorldObject::MovePosition (this spell shouldn't take the Z change into consideration)

535  {
536  // Do our own calculations for the destination position.
538  Unit* caster = GetCaster();
539  float angle = float(rand_norm()) * static_cast<float>(2 * M_PI);
540  uint32 dist = caster->GetObjectSize() + GetSpellInfo()->GetEffect(effIndex)->CalcRadius(GetCaster()) * (float)rand_norm();
541 
542  float x = caster->GetPositionX() + dist * std::cos(angle);
543  float y = caster->GetPositionY() + dist * std::sin(angle);
544  float z = caster->GetMap()->GetHeight(x, y, caster->GetPositionZ());
545 
546  const_cast<WorldLocation*>(GetExplTargetDest())->Relocate(x, y, z);
547  GetHitDest()->Relocate(x, y, z);
548  }
Definition: Position.h:228
Map * GetMap() const
Definition: Object.h:543
WorldLocation * GetHitDest()
Definition: SpellScript.cpp:497
#define M_PI
Definition: Common.h:163
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition: Map.cpp:2314
WorldLocation const * GetExplTargetDest()
Definition: SpellScript.cpp:409
float CalcRadius(Unit *caster=NULL, Spell *=NULL) const
Definition: SpellInfo.cpp:655
void Relocate(float x, float y)
Definition: Position.h:67
float GetPositionY() const
Definition: Position.h:105
G3D::int16 z
Definition: Vector3int16.h:46
float GetPositionZ() const
Definition: Position.h:106
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:404
SpellEffectInfo const * GetEffect(uint32 difficulty, uint32 index) const
Definition: SpellInfo.cpp:3348
double rand_norm()
Definition: Random.cpp:69
Unit * GetCaster()
Definition: SpellScript.cpp:394
G3D::int16 x
Definition: Vector2int16.h:37
float GetPositionX() const
Definition: Position.h:104
Definition: Unit.h:1305
float GetObjectSize() const
Definition: Object.cpp:2656

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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