1111
This commit is contained in:
11
OfficialProject/史诗药剂/Proj.ifo
Normal file
11
OfficialProject/史诗药剂/Proj.ifo
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ProjectName": "史诗药剂",
|
||||
"ProjectDescribe": "通过指定ID的道具,使玩家获得爆率加成。",
|
||||
"ProjectAuthor": "倾泪寒 & 南瓜",
|
||||
"ProjectVersion": 1.4,
|
||||
"ProjectConfig": "史诗药剂配置文件.json",
|
||||
"ProjectFiles": [
|
||||
"史诗药剂.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EpicPotion_Main_"
|
||||
}
|
||||
42
OfficialProject/史诗药剂/史诗药剂.nut
Normal file
42
OfficialProject/史诗药剂/史诗药剂.nut
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
文件名:史诗药剂.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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user