This commit is contained in:
lenheart 2024-11-15 19:53:44 +08:00
parent 6c71c79563
commit 9d84fe256d
17 changed files with 1042 additions and 106 deletions

View File

@ -145,6 +145,19 @@ class GameManager extends Base_C_Object {
Sq_WriteByteArr(S_Ptr("0x86464CE"), Arr);
}
//+13免刷新
function Fix_13Upgrade() {
Haker.LoadHook("0x080FC850", ["pointer", "pointer", "pointer", "int", "void"],
function(args) {
return null;
},
function(args) {
local Pos = NativePointer(args[2]).add(27).readU16();
local SUser = User(args[1]);
SUser.SendUpdateItemList(1, 0, Pos);
return null;
});
}
}
//热重载
function _Reload_List_Write_(Path) {

View File

@ -23,6 +23,7 @@ class _Hacker {
}
local Controler = Sq_HookFunc(S_Ptr(AddressStr), ArgumentArr, EnterFunc, LeaveFunc);
print(Controler);
HookTable.rawset(AddressStr, Controler);
}
}

View File

@ -37,29 +37,3 @@ class Http {
return Request("GET", Url, Content);
}
}
Timer.SetTimeOut(function() {
// local Dio = Http("192.168.200.189", "45123");
// local Jso = {
// a = 1,
// b = 4.8,
// c = "测试"
// }
// local JsonStr = Json.Encode(Jso);
// local Res = Dio.Post("/", JsonStr);
// print(Res);
// local NowTimesstamp = Sq_GetTimestampString();
// print(NowTimesstamp);
// local Trad = Sq_Conversion("這是繁體語句", 0);
// local Simple = Sq_Conversion("这是简体语句", 1);
// print(Trad);
// print(Simple);
}, 0);
// local Dio = Http("myip.ipip.net", "443");
// local Res = Dio.Get("/", "");
// print(Res);

View File

@ -18,10 +18,6 @@ class IO extends Base_C_Object {
_Rewind_Address = Module.getExportByName(null, "rewind");
_Flush_Address = Module.getExportByName(null, "fflush");
Pos = 0;
constructor(FileName, Modes) {
local FileObj = Sq_CallFunc(_Fopen_Address, "pointer", ["pointer", "pointer"], Str_Ptr(FileName), Str_Ptr(Modes));
if (FileObj) {

View File

@ -13,6 +13,16 @@ class Memory {
function allocUtf8String(Str) {
return NativePointer(Str_Ptr(Str));
}
function copy(P1, P2, Size) {
local WriteArr = Sq_ReadByteArr(P2.C_Object, Size);
P1.writeByteArray(WriteArr);
}
function reset(P1, Size) {
local WriteArr = array(Size, 0);
P1.writeByteArray(WriteArr);
}
}
class NativePointer extends Base_C_Object {
@ -41,13 +51,11 @@ class NativePointer extends Base_C_Object {
}
function add(intoffset) {
this.C_Object = Sq_PointerOperation(this.C_Object, intoffset, "+");
return this;
return NativePointer(Sq_PointerOperation(this.C_Object, intoffset, "+"));
}
function sub(intoffset) {
this.C_Object = Sq_PointerOperation(this.C_Object, intoffset, "-");
return this;
return NativePointer(Sq_PointerOperation(this.C_Object, intoffset, "-"));
}
function writeByteArray(arr) {

View File

@ -287,25 +287,19 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
// print("初始化开始时间: " + time());
// local PvfObject = Script();
// print("初始化结束时间: " + time());
local Data = ScriptData.GetEquipment(305014);
printT(Data);
print(123123);
local Str = "{\"op\":2024041602,\"uid\":1,\"map\":{\"id\":15154,\"ra\":0},\"cid\":1}";
local Pack = Packet();
Pack.Put_Header(0, 370);
Pack.Put_Byte(8);
Pack.Put_Short(0);
Pack.Put_Byte(3);
Pack.Put_Int(SendStrLen);
Pack.Put_BinaryEx(Memory.allocUtf8String(SendStr).C_Object, SendStrLen);
Pack.Put_Header(1, 130);
Pack.Put_Byte(1);
Pack.Put_BinaryEx(Memory.alloc(104).C_Object, 104);
// foreach(color in ColorArr) {
// Pack.Put_BinaryEx(color, 104);
// }
Pack.Put_Int(Str.len());
Pack.Put_Binary(Str);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
print("asdasdadad");
// local Sing = Memory.alloc(100);
@ -746,10 +740,12 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
};
Gm_InputFunc_Handle.AAA <- function(SUser, CmdString) {
print(789456);
local Str = "{\"op\":20078034,\"info\":[{\"uid\":1,\"name\":\"Kina\",\"growjob\":4,\"avatar\":[101550559,101560718,101570470,101520542,101500739,101510903,101540654,101580144,101530499],\"job\":0},{\"uid\":2,\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[105550431,105560424,105570386,105520415,105500424,105510429,105540408,105580144,105530361],\"job\":5},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0}]}";
Gm_InputFunc_Handle.WEQ <- function(SUser, CmdString) {
// World.MoveArea(SUser, 1, 0, 55, 349);
// print(789456);
// local Str = "{\"op\":20078034,\"info\":[{\"uid\":1,\"name\":\"Kina\",\"growjob\":4,\"avatar\":[101550559,101560718,101570470,101520542,101500739,101510903,101540654,101580144,101530499],\"job\":0},{\"uid\":2,\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[105550431,105560424,105570386,105520415,105500424,105510429,105540408,105580144,105530361],\"job\":5},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0}]}";
local Str = "{\"op\":20084038,\"uid\":2,\"type\":9,\"cid\":2}";
local Pack = Packet();
Pack.Put_Header(1, 130);
Pack.Put_Byte(1);
@ -763,12 +759,54 @@ Gm_InputFunc_Handle.AAA <- function(SUser, CmdString) {
};
function HexStringToInt(Str) {
if (!(getroottable().rawin("__strtol__function__address__"))) __strtol__function__address__ <- Module.getExportByName(null, "strtol");
local Ret = Sq_CallFunc(__strtol__function__address__, "int", ["pointer", "pointer", "int"], Memory.allocUtf8String(Str).C_Object, Memory.alloc(0), 16);
return Ret;
}
function UserdataSliceStr(Data) {
local Str = "" + Data;
local Pos = Str.find("0x");
local Pos2 = Str.find(")");
local Ret = Str.slice(Pos + 2, Pos2);
return Ret;
}
// //幸运值获取装备品级
// Haker.LoadHook("0x08550BE4", ["pointer", "pointer", "int", "int", "int"],
// function(args) {
// local P = args[0];
// local ABuf = NativePointer(P).readPointer();
// local BBuf = NativePointer(P).add(4).readPointer();
// local A = HexStringToInt(UserdataSliceStr(ABuf).slice(-5));
// local B = HexStringToInt(UserdataSliceStr(BBuf).slice(-5));
// local Size = (B - A) >> 2;
// print(Size);
// },
// function(args) {
// return 4;
// });
Cb_fnStatQuestClear_Enter_Func.text <- function(args) {
local user = User(args[0])
print(args[1]);
print(user.GetCharacName());
};
Timer.SetTimeOut(function() {
print("执行任务")
}, 2000);
local P = S_Ptr("0x08550BE4");
local ABuf = NativePointer(P).readPointer();
print("ABuf: " + ABuf);
local BBuf = NativePointer(P).add(4).readPointer();
print("BBuf: " + BBuf);
local A = HexStringToInt(UserdataSliceStr(ABuf).slice(-5));
print("A:" + A);
local B = HexStringToInt(UserdataSliceStr(BBuf).slice(-5));
print("B:" + B);
local Size = (B - A) >> 2;
print(Size);
}, 0)

View File

@ -4,6 +4,23 @@
创建日期:2024-05-01 16:24
文件用途:服务端核心类
*/
function removeBackslashes(str) {
local result = "";
local index = 0;
local backslashIndex = -1;
while (true) {
backslashIndex = str.find("\\", index);
if (backslashIndex == null) {
result += str.slice(index);
break;
}
result += str.slice(index, backslashIndex);
index = backslashIndex + 1;
}
return result;
}
class ServerControl {
function Get_User_Item_Count(SUser, ItemId) {
@ -26,25 +43,8 @@ class ServerControl {
};
}
function removeBackslashes(str) {
local result = "";
local index = 0;
local backslashIndex = -1;
while (true) {
backslashIndex = str.find("\\", index);
if (backslashIndex == null) {
result += str.slice(index);
break;
}
result += str.slice(index, backslashIndex);
index = backslashIndex + 1;
}
return result;
}
constructor() {
//分发来自网关的包
GatewaySocketPackFuncMap.rawset(20240730, function(Jso) {
local UserList = [];
@ -53,7 +53,6 @@ class ServerControl {
if (SUser) UserList.append(SUser);
else UserList.append(null);
}
foreach(_Index, SUser in UserList) {
if (SUser) {
Jso.uid <- SUser.GetUID();
@ -707,6 +706,21 @@ class ServerControl {
}
}
}
//任务完成
Cb_fnStatQuestClear_Enter_Func.ServerControl <- function(args) {
local SUser = User(args[0])
local Jso = {
uid = SUser.GetUID(),
cid = SUser.GetCID(),
queId = args[1],
op = 20069009
}
Socket.SendGateway(Jso);
};
}
}

View File

@ -0,0 +1,496 @@
/*
文件名:EquimentUseJewel.nut
路径:Dps_A/ProjectClass/EquimentUseJewel/EquimentUseJewel.nut
创建日期:2024-10-28 21:18
文件用途:装备镶嵌
*/
class EquimentUseJewel {
ExecUser = null;
//建库建表
function CreateMysqlTable() {
local CreateSql1 = "create database if not exists l_equ_jewel default charset utf8;"
local CreateSql2 = "CREATE TABLE l_equ_jewel.equipment ( equ_id int(11) AUTO_INCREMENT, jewel_data blob NOT NULL,andonglishanbai_flag int(11),date VARCHAR(255), PRIMARY KEY (equ_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8,AUTO_INCREMENT = 150;"
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Exec_Sql(CreateSql1);
SqlObj.Exec_Sql(CreateSql2);
MysqlPool.GetInstance().PutConnect(SqlObj);
}
function api_get_jewel_socket_data(id) { //获取徽章数据,存在返回徽章数据,不存在返回空字节数据
local CheckSql = "SELECT jewel_data FROM l_equ_jewel.equipment where equ_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["binary"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
//没结婚要返回false
if (Ret.len()< 1 || Ret[0][0] == null) {
return 0;
} else {
return Ret[0][0];
}
}
function api_exitjeweldata(id) { //0代表不存在,存在返回1
local CheckSql = "SELECT andonglishanbai_flag FROM l_equ_jewel.equipment where equ_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["int"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
//没结婚要返回false
if (Ret.len()< 1 || Ret[0][0] == null) {
return 0;
} else {
return Ret[0][0];
}
}
function save_equiment_socket(socket_data, id) { //0代表不存在,存在返回1
local CheckSql = "UPDATE l_equ_jewel.equipment SET jewel_data = 0x" + socket_data + " WHERE equ_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["int"]);
printT(Ret);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
//没结婚要返回false
if (Ret.len()< 1 || Ret[0][0] == null) {
return false;
} else {
return true;
}
}
function CUser_SendCmdErrorPacket(SUser, id, id2) {
local Pack = Packet();
Pack.Put_Header(1, id);
Pack.Put_Byte(0);
Pack.Put_Byte(id2);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
function api_PacketBuf_get_buf(packet_buf) {
return NativePointer(NativePointer(packet_buf).add(20).readPointer()).add(13);
}
function add_equiment_socket(equipment_type) { //0代表开孔失败 成功返回标识
/*
武器10
称号11
上衣12
头肩13
下衣14
鞋子15
腰带16
项链17
手镯18
戒指19
辅助装备20
魔法石21
*/
/*
红色:'010000000000010000000000000000000000000000000000000000000000' A
黄色:'020000000000020000000000000000000000000000000000000000000000' B
绿色:'040000000000040000000000000000000000000000000000000000000000' C
蓝色:'080000000000080000000000000000000000000000000000000000000000' D
白金:'100000000000100000000000000000000000000000000000000000000000'
*/
local DB_JewelsocketData = "";
switch (equipment_type) {
case 10: //武器10 SS
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
case 11: //称号11 SS
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
case 12: //上衣12 C
DB_JewelsocketData = "040000000000040000000000000000000000000000000000000000000000"
break;
case 13: //头肩13 B
DB_JewelsocketData = "020000000000020000000000000000000000000000000000000000000000"
break;
case 14: //下衣14 C
DB_JewelsocketData = "040000000000040000000000000000000000000000000000000000000000"
break;
case 15: //鞋子15 D
DB_JewelsocketData = "080000000000080000000000000000000000000000000000000000000000"
break;
case 16: //腰带16 A
DB_JewelsocketData = "010000000000010000000000000000000000000000000000000000000000"
break;
case 17: //项链17 B
DB_JewelsocketData = "020000000000020000000000000000000000000000000000000000000000"
break;
case 18: //手镯18 D
DB_JewelsocketData = "080000000000080000000000000000000000000000000000000000000000"
break;
case 19: //戒指19 A
DB_JewelsocketData = "010000000000010000000000000000000000000000000000000000000000"
break;
case 20: //辅助装备20 S
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
case 21: //魔法石21 S
DB_JewelsocketData = "100000000000000000000000000000000000000000000000000000000000"
break;
default:
DB_JewelsocketData = "000000000000000000000000000000000000000000000000000000000000"
break;
}
local date = time();
local Ct = Sq_GetTimestampString();
date = date.tostring() + Ct;
local CheckSql = "INSERT INTO l_equ_jewel.equipment (andonglishanbai_flag,jewel_data,date) VALUES(1,0x" + DB_JewelsocketData + ",\'" + date + "\');";
local CheckSql1 = "SELECT equ_id FROM l_equ_jewel.equipment where date = \'" + date + "\';";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Select(CheckSql, ["int"]);
local Ret = SqlObj.Select(CheckSql1, ["int"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
if (Ret.len()< 1 || Ret[0][0] == null) {
return 0;
} else {
return Ret[0][0];
}
return 0;
}
function CStackableItem_getJewelTargetSocket(C_Object) {
return Sq_CallFunc(S_Ptr("0x0822CA28"), "int", ["pointer"], C_Object);
}
function CUser_SendUpdateItemList_DB(SUser, Slot, DB_JewelSocketData) {
local Pack = Packet();
Pack.Put_Header(0, 14);
Pack.Put_Byte(0);
Pack.Put_Short(1);
local InvenObj = SUser.GetInven();
Sq_CallFunc(S_Ptr("0x084FC6BC"), "int", ["pointer", "int", "int", "pointer"], InvenObj.C_Object, 1, Slot, Pack.C_Object);
Pack.Put_BinaryEx(DB_JewelSocketData.C_Object, 30);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
function GetByte(value) {
local Blob = blob();
Blob.writen(value, 'w');
print(Blob.len());
return Blob;
}
function intToHex(num) {
if (num == 0) {
return "0";
}
local hexDigits = "0123456789abcdef";
local hexString = "";
while (num > 0) {
local remainder = num % 16;
hexString = hexDigits[remainder] + hexString;
num = (num / 16).tointeger();
}
return hexString;
}
function lengthCutting(str, ystr, num, maxLength) {
// 如果字符串长度小于最大长度在前面补0
local lengthDiff = maxLength - str.len();
if (lengthDiff > 0) {
local zeroPadding = "";
for (local i = 0; i< lengthDiff; i++) {
zeroPadding += "0";
}
str = zeroPadding + str;
}
local strArr = "";
for (local i = 0; i< str.len(); i += num) {
local endIndex = i + num;
if (endIndex > str.len()) {
endIndex = str.len();
}
strArr += str.slice(i, endIndex);
}
return ystr + strArr;
}
HackReturnAddSocketToAvatarFalg = null;
function HackReturnAddSocketToAvatar(Code) {
//通过hook get short直接返回0达到错误返回的效果
//标记flag
HackReturnAddSocketToAvatarFalg = Code;
Haker.LoadHook("0x0858D0B0", ["pointer", "pointer", "int"],
function(args) {
return null;
},
function(args) {
Haker.UnLoadHook("0x0858D0B0");
return 0;
});
}
function FixFunction() {
//称号回包
Haker.LoadHook("0x08641A6A", ["pointer", "pointer", "int", "pointer", "int"],
function(args) {
return null;
}.bindenv(this),
function(args) {
local JewelSocketData = api_get_jewel_socket_data(NativePointer(args[3]).add(25).readU32());
local ret = args.pop();
if (JewelSocketData && NativePointer(JewelSocketData).add(0).readU8() != 0) {
local Pack = Packet(args[1]);
Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
}
return null;
}.bindenv(this));
//设计图继承
Haker.LoadHook("0x08671EB2", ["pointer", "pointer", "pointer", "int"],
function(args) {
local jewelSocketID = NativePointer(args[2]).add(25).readU32();
NativePointer(args[1]).add(25).writeU32(jewelSocketID);
return null;
}.bindenv(this),
function(args) {
return null;
}.bindenv(this));
//装备开孔
Haker.LoadHook("0x0821A412", ["pointer", "pointer", "pointer", "int"],
function(args) {
local SUser = User(args[1]);
local Pack = Packet(args[2]);
local equ_slot = Pack.GetShort();
local equitem_id = Pack.GetInt();
local sta_slot = Pack.GetShort();
local CurCharacInvenW = SUser.GetInven();
local inven_item = CurCharacInvenW.GetSlot(1, equ_slot);
if (equ_slot > 56) { //修改后大于56则是时装装备 原:如果不是装备文件就调用原逻辑
equ_slot = equ_slot - 57;
local C_PacketBuf = api_PacketBuf_get_buf(args[2]) //获取原始封包数据
C_PacketBuf.add(0).writeShort(equ_slot) //修改掉装备位置信息 时装类镶嵌从57开始。
//执行原逻辑
return null;
}
//如果已开启镶嵌槽则不执行
local equ_id = NativePointer(inven_item.C_Object).add(25).readU32();
if (api_exitjeweldata(equ_id)) {
HackReturnAddSocketToAvatar(0x13);
return null;
}
local item = PvfItem.GetPvfItemById(equitem_id);
local ItemType = Sq_CallFunc(S_Ptr("0x08514D26"), "int", ["pointer"], item.C_Object);
if (ItemType == 10) {
SUser.SendNotiBox("装备为武器类型,不支持打孔!", 1)
HackReturnAddSocketToAvatar(0x0);
return null;
} else if (ItemType == 11) {
SUser.SendNotiBox("装备为称号类型,不支持打孔!", 1)
HackReturnAddSocketToAvatar(0x0);
return null;
}
local id = add_equiment_socket(ItemType);
Sq_Inven_RemoveItemFormCount(CurCharacInvenW.C_Object, 1, sta_slot, 1, 8, 1); //删除打孔道具
NativePointer(inven_item.C_Object).add(25).writeU32(id) //写入槽位标识
SUser.SendUpdateItemList(1, 0, equ_slot);
local JewelSocketData = api_get_jewel_socket_data(id);
CUser_SendUpdateItemList_DB(SUser, equ_slot, JewelSocketData); //用于更新镶嵌后的装备显示,这里用的是带镶嵌数据的更新背包函数,并非CUser_SendUpdateItemList
local Pack = Packet();
Pack.Put_Header(1, 209);
Pack.Put_Byte(1);
Pack.Put_Short(equ_slot + 104);
Pack.Put_Short(sta_slot);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
HackReturnAddSocketToAvatar(0x0);
return null;
}.bindenv(this),
function(args) {
//跳的错误返回0 正常调用的话不处理返回值
if (HackReturnAddSocketToAvatarFalg != null) {
local SUser = User(args[1]);
// SUser.SendItemSpace(0);
CUser_SendCmdErrorPacket(SUser, 209, HackReturnAddSocketToAvatarFalg);
HackReturnAddSocketToAvatarFalg = null;
return 0;
}
return null;
}.bindenv(this));
//装备镶嵌和时装镶嵌
Haker.LoadHook("0x8217BD6", ["int", "pointer", "pointer", "int"],
function(args) {
local SUser = User(args[1]);
local Pack = Packet(args[2]);
local State = SUser.GetState();
if (State != 3) return null;
local avartar_inven_slot = Pack.GetShort();
local avartar_item_id = Pack.GetInt();
local emblem_cnt = Pack.GetByte();
//下面是参照原时装镶嵌的思路写的。个别点标记出来。
if (avartar_inven_slot > 104) {
local equipment_inven_slot = avartar_inven_slot - 104; //取出真实装备所在背包位置值
local Inven = SUser.GetInven();
local equipment = Inven.GetSlot(1, equipment_inven_slot);
//校验是否合法
if (!equipment || equipment.IsEmpty || (equipment.GetIndex() != avartar_item_id) || SUser.CheckItemLock(1, equipment_inven_slot)) return;
local id = NativePointer(equipment.C_Object).add(25).readU32();
local JewelSocketData = api_get_jewel_socket_data(id);
if (!JewelSocketData) return;
local emblems = {};
if (emblem_cnt <= 3) {
for (local i = 0; i< emblem_cnt; i++) {
local emblem_inven_slot = Pack.GetShort();
local emblem_item_id = Pack.GetInt();
local equipment_socket_slot = Pack.GetByte();
local emblem = Inven.GetSlot(1, emblem_inven_slot);
//校验徽章及插槽数据是否合法
if (!emblem || emblem.IsEmpty || (emblem.GetIndex() != emblem_item_id) || (equipment_socket_slot >= 3)) return;
//校验徽章是否满足时装插槽颜色要求
//获取徽章pvf数据
local citem = PvfItem.GetPvfItemById(emblem_item_id);
if (!citem) return;
//校验徽章类型
if (!citem.IsStackable() || citem.GetItemType() != 20) return;
//获取徽章支持的插槽
local emblem_socket_type = CStackableItem_getJewelTargetSocket(citem.C_Object);
//获取要镶嵌的时装插槽类型
local avartar_socket_type = JewelSocketData.add(equipment_socket_slot * 6).readShort();
if (!(emblem_socket_type & avartar_socket_type)) {
return;
}
emblems[equipment_socket_slot] <- [emblem_inven_slot, emblem_item_id];
}
}
foreach(equipment_socket_slot, emblemObject in emblems) {
//删除徽章
local emblem_inven_slot = emblemObject[0];
Sq_Inven_RemoveItemFormCount(Inven.C_Object, 1, emblem_inven_slot, 1, 8, 1); //删除打孔道具
//设置时装插槽数据
local emblem_item_id = emblemObject[1];
JewelSocketData.add(2 + 6 * equipment_socket_slot).writeU32(emblem_item_id);
}
local Buf = Sq_Point2Blob(JewelSocketData.C_Object, 30);
local Str = "";
foreach(Value in Buf) {
Str += format("%02X", Value);
}
save_equiment_socket(Str, id);
// if (!save_equiment_socket(DB_JewelSocketData, id)) {
// print("写入失败了");
// return null;
// }
CUser_SendUpdateItemList_DB(SUser, equipment_inven_slot, JewelSocketData); //用于更新镶嵌后的装备显示,这里用的是带镶嵌数据的更新背包函数,并非CUser_SendUpdateItemList
local Pack = Packet();
Pack.Put_Header(1, 209);
Pack.Put_Byte(1);
Pack.Put_Short(equipment_inven_slot + 104);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
return null;
}.bindenv(this),
function(args) {
return 0;
}.bindenv(this));
//额外数据包,发送装备镶嵌数据给本地处理
Haker.LoadHook("0x0815098e", ["pointer", "pointer", "int"],
function(args) {
return null;
}.bindenv(this),
function(args) {
local ret = args.pop();
local Inven_Item = NativePointer(args[1]);
if (Inven_Item.add(1).readU8() == 1) {
local ItemObj = Item(args[1]);
local JewelSocketData = api_get_jewel_socket_data(NativePointer(ItemObj.C_Object).add(25).readU32());
if (JewelSocketData && JewelSocketData.add(0).readU8() != 0) {
local Pack = Packet(args[0]);
Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
}
}
return null;
}.bindenv(this));
//装备全字节复制
Haker.LoadHook("0x0814A62E", ["pointer", "pointer", "pointer"],
function(args) {
return null;
}.bindenv(this),
function(args) {
local Old = NativePointer(args[1]);
local New = NativePointer(args[0]);
Memory.copy(New, Old, 61);
return args[0];
}.bindenv(this));
//装备全字节删除
Haker.LoadHook("0x080CB7D8", ["pointer", "int"],
function(args) {
return null;
}.bindenv(this),
function(args) {
local New = NativePointer(args[0]);
Memory.reset(New, 61);
return null;
}.bindenv(this));
}
constructor() {
CreateMysqlTable();
FixFunction();
}
}
getroottable().RRR <- EquimentUseJewel();

View File

@ -0,0 +1,232 @@
/*
文件名:LukeClass.nut
路径:Dps_A/ProjectClass/Luke/LukeClass.nut
创建日期:2024-07-15 20:46
文件用途:卢克服务的文件
*/
class Luke {
//频道
Channel = 19;
//城镇
Town = 18;
//服务端区域移动添加玩家HOOK 让大家不可见
function insert_user_hook(C_Area, C_User) {
//如果有城镇配置
if (Town) {
local SUser = User(C_User);
if (SUser.GetLocation().Town == Town) {
if (SUser.GetLocation().Area > 1) Sq_WriteAddress(C_Area, 0x68, 1);
}
}
}
//服务端区域移动HOOK 让玩家不可以直接去另一个区域
function move_area_hook(CUser, TownIndex, AreaIndex) {
// return true;//TODO
if (!CUser) return true;
local SUser = User(CUser);
//卢克频道
if (Sq_Game_GetConfig().find("19") != null) {
if (AreaIndex <= 1) {
return true;
} else {
local Jso = {
op = 20084023,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
regionId = AreaIndex
}
Socket.SendGateway(Jso);
return false;
}
} else {
return true;
}
}
//玩家发送消息HOOK 为了攻坚队频道和团长公告
function base_input_hook(CUser, CmdString) {
if (!CUser) return true;
local SUser = User(CUser);
//卢克频道
if (Sq_Game_GetConfig().find("19") != null) {
local Localtion = SUser.GetLocation();
if (Localtion.Area <= 1) {
return true;
} else {
local Jso = {
op = 20084027,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
msg = CmdString
}
Socket.SendGateway(Jso);
return false;
}
} else {
return true;
}
}
//玩家消息分发
function PlayerNotiMsgDistribute(Jso) {
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (!SUser) return;
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
}
local SUserName = SUser.GetCharacName();
local Type = Jso.type;
Jso.msg = Jso.msg.slice(0, Jso.msg.len() - 11);
if (Type == -1) {
Jso.Name <- SUserName;
foreach(_Index, Value in RealList) {
local SendObj = Value;
SendObj.SendJso(Jso);
}
Type = "长"
}
local NotiStr = "(攻坚队" + Type + ") " + "" + SUserName + " " + Jso.msg;
foreach(_Index, Value in RealList) {
local SendObj = Value;
SendObj.SendNotiPacketMessage(NotiStr, 8);
}
}
function LukeSendAreaUserCallBack(Jso) {
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
}
foreach(_Index, Value in RealList) {
local SUser = Value;
local Pack = Packet();
Pack.Put_Header(0, 24);
Pack.Put_Byte(SUser.GetLocation().Town); //城镇
Pack.Put_Byte(SUser.GetArea(1)); //区域
Pack.Put_Short((RealList.len() - 1)); //几个玩家 要减去自己
foreach(__Index, MapObj in RealList) {
if (SUser.GetUID() == MapObj.GetUID()) continue;
Pack.Put_Short(MapObj.GetUniqueId());
Pack.Put_Short(MapObj.GetAreaPos().X);
Pack.Put_Short(MapObj.GetAreaPos().Y);
Pack.Put_Byte(MapObj.GetDirections()); //朝向
Pack.Put_Byte(MapObj.GetVisibleValues()); //是否可见
}
Pack.Put_Byte(1); //是否可见
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
}
function LukePlayerMoveMapCallBack(Jso) {
local MoveSUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (!MoveSUser) return;
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
}
local Pack = Packet();
Pack.Put_Header(0, 22);
Pack.Put_Short(MoveSUser.GetUniqueId());
Pack.Put_Short(Jso.XPos);
Pack.Put_Short(Jso.YPos);
Pack.Put_Byte(Jso.Direction);
Pack.Put_Short(Jso.Code);
Pack.Finalize(true);
foreach(_Index, Value in RealList) {
local SUser = Value;
if (SUser.GetUniqueId() == MoveSUser.GetUniqueId()) continue;
SUser.Send(Pack);
}
Pack.Delete();
}
function ClientGetConfigCallBack(SUser, Jso) {
local evv = {
op = 20084502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
}
function ClientCreateOrJoinParty(SUser, Jso) {
Jso.uid <- SUser.GetUID();
Jso.cid <- SUser.GetCID();
Jso.PlayerName <- SUser.GetCharacName();
Jso.PlayerLevel <- SUser.GetCharacLevel();
Jso.PlayerJob <- SUser.GetCharacJob();
Jso.PlayerGrowTypeJob <- SUser.GetCharacGrowType();
Jso.IsPrepare <- false;
Jso.PlayerSession <- World.GetSessionByUid(SUser.GetUID());
Jso.PlayCoin <- SUser.GetCoin();
Jso.PlayFatigue <- SUser.GetMaxFatigue() - SUser.GetFatigue();
Socket.SendGateway(Jso);
}
//玩家上线
function Login_Hook(SUser) {
//玩家上线发信息包
local evv = {
op = 20084502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
local T = {
op = 20084063,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
Socket.SendGateway(T);
}
//团本配置信息获取回调
function GetPluginConfig(Jso) {
Town = Jso.Town;
}
constructor() {
local ConfigPath = Sq_Game_GetConfig();
Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
//注册HOOK
Cb_Insert_User_Func.Luke <- insert_user_hook.bindenv(this); //区域添加角色
Cb_Move_Area_Func.Luke <- move_area_hook.bindenv(this); //区域移动
Base_InputHookFunc_Handle.Luke <- base_input_hook.bindenv(this); //玩家发送消息
Cb_reach_game_world_Func.Luke <- Login_Hook.bindenv(this); //上线HOOK
//注册收包
GatewaySocketPackFuncMap.rawset(20084010, LukeSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
GatewaySocketPackFuncMap.rawset(20084012, LukePlayerMoveMapCallBack.bindenv(this)); //玩家移动回调
//玩家消息分发
GatewaySocketPackFuncMap.rawset(20084018, PlayerNotiMsgDistribute.bindenv(this)); //玩家打字发送的信息
GatewaySocketPackFuncMap.rawset(20084778, GetPluginConfig.bindenv(this)); //服务端配置
//注册来自客户端的收包
ClientSocketPackFuncMap.rawset(20230718, ClientGetConfigCallBack.bindenv(this));
ClientSocketPackFuncMap.rawset(20084501, ClientGetConfigCallBack.bindenv(this));
ClientSocketPackFuncMap.rawset(20084001, ClientCreateOrJoinParty.bindenv(this));
ClientSocketPackFuncMap.rawset(20084005, ClientCreateOrJoinParty.bindenv(this));
}
}
ProjectInitFuncMap.P_Luke <- Luke();

View File

@ -243,6 +243,9 @@ class Marry {
}
}
//根据cid查询婚礼开始时间
GetAuditoriumTimeById = function(cid) {
local Sql = format(MARRY_SQL_LIST.GetAuditoriumTimeById, cid);
@ -276,6 +279,34 @@ class Marry {
return Ret[0];
}
}
//根据cid查询自己的经验值
GetExpById = function(cid) {
local Sql = format(MARRY_SQL_LIST.GetExpById, cid);
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(Sql, ["int"]);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
if (Ret.len()< 1 || Ret[0][0] == null) {
return null;
} else {
return Ret[0][0];
}
}
//设置自己的经验值和等级
SetExpAndLvById = function(Cid, lv, exp) {
local Sql = format(MARRY_SQL_LIST.SetExpAndLvById, lv, exp, Cid, Cid);
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
SqlObj.Exec_Sql(Sql);
//把连接还池子
MysqlPool.GetInstance().PutConnect(SqlObj);
}
}
@ -290,11 +321,13 @@ class Marry {
local job = SUser.GetCharacJob();
//遍历身上的每一件装备
for (local u = 0; u <= 11; u++) {
for (local u = 0; u <= 2; u++) {
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
if (EquObj && !EquObj.IsEmpty) {
//先拿克隆id 如果这个值有 那说明带的克隆 直接用这个
//先拿克隆id 如果这个值有 那说明带的克隆这个是被克隆的装备 直接用这个 但是如果这个人什么都没带 只带了克隆 会显示克隆的id 所以还得判断这个id是不是克隆时装
local clearId = Sq_CallFunc(S_Ptr("0x850d374"), "int", ["pointer", "int"], InvenObj.C_Object, u)
local EquObjId = EquObj.GetIndex();
//如果这个是克隆
if (clearId > 0) {
@ -521,7 +554,7 @@ class Marry {
SUser.SendJso(T);
SUser.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
print(time());
Timer.SetTimeOut(OpenAuditorium.bindenv(this), (Time + 1) * 10 * 1000, SUser.GetCID());
}
}
@ -588,7 +621,7 @@ class Marry {
break;
}
}
printT(info);
@ -864,26 +897,24 @@ class Marry {
}
// Cb_Use_Item_Sp_Func[Config["结婚等级1道具ID"]] <- function(SUser, ItemId) {
// ExpUp(SUser, Config["道具1给的心意点"]);
// }
// Cb_Use_Item_Sp_Func[Config["结婚等级2道具ID"]] <- function(SUser, ItemId) {
// ExpUp(SUser, Config["道具2给的心意点"]);
// }
// Cb_Use_Item_Sp_Func[Config["结婚等级3道具ID"]] <- function(SUser, ItemId) {
// ExpUp(SUser, Config["道具3给的心意点"]);
// }
Timer.SetTimeOut(function() {
ProjectInitFuncMap.P_Marry <- Marry();
}, 0)
Gm_InputFunc_Handle.ss <- function(SUser, CmdString) {
local aa = Marry.GetAva(SUser);
printT(aa);
}.bindenv(this);
print("-----------------------")
print(time());
Timer.SetTimeOut(function() {
print(time());
}, 5000);
// function ExpUp(SUser, expUp) {
// exp = Mysql_Operate_Func.GetExpById(SUser.GetCID())
// exp = exp + expUp;
// for (local i = 6; i >= 0; i--) {
// //如果当前的经验值大于所遍历到的等级 就设定等级为这个 然后不继续向更低等级遍历
// if (Config["戒指等级"][i.tostring()]["所需经验"]< exp) {
// Mysql_Operate_Func.SetExpAndLvById(SUser.GetCID(), i, exp)
// }
// }
// }

View File

@ -38,7 +38,12 @@ MARRY_SQL_LIST.GetAuditoriumIndexById <- @"SELECT target_cid FROM zyk.marry_room
//根据cid查询自己的礼堂编号
MARRY_SQL_LIST.GetAuditoriumTimeById <- @"SELECT rindex FROM zyk.marry_room WHERE cid = %d";
MARRY_SQL_LIST.GetAuditoriumName2ById <- @"SELECT name, FROM zyk.marry_room WHERE cid = %d or target_cid = %d";
MARRY_SQL_LIST.GetAuditoriumName2ById <- @"SELECT name FROM zyk.marry_room WHERE cid = %d or target_cid = %d";
MARRY_SQL_LIST.RomoveRoom <- @"DELETE FROM marry_room where rindex < UNIX_TIMESTAMP();";
//获取自己的经验值
MARRY_SQL_LIST.GetExpById <- @"SELECT experience FROM zyk.marry WHERE cid = %d";
//设置自己的经验值和等级
MARRY_SQL_LIST.SetExpAndLvById <- @"UPDATE zyk.marry SET level = %d , experience = %d WHERE cid = %d or target_cid = %d";

View File

@ -9,7 +9,8 @@ function InitPluginInfo() {
//初始化自动重载 只在15线开启
local ConfigPath = Sq_Game_GetConfig();
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
// if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
if (Channel.find("19")) GameManager.OpenHotFix("/dp_s/Dps_A");
local PoolObj = MysqlPool.GetInstance();
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
@ -22,7 +23,7 @@ function InitPluginInfo() {
Sq_CreatSocketConnect("192.168.200.24", "65109");
//初始化结婚
ProjectInitFuncMap.P_Marry <- Marry();
// ProjectInitFuncMap.P_Marry <- Marry();
//初始化日志器
@ -49,10 +50,13 @@ function main() {
PrintTag();
GameManager.SetGameMaxLevel(95);
GameManager.FixAvatarUseJewel();
// GameManager.FixAvatarUseJewel();
GameManager.FixSaveTown();
GameManager.FixDespairGold();
GameManager.FixGlodTradeDaily(80000000);
getroottable().RRR <- EquimentUseJewel();
// local PvfObject = Script();
// local Data = ScriptData.GetEquipment(305014);
// printT(Data);

View File

@ -226,7 +226,7 @@ _Hook_Register_Currency_Func_("0x084D7A90", ["pointer", "pointer", "pointer", "i
//副本内生成物品时
Cb_Battle_Field_MakeDropItems_Enter_Func <- {};
Cb_Battle_Field_MakeDropItems_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x081CC958", ["pointer", "int", "int", "int", "int", "int", "int", "int", "char", "int", "int", "int", "void"], Cb_Battle_Field_MakeDropItems_Enter_Func, Cb_Battle_Field_MakeDropItems_Leave_Func);
_Hook_Register_Currency_Func_("0x0830ADF6", ["pointer", "int", "int", "int", "short", "int", "int", "int", "char", "int", "int", "int", "void"], Cb_Battle_Field_MakeDropItems_Enter_Func, Cb_Battle_Field_MakeDropItems_Leave_Func);
//独立掉落几率
Cb_IndependentItemRateControl_Enter_Func <- {};
@ -238,7 +238,112 @@ Cb_UseVendingMachine_putItemIntoUser_Enter_Func <- {};
Cb_UseVendingMachine_putItemIntoUser_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x0821B71C", ["int", "pointer", "int", "int", "int", "int"], Cb_UseVendingMachine_putItemIntoUser_Enter_Func, Cb_UseVendingMachine_putItemIntoUser_Leave_Func);
//查看信息
Cb_GetUserInfo_Enter_Func <- {};
Cb_GetUserInfo_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x081C3DD8", ["pointer", "pointer", "pointer", "int"], Cb_GetUserInfo_Enter_Func, Cb_GetUserInfo_Leave_Func);
_Hook_Register_Currency_Func_("0x081C3DD8", ["pointer", "pointer", "pointer", "int"], Cb_GetUserInfo_Enter_Func, Cb_GetUserInfo_Leave_Func);
//初始化技能过程
Cb_SkillInit_process_skill_Enter_Func <- {};
Cb_SkillInit_process_skill_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x081E5BDC", ["pointer", "pointer", "pointer", "void"], Cb_SkillInit_process_skill_Enter_Func, Cb_SkillInit_process_skill_Leave_Func);
//转职
Cb_User_set_grow_Enter_Func <- {};
Cb_User_set_grow_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x086787FC", ["pointer", "int", "int", "int", "int", "void"], Cb_User_set_grow_Enter_Func, Cb_User_set_grow_Leave_Func);
//使用特殊道具时
Cb_User_increase_status_Enter_Func <- {};
Cb_User_increase_status_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x86657FC", ["pointer", "int", "void"], Cb_User_increase_status_Enter_Func, Cb_User_increase_status_Leave_Func);
//更新物品
Cb_User_SendUpdateItem_Enter_Func <- {};
Cb_User_SendUpdateItem_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x0867C2D8", ["pointer", "int", "int", "int", "int"], Cb_User_SendUpdateItem_Enter_Func, Cb_User_SendUpdateItem_Leave_Func);
//幸运值获取装备品级
Cb_LuckPoint_GetItemRarity_Enter_Func <- {};
Cb_LuckPoint_GetItemRarity_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x08550BE4", ["pointer", "pointer", "int", "int", "int"], Cb_LuckPoint_GetItemRarity_Enter_Func, Cb_LuckPoint_GetItemRarity_Leave_Func);
//添加时装到背包
Cb_Inventory_AddAvatarItem_Enter_Func <- {};
Cb_Inventory_AddAvatarItem_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x08509B9E", ["int", "int", "int", "int", "int", "int", "pointer", "int", "int", "int", "int"], Cb_Inventory_AddAvatarItem_Enter_Func, Cb_Inventory_AddAvatarItem_Leave_Func);
//是否开启潜能
Cb_Item_IsHiddenOption_Enter_Func <- {};
Cb_Item_IsHiddenOption_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x0817EDEC", ["pointer", "int"], Cb_Item_IsHiddenOption_Enter_Func, Cb_Item_IsHiddenOption_Leave_Func);
//返回1关闭商店回购
Cb_Item_IsBanRedeemItem_Enter_Func <- {};
Cb_Item_IsBanRedeemItem_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x085F7BE0", ["pointer", "int"], Cb_Item_IsBanRedeemItem_Enter_Func, Cb_Item_IsBanRedeemItem_Leave_Func);
//副本内队伍加载完毕时
Cb_CParty_finish_loading_Enter_Func <- {};
Cb_CParty_finish_loading_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x085B15E0", ["pointer", "pointer", "void"], Cb_CParty_finish_loading_Enter_Func, Cb_CParty_finish_loading_Leave_Func);
//检查删除角色时间 返回1则可立马删除新建角色
Cb_User_CheckDeleteCharacTime_Enter_Func <- {};
Cb_User_CheckDeleteCharacTime_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x0864A830", ["pointer", "int", "int"], Cb_User_CheckDeleteCharacTime_Enter_Func, Cb_User_CheckDeleteCharacTime_Leave_Func);
//忽略在副本门口禁止摆摊
Cb_CPrivateStore_IsAreaNearEntranceDungeon_Enter_Func <- {};
Cb_CPrivateStore_IsAreaNearEntranceDungeon_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x085C5082", ["pointer", "pointer", "int"], Cb_CPrivateStore_IsAreaNearEntranceDungeon_Enter_Func, Cb_CPrivateStore_IsAreaNearEntranceDungeon_Leave_Func);
//解除每日创建角色数量限制
Cb_CreateCharac_CheckLimitCreateNewCharac_Enter_Func <- {};
Cb_CreateCharac_CheckLimitCreateNewCharac_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x08401922", ["int", "pointer", "int"], Cb_CreateCharac_CheckLimitCreateNewCharac_Enter_Func, Cb_CreateCharac_CheckLimitCreateNewCharac_Leave_Func);
//脱离公会时
Cb_MonitorNoticeGuildSecede_dispatch_Enter_Func <- {};
Cb_MonitorNoticeGuildSecede_dispatch_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x084C957E", ["pointer", "pointer", "pointer", "int"], Cb_MonitorNoticeGuildSecede_dispatch_Enter_Func, Cb_MonitorNoticeGuildSecede_dispatch_Leave_Func);
//击杀怪物攻城怪物
Cb_CVillageMonster_OnKillVillageMonster_Enter_Func <- {};
Cb_CVillageMonster_OnKillVillageMonster_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x086B34A0", ["pointer", "pointer", "int", "int", "int", "bool", "int"], Cb_CVillageMonster_OnKillVillageMonster_Enter_Func, Cb_CVillageMonster_OnKillVillageMonster_Leave_Func);
//挑战攻城怪物副本结束事件, 更新怪物攻城活动各阶段状态
Cb_CVillageMonster_SendVillageMonsterFightResult_Enter_Func <- {};
Cb_CVillageMonster_SendVillageMonsterFightResult_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x086B330A", ["pointer", "pointer", "bool", "void"], Cb_CVillageMonster_SendVillageMonsterFightResult_Enter_Func, Cb_CVillageMonster_SendVillageMonsterFightResult_Leave_Func);
//刷新攻城怪物函数, 控制下一只刷新的攻城怪物id
Cb_CVillageMonsterArea_GetAttackedMonster_Enter_Func <- {};
Cb_CVillageMonsterArea_GetAttackedMonster_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x086B3AEA", ["pointer", "int", "int"], Cb_CVillageMonsterArea_GetAttackedMonster_Enter_Func, Cb_CVillageMonsterArea_GetAttackedMonster_Leave_Func);
//正在挑战的攻城怪物
Cb_CVillageMonster_OnFightVillageMonster_Enter_Func <- {};
Cb_CVillageMonster_OnFightVillageMonster_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x086B3240", ["pointer", "pointer", "int", "int", "int"], Cb_CVillageMonster_OnFightVillageMonster_Enter_Func, Cb_CVillageMonster_OnFightVillageMonster_Leave_Func);
//副本刷怪函数 控制副本内怪物的数量和属性
Cb_MapInfo_Add_Mob_Enter_Func <- {};
Cb_MapInfo_Add_Mob_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x08151612", ["pointer", "pointer", "int"], Cb_MapInfo_Add_Mob_Enter_Func, Cb_MapInfo_Add_Mob_Leave_Func);
//怪物攻城通关时获得经验
Cb_CVillageMonsterMgr_OnKillVillageMonster_Enter_Func <- {};
Cb_CVillageMonsterMgr_OnKillVillageMonster_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x086B4866", ["pointer", "pointer", "bool", "int"], Cb_CVillageMonsterMgr_OnKillVillageMonster_Enter_Func, Cb_CVillageMonsterMgr_OnKillVillageMonster_Leave_Func);
//玩家完成任务
Cb_fnStatQuestClear_Enter_Func <- {};
Cb_fnStatQuestClear_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x8664412", ["pointer", "int", "int"], Cb_fnStatQuestClear_Enter_Func, Cb_fnStatQuestClear_Leave_Func);

View File

@ -1,6 +1,19 @@
function sqr_main(){
function sqr_main() {
print("服务端插件启动");
print("服务端插件启动");
}
}
//玩家完成任务
Cb_fnStatQuestClear_Enter_Func <- {};
Cb_fnStatQuestClear_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x8664412", ["pointer", "int", "int"], Cb_fnStatQuestClear_Enter_Func, Cb_fnStatQuestClear_Leave_Func);
Cb_fnStatQuestClear_Enter_Func.text <- function(args) {
local user = User(args[0])
print(args[1]);
print(user.GetCharacName());
};

View File

@ -148,5 +148,11 @@
},
"Dps_A/BaseClass/AdMsg": {
"description": "高级消息类"
},
"Dps_A/ProjectClass/EquimentUseJewel": {
"description": "装备镶嵌"
},
"Dps_A/ProjectClass/Luke": {
"description": "卢克攻坚战"
}
}

Binary file not shown.

Binary file not shown.