添加示例项目

This commit is contained in:
2026-04-16 16:27:53 +08:00
parent 69a2141804
commit 721fb5a992
192 changed files with 10148 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
{
"ProjectName": "史诗药剂",
"ProjectDescribe": "在单人深渊中使用指定ID的道具使玩家获得爆率加成。(组队无效),史诗药剂道具的冷却时间和持续时间需一致!!",
"ProjectAuthor": "倾泪寒 & 南瓜",
"ProjectVersion": 1.7,
"ProjectConfig": "史诗药剂配置文件.json",
"ProjectFiles": [
"史诗药剂.nut"
],
"ProjectRunFunc": "_Dps_EpicPotion_Main_"
}

View File

@@ -0,0 +1,47 @@
/*
文件名:史诗药剂.nut
路径:MyProject/史诗药剂.nut
创建日期:2025-03-28 10:21
文件用途:史诗药剂
*/
//启动函数 自定义的需要写在ifo中
function _Dps_EpicPotion_Main_() {
//注册获取道具稀有度进入回调
Cb_GetItemRarity_Enter_Func["史诗药剂_逻辑"] <- function(args) {
// print("获取道具稀有度进入回调");
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["史诗药剂ID"])) {
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["史诗药剂默认加成几率"]; // 默认药剂的增加几率
// 检查是否VIP玩家
local charac_no = userWithPotion.GetCID();
local cfg = Cofig["指定角色ID额外叠加加成几率"];
local key = charac_no.tostring();
if (cfg != null && cfg.rawin(key)) {
odds = cfg[key];
//print("VIP玩家:" + key + " 加成几率:" + odds);
}
// 计算新的roll值
args[2] = MathClass.getMin(args[2] + args[2] * odds, MaxRoll);
// print("新的roll值:" + args[2] + " 加成几率:" + odds + " 最大roll值:" + MaxRoll + " 角色ID:" + charac_no);
}
}
return args;
}
}

View File

@@ -0,0 +1,14 @@
{
"史诗药剂ID": 2600010,
"史诗药剂默认加成几率": 0.2,
"指定角色ID额外叠加加成几率": {
"1": 1.0,
"2": 1.0
},
"提示1": "史诗药剂道具的冷却时间和持续时间需一致否则无效!!!",
"提示2": "比如默认几率是0.2,指定角色ID是1,那么最终几率是0.2+1=1.2",
"提示3": "群文件中有史诗药剂的stk文件,可以自行修改!!!",
"提示4": "角色ID可以查看数据库中 taiwan_cain → charac_info → charac_no代表角色ID",
"提示5": "0.1几率是加成10%以此类推,受幸运值影响,具体加成请自行测算!",
"提示6": "2600010是和平呐喊的道具ID,用此道具有图标提示以及时间提示,但是具体字符串相关自行解决"
}