*Movement Generators standardization.

- bool GetDestination(&x,&y,&z) added to all movement generators.(it is used by update of players view distance)
- Fixed when creature entering in combat not count this as StoppedByPlayer.
- Random Movement Generator - added support for creating custom spawndist during the game.
- Random Movement Generator - Db spawndist is checked only at initialize(NOT in each sellect of random location).
- Added Random Movement to motion master - it can be called now by MoveRandom(spawndist) e.g. for use in SD2.
- Home and Random movements no more using RespawnCoords(Home Position has implemented)
- Fixed bug when creature is moving on path and enter combat, after that returns to spawn position.
-Typo fix in Confused Movement Generator

--HG--
branch : trunk
This commit is contained in:
shadowu@mail.bg committed 2008-12-19 00:37:40 +02:00
1 parent 058db69e07
commit 51f0c70b7e
15 files changed
+85 -36

No files matched your search

+11
View File
@@ -30,6 +30,7 @@
#include "PointMovementGenerator.h"
#include "TargetedMovementGenerator.h"
#include "WaypointMovementGenerator.h"
#include "RandomMovementGenerator.h"
#include <cassert>
@@ -104,6 +105,16 @@ MotionMaster::Clear(bool reset)
}
}
void
MotionMaster::MoveRandom(float spawndist)
{
if(i_owner->GetTypeId()==TYPEID_UNIT)
{
DEBUG_LOG("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow() );
Mutate(new RandomMovementGenerator<Creature>(spawndist));
}
}
void
MotionMaster::MovementExpired(bool reset)
{