Compare commits
3 Commits
91ff5af4f1
...
9d84fe256d
| Author | SHA1 | Date |
|---|---|---|
|
|
9d84fe256d | |
|
|
6c71c79563 | |
|
|
e82c5ceee3 |
|
|
@ -0,0 +1,209 @@
|
||||||
|
/*
|
||||||
|
文件名:AdMsg.nut
|
||||||
|
路径:Dps_A/BaseClass/AdMsg/AdMsg.nut
|
||||||
|
创建日期:2024-10-23 20:46
|
||||||
|
文件用途:高级消息类
|
||||||
|
*/
|
||||||
|
class AdMsg {
|
||||||
|
|
||||||
|
RarityColor = [
|
||||||
|
[255, 255, 255, 255], // 普通
|
||||||
|
[104, 213, 237, 255], // 高级
|
||||||
|
[179, 107, 255, 255], // 稀有
|
||||||
|
[255, 0, 255, 255], // 神器
|
||||||
|
[255, 180, 0, 255], // 史诗
|
||||||
|
[255, 102, 102, 255], // 勇者
|
||||||
|
[255, 20, 147, 255], // 深粉红色
|
||||||
|
[255, 215, 0, 255] // 金色
|
||||||
|
];
|
||||||
|
|
||||||
|
SendBinary = null;
|
||||||
|
SendInfoArr = null;
|
||||||
|
SendStrArr = null;
|
||||||
|
|
||||||
|
//写入分隔
|
||||||
|
function PutSeparate() {
|
||||||
|
SendBinary.writen(0xc2, 'c');
|
||||||
|
SendBinary.writen(0x80, 'c');
|
||||||
|
}
|
||||||
|
//写入普通字符串
|
||||||
|
function WriteStr(Str) {
|
||||||
|
local Point = Memory.allocUtf8String(Str);
|
||||||
|
local Blob = Sq_Point2Blob(Point.C_Object, Str.len());
|
||||||
|
SendBinary.writeblob(Blob);
|
||||||
|
}
|
||||||
|
//写入颜色字符串
|
||||||
|
function WriteColorStr(Str, Color) {
|
||||||
|
//写入分隔
|
||||||
|
PutSeparate();
|
||||||
|
WriteStr(Str);
|
||||||
|
PutSeparate();
|
||||||
|
|
||||||
|
local ColorBlob = blob(104);
|
||||||
|
for (local i = 0; i< 3; i++) {
|
||||||
|
ColorBlob.writen(Color[i], 'c');
|
||||||
|
}
|
||||||
|
for (local i = 0; i< 101; i++) {
|
||||||
|
ColorBlob.writen(0xff, 'c');
|
||||||
|
}
|
||||||
|
SendInfoArr.push(ColorBlob);
|
||||||
|
}
|
||||||
|
//写入表情
|
||||||
|
function WriteImotIcon(Var) {
|
||||||
|
//写入分隔
|
||||||
|
SendBinary.writen(0x1e, 'c');
|
||||||
|
SendBinary.writen(0x25, 'c');
|
||||||
|
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;
|
||||||
|
//写入分隔
|
||||||
|
PutSeparate();
|
||||||
|
WriteStr(Str);
|
||||||
|
PutSeparate();
|
||||||
|
|
||||||
|
local InfoBlob = blob(104);
|
||||||
|
for (local i = 0; i< 3; i++) {
|
||||||
|
InfoBlob.writen(Color[i], 'c');
|
||||||
|
}
|
||||||
|
//装备代码
|
||||||
|
JumpWrite(InfoBlob, 0x4, ItemObj.GetIndex(), 'i');
|
||||||
|
//品级
|
||||||
|
JumpWrite(InfoBlob, 0x8, ItemObj.GetAdd_Info(), 'i');
|
||||||
|
//强化等级
|
||||||
|
JumpWrite(InfoBlob, 0xc, ItemObj.GetUpgrade(), 'c');
|
||||||
|
//装备耐久
|
||||||
|
JumpWrite(InfoBlob, 0xe, ItemObj.GetDurable(), 's');
|
||||||
|
//是否封装 //TODO
|
||||||
|
JumpWrite(InfoBlob, 0x10, ItemObj.GetAttachType(), 'c');
|
||||||
|
//封装次数 //TODO
|
||||||
|
JumpWrite(InfoBlob, 0x12, ItemObj.GetDurable(), 'c');
|
||||||
|
//附魔卡片
|
||||||
|
JumpWrite(InfoBlob, 0x14, ItemObj.GetEnchanting(), 'i');
|
||||||
|
//红字类型
|
||||||
|
JumpWrite(InfoBlob, 0x18, ItemObj.GetAmplification(), 'c');
|
||||||
|
//红字数值
|
||||||
|
JumpWrite(InfoBlob, 0x1a, 112, 'c');
|
||||||
|
|
||||||
|
|
||||||
|
SendInfoArr.push(InfoBlob);
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
SendStrArr = [];
|
||||||
|
SendInfoArr = [];
|
||||||
|
SendBinary = blob(0);
|
||||||
|
//写入分隔
|
||||||
|
PutSeparate();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//构造信息段结构体
|
||||||
|
function MakeInfo() {
|
||||||
|
return {
|
||||||
|
Str = "",
|
||||||
|
Flag = 0,
|
||||||
|
Var = 0,
|
||||||
|
Color = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Type = 0;
|
||||||
|
//put 类型
|
||||||
|
function PutType(gType) {
|
||||||
|
Type = gType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//put 普通信息
|
||||||
|
function PutString(Str) {
|
||||||
|
local Info = MakeInfo();
|
||||||
|
Info.Str = Str;
|
||||||
|
SendStrArr.push(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
//put 颜色信息
|
||||||
|
function PutColorString(Str, Color) {
|
||||||
|
local Info = MakeInfo();
|
||||||
|
Info.Str = Str;
|
||||||
|
Info.Flag = 1;
|
||||||
|
Info.Color = Color;
|
||||||
|
SendStrArr.push(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
//put 表情
|
||||||
|
function PutImoticon(Index) {
|
||||||
|
local Info = MakeInfo();
|
||||||
|
Info.Flag = 2;
|
||||||
|
Info.Var = Index;
|
||||||
|
SendStrArr.push(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
//put 装备
|
||||||
|
function PutEquipment(...) {
|
||||||
|
local Info = MakeInfo();
|
||||||
|
if (vargv.len() > 1) {
|
||||||
|
Info.Str = vargv[0];
|
||||||
|
Info.Var = vargv[1];
|
||||||
|
Info.Color = vargv[2];
|
||||||
|
} else {
|
||||||
|
Info.Var = vargv[0];
|
||||||
|
Info.Str = PvfItem.GetNameById(vargv[0].GetIndex());
|
||||||
|
Info.Color = RarityColor[PvfItem.GetPvfItemById(vargv[0].GetIndex()).GetRarity()];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Info.Flag = 3;
|
||||||
|
SendStrArr.push(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Finalize() {
|
||||||
|
//写入字符串
|
||||||
|
foreach(Info in SendStrArr) {
|
||||||
|
//普通字符串
|
||||||
|
if (Info.Flag == 0) WriteStr(Info.Str);
|
||||||
|
//写入颜色字符串
|
||||||
|
else if (Info.Flag == 1) WriteColorStr(Info.Str, Info.Color);
|
||||||
|
//写入表情
|
||||||
|
else if (Info.Flag == 2) WriteImotIcon(Info.Var);
|
||||||
|
//写入装备
|
||||||
|
else if (Info.Flag == 3) WriteEquipment(Info.Str, Info.Var, Info.Color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Pack = null;
|
||||||
|
|
||||||
|
function MakePack() {
|
||||||
|
//文字信息长度
|
||||||
|
local SendBinaryLen = SendBinary.len();
|
||||||
|
//申请内存
|
||||||
|
local SendStrPoint = Memory.alloc(SendBinaryLen);
|
||||||
|
Sq_WriteBlobToAddress(SendStrPoint.C_Object, SendBinary);
|
||||||
|
|
||||||
|
Pack = Packet();
|
||||||
|
Pack.Put_Header(0, 370);
|
||||||
|
Pack.Put_Byte(Type);
|
||||||
|
Pack.Put_Short(0);
|
||||||
|
Pack.Put_Byte(3);
|
||||||
|
Pack.Put_Int(SendBinaryLen);
|
||||||
|
Pack.Put_BinaryEx(SendStrPoint.C_Object, SendBinaryLen);
|
||||||
|
Pack.Put_Byte(SendInfoArr.len());
|
||||||
|
for (local i = 0; i< SendInfoArr.len(); i++) {
|
||||||
|
local Point = Memory.alloc(104);
|
||||||
|
Sq_WriteBlobToAddress(Point.C_Object, SendInfoArr[i]);
|
||||||
|
Pack.Put_BinaryEx(Point.C_Object, 104);
|
||||||
|
}
|
||||||
|
Pack.Finalize(true);
|
||||||
|
return Pack;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Delete() {
|
||||||
|
Pack.Delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
文件名:BlobExClass.nut
|
||||||
|
路径:BaseClass/BaseTool/BlobExClass.nut
|
||||||
|
创建日期:2024-05-07 17:34
|
||||||
|
文件用途:拓展的Blob类
|
||||||
|
*/
|
||||||
|
class BlobEx extends blob {
|
||||||
|
|
||||||
|
constructor(BaseBlob) {
|
||||||
|
base.constructor(BaseBlob.len());
|
||||||
|
writeblob(BaseBlob);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeblob(B) {
|
||||||
|
base.writeblob(B);
|
||||||
|
seek(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetUShort() {
|
||||||
|
return readn('s');
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetShort() {
|
||||||
|
return readn('w');
|
||||||
|
}
|
||||||
|
|
||||||
|
function charPtrToInt(arr) {
|
||||||
|
local value = ((arr[0]) << 0) |
|
||||||
|
((arr[1]) << 8) |
|
||||||
|
((arr[2]) << 16) |
|
||||||
|
((arr[3]) << 24);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// function GetInt() {
|
||||||
|
// local CurTPos = tell();
|
||||||
|
// local Ret = charPtrToInt([this[CurTPos], this[CurTPos + 1], this[CurTPos + 2], this[CurTPos + 3]]);
|
||||||
|
// seek(4, 'c');
|
||||||
|
// return Ret;
|
||||||
|
// }
|
||||||
|
|
||||||
|
function GetInt() {
|
||||||
|
return readn('i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get256() {
|
||||||
|
local Buf = readn('c');
|
||||||
|
return (256.0 + Buf.tofloat()) % 256.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFloat() {
|
||||||
|
return readn('f');
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetString(count) {
|
||||||
|
return stream_myreadstring(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -87,6 +87,77 @@ class GameManager extends Base_C_Object {
|
||||||
print("请注意如果你不处于DP-S开发环境,请关闭此功能,以免对性能造成影响");
|
print("请注意如果你不处于DP-S开发环境,请关闭此功能,以免对性能造成影响");
|
||||||
Sq_AutoReload(Path);
|
Sq_AutoReload(Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//开启时装镶嵌
|
||||||
|
function FixAvatarUseJewel() {
|
||||||
|
//时装镶嵌修复
|
||||||
|
_AvatarUseJewel_Object <- AvatarUseJewel();
|
||||||
|
}
|
||||||
|
|
||||||
|
//修复下线卡城镇
|
||||||
|
function FixSaveTown() {
|
||||||
|
Cb_Set_Charac_Info_Detail_Enter_Func._FixSaveTown_ <- function(arg) {
|
||||||
|
local curArea = NativePointer(arg[3]).add(34).readS8();
|
||||||
|
if (curArea == 12 || curArea == 13) {
|
||||||
|
NativePointer(arg[3]).add(34).writeS8(11);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修复绝望金币异常
|
||||||
|
function FixDespairGold() {
|
||||||
|
getroottable()._FixDespairGold_Data_ <- {};
|
||||||
|
Cb_UseAncientDungeonItems_Enter_Func._FixDespairGold_ <- function(arg) {
|
||||||
|
local DgnObj = Dungeon(arg[1]);
|
||||||
|
local DgnIndex = DgnObj.GetId();
|
||||||
|
if ((DgnIndex >= 11008) && (DgnIndex <= 11107)) {
|
||||||
|
getroottable()._FixDespairGold_Data_[arg[1]] <- NativePointer(arg[1]).add(2044).readS8();
|
||||||
|
NativePointer(arg[1]).add(2044).writeS8(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Cb_UseAncientDungeonItems_Leave_Func._FixDespairGold_ <- function(arg) {
|
||||||
|
local DgnObj = Dungeon(arg[1]);
|
||||||
|
local DgnIndex = DgnObj.GetId();
|
||||||
|
if ((DgnIndex >= 11008) && (DgnIndex <= 11107)) {
|
||||||
|
//绝望之塔 不再扣除金币
|
||||||
|
NativePointer(arg[1]).add(2044).writeS8(getroottable()._FixDespairGold_Data_[arg[1]]);
|
||||||
|
getroottable()._FixDespairGold_Data_.rawdelete(arg[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修复绝望之塔通关后可以用门票继续进入
|
||||||
|
function FixDespairDungeon() {
|
||||||
|
Cb_User_GetLastClearTime_Leave_Func._FixDespairDungeon_ <- function(arg) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改交易金币上限
|
||||||
|
function FixGlodTradeDaily(Count) {
|
||||||
|
local Arr = [0xB8];
|
||||||
|
local BlobObj = blob(0);
|
||||||
|
BlobObj.writen(Count, 'i');
|
||||||
|
for (local i = 0; i< 4; i++) {
|
||||||
|
Arr.append(BlobObj[i]);
|
||||||
|
}
|
||||||
|
Arr.append(0x90);
|
||||||
|
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) {
|
function _Reload_List_Write_(Path) {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ class _Hacker {
|
||||||
}
|
}
|
||||||
|
|
||||||
local Controler = Sq_HookFunc(S_Ptr(AddressStr), ArgumentArr, EnterFunc, LeaveFunc);
|
local Controler = Sq_HookFunc(S_Ptr(AddressStr), ArgumentArr, EnterFunc, LeaveFunc);
|
||||||
|
print(Controler);
|
||||||
HookTable.rawset(AddressStr, Controler);
|
HookTable.rawset(AddressStr, Controler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
文件名:HttpClass.nut
|
||||||
|
路径:Dps_A/BaseClass/HttpClass/HttpClass.nut
|
||||||
|
创建日期:2024-10-16 18:41
|
||||||
|
文件用途:Http类
|
||||||
|
*/
|
||||||
|
class Http {
|
||||||
|
|
||||||
|
Host = null;
|
||||||
|
Service = null;
|
||||||
|
|
||||||
|
constructor(host, service = "http") {
|
||||||
|
Host = host;
|
||||||
|
Service = service;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Request(Type, Url, Content) {
|
||||||
|
local Request = Type + " " + Url + " HTTP/1.1\r\nHost: " + Host + "\r\n";
|
||||||
|
|
||||||
|
if (Content) {
|
||||||
|
Request += "Content-Length: " + Content.len() + "\r\n";
|
||||||
|
Request += "Content-Type: application/x-www-form-urlencoded\r\n";
|
||||||
|
Request += "\r\n";
|
||||||
|
Request += Content;
|
||||||
|
} else {
|
||||||
|
Request += "Connection: close\r\n\r\n";
|
||||||
|
}
|
||||||
|
return Sq_CreateHttp(Host, Service, Request);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
function Post(Url, Content = null) {
|
||||||
|
return Request("POST", Url, Content);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get(Url, Content = null) {
|
||||||
|
return Request("GET", Url, Content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,16 +16,13 @@ class IO extends Base_C_Object {
|
||||||
_Fseek_Address = Module.getExportByName(null, "fseek");
|
_Fseek_Address = Module.getExportByName(null, "fseek");
|
||||||
_Ftell_Address = Module.getExportByName(null, "ftell");
|
_Ftell_Address = Module.getExportByName(null, "ftell");
|
||||||
_Rewind_Address = Module.getExportByName(null, "rewind");
|
_Rewind_Address = Module.getExportByName(null, "rewind");
|
||||||
|
_Flush_Address = Module.getExportByName(null, "fflush");
|
||||||
|
|
||||||
|
|
||||||
Pos = 0;
|
|
||||||
|
|
||||||
constructor(FileName, Modes) {
|
constructor(FileName, Modes) {
|
||||||
local FileObj = Sq_CallFunc(_Fopen_Address, "pointer", ["pointer", "pointer"], Str_Ptr(FileName), Str_Ptr(Modes));
|
local FileObj = Sq_CallFunc(_Fopen_Address, "pointer", ["pointer", "pointer"], Str_Ptr(FileName), Str_Ptr(Modes));
|
||||||
if (FileObj) {
|
if (FileObj) {
|
||||||
base.constructor(FileObj);
|
base.constructor(FileObj);
|
||||||
} else error("文件打开错误! FileName: " + FileName);
|
} else throw ("文件打开错误! FileName: " + FileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//读取一行
|
//读取一行
|
||||||
|
|
@ -68,6 +65,9 @@ class IO extends Base_C_Object {
|
||||||
Sq_CallFunc(_Fputs_Address, "int", ["pointer", "pointer"], Buffer.C_Object, this.C_Object);
|
Sq_CallFunc(_Fputs_Address, "int", ["pointer", "pointer"], Buffer.C_Object, this.C_Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Flush() {
|
||||||
|
Sq_CallFunc(_Flush_Address, "pointer", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
//关闭文件
|
//关闭文件
|
||||||
function Close() {
|
function Close() {
|
||||||
|
|
|
||||||
|
|
@ -72,4 +72,9 @@ class Inven extends Base_C_Object {
|
||||||
SUser.SendUpdateItemList(1, 0, Slot);
|
SUser.SendUpdateItemList(1, 0, Slot);
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取时装管理器
|
||||||
|
function GetAvatarItemMgr() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x80DD576"), "pointer", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -48,6 +48,10 @@ class Item extends Base_C_Object {
|
||||||
Attribute.seek(2);
|
Attribute.seek(2);
|
||||||
return Attribute.readn('i');
|
return Attribute.readn('i');
|
||||||
}
|
}
|
||||||
|
//获取品级
|
||||||
|
function GetRarity() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x80F12D6"), "int", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
//设置编号
|
//设置编号
|
||||||
function SetIndex(Index) {
|
function SetIndex(Index) {
|
||||||
Attribute.seek(2);
|
Attribute.seek(2);
|
||||||
|
|
@ -120,11 +124,22 @@ class Item extends Base_C_Object {
|
||||||
Attribute.writen(Value, 'i');
|
Attribute.writen(Value, 'i');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取交易类型
|
||||||
|
function GetAttachType() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x80F12E2"), "int", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
//刷写装备数据
|
//刷写装备数据
|
||||||
function Flush() {
|
function Flush() {
|
||||||
Sq_WriteBlobToAddress(C_Object, Attribute);
|
Sq_WriteBlobToAddress(C_Object, Attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//检查是否为空
|
||||||
|
// function IsEmpty() {
|
||||||
|
// return Sq_CallFunc(S_Ptr("0x811ED66"), "int", ["pointer"], this.C_Object);
|
||||||
|
// }
|
||||||
|
|
||||||
//删除道具
|
//删除道具
|
||||||
function Delete() {
|
function Delete() {
|
||||||
Sq_Inven_RemoveItem(C_Object);
|
Sq_Inven_RemoveItem(C_Object);
|
||||||
|
|
@ -132,4 +147,9 @@ class Item extends Base_C_Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//是否可打包
|
||||||
|
function Item::IsPackagble() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x828B5B4"), "int", ["pointer"], this.C_Object);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
/*
|
||||||
|
文件名:LogClass.nut
|
||||||
|
路径:Dps_A/BaseClass/LogClass/LogClass.nut
|
||||||
|
创建日期:2024-10-10 11:35
|
||||||
|
文件用途:日志类
|
||||||
|
*/
|
||||||
|
class Log {
|
||||||
|
|
||||||
|
//linux创建文件夹
|
||||||
|
// function api_mkdir(path) {
|
||||||
|
// var path_ptr = Memory.allocUtf8String(path);
|
||||||
|
// if (opendir(path_ptr))
|
||||||
|
// return true;
|
||||||
|
// return mkdir(path_ptr, 0x1FF);
|
||||||
|
// }
|
||||||
|
_opendir_Address = Module.getExportByName(null, "opendir");
|
||||||
|
_mkdir_Address = Module.getExportByName(null, "mkdir");
|
||||||
|
|
||||||
|
|
||||||
|
Logger = null;
|
||||||
|
LoggerBuffer = null;
|
||||||
|
|
||||||
|
Coro = null;
|
||||||
|
|
||||||
|
constructor(Info) {
|
||||||
|
Logger = {};
|
||||||
|
LoggerBuffer = {};
|
||||||
|
|
||||||
|
local DirPath = Str_Ptr("/dp_s/log");
|
||||||
|
if (!(Sq_CallFunc(_opendir_Address, "int", ["pointer"], DirPath))) {
|
||||||
|
Sq_CallFunc(_mkdir_Address, "int", ["pointer", "int"], DirPath, 0x1FF);
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开文件输出句柄
|
||||||
|
foreach(Level, Path in Info) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
local Io = IO(Path, "a");
|
||||||
|
Logger[Level] <- Io;
|
||||||
|
LoggerBuffer[Level] <- [];
|
||||||
|
} catch (exception) {
|
||||||
|
error("日志器初始化失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()._Logger_Object_ <- this;
|
||||||
|
Cb_timer_dispatch_Func.rawset("__System__Logger__Event", Update.bindenv(this));
|
||||||
|
|
||||||
|
Coro = newthread(__Write__.bindenv(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Put(Type, Message) {
|
||||||
|
if (getroottable().rawin("_Logger_Object_")) {
|
||||||
|
if (getroottable()._Logger_Object_.Logger.rawin(Type)) {
|
||||||
|
getroottable()._Logger_Object_.LoggerBuffer[Type].push(Message);
|
||||||
|
// getroottable()._Logger_Object_.Logger[Type].Write(Message);
|
||||||
|
// getroottable()._Logger_Object_.Logger[Type].Flush();
|
||||||
|
} else {
|
||||||
|
error("未知的日志类型");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error("未初始化日志器");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function __Write__() {
|
||||||
|
local ret = suspend("no");
|
||||||
|
foreach(Type, MessageArr in LoggerBuffer) {
|
||||||
|
for (local i = 0; i< MessageArr.len(); i++) {
|
||||||
|
Logger[Type].Write(MessageArr[i]);
|
||||||
|
Logger[Type].Flush();
|
||||||
|
MessageArr.remove(i);
|
||||||
|
i--;
|
||||||
|
suspend("no");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "yes";
|
||||||
|
}
|
||||||
|
|
||||||
|
function Update() {
|
||||||
|
local susparam = "noq";
|
||||||
|
if (Coro.getstatus() == "idle") susparam = Coro.call();
|
||||||
|
else if (Coro.getstatus() == "suspended") susparam = Coro.wakeup();
|
||||||
|
|
||||||
|
if (susparam == "yes") {
|
||||||
|
Coro = newthread(__Write__.bindenv(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,16 @@ class Memory {
|
||||||
function allocUtf8String(Str) {
|
function allocUtf8String(Str) {
|
||||||
return NativePointer(Str_Ptr(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 {
|
class NativePointer extends Base_C_Object {
|
||||||
|
|
@ -29,14 +39,23 @@ class NativePointer extends Base_C_Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Output(Size) {
|
||||||
|
local Buf = Sq_Point2Blob(this.C_Object, Size);
|
||||||
|
local Str = "[";
|
||||||
|
foreach(Value in Buf) {
|
||||||
|
Str = format("%s%02X", Str, Value);
|
||||||
|
Str += ",";
|
||||||
|
}
|
||||||
|
Str += "]";
|
||||||
|
print(Str);
|
||||||
|
}
|
||||||
|
|
||||||
function add(intoffset) {
|
function add(intoffset) {
|
||||||
this.C_Object = Sq_PointerOperation(this.C_Object, intoffset, "+");
|
return NativePointer(Sq_PointerOperation(this.C_Object, intoffset, "+"));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sub(intoffset) {
|
function sub(intoffset) {
|
||||||
this.C_Object = Sq_PointerOperation(this.C_Object, intoffset, "-");
|
return NativePointer(Sq_PointerOperation(this.C_Object, intoffset, "-"));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeByteArray(arr) {
|
function writeByteArray(arr) {
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,40 @@ class Packet extends Base_C_Object {
|
||||||
Sq_Packet_Send(SUser.C_Object, this.C_Object);
|
Sq_Packet_Send(SUser.C_Object, this.C_Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function GetByte() {
|
||||||
|
local data = Memory.alloc(1);
|
||||||
|
if (Sq_CallFunc(S_Ptr("0x858CF22"), "int", ["pointer", "pointer"], this.C_Object, data.C_Object)) {
|
||||||
|
return data.readS8();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetShort() {
|
||||||
|
local data = Memory.alloc(2);
|
||||||
|
if (Sq_CallFunc(S_Ptr("0x858CFC0"), "int", ["pointer", "pointer"], this.C_Object, data.C_Object)) {
|
||||||
|
return data.readS16();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetInt() {
|
||||||
|
local data = Memory.alloc(4);
|
||||||
|
if (Sq_CallFunc(S_Ptr("0x858D27E"), "int", ["pointer", "pointer"], this.C_Object, data.C_Object)) {
|
||||||
|
return data.readS32();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetBinary(len) {
|
||||||
|
local data = Memory.alloc(len);
|
||||||
|
if (Sq_CallFunc(S_Ptr("0x858D3B2"), "int", ["pointer", "pointer"], this.C_Object, data.C_Object)) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function Delete() {
|
function Delete() {
|
||||||
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], this.C_Object);
|
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], this.C_Object);
|
||||||
Sq_Delete_Point(this.C_Object);
|
Sq_Delete_Point(this.C_Object);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ class PvfItem extends Base_C_Object {
|
||||||
return Sq_GetNameByIdFromPvf(GetIndex());
|
return Sq_GetNameByIdFromPvf(GetIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Public
|
//Public
|
||||||
function GetNameById(Id) {
|
function GetNameById(Id) {
|
||||||
return Sq_GetNameByIdFromPvf(Id);
|
return Sq_GetNameByIdFromPvf(Id);
|
||||||
|
|
@ -70,4 +71,9 @@ function PvfItem::GetUsableLevel() {
|
||||||
//是否为消耗品
|
//是否为消耗品
|
||||||
function PvfItem::IsStackable() {
|
function PvfItem::IsStackable() {
|
||||||
return Sq_CallFunc(S_Ptr("0x80f12fa"), "int", ["pointer"], this.C_Object);
|
return Sq_CallFunc(S_Ptr("0x80f12fa"), "int", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取消耗品类型
|
||||||
|
function PvfItem::GetItemType() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x8514A84"), "int", ["pointer"], this.C_Object);
|
||||||
}
|
}
|
||||||
|
|
@ -277,4 +277,13 @@ class RedBlackTree {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function GetPop() {
|
||||||
|
if (this.size <= 0) return null;
|
||||||
|
local z = this.minimum();
|
||||||
|
if (z != this.nil) {
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -17,9 +17,13 @@ class Timer {
|
||||||
Cb_timer_dispatch_Func.rawset("__System__Timer__Event", Update.bindenv(this));
|
Cb_timer_dispatch_Func.rawset("__System__Timer__Event", Update.bindenv(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ClockTime() {
|
||||||
|
return Sq_GetTimestampString().slice(-10).tointeger();
|
||||||
|
}
|
||||||
|
|
||||||
//检测延时任务
|
//检测延时任务
|
||||||
function CheckTimeOut() {
|
function CheckTimeOut() {
|
||||||
local Node = Wait_Exec_Tree.pop();
|
local Node = Wait_Exec_Tree.GetPop();
|
||||||
if (!Node) {
|
if (!Node) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -27,11 +31,13 @@ class Timer {
|
||||||
local Info = Node.Info;
|
local Info = Node.Info;
|
||||||
//执行时间
|
//执行时间
|
||||||
local exec_time = Node.time;
|
local exec_time = Node.time;
|
||||||
//如果没到执行时间,放回去,等待下次扫描
|
//如果没到执行时间,就不管
|
||||||
if (clock() <= exec_time) {
|
if (ClockTime() <= exec_time) {
|
||||||
Wait_Exec_Tree.insert(exec_time, Node.Info);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//该执行了从树中删除这个元素
|
||||||
|
Wait_Exec_Tree.pop();
|
||||||
|
|
||||||
//函数
|
//函数
|
||||||
local func = Info[0];
|
local func = Info[0];
|
||||||
//参数
|
//参数
|
||||||
|
|
@ -47,10 +53,9 @@ class Timer {
|
||||||
target_arg_list.push(vargv[i]);
|
target_arg_list.push(vargv[i]);
|
||||||
}
|
}
|
||||||
//当前时间戳,单位:秒
|
//当前时间戳,单位:秒
|
||||||
local time_sec = clock();
|
local time_sec = ClockTime();
|
||||||
//计算下一次执行的时间
|
//计算下一次执行的时间
|
||||||
local exec_time_sec = time_sec + (delay_time / 1000.0).tofloat();
|
local exec_time_sec = time_sec + delay_time;
|
||||||
|
|
||||||
//设置下一次执行
|
//设置下一次执行
|
||||||
local func_info = [];
|
local func_info = [];
|
||||||
|
|
||||||
|
|
@ -62,7 +67,7 @@ class Timer {
|
||||||
|
|
||||||
//检测定时任务
|
//检测定时任务
|
||||||
function CheckCronTask() {
|
function CheckCronTask() {
|
||||||
local Node = Date_Exec_Tree.pop();
|
local Node = Date_Exec_Tree.GetPop();
|
||||||
if (!Node) {
|
if (!Node) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -72,38 +77,27 @@ class Timer {
|
||||||
local exec_time = Node.time;
|
local exec_time = Node.time;
|
||||||
//如果没到执行时间,放回去,等待下次扫描
|
//如果没到执行时间,放回去,等待下次扫描
|
||||||
if (time() <= exec_time) {
|
if (time() <= exec_time) {
|
||||||
Date_Exec_Tree.insert(exec_time, Node.Info);
|
// Date_Exec_Tree.insert(exec_time, Node.Info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Date_Exec_Tree.pop();
|
||||||
//函数
|
//函数
|
||||||
local func = Info[0];
|
local func = Info[0];
|
||||||
//参数
|
//参数
|
||||||
local func_args = Info[1];
|
local func_args = Info[1];
|
||||||
//下次任务叠加时间
|
//Cron字符串
|
||||||
local NextTimestep = Info[2];
|
local NextTimestep = Info[2];
|
||||||
//执行函数
|
//执行函数
|
||||||
func.acall(func_args);
|
func.acall(func_args);
|
||||||
//继续构建下一次任务
|
//继续构建下一次任务
|
||||||
Date_Exec_Tree.insert(time() + NextTimestep, Info);
|
Date_Exec_Tree.insert(Sq_Cron_Next(NextTimestep, time()), Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetCronTask(target_func, CronString, ...) {
|
function SetCronTask(target_func, CronString, ...) {
|
||||||
local parts = split(CronString, "/");
|
|
||||||
local minute = parts[0].tointeger();
|
|
||||||
local hour = parts[1].tointeger();
|
|
||||||
local day = parts[2].tointeger();
|
|
||||||
local weekday = parts[3].tointeger();
|
|
||||||
|
|
||||||
local S_minute = minute * 60;
|
|
||||||
local S_hour = hour * 60 * 60;
|
|
||||||
local S_day = day * 24 * 60 * 60;
|
|
||||||
local S_weekday = weekday * 7 * 24 * 60 * 60;
|
|
||||||
|
|
||||||
local AddTimestep = S_minute + S_hour + S_day + S_weekday;
|
|
||||||
local NowTimestep = time();
|
local NowTimestep = time();
|
||||||
|
|
||||||
//下一次执行的时间
|
//下一次执行的时间
|
||||||
local NextTimestep = AddTimestep + NowTimestep;
|
local NextTimestep = Sq_Cron_Next(CronString, NowTimestep);
|
||||||
|
|
||||||
local target_arg_list = [];
|
local target_arg_list = [];
|
||||||
target_arg_list.push(getroottable());
|
target_arg_list.push(getroottable());
|
||||||
|
|
@ -119,7 +113,7 @@ class Timer {
|
||||||
//参数列表
|
//参数列表
|
||||||
func_info.push(target_arg_list);
|
func_info.push(target_arg_list);
|
||||||
//间隔时间戳时间
|
//间隔时间戳时间
|
||||||
func_info.push(AddTimestep);
|
func_info.push(CronString);
|
||||||
|
|
||||||
_Timer_Object.Date_Exec_Tree.insert(NextTimestep, func_info);
|
_Timer_Object.Date_Exec_Tree.insert(NextTimestep, func_info);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -599,4 +599,9 @@ function User::SendItemMail(UID, CID, ItemList, title, content) {
|
||||||
SUser.Send(Pack);
|
SUser.Send(Pack);
|
||||||
Pack.Delete();
|
Pack.Delete();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//道具是否被锁
|
||||||
|
function User::CheckItemLock(Type, Slot) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x8646942"), "int", ["pointer", "int", "int"], this.C_Object, Type, Slot);
|
||||||
}
|
}
|
||||||
|
|
@ -252,9 +252,112 @@ function TestCronTask(str) {
|
||||||
print("定时任务已执行一次");
|
print("定时任务已执行一次");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// class Map{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// Timer.SetTimeOut(function() {
|
||||||
|
// local dgn_requirements = {
|
||||||
|
// [1] = [0, 10, 1, 20, 2, 30, 3, 40, 4, 40],
|
||||||
|
// [2] = [0, 20],
|
||||||
|
// };
|
||||||
|
// print(dgn_requirements[1]);
|
||||||
|
// printT(dgn_requirements);
|
||||||
|
|
||||||
|
// }, 0);
|
||||||
|
// Timer.SetTimeOut(function() {
|
||||||
|
// local SUser = World.GetUserByUid(1);
|
||||||
|
// local InvenObj = SUser.GetInven();
|
||||||
|
// local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 56);
|
||||||
|
|
||||||
|
// local AdMsgObj = AdMsg();
|
||||||
|
// AdMsgObj.PutType(8);
|
||||||
|
// AdMsgObj.PutString("测试文字");
|
||||||
|
// AdMsgObj.PutColorString("测试文字", [255, 85, 0]);
|
||||||
|
// AdMsgObj.PutImoticon(2);
|
||||||
|
// AdMsgObj.PutEquipment("主动提供名字", EquObj, [255, 85, 0]);
|
||||||
|
// AdMsgObj.PutEquipment(EquObj);
|
||||||
|
// AdMsgObj.Finalize();
|
||||||
|
|
||||||
|
// // SUser.Send(AdMsgObj.MakePack());
|
||||||
|
// World.SendAll(AdMsgObj.MakePack());
|
||||||
|
// AdMsgObj.Delete();
|
||||||
|
// }, 0);
|
||||||
|
|
||||||
Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||||
|
// print("初始化开始时间: " + time());
|
||||||
|
// local PvfObject = Script();
|
||||||
|
// print("初始化结束时间: " + time());
|
||||||
|
print(123123);
|
||||||
|
local Str = "{\"op\":2024041602,\"uid\":1,\"map\":{\"id\":15154,\"ra\":0},\"cid\":1}";
|
||||||
|
local Pack = Packet();
|
||||||
|
Pack.Put_Header(1, 130);
|
||||||
|
Pack.Put_Byte(1);
|
||||||
|
Pack.Put_Int(Str.len());
|
||||||
|
Pack.Put_Binary(Str);
|
||||||
|
Pack.Finalize(true);
|
||||||
|
SUser.Send(Pack);
|
||||||
|
Pack.Delete();
|
||||||
|
|
||||||
|
print("asdasdadad");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// local Sing = Memory.alloc(100);
|
||||||
|
// Sing.add(0).writeU32(1200);
|
||||||
|
// Sing.add(4).writeU32(3037);
|
||||||
|
// Sing.add(8).writeU32(1);
|
||||||
|
// Sing.add(12).writeU32(100);
|
||||||
|
// Sing.add(16).writeU32(100);
|
||||||
|
// Sing.add(20).writeU32(100);
|
||||||
|
// Sing.add(40).writeU32(time());
|
||||||
|
// Sing.add(68).writeU32(100);
|
||||||
|
|
||||||
|
// local Sing = Memory.alloc(100);
|
||||||
|
// Sing.add(10).writeInt(1200);
|
||||||
|
// Sing.add(14).writeInt(100);
|
||||||
|
// Sing.add(18).writeInt(100);
|
||||||
|
|
||||||
|
// Sq_CallFunc(S_Ptr(0x84DB452), "pointer", ["pointer", "pointer", "pointer"], S_Ptr("0x0"), SUser.C_Object, Sing.C_Object);
|
||||||
|
|
||||||
|
// //修复金币异常
|
||||||
|
// //CParty::UseAncientDungeonItems
|
||||||
|
// var CParty_UseAncientDungeonItems_ptr = ptr(0x859EAC2);
|
||||||
|
// var CParty_UseAncientDungeonItems = new NativeFunction(CParty_UseAncientDungeonItems_ptr, 'int', ['pointer', 'pointer', 'pointer', 'pointer'], {
|
||||||
|
// "abi": "sysv"
|
||||||
|
// });
|
||||||
|
// Interceptor.replace(CParty_UseAncientDungeonItems_ptr, new NativeCallback(function(party, dungeon, inven_item, a4) {
|
||||||
|
// //当前进入的地下城id
|
||||||
|
// var dungeon_index = CDungeon_get_index(dungeon);
|
||||||
|
// //根据地下城id判断是否为绝望之塔
|
||||||
|
// if ((dungeon_index >= 11008) && (dungeon_index <= 11107)) {
|
||||||
|
// //绝望之塔 不再扣除金币
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
// //其他副本执行原始扣除道具逻辑
|
||||||
|
// return CParty_UseAncientDungeonItems(party, dungeon, inven_item, a4);
|
||||||
|
// }, 'int', ['pointer', 'pointer', 'pointer', 'pointer']));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// local exp_bonus = Memory.alloc(4);
|
||||||
|
// local gold_bonus = Memory.alloc(4);
|
||||||
|
// local quest_point_bonus = Memory.alloc(4);
|
||||||
|
// local quest_piece_bonus = Memory.alloc(4);
|
||||||
|
|
||||||
|
// //计算任务基础奖励(不包含道具奖励)
|
||||||
|
// Sq_CallFunc(S_Ptr(0x866E7A8), "int", ["pointer", "pointer", "pointer", "pointer", "pointer", "pointer", "int"], SUser, pvfQuest, exp_bonus, gold_bonus, quest_point_bonus, quest_piece_bonus, 1);
|
||||||
|
|
||||||
|
// local mitems = {};
|
||||||
|
// mitems[3037] <- 500;
|
||||||
|
// SUser.SendMail(mitems, {
|
||||||
|
// Title = "标题",
|
||||||
|
// Text = "内容"
|
||||||
|
// });
|
||||||
|
|
||||||
|
// Timer.SetCronTask(function() {
|
||||||
|
|
||||||
|
// }, "1/0/0/0"); //计划任务格式为 1/0/0/0 这样格式的字符串 代表 分 时 天 周 如例子标识的 为每分钟执行1次
|
||||||
|
|
||||||
|
|
||||||
// local MoveSUser = World.GetUserByUidCid(2, 2);
|
// local MoveSUser = World.GetUserByUidCid(2, 2);
|
||||||
// local Pack = Packet();
|
// local Pack = Packet();
|
||||||
// Pack.Put_Header(0, 22);
|
// Pack.Put_Header(0, 22);
|
||||||
|
|
@ -266,14 +369,45 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||||
// Pack.Finalize(true);
|
// Pack.Finalize(true);
|
||||||
// SUser.Send(Pack);
|
// SUser.Send(Pack);
|
||||||
// Pack.Delete();
|
// Pack.Delete();
|
||||||
|
// local MoveSUser = World.GetUserByUidCid(2, 2);
|
||||||
|
|
||||||
local Pack = Packet();
|
|
||||||
Pack.Put_Header(0, 23);
|
|
||||||
Pack.Put_Short(SUser.GetUniqueId()); //唯一id
|
|
||||||
Pack.Put_Byte(SUser.GetLocation().Town); //城镇
|
|
||||||
|
|
||||||
Pack.Delete();
|
// local Pack = Packet();
|
||||||
|
// Pack.Put_Header(0, 23);
|
||||||
|
// Pack.Put_Short(MoveSUser.GetUniqueId()); //唯一id
|
||||||
|
// Pack.Put_Byte(MoveSUser.GetLocation().Town); //城镇
|
||||||
|
|
||||||
|
|
||||||
|
// Pack.Put_Byte(7); //区域
|
||||||
|
// Pack.Put_Short(MoveSUser.GetAreaPos().X);
|
||||||
|
|
||||||
|
// Pack.Put_Short(MoveSUser.GetAreaPos().Y);
|
||||||
|
// Pack.Put_Byte(MoveSUser.GetDirections()); //朝向
|
||||||
|
// Pack.Put_Byte(MoveSUser.GetVisibleValues()); //是否可见
|
||||||
|
// Pack.Finalize(true);
|
||||||
|
// print(111);
|
||||||
|
// SUser.Send(Pack);
|
||||||
|
// Pack.Delete();
|
||||||
|
|
||||||
|
// local PartyObj = SUser.GetParty();
|
||||||
|
|
||||||
|
// Sq_CallFunc(S_Ptr("0x85A73A6"), "int", ["pointer", "pointer", "int"], PartyObj.C_Object, SUser.C_Object, 3037);
|
||||||
|
|
||||||
|
// Haker.LoadHook(S_Ptr("0x859D14E"),
|
||||||
|
// ["pointer", "pointer"],
|
||||||
|
// function(args) {
|
||||||
|
// local PartyObj = Party(args[0]);
|
||||||
|
// local Ssuser = PartyObj.GetUser(0);
|
||||||
|
// if (Ssuser) {
|
||||||
|
// local pack = Packet(args[1]);
|
||||||
|
// Ssuser.Send(pack);
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
// function(args) {
|
||||||
|
|
||||||
|
// return null;
|
||||||
|
// });
|
||||||
// local RealList = [World.GetUserByUidCid(2, 2), World.GetUserByUidCid(1, 1)];
|
// local RealList = [World.GetUserByUidCid(2, 2), World.GetUserByUidCid(1, 1)];
|
||||||
|
|
||||||
// foreach(_Index, Value in RealList) {
|
// foreach(_Index, Value in RealList) {
|
||||||
|
|
@ -606,31 +740,73 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Gm_InputFunc_Handle.AAA <- function(SUser, CmdString) {
|
Gm_InputFunc_Handle.WEQ <- function(SUser, CmdString) {
|
||||||
|
// World.MoveArea(SUser, 1, 0, 55, 349);
|
||||||
|
|
||||||
// //查询的sql语句
|
// print(789456);
|
||||||
// local sql = "SELECT m_id,charac_name,lev,village,job,exp,Hp FROM charac_info WHERE charac_no = 1;";
|
// 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}]}";
|
||||||
// //查询的元素类型,按sql中的顺序
|
local Str = "{\"op\":20084038,\"uid\":2,\"type\":9,\"cid\":2}";
|
||||||
// local column_type_list = ["int", "string", "int", "int", "int", "int", "int"];
|
local Pack = Packet();
|
||||||
// local SqlObj = MysqlPool.GetInstance().GetConnect();
|
Pack.Put_Header(1, 130);
|
||||||
// local result = SqlObj.Select(sql, column_type_list);
|
Pack.Put_Byte(1);
|
||||||
|
Pack.Put_Int(Str.len());
|
||||||
|
Pack.Put_Binary(Str);
|
||||||
|
Pack.Finalize(true);
|
||||||
|
SUser.Send(Pack);
|
||||||
|
Pack.Delete();
|
||||||
|
|
||||||
// printT(result);
|
print("asdasdadad");
|
||||||
|
|
||||||
// MysqlPool.GetInstance().PutConnect(SqlObj);
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
//从池子拿连接
|
|
||||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
|
||||||
|
|
||||||
//建库
|
Cb_fnStatQuestClear_Enter_Func.text <- function(args) {
|
||||||
local sql = "SELECT slot FROM frida.setCharacSlotLimit WHERE account_id = " + account_id + ";";
|
local user = User(args[0])
|
||||||
local column_type_list = ["int"];
|
print(args[1]);
|
||||||
local result = SqlObj.Select(sql, column_type_list);
|
print(user.GetCharacName());
|
||||||
if (result.len() > 0) {
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//把连接还池子
|
Timer.SetTimeOut(function() {
|
||||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
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)
|
||||||
|
|
@ -4,6 +4,23 @@
|
||||||
创建日期:2024-05-01 16:24
|
创建日期: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 {
|
class ServerControl {
|
||||||
|
|
||||||
function Get_User_Item_Count(SUser, ItemId) {
|
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() {
|
constructor() {
|
||||||
|
|
||||||
//分发来自网关的包
|
//分发来自网关的包
|
||||||
GatewaySocketPackFuncMap.rawset(20240730, function(Jso) {
|
GatewaySocketPackFuncMap.rawset(20240730, function(Jso) {
|
||||||
local UserList = [];
|
local UserList = [];
|
||||||
|
|
@ -53,7 +53,6 @@ class ServerControl {
|
||||||
if (SUser) UserList.append(SUser);
|
if (SUser) UserList.append(SUser);
|
||||||
else UserList.append(null);
|
else UserList.append(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(_Index, SUser in UserList) {
|
foreach(_Index, SUser in UserList) {
|
||||||
if (SUser) {
|
if (SUser) {
|
||||||
Jso.uid <- SUser.GetUID();
|
Jso.uid <- SUser.GetUID();
|
||||||
|
|
@ -688,6 +687,40 @@ class ServerControl {
|
||||||
Socket.SendGateway(T);
|
Socket.SendGateway(T);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Cb_GetUserInfo_Leave_Func.ServerControl <- function(args) {
|
||||||
|
if (args.pop() >= 0) {
|
||||||
|
local SUser = User(args[1]);
|
||||||
|
local Unid = NativePointer(args[2]).add(13).readShort();
|
||||||
|
local OtherUser = World.GetUserBySession(Unid);
|
||||||
|
if (OtherUser && SUser) {
|
||||||
|
local Jso = {
|
||||||
|
seeUid = SUser.GetUID(),
|
||||||
|
seeCid = SUser.GetCID(),
|
||||||
|
viewedUid = OtherUser.GetUID(),
|
||||||
|
viewedCid = OtherUser.GetCID(),
|
||||||
|
op = 20069009
|
||||||
|
}
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//任务完成
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
/*
|
||||||
|
文件名:AvatarUseJewel.nut
|
||||||
|
路径:Dps_A/ProjectClass/AvatarUseJewel/AvatarUseJewel.nut
|
||||||
|
创建日期:2024-10-09 19:52
|
||||||
|
文件用途:时装镶嵌
|
||||||
|
*/
|
||||||
|
class AvatarUseJewel {
|
||||||
|
|
||||||
|
function WongWork_CAvatarItemMgr_getJewelSocketData(a, b) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x82F98F8"), "pointer", ["pointer", "int"], a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
function CStackableItem_getJewelTargetSocket(C_Object) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x0822CA28"), "int", ["pointer"], C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
function CInventory_delete_item(C_Object, Type, Slot, Count, Ps, Log) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x850400C"), "int", ["pointer", "int", "int", "int", "int", "int"], C_Object, Type, Slot, Count, Ps, Log);
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_set_JewelSocketData(jewelSocketData, slot, emblem_item_id) {
|
||||||
|
if (jewelSocketData) {
|
||||||
|
NativePointer(jewelSocketData).add(slot * 6 + 2).writeInt(emblem_item_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function DB_UpdateAvatarJewelSlot_makeRequest(a, b, c) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x843081C"), "pointer", ["int", "int", "pointer"], a, b, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取时装在数据库中的uid
|
||||||
|
function api_get_avartar_ui_id(avartar) {
|
||||||
|
return NativePointer(avartar).add(7).readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
function FixFunction() {
|
||||||
|
Haker.LoadHook("0x8217BD6", ["int", "pointer", "pointer", "int"],
|
||||||
|
function(args) {
|
||||||
|
//角色
|
||||||
|
local SUser = User(args[1]);
|
||||||
|
//包数据
|
||||||
|
local Pack = Packet(args[2]);
|
||||||
|
|
||||||
|
//校验角色状态是否允许镶嵌
|
||||||
|
if (!SUser || SUser.GetState() != 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//时装所在的背包槽
|
||||||
|
local Inven_Slot = Pack.GetShort();
|
||||||
|
//时装item_id
|
||||||
|
local Item_Id = Pack.GetInt();
|
||||||
|
//本次镶嵌徽章数量
|
||||||
|
local Emblem_Count = Pack.GetByte();
|
||||||
|
|
||||||
|
//获取时装道具
|
||||||
|
local InvemObj = SUser.GetInven();
|
||||||
|
local AvatarObj = InvemObj.GetSlot(2, Inven_Slot);
|
||||||
|
|
||||||
|
//校验时装 数据是否合法
|
||||||
|
if (!AvatarObj || AvatarObj.IsEmpty || (AvatarObj.GetIndex() != Item_Id) || SUser.CheckItemLock(2, Inven_Slot)) return;
|
||||||
|
|
||||||
|
|
||||||
|
local Avartar_AddInfo = AvatarObj.GetAdd_Info();
|
||||||
|
//获取时装管理器
|
||||||
|
local Inven_AvartarMgr = InvemObj.GetAvatarItemMgr();
|
||||||
|
|
||||||
|
//获取时装插槽数据
|
||||||
|
local Jewel_Socket_Data = AvatarUseJewel.WongWork_CAvatarItemMgr_getJewelSocketData(Inven_AvartarMgr, Avartar_AddInfo);
|
||||||
|
|
||||||
|
if (!Jewel_Socket_Data) return;
|
||||||
|
|
||||||
|
//最多只支持3个插槽
|
||||||
|
if (Emblem_Count <= 3) {
|
||||||
|
local emblems = {};
|
||||||
|
|
||||||
|
for (local i = 0; i< Emblem_Count; i++) {
|
||||||
|
//徽章所在的背包槽
|
||||||
|
local emblem_inven_slot = Pack.GetShort();
|
||||||
|
//徽章item_id
|
||||||
|
local emblem_item_id = Pack.GetInt();
|
||||||
|
//该徽章镶嵌的时装插槽id
|
||||||
|
local avartar_socket_slot = Pack.GetByte();
|
||||||
|
|
||||||
|
//获取徽章道具
|
||||||
|
local EmblemObje = InvemObj.GetSlot(1, emblem_inven_slot);
|
||||||
|
|
||||||
|
//校验徽章及插槽数据是否合法
|
||||||
|
if (!EmblemObje || EmblemObje.IsEmpty || (EmblemObje.GetIndex() != emblem_item_id) || (avartar_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 = AvatarUseJewel.CStackableItem_getJewelTargetSocket(citem.C_Object);
|
||||||
|
|
||||||
|
//获取要镶嵌的时装插槽类型
|
||||||
|
local avartar_socket_type = NativePointer(Jewel_Socket_Data).add(avartar_socket_slot * 6).readShort();
|
||||||
|
|
||||||
|
if (!(emblem_socket_type & avartar_socket_type)) return;
|
||||||
|
|
||||||
|
emblems[avartar_socket_slot] <- [emblem_inven_slot, emblem_item_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
//开始镶嵌
|
||||||
|
foreach(avartar_socket_slot, emblemObject in emblems) {
|
||||||
|
//删除徽章
|
||||||
|
local emblem_inven_slot = emblemObject[0];
|
||||||
|
AvatarUseJewel.CInventory_delete_item(InvemObj.C_Object, 1, emblem_inven_slot, 1, 8, 1);
|
||||||
|
//设置时装插槽数据
|
||||||
|
local emblem_item_id = emblemObject[1];
|
||||||
|
AvatarUseJewel.api_set_JewelSocketData(Jewel_Socket_Data, avartar_socket_slot, emblem_item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
//时装插槽数据存档
|
||||||
|
AvatarUseJewel.DB_UpdateAvatarJewelSlot_makeRequest(SUser.GetCID(), AvatarUseJewel.api_get_avartar_ui_id(AvatarObj.C_Object), Jewel_Socket_Data);
|
||||||
|
|
||||||
|
//通知客户端时装数据已更新
|
||||||
|
SUser.SendUpdateItemList(1, 1, Inven_Slot);
|
||||||
|
|
||||||
|
//回包给客户端
|
||||||
|
local Pack = Packet();
|
||||||
|
Pack.Put_Header(1, 204);
|
||||||
|
Pack.Put_Int(1);
|
||||||
|
Pack.Finalize(true);
|
||||||
|
SUser.Send(Pack);
|
||||||
|
Pack.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
|
function(args) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
FixFunction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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();
|
||||||
|
|
@ -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();
|
||||||
|
|
@ -4,6 +4,98 @@
|
||||||
创建日期:2024-10-01 10:02
|
创建日期:2024-10-01 10:02
|
||||||
文件用途:结婚系统
|
文件用途:结婚系统
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
class defaultJobItemId {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头发
|
||||||
|
*/
|
||||||
|
hat = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 帽子
|
||||||
|
*/
|
||||||
|
hair = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*脸
|
||||||
|
*/
|
||||||
|
face = 0;
|
||||||
|
/**
|
||||||
|
* 披风
|
||||||
|
*/
|
||||||
|
breast = 0;
|
||||||
|
/**
|
||||||
|
* 上衣
|
||||||
|
*/
|
||||||
|
coat = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下装
|
||||||
|
*/
|
||||||
|
pants = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 腰部
|
||||||
|
*/
|
||||||
|
waist = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 鞋子
|
||||||
|
*/
|
||||||
|
shoes = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 皮肤
|
||||||
|
*/
|
||||||
|
skin = 0;
|
||||||
|
|
||||||
|
index = null;
|
||||||
|
|
||||||
|
constructor(hat, hair, face, breast, coat, pants, waist, shoes, skin) {
|
||||||
|
index = [];
|
||||||
|
this.hat = hat;
|
||||||
|
this.hair = hair;
|
||||||
|
this.face = face;
|
||||||
|
this.breast = breast;
|
||||||
|
this.coat = coat;
|
||||||
|
this.pants = pants;
|
||||||
|
this.waist = waist;
|
||||||
|
this.shoes = shoes;
|
||||||
|
this.skin = skin;
|
||||||
|
|
||||||
|
index.push(hat);
|
||||||
|
index.push(hair);
|
||||||
|
index.push(face);
|
||||||
|
index.push(breast);
|
||||||
|
index.push(coat);
|
||||||
|
index.push(pants);
|
||||||
|
index.push(waist);
|
||||||
|
index.push(shoes);
|
||||||
|
index.push(skin);
|
||||||
|
index.push(0);
|
||||||
|
index.push(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//默认时装
|
||||||
|
if (!(getroottable().rawin("defaultJobItemIdMap"))) {
|
||||||
|
getroottable().defaultJobItemIdMap <- {};
|
||||||
|
defaultJobItemIdMap.rawset(0, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 0, 41800, 42200));
|
||||||
|
defaultJobItemIdMap.rawset(1, defaultJobItemId(0, 43400, 0, 0, 44600, 45000, 0, 45800, 46200));
|
||||||
|
defaultJobItemIdMap.rawset(2, defaultJobItemId(0, 47400, 0, 48426, 48600, 49000, 0, 49800, 50200));
|
||||||
|
defaultJobItemIdMap.rawset(3, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 0, 53800, 54200));
|
||||||
|
defaultJobItemIdMap.rawset(4, defaultJobItemId(0, 55400, 55820, 0, 56600, 57000, 0, 57800, 58200));
|
||||||
|
|
||||||
|
defaultJobItemIdMap.rawset(5, defaultJobItemId(1600000, 1610000, 0, 0, 1640000, 1650000, 0, 1670000, 1680000));
|
||||||
|
defaultJobItemIdMap.rawset(6, defaultJobItemId(1720000, 1730000, 0, 1750000, 1760000, 1770000, 0, 1790000, 1800000));
|
||||||
|
defaultJobItemIdMap.rawset(7, defaultJobItemId(0, 29201, 0, 0, 29202, 29203, 0, 29204, 29205));
|
||||||
|
defaultJobItemIdMap.rawset(8, defaultJobItemId(0, 2090000, 0, 0, 2120000, 2130000, 0, 2140000, 2150000));
|
||||||
|
defaultJobItemIdMap.rawset(9, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 0, 41800, 42200));
|
||||||
|
defaultJobItemIdMap.rawset(10, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 0, 53800, 54200));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class Marry {
|
class Marry {
|
||||||
//当前频道
|
//当前频道
|
||||||
Channel = null;
|
Channel = null;
|
||||||
|
|
@ -16,9 +108,13 @@ class Marry {
|
||||||
//进入礼堂前的位置信息
|
//进入礼堂前的位置信息
|
||||||
EnterAuditoriumPosList = {};
|
EnterAuditoriumPosList = {};
|
||||||
|
|
||||||
//礼堂id 对应的用户信息
|
//礼堂id 对应的用户信息 结构为Map<cid,Map<uid , avatar[]>>
|
||||||
AuditoriumUserInfo = {};
|
AuditoriumUserInfo = {};
|
||||||
|
//角色时装信息
|
||||||
|
UserAvaList = {};
|
||||||
|
|
||||||
|
//礼堂id 对应礼堂的宾客信息
|
||||||
|
AuditoriumUserInfoNewPeople = {};
|
||||||
|
|
||||||
//数据库操作集
|
//数据库操作集
|
||||||
Mysql_Operate_Func = {
|
Mysql_Operate_Func = {
|
||||||
|
|
@ -70,6 +166,19 @@ class Marry {
|
||||||
//把连接还池子
|
//把连接还池子
|
||||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//清空礼堂信息列表
|
||||||
|
RomoveRoom = function(Cid) {
|
||||||
|
local delete_sql = format(MARRY_SQL_LIST.RomoveRoom);
|
||||||
|
//从池子拿连接
|
||||||
|
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||||
|
SqlObj.Exec_Sql(delete_sql);
|
||||||
|
//把连接还池子
|
||||||
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//查询结婚对象名字
|
//查询结婚对象名字
|
||||||
CheckMarryTargetName = function(Cid) {
|
CheckMarryTargetName = function(Cid) {
|
||||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryTargetName, Cid);
|
local CheckSql = format(MARRY_SQL_LIST.CheckMarryTargetName, Cid);
|
||||||
|
|
@ -134,6 +243,9 @@ class Marry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//根据cid查询婚礼开始时间
|
//根据cid查询婚礼开始时间
|
||||||
GetAuditoriumTimeById = function(cid) {
|
GetAuditoriumTimeById = function(cid) {
|
||||||
local Sql = format(MARRY_SQL_LIST.GetAuditoriumTimeById, cid);
|
local Sql = format(MARRY_SQL_LIST.GetAuditoriumTimeById, cid);
|
||||||
|
|
@ -149,19 +261,88 @@ class Marry {
|
||||||
return Ret[0][0];
|
return Ret[0][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//根据cid查询2个人的姓名
|
||||||
|
GetAuditoriumName2ById = function(cid) {
|
||||||
|
local Sql = format(MARRY_SQL_LIST.GetAuditoriumName2ById, cid, 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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//根据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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//获取角色身上的显示时装
|
||||||
|
function GetAva(SUser) {
|
||||||
|
//获取背包对象
|
||||||
|
local InvenObj = SUser.GetInven();
|
||||||
|
if (!InvenObj) return;
|
||||||
|
local re = [];
|
||||||
|
local job = SUser.GetCharacJob();
|
||||||
|
|
||||||
|
//遍历身上的每一件装备
|
||||||
|
for (local u = 0; u <= 2; u++) {
|
||||||
|
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
||||||
|
if (EquObj && !EquObj.IsEmpty) {
|
||||||
|
//先拿克隆id 如果这个值有 那说明带的克隆这个是被克隆的装备 直接用这个 但是如果这个人什么都没带 只带了克隆 会显示克隆的id 所以还得判断这个id是不是克隆时装
|
||||||
|
local clearId = Sq_CallFunc(S_Ptr("0x850d374"), "int", ["pointer", "int"], InvenObj.C_Object, u)
|
||||||
|
|
||||||
|
|
||||||
|
local EquObjId = EquObj.GetIndex();
|
||||||
|
//如果这个是克隆
|
||||||
|
if (clearId > 0) {
|
||||||
|
re.push(clearId);
|
||||||
|
} else { //不是克隆 直接把id放上去
|
||||||
|
re.push(EquObjId);
|
||||||
|
}
|
||||||
|
} else { //如果这个部位没东西 直接放默认时装上去
|
||||||
|
re.push(defaultJobItemIdMap[job].index[u]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return re;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//查看是否结婚包
|
//查看是否结婚包
|
||||||
|
|
@ -325,8 +506,8 @@ class Marry {
|
||||||
//获得婚礼仪式开始时间
|
//获得婚礼仪式开始时间
|
||||||
local Index = time() + (Time + 1) * 10 * 60;
|
local Index = time() + (Time + 1) * 10 * 60;
|
||||||
//注册婚礼礼堂信息
|
//注册婚礼礼堂信息
|
||||||
Mysql_Operate_Func.InsertMarryRoom(SUser.GetCID(), SUser.GetCharacName(), Time, Level, Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), 1, Index);
|
Mysql_Operate_Func.InsertMarryRoom(SUser.GetCID(), SUser.GetCharacName(), Time, Level, Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), Time, Index);
|
||||||
Mysql_Operate_Func.InsertMarryRoom(Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), Time, Level, SUser.GetCID(), SUser.GetCharacName(), 1, Index);
|
Mysql_Operate_Func.InsertMarryRoom(Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), Time, Level, SUser.GetCID(), SUser.GetCharacName(), Time, Index);
|
||||||
AuditoriumUserInfo.rawset(SUser.GetCID(), {});
|
AuditoriumUserInfo.rawset(SUser.GetCID(), {});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -339,6 +520,30 @@ class Marry {
|
||||||
Flag = 2
|
Flag = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//这里放2个新人的信息
|
||||||
|
local avatra = [];
|
||||||
|
local infore = {};
|
||||||
|
infore.rawset("job", SUser.GetCharacJob());
|
||||||
|
infore.rawset("growjob", SUser.GetCharacGrowType());
|
||||||
|
infore.rawset("avatar", Config["职业对应的结婚礼服"][SUser.GetCharacJob().tostring()]);
|
||||||
|
infore.rawset("name", SUser.GetCharacName());
|
||||||
|
infore.rawset("uid", SUser.GetUID());
|
||||||
|
|
||||||
|
local Muser = World.GetUserByUid(Target_CId);
|
||||||
|
local infore2 = {};
|
||||||
|
infore2.rawset("job", Muser.GetCharacJob());
|
||||||
|
infore2.rawset("growjob", Muser.GetCharacGrowType());
|
||||||
|
infore2.rawset("avatar", Config["职业对应的结婚礼服"][Muser.GetCharacJob().tostring()]);
|
||||||
|
infore2.rawset("name", Muser.GetCharacName());
|
||||||
|
infore2.rawset("uid", Muser.GetUID());
|
||||||
|
avatra.push(infore);
|
||||||
|
avatra.push(infore2);
|
||||||
|
|
||||||
|
AuditoriumUserInfoNewPeople.rawset(SUser.GetCID(), avatra);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local WorldMap = World.GetOnlinePlayer();
|
local WorldMap = World.GetOnlinePlayer();
|
||||||
foreach(W_User in WorldMap) {
|
foreach(W_User in WorldMap) {
|
||||||
if (W_User.GetCID() == Target_CId) {
|
if (W_User.GetCID() == Target_CId) {
|
||||||
|
|
@ -346,20 +551,108 @@ class Marry {
|
||||||
W_User.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
W_User.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SUser.SendJso(T);
|
SUser.SendJso(T);
|
||||||
SUser.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
SUser.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||||
|
|
||||||
|
Timer.SetTimeOut(OpenAuditorium.bindenv(this), (Time + 1) * 10 * 1000, SUser.GetCID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//婚礼前的准备 把2个新人先传进去
|
||||||
|
function OpenPreparation(index) {
|
||||||
|
//拿到两个新人的信息
|
||||||
|
local uidsInfo = AuditoriumUserInfoNewPeople[index];
|
||||||
|
|
||||||
|
local uid1 = uidsInfo[0].rawget("uid");
|
||||||
|
local uid2 = uidsInfo[1].rawget("uid");
|
||||||
|
|
||||||
|
//拿到礼堂所有宾客的信息
|
||||||
|
local userlist = AuditoriumUserInfo[index];
|
||||||
|
//如果不在里面就传送进来
|
||||||
|
if (!(userlist.rawin(uid1))) {
|
||||||
|
EnterAuditorium(World.GetUserByUid(uid1), {
|
||||||
|
room = -1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!(userlist.rawin(uid2))) {
|
||||||
|
EnterAuditorium(World.GetUserByUid(uid2), {
|
||||||
|
room = -1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//开启婚礼 参数为礼堂编号 也就是其中一个人的cid
|
||||||
|
function OpenAuditorium(index) {
|
||||||
|
print(time());
|
||||||
|
|
||||||
|
//婚礼准备
|
||||||
|
OpenPreparation(index);
|
||||||
|
|
||||||
|
//通知所有在这个礼堂里的人 婚礼开始了
|
||||||
|
local userlist = AuditoriumUserInfo[index];
|
||||||
|
|
||||||
|
|
||||||
|
//先拿到新人存的信息
|
||||||
|
local info = AuditoriumUserInfoNewPeople[index];
|
||||||
|
|
||||||
|
local uid1 = info[0].rawget("uid");
|
||||||
|
local uid2 = info[1].rawget("uid");
|
||||||
|
|
||||||
|
|
||||||
|
//比那里礼堂所有人信息
|
||||||
|
foreach(uid, v in userlist) {
|
||||||
|
local user = World.GetUserByUid(uid);
|
||||||
|
//todo 这里要判断 如果是结婚的人就不加到宾客里
|
||||||
|
if (!user) {
|
||||||
|
|
||||||
|
}
|
||||||
|
local infore = {
|
||||||
|
job = user.GetCharacJob(),
|
||||||
|
growjob = user.GetCharacGrowType(),
|
||||||
|
avatar = GetAva(user),
|
||||||
|
name = user.GetCharacName(),
|
||||||
|
};
|
||||||
|
info.push(infore);
|
||||||
|
if (info.len() >= 8) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printT(info);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(uid, v in userlist) {
|
||||||
|
local user = World.GetUserByUid(uid);
|
||||||
|
//发包通知 普通宾客的包
|
||||||
|
local T = {
|
||||||
|
op = OP + 34,
|
||||||
|
info = info
|
||||||
|
}
|
||||||
|
user.SendJso(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//删除礼堂信息
|
||||||
|
AuditoriumUserInfo.rawdelete(index);
|
||||||
|
//删除数据库信息
|
||||||
|
//Mysql_Operate_Func.RomoveRoom();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//进入礼堂
|
//进入礼堂
|
||||||
function EnterAuditorium(SUser, Jso) {
|
function EnterAuditorium(SUser, Jso) {
|
||||||
local RoomId = Jso.room;
|
local RoomId = Jso.room;
|
||||||
|
|
||||||
local location = SUser.GetLocation();
|
local location = SUser.GetLocation();
|
||||||
|
|
||||||
//进入自己的礼堂
|
// //进入自己的礼堂
|
||||||
if (RoomId == -1) {
|
if (RoomId == -1) {
|
||||||
local MyState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
local MyState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
||||||
if (MyState != 2) {
|
if (MyState != 2) {
|
||||||
|
|
@ -376,6 +669,7 @@ class Marry {
|
||||||
location.rawset("所在礼堂编号", RoomId);
|
location.rawset("所在礼堂编号", RoomId);
|
||||||
//向缓存写入进入时的坐标
|
//向缓存写入进入时的坐标
|
||||||
EnterAuditoriumPosList.rawset(SUser.GetCID(), location);
|
EnterAuditoriumPosList.rawset(SUser.GetCID(), location);
|
||||||
|
|
||||||
//移动到礼堂
|
//移动到礼堂
|
||||||
World.MoveArea(SUser, Config["礼堂城镇编号"], Config["礼堂区域编号"], 55, 349);
|
World.MoveArea(SUser, Config["礼堂城镇编号"], Config["礼堂区域编号"], 55, 349);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -389,21 +683,47 @@ class Marry {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AuditoriumUserInfo[RoomId].rawset(SUser.GetCID(), 1);
|
local infore = {};
|
||||||
|
infore.rawset("job", SUser.GetCharacJob());
|
||||||
|
infore.rawset("growjob", SUser.GetCharacGrowType());
|
||||||
|
infore.rawset("avatar", GetAva(SUser));
|
||||||
|
infore.rawset("name", SUser.GetCharacName());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AuditoriumUserInfo[RoomId].rawset(SUser.GetUID(), infore);
|
||||||
|
|
||||||
|
//遍历这个礼堂里的人 给他们发送可见列表
|
||||||
local UserCanSee = [];
|
local UserCanSee = [];
|
||||||
foreach(cid in AuditoriumUserInfo[RoomId]) {
|
foreach(uid, info in AuditoriumUserInfo[RoomId]) {
|
||||||
UserCanSee.push(cid);
|
UserCanSee.push(uid);
|
||||||
}
|
}
|
||||||
|
MarryUserCallBack(UserCanSee, SUser)
|
||||||
|
|
||||||
|
|
||||||
local T = {
|
local T = {
|
||||||
op = OP + 22,
|
op = OP + 22,
|
||||||
time = Mysql_Operate_Func.GetAuditoriumTimeById(RoomId) - time()
|
time = Mysql_Operate_Func.GetAuditoriumTimeById(RoomId) - time()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SUser.SendJso(T);
|
SUser.SendJso(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//服务端区域移动添加玩家HOOK 让大家不可见
|
||||||
|
function Marry_insert_user_hook(C_Area, C_User) {
|
||||||
|
//如果有城镇配置
|
||||||
|
if (Config) {
|
||||||
|
local SUser = User(C_User);
|
||||||
|
if (SUser.GetLocation().Town == Config["礼堂城镇编号"]) {
|
||||||
|
if (SUser.GetLocation().Area == Config["礼堂区域编号"]) Sq_WriteAddress(C_Area, 0x68, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//离开礼堂
|
//离开礼堂
|
||||||
function LeaveAuditorium(SUser, Jso) {
|
function LeaveAuditorium(SUser, Jso) {
|
||||||
if (EnterAuditoriumPosList.rawin(SUser.GetCID())) {
|
if (EnterAuditoriumPosList.rawin(SUser.GetCID())) {
|
||||||
|
|
@ -411,14 +731,19 @@ class Marry {
|
||||||
//离开礼堂回到进入时的位置
|
//离开礼堂回到进入时的位置
|
||||||
World.MoveArea(SUser, Info.Town, Info.Area, Info.Pos.X, Info.Pos.Y);
|
World.MoveArea(SUser, Info.Town, Info.Area, Info.Pos.X, Info.Pos.Y);
|
||||||
|
|
||||||
|
//给这个礼堂的人发送退出可见列表的包
|
||||||
|
foreach(uid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
||||||
|
UserCanSee.push(uid);
|
||||||
|
}
|
||||||
|
MarryUserDeleteCallBack(UserCanSee, SUser)
|
||||||
|
|
||||||
AuditoriumUserInfo[Info["所在礼堂编号"]].rawdelete(SUser.GetCID());
|
|
||||||
|
AuditoriumUserInfo[Info["所在礼堂编号"]].rawdelete(SUser.GetUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//获得礼堂列表
|
//获得礼堂列表
|
||||||
function GetAuditoriumList(SUser, Jso) {
|
function GetAuditoriumList(SUser, Jso) {
|
||||||
local re = Mysql_Operate_Func.GetAuditoriumList();
|
local re = Mysql_Operate_Func.GetAuditoriumList();
|
||||||
|
|
@ -455,13 +780,18 @@ class Marry {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//表示是否可见 参数为用户数组
|
//加入到可见列表
|
||||||
function MarryUserCallBack(RealList, MUser) {
|
function MarryUserCallBack(CUserList, MUser) {
|
||||||
|
|
||||||
|
|
||||||
|
local RealList = [];
|
||||||
|
foreach(uid in CUserList) {
|
||||||
|
local SUser = World.GetUserByUid(uid);
|
||||||
|
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
|
||||||
|
}
|
||||||
|
|
||||||
foreach(_Index, Value in RealList) {
|
foreach(_Index, Value in RealList) {
|
||||||
local SUser = Value;
|
local SUser = Value;
|
||||||
if (!SUser || !SUser.GetState() >= 3) continue;
|
|
||||||
if (SUser.GetUID() == MUser.GetUID()) continue;
|
|
||||||
local Pack = Packet();
|
local Pack = Packet();
|
||||||
Pack.Put_Header(0, 24);
|
Pack.Put_Header(0, 24);
|
||||||
Pack.Put_Byte(SUser.GetLocation().Town); //城镇
|
Pack.Put_Byte(SUser.GetLocation().Town); //城镇
|
||||||
|
|
@ -477,7 +807,6 @@ class Marry {
|
||||||
}
|
}
|
||||||
Pack.Put_Byte(1); //是否可见
|
Pack.Put_Byte(1); //是否可见
|
||||||
Pack.Finalize(true);
|
Pack.Finalize(true);
|
||||||
|
|
||||||
SUser.Send(Pack);
|
SUser.Send(Pack);
|
||||||
Pack.Delete();
|
Pack.Delete();
|
||||||
}
|
}
|
||||||
|
|
@ -498,12 +827,14 @@ class Marry {
|
||||||
Pack.Put_Byte(MUser.GetLocation().Town); //城镇
|
Pack.Put_Byte(MUser.GetLocation().Town); //城镇
|
||||||
|
|
||||||
|
|
||||||
Pack.Put_Byte(MUser.GetArea(1)); //区域
|
Pack.Put_Byte(99); //区域
|
||||||
Pack.Put_Short(MUser.GetAreaPos().X);
|
Pack.Put_Short(MUser.GetAreaPos().X);
|
||||||
|
|
||||||
Pack.Put_Short(MUser.GetAreaPos().Y);
|
Pack.Put_Short(MUser.GetAreaPos().Y);
|
||||||
Pack.Put_Byte(MUser.GetDirections()); //朝向
|
Pack.Put_Byte(MUser.GetDirections()); //朝向
|
||||||
Pack.Put_Byte(MUser.GetVisibleValues()); //是否可见
|
Pack.Put_Byte(MUser.GetVisibleValues()); //是否可见
|
||||||
Pack.Finalize(true);
|
Pack.Finalize(true);
|
||||||
|
|
||||||
SUser.Send(Pack);
|
SUser.Send(Pack);
|
||||||
Pack.Delete();
|
Pack.Delete();
|
||||||
}
|
}
|
||||||
|
|
@ -511,8 +842,10 @@ class Marry {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
Config = dofile("/root/娱心插件配置/结婚系统配置.dat");
|
Config = dofile("/root/娱心插件配置/结婚系统配置.dat");
|
||||||
|
|
||||||
local ConfigPath = Sq_Game_GetConfig();
|
local ConfigPath = Sq_Game_GetConfig();
|
||||||
Channel = ConfigPath.slice(-6).slice(0, 2);
|
Channel = ConfigPath.slice(-6).slice(0, 2);
|
||||||
|
|
||||||
|
|
@ -527,18 +860,23 @@ class Marry {
|
||||||
ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 19, GetAuditoriumList.bindenv(this));
|
ClientSocketPackFuncMap.rawset(OP + 19, GetAuditoriumList.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 777, GetConfig.bindenv(this));
|
ClientSocketPackFuncMap.rawset(OP + 777, GetConfig.bindenv(this));
|
||||||
|
//注册结婚回调函数
|
||||||
|
Cb_Insert_User_Func.Marry <- Marry_insert_user_hook.bindenv(this); //区域添加角色
|
||||||
|
|
||||||
//每次加载的时候都注册礼堂信息
|
//玩家重新上线的时候自动给他退出礼堂
|
||||||
AuditoriumUserInfo.rawset(1, {});
|
Cb_reach_game_world_Func.Auditorium <- function(SUser) {
|
||||||
|
if (EnterAuditoriumPosList.rawin(SUser.GetUID())) {
|
||||||
|
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
||||||
|
//给这个礼堂的人发送退出可见列表的包
|
||||||
|
foreach(cid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
||||||
|
UserCanSee.push(cid);
|
||||||
|
}
|
||||||
|
MarryUserDeleteCallBack(UserCanSee, SUser)
|
||||||
|
|
||||||
local RealList = [];
|
AuditoriumUserInfo[Info["所在礼堂编号"]].rawdelete(SUser.GetUID());
|
||||||
|
}
|
||||||
|
}.bindenv(this);
|
||||||
|
|
||||||
RealList.push(World.GetUserByUid(1));
|
|
||||||
RealList.push(World.GetUserByUid(2));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Timer.SetTimeOut(MarryUserDeleteCallBack, 3000, RealList, World.GetUserByUid(1));
|
|
||||||
|
|
||||||
//从池子拿连接
|
//从池子拿连接
|
||||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||||
|
|
@ -553,7 +891,30 @@ class Marry {
|
||||||
}
|
}
|
||||||
//把连接还池子
|
//把连接还池子
|
||||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectInitFuncMap.P_Marry <- 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给的心意点"]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
@ -36,4 +36,14 @@ MARRY_SQL_LIST.GetAuditoriumList <- @"SELECT * FROM zyk.marry_room";
|
||||||
MARRY_SQL_LIST.GetAuditoriumIndexById <- @"SELECT target_cid FROM zyk.marry_room WHERE cid = %d";
|
MARRY_SQL_LIST.GetAuditoriumIndexById <- @"SELECT target_cid FROM zyk.marry_room WHERE cid = %d";
|
||||||
|
|
||||||
//根据cid查询自己的礼堂编号
|
//根据cid查询自己的礼堂编号
|
||||||
MARRY_SQL_LIST.GetAuditoriumTimeById <- @"SELECT rindex FROM zyk.marry_room WHERE cid = %d";
|
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.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";
|
||||||
|
|
@ -5,10 +5,12 @@ function InitPluginInfo() {
|
||||||
_Timer_Object <- Timer();
|
_Timer_Object <- Timer();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//初始化自动重载 只在15线开启
|
//初始化自动重载 只在15线开启
|
||||||
local ConfigPath = Sq_Game_GetConfig();
|
local ConfigPath = Sq_Game_GetConfig();
|
||||||
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
|
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();
|
local PoolObj = MysqlPool.GetInstance();
|
||||||
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||||
|
|
@ -18,12 +20,21 @@ function InitPluginInfo() {
|
||||||
PoolObj.Init();
|
PoolObj.Init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Sq_CreatCConnectPool(2, 4, "127.0.0.1", 3306, "game", "uu5!^%jg");
|
|
||||||
Sq_CreatSocketConnect("192.168.200.24", "65109");
|
Sq_CreatSocketConnect("192.168.200.24", "65109");
|
||||||
|
|
||||||
//初始化结婚
|
//初始化结婚
|
||||||
ProjectInitFuncMap.P_Marry <- Marry();
|
// ProjectInitFuncMap.P_Marry <- Marry();
|
||||||
|
|
||||||
|
|
||||||
|
//初始化日志器
|
||||||
|
Log({
|
||||||
|
"normal": "/dp_s/log/normal.log",
|
||||||
|
"error": "/dp_s/log/error.log"
|
||||||
|
});
|
||||||
|
//调用方式
|
||||||
|
//Log.Put("normal", "测试日志");
|
||||||
|
//Log.Put("error", "测试错误日志");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -39,6 +50,18 @@ function main() {
|
||||||
PrintTag();
|
PrintTag();
|
||||||
|
|
||||||
GameManager.SetGameMaxLevel(95);
|
GameManager.SetGameMaxLevel(95);
|
||||||
|
// GameManager.FixAvatarUseJewel();
|
||||||
|
GameManager.FixSaveTown();
|
||||||
|
GameManager.FixDespairGold();
|
||||||
|
GameManager.FixGlodTradeDaily(80000000);
|
||||||
|
|
||||||
|
|
||||||
|
getroottable().RRR <- EquimentUseJewel();
|
||||||
|
// local PvfObject = Script();
|
||||||
|
// local Data = ScriptData.GetEquipment(305014);
|
||||||
|
// printT(Data);
|
||||||
|
|
||||||
|
// Sq_Conversion("這是一個繁體字符串");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@ foreach(_ItemId, baseInfo in TW_StkUpJTable) {
|
||||||
if (SlotItem.GetType() != "装备") {
|
if (SlotItem.GetType() != "装备") {
|
||||||
local SlotCount = SlotItem.GetAdd_Info();
|
local SlotCount = SlotItem.GetAdd_Info();
|
||||||
local GiveRate = floor(SlotCount.tofloat() / Info.Stk.Count.tofloat());
|
local GiveRate = floor(SlotCount.tofloat() / Info.Stk.Count.tofloat());
|
||||||
if(GiveRate < 1){
|
if (GiveRate< 1) {
|
||||||
SUser.SendNotiPacketMessage(format(TW_STR_00084), 8);
|
SUser.SendNotiPacketMessage(format(TW_STR_00084), 8);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1563,7 +1563,7 @@ Cb_timer_dispatch_Func["TW_Cb_timer_dispatch_Func"] <- function() {
|
||||||
if (mitems.len() > 0) {
|
if (mitems.len() > 0) {
|
||||||
SUser.SendMail(mitems, {
|
SUser.SendMail(mitems, {
|
||||||
Title = TW_STR_00001,
|
Title = TW_STR_00001,
|
||||||
Text = TW_STR_00002
|
Text = TW_STR_0000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,4 +106,244 @@ _Hook_Register_Currency_Func_("0x84FC37E", ["pointer", "int", "pointer", "int"],
|
||||||
//获取通关时间回调
|
//获取通关时间回调
|
||||||
Cb_CParty_SetBestClearTime_Enter_Func <- {};
|
Cb_CParty_SetBestClearTime_Enter_Func <- {};
|
||||||
Cb_CParty_SetBestClearTime_Leave_Func <- {};
|
Cb_CParty_SetBestClearTime_Leave_Func <- {};
|
||||||
_Hook_Register_Currency_Func_("0x85BE178", ["pointer", "char", "int", "int", "bool"], Cb_CParty_SetBestClearTime_Enter_Func, Cb_CParty_SetBestClearTime_Leave_Func);
|
_Hook_Register_Currency_Func_("0x85BE178", ["pointer", "char", "int", "int", "bool"], Cb_CParty_SetBestClearTime_Enter_Func, Cb_CParty_SetBestClearTime_Leave_Func);
|
||||||
|
|
||||||
|
//使用称号回收箱时检查使用条件
|
||||||
|
Cb_UseLimitCube_Check_Error_Enter_Func <- {};
|
||||||
|
Cb_UseLimitCube_Check_Error_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x081D3BBC", ["pointer", "int", "int", "int", "pointer", "pointer", "pointer", "int"], Cb_UseLimitCube_Check_Error_Enter_Func, Cb_UseLimitCube_Check_Error_Leave_Func);
|
||||||
|
|
||||||
|
//使用称号回收箱过程
|
||||||
|
Cb_UseLimitCube_Process_Enter_Func <- {};
|
||||||
|
Cb_UseLimitCube_Process_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x081D3D38", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_UseLimitCube_Process_Enter_Func, Cb_UseLimitCube_Process_Leave_Func);
|
||||||
|
|
||||||
|
//购买商城物品时日志
|
||||||
|
Cb_Log_BuyCashShopItem_Enter_Func <- {};
|
||||||
|
Cb_Log_BuyCashShopItem_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08686EA0", ["pointer", "int", "int", "int", "int", "char", "int", "int", "int"], Cb_Log_BuyCashShopItem_Enter_Func, Cb_Log_BuyCashShopItem_Leave_Func);
|
||||||
|
|
||||||
|
//购买道具获取信息
|
||||||
|
Cb_BuyItem_Get_Data_Enter_Func <- {};
|
||||||
|
Cb_BuyItem_Get_Data_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x81BE658", ["pointer", "pointer", "int", "pointer", "int"], Cb_BuyItem_Get_Data_Enter_Func, Cb_BuyItem_Get_Data_Leave_Func);
|
||||||
|
|
||||||
|
//设置角色详细信息
|
||||||
|
Cb_Set_Charac_Info_Detail_Enter_Func <- {};
|
||||||
|
Cb_Set_Charac_Info_Detail_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0864AC1A", ["pointer", "int", "int", "pointer", "int"], Cb_Set_Charac_Info_Detail_Enter_Func, Cb_Set_Charac_Info_Detail_Leave_Func);
|
||||||
|
|
||||||
|
//使用远古地下城道具
|
||||||
|
Cb_UseAncientDungeonItems_Enter_Func <- {};
|
||||||
|
Cb_UseAncientDungeonItems_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x859EAC2", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_UseAncientDungeonItems_Enter_Func, Cb_UseAncientDungeonItems_Leave_Func);
|
||||||
|
|
||||||
|
//购买限时商品
|
||||||
|
Cb_BuyCeraShopLimitItem_Enter_Func <- {};
|
||||||
|
Cb_BuyCeraShopLimitItem_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x821F9BA", ["pointer", "pointer", "pointer", "int"], Cb_BuyCeraShopLimitItem_Enter_Func, Cb_BuyCeraShopLimitItem_Leave_Func);
|
||||||
|
|
||||||
|
//获取下次清除时间
|
||||||
|
Cb_User_GetLastClearTime_Enter_Func <- {};
|
||||||
|
Cb_User_GetLastClearTime_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0864387E", ["pointer", "int"], Cb_User_GetLastClearTime_Enter_Func, Cb_User_GetLastClearTime_Leave_Func);
|
||||||
|
|
||||||
|
//每日可交易金币上限
|
||||||
|
Cb_User_CharacInfo_IsAvailableCurCharacTradeGoldDaily_Enter_Func <- {};
|
||||||
|
Cb_User_CharacInfo_IsAvailableCurCharacTradeGoldDaily_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08646496", ["pointer", "int", "int"], Cb_User_CharacInfo_IsAvailableCurCharacTradeGoldDaily_Enter_Func, Cb_User_CharacInfo_IsAvailableCurCharacTradeGoldDaily_Leave_Func);
|
||||||
|
|
||||||
|
//进入副本加载完毕时
|
||||||
|
Cb_Party_OnStartMapFinishLoading_Enter_Func <- {};
|
||||||
|
Cb_Party_OnStartMapFinishLoading_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x085B170A", ["pointer", "int", "int"], Cb_Party_OnStartMapFinishLoading_Enter_Func, Cb_Party_OnStartMapFinishLoading_Leave_Func);
|
||||||
|
|
||||||
|
//房间清理完毕
|
||||||
|
Cb_Battle_Field_onClearMap_Enter_Func <- {};
|
||||||
|
Cb_Battle_Field_onClearMap_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0830DD2C", ["pointer", "bool", "char"], Cb_Battle_Field_onClearMap_Enter_Func, Cb_Battle_Field_onClearMap_Leave_Func);
|
||||||
|
|
||||||
|
//放弃副本
|
||||||
|
Cb_Party_giveup_game_Enter_Func <- {};
|
||||||
|
Cb_Party_giveup_game_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x085B2BAA", ["pointer", "pointer", "bool", "bool", "bool", "void"], Cb_Party_giveup_game_Enter_Func, Cb_Party_giveup_game_Leave_Func);
|
||||||
|
|
||||||
|
//迷妄之塔 死亡之塔通关时
|
||||||
|
Cb_CDeathTower_onClear_Enter_Func <- {};
|
||||||
|
Cb_CDeathTower_onClear_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08467E60", ["pointer", "bool", "int"], Cb_CDeathTower_onClear_Enter_Func, Cb_CDeathTower_onClear_Leave_Func);
|
||||||
|
|
||||||
|
//无尽祭坛通关时
|
||||||
|
Cb_CBloodClearRewardData_Enter_Func <- {};
|
||||||
|
Cb_CBloodClearRewardData_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08306FC4", ["pointer", "bool", "int", "pointer", "pointer", "bool"], Cb_CBloodClearRewardData_Enter_Func, Cb_CBloodClearRewardData_Leave_Func);
|
||||||
|
|
||||||
|
//进入迷妄之塔 死亡之塔时
|
||||||
|
Cb_DeathTowerStageCommand_Enter_Func <- {};
|
||||||
|
Cb_DeathTowerStageCommand_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08208A9E", ["pointer", "pointer", "pointer", "int"], Cb_DeathTowerStageCommand_Enter_Func, Cb_DeathTowerStageCommand_Leave_Func);
|
||||||
|
|
||||||
|
//离开迷妄之塔 死亡之塔时
|
||||||
|
Cb_CDeathTower_onLeaveUser_Enter_Func <- {};
|
||||||
|
Cb_CDeathTower_onLeaveUser_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x084636F2", ["pointer", "pointer", "int"], Cb_CDeathTower_onLeaveUser_Enter_Func, Cb_CDeathTower_onLeaveUser_Leave_Func);
|
||||||
|
|
||||||
|
//玩家交易过程
|
||||||
|
Cb_TradeSpace_proceed_trade_Enter_Func <- {};
|
||||||
|
Cb_TradeSpace_proceed_trade_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0853087A", ["pointer", "int"], Cb_TradeSpace_proceed_trade_Enter_Func, Cb_TradeSpace_proceed_trade_Leave_Func);
|
||||||
|
|
||||||
|
//发送多物品邮件
|
||||||
|
Cb_MultiMailBoxReqSend_Enter_Func <- {};
|
||||||
|
Cb_MultiMailBoxReqSend_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x084E27B8", ["pointer", "pointer", "pointer", "int"], Cb_MultiMailBoxReqSend_Enter_Func, Cb_MultiMailBoxReqSend_Leave_Func);
|
||||||
|
|
||||||
|
//发送单物品邮件
|
||||||
|
Cb_MailBox_Send_Enter_Func <- {};
|
||||||
|
Cb_MailBox_Send_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x081CC958", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_MailBox_Send_Enter_Func, Cb_MailBox_Send_Leave_Func);
|
||||||
|
|
||||||
|
//发送金币邮件时是否通过验证
|
||||||
|
Cb_checkHumanCertify_Enter_Func <- {};
|
||||||
|
Cb_checkHumanCertify_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0867F4C8", ["pointer", "int", "pointer", "int"], Cb_checkHumanCertify_Enter_Func, Cb_checkHumanCertify_Leave_Func);
|
||||||
|
|
||||||
|
//摆摊购买
|
||||||
|
Cb_CPrivateStore_BuyItem_Enter_Func <- {};
|
||||||
|
Cb_CPrivateStore_BuyItem_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x085C924C", ["pointer", "int", "pointer", "int", "int", "int", "int", "int"], Cb_CPrivateStore_BuyItem_Enter_Func, Cb_CPrivateStore_BuyItem_Leave_Func);
|
||||||
|
|
||||||
|
//拍卖行上架
|
||||||
|
Cb_AuctionResultAskRegistedItemNum_Enter_Func <- {};
|
||||||
|
Cb_AuctionResultAskRegistedItemNum_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x084D5930", ["pointer", "pointer", "pointer", "int"], Cb_AuctionResultAskRegistedItemNum_Enter_Func, Cb_AuctionResultAskRegistedItemNum_Leave_Func);
|
||||||
|
|
||||||
|
//拍卖行购买物品
|
||||||
|
Cb_AuctionLogMessage_Enter_Func <- {};
|
||||||
|
Cb_AuctionLogMessage_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x084D7A90", ["pointer", "pointer", "pointer", "int"], Cb_AuctionLogMessage_Enter_Func, Cb_AuctionLogMessage_Leave_Func);
|
||||||
|
|
||||||
|
//副本内生成物品时
|
||||||
|
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 <- {};
|
||||||
|
Cb_IndependentItemRateControl_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0834972F", ["pointer", "pointer", "int"], Cb_IndependentItemRateControl_Enter_Func, Cb_IndependentItemRateControl_Leave_Func);
|
||||||
|
|
||||||
|
//黑钻机添加物品到User时
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
//初始化技能过程
|
||||||
|
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);
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
function sqr_main() {
|
||||||
|
|
||||||
|
|
||||||
|
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());
|
||||||
|
};
|
||||||
|
|
@ -133,5 +133,26 @@
|
||||||
},
|
},
|
||||||
"Dps_A/BaseClass/HotFixClass": {
|
"Dps_A/BaseClass/HotFixClass": {
|
||||||
"description": "热更新"
|
"description": "热更新"
|
||||||
|
},
|
||||||
|
"Dps_A/ProjectClass/AvatarUseJewel": {
|
||||||
|
"description": "时装镶嵌"
|
||||||
|
},
|
||||||
|
"Dps_A/BaseClass/LogClass": {
|
||||||
|
"description": "日志类"
|
||||||
|
},
|
||||||
|
"Dps_A/BaseClass/BlobExClass": {
|
||||||
|
"description": "高级blob"
|
||||||
|
},
|
||||||
|
"Dps_A/BaseClass/ScriptManager": {
|
||||||
|
"description": "pvf管理器"
|
||||||
|
},
|
||||||
|
"Dps_A/BaseClass/AdMsg": {
|
||||||
|
"description": "高级消息类"
|
||||||
|
},
|
||||||
|
"Dps_A/ProjectClass/EquimentUseJewel": {
|
||||||
|
"description": "装备镶嵌"
|
||||||
|
},
|
||||||
|
"Dps_A/ProjectClass/Luke": {
|
||||||
|
"description": "卢克攻坚战"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue