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

Private Member Functions

 PrepareSpellScript (spell_auto_repair_SpellScript)
 
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 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

◆ FilterTargets()

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

◆ HandleScript()

void spell_auto_repair::spell_auto_repair_SpellScript::HandleScript ( SpellEffIndex  )
inlineprivate
1510 {
1511 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
1512 if (!vehicle)
1513 return;
1514
1515 Unit* driver = vehicle->GetPassenger(0);
1516 if (!driver)
1517 return;
1518
1519 //driver->TextEmote(VEHICLE_EMOTE_REPAIR, driver, true); // No source
1520
1521 // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
1522 vehicle->GetBase()->SetFullHealth();
1523
1524 // Achievement
1525 if (InstanceScript* instance = vehicle->GetBase()->GetInstanceScript())
1526 instance->SetData(DATA_UNBROKEN_ACHIEVEMENT, 0);
1527 }
@ DATA_UNBROKEN_ACHIEVEMENT
Definition: ulduar.h:60
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1194
Definition: Unit.h:1290
void SetFullHealth()
Definition: Unit.h:1453
Vehicle * GetVehicleKit() const
Definition: Unit.h:2621
Definition: Vehicle.h:30
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:39
Unit * GetPassenger(int8 seatId) const
Definition: Vehicle.cpp:226
Definition: InstanceScript.h:140
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

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

◆ PrepareSpellScript()

spell_auto_repair::spell_auto_repair_SpellScript::PrepareSpellScript ( spell_auto_repair_SpellScript  )
private

◆ Register()

void spell_auto_repair::spell_auto_repair_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1530 {
1533 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:827
@ TARGET_UNIT_DEST_AREA_ENTRY
Definition: SharedDefines.h:1389
#define EFFECT_ALL
Definition: SharedDefines.h:37
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void FilterTargets(std::list< WorldObject * > &targets)
Definition: boss_flame_leviathan.cpp:1497
void HandleScript(SpellEffIndex)
Definition: boss_flame_leviathan.cpp:1509

References EFFECT_0, EFFECT_ALL, SPELL_EFFECT_SCRIPT_EFFECT, SpellEffectFn, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_DEST_AREA_ENTRY.