mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Core): implement "SCRIPT_COMMAND_MOVEMENT" (35) to fix Defias Thug waypoint errors (#1721)
* fix(DB): fix Defias Thug waypoint errors * implement SCRIPT_COMMAND_MOVEMENT (35); remove SQL script
This commit is contained in:
@@ -916,6 +916,28 @@ void Map::ScriptsProcess()
|
||||
player->SendMovieStart(step.script->PlayMovie.MovieID);
|
||||
break;
|
||||
|
||||
case SCRIPT_COMMAND_MOVEMENT:
|
||||
// Source must be Creature.
|
||||
if (Creature* cSource = _GetScriptCreature(source, true, step.script))
|
||||
{
|
||||
if (!cSource->IsAlive())
|
||||
return;
|
||||
|
||||
cSource->GetMotionMaster()->MovementExpired();
|
||||
cSource->GetMotionMaster()->MoveIdle();
|
||||
|
||||
switch (step.script->Movement.MovementType)
|
||||
{
|
||||
case RANDOM_MOTION_TYPE:
|
||||
cSource->GetMotionMaster()->MoveRandom((float)step.script->Movement.MovementDistance);
|
||||
break;
|
||||
case WAYPOINT_MOTION_TYPE:
|
||||
cSource->GetMotionMaster()->MovePath(step.script->Movement.Path, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
sLog->outError("Unknown script command %s.", step.script->GetDebugInfo().c_str());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user