1111
This commit is contained in:
@@ -56,12 +56,13 @@ class AdMsg {
|
||||
SendBinary.writen(Var, 'c');
|
||||
SendBinary.writen(0x1f, 'c');
|
||||
}
|
||||
//写入装备
|
||||
|
||||
function JumpWrite(Blob, Pos, Value, Type) {
|
||||
Blob.seek(Pos, 'b');
|
||||
Blob.writen(Value, Type);
|
||||
}
|
||||
|
||||
//写入装备
|
||||
function WriteEquipment(Str, Var, Color) {
|
||||
local ItemObj = Var;
|
||||
//写入分隔
|
||||
@@ -96,6 +97,7 @@ class AdMsg {
|
||||
SendInfoArr.push(InfoBlob);
|
||||
}
|
||||
|
||||
|
||||
constructor() {
|
||||
SendStrArr = [];
|
||||
SendInfoArr = [];
|
||||
|
||||
@@ -4,3 +4,54 @@
|
||||
创建日期:2025-03-25 18:28
|
||||
文件用途:大数字类
|
||||
*/
|
||||
class longlong {
|
||||
Value = null;
|
||||
//构造函数 不管是不是string类型都要转成string类型
|
||||
constructor(arg) {
|
||||
if( typeof arg == "string"){
|
||||
Value = arg;
|
||||
}
|
||||
else if( typeof arg == "integer"){
|
||||
Value = arg.tostring();
|
||||
}
|
||||
else if ( typeof arg == "userdata"){
|
||||
local Str = "" + arg;
|
||||
Str = Str.slice(Str.find("0x") + 2, -1);
|
||||
Value = Str;
|
||||
}
|
||||
}
|
||||
|
||||
function _add(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "+"));
|
||||
}
|
||||
|
||||
function _sub(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "-"));
|
||||
}
|
||||
|
||||
function _mul(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "*"));
|
||||
}
|
||||
|
||||
function _div(other) {
|
||||
return Sq_LongLongOperation(this.Value, other.Value, "/");
|
||||
}
|
||||
|
||||
function _unm() {
|
||||
return longlong(Sq_LongLongOperation(longlong("0"), this.Value, "-"));
|
||||
}
|
||||
|
||||
function _modulo(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "%"));
|
||||
}
|
||||
|
||||
function GetFormat(FType) {
|
||||
local Buf = Sq_LongLongOperation(this.Value, FType, "format");
|
||||
if (Buf.len()< 2) return Buf + ".0";
|
||||
local Value = Buf.slice(0, -1);
|
||||
local Unit = Buf.slice(-1);
|
||||
local RetStr = format(FType + Unit, Value.tofloat());
|
||||
return RetStr;
|
||||
}
|
||||
|
||||
}
|
||||
47
Dps_A/BaseClass/ConfigClass/ConfigClass.nut
Normal file
47
Dps_A/BaseClass/ConfigClass/ConfigClass.nut
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
文件名:ConfigClass.nut
|
||||
路径:Dps_A/BaseClass/ConfigClass/ConfigClass.nut
|
||||
创建日期:2025-03-29 23:54
|
||||
文件用途:全局配置类
|
||||
*/
|
||||
class _GlobalConfig {
|
||||
ConfigMap = null;
|
||||
|
||||
|
||||
constructor() {
|
||||
//在全局中注册自己
|
||||
getroottable().GlobalConfig <- this;
|
||||
|
||||
ConfigMap = {};
|
||||
|
||||
local WorkPath = "/dp_s/OfficialConfig";
|
||||
local FilePaths = sq_GetListFiles(WorkPath);
|
||||
foreach(FilePath in FilePaths) {
|
||||
try {
|
||||
LoadJson(FilePath, WorkPath + "/" + FilePath);
|
||||
} catch (exception) {
|
||||
error("加载配置文件失败:" + FilePath);
|
||||
}
|
||||
}
|
||||
//开启热重载配置
|
||||
GameManager.OpenHotFix("/dp_s/OfficialConfig");
|
||||
}
|
||||
|
||||
function LoadJson(FilePath, Path) {
|
||||
local Config = sq_ReadJsonFile(Path);
|
||||
if (Config) {
|
||||
ConfigMap.rawset(FilePath, Config);
|
||||
}
|
||||
}
|
||||
|
||||
function Get(ConfigName) {
|
||||
if (ConfigMap.rawin(ConfigName)) {
|
||||
return ConfigMap[ConfigName];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_GlobalConfig();
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,9 @@ class _Hacker {
|
||||
}
|
||||
|
||||
function _Haker_SetNextReturnAddress(Address) {
|
||||
Haker.NextReturnAddress = "" + Address;
|
||||
local Buffer = "" + Address;
|
||||
Haker.NextReturnAddress = Buffer.slice(Buffer.find("0x") + 2, -1);
|
||||
|
||||
}
|
||||
//初始化Hacker
|
||||
Haker <- _Hacker();
|
||||
@@ -220,6 +220,9 @@ class MysqlPool {
|
||||
//连接池
|
||||
PoolList = null;
|
||||
|
||||
//是否已经初始化
|
||||
IsInit = false;
|
||||
|
||||
constructor() {
|
||||
PoolList = [];
|
||||
getroottable()._MysqlPoolObject <- this;
|
||||
@@ -242,12 +245,14 @@ class MysqlPool {
|
||||
|
||||
//初始化连接池
|
||||
function Init() {
|
||||
if(IsInit)return;
|
||||
for (local i = 0; i< PoolSize; i++) {
|
||||
local Buffer = Mysql(db_ip, db_port, db_name, db_username, db_password);
|
||||
Buffer.Exec_Sql(format("SET NAMES %s", Charset));
|
||||
PoolList.append(Buffer);
|
||||
// print("创建了一条连接,编号: " + i + ",地址: " + Buffer + ", 指针地址: " + Buffer.C_Object);
|
||||
}
|
||||
IsInit = true;
|
||||
}
|
||||
|
||||
function GetConnect() {
|
||||
|
||||
47
Dps_A/BaseClass/OfficialProject/OfficialProject.nut
Normal file
47
Dps_A/BaseClass/OfficialProject/OfficialProject.nut
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
文件名:OfficialProject.nut
|
||||
路径:Dps_A/BaseClass/OfficialProject/OfficialProject.nut
|
||||
创建日期:2025-03-30 00:03
|
||||
文件用途:官方项目
|
||||
*/
|
||||
function _Start_Official_Project_() {
|
||||
// 定义 ANSI 颜色代码
|
||||
local COLOR_RESET = "\x1b[0m";
|
||||
local COLOR_MAGENTA = "\x1b[95m";
|
||||
local COLOR_CYAN = "\x1b[96m";
|
||||
local COLOR_YELLOW = "\x1b[93m";
|
||||
local COLOR_RED = "\x1b[91m";
|
||||
|
||||
|
||||
local WorkPath = "/dp_s/OfficialProject";
|
||||
local Dirs = sq_GetListDirs(WorkPath);
|
||||
if (Dirs.len() > 0) {
|
||||
print(format("\n\n\t\t\t\t%s开始加载DP-S插件市场项目%s", COLOR_YELLOW, COLOR_RESET));
|
||||
}
|
||||
foreach(DirPath in Dirs) {
|
||||
local FilePaths = sq_GetListFiles(WorkPath + "/" + DirPath);
|
||||
|
||||
foreach(FilePath in FilePaths) {
|
||||
//找到项目文件
|
||||
if (FilePath == "Proj.ifo") {
|
||||
local Config = sq_ReadJsonFile(WorkPath + "/" + DirPath + "/" + FilePath);
|
||||
if (Config) {
|
||||
try {
|
||||
local ProjectFiles = Config.ProjectFiles;
|
||||
//载入所有项目文件
|
||||
foreach(ProjectFile in ProjectFiles) {
|
||||
sq_RunScript("OfficialProject/" + DirPath + "/" + ProjectFile);
|
||||
}
|
||||
//调用启动函数
|
||||
getroottable()[Config.ProjectRunFunc]();
|
||||
//播报脚本已加载
|
||||
print(format("%s[ %s ]%s" + " 脚本项目已加载 --- 当前版本: %s%.2f%s", COLOR_YELLOW, Config.ProjectName, COLOR_RESET, COLOR_YELLOW, Config.ProjectVersion, COLOR_RESET));
|
||||
} catch (exception) {
|
||||
//播报脚本未加载
|
||||
print(format("%s[ %s ]%s" + " 脚本项目未加载 --- 当前版本: %s%.2f%s", COLOR_RED, Config.ProjectName, COLOR_RESET, COLOR_RED, Config.ProjectVersion, COLOR_RESET));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ class Timer {
|
||||
}
|
||||
|
||||
function ClockTime() {
|
||||
return Sq_GetTimestampString().slice(-10).tointeger();
|
||||
return Sq_GetTimestampString().slice(-9).tointeger();
|
||||
}
|
||||
|
||||
//检测延时任务
|
||||
|
||||
@@ -743,4 +743,38 @@ function User::GetTradeGoldDaily() {
|
||||
//设置本日金币交易额度
|
||||
function User::SetTradeGoldDaily(Value) {
|
||||
return Sq_CallFunc(S_Ptr("0x84EC002"), "int", ["pointer", "int"], this.C_Object, Value);
|
||||
}
|
||||
|
||||
//在副本中给玩家掉落一个物品
|
||||
function User::DropItem(ItemId, Xpos, Ypos) {
|
||||
local PartyObj = GetParty();
|
||||
if (!PartyObj) return;
|
||||
//更改掉落物的坐标
|
||||
NativePointer("0x085A7599").writeShort(Xpos);
|
||||
NativePointer("0x085A759F").writeShort(Ypos);
|
||||
//申请一块内存用于存放包地址
|
||||
local PackBuffer = Memory.alloc(8);
|
||||
PackBuffer.writeInt(947330670);
|
||||
local StrBuffer = "" + PackBuffer.C_Object;
|
||||
local AddressStr = StrBuffer.slice(StrBuffer.find("0x") + 2, -1);
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov ebx," + AddressStr,
|
||||
"mov [ebx], eax",
|
||||
"mov ebx , 0",
|
||||
"mov eax, 0x85A775B",
|
||||
"jmp eax");
|
||||
|
||||
Haker.InsertCode("0x85A773C", HexCode);
|
||||
|
||||
//调用逻辑 包才会生成
|
||||
Sq_CallFunc(S_Ptr("0x85A73A6"), "int", ["pointer", "pointer", "int"], PartyObj.C_Object, this.C_Object, ItemId);
|
||||
|
||||
local Pack = Packet(PackBuffer.readPointer());
|
||||
Send(Pack);
|
||||
//销毁包
|
||||
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], Pack.C_Object);
|
||||
//还原逻辑
|
||||
Sq_WriteByteArr(S_Ptr("0x85A773C"), [0x89, 0x44, 0x24, 0x04, 0x8B, 0x45, 0x08]);
|
||||
NativePointer("0x085A7599").writeShort(300);
|
||||
NativePointer("0x085A759F").writeShort(240);
|
||||
}
|
||||
@@ -474,71 +474,6 @@ function splitItemList(item_list, maxSlots) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//角色类 发送邮件函数 (标题, 正文, 金币, 道具列表[[3037,100],[3038,100]])
|
||||
function User::ReqDBSendMultiMail(title, text, gold, item_list) {
|
||||
local Cid = this.GetCID();
|
||||
// 获取分割后的道具列表
|
||||
local subLists;
|
||||
local maxSlots = 10;
|
||||
local length = item_list.len();
|
||||
if (length <= maxSlots) {
|
||||
subLists = [item_list];
|
||||
} else {
|
||||
subLists = [];
|
||||
for (local i = 0; i< length; i += maxSlots) {
|
||||
local end = i + maxSlots;
|
||||
if (end > length) {
|
||||
end = length;
|
||||
}
|
||||
subLists.append(item_list.slice(i, end));
|
||||
}
|
||||
}
|
||||
if (subLists) {
|
||||
// 为每个子列表发送邮件
|
||||
for (local i = 0; i< subLists.len(); ++i) {
|
||||
local subList = subLists[i];
|
||||
|
||||
// 添加道具附件
|
||||
local vector = Memory.alloc(100);
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x81349D6"), "pointer", ["pointer"], vector.C_Object);
|
||||
Sq_CallFunc(S_Ptr("0x817A342"), "pointer", ["pointer"], vector.C_Object);
|
||||
//将所有要发送的道具写入Vector
|
||||
for (local j = 0; j< subList.len(); ++j) {
|
||||
//道具ID 分配4字节内存
|
||||
local item_id = Memory.alloc(4);
|
||||
//道具数量 分配4字节内存
|
||||
local item_cnt = Memory.alloc(4);
|
||||
//写入道具ID和数量
|
||||
item_id.writeInt(subList[j][0]);
|
||||
item_cnt.writeInt(subList[j][1]);
|
||||
|
||||
local pair = Memory.alloc(100);
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x81B8D41"), "pointer", ["pointer", "pointer", "pointer"], pair.C_Object, item_id.C_Object, item_cnt.C_Object);
|
||||
Sq_CallFunc(S_Ptr("0x80DD606"), "pointer", ["pointer", "pointer"], vector.C_Object, pair.C_Object);
|
||||
}
|
||||
|
||||
// 邮件支持10个道具附件格子
|
||||
local addition_slots = Memory.alloc(1000);
|
||||
|
||||
for (local j = 0; j< 10; ++j) {
|
||||
Sq_CallFunc(S_Ptr("0x80CB854"), "pointer", ["pointer"], addition_slots.add(j * 61).C_Object);
|
||||
}
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x8556A14"), "int", ["pointer", "pointer", "int"], vector.C_Object, addition_slots.C_Object, 10);
|
||||
|
||||
local title_ptr = Memory.allocUtf8String(title); // 邮件标题
|
||||
local text_ptr = Memory.allocUtf8String(text); // 邮件正文
|
||||
|
||||
local text_len = text.len(); // 邮件正文长度
|
||||
|
||||
// 发邮件给角色
|
||||
Sq_CallFunc(S_Ptr("0x8556B68"), "int", ["pointer", "pointer", "int", "int", "int", "pointer", "int", "int", "int", "int"], title_ptr.C_Object, addition_slots.C_Object, subList.len(), gold, Cid, text_ptr.C_Object, text_len, 0, 99, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function WongWork_CQuestClear_isClearedQuest(QuestInfo, QuestID) {
|
||||
@@ -640,38 +575,6 @@ function User::MainTaskCompleted() {
|
||||
}
|
||||
|
||||
|
||||
function User::DropItem(ItemId, Xpos, Ypos) {
|
||||
local PartyObj = GetParty();
|
||||
if (!PartyObj) return;
|
||||
//更改掉落物的坐标
|
||||
NativePointer("0x085A7599").writeShort(Xpos);
|
||||
NativePointer("0x085A759F").writeShort(Ypos);
|
||||
//申请一块内存用于存放包地址
|
||||
local PackBuffer = Memory.alloc(8);
|
||||
PackBuffer.writeInt(947330670);
|
||||
local StrBuffer = "" + PackBuffer.C_Object;
|
||||
local AddressStr = StrBuffer.slice(StrBuffer.find("0x") + 2, -1);
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov ebx," + AddressStr,
|
||||
"mov [ebx], eax",
|
||||
"mov ebx , 0",
|
||||
"mov eax, 0x85A775B",
|
||||
"jmp eax");
|
||||
|
||||
Haker.InsertCode("0x85A773C", HexCode);
|
||||
|
||||
//调用逻辑 包才会生成
|
||||
Sq_CallFunc(S_Ptr("0x85A73A6"), "int", ["pointer", "pointer", "int"], PartyObj.C_Object, this.C_Object, ItemId);
|
||||
|
||||
local Pack = Packet(PackBuffer.readPointer());
|
||||
Send(Pack);
|
||||
//销毁包
|
||||
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], Pack.C_Object);
|
||||
//还原逻辑
|
||||
Sq_WriteByteArr(S_Ptr("0x85A773C"), [0x89, 0x44, 0x24, 0x04, 0x8B, 0x45, 0x08]);
|
||||
NativePointer("0x085A7599").writeShort(300);
|
||||
NativePointer("0x085A759F").writeShort(240);
|
||||
}
|
||||
|
||||
|
||||
Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||
@@ -687,196 +590,196 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||
};
|
||||
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
|
||||
// Haker.LoadHook("0x0834F776", ["pointer", "int", "int"],
|
||||
// function(args) {
|
||||
// print(args[0]);
|
||||
// print(args[1]);
|
||||
// return null;
|
||||
// },
|
||||
// function(args) {
|
||||
// print(args[2]);
|
||||
// return null;
|
||||
// });
|
||||
|
||||
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();
|
||||
print("怪物等级: " + MonsterLevel);
|
||||
|
||||
//怪物ID
|
||||
local MonsterId = getroottable().LashKillMonsterId;
|
||||
print("怪物ID: " + MonsterId);
|
||||
|
||||
//坐标
|
||||
local Xpos = NativePointer(args[4]).add(2596).readShort();
|
||||
local Ypos = NativePointer(args[4]).add(2598).readShort();
|
||||
print("坐标: " + Xpos + "," + Ypos);
|
||||
|
||||
|
||||
local DgnObj = BattleFieldObj.GetDgn();
|
||||
//副本名称
|
||||
local DgnName = DgnObj.GetName();
|
||||
print("副本名称: " + DgnName);
|
||||
|
||||
//副本ID
|
||||
local DgnId = DgnObj.GetId();
|
||||
print("副本ID: " + DgnId);
|
||||
|
||||
//副本等级
|
||||
local DgnLevel = DgnObj.GetMinLevel();
|
||||
print("副本等级: " + DgnLevel);
|
||||
|
||||
//深渊标识
|
||||
local HellDiff = BattleFieldObj.GetHellDifficulty();
|
||||
print("深渊标识: " + HellDiff);
|
||||
|
||||
|
||||
for (local i = 0; i< 4; i++) {
|
||||
local SUser = PartyObj.GetUser(i);
|
||||
if (SUser) {
|
||||
SUser.DropItem(MathClass.Rand(3033, 3042), Xpos, Ypos);
|
||||
// print("玩家名称: " + SUser.GetCharacName());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
|
||||
//修改独立掉落原逻辑为不掉落
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov eax, 0x830CD5D",
|
||||
"jmp eax");
|
||||
Haker.InsertCode("0x830CCE2", HexCode);
|
||||
|
||||
|
||||
// local HexCode = Haker.AsmGenerateMcd(
|
||||
// "mov eax,0x666",
|
||||
// "mov ebx,0x86B1B98",
|
||||
// "jmp ebx");
|
||||
|
||||
// Haker.InsertCode("0x86B1B93", HexCode);
|
||||
|
||||
// local RandNum = Sq_CallFunc(S_Ptr("0x086B1B87"), "int", ["int"], -6);
|
||||
// print("返回的随机值: " + RandNum);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//公有方法 获取本机IP
|
||||
// local MyIp = Http.GetMyIp();
|
||||
// print(MyIp);
|
||||
|
||||
//私有方法 发送Get请求
|
||||
// local SO = Http("www.baidu.com");
|
||||
// local BaiduBody = SO.Get("/");
|
||||
// print(BaiduBody);
|
||||
|
||||
//私有方法 发送带参数的Post请求
|
||||
// local SO = Http("192.168.200.189","1311");
|
||||
// local Res = SO.Post("/",{username = "lenheart", password = "123456"});
|
||||
|
||||
// // 创建一个Http Server
|
||||
// local HS = HttpServer("0.0.0.0","41817");
|
||||
// HS.Listen(function (SocketObject,Msg)
|
||||
// {
|
||||
// // print("收到请求内容: " + Msg);
|
||||
|
||||
// //回复字符串
|
||||
// //SocketObject.Write("hello world");
|
||||
// //回复Json 直接Write Table就是Json
|
||||
// SocketObject.Write({
|
||||
// user = "lenheart",
|
||||
// msg = "hello world",
|
||||
// time = clock()
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
|
||||
//初始化PVF 可传路径 可不传
|
||||
// Script();
|
||||
|
||||
//读取装备List 读取完的内容在这个Buffer里
|
||||
// local Buffer = ScriptData.GetFileData("equipment/equipment.lst", function(DataTable, Data) {
|
||||
// while (!Data.Eof()) {
|
||||
// local Key = Data.Get();
|
||||
// //注册装备列表 路径写入 数据未读取
|
||||
// DataTable.rawset(Key, {
|
||||
// Path = Data.Get(),
|
||||
// Data = null
|
||||
// });
|
||||
// }
|
||||
// print("加载装备List完成, 共" + DataTable.len() + "个");
|
||||
// });
|
||||
|
||||
|
||||
// 读取某一件装备的数据
|
||||
// local Buffer = ScriptData.GetFileData("equipment/character/swordman/weapon/hsword/lgcy_agitto_nitras.equ", function(DataTable, Data) {
|
||||
// while (!Data.Eof()) {
|
||||
// local Buf = Data.Get();
|
||||
// print(Buf);
|
||||
// }
|
||||
// });
|
||||
|
||||
// Script();
|
||||
// local Tim = clock();
|
||||
// local Buffer = ScriptData.GetFileData("etc/independent_drop.etc", function(DataTable, Data) {
|
||||
// while (!Data.Eof()) {
|
||||
// local Buf = Data.Get();
|
||||
// }
|
||||
// });
|
||||
|
||||
// print("耗时: " + (clock() - Tim));
|
||||
|
||||
|
||||
// Haker.InsertCode("0x86B1B93", [0xB8, 0x06, 0x00, 0x00, 0x00, 0xBB, 0x98, 0x1B, 0x6B, 0x08, 0xFF, 0xE3]);
|
||||
|
||||
// local RandNum = Sq_CallFunc(S_Ptr("0x086B1B87"), "int", ["int"], -6);
|
||||
// print("返回的随机值: " + RandNum);
|
||||
|
||||
|
||||
|
||||
|
||||
}, 1);
|
||||
|
||||
|
||||
|
||||
ClientSocketPackFuncMap.rawset(21091001, function (SUser, Jso)
|
||||
{
|
||||
ClientSocketPackFuncMap.rawset(21091001, function(SUser, Jso) {
|
||||
printT(Jso);
|
||||
if(Jso.type == 0){
|
||||
saveItemToInven(SUser);
|
||||
if (Jso.type == 0) {
|
||||
// saveItemToInven(SUser);
|
||||
Gm_InputFunc_Handle["aaa"](SUser, "11");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// function _Dps_CrossBorderStones_Main_() {
|
||||
// local Cofig = GlobalConfig.Get("跨界石_Lenheart.json");
|
||||
// Cb_Use_Item_Sp_Func[Cofig.CrossoverId.tointeger()] <- function(SUser, ItemId) {
|
||||
// //获取账号金库对象
|
||||
// local CargoObj = SUser.GetAccountCargo();
|
||||
// //获取账号金库中的一个空格子
|
||||
// local EmptySlot = CargoObj.GetEmptySlot();
|
||||
|
||||
// //如果没有空格子
|
||||
// if (EmptySlot == -1) {
|
||||
// SUser.SendNotiPacketMessage(Cofig.CrossoverStr2, 8);
|
||||
// //不扣除道具
|
||||
// SUser.GiveItem(ItemId, 1);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// //获取角色背包
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// //获取需要转移的装备 这里默认写的装备栏第一个格子
|
||||
// local ItemObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 9);
|
||||
// //获取装备ID
|
||||
// local EquipId = ItemObj.GetIndex();
|
||||
// //获取装备名字
|
||||
// local ItemName = PvfItem.GetNameById(EquipId);
|
||||
// //获取配置中不可跨界的ID数组
|
||||
// local NoCrossId = Cofig.NoCrossIdArr;
|
||||
// //如果这个装备不可跨界
|
||||
// if (NoCrossId.find(EquipId) != null) {
|
||||
// SUser.SendNotiPacketMessage(format(Cofig.CrossoverStr5, ItemName), 7);
|
||||
// //不扣除道具
|
||||
// SUser.GiveItem(ItemId, 1);
|
||||
// return;
|
||||
// }
|
||||
// //如果没找到这个格子的装备
|
||||
// if (!ItemName) {
|
||||
// SUser.SendNotiPacketMessage(Cofig.CrossoverStr1, 8);
|
||||
// //不扣除道具
|
||||
// SUser.GiveItem(ItemId, 1);
|
||||
// return;
|
||||
// }
|
||||
// //跨界
|
||||
// local Flag = CargoObj.InsertItem(ItemObj, EmptySlot);
|
||||
// if (Flag == -1) {
|
||||
// SUser.SendNotiPacketMessage(Cofig.CrossoverStr3, 8);
|
||||
// //不扣除道具
|
||||
// SUser.GiveItem(ItemId, 1);
|
||||
// } else {
|
||||
// //销毁背包中的道具
|
||||
// ItemObj.Delete();
|
||||
// //刷新玩家背包列表
|
||||
// SUser.SendUpdateItemList(1, 0, 9);
|
||||
// //刷新账号金库列表
|
||||
// CargoObj.SendItemList();
|
||||
// SUser.SendNotiPacketMessage(format(Cofig.CrossoverStr4, ItemName), 7);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// Gm_InputFunc_Handle["okok"] <- function(SUser, cmd) {
|
||||
|
||||
// local _Execve_Address = Module.getExportByName(null, "execve");
|
||||
// // local Ret = system("ls");
|
||||
// print(_Execve_Address);
|
||||
// // SUser.SendNotiPacketMessage("出纳上到几点方柏霓撒娇扩大年级卡萨", 7);
|
||||
// }
|
||||
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
|
||||
|
||||
|
||||
}, 1)
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["aaa"] <- function(SUser, cmd) {
|
||||
// 获取角色背包
|
||||
local InvenObj = SUser.GetInven();
|
||||
// 角色仓库
|
||||
local CargoObj = Sq_CallFunc(S_Ptr("0x08151a94"), "pointer", ["pointer"], SUser.C_Object);
|
||||
// 添加计数器
|
||||
local transferCount = 0;
|
||||
// 遍历背包消耗品栏及材料栏
|
||||
for (local i = 57; i <= 152; ++i) {
|
||||
// 获取背包物品
|
||||
local ItemObj = InvenObj.GetSlot(1, i);
|
||||
// 获取背包物品ID
|
||||
local Item_Id = ItemObj.GetIndex();
|
||||
local ItemName = PvfItem.GetNameById(Item_Id);
|
||||
// 如果物品ID为0或3037,跳过(在此可以添加其他需要跳过的物品ID)
|
||||
if (Item_Id == 0 || Item_Id == 3037) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 角色仓库是否存在背包物品
|
||||
local CargoSlot = Sq_CallFunc(S_Ptr("0x850bc14"), "int", ["pointer", "int"], CargoObj, Item_Id);
|
||||
// 如果角色仓库中没有该物品,跳过
|
||||
if (CargoSlot == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取仓库物品指针
|
||||
local cargoItemPointer = NativePointer(CargoObj).add(4).readPointer();
|
||||
// 获取角色仓库物品对象
|
||||
local cargoItemObj = NativePointer(cargoItemPointer).add(61 * CargoSlot);
|
||||
// 获取角色仓库物品ID
|
||||
local cargoItemId = NativePointer(cargoItemPointer).add(61 * CargoSlot + 2).readU32();
|
||||
// 获取角色仓库物品数量
|
||||
local cargoItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], cargoItemObj.C_Object);
|
||||
|
||||
// 获取物品对象
|
||||
local PvfItem = PvfItem.GetPvfItemById(cargoItemId);
|
||||
|
||||
// 获取物品可堆叠数量
|
||||
local getStackableLimit = Sq_CallFunc(S_Ptr("0x0822C9FC"), "int", ["pointer"], PvfItem.C_Object);
|
||||
|
||||
// 如果仓库已达堆叠上限,跳过此物品
|
||||
if (cargoItemCount >= getStackableLimit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取背包物品数量
|
||||
local inventoryItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], ItemObj.C_Object);
|
||||
// 获取物品是否可堆叠
|
||||
local checkStackableLimit = Sq_CallFunc(S_Ptr("0x08501A79"), "int", ["int", "int"], cargoItemId, cargoItemCount + inventoryItemCount);
|
||||
// 尝试将物品储存至角色仓库中
|
||||
local tryAddStackItem = Sq_CallFunc(S_Ptr("0x0850B4B0"), "int", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||
if (tryAddStackItem >= 0) {
|
||||
// 正式将物品插入角色仓库中
|
||||
Sq_CallFunc(S_Ptr("0x850b672"), "pointer", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||
// 删除背包中的物品
|
||||
ItemObj.Delete();
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||
}
|
||||
|
||||
// 处理可堆叠物品
|
||||
if (checkStackableLimit == 0) {
|
||||
// 获取物品总数
|
||||
local totalCount = cargoItemCount + inventoryItemCount;
|
||||
|
||||
// 如果总数不超过上限,全部堆到仓库
|
||||
if (totalCount <= getStackableLimit) {
|
||||
// 将物品堆到仓库
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, totalCount);
|
||||
// 删除背包中的物品
|
||||
ItemObj.Delete();
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||
} else {
|
||||
// 如果总数超过上限
|
||||
// 将仓库的物品数量设置为最大数量
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, getStackableLimit);
|
||||
// 将背包数量减去转移至仓库的数量
|
||||
local transferAmount = getStackableLimit - cargoItemCount;
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], ItemObj.C_Object, totalCount - getStackableLimit);
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + transferAmount, 8);
|
||||
}
|
||||
}
|
||||
|
||||
// 通知客户端更新背包
|
||||
SUser.SendUpdateItemList(1, 0, i);
|
||||
}
|
||||
|
||||
if (transferCount == 0) {
|
||||
SUser.SendNotiBox("没有可转移的物品!", 1);
|
||||
}
|
||||
// 通知客户端更新仓库
|
||||
SUser.SendItemSpace(2);
|
||||
|
||||
print(666);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Register_DPS_Pack(1, function(SUser, Pack) {
|
||||
printT(Pack);
|
||||
|
||||
@@ -222,20 +222,20 @@ class EquimentUseJewel {
|
||||
}
|
||||
|
||||
|
||||
HackReturnAddSocketToAvatarFalg = null;
|
||||
|
||||
|
||||
function HackReturnAddSocketToAvatar(Code) {
|
||||
//标记flag
|
||||
HackReturnAddSocketToAvatarFalg = Code;
|
||||
|
||||
Cb_PacketBuf_get_short_Leave_Func.EquimentUseJewel <- function(args) {
|
||||
Cb_PacketBuf_get_short_Leave_Func.rawdelete("EquimentUseJewel");
|
||||
return 0;
|
||||
}.bindenv(this);
|
||||
function HackAddSocketToAvatarLogic(Flag) {
|
||||
if (Flag) {
|
||||
Sq_WriteByteArr(S_Ptr("821A449"), [0x90,0x90]);
|
||||
Sq_WriteByteArr(S_Ptr("0x821A44B"), array(36,0x90));
|
||||
} else {
|
||||
Sq_WriteByteArr(S_Ptr("821A449"), [0x74,0x2B]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function FixFunction() {
|
||||
//称号回包
|
||||
Cb_CTitleBook_putItemData_Leave_Func.EquimentUseJewel <- function(args) {
|
||||
@@ -258,7 +258,9 @@ class EquimentUseJewel {
|
||||
//装备开孔
|
||||
Cb_AddSocketToAvatar_Enter_Func.EquimentUseJewel <- function(args) {
|
||||
local SUser = User(args[1]);
|
||||
local Pack = Packet(args[2]);
|
||||
local PackCopyBuffer = Memory.alloc(10001);
|
||||
Memory.copy(PackCopyBuffer, NativePointer(args[2]), 1000);
|
||||
local Pack = Packet(PackCopyBuffer.C_Object);
|
||||
local equ_slot = Pack.GetShort();
|
||||
local equitem_id = Pack.GetInt();
|
||||
local sta_slot = Pack.GetShort();
|
||||
@@ -276,7 +278,8 @@ class EquimentUseJewel {
|
||||
//如果已开启镶嵌槽则不执行
|
||||
local equ_id = NativePointer(inven_item.C_Object).add(25).readU32();
|
||||
if (api_exitjeweldata(equ_id)) {
|
||||
HackReturnAddSocketToAvatar(0x13);
|
||||
CUser_SendCmdErrorPacket(SUser, 209, 19);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -285,11 +288,13 @@ class EquimentUseJewel {
|
||||
|
||||
if (ItemType == 10) {
|
||||
SUser.SendNotiBox("装备为武器类型,不支持打孔!", 1)
|
||||
HackReturnAddSocketToAvatar(0x0);
|
||||
CUser_SendCmdErrorPacket(SUser, 209, 0);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
return null;
|
||||
} else if (ItemType == 11) {
|
||||
SUser.SendNotiBox("装备为称号类型,不支持打孔!", 1)
|
||||
HackReturnAddSocketToAvatar(0x0);
|
||||
CUser_SendCmdErrorPacket(SUser, 209, 0);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -310,23 +315,12 @@ class EquimentUseJewel {
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
HackReturnAddSocketToAvatar(0x0);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
return null;
|
||||
}.bindenv(this);
|
||||
|
||||
Cb_AddSocketToAvatar_Leave_Func.EquimentUseJewel <- function(args) {
|
||||
|
||||
local Pack = Packet(args[2]);
|
||||
local equ_slot = Pack.GetShort();
|
||||
print(equ_slot);
|
||||
//跳的错误返回0 正常调用的话不处理返回值
|
||||
if (HackReturnAddSocketToAvatarFalg != null) {
|
||||
local SUser = User(args[1]);
|
||||
// SUser.SendItemSpace(0);
|
||||
CUser_SendCmdErrorPacket(SUser, 209, HackReturnAddSocketToAvatarFalg);
|
||||
HackReturnAddSocketToAvatarFalg = null;
|
||||
return 0;
|
||||
}
|
||||
HackAddSocketToAvatarLogic(false);
|
||||
return null;
|
||||
}.bindenv(this);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ function _Hook_Enter_Currency_Func_(args, TableObj) {
|
||||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf) Ret = Buf;
|
||||
if (Buf != null) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ function _Hook_Leave_Currency_Func_(args, TableObj) {
|
||||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf) Ret = Buf;
|
||||
if (Buf != null) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
@@ -444,4 +444,15 @@ _Hook_Register_Currency_Func_("0x08608C98", ["pointer", "char", "char", "bool"],
|
||||
//检查插入快捷技能槽位
|
||||
Cb_CheckComboSkillInsertQuickSlot_Enter_Func <- {};
|
||||
Cb_CheckComboSkillInsertQuickSlot_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08608D58", ["pointer", "int", "bool"], Cb_CheckComboSkillInsertQuickSlot_Enter_Func, Cb_CheckComboSkillInsertQuickSlot_Leave_Func);
|
||||
_Hook_Register_Currency_Func_("0x08608D58", ["pointer", "int", "bool"], Cb_CheckComboSkillInsertQuickSlot_Enter_Func, Cb_CheckComboSkillInsertQuickSlot_Leave_Func);
|
||||
|
||||
|
||||
//检查每日日程时间 提供者: ZZ
|
||||
Cb_User_CheckDailyScheduleTime_Enter_Func<-{};
|
||||
Cb_User_CheckDailyScheduleTime_Leave_Func<-{};
|
||||
_Hook_Register_Currency_Func_("0x846C0A8",["int","int","int"],Cb_User_CheckDailyScheduleTime_Enter_Func,Cb_User_CheckDailyScheduleTime_Leave_Func);
|
||||
|
||||
//绝望之塔获取上次挑战时间 提供者: ZZ
|
||||
Cb_User_TOD_UserState_getLastClearTime_Enter_Func<-{};
|
||||
Cb_User_TOD_UserState_getLastClearTime_Leave_Func<-{};
|
||||
_Hook_Register_Currency_Func_("0x864387E",["pointer"],Cb_User_TOD_UserState_getLastClearTime_Enter_Func,Cb_User_TOD_UserState_getLastClearTime_Leave_Func);
|
||||
@@ -36,4 +36,25 @@ function printT(T)
|
||||
function LoadConfig(Path)
|
||||
{
|
||||
dofile("/dp_s/" + Path);
|
||||
}
|
||||
|
||||
if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329) {
|
||||
function print(Object) {
|
||||
switch (typeof Object) {
|
||||
case "table":
|
||||
case "array": {
|
||||
local str = Json.Encode(Object);
|
||||
Sq_OutPutTable(str);
|
||||
break;
|
||||
}
|
||||
case "string":
|
||||
case "integer": {
|
||||
output(Object);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
output(Object);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
145
Dps_A/main.nut
145
Dps_A/main.nut
@@ -22,7 +22,6 @@ function InitPluginInfo() {
|
||||
//初始化
|
||||
PoolObj.Init();
|
||||
|
||||
GameManager.FixEquipUseJewel();
|
||||
GameManager.Fix14Skill();
|
||||
|
||||
Sq_CreatSocketConnect("192.168.200.20", "65109");
|
||||
@@ -42,6 +41,22 @@ function InitPluginInfo() {
|
||||
|
||||
GameManager.OpenCreateJob_CreatorMage();
|
||||
|
||||
|
||||
// function IndependenceDropLogic(SUser, MonsterId, MonsterLevel, Xpos, Ypos, DgnName, DgnId, DgnLevel,DgnDiff, HellDiff)
|
||||
// {
|
||||
// //注意这里组队时每一个队员都会调用一次这个函数
|
||||
|
||||
// //如果角色名字为游戏管理员 掉落3037
|
||||
// if(SUser.GetCharacName() == "游戏管理员")
|
||||
// SUser.DropItem(3037, Xpos, Ypos);
|
||||
// //如果怪物ID 为 1 掉落 3038
|
||||
// if(MonsterId == 1)
|
||||
// SUser.DropItem(3038, Xpos, Ypos);
|
||||
// }
|
||||
|
||||
// GameManager.OpenIndependenceDropMode(IndependenceDropLogic);
|
||||
GameManager.FixEmailRemovalVerification();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,12 +65,16 @@ function PrintTag() {
|
||||
print(InitSuccessTag);
|
||||
}
|
||||
|
||||
|
||||
function main() {
|
||||
|
||||
InitPluginInfo();
|
||||
|
||||
PrintTag();
|
||||
|
||||
//读取全部配置文件
|
||||
|
||||
|
||||
GameManager.SetGameMaxLevel(95);
|
||||
// GameManager.FixAvatarUseJewel();
|
||||
GameManager.FixSaveTown();
|
||||
@@ -68,6 +87,130 @@ function main() {
|
||||
|
||||
// Sq_Conversion("這是一個繁體字符串");
|
||||
|
||||
|
||||
_Start_Official_Project_();
|
||||
|
||||
|
||||
|
||||
// if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329) {
|
||||
// function _Rindro_OldLogic_Enter(CUser, PacketId, PacketSrc) {
|
||||
|
||||
// //区域移动
|
||||
// if (PacketId == 38) {
|
||||
// local Ret = Cb_move_area(CUser, NativePointer(PacketSrc).add(0x0D).readU8(), NativePointer(PacketSrc).add(0x0E).readU8());
|
||||
// if (!Ret) {
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
// //普通输入
|
||||
// else if (PacketId == 17) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// local Size = NativePointer(PacketSrc).add(20).readInt();
|
||||
// local Str = NativePointer(PacketSrc).add(24).readUtf8String(Size);
|
||||
// Cb_base_input(CUser, Str);
|
||||
// }, 1);
|
||||
// }
|
||||
// //GM输入
|
||||
// else if (PacketId == 179) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// local Size = NativePointer(PacketSrc).add(13).readInt();
|
||||
// local Str = NativePointer(PacketSrc).add(17).readUtf8String(Size);
|
||||
// Cb_gm_input(CUser, Str.slice(2));
|
||||
// }, 1);
|
||||
// }
|
||||
// //特殊道具使用
|
||||
// else if (PacketId == 255) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// Cb_use_item_sp(CUser, NativePointer(PacketSrc).add(0x0D).readInt());
|
||||
// }, 1);
|
||||
// }
|
||||
// //返回选择角色
|
||||
// else if (PacketId == 7) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// Cb_return_select_character(CUser);
|
||||
// }, 1);
|
||||
// }
|
||||
// //组队 创建和加入
|
||||
// else if (PacketId == 10) {
|
||||
// local Ret = Cb_userpartycreate(CUser);
|
||||
// if (!Ret) {
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
// //下线
|
||||
// else if (PacketId == 3) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// Cb_player_exit(CUser);
|
||||
// }, 1);
|
||||
// }
|
||||
// // //查看信息
|
||||
// // else if (PacketId == 8) {
|
||||
// // Cb_see_information(CUser, PacketSrc);
|
||||
// // }
|
||||
// //自定义包
|
||||
// else if (PacketId == 130) {
|
||||
|
||||
// Timer.SetTimeOut(function() {
|
||||
// OnClientSocketMsg(CUser, Str);
|
||||
// }, 1);
|
||||
// }
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
// function _Rindro_OldLogic_Leave(CUser, PacketId, PacketSrc) {
|
||||
// //更换装备
|
||||
// if (PacketId == 19) {
|
||||
// Cb_player_chanage_equ(CUser);
|
||||
// }
|
||||
// //组队 同意组队和同意加入
|
||||
// else if (PacketId == 11) {
|
||||
// Cb_userpartyagree(CUser);
|
||||
// }
|
||||
// //组队 退出队伍
|
||||
// else if (PacketId == 13) {
|
||||
// Cb_userpartyexit(CUser);
|
||||
// }
|
||||
// //组队 踢出队伍
|
||||
// else if (PacketId == 14) {
|
||||
// Cb_userpartykick(CUser);
|
||||
// }
|
||||
// //组队 委任队长
|
||||
// else if (PacketId == 124) {
|
||||
// Cb_userpartygivemaster(CUser);
|
||||
// }
|
||||
// return null;
|
||||
// };
|
||||
|
||||
// Haker.LoadHook("0x08594E52", ["pointer", "int", "pointer", "int", "int"],
|
||||
// function(args) {
|
||||
// local CallArr = [];
|
||||
// local v4 = Sq_CallFunc(S_Ptr("0x080CC18E"), "pointer", []);
|
||||
// local cuser = Sq_CallFunc(S_Ptr("0x082947A4"), "pointer", ["pointer", "int"], v4, args[1]);
|
||||
// if (!cuser) return;
|
||||
// local PacketId = NativePointer(args[2]).add(1).readShort();
|
||||
// local Ret = _Rindro_OldLogic_Enter(cuser, PacketId, args[2]);
|
||||
// if (Ret == -1) {
|
||||
// NativePointer(args[2]).add(1).writeShort(-1);
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// function(args) {
|
||||
// local CallArr = [];
|
||||
// local v4 = Sq_CallFunc(S_Ptr("0x080CC18E"), "pointer", []);
|
||||
// local cuser = Sq_CallFunc(S_Ptr("0x082947A4"), "pointer", ["pointer", "int"], v4, args[1]);
|
||||
// if (!cuser) return;
|
||||
// local PacketId = NativePointer(args[2]).add(1).readShort();
|
||||
// Timer.SetTimeOut(function() {
|
||||
// _Rindro_OldLogic_Leave(cuser, PacketId, args[2]);
|
||||
// }, 1);
|
||||
// return null;
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user