From 7edd836c63571a6a02e572274c50ec1b26a49cb6 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Mon, 15 Dec 2025 15:02:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E8=B7=A8=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/UI/Lenheart_Each_Class.nut | 8 +- Base/UI/Lenheart_UI_Class.nut | 20 ++ Base/_ENUM/_ENUM_.nut | 2 +- Base/_Tool/BaseTool_Class.nut | 20 +- Base/_Tool/Hacker_Class.nut | 17 +- Base/_Tool/Hacker_RegApi.nut | 35 +- Base/_Tool/HookMap.nut | 43 +++ FileConfig.json | 17 + Project/HudUi/HudUi.nut | 7 - .../ItemTool/ItemCrossover/ItemCrossover.nut | 327 ++++++++++++++++++ Project/ItemTool/ItemFusion/ItemFusion.nut | 12 +- Project/SeriaZeal/SeriaZeal.nut | 1 + .../Training_ModifyAttributes.nut | 58 ++++ Project/Trainingroom/Training_Setting.nut | 56 +++ Project/Trainingroom/Training_State.nut | 56 +++ .../Trainingroom/Training_SummonMonster.nut | 58 ++++ Project/Trainingroom/Trainingroom.nut | 153 +++++++- Project/WorldBoss/WorldBoss.nut | 2 - folder-alias.json | 18 + 19 files changed, 875 insertions(+), 35 deletions(-) create mode 100644 Base/_Tool/HookMap.nut create mode 100644 Project/ItemTool/ItemCrossover/ItemCrossover.nut create mode 100644 Project/Trainingroom/Training_ModifyAttributes.nut create mode 100644 Project/Trainingroom/Training_Setting.nut create mode 100644 Project/Trainingroom/Training_State.nut create mode 100644 Project/Trainingroom/Training_SummonMonster.nut diff --git a/Base/UI/Lenheart_Each_Class.nut b/Base/UI/Lenheart_Each_Class.nut index 06198cb..657a273 100644 --- a/Base/UI/Lenheart_Each_Class.nut +++ b/Base/UI/Lenheart_Each_Class.nut @@ -235,7 +235,13 @@ function Lenheart_Each_Fun(obj) { } } -getroottable()["LenheartFuncTab"].rawset("Lenheart_EachN", Lenheart_Each_Fun); +function Lenheart_Get_EachObj() +{ + Lenheart_Each_Fun(1); + return getroottable().L_Each_Obj; +} + +getroottable()["LenheartFuncTab"].rawset("_Lenheart_EachN", Lenheart_Each_Fun); diff --git a/Base/UI/Lenheart_UI_Class.nut b/Base/UI/Lenheart_UI_Class.nut index 39ad7e6..2a20a51 100644 --- a/Base/UI/Lenheart_UI_Class.nut +++ b/Base/UI/Lenheart_UI_Class.nut @@ -529,6 +529,26 @@ function CheackMouseInOldWindows() { //设定鼠标逻辑 function RunMouseLogic(MousePos_X, MousePos_Y) { + // if (CheackMouseInNewWindows(MousePos_X, MousePos_Y)) { + // //悬停鼠标变更 + // Sq_Memory_WriteByteArr(L_sq_I2P(0x110BA8D), [0x90, 0x90, 0x90]); + // //点击头顶图标 + // Sq_Memory_WriteByteArr(L_sq_I2P(0xE7220C), [0xEB]); + // //点击NPC打开交互 + // Sq_Memory_WriteByteArr(L_sq_I2P(0xE72234), [0xE9, 0xD0, 0x00, 0x00, 0x00, 0x90]); + // //点击仓库交互 + // Sq_Memory_WriteByteArr(L_sq_I2P(0xFCF380), [0xC3]); + // //点击邮箱交互 + // Sq_Memory_WriteByteArr(L_sq_I2P(0x94FDA0), [0xC3]); + // } else { + + // Sq_Memory_WriteByteArr(L_sq_I2P(0x110BA8D), [0x89, 0x5F, 0x48]); + // Sq_Memory_WriteByteArr(L_sq_I2P(0xE7220C), [0x75]); + // Sq_Memory_WriteByteArr(L_sq_I2P(0xE72234), [0x0F, 0x85, 0xCF, 0x00, 0x00, 0x00]); + // Sq_Memory_WriteByteArr(L_sq_I2P(0xFCF380), [0x55]); + // Sq_Memory_WriteByteArr(L_sq_I2P(0x94FDA0), [0x55]); + // } + //解锁鼠标 如果鼠标已处于锁定状态 并且没有悬停在任何窗口上 解锁鼠标 if (R_Mouse.IsLock()) { //不在任何新窗口上 diff --git a/Base/_ENUM/_ENUM_.nut b/Base/_ENUM/_ENUM_.nut index 6492486..6af346d 100644 --- a/Base/_ENUM/_ENUM_.nut +++ b/Base/_ENUM/_ENUM_.nut @@ -429,4 +429,4 @@ function sq_GetCharacterAttribute(address) { function sq_GetCharacterEquipAttribute(offest, Slot) { return L_sq_GetCharacterAttribute(offest, Slot); -} \ No newline at end of file +} diff --git a/Base/_Tool/BaseTool_Class.nut b/Base/_Tool/BaseTool_Class.nut index 20e9fe9..3a6c8bc 100644 --- a/Base/_Tool/BaseTool_Class.nut +++ b/Base/_Tool/BaseTool_Class.nut @@ -291,7 +291,25 @@ class Rindro_BaseToolClass { Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 8, X + Width - LeftTopW, Y + Height - LeftTopH); } - + //品级颜色 + function GetRarityColor(rarity) { + switch (rarity) { + case 0: + return sq_RGBA(255, 255, 255, 255); + case 1: + return sq_RGBA(104, 213, 237, 255); + case 2: + return sq_RGBA(179, 107, 254, 255); + case 3: + return sq_RGBA(255, 0, 240, 255); + case 4: + return sq_RGBA(255, 177, 0, 255); + case 5: + return sq_RGBA(255, 102, 102, 255); + case 6: + return sq_RGBA(255, 50, 50, 255); + } + } } //获取文字绘制长度 class LenheartTextClass { diff --git a/Base/_Tool/Hacker_Class.nut b/Base/_Tool/Hacker_Class.nut index ea91208..e462d41 100644 --- a/Base/_Tool/Hacker_Class.nut +++ b/Base/_Tool/Hacker_Class.nut @@ -9,6 +9,9 @@ class _Rindro_Hacker { HookData = null; + NextReturnAddress = null; + CpuContext = null; + constructor() { HookTable = {}; HookData = {}; @@ -29,6 +32,17 @@ class _Rindro_Hacker { HookTable.rawset(AddressStr, Controler); } } + +function _Haker_SetNextReturnAddress(Address) { + local Buffer = "" + Address; + Rindro_Haker.NextReturnAddress = Buffer.slice(Buffer.find("0x") + 2, -1); + +} +function _Haker_SetCpuContext(tab) { + Rindro_Haker.CpuContext = tab; + +} + //初始化Hacker if (!(getroottable().rawin("Rindro_Haker"))) Rindro_Haker <- _Rindro_Hacker(); @@ -60,4 +74,5 @@ OnSetCharacter_Control.MarrySystem <- function() { L_sq_WA(L_sq_RA(L_sq_RA(0x01ADE0CC) + 0x60 + (i * 0x4)) + 0x18, Yosin_14SkillYpos2); } } -}; \ No newline at end of file +}; + diff --git a/Base/_Tool/Hacker_RegApi.nut b/Base/_Tool/Hacker_RegApi.nut index 17cae70..f8a7b1c 100644 --- a/Base/_Tool/Hacker_RegApi.nut +++ b/Base/_Tool/Hacker_RegApi.nut @@ -299,6 +299,24 @@ Rindro_Haker.LoadHook(0x67C560, ["pointer", "int", "int", "int", "int", "void"], }); +// getroottable()._11B47C0_OpenWindow_CallBackFunc <- {}; +// Rindro_Haker.LoadHook(0x11B47C0, ["pointer", "int", "int"], +// function(args) { +// local Ret = null; +// foreach(Func in _11B47C0_OpenWindow_CallBackFunc) { +// local FRet = Func(args); +// if (FRet != null) Ret = FRet; +// } +// return Ret; +// }, +// function(args) { + +// return null; +// }); + + + + /* local Flag = L_Sq_CallFunc(0x59E3D0, "bool", FFI_MS_CDECL, ["int", "int", "int", "int"], ReadPath, ReadBuffer, AllocSize, ReadSizeBuffer); if (Flag) { @@ -315,12 +333,17 @@ Rindro_Haker.LoadHook(0x67C560, ["pointer", "int", "int", "int", "int", "void"], // return null; // }, // function(args) { -// print(NativePointer(L_sq_I2P(args[1])).readUnicodeString()); -// if (NativePointer(L_sq_I2P(args[1])).readUnicodeString() == "SQR/../etc/rindro/ancientrelic/ancientrelic.nut") { -// printf("加载AP脚本"); -// local str = "function sq_AddFunctionName(appendage)\n{\n}\n print(778899);"; -// NativePointer(L_sq_I2P(args[4])).writeInt(str.len()); -// NativePointer(L_sq_I2P(args[2])).writeByteArray(str); +// // print(NativePointer(L_sq_I2P(args[1])).readUnicodeString()); +// // if (NativePointer(L_sq_I2P(args[1])).readUnicodeString() == "SQR/../etc/rindro/ancientrelic/ancientrelic.nut") { +// // printf("加载AP脚本"); +// // local str = "function sq_AddFunctionName(appendage)\n{\n}\n print(778899);"; +// // NativePointer(L_sq_I2P(args[4])).writeInt(str.len()); +// // NativePointer(L_sq_I2P(args[2])).writeByteArray(str); +// // } +// if (NativePointer(L_sq_I2P(args[1])).readUnicodeString() == "ui/inventory/iteminventorywindow.ui") { +// printf("读取ui"); +// print(Rindro_Haker.NextReturnAddress); + // } // return null; // }); diff --git a/Base/_Tool/HookMap.nut b/Base/_Tool/HookMap.nut new file mode 100644 index 0000000..11cce55 --- /dev/null +++ b/Base/_Tool/HookMap.nut @@ -0,0 +1,43 @@ +/* +文件名:HookMap.nut +路径:Base/_Tool/HookMap.nut +创建日期:2025-12-12 22:40 +文件用途: +*/ +//通用HOOK入口函数 +function _Hook_Enter_Currency_Func_(args, TableObj) { + local Ret = null; + foreach(Func in TableObj) { + local Buf = Func(args); + if (Buf != null) Ret = Buf; + } + return Ret; +} +//通用HOOK出口函数 +function _Hook_Leave_Currency_Func_(args, TableObj) { + local Ret = null; + foreach(Func in TableObj) { + local Buf = Func(args); + if (Buf != null) Ret = Buf; + } + return Ret; +} + +//通用HOOK注册全局临时表名 +_Hook_Register_Currency_TableName_ <- null; +//通用注册HOOK函数 +function _Hook_Register_Currency_Func_(AddressString, ArgRetArr, TableName) { + getroottable().rawset(TableName + "Enter_Func", {}); + getroottable().rawset(TableName + "Leave_Func", {}); + _Hook_Register_Currency_TableName_ = TableName; + Rindro_Haker.LoadHook(AddressString, ArgRetArr, + function(args) { + return _Hook_Enter_Currency_Func_(args, getroottable()[getroottable()._Hook_Register_Currency_TableName_ + "Enter_Func"]); + }, + function(args) { + return _Hook_Leave_Currency_Func_(args, getroottable()[getroottable()._Hook_Register_Currency_TableName_ + "Leave_Func"]); + } + ); +} + +_Hook_Register_Currency_Func_(0xE6E070, ["int", "int", "int", "int"], "Cb_OpenWindow_"); diff --git a/FileConfig.json b/FileConfig.json index 6d5afe0..7043f7d 100644 --- a/FileConfig.json +++ b/FileConfig.json @@ -7,6 +7,7 @@ "Base/_Tool/MemoryClass.nut", "Base/_Tool/Hacker_Class.nut", "Base/_Tool/Hacker_RegApi.nut", + "Base/_Tool/HookMap.nut", "Base/_Tool/Script_Class.nut", "Base/_Tool/Image_Class.nut", "Base/_Tool/Animation_Class.nut", @@ -55,6 +56,10 @@ "修炼场": { "Private": true, "Script": [ + "Project/Trainingroom/Training_SummonMonster.nut", + "Project/Trainingroom/Training_ModifyAttributes.nut", + "Project/Trainingroom/Training_State.nut", + "Project/Trainingroom/Training_Setting.nut", "Project/Trainingroom/Trainingroom.nut" ], "info": { @@ -76,6 +81,18 @@ "ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png" } }, + "装备跨界": { + "Private": true, + "Script": [ + "Project/ItemTool/ItemCrossover/ItemCrossover.nut" + ], + "info": { + "ProjectAuthor": "官方 (期限:月)", + "ProjectVersion": "1.0.0", + "ProjectDescribe": "装备跨界定制插件", + "ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png" + } + }, "赛利亚的热忱": { "Private": true, "Script": [ diff --git a/Project/HudUi/HudUi.nut b/Project/HudUi/HudUi.nut index 181f5f4..3b4cc63 100644 --- a/Project/HudUi/HudUi.nut +++ b/Project/HudUi/HudUi.nut @@ -42,13 +42,6 @@ class HudUiC extends LenheartNewUI_Windows { //修补内存 function FixMemory() { - printf("宽屏UI已加载!"); - printf("宽屏UI已加载!"); - printf("宽屏UI已加载!"); - printf("宽屏UI已加载!"); - printf("宽屏UI已加载!"); - printf("宽屏UI已加载!"); - printf("宽屏UI已加载!"); L_sq_WAB(0x400E10, 9); L_sq_WAB(0x400E11, 4); diff --git a/Project/ItemTool/ItemCrossover/ItemCrossover.nut b/Project/ItemTool/ItemCrossover/ItemCrossover.nut new file mode 100644 index 0000000..49a09b3 --- /dev/null +++ b/Project/ItemTool/ItemCrossover/ItemCrossover.nut @@ -0,0 +1,327 @@ +/* +文件名:ItemCrossover.nut +路径:Project/ItemTool/ItemCrossover/ItemCrossover.nut +创建日期:2025-12-14 20:47 +文件用途: +*/ +class ItemCrossoverC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + // NoWindow = true; + + //是否可见 + Visible = false; + + NPCList = null; + + Img = Rindro_Image("interface2/ui/newitemtool/newitemtool.img"); + + //待跨界装备 + CrossoverItem = null; + + //错误信息 + ErrorMsg = null; + //所需材料信息 + MaterialInfo = null; + //所需材料是否足够 + MaterialIsEnough = false; + + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + InifPvf(); + RegNpc(); + + DiscardItemCallBackFunc.rawset("ItemCrossoverC", DiscardItem.bindenv(this)); + + Pack_Control.rawset(21007002, function(Chunk) { + local Jso = Json.Decode(Chunk); + if (Jso.rawin("error")) { + ErrorMsg = 1; + } + if (Jso.rawin("MgInfo")) { + MaterialInfo = Jso.MgInfo; + //材料是否充足 + MaterialIsEnough = true; + foreach(Info in MaterialInfo) { + if (Info.NeedCount > Info.RealCount) { + MaterialIsEnough = false; + break; + } + } + } + }.bindenv(this)); + + //成功跨界回包 + Pack_Control.rawset(21007004, function(Chunk) { + //清空 + CrossoverItem = null; + ErrorMsg = null; + MaterialInfo = null; + MaterialIsEnough = false; + R_Utils.PlaySound("CHNUTTREE_BOX"); + }.bindenv(this)); + } + + function RegisterWidget() { + //关闭按钮 + local CloseButton = LenheartNewUI_BaseButton(274, 4, 11, 12, "interface/lenheartwindowcommon.img", 276); + CloseButton.OnClick = function() { + this.Visible = false; + }.bindenv(this); + Childrens.append(CloseButton); + + //确认按钮 + local CrossoverButton = LenheartNewUI_ButtonText(109, 260, 15, "确认跨界"); + CrossoverButton.DWidth = 18; + CrossoverButton.Width = 74; + CrossoverButton.SetTextOffset(-4, 1); + CrossoverButton.OnClickEx = function(Btn) { + if (!Btn.Visible) return; + SendPackEx({ + op = 21007003, + item = CrossoverItem + }); + }.bindenv(this); + CrossoverButton.SetCallBackFunc(function(Btn) { + // if (mode >= 1 && mode< 3) { + // Btn.Visible = true; + // } else { + // Btn.Visible = false; + // } + if (ErrorMsg || !MaterialIsEnough) { + Btn.State = 8; + } else { + Btn.State = 0; + } + }.bindenv(this)); + AddChild(CrossoverButton); + } + + //绘制主界面 + function DrawMain(obj) { + //背景框 + DrawNineBox(X, Y, 292, 292, "interface/lenheartwindowcommon.img", 213); + //标题 + DrawWindowTitle(293); + //绘制标题名 + L_sq_DrawCode("装备跨界", X + 123, Y + 5, sq_RGBA(230, 200, 155, 255), 0, 1); + + Img.DrawPng(0, X + 8, Y + 32); + + if (CrossoverItem) { + //绘制不可跨界原因 + if (ErrorMsg) { + local str = "该装备不可跨界!"; + L_sq_DrawCode(str, X + 147 - LenheartTextClass.GetStringLength(str) / 2, Y + 142, sq_RGBA(255, 60, 48, 255), 0, 1); + for (local i = 0; i< 5; i++) { + Img.DrawPng(2, X + 31 + 51 * i, Y + 195); + } + } else { + //绘制跨界所需材料及数量信息 + if (MaterialInfo) { + for (local i = 0; i< 5; i++) { + if (i >= MaterialInfo.len()) { + Img.DrawPng(2, X + 31 + 51 * i, Y + 195); + continue; + } + local Info = MaterialInfo[i]; + DrawItemBase(X + 31 + 51 * i, Y + 195, Info.Item, Info.NeedCount); + //数量不足绘制遮盖图 + if (Info.NeedCount > Info.RealCount) { + Rindro_Image_GlobalMap["lenheartui"].DrawExPng(257, X + 32 + 51 * i, Y + 196, 0, sq_RGBA(255, 255, 255, 120), 1.0, 1.0); + } + + local RealCountStr = Info.RealCount.tostring(); + local Color = Info.RealCount >= Info.NeedCount ? sq_RGBA(52, 255, 50, 255) : sq_RGBA(255, 60, 47, 255); + L_sq_DrawCode(RealCountStr, X + 46 + (51 * i) - LenheartTextClass.GetStringLength(RealCountStr) / 2, Y + 232, Color, 0, 1); + } + + if (!MaterialIsEnough) { + local str = "跨界材料不足!"; + L_sq_DrawCode(str, X + 147 - LenheartTextClass.GetStringLength(str) / 2, Y + 142, sq_RGBA(255, 60, 48, 255), 0, 1); + } else { + local str = CrossoverItem.Name; + L_sq_DrawCode(str, X + 147 - LenheartTextClass.GetStringLength(str) / 2, Y + 142, GetRarityColor(CrossoverItem.Rarity), 0, 1); + } + } + } + DrawItemObject(X + 133, Y + 96, CrossoverItem); + } + + local MousePos_X = IMouse.GetXPos(); + local MousePos_Y = IMouse.GetYPos(); + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 132, Y + 95, 30, 30)) { + L_sq_SetDrawImgModel(2, 0); + Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X + 132, Y + 95); + L_sq_ReleaseDrawImgModel(); + } + } + + + //绘制道具带道具信息 + function DrawItemObject(X, Y, Object) { + if (!Object) return; + L_Sq_DrawItem(X, Y, Object.ItemId, Object.Count, 0, 0, 0); + if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 30, 30)) { + //打开道具信息窗口 + if (!ItemInfoDrawS) { + ItemInfoDrawS = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, Object.ItemAddress, 41); + //校准道具信息窗口位置 + L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], ItemInfoDrawS, IMouse.GetXPos(), IMouse.GetYPos(), 28, 28); + //我自己UI打开的道具信息窗口需要把渲染队列改为下层 以显示我打开的道具 + getroottable().WindowsShowABFlag <- false; + } + } else { + if (ItemInfoDrawS) { + L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0); + ItemInfoDrawS = null; + } + } + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + } + + //回收道具回调 + function DiscardItem(ItemAddress) { + local MousePos_X = IMouse.GetXPos(); + local MousePos_Y = IMouse.GetYPos(); + if (!sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) return true; + if (!Visible) return true; + else { + CrossoverItem = FindItemPosByForeachInven(ItemAddress); + //清空 + ErrorMsg = null; + MaterialInfo = null; + MaterialIsEnough = false; + + if (CrossoverItem) { + SendPackEx({ + op = 21007001, + item = CrossoverItem + }); + } + } + } + + + //遍历背包查找Item + function FindItemPosByForeachInven(FindAddress) { + local Inven = L_sq_RA(0x1A5FB24); + local InvenAdd = L_sq_RA(Inven + 56); + InvenAdd += 36; + for (local z = 0; z< 5; z++) { + for (local i = 0; i< 48; i++) { + local ItemAdd = L_sq_RA(InvenAdd + ((i + (z * 48)) * 4)); + if (ItemAdd == FindAddress) { + local NamePointer = L_sq_RA(FindAddress + 0x20); + if (z != 0) { + if (ItemInfoDrawS) { + L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0); + ItemInfoDrawS = null; + ResetFocus(); + } + return null; + } + return { + Type = z, + Pos = i, + Vis = false, + Count = MemoryTool.DecodeMemoryData(FindAddress + 0x1A4), + ItemId = L_sq_RA(FindAddress + 0x1c), + ItemAddress = FindAddress, + Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString() + Rarity = L_sq_RA(FindAddress + 0xF4), + }; + } + } + } + return null; + } + + function InifPvf() { + Rindro_Script.GetFileData("etc/rindro/itemtool/itemcrossover/itemcrossover.etc", function(DataTable, Data) { + while (!Data.Eof()) { + local Fragment = Data.Get(); + if (Fragment == "[NPC]") { + NPCList = []; + while (true) { + local Fbuf = Data.Get(); + if (Fbuf == "[/NPC]") { + break; + } + NPCList.append(Fbuf); + } + } + } + }); + } + + function RegNpc() { + local EachManager = Lenheart_Get_EachObj(); + foreach(id in NPCList) { + //先清空注册 + EachManager.AddEachForNpc(id, function(SThis) { + //关闭按钮 + local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); + ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img"; + ApplyEngagementButton.IconIdx = 53; + ApplyEngagementButton.Str = "装备跨界"; + ApplyEngagementButton.Data = SThis.NPC_Index; + ApplyEngagementButton.OnClick = function(Button) { + + InitWindow(); + //打开背包 + L_sq_Open_ExWindow(0x1ADE090, 0, 0, 1); + Button.Parent.CloseAllEach(); + Button.Parent.CloseWindow(); + ResetFocus(); + R_Utils.PlaySound("WINDOW_SHOW"); + }.bindenv(this); + ApplyEngagementButton.SetCallBackFunc(function(Button) {}) + SThis.AddChild(ApplyEngagementButton); + }.bindenv(this)); + } + } + + function InitWindow() { + Visible = true; + //清空 + CrossoverItem = null; + ErrorMsg = null; + MaterialInfo = null; + MaterialIsEnough = false; + } +} + + +L_Windows_List <- []; +getroottable().rawdelete("LenheartPluginsInitFlag"); +getroottable().rawdelete("EventList_Obj") +getroottable().rawdelete("ItemCrossover_Obj"); +getroottable().rawdelete("L_Each_Obj"); + +function Lenheart_ItemCrossover_Fun(obj) { + local RootTab = getroottable(); + if (!RootTab.rawin("ItemCrossover_Obj")) { + RootTab.rawset("ItemCrossover_Obj", true); + LenheartNewUI_CreateWindow(ItemCrossoverC, "装备跨界窗口", ((getroottable().Rindro_Scr_Width - 700) / 2).tointeger(), 160, 292, 290, 28); + } +} + +getroottable()["LenheartFuncTab"].rawset("ItemCrossoverFuncN", Lenheart_ItemCrossover_Fun); \ No newline at end of file diff --git a/Project/ItemTool/ItemFusion/ItemFusion.nut b/Project/ItemTool/ItemFusion/ItemFusion.nut index c2ed676..699ebd1 100644 --- a/Project/ItemTool/ItemFusion/ItemFusion.nut +++ b/Project/ItemTool/ItemFusion/ItemFusion.nut @@ -336,7 +336,6 @@ class ItemFusionC extends LenheartNewUI_Windows { local EachManager = getroottable()["L_Each_Obj"]; foreach(id in NPCList) { //先清空注册 - EachManager.RemoveEachForNpc(id); EachManager.AddEachForNpc(id, function(SThis) { //关闭按钮 local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); @@ -365,11 +364,12 @@ class ItemFusionC extends LenheartNewUI_Windows { } } -L_Windows_List <- []; -getroottable().rawdelete("LenheartPluginsInitFlag"); -getroottable().rawdelete("EventList_Obj") -getroottable().rawdelete("ItemFusion_Obj"); -getroottable().rawdelete("L_Each_Obj"); + +// L_Windows_List <- []; +// getroottable().rawdelete("LenheartPluginsInitFlag"); +// getroottable().rawdelete("EventList_Obj") +// getroottable().rawdelete("ItemFusion_Obj"); +// getroottable().rawdelete("L_Each_Obj"); function Lenheart_ItemFusion_Fun(obj) { local RootTab = getroottable(); diff --git a/Project/SeriaZeal/SeriaZeal.nut b/Project/SeriaZeal/SeriaZeal.nut index d38caec..d3a3bad 100644 --- a/Project/SeriaZeal/SeriaZeal.nut +++ b/Project/SeriaZeal/SeriaZeal.nut @@ -30,6 +30,7 @@ class SeriaZealC extends LenheartNewUI_Windows { //已完成的累计次数 AccumCount = 0; + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { Childrens = []; //注册控件 diff --git a/Project/Trainingroom/Training_ModifyAttributes.nut b/Project/Trainingroom/Training_ModifyAttributes.nut new file mode 100644 index 0000000..7d66951 --- /dev/null +++ b/Project/Trainingroom/Training_ModifyAttributes.nut @@ -0,0 +1,58 @@ +/* +文件名:Training_ModifyAttributes.nut +路径:Project/Trainingroom/Training_ModifyAttributes.nut +创建日期:2025-12-13 02:22 +文件用途:修改训练房角色属性 +*/ +class Training_ModifyAttributesC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + // Visible = false; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + + } + + //绘制主界面 + function DrawMain(obj) { + // print(2); + L_sq_DrawCode("修改属性页面", X + 50, Y + 80, sq_RGBA(230, 200, 155, 255), 0, 1); + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y - 28); + + if (Parent && Parent.Visible) { + X = Parent.X; + Y = Parent.Y + 28; + } + } + +} \ No newline at end of file diff --git a/Project/Trainingroom/Training_Setting.nut b/Project/Trainingroom/Training_Setting.nut new file mode 100644 index 0000000..8f507a1 --- /dev/null +++ b/Project/Trainingroom/Training_Setting.nut @@ -0,0 +1,56 @@ +/* +文件名:Training_Setting.nut +路径:Project/Trainingroom/Training_Setting.nut +创建日期:2025-12-13 02:24 +文件用途:训练房设置 +*/ +class Training_SettingC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + // Visible = false; + + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + + } + + //绘制主界面 + function DrawMain(obj) { + L_sq_DrawCode("设置页面", X + 50, Y + 80, sq_RGBA(230, 200, 155, 255), 0, 1); + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y - 28); + + if (Parent && Parent.Visible) { + X = Parent.X; + Y = Parent.Y + 28; + } + } +} diff --git a/Project/Trainingroom/Training_State.nut b/Project/Trainingroom/Training_State.nut new file mode 100644 index 0000000..0bc6f10 --- /dev/null +++ b/Project/Trainingroom/Training_State.nut @@ -0,0 +1,56 @@ +/* +文件名:Training_State.nut +路径:Project/Trainingroom/Training_State.nut +创建日期:2025-12-13 02:23 +文件用途:训练状态管理 +*/ +class Training_StateC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + // Visible = false; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + + } + + //绘制主界面 + function DrawMain(obj) { + L_sq_DrawCode("状态页面", X + 50, Y + 80, sq_RGBA(230, 200, 155, 255), 0, 1); + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y - 28); + + if (Parent && Parent.Visible) { + X = Parent.X; + Y = Parent.Y + 28; + } + } + +} diff --git a/Project/Trainingroom/Training_SummonMonster.nut b/Project/Trainingroom/Training_SummonMonster.nut new file mode 100644 index 0000000..98f7f5a --- /dev/null +++ b/Project/Trainingroom/Training_SummonMonster.nut @@ -0,0 +1,58 @@ +/* +文件名:Training_SummonMonster.nut +路径:Project/Trainingroom/Training_SummonMonster.nut +创建日期:2025-12-13 02:02 +文件用途:训练室-召唤怪物 +*/ +class Training_SummonMonsterC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + // Visible = false; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + + } + + //绘制主界面 + function DrawMain(obj) { + // print(1); + L_sq_DrawCode("召唤怪物页面", X + 50, Y + 80, sq_RGBA(230, 200, 155, 255), 0, 1); + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y - 28); + + if (Parent && Parent.Visible) { + X = Parent.X; + Y = Parent.Y + 28; + } + } + +} \ No newline at end of file diff --git a/Project/Trainingroom/Trainingroom.nut b/Project/Trainingroom/Trainingroom.nut index d6f55bb..db61586 100644 --- a/Project/Trainingroom/Trainingroom.nut +++ b/Project/Trainingroom/Trainingroom.nut @@ -5,11 +5,14 @@ 文件用途: */ class TrainingroomC extends LenheartNewUI_Windows { + + X = -321; + //调试模式 - DeBugMode = true; + // DeBugMode = true; //不是窗口 - // NoWindow = true; + NoWindow = true; //是否可见 // Visible = false; @@ -21,45 +24,173 @@ class TrainingroomC extends LenheartNewUI_Windows { //位移修炼场副本编号 MoveTrainingroomDungeonId = 1; + //是否在修炼场中 + InTrainingroom = false; + + //队列 + Queue = null; + //图像 + Img = Rindro_Image("training/main.img"); + //主界面展开状态 + MainState = 0; + + //子页面配置 + PageConfig = ["召唤怪物", "修改属性", "状态", "设置"]; + //子页面标题 + Title = null; + //子页面 + PageList = null; constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { Childrens = []; + Title = []; + PageList = []; + Queue = QuestQueue(); //注册控件 RegisterWidget(); LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + X = -321; InitPvf(); + + Cb_OpenWindow_Enter_Func.rawset("TrainingroomC", function(args) { + NativePointer(Rindro_Haker.CpuContext.ecx).add(4344 * 4).writeInt(1); + if (args[0] == 244 && InTrainingroom) { + NativePointer(Rindro_Haker.CpuContext.ecx).add(4344 * 4).writeInt(0); + ChangeMainState(false); + } + }.bindenv(this)); + } + function RegisterWidget() { - // //关闭按钮 - // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); - // CloseButton.OnClick = function() { - // this.Visible = false; - // }.bindenv(this); - // Childrens.append(CloseButton); + + local LogicFunc = function(Btn) { + foreach(Pos, obj in Title) { + if (obj != Btn) obj.State = 0; + else { + obj.State = 1; + ChangeSubPage(Pos); + } + } + }; + + foreach(Pos, Name in PageConfig) { + local Tabbars1 = LenheartNewUI_TabbarsText((Pos * 61), 4, Name); + if (Pos == 0) Tabbars1.State = 1; + Tabbars1.SetTextOffset(31 - LenheartTextClass.GetStringLength(Name) / 2, 4); + AddChild(Tabbars1); + Tabbars1.OnClickEx = LogicFunc.bindenv(this); + Title.append(Tabbars1); + } + //返回城镇 + local ReturnToTheTownButton = LenheartNewUI_ButtonText(236, 450, 15, "返回城镇"); + ReturnToTheTownButton.Idx = 74; + ReturnToTheTownButton.DWidth = 18; + ReturnToTheTownButton.Width = 74; + ReturnToTheTownButton.SetTextOffset(-4, 1); + ReturnToTheTownButton.OnClickEx = function(Btn) { + L_sq_SendPackType(45); + L_sq_SendPack(); + ChangeMainState(false); + }.bindenv(this); + AddChild(ReturnToTheTownButton); + + PageList.append(Training_SummonMonsterC("修炼场_召唤怪物页面", 0, 0, 300, 140, 0)); + PageList.append(Training_ModifyAttributesC("修炼场_修改属性页面", 0, 0, 300, 140, 0)); + PageList.append(Training_StateC("修炼场_状态页面", 0, 0, 300, 140, 0)); + PageList.append(Training_SettingC("修炼场_设置页面", 0, 0, 300, 140, 0)); + + ChangeSubPage(0); + } + + function ChangeSubPage(Index) { + for (local i = 0; i< PageList.len(); i++) { + local Object = PageList[i]; + Object.Visible = false; + RemoveChild(Object.ObjectId); + } + + PageList[Index].Visible = true; + AddChild(PageList[Index]); } //绘制主界面 function DrawMain(obj) { + Img.DrawPng(0, X, Y); + //分割线 + Rindro_Image_GlobalMap["lenheartui"].DrawExPng(230, X, Y + 25, 0, sq_RGBA(255, 255, 255, 250), 1.5, 1.0); + //子页面背景框 + //嵌套背景框 + // DrawNineBox(X + 0, Y + 26, 302, 146, "interface/lenheartwindowcommon.img", 0); + } + function ChangeMainState(flag) { + if (MainState == 0) { + MainState = 1 + Queue.AddQuest("界面移动动画", function(Name, Time) { + local Offset = sq_GetAccel(-321, 0, Time, 500, true); + X = Offset; + if (Offset == 0) { + MainState = 2; + Queue.RemoveQuest(Name); + } + }.bindenv(this)); + } else if (MainState == 2) { + MainState = 1; + Queue.AddQuest("界面移动动画", function(Name, Time) { + local Offset = sq_GetAccel(0, -321, Time, 500, true); + X = Offset; + if (Offset == -321) { + MainState = 0; + Queue.RemoveQuest(Name); + } + }.bindenv(this)); + } } function Show(obj) { DrawMain(obj); LenheartNewUI_Windows.Show(obj); + Queue.Run(); + } + //修炼场中Proc + function ProcInTraining(obj) { + InTrainingroom = false; + //判断自己是否在修炼场中 + if (sq_GetCurrentModuleType() != 3) return; + local stage = sq_GetGlobaludpModuleStage(); + local dungeon = sq_GetDungeonByStage(stage); + local dungeonIndex = sq_GetDuegonIndex(dungeon); + if (dungeonIndex != MoveTrainingroomDungeonId) return; + InTrainingroom = true; + + local KThisC = L_sq_RA(0x1B470E0); + local KeyFlag = L_sq_RA(KThisC + 269 + DIK_F12); + if (KeyFlag == 128 && MainState != 1) { + ChangeMainState(true); + } + + } + + //逻辑入口 function Proc(obj) { LenheartNewUI_Windows.SyncPos(X, Y); - + //主动调用子对象窗口的Proc + foreach(Object in Childrens) { + if (Object instanceof LenheartNewUI_Windows) + Object.Proc(obj); + } //判断自己是否在需要位移修炼场的区域 if (sq_GetCurrentModuleType() == 1) { @@ -76,6 +207,8 @@ class TrainingroomC extends LenheartNewUI_Windows { } } } + + ProcInTraining(obj); } function InitPvf() { @@ -101,7 +234,7 @@ function Lenheart_Trainingroom_Fun(obj) { local RootTab = getroottable(); if (!RootTab.rawin("Trainingroom_Obj")) { RootTab.rawset("Trainingroom_Obj", true); - LenheartNewUI_CreateWindow(TrainingroomC, "修炼场窗口", ((getroottable().Rindro_Scr_Width - 405) / 2).tointeger(), 64, 405, 372, 28); + LenheartNewUI_CreateWindow(TrainingroomC, "修炼场窗口", 0, 35, 306, 474, 0); } } diff --git a/Project/WorldBoss/WorldBoss.nut b/Project/WorldBoss/WorldBoss.nut index 99fbb54..fa804db 100644 --- a/Project/WorldBoss/WorldBoss.nut +++ b/Project/WorldBoss/WorldBoss.nut @@ -56,7 +56,6 @@ class WorldBossC extends LenheartNewUI_Windows { MyRankObject = null; - //计时器 TiemrCache = null; Timer = null; @@ -238,7 +237,6 @@ class WorldBossC extends LenheartNewUI_Windows { } function RegisterWidget() { - //关闭按钮 local CloseButton = LenheartNewUI_BaseButton(738, 3, 11, 12, "interface/lenheartwindowcommon.img", 276); CloseButton.OnClick = function() { diff --git a/folder-alias.json b/folder-alias.json index ae628d0..dcfe7c4 100644 --- a/folder-alias.json +++ b/folder-alias.json @@ -196,5 +196,23 @@ }, "Project/Trainingroom": { "description": "修炼场" + }, + "Base/_Tool/HookMap.nut": { + "description": "所有HOOK" + }, + "Project/Trainingroom/Training_SummonMonster.nut": { + "description": "召唤怪物" + }, + "Project/Trainingroom/Training_ModifyAttributes.nut": { + "description": "修改属性" + }, + "Project/Trainingroom/Training_State.nut": { + "description": "状态" + }, + "Project/Trainingroom/Training_Setting.nut": { + "description": "设置" + }, + "Project/ItemTool/ItemCrossover": { + "description": "装备跨甲" } } \ No newline at end of file