This commit is contained in:
lenheart
2025-04-21 13:36:35 +08:00
parent eeb773e723
commit 2ef9cfef42
87 changed files with 2134 additions and 765 deletions

View File

@@ -0,0 +1,145 @@
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

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

View File

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

View File

@@ -0,0 +1,45 @@
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

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

View File

@@ -5,11 +5,10 @@
文件用途:一键入库
*/
//启动函数 自定义的需要写在ifo中
function _Dps_OneClickStorage_Main_() {
function _Dps_OneClickStorage_Logic_() {
local Config = GlobalConfig.Get("一键存入个人金库_Lenheart.json");
//在游戏中输入//一键入库即可调用
Gm_InputFunc_Handle[Config["一键存仓命令"]] <- function(SUser,Cmd) {
Gm_InputFunc_Handle[Config["一键存仓命令"]] <- function(SUser, Cmd) {
// 获取角色背包
local InvenObj = SUser.GetInven();
// 角色仓库
@@ -105,4 +104,13 @@ function _Dps_OneClickStorage_Main_() {
// 通知客户端更新仓库
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

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

View File

@@ -0,0 +1,9 @@
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,12 +0,0 @@
{
"ProjectName": "任务清除卷",
"ProjectDescribe": "清理各类型任务以及重置相关任务",
"ProjectAuthor": "南瓜",
"ProjectVersion": 1.0,
"ProjectConfig": "任务相关配置_南瓜.json",
"ProjectFiles": [
"任务清除卷.nut"
],
"ProjectIcon":"http://103.36.223.176:5244/d/DP_S/logo2.png?sign=aH3AjsyJgmomCqT3To_QfDY6a2RlSI-T3eUmtW0raoA=:0",
"ProjectRunFunc": "_Dps_QuestInfo_nangua_Main_"
}

View File

@@ -1,212 +0,0 @@
_NG_QUEST_GRADE_COMMON_UNIQUE <- 5 //普通任务
_NG_QUEST_GRADE_EPIC <- 0 //主线任务
_NG_QUEST_GRADE_ACHIEVEMENT <- 2 //成就任务
// 任务类型与排除列表的映射
_QUEST_EXCLUDE_MAP <- {
[_NG_QUEST_GRADE_COMMON_UNIQUE] = "普通任务需排除任务ID",
[_NG_QUEST_GRADE_ACHIEVEMENT] = "成就任务需排除任务ID",
[_NG_QUEST_GRADE_EPIC] = "主线任务需排除任务ID"
}
function clear_all_quest_by_character_level_nangua(SUser, Item_id) {
local Cofig = GlobalConfig.Get("任务相关配置_南瓜.json");
local poolMapping = {
[Cofig["主线任务完成券道具ID"]] = _NG_QUEST_GRADE_EPIC,
[Cofig["普通任务完成券道具ID"]] = _NG_QUEST_GRADE_COMMON_UNIQUE,
[Cofig["成就任务完成券道具ID"]] = _NG_QUEST_GRADE_ACHIEVEMENT
};
// 获取对应的type
local quest_type = poolMapping[Item_id];
// 玩家任务信息
local user_quest = SUser.GetQuest();
// 玩家已完成任务信息
local WongWork_CQuestClear = NativePointer(user_quest).add(4);
// 玩家当前等级
local charac_lv = SUser.GetCharacLevel();
// 本次完成任务数量
local clear_quest_cnt = 0;
// 获取pvf数据
local data_manager = Sq_CallFunc(S_Ptr("0x80CC19B"), "pointer");
// 使用全局排除列表
local exclude_quset_id = _QUEST_EXCLUDE_MAP.rawin(quest_type) ? Cofig[_QUEST_EXCLUDE_MAP[quest_type]] : [];
//完成当前已接任务
for (local i = 0; i < 20; i++) {
// 任务id
local doing_quest_id = NativePointer(user_quest).add(4 * (i + 7500 + 2)).readInt();
if (doing_quest_id > 0) {
// 获取当前任务的数据
local quest = Sq_CallFunc(S_Ptr("0x835FDC6"), "pointer", ["pointer", "int"], data_manager, doing_quest_id);
if (quest) {
// 任务类型
local quest_grade = NativePointer(quest).add(8).readInt();
// 判断任务类型并且不在排除列表中
if (quest_grade == quest_type && exclude_quset_id.find(doing_quest_id) == null) {
// 无条件完成任务
SUser.ClearQuest_Gm(doing_quest_id);
}
}
}
}
// 遍历所有任务ID
for (local quest_id = 1; quest_id < 30000; quest_id++) {
// 检查任务是否在排除列表中
if (exclude_quset_id.find(quest_id) != null) {
continue;
}
// 跳过已完成的任务
local isCleared = isClearedQuest(WongWork_CQuestClear.C_Object, quest_id);
if (isCleared) {
continue;
}
// 获取任务数据
local quest = Sq_CallFunc(S_Ptr("0x835FDC6"), "pointer", ["pointer", "int"], data_manager, quest_id);
if (quest) {
// 任务类型
local quest_grade = NativePointer(quest).add(8).readInt();
if (quest_grade == quest_type) {
// 只判断任务最低等级要求 忽略 职业/前置 等任务要求 可一次性完成当前等级所有任务
local quest_min_lv = NativePointer(quest).add(0x20).readInt();
if (quest_min_lv <= charac_lv) {
Sq_CallFunc(S_Ptr("0x808BA78"), "int", ["pointer", "int"], WongWork_CQuestClear.C_Object, quest_id);
// 本次自动完成任务计数
clear_quest_cnt++;
}
}
}
}
// 通知客户端更新
if (clear_quest_cnt > 0) {
local Pack = Packet();
Sq_CallFunc(S_Ptr("0x868B044"), "int", ["pointer"], SUser.C_Object);
Sq_CallFunc(S_Ptr("0x86ABBA8"), "int", ["pointer", "pointer"], user_quest, Pack.C_Object);
SUser.Send(Pack);
Pack.Delete();
// 公告通知客户端本次自动完成任务数据
SUser.SendNotiPacketMessage("已自动完成当前等级任务数量: " + clear_quest_cnt, 8);
}else{
SUser.SendNotiPacketMessage("没有可清理的任务", 8);
SUser.GiveItem(Item_id, 1);
}
}
//指定每日任务完成券
function QUEST_ByMRFuncBynangua(SUser, ItemId) {
// 玩家已完成任务信息
local user_quest = SUser.GetQuest();
local WongWork_CQuestClear = NativePointer(user_quest).add(4);
// 是否有任务已被清理
local anyTaskCleared = false;
// 遍历并完成每一个任务
for (local i = 0; i < questConfigBynangua.CF.len(); i++) {
local quest_id = questConfigBynangua.CF[i];
local isCleared = isClearedQuest(WongWork_CQuestClear.C_Object, quest_id);
if (isCleared) {
continue;
} else {
SUser.ClearQuest_Gm(quest_id);
anyTaskCleared = true;
}
}
if (anyTaskCleared) {
SUser.SendNotiPacketMessage("指定每日任务已完成!", 8);
} else {
SUser.SendNotiPacketMessage("没有可清理的任务", 8);
SUser.GiveItem(ItemId, 1);
}
}
//指定每日任务重置券
function QUEST_ByCZMRFuncBynangua(SUser, ItemId) {
// 玩家已完成任务信息
local user_quest = SUser.GetQuest();
local WongWork_CQuestClear = NativePointer(user_quest).add(4);
// 是否有任务被重置
local anyTaskReset = false;
// 遍历并重置每一个任务
for (local i = 0; i < questConfigBynangua.CF.len(); i++) {
local quest_id = questConfigBynangua.CF[i];
local isCleared = isClearedQuest(WongWork_CQuestClear.C_Object, quest_id);
if (!isCleared) {
continue;
} else {
Sq_CallFunc(S_Ptr("0x808BAAC"), "int", ["pointer", "int"], WongWork_CQuestClear.C_Object, quest_id);
anyTaskReset = true;
}
}
if (anyTaskReset) {
//通知客户端更新任务列表
Sq_CallFunc(S_Ptr("0x868B044"), "int", ["pointer"], SUser.C_Object);
local Pack = Packet();
Sq_CallFunc(S_Ptr("0x86ABBA8"), "int", ["pointer", "pointer"], user_quest, Pack.C_Object);
SUser.Send(Pack);
Pack.Delete();
SUser.SendNotiPacketMessage("指定每日任务已重置!", 8);
} else {
SUser.SendNotiPacketMessage("没有可重置的任务", 8);
SUser.GiveItem(ItemId, 1);
}
}
//重置所有任务为未完成状态
function QUEST_ByALLFuncBynangua(SUser, ItemId) {
local GetState = SUser.GetState()
local user_quest = SUser.GetQuest();
local WongWork_CQuestClear = NativePointer(user_quest).add(4);
//清空已接任务列表
for (local i = 0; i < 20; i++) {
NativePointer(user_quest).add(4 * (i + 7500 + 2)).writeInt(0);
}
//所有任务设置未完成状态
for (local i = 0; i < 29999; i++) {
Sq_CallFunc(S_Ptr("0x808BAAC"), "int", ["pointer", "int"], WongWork_CQuestClear.C_Object, i);
}
//通知客户端更新任务列表
Sq_CallFunc(S_Ptr("0x868B044"), "int", ["pointer"], SUser.C_Object);
local Pack = Packet();
Sq_CallFunc(S_Ptr("0x86ABBA8"), "int", ["pointer", "pointer"], user_quest, Pack.C_Object);
SUser.Send(Pack);
Pack.Delete();
SUser.SendNotiPacketMessage("所有任务已重置!", 8);
}
function isClearedQuest(C_Object, questID) {
return Sq_CallFunc(S_Ptr("0x808BAE0"), "bool", ["pointer", "int"], C_Object, questID);
}
function _Dps_QuestInfo_nangua_Main_() {
local Cofig = GlobalConfig.Get("任务相关配置_南瓜.json");
// 主线任务完成券
Cb_Use_Item_Sp_Func[Cofig["主线任务完成券道具ID"]] <- clear_all_quest_by_character_level_nangua;
// 普通任务完成券
Cb_Use_Item_Sp_Func[Cofig["普通任务完成券道具ID"]] <- clear_all_quest_by_character_level_nangua;
// 成就任务完成券
Cb_Use_Item_Sp_Func[Cofig["成就任务完成券道具ID"]] <- clear_all_quest_by_character_level_nangua;
// 每日任务完成券
Cb_Use_Item_Sp_Func[Cofig["指定每日任务完成券道具ID"]] <- QUEST_ByMRFuncBynangua;
// 每日任务重置券
Cb_Use_Item_Sp_Func[Cofig["指定每日任务重置券道具ID"]] <- QUEST_ByCZMRFuncBynangua;
// 所有任务重置券
Cb_Use_Item_Sp_Func[Cofig["重置所有任务道具ID"]] <- QUEST_ByALLFuncBynangua;
}

View File

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

View File

@@ -0,0 +1,12 @@
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

@@ -1,11 +0,0 @@
{
"ProjectName": "副本播报",
"ProjectDescribe": "通关及未通关时播报耗时时长",
"ProjectAuthor": "南瓜",
"ProjectVersion": 1.0,
"ProjectConfig": "副本播报配置_Nangua.json",
"ProjectFiles": [
"副本播报.nut"
],
"ProjectRunFunc": "_Dps_send_dungeon_msg_Main_"
}

View File

@@ -1,193 +0,0 @@
EnterDungeon <- {};
LeaveDungeon <- {};
ClearDungeon <- {};
dungeon_cleared <- {};
dungeon_cache <- {};
function _Dps_send_dungeon_msg_Main_() {
//进入副本加载完毕时
Cb_Party_OnStartMapFinishLoading_Enter_Func.EnterStartMapByNangua <- function(args) {
local Cofig = GlobalConfig.Get("副本播报配置_Nangua.json");
local PartyObj = Party(args[0]);
if(!PartyObj)
return
if (!Cofig["副本播报开关(true开启,false关闭)"]) {
return;
}
for (local i = 0; i < 4; ++i) {
local SUser = PartyObj.GetUser(i);
if (SUser) {
if(SUser.GetCID() in dungeon_cache){
dungeon_cache.rawdelete(SUser.GetCID());
}
dungeon_cleared[SUser.GetCID()] <- false; // 进入副本时初始化标志为未通关
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
local DgnID = DgnObj.GetId();
local Dungeon_Name = DgnObj.GetName();
local dungeon_type = NativePointer(Bfobj.C_Object).add(460).readU8(); // 0 为普通副本1 为非常困难深渊2 为困难深渊
local dungeon_diff = Sq_CallFunc(S_Ptr("0x080F981C"), "int", ["pointer"], Bfobj.C_Object); // 获取副本难度
local diff_name = Cofig["副本难度命名"][(dungeon_diff).tostring()]; // 获取副本难度名称
local dgntypeName = _clear_dgn_Bynangua.DungeonType[(dungeon_type).tostring()];
local DgnData = {
"entered": true,
"Dungeon_Name": Dungeon_Name,
"dgntypeName": dgntypeName,
"diff_name": diff_name,
"totalTime": 0
};
//以角色ID为键记录副本信息
dungeon_cache[SUser.GetCID()] <- DgnData;
}
}
}
//清理房间完毕时
Cb_Battle_Field_onClearMap_Leave_Func.onClearMapByNangua <- function(args) {
local Cofig = GlobalConfig.Get("副本播报配置_Nangua.json");
local retval = args.pop();
local CBattle_Field = args[0];
local PartyObj = Party(NativePointer(CBattle_Field).add(-2852).C_Object);
if(!PartyObj)
return
local DgnId = NativePointer(args[0]).add(404).readInt();
if (!Cofig["副本播报开关(true开启,false关闭)"]) {
return;
}
if (retval == DgnId) {
for (local i = 0; i < 4; ++i) {
local SUser = PartyObj.GetUser(i);
if (SUser) {
if (dungeon_cache.rawin(SUser.GetCID()) && dungeon_cache[SUser.GetCID()].rawin("entered")) {
local time = Sq_CallFunc(S_Ptr("0x085B6768"), "int", ["pointer"], PartyObj.C_Object);
dungeon_cache[SUser.GetCID()]["totalTime"] += time;
}
}
}
}
}
//放弃副本或未通关副本时
Cb_Party_giveup_game_Enter_Func.giveupByNangua <- function(args) {
local Cofig = GlobalConfig.Get("副本播报配置_Nangua.json");
local PartyObj = Party(args[0]);
local killcount = Sq_CallFunc(S_Ptr("0x085BF456"), "int", ["pointer"], NativePointer(args[0]).add(812).C_Object);
if (!PartyObj) return;
if (!Cofig["副本播报开关(true开启,false关闭)"]) return;
local SUser = User(args[1]);
local Party_Master = PartyObj.GetMaster();
local MasterName = Party_Master.GetCharacName();
local formattedTime = "";
local DgnId = NativePointer(args[0]).add(814 * 4).readInt();
local name = SUser.GetCharacName();
// 如果副本ID不在允许播报的数组内则跳出
if (Cofig["不需要播报的副本ID"].find(DgnId) != null) {
return;
}
if (SUser.GetCID() in dungeon_cache) {
local dungeonInfo = dungeon_cache[SUser.GetCID()];
local dgnTypeName = dungeonInfo["dgntypeName"];
local dungeonName = dungeonInfo["Dungeon_Name"];
local diffName = dungeonInfo["diff_name"];
local totalTime = 0;
if (dungeon_cache.rawin(SUser.GetCID()) && dungeon_cache[SUser.GetCID()].rawin("totalTime")) {
totalTime = dungeon_cache[SUser.GetCID()]["totalTime"];
formattedTime = _clear_dgn_Bynangua.formatMilliseconds(totalTime);
}
if (dungeon_cleared.rawin(SUser.GetCID()) && dungeon_cleared[SUser.GetCID()] == true) {
dungeon_cache.rawdelete(SUser.GetCID());
dungeon_cleared[SUser.GetCID()] <- false;
} else {
// 发送未通关信息
if (totalTime == 0) {
World.SendNotiPacketMessage(format(Cofig["未通过一个小地图播报信息"], name, dgnTypeName, dungeonName, diffName, killcount), Cofig["发送信息位置"]);
} else if (MasterName == SUser.GetCharacName()) {
World.SendNotiPacketMessage(format(Cofig["放弃副本"], name, dgnTypeName, dungeonName, diffName, formattedTime, killcount), Cofig["发送信息位置"]);
} else {
World.SendNotiPacketMessage(format(Cofig["在队伍中提前退出副本"], name, MasterName, dgnTypeName, dungeonName, diffName, formattedTime, killcount), Cofig["发送信息位置"])
}
dungeon_cache.rawdelete(SUser.GetCID());
}
}
}
//通关副本时
Cb_CParty_SetBestClearTime_Enter_Func.ClearTimeByNangua <- function (args) {
local Cofig = GlobalConfig.Get("副本播报配置_Nangua.json");
local PartyObj = Party(args[0]);
local killcount = Sq_CallFunc(S_Ptr("0x085BF456"), "int", ["pointer"], NativePointer(args[0]).add(812).C_Object);
if(!PartyObj)
return
local dungeon_diff = args[2];
local clearTime = args[3];
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
local diff_name = Cofig["副本难度命名"][(dungeon_diff).tostring()];
if (!Cofig["副本播报开关(true开启,false关闭)"]) {
return;
}
if (DgnObj) {
local Dungeon_Name = DgnObj.GetName();
local MemberNames = [];
for (local i = 0; i < 4; ++i) {
local SUser = PartyObj.GetUser(i);
if (SUser) {
local name = SUser.GetCharacName();
MemberNames.append(name);
dungeon_cleared[SUser.GetCID()] <- true;
}
}
local joinedNames = _clear_dgn_Bynangua.join(MemberNames, ", ");
local time = _clear_dgn_Bynangua.formatMilliseconds(clearTime);
World.SendNotiPacketMessage(format(Cofig["通关播报信息"], joinedNames, Dungeon_Name, diff_name, time, killcount), Cofig["发送信息位置"]);
for (local i = 0; i < 4; ++i) {
local TUser = PartyObj.GetUser(i);
if (TUser) {
local CID = TUser.GetCID();
if (CID) {
dungeon_cache.rawdelete(CID);
}
}
}
}
}
}
class _clear_dgn_Bynangua {
DungeonType = {
"0": "",
"1": "非常困难级深渊-",
"2": "困难级深渊-",
};
function join(array, delimiter) {
local result = "";
for (local i = 0; i < array.len(); ++i) {
if (i > 0) {
result += delimiter;
}
result += array[i];
}
return result;
}
function formatMilliseconds(ms) {
local str = "";
local minutes = ms / 60000;
local seconds = (ms % 60000) / 1000;
local milliseconds = (ms % 1000) / 10;
if (minutes > 0) {
str = minutes + "分" +
(seconds < 10 ? "0" : "") + seconds + "秒" +
(milliseconds < 10 ? "0" : "") + milliseconds;
} else {
str = seconds + "秒" +
(milliseconds < 10 ? "0" : "") + milliseconds;
}
return str;
}
}

View File

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

View File

@@ -0,0 +1,38 @@
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

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

View File

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

View File

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

View File

@@ -0,0 +1,333 @@
_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

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

View File

@@ -0,0 +1,32 @@
/*
文件名:屏蔽指定对话内容的私聊和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

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

View File

@@ -0,0 +1,26 @@
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

@@ -0,0 +1,11 @@
{
"ProjectName": "技能拓展14键",
"ProjectDescribe": "14键位技能的服务端修复程序,需要客户端已经加载了14键技能的插件。",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "",
"ProjectFiles": [
"技能拓展14键.nut"
],
"ProjectRunFunc": "_Dps_SkillExpansion_14Keys_Main_"
}

View File

@@ -0,0 +1,7 @@
function _Dps_SkillExpansion_14Keys_Main_()
{
GameManager.Fix14Skill();
}

View File

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

View File

@@ -0,0 +1,29 @@
_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

@@ -4,15 +4,27 @@
创建日期:2025-04-01 21:42
文件用途:
*/
function _Dps_FashionAndPetClearanceRoll_Main_() {
local Cofig = GlobalConfig.Get("时装与宠物清除卷_Lenheart.json");
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[Cofig["宠物清除卷ID"]] <- function(SUser, ItemId) {
if(Cofig["宠物清除券是否返还"])SUser.GiveItem(ItemId, 1);
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++) {
for (local i = 0; i <= 13; i++) {
local ItemObj = InvenObj.GetSlot(3, i);
local Flag = false;
if (ItemObj) {
@@ -25,17 +37,17 @@ function _Dps_FashionAndPetClearanceRoll_Main_() {
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
SUser.SendItemSpace(7);
SUser.SendNotiPacketMessage(Cofig["宠物清除完成提示"], 8);
SUser.SendNotiPacketMessage(Config["宠物清除完成提示"], 8);
}
}
//时装删除
Cb_Use_Item_Sp_Func[Cofig["时装清除卷ID"]] <- function(SUser, ItemId) {
if(Cofig["时装清除券是否返还"])SUser.GiveItem(ItemId, 1);
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++) {
for (local i = 0; i <= 13; i++) {
local ItemObj = InvenObj.GetSlot(2, i);
if (ItemObj) {
ItemObj.Delete();
@@ -47,8 +59,18 @@ function _Dps_FashionAndPetClearanceRoll_Main_() {
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
SUser.SendItemSpace(1);
SUser.SendNotiPacketMessage(Cofig["时装清除完成提示"], 8);
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

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

View File

@@ -0,0 +1,16 @@
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

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

View File

@@ -0,0 +1,70 @@
/*
文件名:月光定制收集图鉴.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": "本项目会持续更新,因特殊原因逻辑不会公开",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "",
"ProjectFiles": [
"服务器防入侵.sut"
],
"ProjectRunFunc": "_Dps_ServerIntrusionPrevention_Main_"
}

View File

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

View File

@@ -0,0 +1,13 @@
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

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

View File

@@ -0,0 +1,12 @@
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,8 +1,8 @@
{
"ProjectName": "设置装备解锁时间",
"ProjectDescribe": "是指装备解锁需要等待的冷却时间",
"ProjectDescribe": "设置装备解锁时间",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectVersion": 1.1,
"ProjectConfig": "设置装备解锁时间_Lenheart.json",
"ProjectFiles": [
"设置装备解锁时间.nut"

View File

@@ -1,5 +1,12 @@
function _Dps_SetEquipmentUnlockTime_Main_()
{
local Config = GlobalConfig.Get("设置装备解锁时间_Lenheart.json");
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,8 +1,8 @@
{
"ProjectName": "跨界石",
"ProjectDescribe": "通过指定ID的道具将装备背包第一格的装备跨界。\n配置中修改NoCrossIdArr可增加不可跨界的ID。",
"ProjectDescribe": "通过指定ID的道具将装备背包第一格的装备跨界。\n配置中修改CrossoverId可修改跨界石的ID 修改NoCrossIdArr可增加不可跨界的ID。",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.2,
"ProjectVersion": 1.3,
"ProjectConfig": "跨界石_Lenheart.json",
"ProjectFiles": [
"跨界石.nut"

View File

@@ -1,6 +1,13 @@
function _Dps_CrossBorderStones_Main_() {
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();
//获取账号金库中的一个空格子
@@ -54,4 +61,20 @@ function _Dps_CrossBorderStones_Main_() {
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.3,
"ProjectConfig": "防脱机制裁_Nangua.json",
"ProjectFiles": [
"防脱机制裁.sut"
],
"ProjectRunFunc": "_Dps_AntiOfflineSanctions_Main_"
}

View File

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

View File

@@ -0,0 +1,22 @@
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);
}
}
}
}