*Update movement enums - thanks to Zor for info.

*Add functions for position data streaming.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-08-04 14:39:45 +02:00
parent 850868c8a3
commit 6353e7dd8c
60 changed files with 428 additions and 366 deletions
+1 -1
View File
@@ -324,7 +324,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ)
{
uint32 moveFlag = MOVEFLAG_JUMP | MOVEFLAG_WALK;
uint32 moveFlag = SPLINEFLAG_TRAJECTORY | SPLINEFLAG_WALKING;
uint32 time = speedZ * 100;
i_owner->addUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
@@ -91,7 +91,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.CastStop();
unit.StopMoving();
unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
unit.addUnitState(UNIT_STAT_CONFUSED);
}
@@ -307,7 +307,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.SetUInt64Value(UNIT_FIELD_TARGET, 0);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
if (Unit * fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
{
@@ -30,7 +30,7 @@ HomeMovementGenerator<Creature>::Initialize(Creature & owner)
{
float x, y, z;
owner.GetHomePosition(x, y, z, ori);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
owner.addUnitState(UNIT_STAT_EVADE);
_setTargetLocation(owner);
}
@@ -67,7 +67,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
if (time_diff > i_travel_timer)
{
owner.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
owner.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
// restore orientation of not moving creature at returning to home
if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
@@ -128,7 +128,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
else
{
i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime()));
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
}
//Call for creature group update
@@ -149,7 +149,7 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature)
wander_distance = creature.GetRespawnRadius();
if (irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
_setRandomLocation(creature);
}
@@ -190,12 +190,12 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
if (i_nextMoveTime.Passed())
{
if (irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
_setRandomLocation(creature);
}
else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(),PET_FOLLOW_DIST+2.5f))
{
creature.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
creature.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
_setRandomLocation(creature);
}
}
@@ -154,7 +154,7 @@ void
TargetedMovementGenerator<T>::Initialize(T &owner)
{
if (owner.isInCombat())
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
_setTargetLocation(owner);
}
@@ -80,8 +80,8 @@ void WaypointMovementGenerator<Player>::Reset(Player & /*unit*/){}
template<>
void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const WaypointData &node)
{
node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE):
unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING):
unit.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+3 -3
View File
@@ -77,7 +77,7 @@ inline float Traveller<Creature>::Speed()
{
if (i_traveller.hasUnitState(UNIT_STAT_CHARGING))
return i_traveller.m_TempSpeed;
else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
return i_traveller.GetSpeed(MOVE_WALK);
else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING))
return i_traveller.GetSpeed(MOVE_FLIGHT);
@@ -120,7 +120,7 @@ inline float Traveller<Player>::Speed()
else if (i_traveller.isInFlight())
return PLAYER_FLIGHT_SPEED;
else
return i_traveller.GetSpeed(i_traveller.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALK_MODE) ? MOVE_WALK : MOVE_RUN);
return i_traveller.GetSpeed(i_traveller.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING) ? MOVE_WALK : MOVE_RUN);
}
template<>
@@ -145,7 +145,7 @@ inline void Traveller<Player>::Relocation(float x, float y, float z, float orien
template<>
inline void Traveller<Player>::MoveTo(float x, float y, float z, uint32 t)
{
//Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
//Only send MOVEMENTFLAG_WALKING, client has strange issues with other move flags
i_traveller.SendMonsterMove(x, y, z, t);
}