*Update movement enums - thanks to Zor for info.
*Add functions for position data streaming. --HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user