AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
EffectMovementGenerator Class Reference

#include "PointMovementGenerator.h"

Inheritance diagram for EffectMovementGenerator:
MovementGenerator

Public Member Functions

 EffectMovementGenerator (uint32 Id)
 
void Initialize (Unit *) override
 
void Finalize (Unit *) override
 
void Reset (Unit *) override
 
bool Update (Unit *, uint32) override
 
MovementGeneratorType GetMovementGeneratorType () override
 
- Public Member Functions inherited from MovementGenerator
virtual ~MovementGenerator ()
 
virtual void Initialize (Unit *)=0
 
virtual void Finalize (Unit *)=0
 
virtual void Reset (Unit *)=0
 
virtual bool Update (Unit *, uint32 time_diff)=0
 
virtual MovementGeneratorType GetMovementGeneratorType ()=0
 
virtual uint32 GetSplineId () const
 
virtual void unitSpeedChanged ()
 
virtual void Pause (uint32)
 
virtual void Resume (uint32)
 
virtual bool GetResetPosition (float &, float &, float &)
 

Private Attributes

uint32 m_Id
 

Detailed Description

Constructor & Destructor Documentation

◆ EffectMovementGenerator()

EffectMovementGenerator::EffectMovementGenerator ( uint32  Id)
inlineexplicit
75: m_Id(Id) {}
uint32 m_Id
Definition: PointMovementGenerator.h:82

Member Function Documentation

◆ Finalize()

void EffectMovementGenerator::Finalize ( Unit unit)
overridevirtual

Implements MovementGenerator.

232{
233 if (!unit->IsCreature())
234 return;
235
236 if (unit->IsCreature() && unit->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) && unit->movespline->isFalling()) // pussywizard
238
239 // Need restore previous movement since we have no proper states system
240 //if (unit->IsAlive() && !unit->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING))
241 //{
242 // if (Unit* victim = unit->GetVictim())
243 // unit->GetMotionMaster()->MoveChase(victim);
244 // else
245 // unit->GetMotionMaster()->Initialize();
246 //}
247
248 if (unit->ToCreature()->AI())
250}
@ MOVEMENTFLAG_FALLING
Definition: UnitDefines.h:356
@ EFFECT_MOTION_TYPE
Definition: MotionMaster.h:56
virtual void MovementInform(uint32, uint32)
Definition: CreatureAI.h:157
CreatureAI * AI() const
Definition: Creature.h:140
bool IsCreature() const
Definition: Object.h:204
Creature * ToCreature()
Definition: Object.h:205
Movement::MoveSpline * movespline
Definition: Unit.h:1979
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:736
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:735
bool isFalling() const
Definition: MoveSpline.h:118

References Creature::AI(), EFFECT_MOTION_TYPE, Unit::HasUnitMovementFlag(), Object::IsCreature(), Movement::MoveSpline::isFalling(), m_Id, MOVEMENTFLAG_FALLING, CreatureAI::MovementInform(), Unit::movespline, Unit::RemoveUnitMovementFlag(), and Object::ToCreature().

◆ GetMovementGeneratorType()

MovementGeneratorType EffectMovementGenerator::GetMovementGeneratorType ( )
inlineoverridevirtual

Implements MovementGenerator.

80{ return EFFECT_MOTION_TYPE; }

References EFFECT_MOTION_TYPE.

◆ Initialize()

void EffectMovementGenerator::Initialize ( Unit )
inlineoverridevirtual

Implements MovementGenerator.

76{}

◆ Reset()

void EffectMovementGenerator::Reset ( Unit )
inlineoverridevirtual

Implements MovementGenerator.

78{}

◆ Update()

bool EffectMovementGenerator::Update ( Unit unit,
uint32   
)
overridevirtual

Implements MovementGenerator.

227{
228 return !unit->movespline->Finalized();
229}
bool Finalized() const
Definition: MoveSpline.h:116

References Movement::MoveSpline::Finalized(), and Unit::movespline.

Member Data Documentation

◆ m_Id

uint32 EffectMovementGenerator::m_Id
private

Referenced by Finalize().