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
1501 {
1502 std::list<WorldObject*> tmplist;
1503 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1504 if (!(*itr)->ToUnit()->HasAura(SPELL_AUTO_REPAIR))
1505 tmplist.push_back(*itr);
1506
1507 targets.clear();
1508 for (std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr)
1509 targets.push_back(*itr);
1510 }
@ SPELL_AUTO_REPAIR
Definition boss_flame_leviathan.cpp:1488

References SPELL_AUTO_REPAIR.

Referenced by Register().

◆ HandleScript()

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

1533 {
1536 }
@ 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:1512
void FilterTargets(std::list< WorldObject * > &targets)
Definition boss_flame_leviathan.cpp:1500

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.

1496 {
1498 }
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: