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

Private Member Functions

 PrepareSpellScript (spell_auto_repair)
 
bool Validate (SpellInfo const *) override
 
void FilterTargets (std::list< WorldObject * > &targets)
 
void HandleScript (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 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
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ FilterTargets()

void spell_auto_repair::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
1500 {
1501 std::list<WorldObject*> tmplist;
1502 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1503 if (!(*itr)->ToUnit()->HasAura(SPELL_AUTO_REPAIR))
1504 tmplist.push_back(*itr);
1505
1506 targets.clear();
1507 for (std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr)
1508 targets.push_back(*itr);
1509 }
@ SPELL_AUTO_REPAIR
Definition boss_flame_leviathan.cpp:1487

References SPELL_AUTO_REPAIR.

Referenced by Register().

◆ HandleScript()

void spell_auto_repair::HandleScript ( SpellEffIndex  )
inlineprivate
1512 {
1513 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
1514 if (!vehicle)
1515 return;
1516
1517 Unit* driver = vehicle->GetPassenger(0);
1518 if (!driver)
1519 return;
1520
1521 //driver->TextEmote(VEHICLE_EMOTE_REPAIR, driver, true); // No source
1522
1523 // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
1524 vehicle->GetBase()->SetFullHealth();
1525
1526 // Achievement
1527 if (InstanceScript* instance = vehicle->GetBase()->GetInstanceScript())
1528 instance->SetData(DATA_UNBROKEN_ACHIEVEMENT, 0);
1529 }
Definition InstanceScript.h:143
Unit * GetHitUnit()
Definition SpellScript.cpp:448
Definition Unit.h:636
void SetFullHealth()
Definition Unit.h:1056
Vehicle * GetVehicleKit() const
Definition Unit.h:1838
Definition Vehicle.h:28
Unit * GetBase() const
May be called from scripts.
Definition Vehicle.h:37
Unit * GetPassenger(int8 seatId) const
Definition Vehicle.cpp:227
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
@ DATA_UNBROKEN_ACHIEVEMENT
Definition ulduar.h:59

References DATA_UNBROKEN_ACHIEVEMENT, Vehicle::GetBase(), WorldObject::GetInstanceScript(), Vehicle::GetPassenger(), and Unit::SetFullHealth().

Referenced by Register().

◆ PrepareSpellScript()

spell_auto_repair::PrepareSpellScript ( spell_auto_repair  )
private

◆ Register()

void spell_auto_repair::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1532 {
1535 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition SharedDefines.h:855
@ TARGET_UNIT_DEST_AREA_ENTRY
Definition SharedDefines.h:1417
#define EFFECT_ALL
Definition SharedDefines.h:38
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void HandleScript(SpellEffIndex)
Definition boss_flame_leviathan.cpp:1511
void FilterTargets(std::list< WorldObject * > &targets)
Definition boss_flame_leviathan.cpp:1499

References EFFECT_0, EFFECT_ALL, FilterTargets(), HandleScript(), SPELL_EFFECT_SCRIPT_EFFECT, SpellEffectFn, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_DEST_AREA_ENTRY.

◆ Validate()

bool spell_auto_repair::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1495 {
1497 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SPELL_AUTO_REPAIR.


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