保存标准
This commit is contained in:
104
MyProject/A.nut
Normal file
104
MyProject/A.nut
Normal file
@@ -0,0 +1,104 @@
|
||||
Gm_InputFunc_Handle["给"] <- 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
|
||||
|
||||
Haker.LoadHook("0x0830ADF6", ["pointer", "pointer", "pointer", "pointer", "int", "int", "int", "int", "int", "pointer", "float", "int", "void"],
|
||||
function(args) {
|
||||
local SParty = Party(NativePointer(args[0]).readPointer());
|
||||
local map_monster_param = NativePointer(Haker.CpuContext.ebp).add(0x10).readPointer();
|
||||
local monster_uid = NativePointer(NativePointer(Haker.CpuContext.ebp).add(0x18).readPointer()).readU16();
|
||||
|
||||
Sq_WriteByteArr(S_Ptr("0x830ADFB"), Haker.AsmGenerateMcd(
|
||||
"pop esi",
|
||||
"pop edi",
|
||||
"pop ebp",
|
||||
"ret"));
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
//还原
|
||||
Sq_WriteByteArr(S_Ptr("0x830ADFB"), [0x53, 0x81, 0xec, 0x7c, 0x01]);
|
||||
return null;
|
||||
});
|
||||
}, 1)
|
||||
|
||||
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
local Config = sq_ReadJsonFile("/dp_s/OfficialConfig" + "/" + "门票进入副本配置_Maomi.json");
|
||||
// local Config = GlobalConfig.Get("门票进入副本配置_Maomi.json");
|
||||
print(Config);
|
||||
}, 1);
|
||||
|
||||
|
||||
function get_required_gradeByMaomi(dgn_id, dgn_diff) {
|
||||
local Config = GlobalConfig.Get("门票进入副本配置_Maomi.json");
|
||||
if (Config["门票进入副本"]["副本配置"].rawin(dgn_id.tostring())) {
|
||||
local requirements = Config["门票进入副本"]["副本配置"][dgn_id.tostring()];
|
||||
for (local i = 0; i< requirements.len(); i += 2) {
|
||||
if (requirements[i] == dgn_diff) {
|
||||
return requirements[i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Cb_SelectDungeon_Check_Error_Leave_Func.Check_TicketByMaomi <- function(args) {
|
||||
|
||||
local Config = sq_ReadJsonFile("/dp_s/OfficialConfig" + "/" + "门票进入副本配置_Maomi.json");
|
||||
// local Config = GlobalConfig.Get("门票进入副本配置_Maomi.json");
|
||||
|
||||
local SUser = User(args[1]);
|
||||
local msg_base = args[2];
|
||||
local dgn_id = NativePointer(msg_base).add(13).readU16(); // 获取副本ID
|
||||
local dgn_diff = NativePointer(msg_base).add(15).readU8(); // 获取副本难度
|
||||
local PartyObj = SUser.GetParty();
|
||||
|
||||
local required_Item = get_required_gradeByMaomi(dgn_id, dgn_diff);
|
||||
local diff_name = Config["副本难度命名"][(dgn_diff).tostring()];
|
||||
|
||||
if (!required_Item) return null;
|
||||
|
||||
if (PartyObj && Config["门票进入副本"]["门票进入副本开关(true为开启,false为关闭)"]) {
|
||||
for (local i = 0; i< 4; ++i) {
|
||||
local Tuser = PartyObj.GetUser(i);
|
||||
if (Tuser) {
|
||||
local InvenObj = Tuser.GetInven();
|
||||
if (InvenObj) {
|
||||
if (InvenObj.CheckItemCount(required_Item, 1))
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SUser.SendNotiBox("队伍中所有玩家均无副本所需门票,无法进入!", 2)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
54
MyProject/史诗药剂.nut
Normal file
54
MyProject/史诗药剂.nut
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
文件名:史诗药剂.nut
|
||||
路径:MyProject/史诗药剂.nut
|
||||
创建日期:2025-03-28 10:21
|
||||
文件用途:史诗药剂
|
||||
*/
|
||||
|
||||
//➢SS药剂的ID
|
||||
EpicPotionID <- 2600006;
|
||||
//➢默认的药剂增加倍率
|
||||
EpicPotionOdds <- 0.1;
|
||||
//➢指定玩家增加深渊爆率
|
||||
EpicPotionlist <- {};
|
||||
//角色ID:增加个人深渊爆率
|
||||
EpicPotionlist[1] <- 1;
|
||||
|
||||
|
||||
Cb_GetItemRarity_Enter_Func["史诗药剂_逻辑"] <- function(args) {
|
||||
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, 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 = EpicPotionOdds; // 默认药剂的增加几率
|
||||
// 检查是否VIP玩家
|
||||
local charac_no = userWithPotion.GetCID();
|
||||
if (EpicPotionlist.rawin(charac_no)) {
|
||||
odds = EpicPotionlist[charac_no];
|
||||
}
|
||||
// 计算新的roll值
|
||||
args[2] = MathClass.getMin(args[2] + args[2] * odds, MaxRoll);
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["okok"] <- function(SUser, cmd) {
|
||||
|
||||
SUser.SendNotiPacketMessage("出纳上asdasdasda到几点方柏霓撒娇扩大年级卡萨", 7);
|
||||
}
|
||||
Reference in New Issue
Block a user