Scripts/Commands: update .wp commands to use orientation field from DB
Port From (https://github.com/TrinityCore/TrinityCore/commit/61cc88731c8941289352a1aaa6410bc3dce83faa)
This commit is contained in:
@@ -1114,7 +1114,7 @@ namespace Game.Chat
|
||||
{
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
Log.outInfo(LogFilter.SqlDev, "(@PATH, XX, {0}, {1}, {2}, 0, 0, 0, 100, 0),", player.GetPositionX(), player.GetPositionY(), player.GetPositionZ());
|
||||
Log.outInfo(LogFilter.SqlDev, $"(@PATH, XX, {player.GetPositionX():3F}, {player.GetPositionY():3F}, {player.GetPositionZ():5F}, {player.GetOrientation():5F}, 0, 0, 0, 100, 0)");
|
||||
|
||||
handler.SendSysMessage("Waypoint SQL written to SQL Developer log");
|
||||
return true;
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace Game.Chat.Commands
|
||||
stmt.AddValue(2, player.GetPositionX());
|
||||
stmt.AddValue(3, player.GetPositionY());
|
||||
stmt.AddValue(4, player.GetPositionZ());
|
||||
stmt.AddValue(5, player.GetOrientation());
|
||||
|
||||
DB.World.Execute(stmt);
|
||||
|
||||
@@ -579,8 +580,9 @@ namespace Game.Chat.Commands
|
||||
stmt.AddValue(0, chr.GetPositionX());
|
||||
stmt.AddValue(1, chr.GetPositionY());
|
||||
stmt.AddValue(2, chr.GetPositionZ());
|
||||
stmt.AddValue(3, pathid);
|
||||
stmt.AddValue(4, point);
|
||||
stmt.AddValue(3, chr.GetOrientation());
|
||||
stmt.AddValue(4, pathid);
|
||||
stmt.AddValue(5, point);
|
||||
DB.World.Execute(stmt);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.WaypointChanged);
|
||||
@@ -753,14 +755,14 @@ namespace Game.Chat.Commands
|
||||
float x = result.Read<float>(1);
|
||||
float y = result.Read<float>(2);
|
||||
float z = result.Read<float>(3);
|
||||
float o = result.Read<float>(4);
|
||||
|
||||
uint id = 1;
|
||||
|
||||
Player chr = handler.GetSession().GetPlayer();
|
||||
Map map = chr.GetMap();
|
||||
Position pos = new(x, y, z, chr.GetOrientation());
|
||||
|
||||
Creature creature = Creature.CreateCreature(id, map, pos);
|
||||
Creature creature = Creature.CreateCreature(id, map, new Position(x, y, z, o));
|
||||
if (!creature)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.WaypointVpNotcreated, id);
|
||||
@@ -821,12 +823,12 @@ namespace Game.Chat.Commands
|
||||
float x = result.Read<float>(0);
|
||||
float y = result.Read<float>(1);
|
||||
float z = result.Read<float>(2);
|
||||
float o = result.Read<float>(3);
|
||||
|
||||
Player chr = handler.GetSession().GetPlayer();
|
||||
Map map = chr.GetMap();
|
||||
Position pos = new(x, y, z, chr.GetOrientation());
|
||||
|
||||
Creature creature = Creature.CreateCreature(1, map, pos);
|
||||
Creature creature = Creature.CreateCreature(1, map, new Position(x, y, z, 0));
|
||||
if (!creature)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.WaypointVpNotcreated, 1);
|
||||
|
||||
Reference in New Issue
Block a user