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.

233{
234 if (!unit->IsCreature())
235 return;
236
237 if (unit->IsCreature() && unit->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) && unit->movespline->isFalling()) // pussywizard
239
240 // Need restore previous movement since we have no proper states system
241 //if (unit->IsAlive() && !unit->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING))
242 //{
243 // if (Unit* victim = unit->GetVictim())
244 // unit->GetMotionMaster()->MoveChase(victim);
245 // else
246 // unit->GetMotionMaster()->Initialize();
247 //}
248
249 if (unit->ToCreature()->AI())
251}
@ EFFECT_MOTION_TYPE
Definition: MotionMaster.h:54
@ MOVEMENTFLAG_FALLING
Definition: UnitDefines.h:356
virtual void MovementInform(uint32, uint32)
Definition: CreatureAI.h:156
CreatureAI * AI() const
Definition: Creature.h:143
bool IsCreature() const
Definition: Object.h:201
Creature * ToCreature()
Definition: Object.h:202
Movement::MoveSpline * movespline
Definition: Unit.h:1818
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:1613
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:1612
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.

228{
229 return !unit->movespline->Finalized();
230}
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().