TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
spell_auto_repair::spell_auto_repair_SpellScript Class Reference

Private Member Functions

 PrepareSpellScript (spell_auto_repair_SpellScript)
 
void CheckCooldownForTarget ()
 
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 constGetSpellInfo ()
 
SpellValue constGetSpellValue ()
 
SpellEffectInfo constGetEffectInfo (SpellEffIndex) const
 
WorldLocation constGetExplTargetDest ()
 
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)
 
SpellEffectInfo constGetEffectInfo () const
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo constGetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
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 Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< EffectHandlerOnEffectSuccessfulDispel
 
HookList< HitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList
< ObjectAreaTargetSelectHandler
OnObjectAreaTargetSelect
 
HookList
< ObjectTargetSelectHandler
OnObjectTargetSelect
 
HookList
< DestinationTargetSelectHandler
OnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string constm_scriptName
 
uint32 m_scriptSpellId
 

Member Function Documentation

void spell_auto_repair::spell_auto_repair_SpellScript::CheckCooldownForTarget ( )
inlineprivate

Currently this doesn't work: if we call PreventHitAura(), the existing aura will be removed because of recent aura refreshing changes. Since removing the existing aura negates the idea of a cooldown marker, we just let the dummy aura refresh itself without executing the other spelleffects. The spelleffects can be executed by letting the dummy aura expire naturally. This is a temporary solution only.

1520  {
1521  if (GetHitUnit()->HasAuraEffect(SPELL_AUTO_REPAIR, EFFECT_2)) // Check presence of dummy aura indicating cooldown
1522  {
1531  //PreventHitAura();
1532  }
1533  }
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:583
Definition: SharedDefines.h:29
Definition: SharedDefines.h:28
void PreventHitEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:572
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
Definition: SharedDefines.h:30
Definition: boss_flame_leviathan.cpp:1509

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_auto_repair::spell_auto_repair_SpellScript::HandleScript ( SpellEffIndex  )
inlineprivate
1536  {
1537  Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
1538  if (!vehicle)
1539  return;
1540 
1541  Unit* driver = vehicle->GetPassenger(0);
1542  if (!driver)
1543  return;
1544 
1545  driver->TextEmote(EMOTE_REPAIR, driver, true);
1546 
1547  InstanceScript* instance = driver->GetInstanceScript();
1548  if (!instance)
1549  return;
1550 
1551  // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
1552  vehicle->GetBase()->SetFullHealth();
1553 
1554  // For achievement
1555  instance->SetData(DATA_UNBROKEN, 0);
1556  }
Definition: Vehicle.h:32
virtual void TextEmote(std::string const &text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:16403
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: ulduar.h:419
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition: Vehicle.cpp:287
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: boss_flame_leviathan.cpp:166
Definition: InstanceScript.h:141
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
void SetFullHealth()
Definition: Unit.h:1440
Definition: Unit.h:1305
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:49
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

spell_auto_repair::spell_auto_repair_SpellScript::PrepareSpellScript ( spell_auto_repair_SpellScript  )
private
void spell_auto_repair::spell_auto_repair_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1559  {
1562  }
Definition: SharedDefines.h:28
void HandleScript(SpellEffIndex)
Definition: boss_flame_leviathan.cpp:1535
#define SpellHitFn(F)
Definition: SpellScript.h:306
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
HookList< HitHandler > BeforeHit
Definition: SpellScript.h:300
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
Definition: SharedDefines.h:1087
void CheckCooldownForTarget()
Definition: boss_flame_leviathan.cpp:1519

+ Here is the call graph for this function:


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