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

#include <PointMovementGenerator.h>

Public Member Functions

 EffectMovementGenerator (uint32 id, uint32 arrivalSpellId=0, ObjectGuid const &arrivalSpellTargetGuid=ObjectGuid::Empty)
 
void Initialize (Unit *) override
 
void Finalize (Unit *) override
 
void Reset (Unit *) override
 
bool Update (Unit *, uint32) override
 
MovementGeneratorType GetMovementGeneratorType () const override
 
- Public Member Functions inherited from MovementGenerator
virtual ~MovementGenerator ()
 
virtual void unitSpeedChanged ()
 
virtual bool GetResetPosition (Unit *, float &, float &, float &)
 

Private Attributes

uint32 _id
 
uint32 _arrivalSpellId
 
ObjectGuid _arrivalSpellTargetGuid
 

Constructor & Destructor Documentation

EffectMovementGenerator::EffectMovementGenerator ( uint32  id,
uint32  arrivalSpellId = 0,
ObjectGuid const arrivalSpellTargetGuid = ObjectGuid::Empty 
)
inline
67  : _id(id), _arrivalSpellId(arrivalSpellId), _arrivalSpellTargetGuid(arrivalSpellTargetGuid) { }
uint32 _arrivalSpellId
Definition: PointMovementGenerator.h:75
ObjectGuid _arrivalSpellTargetGuid
Definition: PointMovementGenerator.h:76
uint32 _id
Definition: PointMovementGenerator.h:74

Member Function Documentation

void EffectMovementGenerator::Finalize ( Unit unit)
overridevirtual

Implements MovementGenerator.

137 {
138  if (_arrivalSpellId)
140 
141  if (unit->GetTypeId() != TYPEID_UNIT)
142  return;
143 
144  // Need restore previous movement since we have no proper states system
146  {
147  if (Unit* victim = unit->GetVictim())
148  unit->GetMotionMaster()->MoveChase(victim);
149  else
150  unit->GetMotionMaster()->Initialize();
151  }
152 
153  if (unit->ToCreature()->AI())
155 }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
void MoveChase(Unit *target, float dist=0.0f, float angle=0.0f)
Definition: MotionMaster.cpp:241
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: ObjectGuid.h:32
Definition: Unit.h:561
Definition: Unit.h:557
TypeID GetTypeId() const
Definition: Object.h:113
uint32 _arrivalSpellId
Definition: PointMovementGenerator.h:75
bool IsAlive() const
Definition: Unit.h:1692
Unit * GetVictim() const
Definition: Unit.h:1379
CreatureAI * AI() const
Definition: Creature.h:525
Definition: MotionMaster.h:54
ObjectGuid _arrivalSpellTargetGuid
Definition: PointMovementGenerator.h:76
Creature * ToCreature()
Definition: Object.h:194
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
void Initialize()
Definition: MotionMaster.cpp:39
Definition: Unit.h:1305
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
virtual void MovementInform(uint32, uint32)
Definition: CreatureAI.h:143
uint32 _id
Definition: PointMovementGenerator.h:74

+ Here is the call graph for this function:

MovementGeneratorType EffectMovementGenerator::GetMovementGeneratorType ( ) const
inlineoverridevirtual

Implements MovementGenerator.

72 { return EFFECT_MOTION_TYPE; }
Definition: MotionMaster.h:54
void EffectMovementGenerator::Initialize ( Unit )
inlineoverridevirtual

Implements MovementGenerator.

68 { }
void EffectMovementGenerator::Reset ( Unit )
inlineoverridevirtual

Implements MovementGenerator.

70 { }
bool EffectMovementGenerator::Update ( Unit unit,
uint32   
)
overridevirtual

Implements MovementGenerator.

132 {
133  return !unit->movespline->Finalized();
134 }
Movement::MoveSpline * movespline
Definition: Unit.h:2213
bool Finalized() const
Definition: MoveSpline.h:129

+ Here is the call graph for this function:

Member Data Documentation

uint32 EffectMovementGenerator::_arrivalSpellId
private
ObjectGuid EffectMovementGenerator::_arrivalSpellTargetGuid
private
uint32 EffectMovementGenerator::_id
private

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