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

Private Member Functions

 PrepareSpellScript (spell_ioc_launch_SpellScript)
 
void HandleScript (SpellEffIndex)
 
void Launch ()
 
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

◆ HandleScript()

void spell_ioc_launch::spell_ioc_launch_SpellScript::HandleScript ( SpellEffIndex  )
inlineprivate
469 {
470 if (Player* player = GetHitPlayer())
471 player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
472 }
@ SPELL_LAUNCH_NO_FALLING_DAMAGE
Definition: BattlegroundIC.h:729
Definition: Player.h:1056
Player * GetHitPlayer()
Definition: SpellScript.cpp:471

References SpellScript::GetHitPlayer(), and SPELL_LAUNCH_NO_FALLING_DAMAGE.

Referenced by Register().

◆ Launch()

void spell_ioc_launch::spell_ioc_launch_SpellScript::Launch ( )
inlineprivate
475 {
476 WorldLocation const* const position = GetExplTargetDest();
477
478 if (Player* player = GetHitPlayer())
479 {
480 player->ExitVehicle();
481 player->DisableSpline();
482 player->GetMap()->PlayerRelocation(player, GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ(), GetCaster()->GetOrientation());
483
484 float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
485 float elevation = GetSpell()->m_targets.GetElevation();
486 float speedZ = std::max(10.0f, float(50.0f * std::sin(elevation)));
487 float speedXY = dist * 10.0f / speedZ;
488
489 player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
490 }
491 }
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
Definition: Position.h:251
float GetElevation() const
Definition: Spell.h:168
SpellCastTargets m_targets
Definition: Spell.h:527
WorldLocation const * GetExplTargetDest()
Definition: SpellScript.cpp:416
Spell * GetSpell()
Definition: SpellScript.h:442
Unit * GetCaster()
Definition: SpellScript.cpp:401

References SpellScript::GetCaster(), SpellCastTargets::GetElevation(), Position::GetExactDist2d(), SpellScript::GetExplTargetDest(), SpellScript::GetHitPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), SpellScript::GetSpell(), and Spell::m_targets.

Referenced by Register().

◆ PrepareSpellScript()

spell_ioc_launch::spell_ioc_launch_SpellScript::PrepareSpellScript ( spell_ioc_launch_SpellScript  )
private

◆ Register()

void spell_ioc_launch::spell_ioc_launch_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

494 {
497 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
#define SpellHitFn(F)
Definition: SpellScript.h:349
@ EFFECT_1
Definition: SharedDefines.h:32
@ SPELL_EFFECT_FORCE_CAST
Definition: SharedDefines.h:918
HookList< HitHandler > AfterHit
Definition: SpellScript.h:347
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleScript(SpellEffIndex)
Definition: isle_of_conquest.cpp:468
void Launch()
Definition: isle_of_conquest.cpp:474

References SpellScript::AfterHit, EFFECT_1, HandleScript(), Launch(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_FORCE_CAST, SpellEffectFn, and SpellHitFn.