1111
This commit is contained in:
@@ -42,13 +42,24 @@ class GameManager extends Base_C_Object {
|
||||
}
|
||||
|
||||
//设置装备解锁需要时间
|
||||
function SetItemLockTime(time) {
|
||||
NativePointer("0x8402D29").writeInt(time);
|
||||
NativePointer("0x854242F").writeInt(time);
|
||||
NativePointer("0x854274D").writeInt(time);
|
||||
NativePointer("0x854296F").writeInt(time);
|
||||
NativePointer("0x8542AD9").writeInt(time);
|
||||
NativePointer("0x8542BDE").writeInt(time);
|
||||
function SetItemLockTime(UnLockTime) {
|
||||
NativePointer("0x854242F").writeInt(UnLockTime);
|
||||
NativePointer("0x8402D29").writeInt(UnLockTime);
|
||||
NativePointer("0x854274D").writeInt(UnLockTime);
|
||||
NativePointer("0x854296F").writeInt(UnLockTime);
|
||||
NativePointer("0x8542AD9").writeInt(UnLockTime);
|
||||
NativePointer("0x8542BDE").writeInt(UnLockTime);
|
||||
NativePointer("0x85F3EB9").writeInt(UnLockTime);
|
||||
Cb_CItemLock_DoItemUnlock_Leave_Func["DPS装备解锁定时器注册任务"] <- function(args) {
|
||||
if (UnLockTime > 0) {
|
||||
local SUser = User(args[1]);
|
||||
Timer.SetTimeOut(function(SUser) {
|
||||
Sq_CallFunc(S_Ptr("0x08646912"), "int", ["pointer"], SUser.C_Object);
|
||||
}, UnLockTime * 1000, SUser)
|
||||
} else {
|
||||
Sq_CallFunc(S_Ptr("0x08646912"), "int", ["pointer"], SUser.C_Object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//开启创建鼠标妹
|
||||
@@ -67,7 +78,7 @@ class GameManager extends Base_C_Object {
|
||||
local item_id = inven_item.GetIndex();
|
||||
local pvfitem = PvfItem.GetPvfItemById(item_id);
|
||||
//如果是魔法封印装备
|
||||
if (!pvfitem.IsRandomOption()) {
|
||||
if (!pvfitem || !pvfitem.IsRandomOption()) {
|
||||
return;
|
||||
}
|
||||
local random_option = NativePointer(inven_item.C_Object).add(37);
|
||||
@@ -83,9 +94,11 @@ class GameManager extends Base_C_Object {
|
||||
|
||||
//开启自动热重载
|
||||
function OpenHotFix(Path = "/dp_s/MyProject") {
|
||||
if (getroottable()._HotFixPath_.rawin(Path)) return;
|
||||
print("DP-S开启自动重载脚本功能,重载目录为: " + Path + " .");
|
||||
print("请注意如果你不处于DP-S开发环境,请关闭此功能,以免对性能造成影响");
|
||||
Sq_AutoReload(Path);
|
||||
getroottable()._HotFixPath_.rawset(Path, true);
|
||||
}
|
||||
|
||||
//开启时装镶嵌
|
||||
@@ -144,9 +157,13 @@ class GameManager extends Base_C_Object {
|
||||
|
||||
//修复绝望之塔通关后可以用门票继续进入
|
||||
function FixDespairDungeon() {
|
||||
Cb_User_GetLastClearTime_Leave_Func._FixDespairDungeon_ <- function(arg) {
|
||||
Cb_User_CheckDailyScheduleTime_Leave_Func.DailyScheduleTime <- function(args) {
|
||||
return true;
|
||||
};
|
||||
|
||||
Cb_User_TOD_UserState_getLastClearTime_Leave_Func.DailyScheduleTime <- function(args) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//修改交易金币上限
|
||||
@@ -182,7 +199,6 @@ class GameManager extends Base_C_Object {
|
||||
|
||||
//邮件去除验证
|
||||
function FixEmailRemovalVerification() {
|
||||
//修改独立掉落原逻辑为不掉落
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov eax, 0x0",
|
||||
"ret");
|
||||
@@ -199,9 +215,125 @@ class GameManager extends Base_C_Object {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
//开启独立掉落模式 此功能需要传入一个回调函数 参数为 //角色 怪物ID 怪物等级 坐标X 坐标Y 副本名称 副本ID 副本等级 副本难度 深渊标识
|
||||
function OpenIndependenceDropMode(Func) {
|
||||
Haker.LoadHook("0x0830BC78", ["pointer", "pointer", "pointer", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
getroottable().LashKillMonsterId <- NativePointer(args[2]).add(3 * 4).readInt();
|
||||
return null;
|
||||
});
|
||||
|
||||
Haker.LoadHook("0x085A27E8", ["pointer", "pointer", "short", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
//杀死怪物了 要判断是否掉落
|
||||
//获取队伍
|
||||
local PartyObj = Party(args[0]);
|
||||
//获取战斗对象
|
||||
local BattleFieldObj = PartyObj.GetBattleField();
|
||||
//怪物等级
|
||||
local MonsterLevel = NativePointer(args[4]).add(2605).readInt();
|
||||
//怪物ID
|
||||
local MonsterId = getroottable().LashKillMonsterId;
|
||||
//坐标
|
||||
local Xpos = NativePointer(args[4]).add(2596).readShort();
|
||||
local Ypos = NativePointer(args[4]).add(2598).readShort();
|
||||
local DgnObj = BattleFieldObj.GetDgn();
|
||||
//副本名称
|
||||
local DgnName = DgnObj.GetName();
|
||||
//副本ID
|
||||
local DgnId = DgnObj.GetId();
|
||||
//副本等级
|
||||
local DgnLevel = DgnObj.GetMinLevel();
|
||||
//副本难度
|
||||
local DgnDiff = Sq_CallFunc(S_Ptr("0x080F981C"), "int", ["pointer"], BattleFieldObj.C_Object);
|
||||
//深渊标识
|
||||
local HellDiff = BattleFieldObj.GetHellDifficulty();
|
||||
|
||||
for (local i = 0; i< 4; i++) {
|
||||
local SUser = PartyObj.GetUser(i);
|
||||
if (SUser) {
|
||||
//角色 怪物ID 怪物等级 坐标X 坐标Y 副本名称 副本ID 副本等级 副本难度 深渊标识
|
||||
Func(SUser, MonsterId, MonsterLevel, Xpos, Ypos, DgnName, DgnId, DgnLevel, DgnDiff, HellDiff);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
//修改独立掉落原逻辑为不掉落
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov eax, 0x830CD5D",
|
||||
"jmp eax");
|
||||
Haker.InsertCode("0x830CCE2", HexCode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//开启防入侵
|
||||
function FixInvasion() {
|
||||
NativePointer("0x81DB4EA").writeS8(0x00);
|
||||
|
||||
getroottable()._TH_MEM_K_ <- Memory.allocUtf8String("/");
|
||||
{
|
||||
local _Execve_Address = Module.getExportByName(null, "execve");
|
||||
local _Execve_Address_Str = "" + _Execve_Address;
|
||||
_Execve_Address_Str = _Execve_Address_Str.slice(_Execve_Address_Str.find("0x0x") + 2, -1);
|
||||
|
||||
Haker.LoadHook(_Execve_Address_Str, ["pointer", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
args[0] = getroottable()._TH_MEM_K_.C_Object;
|
||||
return args;
|
||||
},
|
||||
function(args) {
|
||||
return -1;
|
||||
});
|
||||
}
|
||||
{
|
||||
local _System_Address = Module.getExportByName(null, "system");
|
||||
local _System_Address_Str = "" + _System_Address;
|
||||
_System_Address_Str = _System_Address_Str.slice(_System_Address_Str.find("0x0x") + 2, -1);
|
||||
|
||||
Haker.LoadHook(_System_Address_Str, ["pointer", "int"],
|
||||
function(args) {
|
||||
args[0] = getroottable()._TH_MEM_K_.C_Object;
|
||||
return args;
|
||||
},
|
||||
function(args) {
|
||||
return -1;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//热重载
|
||||
getroottable()._HotFixPath_ <- {};
|
||||
getroottable()._HotFixPathChangeTimer_ <- {};
|
||||
|
||||
function _Reload_List_Write_(Path) {
|
||||
dofile(Path);
|
||||
print("位于 [" + Path + "] 的脚本已重载")
|
||||
local NowTime = Sq_GetTimestampString().slice(-9).tointeger();
|
||||
if (!getroottable()._HotFixPathChangeTimer_.rawin(Path) || NowTime - getroottable()._HotFixPathChangeTimer_[Path] > 1000) {
|
||||
//判断类型
|
||||
if (endswith(Path, ".nut")) {
|
||||
dofile(Path);
|
||||
print("位于 [" + Path + "] 的脚本已重载")
|
||||
} else if (endswith(Path, ".json")) {
|
||||
try {
|
||||
local PArr = split(Path, "/");
|
||||
local RealName = PArr[PArr.len() - 1];
|
||||
GlobalConfig.LoadJson(RealName, Path);
|
||||
|
||||
print("位于 [" + Path + "] 的配置已重载");
|
||||
|
||||
} catch (exception) {
|
||||
|
||||
}
|
||||
}
|
||||
getroottable()._HotFixPathChangeTimer_[Path] <- NowTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user