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

Private Member Functions

 PrepareSpellScript (spell_ioc_launch)
 
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::HandleScript ( SpellEffIndex  )
inlineprivate
440 {
441 if (Player* player = GetHitPlayer())
442 player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
443 }
@ SPELL_LAUNCH_NO_FALLING_DAMAGE
Definition: BattlegroundIC.h:729
Definition: Player.h:1064
Player * GetHitPlayer()
Definition: SpellScript.cpp:471

References SpellScript::GetHitPlayer(), and SPELL_LAUNCH_NO_FALLING_DAMAGE.

Referenced by Register().

◆ Launch()

void spell_ioc_launch::Launch ( )
inlineprivate
446 {
447 WorldLocation const* const position = GetExplTargetDest();
448
449 if (Player* player = GetHitPlayer())
450 {
451 player->ExitVehicle();
452 player->DisableSpline();
453 player->GetMap()->PlayerRelocation(player, GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ(), GetCaster()->GetOrientation());
454
455 float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
456 float elevation = GetSpell()->m_targets.GetElevation();
457 float speedZ = std::max(10.0f, float(50.0f * std::sin(elevation)));
458 float speedXY = dist * 10.0f / speedZ;
459
460 player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
461 }
462 }
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::PrepareSpellScript ( spell_ioc_launch  )
private

◆ Register()

void spell_ioc_launch::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

465 {
468 }
#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:439
void Launch()
Definition: isle_of_conquest.cpp:445

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