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

Private Member Functions

 PrepareSpellScript (spell_fight_fire_bomber_SpellScript) void HandleDummy(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 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_fight_fire_bomber::spell_fight_fire_bomber_SpellScript::PrepareSpellScript ( spell_fight_fire_bomber_SpellScript  )
inlineprivate
1196 {
1197 PreventHitDefaultEffect(effIndex);
1198 Vehicle* kit = GetCaster()->GetVehicle();
1199 if (!kit)
1200 return;
1201
1202 bool extinguished = false;
1203 uint8 fireCount = 0;
1204 for (uint8 seat = 3; seat <= 5; ++seat)
1205 if (Unit* banner = kit->GetPassenger(seat))
1206 if (banner->HasAura(SPELL_COSMETIC_FIRE))
1207 {
1208 if (!extinguished)
1209 {
1210 GetCaster()->CastSpell(banner, SPELL_EXTINGUISH_FIRE, true);
1211 extinguished = true;
1212 if (urand(0, 2))
1213 {
1214 banner->RemoveAurasDueToSpell(SPELL_COSMETIC_FIRE);
1215 continue;
1216 }
1217 }
1218 fireCount++;
1219 }
1220
1221 if (fireCount == 0)
1223 }
std::uint8_t uint8
Definition: Define.h:110
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SPELL_EXTINGUISH_FIRE
Definition: zone_icecrown.cpp:1049
@ SPELL_BURNING
Definition: zone_icecrown.cpp:1047
@ SPELL_COSMETIC_FIRE
Definition: zone_icecrown.cpp:1048
Definition: Unit.h:1290
Vehicle * GetVehicle() const
Definition: Unit.h:2354
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4835
Definition: Vehicle.h:30
Unit * GetPassenger(int8 seatId) const
Definition: Vehicle.cpp:226
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetCaster()
Definition: SpellScript.cpp:401

References Unit::CastSpell(), SpellScript::GetCaster(), Vehicle::GetPassenger(), Unit::GetVehicle(), SpellScript::PreventHitDefaultEffect(), Unit::RemoveAurasDueToSpell(), SPELL_BURNING, SPELL_COSMETIC_FIRE, SPELL_EXTINGUISH_FIRE, and urand().

◆ Register()

void spell_fight_fire_bomber::spell_fight_fire_bomber_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1226 {
1227 OnEffectHitTarget += SpellEffectFn(spell_fight_fire_bomber_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
1228 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:753
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336

References EFFECT_0, SpellScript::OnEffectHitTarget, SPELL_EFFECT_DUMMY, and SpellEffectFn.