Skip to content

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
Specify the change for command MOVE_TO that will now support move to respawn pos for the creature itself or its entire group.
  • Loading branch information
cyberium committed Jan 3, 2022
1 parent 3148be1 commit c489723
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 2 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ Defining a buddy could be done in several way:
* datalong3 = enum ForcedMovement
* data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position
* x/y/z/o
* dataint = 1 to init move to respawn position, 2 to init creature group member each in their respawn position.
no other data is needed. So ex: command 3 ... dataint=1 and creature should head to its respawn pos

4 SCRIPT_COMMAND_FLAG_SET source = any
* datalong = field_id
Expand Down
12 changes: 2 additions & 10 deletions src/game/DBScripts/ScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,22 +1605,14 @@ bool ScriptAction::ExecuteDbscriptCommand(WorldObject* pSource, WorldObject* pTa

if (m_script->textId[0])
{
if (m_script->textId[0] == 1)
if (m_script->textId[0] == 1 || m_script->textId[0] == 2 && !creature->GetCreatureGroup())
{
Position const& respPos = creature->GetRespawnPosition();
creature->GetMotionMaster()->MovePoint(0, respPos, ForcedMovement(m_script->moveTo.forcedMovement), 0.f, true);
}
else if (m_script->textId[0] == 2)
{
if (creature->GetCreatureGroup())
{
creature->GetCreatureGroup()->MoveHome();
}
else
{
auto respPos = creature->GetRespawnPosition();
creature->GetMotionMaster()->MovePoint(0, respPos, ForcedMovement(m_script->moveTo.forcedMovement), 0.f, true);
}
creature->GetCreatureGroup()->MoveHome();
}
break;
}
Expand Down

0 comments on commit c489723

Please sign in to comment.