From 7e461be45d2c27be6f6d047d6b474302abc2396f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E6=B2=A2=E5=93=8D=E4=B9=9F?= <72963826+Hibiya615@users.noreply.github.com> Date: Tue, 18 Feb 2025 04:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=AD=BB=E5=AE=AB190?= =?UTF-8?q?=E7=88=86=E5=BC=B9=E4=BD=8D=E7=BD=AE=E9=A2=84=E6=B5=8B=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Deep_Dungeon/the_Palace_of_the_Dead.cs | 92 ++++- .../The_Baldesion_Arsenal.cs | 360 +++++++++++++++++- .../TetoraKodakkuScript.AssemblyInfo.cs | 2 +- ...toraKodakkuScript.AssemblyInfoInputs.cache | 2 +- 4 files changed, 452 insertions(+), 4 deletions(-) diff --git a/Deep_Dungeon/the_Palace_of_the_Dead.cs b/Deep_Dungeon/the_Palace_of_the_Dead.cs index 94a0a63..0b1fe59 100644 --- a/Deep_Dungeon/the_Palace_of_the_Dead.cs +++ b/Deep_Dungeon/the_Palace_of_the_Dead.cs @@ -14,6 +14,7 @@ using ECommons; using ECommons.DalamudServices; using ECommons.GameFunctions; using ECommons.MathHelpers; +using System.Threading; namespace the_Palace_of_the_Dead; @@ -57,6 +58,13 @@ public class the_Palace_of_the_Dead KnockPenalty = false; } + //190 治疗爆弹怪 计数 注意暂时还没有写重置计数!! + private int timesRemedyBomb=0; + public void Init(ScriptAccessory accessory) { + + timesRemedyBomb=0; //190 治疗爆弹怪 计数 + + } // 通用内容 [ScriptMethod(name: "拟态怪_怨念提示", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:6397"])] @@ -552,9 +560,91 @@ public class the_Palace_of_the_Dead public void 治疗爆弹怪_击杀提示(Event @event, ScriptAccessory accessory) { accessory.Method.TextInfo("击杀治疗爆弹怪", duration: 5, true); - accessory.Method.TTS("击杀治疗爆弹怪"); + accessory.Method.TTS("击杀治疗爆弹怪"); + //Interlocked.Increment(ref timesRemedyBomb); //防止多线程出问题,锁定一下 + //++timesRemedyBomb; //记录 治疗爆弹怪出现次数 注意:还没有写重置次数条件 } + + /* 有点计数问题,先放着等有缘人修 + [ScriptMethod(name: "\ue061\ue069\ue060 熔岩爆弹怪 出现位置预测", eventType: EventTypeEnum.AddCombatant, eventCondition: ["DataId:6385"])] + public void 熔岩爆弹怪_震撼弹预测(Event @event, ScriptAccessory accessory) + { + //在治疗爆弹怪 刷新约54s后 出现熔岩爆弹怪 ,期间BOSS会读条3次 [7169]地面爆破 第3次与第2次间隔较长,应在第3次黄圈读条时准备将BOSS拉去刷新位置 + //暂未知 治疗爆弹怪死亡时间 与BOSS黄圈技能时间轴是否有关联 + //在刷新45s时 大约会读条第3次黄圈,故应 Delay = 45000,DestoryAt = 9000 + + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = "熔岩爆弹怪_震撼弹预测"; + dp.Color = new Vector4(0f, 0f, 1f, 1f); + dp.Scale = new Vector2(7.2f); + dp.Delay = 45000; + dp.DestoryAt = 9000; + + switch(timesRemedyBomb) { + + case 1: { + dp.Position = new Vector3(-288.63f, 0.14f,-300.26f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + case 2:{ + dp.Position = new Vector3(-297.46f, 0.12f,-297.52f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + case 3:{ + dp.Position = new Vector3(-288.84f, 0.12f,-305.54f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + case 4:{ + dp.Position = new Vector3(-309.13f, 0.05f,-303.74f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + case 5:{ + dp.Position = new Vector3(-298.36f, 0.05f,-293.63f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + case 6:{ + dp.Position = new Vector3(-301.96f, 0.05f,-314.29f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + case 7:{ + dp.Position = new Vector3(-299.12f, 0.05f,-297.56f); + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + default: { + accessory.Method.SendChat($"/e 调试信息 timeRemedyBomb={timesRemedyBomb}"); + break; + } + + } + + //accessory.Method.TextInfo("已预测 <熔岩爆弹怪> 刷新位置", duration: 5, false); + //accessory.Method.TTS("已预测熔岩爆弹怪刷新位置"); + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Circle, dp); + } + + [ScriptMethod(name: "熔岩爆弹怪 震撼弹预测销毁", eventType: EventTypeEnum.AddCombatant, eventCondition: ["DataId:6386"], userControl: false)] + public void 熔岩爆弹怪_震撼弹预测销毁(Event @event, ScriptAccessory accessory) + { + accessory.Method.RemoveDraw($"熔岩爆弹怪_震撼弹预测"); + } + + */ + [ScriptMethod(name: "\ue061\ue069\ue060 熔岩爆弹怪 震撼弹提示", eventType: EventTypeEnum.AddCombatant, eventCondition: ["DataId:6386"])] public void 熔岩爆弹怪_震撼弹(Event @event, ScriptAccessory accessory) { diff --git a/Field_Operations/The_Forbidden_Land_Eureka/The_Baldesion_Arsenal.cs b/Field_Operations/The_Forbidden_Land_Eureka/The_Baldesion_Arsenal.cs index b30c102..5007afa 100644 --- a/Field_Operations/The_Forbidden_Land_Eureka/The_Baldesion_Arsenal.cs +++ b/Field_Operations/The_Forbidden_Land_Eureka/The_Baldesion_Arsenal.cs @@ -1,6 +1,364 @@ -namespace The_Navel___EX.Field_Operations.The_Forbidden_Land_Eureka; +using System; +using System.ComponentModel; +using System.Linq; +using System.Numerics; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Dalamud.Game.ClientState.Objects.Types; +using Newtonsoft.Json; +using Dalamud.Utility.Numerics; +using KodakkuAssist.Script; +using KodakkuAssist.Module.GameEvent; +using KodakkuAssist.Module.Draw; +using ECommons; +using ECommons.DalamudServices; +using ECommons.GameFunctions; +using ECommons.MathHelpers; + +namespace The_Baldesion_Arsenal_Eureka; + + +[ScriptType(guid: "cb001385-81e0-4c16-8bb3-fb51fd70336a", name: "禁地优雷卡 - 巴尔德西昂兵武塔", territorys: [827], + version: "0.0.0.1", author: "Tetora", note: noteStr)] public class The_Baldesion_Arsenal { + const string noteStr = + """ + v0.0.0.1: + 禁地优雷卡 - 巴尔德西昂兵武塔 初版绘制 + 【施工中】 + """; + //全局 + //7538 插言 ; 7551 伤头 ; 7540 下踢 ; 7863 扫腿 ; 25880 催眠 ; 16560 沉静 + + [ScriptMethod(name: "伤头 & 插言 打断销毁", eventType: EventTypeEnum.ActionEffect, userControl: false, + eventCondition: ["ActionId:regex:^(7538|7551)$"] )] + public void 伤头插言打断销毁(Event @event, ScriptAccessory accessory) + { + accessory.Method.RemoveDraw($"兵武元精_强放逐{@event.SourceId()}"); + } + + [ScriptMethod(name: "眩晕打断销毁", eventType: EventTypeEnum.ActionEffect, userControl: false, + eventCondition: ["ActionId:regex:^(7540|7863)$"] )] + public void 眩晕打断销毁(Event @event, ScriptAccessory accessory) + { + accessory.Method.RemoveDraw($"兵武元精_强放逐{@event.SourceId()}"); + } + + [ScriptMethod(name: "睡眠打断销毁", eventType: EventTypeEnum.ActionEffect, userControl: false, + eventCondition: ["ActionId:regex:^(25880|16560)$"] )] + public void 睡眠打断销毁(Event @event, ScriptAccessory accessory) + { + // accessory.Method.RemoveDraw($"暂时还没有{@event.TargetId()}"); + } + + + // 入口小怪 + [ScriptMethod(name: "兵武比布鲁斯 尾部碎击", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:15356"])] + public void 兵武比布鲁斯_尾部碎击(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + + dp.Name = "兵武比布鲁斯_尾部碎击"; + dp.Color = accessory.Data.DefaultDangerColor; + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(12); + dp.Radian = 90f.DegToRad(); + dp.Rotation = 180f.DegToRad(); + dp.DestoryAt = 4700; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Fan, dp); + } + + [ScriptMethod(name: "兵武元精 强放逐", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:15383"])] + public void 兵武元精_强放逐(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = $"兵武元精_强放逐{@event.SourceId()}"; + dp.Color = new Vector4(1f, 0f, 0f, 1f); + dp.Owner = @event.TargetId(); + dp.Scale = new Vector2(5f); + dp.DestoryAt = 5700; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Circle, dp); + } + + // BOSS1后 + [ScriptMethod(name: "兵武卡尔克布莉娜 恐惧之瞳(石化顺劈)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:15366"])] + public void 兵武卡尔克布莉娜_恐惧之瞳(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + + dp.Name = "兵武卡尔克布莉娜_恐惧之瞳"; + dp.Color = new Vector4(1f, 0f, 1f, 0.6f); + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(42.2f); + dp.Radian = 120f.DegToRad(); + dp.DestoryAt = 4700; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Fan, dp); + } + + + + + #region BOSS1 亚特 + // 14632:本体读条 [妖枪振]钢铁 ; 14633:本体读条 [妖枪振]月环 ; 14631:幻枪招来 + //幻枪招来后,BOSS(DataID:9818)会连线4根 烈焰金枪(DataID:9819),并读条随机[妖枪振]钢铁月环,随后烈焰金枪将瞬发BOSS的钢铁月环 [幻枪振] 14634 / 14635 + /* + [ScriptMethod(name: "BOSS1_亚特 妖枪振(钢铁)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:14632"])] + public void 妖枪振(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = "妖枪振"; + dp.Color = accessory.Data.DefaultDangerColor; + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(15f); + dp.DestoryAt = 4200; + dp.ScaleMode = ScaleMode.ByTime; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Circle, dp); + } + + [ScriptMethod(name: "BOSS1_亚特 妖枪旋(月环)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:14633"])] + public void 妖枪旋(Event @event, ScriptAccessory accessory) + { + //注:14633技能名也叫妖枪振,但他确实是月环 + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = "妖枪旋"; + dp.Color = accessory.Data.DefaultDangerColor; + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(22f); + dp.InnerScale = new Vector2(5f); + dp.Radian = float.Pi * 2; + dp.DestoryAt = 4200; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Donut, dp); + } + */ + #endregion + + + #region BOSS1 欧文 + #endregion + + #region BOSS2 莱丁 + [ScriptMethod(name: "BOSS2_莱丁 天逆矛(钢铁)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:14441"])] + public void 天逆矛(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = "天逆矛"; + dp.Color = accessory.Data.DefaultDangerColor; + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(25f); + dp.DestoryAt = 7200; + dp.ScaleMode = ScaleMode.ByTime; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Circle, dp); + } + + [ScriptMethod(name: "BOSS2_莱丁 旋・斩铁剑(月环)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:14442"])] + public void 旋斩铁剑(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = "旋斩铁剑"; + dp.Color = accessory.Data.DefaultDangerColor; + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(60f); + dp.InnerScale = new Vector2(5f); + dp.Radian = float.Pi * 2; + dp.DestoryAt = 5200; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Donut, dp); + } + + + [ScriptMethod(name: "BOSS2_莱丁 片・斩铁剑(直线)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:regex:^1444[34]$"])] + public void 片斩铁剑(Event @event, ScriptAccessory accessory) + { + bool isLeft=true; + //14444 左 , 14443右 + + if(@event["ActionId"].Equals("14444")) { + + isLeft=true; + + } + + if(@event["ActionId"].Equals("14443")) { + + isLeft=false; + + } + + var dp=accessory.Data.GetDefaultDrawProperties(); + dp.Name="片斩铁剑"; + dp.Scale=new(70,39); + dp.Owner=@event.SourceId(); + dp.Color=accessory.Data.DefaultDangerColor; + dp.DestoryAt=6200; + + if(isLeft) { + + dp.Rotation=90f.DegToRad(); + dp.Offset=new Vector3(3.5f,0,0); + + } + + else { + + dp.Rotation=-90f.DegToRad(); + dp.Offset=new Vector3(-3.5f,0,0); + + } + + //dp.Offset=new Vector3(0,0,3.5f); + // 向后移动3.5f + // 我不确定rotation是否会影响偏差 + // 如果并没有按照预期向左向右偏移 注释或者删掉掉上面这个offset设置^ 然后解除注释if里的两个注释 + // 如果这样就已经生效了 就删除if里的两个注释 + + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Rect, dp); + } + + + [ScriptMethod(name: "BOSS2_莱丁 战死击(钢铁)", eventType: EventTypeEnum.StartCasting, eventCondition: ["ActionId:14460"])] + public void 战死击(Event @event, ScriptAccessory accessory) + { + var dp = accessory.Data.GetDefaultDrawProperties(); + dp.Name = "战死击"; + dp.Color = accessory.Data.DefaultDangerColor; + dp.Owner = @event.SourceId(); + dp.Scale = new Vector2(10.4f); + dp.DestoryAt = 4200; + accessory.Method.SendDraw(DrawModeEnum.Default, DrawTypeEnum.Circle, dp); + } + + #endregion + +} + +public static class EventExtensions +{ + private static bool ParseHexId(string? idStr, out uint id) + { + id = 0; + if (string.IsNullOrEmpty(idStr)) return false; + try + { + var idStr2 = idStr.Replace("0x", ""); + id = uint.Parse(idStr2, System.Globalization.NumberStyles.HexNumber); + return true; + } + catch (Exception) + { + return false; + } + } + + public static uint ActionId(this Event @event) + { + return JsonConvert.DeserializeObject(@event["ActionId"]); + } + + public static uint SourceId(this Event @event) + { + return ParseHexId(@event["SourceId"], out var id) ? id : 0; + } + + public static uint SourceDataId(this Event @event) + { + return JsonConvert.DeserializeObject(@event["SourceDataId"]); + } + + public static uint Command(this Event @event) + { + return ParseHexId(@event["Command"], out var cid) ? cid : 0; + } + + public static uint DurationMilliseconds(this Event @event) + { + return JsonConvert.DeserializeObject(@event["DurationMilliseconds"]); + } + + public static float SourceRotation(this Event @event) + { + return JsonConvert.DeserializeObject(@event["SourceRotation"]); + } + + public static float TargetRotation(this Event @event) + { + return JsonConvert.DeserializeObject(@event["TargetRotation"]); + } + + public static byte Index(this Event @event) + { + return (byte)(ParseHexId(@event["Index"], out var index) ? index : 0); + } + + public static uint State(this Event @event) + { + return ParseHexId(@event["State"], out var state) ? state : 0; + } + + public static string SourceName(this Event @event) + { + return @event["SourceName"]; + } + + public static string TargetName(this Event @event) + { + return @event["TargetName"]; + } + + public static uint TargetId(this Event @event) + { + return ParseHexId(@event["TargetId"], out var id) ? id : 0; + } + + public static Vector3 SourcePosition(this Event @event) + { + return JsonConvert.DeserializeObject(@event["SourcePosition"]); + } + + public static Vector3 TargetPosition(this Event @event) + { + return JsonConvert.DeserializeObject(@event["TargetPosition"]); + } + + public static Vector3 EffectPosition(this Event @event) + { + return JsonConvert.DeserializeObject(@event["EffectPosition"]); + } + + public static uint DirectorId(this Event @event) + { + return ParseHexId(@event["DirectorId"], out var id) ? id : 0; + } + + public static uint StatusId(this Event @event) + { + return JsonConvert.DeserializeObject(@event["StatusId"]); + } + + public static uint StackCount(this Event @event) + { + return JsonConvert.DeserializeObject(@event["StackCount"]); + } + + public static uint Param(this Event @event) + { + return JsonConvert.DeserializeObject(@event["Param"]); + } +} + + +public static class Extensions +{ + public static void TTS(this ScriptAccessory accessory, string text, bool isTTS, bool isDRTTS) + { + if (isDRTTS) + { + accessory.Method.SendChat($"/pdr tts {text}"); + } + else if (isTTS) + { + accessory.Method.TTS(text); + } + } } \ No newline at end of file diff --git a/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfo.cs b/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfo.cs index 61c3691..71bac3f 100644 --- a/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfo.cs +++ b/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("TetoraKodakkuScript")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+71f2d1b2d82da3589802f31f183dbf4820437ec4")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+95222e0dd36789d7fdd37bff20f033a47b0e3bff")] [assembly: System.Reflection.AssemblyProductAttribute("TetoraKodakkuScript")] [assembly: System.Reflection.AssemblyTitleAttribute("TetoraKodakkuScript")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfoInputs.cache b/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfoInputs.cache index e2c4148..0efa351 100644 --- a/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0-windows/TetoraKodakkuScript.AssemblyInfoInputs.cache @@ -1 +1 @@ -90c0f1295136de86e708ea0f6ebbe48cb1618f6849bd890f571a6b768bae13d4 +0d2c11b90053c3fd2a4bb09abf9e70c4d9d2d031e732d14a20d6d123534622e5