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

Public Member Functions

 spell_pursue_SpellScript ()
 
- 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 ()
 

Private Member Functions

 PrepareSpellScript (spell_pursue_SpellScript)
 
void FilterTargets (std::list< WorldObject * > &targets)
 
void FilterTargetsSubsequently (std::list< WorldObject * > &targets)
 
void HandleScript (SpellEffIndex)
 
void Register () override
 

Private Attributes

WorldObject_target
 

Additional Inherited Members

- 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
 

Constructor & Destructor Documentation

spell_pursue::spell_pursue_SpellScript::spell_pursue_SpellScript ( )
inline
1668  {
1669  _target = nullptr;
1670  }
WorldObject * _target
Definition: boss_flame_leviathan.cpp:1716

Member Function Documentation

void spell_pursue::spell_pursue_SpellScript::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate

In the end, only one target should be selected

1674  {
1675  targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster()));
1676  if (!targets.empty())
1677  {
1680  FilterTargetsSubsequently(targets);
1681  }
1682  }
C::value_type const & SelectRandomContainerElement(C const &container)
Definition: Containers.h:68
WorldObject * _target
Definition: boss_flame_leviathan.cpp:1716
void FilterTargetsSubsequently(std::list< WorldObject * > &targets)
Definition: boss_flame_leviathan.cpp:1684
Unit * GetCaster()
Definition: SpellScript.cpp:394
Definition: boss_flame_leviathan.cpp:1614

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_pursue::spell_pursue_SpellScript::FilterTargetsSubsequently ( std::list< WorldObject * > &  targets)
inlineprivate
1685  {
1686  targets.clear();
1687  if (_target)
1688  targets.push_back(_target);
1689  }
WorldObject * _target
Definition: boss_flame_leviathan.cpp:1716

+ Here is the caller graph for this function:

void spell_pursue::spell_pursue_SpellScript::HandleScript ( SpellEffIndex  )
inlineprivate
1692  {
1693  Creature* caster = GetCaster()->ToCreature();
1694  if (!caster)
1695  return;
1696 
1697  caster->AI()->AttackStart(GetHitUnit()); // Chase target
1698 
1699  for (SeatMap::const_iterator itr = caster->GetVehicleKit()->Seats.begin(); itr != caster->GetVehicleKit()->Seats.end(); ++itr)
1700  {
1701  if (Player* passenger = ObjectAccessor::GetPlayer(*caster, itr->second.Passenger.Guid))
1702  {
1703  caster->AI()->Talk(EMOTE_PURSUE, passenger);
1704  return;
1705  }
1706  }
1707  }
Definition: Creature.h:467
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
CreatureAI * AI() const
Definition: Creature.h:525
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Unit * GetCaster()
Definition: SpellScript.cpp:394
Creature * ToCreature()
Definition: Object.h:194
Unit * GetHitUnit()
Definition: SpellScript.cpp:441
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Definition: Vehicle.h:68
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165
Definition: boss_flame_leviathan.cpp:164

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

spell_pursue::spell_pursue_SpellScript::PrepareSpellScript ( spell_pursue_SpellScript  )
private
void spell_pursue::spell_pursue_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1710  {
1714  }
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:310
Definition: SharedDefines.h:29
Definition: SharedDefines.h:28
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:311
Definition: SharedDefines.h:1016
Definition: SharedDefines.h:1885
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:297
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:295
void FilterTargetsSubsequently(std::list< WorldObject * > &targets)
Definition: boss_flame_leviathan.cpp:1684
void FilterTargets(std::list< WorldObject * > &targets)
Definition: boss_flame_leviathan.cpp:1673
void HandleScript(SpellEffIndex)
Definition: boss_flame_leviathan.cpp:1691

+ Here is the call graph for this function:

Member Data Documentation

WorldObject* spell_pursue::spell_pursue_SpellScript::_target
private

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