Get rid of monster movement flags, since it's really spline flags.

Thanks to Ralek for research.
This commit is contained in:
tomrus88 2010-02-07 14:53:09 +03:00
parent 4a3081e7d5
commit db547a008a
20 changed files with 206 additions and 182 deletions

View file

@ -98,13 +98,13 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
if (is_air_ok)
{
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY);
creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
}
//else if (is_water_ok) // Swimming mode to be done with more than this check
else
{
i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(), 10000+i_destinationHolder.GetTotalTravelTime()));
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
}
}
@ -115,9 +115,9 @@ void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
return;
if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY);
creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
else
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
creature.addUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
_setRandomLocation(creature);
@ -168,15 +168,15 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
if (i_nextMoveTime.Passed())
{
if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY);
creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
else
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
_setRandomLocation(creature);
}
else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f))
{
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK);
creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
_setRandomLocation(creature);
}
}