This commit is contained in:
lenheart
2025-11-03 21:13:01 +08:00
parent 2ef9cfef42
commit 10de73a395
91 changed files with 2497 additions and 2329 deletions

View File

@@ -1,145 +0,0 @@
function _Dps_GmConvenienceConsole_Logic_() {
local Config = GlobalConfig.Get("GM便捷操作台_Lenheart.json");
Gm_InputFunc_Handle[Config["发送道具指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
local Ret = SUser.GiveItem(handler[1].tointeger(), 1);
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
} else if (count == 2) {
local Ret = SUser.GiveItem(handler[1].tointeger(), handler[2].tointeger());
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
}
}
Gm_InputFunc_Handle[Config["转职觉醒指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.ChangeGrowType(handler[1].tointeger(), 0);
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(handler[1].tointeger(), 0);
} else if (count == 2) {
SUser.ChangeGrowType(handler[1].tointeger(), handler[2].tointeger());
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(handler[1].tointeger(), handler[2].tointeger());
}
}
Gm_InputFunc_Handle[Config["完成任务指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.ClearQuest_Gm(handler[1].tointeger());
}
}
Gm_InputFunc_Handle[Config["设置等级指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.SetCharacLevel(handler[1].tointeger());
}
}
//获取位置信息
Gm_InputFunc_Handle[Config["获取位置指令"]] <- function(SUser, CmdString) {
local Location = SUser.GetLocation();
SUser.SendNotiPacketMessage("X坐标: " + Location.Pos.X, 8);
SUser.SendNotiPacketMessage("Y坐标: " + Location.Pos.Y, 8);
SUser.SendNotiPacketMessage("城镇编号: " + Location.Town, 8);
SUser.SendNotiPacketMessage("区域编号: " + Location.Area, 8);
};
//踢人下线
Gm_InputFunc_Handle[Config["踢玩家下线指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
local TUser = World.GetUserByName(handler[1]);
if(TUser)TUser.Kick();
}
};
}
function _Dps_GmConvenienceConsole_Main_() {
_Dps_GmConvenienceConsole_Logic_();
}
function _Dps_GmConvenienceConsole_Main_Reload_(OldConfig) {
foreach (Key,Value in OldConfig) {
try {
Gm_InputFunc_Handle.rawdelete(Key);
} catch (exception){
}
}
_Dps_GmConvenienceConsole_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "GM便捷操作台",
"ProjectDescribe": "本项目提供了许多GM的便捷操作 方便平时调试或写代码 \n输入'//' + 设定的指令即可执行逻辑 ",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "GM便捷操作台_Lenheart.json",
"ProjectFiles": [
"GM便捷操作台.nut"
],
"ProjectRunFunc": "_Dps_GmConvenienceConsole_Main_"
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "一键分解卷",
"ProjectDescribe": "一键分解卷 需要先开启自己的分解师副职业",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "一键分解卷_Lenheart.json",
"ProjectFiles": [
"一键分解卷.nut"
],
"ProjectRunFunc": "_Dps_OneClickDisassemblyOfRoll_Main_"
}

View File

@@ -1,45 +0,0 @@
function _Dps_OneClickDisassemblyOfRoll_Logic_() {
local Config = GlobalConfig.Get("一键分解卷_Lenheart.json");
//分解券
Cb_Use_Item_Sp_Func[Config["分解卷的道具ID"]] <- function(SUser, ItemId) {
local Config = GlobalConfig.Get("一键分解卷_Lenheart.json");
if (Config["是否返还_true代表返还false代表不返还"])
SUser.GiveItem(ItemId, 1);
local is = SUser.GetCurCharacExpertJob();
if (!is) {
SUser.SendNotiPacketMessage("未开启分解机", 8);
return;
}
local inven = SUser.GetInven();
for (local i = (9 + Config["一键分解的起始位置_就是背包从第几格开始"]); i <= (48 + Config["一键分解的结束位置_就是背包到第几格结束"]); i++)
{
local itemObj = inven.GetSlot(1, i);
local itemid = itemObj.GetIndex();
//如果这个位置有道具
if (itemid != 0) {
local pvfitem = PvfItem.GetPvfItemById(itemid);
local rarity = pvfitem.GetRarity();
if (rarity <= 3) {
SUser.DisPatcher_DisJointItem_disjoint(i);
}
}
SUser.SendItemSpace(0);
}
};
}
function _Dps_OneClickDisassemblyOfRoll_Main_() {
_Dps_OneClickDisassemblyOfRoll_Logic_();
}
function _Dps_OneClickDisassemblyOfRoll_Main_Reload_(OldConfig) {
Cb_Use_Item_Sp_Func.rawdelete(OldConfig["分解卷的道具ID"]);
_Dps_OneClickDisassemblyOfRoll_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "一键存入个人金库",
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可,在游戏中输入 //yjcc 即可一键存入个人金库,也可以在游戏中的快捷喊话中添加为快捷键 配置中可更改 yjcc 关键字",
"ProjectAuthor": "倾泪寒 & 南瓜",
"ProjectVersion": 1.1,
"ProjectConfig": "一键存入个人金库_Lenheart.json",
"ProjectFiles": [
"一键入库.nut"
],
"ProjectRunFunc": "_Dps_OneClickStorage_Main_"
}

View File

@@ -1,116 +0,0 @@
/*
文件名:一键入库.nut
路径:MyProject/一键入库.nut
创建日期:2025-03-25 14:42
文件用途:一键入库
*/
function _Dps_OneClickStorage_Logic_() {
local Config = GlobalConfig.Get("一键存入个人金库_Lenheart.json");
//在游戏中输入//一键入库即可调用
Gm_InputFunc_Handle[Config["一键存仓命令"]] <- function(SUser, Cmd) {
// 获取角色背包
local InvenObj = SUser.GetInven();
// 角色仓库
local CargoObj = Sq_CallFunc(S_Ptr("0x08151a94"), "pointer", ["pointer"], SUser.C_Object);
// 添加计数器
local transferCount = 0;
// 遍历背包消耗品栏及材料栏
for (local i = 57; i <= 152; ++i) {
// 获取背包物品
local ItemObj = InvenObj.GetSlot(1, i);
// 获取背包物品ID
local Item_Id = ItemObj.GetIndex();
local ItemName = PvfItem.GetNameById(Item_Id);
// 如果物品ID为0或3037跳过(在此可以添加其他需要跳过的物品ID)
if (Item_Id == 0 || Item_Id == 3037) {
continue;
}
// 角色仓库是否存在背包物品
local CargoSlot = Sq_CallFunc(S_Ptr("0x850bc14"), "int", ["pointer", "int"], CargoObj, Item_Id);
// 如果角色仓库中没有该物品,跳过
if (CargoSlot == -1) {
continue;
}
// 获取仓库物品指针
local cargoItemPointer = NativePointer(CargoObj).add(4).readPointer();
// 获取角色仓库物品对象
local cargoItemObj = NativePointer(cargoItemPointer).add(61 * CargoSlot);
// 获取角色仓库物品ID
local cargoItemId = NativePointer(cargoItemPointer).add(61 * CargoSlot + 2).readU32();
// 获取角色仓库物品数量
local cargoItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], cargoItemObj.C_Object);
// 获取物品对象
local PvfItem = PvfItem.GetPvfItemById(cargoItemId);
// 获取物品可堆叠数量
local getStackableLimit = Sq_CallFunc(S_Ptr("0x0822C9FC"), "int", ["pointer"], PvfItem.C_Object);
// 如果仓库已达堆叠上限,跳过此物品
if (cargoItemCount >= getStackableLimit) {
continue;
}
// 获取背包物品数量
local inventoryItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], ItemObj.C_Object);
// 获取物品是否可堆叠
local checkStackableLimit = Sq_CallFunc(S_Ptr("0x08501A79"), "int", ["int", "int"], cargoItemId, cargoItemCount + inventoryItemCount);
// 尝试将物品储存至角色仓库中
local tryAddStackItem = Sq_CallFunc(S_Ptr("0x0850B4B0"), "int", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
if (tryAddStackItem >= 0) {
// 正式将物品插入角色仓库中
Sq_CallFunc(S_Ptr("0x850b672"), "pointer", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
// 删除背包中的物品
ItemObj.Delete();
transferCount++;
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
}
// 处理可堆叠物品
if (checkStackableLimit == 0) {
// 获取物品总数
local totalCount = cargoItemCount + inventoryItemCount;
// 如果总数不超过上限,全部堆到仓库
if (totalCount <= getStackableLimit) {
// 将物品堆到仓库
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, totalCount);
// 删除背包中的物品
ItemObj.Delete();
transferCount++;
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
} else {
// 如果总数超过上限
// 将仓库的物品数量设置为最大数量
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, getStackableLimit);
// 将背包数量减去转移至仓库的数量
local transferAmount = getStackableLimit - cargoItemCount;
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], ItemObj.C_Object, totalCount - getStackableLimit);
transferCount++;
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + transferAmount, 8);
}
}
// 通知客户端更新背包
SUser.SendUpdateItemList(1, 0, i);
}
if (transferCount == 0) {
SUser.SendNotiBox("没有可转移的物品!", 1);
}
// 通知客户端更新仓库
SUser.SendItemSpace(2);
}
}
//启动函数 自定义的需要写在ifo中
function _Dps_OneClickStorage_Main_() {
_Dps_OneClickStorage_Logic_();
}
function _Dps_OneClickStorage_Main_Reload(OldConfig) {
Gm_InputFunc_Handle.rawdelete(OldConfig["一键存仓命令"]);
_Dps_OneClickStorage_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "上线自动完成任务",
"ProjectDescribe": "上线自动完成任务",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "上线自动完成任务_Lenheart.json",
"ProjectFiles": [
"上线自动完成任务.nut"
],
"ProjectRunFunc": "_Dps_AutomaticallyCompleteTasksOnline_Main_"
}

View File

@@ -1,9 +0,0 @@
function _Dps_AutomaticallyCompleteTasksOnline_Main_() {
Cb_History_MileageSet_Func["_DPS_上线自动完成任务_"] <- function(SUser, Data) {
local Config = GlobalConfig.Get("上线自动完成任务_Lenheart.json");
local QuestArr = Config["需要完成的任务编号"];
foreach(QuestId in QuestArr) {
SUser.ClearQuest_Gm(QuestId);
}
}
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "修复卡NPC商店道具",
"ProjectDescribe": "修复了客户端通过BUG卡NPC商店道具的问题",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "",
"ProjectFiles": [
"修复卡NPC商店道具.nut"
],
"ProjectRunFunc": "_Dps_RepairCardNpcStoreProps_Main_"
}

View File

@@ -1,12 +0,0 @@
function _Dps_RepairCardNpcStoreProps_Main_()
{
Cb_BuyItem_Get_Data_Leave_Func["_DPS_RepairCardNpcStoreProps_"] <- function (args)
{
if(NativePointer(args[3]).add(156).readInt() < 0){
return 10;
}
}
}

View File

@@ -0,0 +1,12 @@
{
"ProjectName": "全职业通用转职书",
"ProjectDescribe": "全职业都可用的转职书。每个转职职业是个数组,可以写多个转职卷编号仿照7577的道具类型即可使用\",\"隔开。",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "",
"ProjectConfig": "全职业通用转职书_Lenheart.json",
"ProjectFiles": [
"全职业通用转职书.nut"
],
"ProjectRunFunc": "_Dps_GeneralJobTransferCertificateForAllProfessions_Main_"
}

View File

@@ -0,0 +1,50 @@
/*
文件名:全职业通用转职书.nut
路径:OfficialProject/全职业通用转职书/全职业通用转职书.nut
创建日期:2025-10-24 22:26
文件用途:
*/
//重载入口
function _Dps_GeneralJobTransferCertificateForAllProfessions_Main_Reload_(OldConfig) {
//先销毁原来注册的
local JobArr = [];
JobArr.push(GlobalConfig["转职初始职业"]);
JobArr.push(GlobalConfig["转职第一职业"]);
JobArr.push(GlobalConfig["转职第二职业"]);
JobArr.push(GlobalConfig["转职第三职业"]);
JobArr.push(GlobalConfig["转职第四职业"]);
JobArr.push(GlobalConfig["转职第五职业"]);
foreach(Index, arr in JobArr) {
foreach(ItemId in arr) {
if (Cb_Use_Item_Sp_Func.rawin(ItemId)) Cb_Use_Item_Sp_Func.rawdelete(ItemId);
}
}
//重新注册
_Dps_GeneralJobTransferCertificateForAllProfessions_Main_();
}
function _Dps_GeneralJobTransferCertificateForAllProfessions_Main_() {
local Config = GlobalConfig.Get("全职业通用转职书_Lenheart.json");
local JobArr = [];
JobArr.push(Config["转职初始职业"]);
JobArr.push(Config["转职第一职业"]);
JobArr.push(Config["转职第二职业"]);
JobArr.push(Config["转职第三职业"]);
JobArr.push(Config["转职第四职业"]);
JobArr.push(Config["转职第五职业"]);
foreach(Index, arr in JobArr) {
foreach(ItemId in arr) {
Cb_Use_Item_Sp_Func[ItemId] <- function(SUser, ItemId) {
SUser.ChangeGrowType(Index, 0);
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(0, 0);
}
}
}
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "副本需要持有道具进入",
"ProjectDescribe": "副本需要持有道具进入",
"ProjectAuthor": "凌众",
"ProjectVersion": 1.0,
"ProjectConfig": "副本需要持有道具进入_Lenheart.json",
"ProjectFiles": [
"副本需要持有道具进入.nut"
],
"ProjectRunFunc": "_Dps_MapNeedItem_Main_"
}

View File

@@ -1,38 +0,0 @@
function _Dps_MapNeedItem_Main_() {
// 禁止进入副本
Cb_SelectDungeon_Check_Error_Leave_Func.MapNeedItem <- function (args) {
local Config = GlobalConfig.Get("副本需要持有道具进入_Lenheart.json");
local body = Config["副本需要持有道具才允许进入"];
local SUser = User(args[1]);
local mapid = NativePointer(args[2]).add(13).readShort();
if(body.rawin(mapid.tostring())){
local ItemId = body[mapid.tostring()];
local PartyObj = SUser.GetParty();
if (!PartyObj) {
return;
}
for (local i = 0; i < 4; ++i) {
local PSUser = PartyObj.GetUser(i);
if (PSUser) {
local InvenObj = SUser.GetInven();
local SlotIdx = InvenObj.GetSlotById(ItemId);
if(SlotIdx == -1){
SUser.SendNotiBox(Config["公告"]+PvfItem.GetNameById(ItemId),1);
return 1; // 禁止进入副本
}
}
}
}
}
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "史诗免确认",
"ProjectDescribe": "史诗免确认",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.1,
"ProjectConfig": "",
"ProjectFiles": [
"史诗免确认.nut"
],
"ProjectRunFunc": "_Dps_EpicNoConfirmationRequired_Main_"
}

View File

@@ -1,7 +0,0 @@
function _Dps_EpicNoConfirmationRequired_Main_() {
NativePointer("0x085A56CE").add(2).writeU8(9);
Cb_CItem_IsRoutingItem_Leave_Func["DPSOFFICIAL"] <- function (args)
{
return 0
}
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "史诗掉落奖励",
"ProjectDescribe": "获取指定数量获得奖励以及指定道具获得奖励",
"ProjectAuthor": "南瓜",
"ProjectVersion": 1.1,
"ProjectConfig": "史诗掉落奖励配置_南瓜.json",
"ProjectFiles": [
"史诗掉落奖励.nut"
],
"ProjectRunFunc": "_Dps_SSDL_nangua_Main_"
}

View File

@@ -1,333 +0,0 @@
_SpecialItemBynangua <- {
"Rarity4": {},
"Rarity3": {},
"Rarity2": {}
}
function _Dps_SSDL_nangua_Main_() {
//进入副本
Cb_History_DungeonEnter_Func.RindroSSEnterByNangua <- function(SUser, Data) {
_SpecialItemBynangua.Rarity4.rawset(SUser.GetCID(), []);
_SpecialItemBynangua.Rarity3.rawset(SUser.GetCID(), []);
_SpecialItemBynangua.Rarity2.rawset(SUser.GetCID(), []);
}
//离开副本
Cb_History_DungeonLeave_Func.RindroSSLeaveByNangua <- function(SUser, Data) {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local PartyObj = SUser.GetParty();
if (!PartyObj) return;
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
if (DgnObj) {
local Dungeon_Name = DgnObj.GetName();
// 处理史诗装备
if (_SpecialItemBynangua.Rarity4.rawin(SUser.GetCID())) {
local ItemObjS = _SpecialItemBynangua.Rarity4[SUser.GetCID()];
if (ItemObjS != null && ItemObjS.len() > 0) {
local config = Cofig["奖励控制"]["多件SS对应奖励(史诗)"];
local key = ItemObjS.len().tostring();
if (config.rawin(key)) {
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得史诗装备");
foreach(ItemObj in ItemObjS) {
local item_id = ItemObj.GetIndex();
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
}
Nangua_SSMSG.SendCntMsg(ItemObjS.len());
Nangua_SSMSG.SendMiddle();
ProcessRewards(SUser, config[key]);
Nangua_SSMSG.EndMsg();
}
}
_SpecialItemBynangua.Rarity4.rawset(SUser.GetCID(), []);
}
// 处理神器装备
if (_SpecialItemBynangua.Rarity3.rawin(SUser.GetCID())) {
local ItemObjS = _SpecialItemBynangua.Rarity3[SUser.GetCID()];
if (ItemObjS != null && ItemObjS.len() > 0) {
local config = Cofig["奖励控制"]["多件神器对应奖励"];
local key = ItemObjS.len().tostring();
if (config.rawin(key)) {
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得神器装备");
foreach(ItemObj in ItemObjS) {
local item_id = ItemObj.GetIndex();
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
}
Nangua_SSMSG.SendCntMsg(ItemObjS.len());
Nangua_SSMSG.SendMiddle();
ProcessRewards(SUser, config[key]);
Nangua_SSMSG.EndMsg();
}
}
_SpecialItemBynangua.Rarity3.rawset(SUser.GetCID(), []);
}
// 处理稀有装备
if (_SpecialItemBynangua.Rarity2.rawin(SUser.GetCID())) {
local ItemObjS = _SpecialItemBynangua.Rarity2[SUser.GetCID()];
if (ItemObjS != null && ItemObjS.len() > 0) {
local config = Cofig["奖励控制"]["多件稀有对应奖励"];
local key = ItemObjS.len().tostring();
if (config.rawin(key)) {
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得稀有装备");
foreach(ItemObj in ItemObjS) {
local item_id = ItemObj.GetIndex();
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
}
Nangua_SSMSG.SendCntMsg(ItemObjS.len());
Nangua_SSMSG.SendMiddle();
ProcessRewards(SUser, config[key]);
Nangua_SSMSG.EndMsg();
}
}
_SpecialItemBynangua.Rarity2.rawset(SUser.GetCID(), []);
}
}
}
Cb_UserHistoryLog_ItemAdd_Enter_Func.ItemAddByNangua <- function(args) {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local SUser = User(NativePointer(args[0]).readPointer());
local InvenObj = SUser.GetInven();
local ItemObj = Item(args[4]);
local type = args[5];
local PartyObj = SUser.GetParty();
if (!PartyObj) return;
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
if (!DgnObj) return;
local Dungeon_Name = DgnObj.GetName();
if (!ItemObj) return;
local item_id = ItemObj.GetIndex();
local ItemType = Sq_CallFunc(S_Ptr("0x085018D2"), "int", ["pointer", "int"], InvenObj.C_Object, item_id);
local pvfitem = PvfItem.GetPvfItemById(item_id);
// 史诗装备记录
if (pvfitem.GetRarity() == 4 && type == 4 && ItemType == 1 && Cofig["奖励控制"]["多件史诗奖励控制开关"]) {
if (!_SpecialItemBynangua.Rarity4.rawin(SUser.GetCID())) {
_SpecialItemBynangua.Rarity4.rawset(SUser.GetCID(), []);
}
_SpecialItemBynangua.Rarity4[SUser.GetCID()].append(ItemObj);
}
// 神器装备记录
else if (pvfitem.GetRarity() == 3 && type == 4 && ItemType == 1 && Cofig["奖励控制"]["多件神器奖励控制开关"]) {
if (!_SpecialItemBynangua.Rarity3.rawin(SUser.GetCID())) {
_SpecialItemBynangua.Rarity3.rawset(SUser.GetCID(), []);
}
_SpecialItemBynangua.Rarity3[SUser.GetCID()].append(ItemObj);
}
// 稀有装备记录
else if (pvfitem.GetRarity() == 2 && type == 4 && ItemType == 1 && Cofig["奖励控制"]["多件稀有奖励控制开关"]) {
if (!_SpecialItemBynangua.Rarity2.rawin(SUser.GetCID())) {
_SpecialItemBynangua.Rarity2.rawset(SUser.GetCID(), []);
}
_SpecialItemBynangua.Rarity2[SUser.GetCID()].append(ItemObj);
}
// 指定道具奖励逻辑保持不变
if (!Cofig["指定道具奖励控制"]["指定道具奖励控制开关"]) return;
local Itemid = item_id.tostring();
if (Cofig["指定道具奖励控制"]["指定道具对应奖励"].rawin(Itemid) && type == 4) {
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得特定道具");
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
Nangua_SSMSG.SendMiddle();
ProcessRewards(SUser, Cofig["指定道具奖励控制"]["指定道具对应奖励"][Itemid]);
Nangua_SSMSG.EndMsg();
}
}
// 处理奖励逻辑
function ProcessRewards(SUser, rewards) {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local config = Cofig["信息播报"];
local totalRewards = [];
local rewardMessages = [];
// 遍历奖励列表
foreach(reward in rewards) {
local itemId = reward[0];
local itemCnt = reward[1];
if (itemId == 0) {
// 点券奖励
local ceraMsgObj = AdMsg();
ceraMsgObj.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
ceraMsgObj.PutString(" ");
}
ceraMsgObj.PutColorString("点券", config["内容颜色"]);
ceraMsgObj.PutColorString("[" + itemCnt + "]", [255, 20, 0]);
ceraMsgObj.Finalize();
World.SendAll(ceraMsgObj.MakePack());
ceraMsgObj.Delete();
SUser.RechargeCera(itemCnt);
} else {
totalRewards.append([itemId, itemCnt]);
local itemName = PvfItem.GetNameById(itemId);
local color = Nangua_SSMSG.RarityColor(itemId);
rewardMessages.append([itemName, itemCnt, color]);
}
}
Nangua_SSMSG.api_CUser_Add_Item_list(SUser, totalRewards);
// 发送奖励物品信息通知
if (rewardMessages.len() > 0) {
local rewardMsgObj = AdMsg();
rewardMsgObj.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
rewardMsgObj.PutString(" ");
}
foreach(message in rewardMessages) {
rewardMsgObj.PutColorString("[" + message[0] + "]", message[2]);
rewardMsgObj.PutColorString("<" + message[1] + ">", [255, 20, 0]);
rewardMsgObj.PutColorString("个", config["内容颜色"]);
}
rewardMsgObj.Finalize();
World.SendAll(rewardMsgObj.MakePack());
rewardMsgObj.Delete();
}
}
}
class Nangua_SSMSG {
function SendTitle(SUser, Dungeon_Name, msg) {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local config = Cofig["信息播报"];
local title = AdMsg();
title.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
title.PutString(" ");
}
title.PutColorString(config["标题"][0], config["标题"][1]);
title.PutColorString("恭喜玩家", config["内容颜色"]);
title.PutColorString("[" + SUser.GetCharacName() + "]", [255, 20, 0]);
title.PutColorString("在", config["内容颜色"]);
title.PutColorString("[" + Dungeon_Name + "]", [255, 20, 0]);
title.PutColorString("" + msg + "", config["内容颜色"]);
title.Finalize();
World.SendAll(title.MakePack());
title.Delete();
}
function SendMiddle() {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local config = Cofig["信息播报"];
local MiddleMsgObj = AdMsg();
MiddleMsgObj.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
MiddleMsgObj.PutString(" ");
}
MiddleMsgObj.PutColorString("特此奖励:", config["内容颜色"]);
MiddleMsgObj.Finalize();
World.SendAll(MiddleMsgObj.MakePack());
MiddleMsgObj.Delete();
}
function SendCntMsg(cnt) {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local config = Cofig["信息播报"];
local CntMsgObj = AdMsg();
CntMsgObj.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
CntMsgObj.PutString(" ");
}
CntMsgObj.PutColorString("合计", config["内容颜色"]);
CntMsgObj.PutColorString("[" + cnt + "]", [255, 20, 0]);
CntMsgObj.PutColorString("件装备", config["内容颜色"]);
CntMsgObj.Finalize();
World.SendAll(CntMsgObj.MakePack());
CntMsgObj.Delete();
}
function ItemMsg(item_id, ItemObj) {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local config = Cofig["信息播报"];
local MsgObj = AdMsg();
MsgObj.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
MsgObj.PutString(" ");
}
MsgObj.PutEquipment("[" + PvfItem.GetNameById(item_id) + "]", ItemObj, Nangua_SSMSG.RarityColor(item_id));
MsgObj.Finalize();
World.SendAll(MsgObj.MakePack());
MsgObj.Delete();
}
function EndMsg() {
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
local config = Cofig["信息播报"];
local endMsgObj = AdMsg();
endMsgObj.PutType(config["发送位置"]);
if (config["发送位置"] != 14) {
endMsgObj.PutString(" ");
}
endMsgObj.PutColorString(config["结尾"][0], config["结尾"][1]);
endMsgObj.Finalize();
World.SendAll(endMsgObj.MakePack());
endMsgObj.Delete();
}
function api_CUser_Add_Item_list(SUser, item_list) {
for (local i = 0; i < item_list.len(); i++) {
local item_id = item_list[i][0]; // 道具代码
local quantity = item_list[i][1]; // 道具数量
local cnt = Nangua_SSMSG.checkInventorySlot(SUser, item_id);
if (cnt == 1) {
SUser.GiveItem(item_id, quantity); //使用窗口发送奖励
} else {
local RewardItems = [];
RewardItems.append([item_id, quantity]);
local title = "GM"
local Text = "由于背包空间不足,已通过邮件发送,请查收!"
//角色类 发送邮件函数 (标题, 正文, 金币, 道具列表[[3037,100],[3038,100]])
SUser.ReqDBSendMultiMail(title, Text, 0, RewardItems)
}
}
Nangua_SSMSG.SendItemWindowNotification(SUser, item_list);
}
function SendItemWindowNotification(SUser, item_list) {
local Pack = Packet();
Pack.Put_Header(1, 163); //协议
Pack.Put_Byte(1); //默认1
Pack.Put_Short(0); //槽位id 填入0即可
Pack.Put_Int(0); //未知 0以上即可
Pack.Put_Short(item_list.len()); //道具组数
//写入道具代码和道具数量
for (local i = 0; i < item_list.len(); i++) {
Pack.Put_Int(item_list[i][0]); //道具代码
Pack.Put_Int(item_list[i][1]); //道具数量 装备/时装时 任意均可
}
Pack.Finalize(true); //确定发包内容
SUser.Send(Pack); //发包
Pack.Delete(); //清空buff区
}
/**
* 根据道具类型背包空格数量
* @param {pointer} SUser - 用户
* @param {int} item_id - 需要查找的道具ID
* @returns {int} - 空格数量
*/
function checkInventorySlot(SUser, itemid) {
local InvenObj = SUser.GetInven();
local type = Sq_CallFunc(S_Ptr("0x085018D2"), "int", ["pointer", "int"], InvenObj.C_Object, itemid);
local cnt = Sq_CallFunc(S_Ptr("0x08504F64"), "int", ["pointer", "int", "int"], InvenObj.C_Object, type, 1);
return cnt;
}
function RarityColor(item_id) {
local PvfItemObj = PvfItem.GetPvfItemById(item_id);
if (PvfItemObj == null) {
return;
}
local CItem_get_rarity = PvfItemObj.GetRarity(); // 装备品级
return Nangua_SSMSG.rarityColorMap[(CItem_get_rarity).tostring()];
}
//品级对应的RGB
rarityColorMap = {
"0": [255, 255, 255], // 普通
"1": [104, 213, 237], // 高级
"2": [179, 107, 255], // 稀有
"3": [255, 0, 255], // 神器
"4": [255, 180, 0], // 史诗
"5": [255, 102, 102], // 勇者
"6": [255, 20, 147], // 深粉红色
"7": [255, 215, 0] // 金色
};
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "史诗药剂",
"ProjectDescribe": "通过指定ID的道具使玩家获得爆率加成。",
"ProjectAuthor": "倾泪寒 & 南瓜",
"ProjectVersion": 1.4,
"ProjectConfig": "史诗药剂配置文件.json",
"ProjectFiles": [
"史诗药剂.nut"
],
"ProjectRunFunc": "_Dps_EpicPotion_Main_"
}

View File

@@ -1,42 +0,0 @@
/*
文件名:史诗药剂.nut
路径:MyProject/史诗药剂.nut
创建日期:2025-03-28 10:21
文件用途:史诗药剂
*/
//启动函数 自定义的需要写在ifo中
function _Dps_EpicPotion_Main_() {
//注册获取道具稀有度进入回调
Cb_GetItemRarity_Enter_Func["史诗药剂_逻辑"] <- function(args) {
local Cofig = GlobalConfig.Get("史诗药剂配置文件.json");
local Addr = NativePointer(args[0]);
local VectorSize = (Addr.add(4).readU32() - Addr.readU32()) / 4;
// 遍历队伍成员,找到使用了史诗药剂的玩家
local userWithPotion = null;
for (local i = 0; i< VectorSize; i++) {
local elementAddr = NativePointer(Addr.readPointer()).add(i * 4);
local user = elementAddr.readPointer();
if (user && Sq_CallFunc(S_Ptr("0x865E994"), "int", ["pointer", "int"], user, Cofig.EpicPotionID)) {
userWithPotion = User(user);
break;
}
}
if (userWithPotion && Haker.NextReturnAddress == "0x853583a") {
local partyobj = userWithPotion.GetParty();
// 检查是否单人
if (Sq_CallFunc(S_Ptr("0x0859A16A"), "int", ["pointer", ], partyobj.C_Object) == 1) {
local MaxRoll = NativePointer(args[1]).add(16).readU32();
local odds = Cofig.EpicPotionOdds; // 默认药剂的增加几率
// 检查是否VIP玩家
local charac_no = userWithPotion.GetCID();
if (Cofig.EpicPotionlist.rawin(charac_no)) {
odds = Cofig.EpicPotionlist[charac_no];
}
// 计算新的roll值
args[2] = MathClass.getMin(args[2] + args[2] * odds, MaxRoll);
}
}
return args;
}
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "屏蔽广告私聊和1v1聊天",
"ProjectDescribe": "屏蔽广告私聊和1v1聊天",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "屏蔽广告私聊和1v1聊天.json",
"ProjectFiles": [
"屏蔽广告私聊和1v1聊天.nut"
],
"ProjectRunFunc": "_Dps_BlockPrivateChatsWithSpecifiedConversationContent_Main_"
}

View File

@@ -1,32 +0,0 @@
/*
文件名:屏蔽指定对话内容的私聊和1v1聊天.nut
路径:OfficialProject/屏蔽指定对话内容的私聊和1v1聊天/屏蔽指定对话内容的私聊和1v1聊天.nut
创建日期:2025-04-19 19:17
文件用途:
*/
getroottable()._LenheartUserLoseEfficacyState_ <- Memory.alloc(577477);
Memory.reset(getroottable()._LenheartUserLoseEfficacyState_, 577477);
function _Dps_BlockPrivateChatsWithSpecifiedConversationContent_Main_() {
Cb_SendMess_Enter_Func["Rindro"] <- function(args) {
local PackCopyBuffer = Memory.alloc(10001);
Memory.copy(PackCopyBuffer, NativePointer(args[2]), 1000);
local Pack = Packet(PackCopyBuffer.C_Object);
local Type = Pack.GetByte();
if (Type == 1 || Type == 33) {
Pack.GetShort();
Pack.GetInt();
local StrLen = Pack.GetInt();
local SStr = Pack.GetString(256, StrLen);
local Str = SStr.readUtf8String();
local Conifg = GlobalConfig.Get("屏蔽广告私聊和1v1聊天.json");
foreach(substr in Conifg["屏蔽词"]) {
if (Str.find(substr) != null) {
args[1] = getroottable()._LenheartUserLoseEfficacyState_.C_Object;
return args;
}
}
}
}
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "异界重置",
"ProjectDescribe": "异界重置",
"ProjectAuthor": "凌众",
"ProjectVersion": 1.0,
"ProjectConfig": "异界重置_Lenheart.json",
"ProjectFiles": [
"异界重置.nut"
],
"ProjectRunFunc": "_Dps_MapReset_Main_"
}

View File

@@ -1,26 +0,0 @@
function _Dps_MapReset_Logic_() {
}
function _Dps_MapReset_Main_() {
local Config = GlobalConfig.Get("异界重置_Lenheart.json");
//异界重置
Cb_Use_Item_Sp_Func[Config["重置券id"]] <- function(SUser, ItemId) {
for (local i = 0; i< 6; i++) {
local dimensionInout = _Rindro_CDataManager_get_dimensionInout(Sq_CallFunc(S_Ptr("0x80CC19B"), "pointer"), i);
_Rindro_CUserCharacInfo_setDemensionInoutValue(SUser.C_Object, i, dimensionInout);
}
}
}
function _Rindro_CDataManager_get_dimensionInout(a, b) {
return Sq_CallFunc(S_Ptr("0x0822b612"), "int", ["pointer", "int"], a, b);
}
function _Rindro_CUserCharacInfo_setDemensionInoutValue(a, b, c) {
return Sq_CallFunc(S_Ptr("0x0822f184"), "int", ["pointer", "int", "int"], a, b, c);
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "整点在线奖励",
"ProjectDescribe": "可以设置某一个时间点 全服发放奖励",
"ProjectAuthor": "凌众",
"ProjectVersion": 1.2,
"ProjectConfig": "整点在线奖励_Lenheart.json",
"ProjectFiles": [
"整点在线奖励.nut"
],
"ProjectRunFunc": "_Dps_TimeReward_identifying_Main_"
}

View File

@@ -1,29 +0,0 @@
_TimeReward_identifying_Rindro_ <- 0;
function _Dps_TimeReward_identifying_Main_() {
Cb_timer_dispatch_Func.Time <- function() {
local Config = GlobalConfig.Get("整点在线奖励_Lenheart.json");
local DateObj = date();
local HourminTime = DateObj.hour + ":" + DateObj.min;
if (!(HourminTime in Config["奖励时间和内容"])) {
_TimeReward_identifying_Rindro_ = 0;
return;
}
if (_TimeReward_identifying_Rindro_ != 0) {
return;
}
_TimeReward_identifying_Rindro_ = 1;
local reward = Config["奖励时间和内容"][HourminTime];
local users = World.GetOnlinePlayer();
users.apply(function(SUser) {
foreach(itemR in reward) {
SUser.GiveItem(itemR[0], itemR[1]);
}
});
World.SendNotiPacketMessage(format(Config["公告"], HourminTime), 14);
};
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "时装与宠物清除卷",
"ProjectDescribe": "通过指定ID的道具将装备背包第前两行的时装或宠物清除。",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.2,
"ProjectConfig": "时装与宠物清除卷_Lenheart.json",
"ProjectFiles": [
"时装与宠物清除卷.nut"
],
"ProjectRunFunc": "_Dps_FashionAndPetClearanceRoll_Main_"
}

View File

@@ -1,76 +0,0 @@
/*
文件名:时装与宠物清除卷.nut
路径:OfficialProject/时装与宠物清除卷/时装与宠物清除卷.nut
创建日期:2025-04-01 21:42
文件用途:
*/
function _Dps_FashionAndPetClearanceRoll_Logic_() {
local Config = GlobalConfig.Get("时装与宠物清除卷_Lenheart.json");
local PoolObj = MysqlPool.GetInstance();
local Ip = Config["数据库IP 不是外置数据库不要更改"];
local Port = Config["数据库端口 不懂不要更改"];
local DbName = Config["数据库用户名 本地用户名不懂不要更改"];
local Password = Config["数据库密码 本地密码不懂不要更改"];
//设置数据库连接信息
PoolObj.SetBaseConfiguration(Ip, Port, DbName, Password);
//连接池大小
PoolObj.PoolSize = 10;
//初始化
PoolObj.Init();
//宠物删除
Cb_Use_Item_Sp_Func[Config["宠物清除卷ID"]] <- function(SUser, ItemId) {
if (Config["宠物清除券是否返还"]) SUser.GiveItem(ItemId, 1);
local Cid = SUser.GetCID();
local InvenObj = SUser.GetInven();
if (InvenObj) {
for (local i = 0; i <= 13; i++) {
local ItemObj = InvenObj.GetSlot(3, i);
local Flag = false;
if (ItemObj) {
ItemObj.Delete();
}
}
local Sql = "delete from taiwan_cain_2nd.creature_items where charac_no=" + Cid + " and slot < 13 ;";
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Exec_Sql(Sql);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
SUser.SendItemSpace(7);
SUser.SendNotiPacketMessage(Config["宠物清除完成提示"], 8);
}
}
//时装删除
Cb_Use_Item_Sp_Func[Config["时装清除卷ID"]] <- function(SUser, ItemId) {
if (Config["时装清除券是否返还"]) SUser.GiveItem(ItemId, 1);
local Cid = SUser.GetCID();
local InvenObj = SUser.GetInven();
if (InvenObj) {
for (local i = 0; i <= 13; i++) {
local ItemObj = InvenObj.GetSlot(2, i);
if (ItemObj) {
ItemObj.Delete();
}
}
local Sql = "delete from taiwan_cain_2nd.user_items where charac_no=" + Cid + " and slot >= 10 and slot <= 23";
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Exec_Sql(Sql);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
SUser.SendItemSpace(1);
SUser.SendNotiPacketMessage(Config["时装清除完成提示"], 8);
}
}
}
function _Dps_FashionAndPetClearanceRoll_Main_() {
_Dps_FashionAndPetClearanceRoll_Logic_();
}
function _Dps_FashionAndPetClearanceRoll_Main_Reload_(OldConfig) {
Cb_Use_Item_Sp_Func.rawdelete(OldConfig["宠物清除卷ID"]);
Cb_Use_Item_Sp_Func.rawdelete(OldConfig["时装清除卷ID"]);
_Dps_FashionAndPetClearanceRoll_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "是否允许创建缔造者",
"ProjectDescribe": "是否允许创建缔造者.",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "是否允许创建缔造者_Lenheart.json",
"ProjectFiles": [
"是否允许创建缔造者.nut"
],
"ProjectRunFunc": "_Dps_EnableTheCreationOfCreators_Main_"
}

View File

@@ -1,16 +0,0 @@
function _Dps_EnableTheCreationOfCreators_Logic_()
{
local Config = GlobalConfig.Get("是否允许创建缔造者_Lenheart.json");
Sq_WriteByteArr(S_Ptr("0x81C029F"), Config["是否允许创建"] ? [0xF] : [0xA]);
}
function _Dps_EnableTheCreationOfCreators_Main_()
{
GameManager.OpenCreateJob_CreatorMage();
}
function _Dps_EnableTheCreationOfCreators_Main_Reload_(OldConfig)
{
GameManager.OpenCreateJob_CreatorMage();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "月光定制收集图鉴",
"ProjectDescribe": "月光定制收集图鉴",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "月光定制收集图鉴.json",
"ProjectFiles": [
"月光定制收集图鉴.nut"
],
"ProjectRunFunc": "_Dps_MoonlightCustomizedCollectionCatalog_Main_"
}

View File

@@ -1,70 +0,0 @@
/*
文件名:月光定制收集图鉴.nut
路径:OfficialProject/月光定制收集图鉴/月光定制收集图鉴.nut
创建日期:2025-04-20 11:38
文件用途:
*/
getroottable()._MoonlightCustomizedCollectionCatalogMysql_ <- null;
function InitMysql() {
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) {
local Config = GlobalConfig.Get("装备镶嵌与时装镶嵌_Lenheart.json");
local Ip = Config["数据库IP 不是外置数据库不要更改"];
local Port = Config["数据库端口 不懂不要更改"];
local DbName = Config["数据库用户名 本地用户名不懂不要更改"];
local Password = Config["数据库密码 本地密码不懂不要更改"];
getroottable()._MoonlightCustomizedCollectionCatalogMysql_ = Mysql(Str_Ptr(Ip), Port, Str_Ptr("taiwan_cain"), Str_Ptr(DbName), Str_Ptr(Password));
}
}
function _Moonlight_collect_check(id) {
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) return;
local SqlObj = getroottable()._MoonlightCustomizedCollectionCatalogMysql_;
local CheckSql = "select id from `collect`.`s_item` where id = " + id + ";";
local Ret = SqlObj.Select(CheckSql, ["int"]);
if (Ret.len()< 1 || Ret[0][0] == null) {
return false;
} else {
return Ret[0][0];
}
}
function _Moonlight_collect_check_has(uid, item) {
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) return;
local SqlObj = getroottable()._MoonlightCustomizedCollectionCatalogMysql_;
local CheckSql = "select num from `collect`.`g_user_item` where uid = " + uid + " and item = " + item + ";";
local Ret = SqlObj.Select(CheckSql, ["int"]);
if (Ret.len()< 1 || Ret[0][0] == null) {
return false;
} else {
return Ret[0][0];
}
}
function _Moonlight_collect_update(uid, item, type, num) {
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) return;
local SqlObj = getroottable()._MoonlightCustomizedCollectionCatalogMysql_;
local CheckSql = "select id,num from `collect`.`g_user_item` where uid = " + uid + " and item = " + item + ";";
local Ret = SqlObj.Select(CheckSql, ["int", "int"]);
if (Ret.len()< 1 || Ret[0][0] == null) {
local InsertSql = "INSERT INTO `collect`.`g_user_item`(`uid`,`item`,`type`,`num`) VALUES(" + uid + "," + item + "," + type + "," + num + ");";
SqlObj.Exec_Sql(InsertSql);
} else {
local id = Ret[0][0]
local num = Ret[0][1];
local UpdateSql = "update `collect`.`g_user_item` set num = ' + num + ' where id = ' + id + ';";
SqlObj.Exec_Sql(UpdateSql);
}
}
function _Moonlight_collect_equ(user,slot)
{
// local inven =
}
function _Dps_MoonlightCustomizedCollectionCatalog_Main_() {
InitMysql();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "装备镶嵌与时装镶嵌",
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可\n如果你是0627的客户端版本还需要安装群内的 \"0627装备镶嵌.dll\" 插件",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.2,
"ProjectConfig": "装备镶嵌与时装镶嵌_Lenheart.json",
"ProjectFiles": [
"装备镶嵌与时装镶嵌.nut"
],
"ProjectRunFunc": "_Dps_Equ2AvaJewel_Main_"
}

View File

@@ -1,590 +0,0 @@
class EquimentUseJewel {
ExecUser = null;
//建库建表
function CreateMysqlTable() {
local CreateSql1 = "create database if not exists l_equ_jewel default charset utf8;"
local CreateSql2 = "CREATE TABLE l_equ_jewel.equipment ( equ_id int(11) AUTO_INCREMENT, jewel_data blob NOT NULL,andonglishanbai_flag int(11),date VARCHAR(255), PRIMARY KEY (equ_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8,AUTO_INCREMENT = 150;"
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Exec_Sql(CreateSql1);
SqlObj.Exec_Sql(CreateSql2);
MysqlPool.GetInstance().PutConnect(SqlObj);
}
function api_get_jewel_socket_data(id) { //获取徽章数据,存在返回徽章数据,不存在返回空字节数据
local CheckSql = "SELECT jewel_data FROM l_equ_jewel.equipment where equ_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["binary"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
//没结婚要返回false
if (Ret.len()< 1 || Ret[0][0] == null) {
return 0;
} else {
return Ret[0][0];
}
}
function api_exitjeweldata(id) { //0代表不存在,存在返回1
local CheckSql = "SELECT andonglishanbai_flag FROM l_equ_jewel.equipment where equ_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["int"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
//没结婚要返回false
if (Ret.len()< 1 || Ret[0][0] == null) {
return 0;
} else {
return Ret[0][0];
}
}
function save_equiment_socket(socket_data, id) { //0代表不存在,存在返回1
local CheckSql = "UPDATE l_equ_jewel.equipment SET jewel_data = 0x" + socket_data + " WHERE equ_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["int"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
//没结婚要返回false
if (Ret.len()< 1 || Ret[0][0] == null) {
return false;
} else {
return true;
}
}
function CUser_SendCmdErrorPacket(SUser, id, id2) {
local Pack = Packet();
Pack.Put_Header(1, id);
Pack.Put_Byte(0);
Pack.Put_Byte(id2);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
function api_PacketBuf_get_buf(packet_buf) {
return NativePointer(NativePointer(packet_buf).add(20).readPointer()).add(13);
}
function add_equiment_socket(equipment_type) { //0代表开孔失败 成功返回标识
/*
武器10
称号11
上衣12
头肩13
下衣14
鞋子15
腰带16
项链17
手镯18
戒指19
辅助装备20
魔法石21
*/
/*
红色:'010000000000010000000000000000000000000000000000000000000000' A
黄色:'020000000000020000000000000000000000000000000000000000000000' B
绿色:'040000000000040000000000000000000000000000000000000000000000' C
蓝色:'080000000000080000000000000000000000000000000000000000000000' D
白金:'100000000000100000000000000000000000000000000000000000000000'
*/
local DB_JewelsocketData = "";
switch (equipment_type) {
case 10: //武器10 SS
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
case 11: //称号11 SS
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
case 12: //上衣12 C
DB_JewelsocketData = "040000000000040000000000000000000000000000000000000000000000"
break;
case 13: //头肩13 B
DB_JewelsocketData = "020000000000020000000000000000000000000000000000000000000000"
break;
case 14: //下衣14 C
DB_JewelsocketData = "040000000000040000000000000000000000000000000000000000000000"
break;
case 15: //鞋子15 D
DB_JewelsocketData = "080000000000080000000000000000000000000000000000000000000000"
break;
case 16: //腰带16 A
DB_JewelsocketData = "010000000000010000000000000000000000000000000000000000000000"
break;
case 17: //项链17 B
DB_JewelsocketData = "020000000000020000000000000000000000000000000000000000000000"
break;
case 18: //手镯18 D
DB_JewelsocketData = "080000000000080000000000000000000000000000000000000000000000"
break;
case 19: //戒指19 A
DB_JewelsocketData = "010000000000010000000000000000000000000000000000000000000000"
break;
case 20: //辅助装备20 S
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
case 21: //魔法石21 S
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
default:
DB_JewelsocketData = "000000000000000000000000000000000000000000000000000000000000"
break;
}
local date = time();
local Ct = Sq_GetTimestampString();
date = date.tostring() + Ct;
local CheckSql = "INSERT INTO l_equ_jewel.equipment (andonglishanbai_flag,jewel_data,date) VALUES(1,0x" + DB_JewelsocketData + ",\'" + date + "\');";
local CheckSql1 = "SELECT equ_id FROM l_equ_jewel.equipment where date = \'" + date + "\';";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Select(CheckSql, ["int"]);
local Ret = SqlObj.Select(CheckSql1, ["int"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
if (Ret.len()< 1 || Ret[0][0] == null) {
return 0;
} else {
return Ret[0][0];
}
return 0;
}
function CStackableItem_getJewelTargetSocket(C_Object) {
return Sq_CallFunc(S_Ptr("0x0822CA28"), "int", ["pointer"], C_Object);
}
function CUser_SendUpdateItemList_DB(SUser, Slot, DB_JewelSocketData) {
local Pack = Packet();
Pack.Put_Header(0, 14);
Pack.Put_Byte(0);
Pack.Put_Short(1);
local InvenObj = SUser.GetInven();
Sq_CallFunc(S_Ptr("0x084FC6BC"), "int", ["pointer", "int", "int", "pointer"], InvenObj.C_Object, 1, Slot, Pack.C_Object);
Pack.Put_BinaryEx(DB_JewelSocketData.C_Object, 30);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
function GetByte(value) {
local Blob = blob();
Blob.writen(value, 'w');
return Blob;
}
function intToHex(num) {
if (num == 0) {
return "0";
}
local hexDigits = "0123456789abcdef";
local hexString = "";
while (num > 0) {
local remainder = num % 16;
hexString = hexDigits[remainder] + hexString;
num = (num / 16).tointeger();
}
return hexString;
}
function lengthCutting(str, ystr, num, maxLength) {
// 如果字符串长度小于最大长度在前面补0
local lengthDiff = maxLength - str.len();
if (lengthDiff > 0) {
local zeroPadding = "";
for (local i = 0; i< lengthDiff; i++) {
zeroPadding += "0";
}
str = zeroPadding + str;
}
local strArr = "";
for (local i = 0; i< str.len(); i += num) {
local endIndex = i + num;
if (endIndex > str.len()) {
endIndex = str.len();
}
strArr += str.slice(i, endIndex);
}
return ystr + strArr;
}
function HackAddSocketToAvatarLogic(Flag) {
if (Flag) {
Sq_WriteByteArr(S_Ptr("821A449"), [0x90, 0x90]);
Sq_WriteByteArr(S_Ptr("0x821A44B"), array(36, 0x90));
} else {
Sq_WriteByteArr(S_Ptr("821A449"), [0x74, 0x2B]);
}
}
function FixFunction() {
//称号回包
Cb_CTitleBook_putItemData_Leave_Func.EquimentUseJewel <- function(args) {
local JewelSocketData = api_get_jewel_socket_data(NativePointer(args[3]).add(25).readU32());
local ret = args.pop();
if (JewelSocketData && NativePointer(JewelSocketData).add(0).readU8() != 0) {
local Pack = Packet(args[1]);
Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
}
return null;
}.bindenv(this);
//设计图继承
Cb_CUsercopyItemOption_Enter_Func.EquimentUseJewel <- function(args) {
local jewelSocketID = NativePointer(args[2]).add(25).readU32();
NativePointer(args[1]).add(25).writeU32(jewelSocketID);
return null;
}.bindenv(this);
//装备开孔
Cb_AddSocketToAvatar_Enter_Func.EquimentUseJewel <- function(args) {
local SUser = User(args[1]);
local PackCopyBuffer = Memory.alloc(10001);
Memory.copy(PackCopyBuffer, NativePointer(args[2]), 1000);
local Pack = Packet(PackCopyBuffer.C_Object);
local equ_slot = Pack.GetShort();
local equitem_id = Pack.GetInt();
local sta_slot = Pack.GetShort();
local CurCharacInvenW = SUser.GetInven();
local inven_item = CurCharacInvenW.GetSlot(1, equ_slot);
if (equ_slot > 56) { //修改后大于56则是时装装备 原:如果不是装备文件就调用原逻辑
equ_slot = equ_slot - 57;
local C_PacketBuf = api_PacketBuf_get_buf(args[2]) //获取原始封包数据
C_PacketBuf.add(0).writeShort(equ_slot) //修改掉装备位置信息 时装类镶嵌从57开始。
//执行原逻辑
return null;
}
//如果已开启镶嵌槽则不执行
local equ_id = NativePointer(inven_item.C_Object).add(25).readU32();
if (api_exitjeweldata(equ_id)) {
CUser_SendCmdErrorPacket(SUser, 209, 19);
HackAddSocketToAvatarLogic(true);
return null;
}
local item = PvfItem.GetPvfItemById(equitem_id);
local ItemType = Sq_CallFunc(S_Ptr("0x08514D26"), "int", ["pointer"], item.C_Object);
if (ItemType == 10) {
SUser.SendNotiBox("装备为武器类型,不支持打孔!", 1)
CUser_SendCmdErrorPacket(SUser, 209, 0);
HackAddSocketToAvatarLogic(true);
return null;
} else if (ItemType == 11) {
SUser.SendNotiBox("装备为称号类型,不支持打孔!", 1)
CUser_SendCmdErrorPacket(SUser, 209, 0);
HackAddSocketToAvatarLogic(true);
return null;
}
local id = add_equiment_socket(ItemType);
Sq_Inven_RemoveItemFormCount(CurCharacInvenW.C_Object, 1, sta_slot, 1, 8, 1); //删除打孔道具
NativePointer(inven_item.C_Object).add(25).writeU32(id) //写入槽位标识
SUser.SendUpdateItemList(1, 0, equ_slot);
local JewelSocketData = api_get_jewel_socket_data(id);
CUser_SendUpdateItemList_DB(SUser, equ_slot, JewelSocketData); //用于更新镶嵌后的装备显示,这里用的是带镶嵌数据的更新背包函数,并非CUser_SendUpdateItemList
local Pack = Packet();
Pack.Put_Header(1, 209);
Pack.Put_Byte(1);
Pack.Put_Short(equ_slot + 104);
Pack.Put_Short(sta_slot);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
HackAddSocketToAvatarLogic(true);
return null;
}.bindenv(this);
Cb_AddSocketToAvatar_Leave_Func.EquimentUseJewel <- function(args) {
HackAddSocketToAvatarLogic(false);
return null;
}.bindenv(this);
//装备镶嵌和时装镶嵌
Cb_Dispatcher_UseJewel_Enter_Func.EquimentUseJewel <- function(args) {
local SUser = User(args[1]);
local Pack = Packet(args[2]);
local PackIndex = NativePointer(args[2]).add(4).readInt();
local State = SUser.GetState();
if (State != 3) return null;
local avartar_inven_slot = Pack.GetShort();
local avartar_item_id = Pack.GetInt();
local emblem_cnt = Pack.GetByte();
//下面是参照原时装镶嵌的思路写的。个别点标记出来。
if (avartar_inven_slot > 104) {
local equipment_inven_slot = avartar_inven_slot - 104; //取出真实装备所在背包位置值
local Inven = SUser.GetInven();
local equipment = Inven.GetSlot(1, equipment_inven_slot);
//校验是否合法
if (!equipment || equipment.IsEmpty || (equipment.GetIndex() != avartar_item_id) || SUser.CheckItemLock(1, equipment_inven_slot)) return;
local id = NativePointer(equipment.C_Object).add(25).readU32();
local JewelSocketData = api_get_jewel_socket_data(id);
if (!JewelSocketData) return;
local emblems = {};
if (emblem_cnt <= 3) {
for (local i = 0; i< emblem_cnt; i++) {
local emblem_inven_slot = Pack.GetShort();
local emblem_item_id = Pack.GetInt();
local equipment_socket_slot = Pack.GetByte();
local emblem = Inven.GetSlot(1, emblem_inven_slot);
//校验徽章及插槽数据是否合法
if (!emblem || emblem.IsEmpty || (emblem.GetIndex() != emblem_item_id) || (equipment_socket_slot >= 3)) return;
//校验徽章是否满足时装插槽颜色要求
//获取徽章pvf数据
local citem = PvfItem.GetPvfItemById(emblem_item_id);
if (!citem) return;
//校验徽章类型
if (!citem.IsStackable() || citem.GetItemType() != 20) return;
//获取徽章支持的插槽
local emblem_socket_type = CStackableItem_getJewelTargetSocket(citem.C_Object);
//获取要镶嵌的时装插槽类型
local avartar_socket_type = JewelSocketData.add(equipment_socket_slot * 6).readShort();
if (!(emblem_socket_type & avartar_socket_type)) {
return;
}
emblems[equipment_socket_slot] <- [emblem_inven_slot, emblem_item_id];
}
}
foreach(equipment_socket_slot, emblemObject in emblems) {
//删除徽章
local emblem_inven_slot = emblemObject[0];
Sq_Inven_RemoveItemFormCount(Inven.C_Object, 1, emblem_inven_slot, 1, 8, 1); //删除打孔道具
//设置时装插槽数据
local emblem_item_id = emblemObject[1];
JewelSocketData.add(2 + 6 * equipment_socket_slot).writeU32(emblem_item_id);
}
local Buf = Sq_Point2Blob(JewelSocketData.C_Object, 30);
local Str = "";
foreach(Value in Buf) {
Str += format("%02X", Value);
}
save_equiment_socket(Str, id);
// if (!save_equiment_socket(DB_JewelSocketData, id)) {
// print("写入失败了");
// return null;
// }
CUser_SendUpdateItemList_DB(SUser, equipment_inven_slot, JewelSocketData); //用于更新镶嵌后的装备显示,这里用的是带镶嵌数据的更新背包函数,并非CUser_SendUpdateItemList
local Pack = Packet();
Pack.Put_Header(1, 209);
Pack.Put_Byte(1);
Pack.Put_Short(equipment_inven_slot + 104);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
return;
}
AvatarLogic(args, PackIndex);
return null;
}.bindenv(this);
Cb_Dispatcher_UseJewel_Leave_Func.EquimentUseJewel <- function(args) {
return -1;
}.bindenv(this);
//额外数据包,发送装备镶嵌数据给本地处理
Cb_InterfacePacketBuf_put_packet_Leave_Func.EquimentUseJewel <- function(args) {
local ret = args.pop();
local Inven_Item = NativePointer(args[1]);
if (Inven_Item.add(1).readU8() == 1) {
local ItemObj = Item(args[1]);
local JewelSocketData = api_get_jewel_socket_data(NativePointer(ItemObj.C_Object).add(25).readU32());
if (JewelSocketData && JewelSocketData.add(0).readU8() != 0) {
local Pack = Packet(args[0]);
Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
}
}
return null;
}.bindenv(this);
L_HookEquimentUseJewel();
}
function WongWork_CAvatarItemMgr_getJewelSocketData(a, b) {
return Sq_CallFunc(S_Ptr("0x82F98F8"), "pointer", ["pointer", "int"], a, b);
}
function CStackableItem_getJewelTargetSocket(C_Object) {
return Sq_CallFunc(S_Ptr("0x0822CA28"), "int", ["pointer"], C_Object);
}
function CInventory_delete_item(C_Object, Type, Slot, Count, Ps, Log) {
return Sq_CallFunc(S_Ptr("0x850400C"), "int", ["pointer", "int", "int", "int", "int", "int"], C_Object, Type, Slot, Count, Ps, Log);
}
function api_set_JewelSocketData(jewelSocketData, slot, emblem_item_id) {
if (jewelSocketData) {
NativePointer(jewelSocketData).add(slot * 6 + 2).writeInt(emblem_item_id);
}
}
function DB_UpdateAvatarJewelSlot_makeRequest(a, b, c) {
return Sq_CallFunc(S_Ptr("0x843081C"), "pointer", ["int", "int", "pointer"], a, b, c);
}
//获取时装在数据库中的uid
function api_get_avartar_ui_id(avartar) {
return NativePointer(avartar).add(7).readInt();
}
function AvatarLogic(args, PackIndex) {
//角色
local SUser = User(args[1]);
//包数据
local Pack = Packet(args[2]);
//还原包读取数据号位
NativePointer(args[2]).add(4).writeInt(PackIndex);
//校验角色状态是否允许镶嵌
if (!SUser || SUser.GetState() != 3) {
return;
}
//时装所在的背包槽
local Inven_Slot = Pack.GetShort();
//时装item_id
local Item_Id = Pack.GetInt();
//本次镶嵌徽章数量
local Emblem_Count = Pack.GetByte();
//获取时装道具
local InvemObj = SUser.GetInven();
local AvatarObj = InvemObj.GetSlot(2, Inven_Slot);
//校验时装 数据是否合法
if (!AvatarObj || AvatarObj.IsEmpty || (AvatarObj.GetIndex() != Item_Id) || SUser.CheckItemLock(2, Inven_Slot)) return;
local Avartar_AddInfo = AvatarObj.GetAdd_Info();
//获取时装管理器
local Inven_AvartarMgr = InvemObj.GetAvatarItemMgr();
//获取时装插槽数据
local Jewel_Socket_Data = WongWork_CAvatarItemMgr_getJewelSocketData(Inven_AvartarMgr, Avartar_AddInfo);
if (!Jewel_Socket_Data) return;
//最多只支持3个插槽
if (Emblem_Count <= 3) {
local emblems = {};
for (local i = 0; i< Emblem_Count; i++) {
//徽章所在的背包槽
local emblem_inven_slot = Pack.GetShort();
//徽章item_id
local emblem_item_id = Pack.GetInt();
//该徽章镶嵌的时装插槽id
local avartar_socket_slot = Pack.GetByte();
//获取徽章道具
local EmblemObje = InvemObj.GetSlot(1, emblem_inven_slot);
//校验徽章及插槽数据是否合法
if (!EmblemObje || EmblemObje.IsEmpty || (EmblemObje.GetIndex() != emblem_item_id) || (avartar_socket_slot >= 3)) return;
//校验徽章是否满足时装插槽颜色要求
//获取徽章pvf数据
local citem = PvfItem.GetPvfItemById(emblem_item_id);
if (!citem) return;
//校验徽章类型
if (!citem.IsStackable() || citem.GetItemType() != 20) return;
//获取徽章支持的插槽
local emblem_socket_type = CStackableItem_getJewelTargetSocket(citem.C_Object);
//获取要镶嵌的时装插槽类型
local avartar_socket_type = NativePointer(Jewel_Socket_Data).add(avartar_socket_slot * 6).readShort();
if (!(emblem_socket_type & avartar_socket_type)) return;
emblems[avartar_socket_slot] <- [emblem_inven_slot, emblem_item_id];
}
//开始镶嵌
foreach(avartar_socket_slot, emblemObject in emblems) {
//删除徽章
local emblem_inven_slot = emblemObject[0];
CInventory_delete_item(InvemObj.C_Object, 1, emblem_inven_slot, 1, 8, 1);
//设置时装插槽数据
local emblem_item_id = emblemObject[1];
api_set_JewelSocketData(Jewel_Socket_Data, avartar_socket_slot, emblem_item_id);
}
//时装插槽数据存档
DB_UpdateAvatarJewelSlot_makeRequest(SUser.GetCID(), api_get_avartar_ui_id(AvatarObj.C_Object), Jewel_Socket_Data);
//通知客户端时装数据已更新
SUser.SendUpdateItemList(1, 1, Inven_Slot);
//回包给客户端
local Pack = Packet();
Pack.Put_Header(1, 204);
Pack.Put_Int(1);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
return null;
}
constructor() {
CreateMysqlTable();
FixFunction();
}
}
function _Dps_Equ2AvaJewel_Main_() {
local Config = GlobalConfig.Get("装备镶嵌与时装镶嵌_Lenheart.json");
local PoolObj = MysqlPool.GetInstance();
local Ip = Config["数据库IP 不是外置数据库不要更改"];
local Port = Config["数据库端口 不懂不要更改"];
local DbName = Config["数据库用户名 本地用户名不懂不要更改"];
local Password = Config["数据库密码 本地密码不懂不要更改"];
//设置数据库连接信息
PoolObj.SetBaseConfiguration(Ip, Port, DbName, Password);
//连接池大小
PoolObj.PoolSize = 10;
//初始化
PoolObj.Init();
//装备镶嵌修复
getroottable()._EquimentUseJewel_Object <- EquimentUseJewel();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "角色初始武器修改",
"ProjectDescribe": "修改黑暗武士和缔造的初始武器",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.1,
"ProjectConfig": "角色初始武器修改_Lenheart.json",
"ProjectFiles": [
"角色初始武器修改.nut"
],
"ProjectRunFunc": "_Dps_SetInitiaweapon_Main_"
}

View File

@@ -1,13 +0,0 @@
function _Dps_SetInitiaweapon_Logic_() {
local Config = GlobalConfig.Get("角色初始武器修改_Lenheart.json");
NativePointer("0x081C0CB2").writeInt(Config["黑暗武士武器"].tointeger());
NativePointer("0x081C0CBB").writeInt(Config["缔造武器"].tointeger());
}
function _Dps_SetInitiaweapon_Main_() {
_Dps_SetInitiaweapon_Logic_();
}
function _Dps_SetInitiaweapon_Main_Reload_(OldConfig) {
_Dps_SetInitiaweapon_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "设置服务器等级上限",
"ProjectDescribe": "设置服务器等级上限",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "设置服务器等级上限_Lenheart.json",
"ProjectFiles": [
"设置服务器等级上限.nut"
],
"ProjectRunFunc": "_Dps_SetGameMaxLevel_Main_"
}

View File

@@ -1,12 +0,0 @@
function _Dps_SetGameMaxLevel_Logic_() {
local Config = GlobalConfig.Get("设置服务器等级上限_Lenheart.json");
GameManager.SetGameMaxLevel(Config["等级上限"]);
}
function _Dps_SetGameMaxLevel_Main_() {
_Dps_SetGameMaxLevel_Logic_();
}
function _Dps_SetGameMaxLevel_Main_Reload() {
_Dps_SetGameMaxLevel_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "设置装备解锁时间",
"ProjectDescribe": "设置装备的解锁时间",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.1,
"ProjectConfig": "设置装备解锁时间_Lenheart.json",
"ProjectFiles": [
"设置装备解锁时间.nut"
],
"ProjectRunFunc": "_Dps_SetEquipmentUnlockTime_Main_"
}

View File

@@ -1,12 +0,0 @@
function _Dps_SetEquipmentUnlockTime_Logic_() {
local Config = GlobalConfig.Get("设置装备解锁时间_Lenheart.json");
GameManager.SetItemLockTime(Config["设置装备解锁需要的冷却时间_单位秒"]);
}
function _Dps_SetEquipmentUnlockTime_Main_() {
_Dps_SetEquipmentUnlockTime_Logic_();
}
function _Dps_SetEquipmentUnlockTime_Main_Reload(OldConfig) {
_Dps_SetEquipmentUnlockTime_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "跨界石",
"ProjectDescribe": "通过指定ID的道具将装备背包第一格的装备跨界。\n配置中修改CrossoverId可修改跨界石的ID 修改NoCrossIdArr可增加不可跨界的ID。",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.3,
"ProjectConfig": "跨界石_Lenheart.json",
"ProjectFiles": [
"跨界石.nut"
],
"ProjectRunFunc": "_Dps_CrossBorderStones_Main_"
}

View File

@@ -1,80 +0,0 @@
function _Dps_CrossBorderStones_Logic_()
{
local Cofig = GlobalConfig.Get("跨界石_Lenheart.json");
Cb_Use_Item_Sp_Func[Cofig.CrossoverId.tointeger()] <- function(SUser, ItemId) {
local Cofig = GlobalConfig.Get("跨界石_Lenheart.json");
//获取账号金库对象
local CargoObj = SUser.GetAccountCargo();
//获取账号金库中的一个空格子
local EmptySlot = CargoObj.GetEmptySlot();
//如果没有空格子
if (EmptySlot == -1) {
SUser.SendNotiPacketMessage(Cofig.CrossoverStr2, 8);
//不扣除道具
SUser.GiveItem(ItemId, 1);
return;
}
//获取角色背包
local InvenObj = SUser.GetInven();
//获取需要转移的装备 这里默认写的装备栏第一个格子
local ItemObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 9);
//获取装备ID
local EquipId = ItemObj.GetIndex();
//获取装备名字
local ItemName = PvfItem.GetNameById(EquipId);
//获取配置中不可跨界的ID数组
local NoCrossId = Cofig.NoCrossIdArr;
//如果这个装备不可跨界
if (NoCrossId.find(EquipId) != null) {
SUser.SendNotiPacketMessage(format(Cofig.CrossoverStr5, ItemName), 7);
//不扣除道具
SUser.GiveItem(ItemId, 1);
return;
}
//如果没找到这个格子的装备
if (!ItemName) {
SUser.SendNotiPacketMessage(Cofig.CrossoverStr1, 8);
//不扣除道具
SUser.GiveItem(ItemId, 1);
return;
}
//跨界
local Flag = CargoObj.InsertItem(ItemObj, EmptySlot);
if (Flag == -1) {
SUser.SendNotiPacketMessage(Cofig.CrossoverStr3, 8);
//不扣除道具
SUser.GiveItem(ItemId, 1);
} else {
//销毁背包中的道具
ItemObj.Delete();
//刷新玩家背包列表
SUser.SendUpdateItemList(1, 0, 9);
//刷新账号金库列表
CargoObj.SendItemList();
SUser.SendNotiPacketMessage(format(Cofig.CrossoverStr4, ItemName), 7);
}
}
}
//加载入口
function _Dps_CrossBorderStones_Main_() {
_Dps_CrossBorderStones_Logic_();
}
//重载入口
function _Dps_CrossBorderStones_Main_Reload_(OldConfig) {
//先销毁原来注册的
Cb_Use_Item_Sp_Func.rawdelete(OldConfig.CrossoverId.tointeger());
//重新注册
_Dps_CrossBorderStones_Logic_();
}

View File

@@ -1,11 +0,0 @@
{
"ProjectName": "黄金品级调整箱",
"ProjectDescribe": "将一个品级调整箱替换为黄金品级调整箱",
"ProjectAuthor": "凌众",
"ProjectVersion": 1.1,
"ProjectConfig": "黄金品级调整箱_Lenheart.json",
"ProjectFiles": [
"黄金品级调整箱.nut"
],
"ProjectRunFunc": "_Dps_SetEquinherit_Main_"
}

View File

@@ -1,22 +0,0 @@
function _Dps_SetEquinherit_Main_() {
Cb_ModItemattr_Leave_Func.addinfoMax <- function(args) {
local Config = GlobalConfig.Get("黄金品级调整箱_Lenheart.json");
local SUser = User(args[1]);
local pack = NativePointer(args[2]);
local a = NativePointer(pack.add(20).readPointer());
local itemSold = a.add(13).add(6).readShort();
local equSold = a.add(13).add(0).readShort();
local InvenObj = SUser.GetInven();
if (InvenObj) {
local ItemObj = InvenObj.GetSlot(1, itemSold);
local equObj = InvenObj.GetSlot(1, equSold);
if (ItemObj.GetIndex() == Config["黄金品级调整箱id"]) {
equObj.SetAdd_Info(999999998);
equObj.Flush();
SUser.SendUpdateItemList(1, 0, equSold);
}
}
}
}