diff --git a/client/Message.cs b/client/Message.cs index 4543ec0..cf5ca6d 100644 --- a/client/Message.cs +++ b/client/Message.cs @@ -11,6 +11,7 @@ internal class Message { public float X { get; init; } public float Y { get; init; } public float Z { get; init; } + public float Yaw { get; init; } [JsonProperty("message")] public string Text { get; init; } @@ -30,6 +31,7 @@ internal class MessageWithTerritory { public float X { get; init; } public float Y { get; init; } public float Z { get; init; } + public float Yaw { get; init; } [JsonProperty("message")] public string Text { get; init; } diff --git a/client/MessageRequest.cs b/client/MessageRequest.cs index a378187..fa5a586 100644 --- a/client/MessageRequest.cs +++ b/client/MessageRequest.cs @@ -10,6 +10,7 @@ public class MessageRequest { public float X { get; set; } public float Y { get; set; } public float Z { get; set; } + public float Yaw { get; set; } public Guid PackId { get; set; } [JsonProperty("template_1")] diff --git a/client/Messages.cs b/client/Messages.cs index a954ac6..4b4de21 100644 --- a/client/Messages.cs +++ b/client/Messages.cs @@ -43,7 +43,8 @@ internal class Messages : IDisposable { } PluginLog.Log($"spawning vfx for {message.Id}"); - if (this.Plugin.Vfx.SpawnStatic(message.Id, VfxPath, message.Position) == null) { + var rotation = Quaternion.CreateFromYawPitchRoll(message.Yaw, 0, 0); + if (this.Plugin.Vfx.SpawnStatic(message.Id, VfxPath, message.Position, rotation) == null) { PluginLog.Log("trying again"); this.SpawnQueue.Enqueue(message); } diff --git a/client/Ui/MainWindowTabs/Write.cs b/client/Ui/MainWindowTabs/Write.cs index 9baf306..c240b0c 100644 --- a/client/Ui/MainWindowTabs/Write.cs +++ b/client/Ui/MainWindowTabs/Write.cs @@ -147,6 +147,7 @@ internal class Write : ITab { X = player.Position.X, Y = player.Position.Y, Z = player.Position.Z, + Yaw = player.Rotation, PackId = pack.Id, Template1 = this._part1, Word1List = this._word1.Item1 == -1 ? null : this._word1.Item1, diff --git a/client/Vfx.cs b/client/Vfx.cs index 2257afd..53b8bf1 100644 --- a/client/Vfx.cs +++ b/client/Vfx.cs @@ -35,7 +35,7 @@ internal unsafe class Vfx : IDisposable { this.Spawned.Clear(); } - internal VfxStruct* SpawnStatic(Guid id, string path, Vector3 pos) { + internal VfxStruct* SpawnStatic(Guid id, string path, Vector3 pos, Quaternion rotation) { VfxStruct* vfx; fixed (byte* p = Encoding.UTF8.GetBytes(path)) { fixed (byte* pool = Pool) { @@ -54,6 +54,8 @@ internal unsafe class Vfx : IDisposable { // update position vfx->Position = new Vector3(pos.X, pos.Y, pos.Z); + // update rotation + vfx->Rotation = new Quaternion(rotation.X, rotation.Y, rotation.Z, rotation.W); // update vfx->Flags |= 2; @@ -81,6 +83,9 @@ internal unsafe class Vfx : IDisposable { [FieldOffset(0x50)] public Vector3 Position; + [FieldOffset(0x60)] + public Quaternion Rotation; + [FieldOffset(0x70)] public Vector3 Scale; diff --git a/server/packs/ffxiv.yaml b/server/packs/ffxiv.yaml index 8d7f94f..309c4c3 100644 --- a/server/packs/ffxiv.yaml +++ b/server/packs/ffxiv.yaml @@ -174,6 +174,9 @@ words: - moogle - goblin - dragon + - namazu + - goat + - mameshiba - name: Situations words: