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

Private Member Functions

 PrepareSpellScript (spell_warhead_detonate)
 
bool Validate (SpellInfo const *) override
 
void HandleDummy (SpellEffIndex)
 
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

◆ HandleDummy()

void spell_warhead_detonate::HandleDummy ( SpellEffIndex  )
inlineprivate
1156 {
1157 Unit* caster = GetCaster();
1158 Player* player = GetHitPlayer();
1159 if (!player || !caster)
1160 {
1161 return;
1162 }
1163
1164 player->ExitVehicle();
1165 float horizontalSpeed = 3.0f;
1166 float verticalSpeed = 40.0f;
1167 player->KnockbackFrom(caster->GetPositionX(), caster->GetPositionY(), horizontalSpeed, verticalSpeed);
1169
1170 std::list<Creature*> explosionBunnys;
1172 for (auto itr = explosionBunnys.begin(); itr != explosionBunnys.end(); ++itr)
1173 {
1174 (*itr)->CastSpell((*itr), SPELL_TORPEDO_EXPLOSION, true);
1175 }
1176 }
@ SPELL_WARHEAD_FUSE
Definition: zone_grizzly_hills.cpp:1106
@ SPELL_TORPEDO_EXPLOSION
Definition: zone_grizzly_hills.cpp:1142
@ NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS
Definition: zone_grizzly_hills.cpp:1143
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2511
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
Definition: Player.h:1081
Definition: Unit.h:630
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
void KnockbackFrom(float x, float y, float speedXY, float speedZ)
Definition: Unit.cpp:19143
void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:19735
Player * GetHitPlayer()
Definition: SpellScript.cpp:471
Unit * GetCaster()
Definition: SpellScript.cpp:401

References Unit::ExitVehicle(), SpellScript::GetCaster(), WorldObject::GetCreatureListWithEntryInGrid(), SpellScript::GetHitPlayer(), Position::GetPositionX(), Position::GetPositionY(), Unit::KnockbackFrom(), NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS, Unit::RemoveAurasDueToSpell(), SPELL_TORPEDO_EXPLOSION, and SPELL_WARHEAD_FUSE.

Referenced by Register().

◆ PrepareSpellScript()

spell_warhead_detonate::PrepareSpellScript ( spell_warhead_detonate  )
private

◆ Register()

void spell_warhead_detonate::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1179 {
1181 }
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:855
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleDummy(SpellEffIndex)
Definition: zone_grizzly_hills.cpp:1155

References EFFECT_0, HandleDummy(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_SCRIPT_EFFECT, and SpellEffectFn.

◆ Validate()

bool spell_warhead_detonate::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1151 {
1152 return sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) && sSpellMgr->GetSpellInfo(SPELL_TORPEDO_EXPLOSION);
1153 }
@ SPELL_PARACHUTE
Definition: zone_grizzly_hills.cpp:1141
#define sSpellMgr
Definition: SpellMgr.h:825

References SPELL_PARACHUTE, SPELL_TORPEDO_EXPLOSION, and sSpellMgr.