Compare commits
10 Commits
825ab4366c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10de73a395 | ||
|
|
2ef9cfef42 | ||
|
|
eeb773e723 | ||
|
|
4d65103501 | ||
|
|
9d84fe256d | ||
|
|
6c71c79563 | ||
|
|
e82c5ceee3 | ||
|
|
91ff5af4f1 | ||
|
|
7a064bd674 | ||
|
|
3e73f1ae54 |
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Codegeex.RepoIndex": true
|
||||
}
|
||||
211
Dps_A/BaseClass/AdMsg/AdMsg.nut
Normal file
211
Dps_A/BaseClass/AdMsg/AdMsg.nut
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
文件名: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();
|
||||
}
|
||||
}
|
||||
57
Dps_A/BaseClass/BigInt/BigInt.nut
Normal file
57
Dps_A/BaseClass/BigInt/BigInt.nut
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
文件名:BigInt.nut
|
||||
路径:Dps_A/BaseClass/BigInt/BigInt.nut
|
||||
创建日期:2025-03-25 18:28
|
||||
文件用途:大数字类
|
||||
*/
|
||||
class longlong {
|
||||
Value = null;
|
||||
//构造函数 不管是不是string类型都要转成string类型
|
||||
constructor(arg) {
|
||||
if( typeof arg == "string"){
|
||||
Value = arg;
|
||||
}
|
||||
else if( typeof arg == "integer"){
|
||||
Value = arg.tostring();
|
||||
}
|
||||
else if ( typeof arg == "userdata"){
|
||||
local Str = "" + arg;
|
||||
Str = Str.slice(Str.find("0x") + 2, -1);
|
||||
Value = Str;
|
||||
}
|
||||
}
|
||||
|
||||
function _add(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "+"));
|
||||
}
|
||||
|
||||
function _sub(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "-"));
|
||||
}
|
||||
|
||||
function _mul(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "*"));
|
||||
}
|
||||
|
||||
function _div(other) {
|
||||
return Sq_LongLongOperation(this.Value, other.Value, "/");
|
||||
}
|
||||
|
||||
function _unm() {
|
||||
return longlong(Sq_LongLongOperation(longlong("0"), this.Value, "-"));
|
||||
}
|
||||
|
||||
function _modulo(other) {
|
||||
return longlong(Sq_LongLongOperation(this.Value, other.Value, "%"));
|
||||
}
|
||||
|
||||
function GetFormat(FType) {
|
||||
local Buf = Sq_LongLongOperation(this.Value, FType, "format");
|
||||
if (Buf.len()< 2) return Buf + ".0";
|
||||
local Value = Buf.slice(0, -1);
|
||||
local Unit = Buf.slice(-1);
|
||||
local RetStr = format(FType + Unit, Value.tofloat());
|
||||
return RetStr;
|
||||
}
|
||||
|
||||
}
|
||||
121
Dps_A/BaseClass/BlobExClass/BlobExClass.nut
Normal file
121
Dps_A/BaseClass/BlobExClass/BlobExClass.nut
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
文件名: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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class blobex extends blob {
|
||||
|
||||
//-----------------Metamethods--------------------//
|
||||
function _typeof() {
|
||||
return "blobex";
|
||||
}
|
||||
//-----------------Metamethods--------------------//
|
||||
|
||||
constructor(arg) {
|
||||
//通过blob构造
|
||||
if (typeof arg == "blob") {
|
||||
base.constructor(arg.len());
|
||||
writeblob(arg);
|
||||
}
|
||||
//直接构造
|
||||
else {
|
||||
base.constructor(arg);
|
||||
}
|
||||
}
|
||||
|
||||
function writeblob(B) {
|
||||
base.writeblob(B);
|
||||
seek(0);
|
||||
}
|
||||
|
||||
function GetUShort() {
|
||||
return readn('w');
|
||||
}
|
||||
|
||||
function GetShort() {
|
||||
return readn('s');
|
||||
}
|
||||
|
||||
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 Get256() {
|
||||
local Buf = readn('c');
|
||||
return (256.0 + Buf.tofloat()) % 256.0;
|
||||
}
|
||||
|
||||
function GetFloat() {
|
||||
return readn('f');
|
||||
}
|
||||
|
||||
function GetString(count) {
|
||||
return stream_myreadstring(count);
|
||||
}
|
||||
}
|
||||
47
Dps_A/BaseClass/ConfigClass/ConfigClass.nut
Normal file
47
Dps_A/BaseClass/ConfigClass/ConfigClass.nut
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
文件名:ConfigClass.nut
|
||||
路径:Dps_A/BaseClass/ConfigClass/ConfigClass.nut
|
||||
创建日期:2025-03-29 23:54
|
||||
文件用途:全局配置类
|
||||
*/
|
||||
class _GlobalConfig {
|
||||
ConfigMap = null;
|
||||
|
||||
|
||||
constructor() {
|
||||
//在全局中注册自己
|
||||
getroottable().GlobalConfig <- this;
|
||||
|
||||
ConfigMap = {};
|
||||
|
||||
local WorkPath = "/dp_s/OfficialConfig";
|
||||
local FilePaths = sq_GetListFiles(WorkPath);
|
||||
foreach(FilePath in FilePaths) {
|
||||
try {
|
||||
LoadJson(FilePath, WorkPath + "/" + FilePath);
|
||||
} catch (exception) {
|
||||
error("加载配置文件失败:" + FilePath);
|
||||
}
|
||||
}
|
||||
//开启热重载配置
|
||||
GameManager.OpenHotFix("/dp_s/OfficialConfig");
|
||||
}
|
||||
|
||||
function LoadJson(FilePath, Path) {
|
||||
local Config = sq_ReadJsonFile(Path);
|
||||
if (Config) {
|
||||
ConfigMap.rawset(FilePath, Config);
|
||||
}
|
||||
}
|
||||
|
||||
function Get(ConfigName) {
|
||||
if (ConfigMap.rawin(ConfigName)) {
|
||||
return ConfigMap[ConfigName];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_GlobalConfig();
|
||||
@@ -42,13 +42,24 @@ class GameManager extends Base_C_Object {
|
||||
}
|
||||
|
||||
//设置装备解锁需要时间
|
||||
function SetItemLockTime(time) {
|
||||
NativePointer("0x8402D29").writeInt(time);
|
||||
NativePointer("0x854242F").writeInt(time);
|
||||
NativePointer("0x854274D").writeInt(time);
|
||||
NativePointer("0x854296F").writeInt(time);
|
||||
NativePointer("0x8542AD9").writeInt(time);
|
||||
NativePointer("0x8542BDE").writeInt(time);
|
||||
function SetItemLockTime(UnLockTime) {
|
||||
NativePointer("0x854242F").writeInt(UnLockTime);
|
||||
NativePointer("0x8402D29").writeInt(UnLockTime);
|
||||
NativePointer("0x854274D").writeInt(UnLockTime);
|
||||
NativePointer("0x854296F").writeInt(UnLockTime);
|
||||
NativePointer("0x8542AD9").writeInt(UnLockTime);
|
||||
NativePointer("0x8542BDE").writeInt(UnLockTime);
|
||||
NativePointer("0x85F3EB9").writeInt(UnLockTime);
|
||||
Cb_CItemLock_DoItemUnlock_Leave_Func["DPS装备解锁定时器注册任务"] <- function(args) {
|
||||
if (UnLockTime > 0) {
|
||||
local SUser = User(args[1]);
|
||||
Timer.SetTimeOut(function(SUser) {
|
||||
Sq_CallFunc(S_Ptr("0x08646912"), "int", ["pointer"], SUser.C_Object);
|
||||
}, UnLockTime * 1000, SUser)
|
||||
} else {
|
||||
Sq_CallFunc(S_Ptr("0x08646912"), "int", ["pointer"], SUser.C_Object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//开启创建鼠标妹
|
||||
@@ -67,7 +78,7 @@ class GameManager extends Base_C_Object {
|
||||
local item_id = inven_item.GetIndex();
|
||||
local pvfitem = PvfItem.GetPvfItemById(item_id);
|
||||
//如果是魔法封印装备
|
||||
if (!pvfitem.IsRandomOption()) {
|
||||
if (!pvfitem || !pvfitem.IsRandomOption()) {
|
||||
return;
|
||||
}
|
||||
local random_option = NativePointer(inven_item.C_Object).add(37);
|
||||
@@ -83,13 +94,280 @@ class GameManager extends Base_C_Object {
|
||||
|
||||
//开启自动热重载
|
||||
function OpenHotFix(Path = "/dp_s/MyProject") {
|
||||
if (getroottable()._HotFixPath_.rawin(Path)) return;
|
||||
print("DP-S开启自动重载脚本功能,重载目录为: " + Path + " .");
|
||||
print("请注意如果你不处于DP-S开发环境,请关闭此功能,以免对性能造成影响");
|
||||
Sq_AutoReload(Path);
|
||||
getroottable()._HotFixPath_.rawset(Path, true);
|
||||
}
|
||||
|
||||
//开启时装镶嵌
|
||||
function FixAvatarUseJewel() {
|
||||
//时装镶嵌修复
|
||||
_AvatarUseJewel_Object <- AvatarUseJewel();
|
||||
}
|
||||
|
||||
//开启装备镶嵌
|
||||
function FixEquipUseJewel() {
|
||||
//装备镶嵌修复
|
||||
_EquimentUseJewel_Object <- EquimentUseJewel();
|
||||
}
|
||||
|
||||
//修复14技能
|
||||
function Fix14Skill() {
|
||||
Sq_WriteByteArr(S_Ptr("0x08604B1E"), [0x83, 0x7D, 0xEC, 0x07]);
|
||||
Sq_WriteByteArr(S_Ptr("0x08604B8C"), [0xC7, 0x45, 0xE4, 0x08, 0x00, 0x00, 0x00]);
|
||||
Sq_WriteByteArr(S_Ptr("0x08604A09"), [0x83, 0x7D, 0x0C, 0x07]);
|
||||
Sq_WriteByteArr(S_Ptr("0x086050b1"), [0xC7, 0x45, 0xEC, 0x08, 0x00, 0x00, 0x00]);
|
||||
Sq_WriteByteArr(S_Ptr("0x0860511c"), [0xC7, 0x45, 0xE8, 0x08, 0x00, 0x00, 0x00]);
|
||||
Sq_WriteByteArr(S_Ptr("0x08608D7B"), [0x83, 0xF8, 0x0B]);
|
||||
}
|
||||
|
||||
//修复下线卡城镇
|
||||
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_CheckDailyScheduleTime_Leave_Func.DailyScheduleTime <- function(args) {
|
||||
return true;
|
||||
};
|
||||
|
||||
Cb_User_TOD_UserState_getLastClearTime_Leave_Func.DailyScheduleTime <- function(args) {
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
//副本可丢弃品级 传入一个值 3为神器
|
||||
function FixDungeonDropGrade(Level) {
|
||||
NativePointer("0x085A69F2").writeS8(Level);
|
||||
}
|
||||
|
||||
//邮件去除验证
|
||||
function FixEmailRemovalVerification() {
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov eax, 0x0",
|
||||
"ret");
|
||||
Sq_WriteByteArr(S_Ptr("0x0868A51A"), HexCode);
|
||||
}
|
||||
|
||||
//修复拍卖行消耗品上架,设置最大总价,建议值2E
|
||||
function Fix_Auction_Regist_Item() {
|
||||
Haker.LoadHook("0x08213E40", ["int", "int", "bool"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
//开启独立掉落模式 此功能需要传入一个回调函数 参数为 //角色 怪物ID 怪物等级 坐标X 坐标Y 副本名称 副本ID 副本等级 副本难度 深渊标识
|
||||
function OpenIndependenceDropMode(Func) {
|
||||
Haker.LoadHook("0x0830BC78", ["pointer", "pointer", "pointer", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
getroottable().LashKillMonsterId <- NativePointer(args[2]).add(3 * 4).readInt();
|
||||
return null;
|
||||
});
|
||||
|
||||
Haker.LoadHook("0x085A27E8", ["pointer", "pointer", "short", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
//杀死怪物了 要判断是否掉落
|
||||
//获取队伍
|
||||
local PartyObj = Party(args[0]);
|
||||
//获取战斗对象
|
||||
local BattleFieldObj = PartyObj.GetBattleField();
|
||||
//怪物等级
|
||||
local MonsterLevel = NativePointer(args[4]).add(2605).readInt();
|
||||
//怪物ID
|
||||
local MonsterId = getroottable().LashKillMonsterId;
|
||||
//坐标
|
||||
local Xpos = NativePointer(args[4]).add(2596).readShort();
|
||||
local Ypos = NativePointer(args[4]).add(2598).readShort();
|
||||
local DgnObj = BattleFieldObj.GetDgn();
|
||||
//副本名称
|
||||
local DgnName = DgnObj.GetName();
|
||||
//副本ID
|
||||
local DgnId = DgnObj.GetId();
|
||||
//副本等级
|
||||
local DgnLevel = DgnObj.GetMinLevel();
|
||||
//副本难度
|
||||
local DgnDiff = Sq_CallFunc(S_Ptr("0x080F981C"), "int", ["pointer"], BattleFieldObj.C_Object);
|
||||
//深渊标识
|
||||
local HellDiff = BattleFieldObj.GetHellDifficulty();
|
||||
|
||||
for (local i = 0; i< 4; i++) {
|
||||
local SUser = PartyObj.GetUser(i);
|
||||
if (SUser) {
|
||||
//角色 怪物ID 怪物等级 坐标X 坐标Y 副本名称 副本ID 副本等级 副本难度 深渊标识
|
||||
Func(SUser, MonsterId, MonsterLevel, Xpos, Ypos, DgnName, DgnId, DgnLevel, DgnDiff, HellDiff);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
//修改独立掉落原逻辑为不掉落
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov eax, 0x830CD5D",
|
||||
"jmp eax");
|
||||
Haker.InsertCode("0x830CCE2", HexCode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//开启防入侵
|
||||
function FixInvasion() {
|
||||
NativePointer("0x81DB4EA").writeS8(0x00);
|
||||
|
||||
getroottable()._TH_MEM_K_ <- Memory.allocUtf8String("/"); {
|
||||
local _Execve_Address = Module.getExportByName(null, "execve");
|
||||
local _Execve_Address_Str = "" + _Execve_Address;
|
||||
_Execve_Address_Str = _Execve_Address_Str.slice(_Execve_Address_Str.find("0x0x") + 2, -1);
|
||||
|
||||
Haker.LoadHook(_Execve_Address_Str, ["pointer", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
args[0] = getroottable()._TH_MEM_K_.C_Object;
|
||||
return args;
|
||||
},
|
||||
function(args) {
|
||||
return -1;
|
||||
});
|
||||
} {
|
||||
local _System_Address = Module.getExportByName(null, "system");
|
||||
local _System_Address_Str = "" + _System_Address;
|
||||
_System_Address_Str = _System_Address_Str.slice(_System_Address_Str.find("0x0x") + 2, -1);
|
||||
|
||||
Haker.LoadHook(_System_Address_Str, ["pointer", "int"],
|
||||
function(args) {
|
||||
args[0] = getroottable()._TH_MEM_K_.C_Object;
|
||||
return args;
|
||||
},
|
||||
function(args) {
|
||||
return -1;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//修复练习模式
|
||||
function FixPracticemode() {
|
||||
Sq_WriteByteArr(S_Ptr("0x81C820A"), [0xE9, 0xC6, 0x0, 0x0, 0x0, 0x90]);
|
||||
}
|
||||
|
||||
//修复黑暗武士技能
|
||||
function FixDarkWarriorSkillBar()
|
||||
{
|
||||
Cb_CheckMoveComboSkillSlot_Leave_Func["DPSOFF"] <- function (args)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// //调用群助手发送消息
|
||||
// function GroupAssistantSendAMessage() {
|
||||
// //私有方法 发送带参数的Post请求
|
||||
// local SO = Http("129.211.27.104", "9080");
|
||||
// local Res = SO.Post("/dof/chat", Json.Encode({
|
||||
// username = "倾泪寒",
|
||||
// text = "倾泪寒爆史诗了!",
|
||||
// groupId = 416424738
|
||||
// }), "application/json");
|
||||
// }
|
||||
}
|
||||
//热重载
|
||||
getroottable()._HotFixPath_ <- {};
|
||||
getroottable()._HotFixPathChangeTimer_ <- {};
|
||||
|
||||
function _Reload_List_Write_(Path) {
|
||||
sq_RunScript(Path);
|
||||
print("位于 [" + Path + "] 的脚本已重载")
|
||||
local NowTime = Sq_GetTimestampString().slice(-9).tointeger();
|
||||
if (!getroottable()._HotFixPathChangeTimer_.rawin(Path) || NowTime - getroottable()._HotFixPathChangeTimer_[Path] > 1000) {
|
||||
Timer.SetTimeOut(function() {
|
||||
//判断类型
|
||||
if (endswith(Path, ".nut")) {
|
||||
dofile(Path);
|
||||
print("位于 [" + Path + "] 的脚本已重载")
|
||||
} else if (endswith(Path, ".json")) {
|
||||
try {
|
||||
local PArr = split(Path, "/");
|
||||
local RealName = PArr[PArr.len() - 1];
|
||||
|
||||
//在载入新配置之前 先拿到旧配置保存起来
|
||||
local OldConfig = GlobalConfig.Get(RealName);
|
||||
GlobalConfig.LoadJson(RealName, Path);
|
||||
|
||||
//如果存在项目 并且有重载入口 则调用重载入口
|
||||
if (_GlobalOfficial_Project.ReloadProjectMap.rawin(RealName)) {
|
||||
local ProjectStartFunc = _GlobalOfficial_Project.ReloadProjectMap[RealName];
|
||||
if (getroottable().rawin(ProjectStartFunc + "Reload_")) {
|
||||
getroottable()[ProjectStartFunc + "Reload_"](OldConfig);
|
||||
}
|
||||
}
|
||||
print("位于 [" + Path + "] 的配置已重载");
|
||||
|
||||
} catch (exception) {
|
||||
|
||||
}
|
||||
}
|
||||
}, 500)
|
||||
getroottable()._HotFixPathChangeTimer_[Path] <- NowTime;
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,18 @@
|
||||
class _Hacker {
|
||||
HookTable = null;
|
||||
|
||||
HookJumpMemoryTable = null;
|
||||
|
||||
__strtol__function__address__ = null;
|
||||
|
||||
NextReturnAddress = null;
|
||||
|
||||
constructor() {
|
||||
HookTable = {};
|
||||
HookJumpMemoryTable = {};
|
||||
}
|
||||
|
||||
|
||||
function UnLoadHook(AddressStr) {
|
||||
Sq_DeHookFunc(HookTable[AddressStr]);
|
||||
}
|
||||
@@ -25,6 +33,57 @@ class _Hacker {
|
||||
local Controler = Sq_HookFunc(S_Ptr(AddressStr), ArgumentArr, EnterFunc, LeaveFunc);
|
||||
HookTable.rawset(AddressStr, Controler);
|
||||
}
|
||||
|
||||
|
||||
function HexStringToInt(Str) {
|
||||
if (!__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 AsmGenerateMcd(...) {
|
||||
local CodeArr = [];
|
||||
local CurCode = "";
|
||||
try {
|
||||
foreach(Str in vargv) {
|
||||
CurCode = Str;
|
||||
local Code = Sq_Asmjit_Compile(Str);
|
||||
CodeArr.extend(Code);
|
||||
}
|
||||
} catch (exception) {
|
||||
error("汇编代码有误,错误行: " + CurCode);
|
||||
}
|
||||
return CodeArr;
|
||||
}
|
||||
|
||||
function InsertCode(Address, Code) {
|
||||
//置入代码的大小
|
||||
local CodeSize = Code.len();
|
||||
//申请一块内存
|
||||
local MemBuffer = Memory.alloc(CodeSize);
|
||||
//记录
|
||||
HookJumpMemoryTable.rawset(Address, MemBuffer);
|
||||
//写入置入的代码
|
||||
MemBuffer.writeByteArray(Code);
|
||||
|
||||
//计算偏移
|
||||
local Offset = Sq_PointerOperationPointer(MemBuffer.C_Object, Sq_PointerOperation(S_Ptr(Address), 5, "+"), "-");
|
||||
local Str = "" + Offset;
|
||||
Str = Str.slice(Str.find("0x") + 4, -1);
|
||||
local JumpCodeArr = [0xE9];
|
||||
for (local i = 0; i< 4; i++) {
|
||||
local Index = -2 * (i + 1);
|
||||
local StrBuffer = "0x" + (Str.slice(Index).slice(0, 2));
|
||||
JumpCodeArr.push(HexStringToInt(StrBuffer));
|
||||
}
|
||||
Sq_WriteByteArr(S_Ptr(Address), JumpCodeArr);
|
||||
}
|
||||
}
|
||||
|
||||
function _Haker_SetNextReturnAddress(Address) {
|
||||
local Buffer = "" + Address;
|
||||
Haker.NextReturnAddress = Buffer.slice(Buffer.find("0x") + 2, -1);
|
||||
|
||||
}
|
||||
//初始化Hacker
|
||||
Haker <- _Hacker();
|
||||
291
Dps_A/BaseClass/HttpClass/HttpClass.nut
Normal file
291
Dps_A/BaseClass/HttpClass/HttpClass.nut
Normal file
@@ -0,0 +1,291 @@
|
||||
/*
|
||||
文件名: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;
|
||||
}
|
||||
|
||||
// 辅助函数:将参数表编码为 URL 编码字符串
|
||||
function _EncodeParams(params) {
|
||||
local encoded = "";
|
||||
foreach(key, value in params) {
|
||||
if (encoded.len() > 0) encoded += "&";
|
||||
encoded += key + "=" + value; // 需要实现 urlencode
|
||||
}
|
||||
return encoded;
|
||||
}
|
||||
|
||||
function Request(Type, Url, Content, DataType) {
|
||||
local RequestBuffer = Type + " " + Url + " HTTP/1.1\r\nHost: " + Host + "\r\n";
|
||||
|
||||
if (Content) {
|
||||
RequestBuffer += "Content-Length: " + Content.len() + "\r\n";
|
||||
RequestBuffer += "Content-Type: " + DataType + "\r\n";
|
||||
RequestBuffer += "\r\n";
|
||||
RequestBuffer += Content;
|
||||
} else {
|
||||
RequestBuffer += "Connection: close\r\n\r\n";
|
||||
}
|
||||
return Sq_CreateHttp(Host, Service, RequestBuffer);
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
function Post(Url, params = null, DataType = "application/x-www-form-urlencoded") {
|
||||
local content = null;
|
||||
if (params != null && typeof params == "table") {
|
||||
content = _EncodeParams(params); // 编码参数
|
||||
}
|
||||
else if (params != null && typeof params == "string") {
|
||||
content = params;
|
||||
}
|
||||
return Request("POST", Url, content, DataType);
|
||||
}
|
||||
|
||||
function Get(Url, Content = null, DataType = "application/x-www-form-urlencoded") {
|
||||
return Request("GET", Url, Content, DataType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function xorEncryptDecrypt(BlobObj, Key) {
|
||||
local Arr = [];
|
||||
for (local i = 0; i< BlobObj.len(); i++) {
|
||||
local currentKeyChar = Key[i % Key.len()];
|
||||
Arr.push(BlobObj[i] ^ currentKeyChar);
|
||||
}
|
||||
return Arr;
|
||||
}
|
||||
|
||||
function base64_encode(input) {
|
||||
local base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
local inputLength = input.len();
|
||||
local i = 0;
|
||||
local j = 0;
|
||||
local charArray3 = array(3);
|
||||
local charArray4 = array(4);
|
||||
local encoded = "";
|
||||
|
||||
while (inputLength--) {
|
||||
charArray3[i++] = input[inputLength];
|
||||
if (i == 3) {
|
||||
charArray4[0] = (charArray3[0] & 0xfc) >> 2;
|
||||
charArray4[1] = ((charArray3[0] & 0x03) << 4) + ((charArray3[1] & 0xf0) >> 4);
|
||||
charArray4[2] = ((charArray3[1] & 0x0f) << 2) + ((charArray3[2] & 0xc0) >> 6);
|
||||
charArray4[3] = charArray3[2] & 0x3f;
|
||||
|
||||
for (i = 0; i< 4; i++) {
|
||||
encoded += base64_chars.slice(charArray4[i], charArray4[i] + 1);
|
||||
}
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i) {
|
||||
for (j = i; j< 3; j++) {
|
||||
charArray3[j] = 0;
|
||||
}
|
||||
|
||||
charArray4[0] = (charArray3[0] & 0xfc) >> 2;
|
||||
charArray4[1] = ((charArray3[0] & 0x03) << 4) + ((charArray3[1] & 0xf0) >> 4);
|
||||
charArray4[2] = ((charArray3[1] & 0x0f) << 2) + ((charArray3[2] & 0xc0) >> 6);
|
||||
charArray4[3] = charArray3[2] & 0x3f;
|
||||
|
||||
for (j = 0; j< i + 1; j++) {
|
||||
encoded += base64_chars.slice(charArray4[j], charArray4[j] + 1);
|
||||
}
|
||||
|
||||
while (i++<3) {
|
||||
encoded += "=";
|
||||
}
|
||||
}
|
||||
return encoded;
|
||||
}
|
||||
|
||||
function AsciiToStr(code) {
|
||||
local str = Memory.alloc(1);
|
||||
str.writeS8(code);
|
||||
return str.readUtf8String();
|
||||
}
|
||||
|
||||
function base64_decode(input) {
|
||||
local base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
local base64_map = {};
|
||||
for (local i = 0; i< base64_chars.len(); i++) {
|
||||
local key = base64_chars.slice(i, i + 1);
|
||||
if (key != "=") {
|
||||
base64_map[key] <- i;
|
||||
}
|
||||
}
|
||||
local inputLength = input.len();
|
||||
local i = 0;
|
||||
local j = 0;
|
||||
local charArray4 = array(4);
|
||||
local charArray3 = array(3);
|
||||
local decoded = [];
|
||||
|
||||
while (inputLength--) {
|
||||
if (input.slice(i, i + 1) == "=") {
|
||||
charArray4[j++] = 0;
|
||||
} else {
|
||||
charArray4[j++] = base64_map[input.slice(i, i + 1)];
|
||||
}
|
||||
i++;
|
||||
if (j == 4) {
|
||||
charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4);
|
||||
charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2);
|
||||
charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];
|
||||
|
||||
for (j = 0; j< 3; j++) {
|
||||
decoded.push(charArray3[j]);
|
||||
}
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (j) {
|
||||
for (local k = j; k< 4; k++) {
|
||||
charArray4[k] = 0;
|
||||
}
|
||||
|
||||
charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4);
|
||||
charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2);
|
||||
charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];
|
||||
|
||||
for (local k = 0; k< j - 1; k++) {
|
||||
decoded.push(charArray3[k]);
|
||||
}
|
||||
}
|
||||
local ret = decoded.reverse();
|
||||
ret.remove(0);
|
||||
ret.push(0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
function GetMyIp() {
|
||||
local Hb = Http("tnedi.me");
|
||||
return Hb.Get("/");
|
||||
}
|
||||
|
||||
function generateRandomString(length) {
|
||||
local alphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||
local result = "";
|
||||
for (local i = 0; i< length; i++) {
|
||||
local randomIndex = math.random(0, alphabet.len() - 1);
|
||||
result += alphabet.get(randomIndex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function Blend(str1, str2) {
|
||||
local alphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||
local result = "";
|
||||
local len = MathClass.getMin(str1.len(), str2.len());
|
||||
for (local i = 0; i< len; i++) {
|
||||
print((str1[i].tointeger() % alphabet.len()) - 1);
|
||||
result += alphabet.slice((str1[i].tointeger() % alphabet.len()), (str1[i].tointeger() % alphabet.len()) + 1) + str2[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function Encode(Str, Key = [9, 4, 7, 3, 3, 0, 6, 7, 0]) {
|
||||
local StrPointer = Memory.allocUtf8String(Str);
|
||||
local BlobObj = StrPointer.readBinary(Str.len());
|
||||
local str = "";
|
||||
for (local i = 0; i< BlobObj.len(); i++) {
|
||||
str += BlobObj[i].tostring();
|
||||
str += ","
|
||||
}
|
||||
print(str)
|
||||
// printT(BlobObj);
|
||||
local Arr = xorEncryptDecrypt(BlobObj, Key);
|
||||
local encodestr = base64_encode(Arr);
|
||||
return encodestr;
|
||||
}
|
||||
|
||||
function Decode(Str, Key = [9, 4, 7, 3, 3, 0, 6, 7, 0]) {
|
||||
local StrArr = base64_decode(Str);
|
||||
local Arr = xorEncryptDecrypt(StrArr, Key);
|
||||
local str = "";
|
||||
for (local i = 0; i< Arr.len(); i++) {
|
||||
str += Arr[i].tostring();
|
||||
str += ","
|
||||
}
|
||||
print(str)
|
||||
local StrPointer = Memory.alloc(Arr.len());
|
||||
StrPointer.writeByteArray(Arr);
|
||||
local decodestr = StrPointer.readUtf8String(Arr.len());
|
||||
return decodestr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class HttpResponse {
|
||||
C_Object = null;
|
||||
constructor(obj) {
|
||||
C_Object = obj;
|
||||
}
|
||||
|
||||
function Write(Msg) {
|
||||
local response = "HTTP/1.1 200 OK\r\n";
|
||||
if (typeof Msg == "table") {
|
||||
response += "Content-Type: application/json\r\n";
|
||||
local JsonString = Json.Encode(Msg);
|
||||
response += "Content-Length: " + JsonString.len() + "\r\n";
|
||||
response += "\r\n";
|
||||
response += JsonString;
|
||||
} else if (typeof Msg == "string") {
|
||||
response += "Content-Type: text/plain\r\n";
|
||||
response += "Content-Length: " + Msg.len() + "\r\n";
|
||||
response += "\r\n";
|
||||
response += Msg;
|
||||
}
|
||||
|
||||
Sq_HttpServerResponse_Write(C_Object, response);
|
||||
}
|
||||
}
|
||||
|
||||
class HttpServer {
|
||||
|
||||
Host = null;
|
||||
Service = null;
|
||||
|
||||
//处理函数
|
||||
Handler = null;
|
||||
|
||||
|
||||
constructor(host, service = "80") {
|
||||
Host = host;
|
||||
Service = service;
|
||||
|
||||
getroottable()["HttpServer_" + Host + "_" + Service] <- this;
|
||||
}
|
||||
|
||||
function Listen(Func) {
|
||||
//记录处理函数
|
||||
Handler = Func;
|
||||
|
||||
local success = Sq_CreateHttpServer(Host, Service, this);
|
||||
if (success) {
|
||||
::print("Server started successfully.");
|
||||
} else {
|
||||
::print("Failed to start server.");
|
||||
}
|
||||
}
|
||||
|
||||
function Event(SocketObject, Msg) {
|
||||
Timer.SetTimeOut(Handler, 1, HttpResponse(SocketObject), Msg);
|
||||
}
|
||||
}
|
||||
@@ -16,16 +16,13 @@ class IO extends Base_C_Object {
|
||||
_Fseek_Address = Module.getExportByName(null, "fseek");
|
||||
_Ftell_Address = Module.getExportByName(null, "ftell");
|
||||
_Rewind_Address = Module.getExportByName(null, "rewind");
|
||||
|
||||
|
||||
|
||||
Pos = 0;
|
||||
_Flush_Address = Module.getExportByName(null, "fflush");
|
||||
|
||||
constructor(FileName, Modes) {
|
||||
local FileObj = Sq_CallFunc(_Fopen_Address, "pointer", ["pointer", "pointer"], Str_Ptr(FileName), Str_Ptr(Modes));
|
||||
if (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);
|
||||
}
|
||||
|
||||
function Flush() {
|
||||
Sq_CallFunc(_Flush_Address, "pointer", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
//关闭文件
|
||||
function Close() {
|
||||
|
||||
@@ -33,8 +33,33 @@ class Inven extends Base_C_Object {
|
||||
return Sq_Inven_GetItemById(this.C_Object, Idx);
|
||||
}
|
||||
|
||||
//获取金币
|
||||
function GetMoney() {
|
||||
return Sq_CallFunc(S_Ptr("0x817a188"), "int", ["pointer"], SUser.C_Object);
|
||||
}
|
||||
|
||||
//检查背包是否拥有指定数量的指定道具
|
||||
function CheckItemCount(ItemId, ItemCount) {
|
||||
if (ItemId == 0) {
|
||||
//检查金币
|
||||
local Money = Sq_CallFunc(S_Ptr("0x817a188"), "int", ["pointer"], SUser.C_Object);
|
||||
if (Money >= ItemCount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ItemId == -1) {
|
||||
//检查点券
|
||||
if (SUser.GetCera() >= ItemCount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ItemId == -2) {
|
||||
//检查代币券
|
||||
if (SUser.GetCeraPoint() >= ItemCount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
local SlotIdx = GetSlotById(ItemId);
|
||||
if (SlotIdx != -1) {
|
||||
local SlotItem = GetSlot(1, SlotIdx);
|
||||
@@ -56,6 +81,8 @@ class Inven extends Base_C_Object {
|
||||
return Flag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//销毁背包中指定表的道具及数量
|
||||
function DeleteArrItemCount(T) {
|
||||
foreach(value in T) {
|
||||
@@ -67,9 +94,98 @@ class Inven extends Base_C_Object {
|
||||
|
||||
//销毁背包中指定的道具及数量
|
||||
function DeleteItemCount(Id, Count) {
|
||||
if (Id == 0) {
|
||||
//处理金币
|
||||
SUser.RechargeMoney(-Count);
|
||||
return 1;
|
||||
}
|
||||
if (Id == -1) {
|
||||
//处理点券
|
||||
SUser.RechargeCera(-Count);
|
||||
return 1;
|
||||
}
|
||||
if (Id == -2) {
|
||||
//处理代币券
|
||||
SUser.RechargeCeraPoint(-Count);
|
||||
return 1;
|
||||
}
|
||||
|
||||
local Slot = GetSlotById(Id);
|
||||
local Ret = Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, Count, 10, 1);
|
||||
SUser.SendUpdateItemList(1, 0, Slot);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
//获取时装管理器
|
||||
function GetAvatarItemMgr() {
|
||||
return Sq_CallFunc(S_Ptr("0x80DD576"), "pointer", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
|
||||
//销毁背包中指定表的道具及数量 并且需要格子匹配
|
||||
function DeleteArrItemCountRindro(T) {
|
||||
foreach(value in T) {
|
||||
if (value.type == 0) {
|
||||
//如果是装备 按格子直接删除
|
||||
Sq_Inven_RemoveItemFormCount(this.C_Object, 1, value.pos, value.count, 10, 1);
|
||||
SUser.SendUpdateItemList(1, 0, value.pos);
|
||||
} else {
|
||||
//如果不是装备 走原逻辑
|
||||
local Slot = GetSlotById(value.itemId);
|
||||
Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, value.count, 10, 1);
|
||||
SUser.SendUpdateItemList(1, 0, Slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//检查背包是否拥有指定表的道具及数量 并且是装备还要匹配格子
|
||||
function CheckArrItemCountRindro(T) {
|
||||
local Flag = true;
|
||||
foreach(value in T) {
|
||||
if (!CheckItemCountRindro(value.itemId, value.count, value.pos)) Flag = false;
|
||||
}
|
||||
return Flag;
|
||||
}
|
||||
|
||||
//检查背包是否拥有指定数量的指定道具
|
||||
function CheckItemCountRindro(ItemId, ItemCount, Slot) {
|
||||
if (ItemId == 0) {
|
||||
//检查金币
|
||||
local Money = Sq_CallFunc(S_Ptr("0x817a188"), "int", ["pointer"], SUser.C_Object);
|
||||
if (Money >= ItemCount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ItemId == -1) {
|
||||
//检查点券
|
||||
if (SUser.GetCera() >= ItemCount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ItemId == -2) {
|
||||
//检查代币券
|
||||
if (SUser.GetCeraPoint() >= ItemCount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
local SlotIdx = GetSlotById(ItemId);
|
||||
if (SlotIdx != -1) {
|
||||
local SlotItem = GetSlot(1, SlotIdx);
|
||||
if (SlotItem) {
|
||||
if (SlotItem.GetType() != "装备") {
|
||||
if (SlotItem.GetAdd_Info() >= ItemCount) return true;
|
||||
} else {
|
||||
//如果是装备 检查格子所在的道具id
|
||||
local ItemId2 = GetSlot(1, Slot).GetIndex();
|
||||
//如果这个格子的道具id就是发来的id 那么返回true
|
||||
if (ItemId == ItemId2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,10 @@ class Item extends Base_C_Object {
|
||||
Attribute.seek(2);
|
||||
return Attribute.readn('i');
|
||||
}
|
||||
//获取品级
|
||||
function GetRarity() {
|
||||
return Sq_CallFunc(S_Ptr("0x80F12D6"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
//设置编号
|
||||
function SetIndex(Index) {
|
||||
Attribute.seek(2);
|
||||
@@ -120,11 +124,22 @@ class Item extends Base_C_Object {
|
||||
Attribute.writen(Value, 'i');
|
||||
}
|
||||
|
||||
|
||||
//获取交易类型
|
||||
function GetAttachType() {
|
||||
return Sq_CallFunc(S_Ptr("0x80F12E2"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
//刷写装备数据
|
||||
function Flush() {
|
||||
Sq_WriteBlobToAddress(C_Object, Attribute);
|
||||
}
|
||||
|
||||
//检查是否为空
|
||||
// function IsEmpty() {
|
||||
// return Sq_CallFunc(S_Ptr("0x811ED66"), "int", ["pointer"], this.C_Object);
|
||||
// }
|
||||
|
||||
//删除道具
|
||||
function Delete() {
|
||||
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);
|
||||
}
|
||||
90
Dps_A/BaseClass/LogClass/LogClass.nut
Normal file
90
Dps_A/BaseClass/LogClass/LogClass.nut
Normal file
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,15 +11,35 @@ class Memory {
|
||||
}
|
||||
|
||||
function allocUtf8String(Str) {
|
||||
return NativePointer(Str_Ptr(Str));
|
||||
local P = NativePointer(Str_Ptr(Str));
|
||||
P.Size = Str.len();
|
||||
return P;
|
||||
}
|
||||
|
||||
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 {
|
||||
//大小
|
||||
Size = -1;
|
||||
|
||||
function _tyoeof()
|
||||
{
|
||||
return "Sq_Pointer";
|
||||
}
|
||||
|
||||
constructor(T) {
|
||||
if (typeof T == "integer") {
|
||||
base.constructor(Sq_New_Point(T));
|
||||
Size = T;
|
||||
//注册销毁伪析构
|
||||
Register_Destruction(C_Object, this);
|
||||
} else if (typeof T == "userdata") {
|
||||
@@ -29,14 +49,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) {
|
||||
this.C_Object = Sq_PointerOperation(this.C_Object, intoffset, "+");
|
||||
return this;
|
||||
return NativePointer(Sq_PointerOperation(this.C_Object, intoffset, "+"));
|
||||
}
|
||||
|
||||
function sub(intoffset) {
|
||||
this.C_Object = Sq_PointerOperation(this.C_Object, intoffset, "-");
|
||||
return this;
|
||||
return NativePointer(Sq_PointerOperation(this.C_Object, intoffset, "-"));
|
||||
}
|
||||
|
||||
function writeByteArray(arr) {
|
||||
@@ -177,6 +206,10 @@ class NativePointer extends Base_C_Object {
|
||||
return Sq_ReadPoint(this.C_Object);
|
||||
}
|
||||
|
||||
function readBinary(Size) {
|
||||
return Sq_Point2Blob(this.C_Object, Size);
|
||||
}
|
||||
|
||||
function tostring() {
|
||||
return this.C_Object.tostring();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class Mysql extends Base_C_Object {
|
||||
}
|
||||
|
||||
function Fetch() {
|
||||
Sq_CallFunc(S_Ptr("0x83F44BC"), "int", ["pointer"], this.C_Object);
|
||||
return Sq_CallFunc(S_Ptr("0x83F44BC"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
function Close() {
|
||||
@@ -73,11 +73,11 @@ class Mysql extends Base_C_Object {
|
||||
//转为blob
|
||||
local blob = Sq_Point2Blob(intSizePoint, 4);
|
||||
//读取8位有符号整数
|
||||
local result = blob.readn('c');
|
||||
local result = blob.readn('i');
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
return result;
|
||||
}
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
// Sq_Delete_Point(intSizePoint);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -131,16 +131,12 @@ class Mysql extends Base_C_Object {
|
||||
//MySQL_get_binary_length
|
||||
local binary_length = Sq_CallFunc(S_Ptr("0x81253DE"), "int", ["pointer", "int"], this.C_Object, columnIndex);
|
||||
if (binary_length > 0) {
|
||||
local binary_length_point = Sq_New_Point(binary_length);
|
||||
local binary_length_point = Memory.alloc(binary_length);
|
||||
//MySQL_get_binary
|
||||
if (1 == Sq_CallFunc(S_Ptr("0x812531A"), "int", ["pointer", "int", "pointer", "int"], this.C_Object, columnIndex, binary_length_point, binary_length)) {
|
||||
//转为blob
|
||||
local blob = Sq_Point2Blob(binary_length_point, binary_length);
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
return blob;
|
||||
if (1 == Sq_CallFunc(S_Ptr("0x812531A"), "int", ["pointer", "int", "pointer", "int"], this.C_Object, columnIndex, binary_length_point.C_Object, binary_length)) {
|
||||
return binary_length_point;
|
||||
}
|
||||
}
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -161,19 +157,18 @@ class Mysql extends Base_C_Object {
|
||||
Fetch();
|
||||
local row = [];
|
||||
for (local j = 0; j< column_type_list.len(); j++) {
|
||||
if (column_type_list[j] == "int") {
|
||||
//判断是否为空值
|
||||
if (!Sq_CallFunc(S_Ptr("0x85F41B2"), "bool", ["pointer", "int"], this.C_Object, j)) {
|
||||
row.push(null);
|
||||
} else if (column_type_list[j] == "int") {
|
||||
row.push(ReadIntColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "string") {
|
||||
} else if (column_type_list[j] == "string") {
|
||||
row.push(ReadStringColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "uint") {
|
||||
} else if (column_type_list[j] == "uint") {
|
||||
row.push(ReadUIntColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "float") {
|
||||
} else if (column_type_list[j] == "float") {
|
||||
row.push(ReadFloatColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "binary") {
|
||||
} else if (column_type_list[j] == "binary") {
|
||||
row.push(ReadBinaryColumn(j));
|
||||
}
|
||||
}
|
||||
@@ -225,6 +220,9 @@ class MysqlPool {
|
||||
//连接池
|
||||
PoolList = null;
|
||||
|
||||
//是否已经初始化
|
||||
IsInit = false;
|
||||
|
||||
constructor() {
|
||||
PoolList = [];
|
||||
getroottable()._MysqlPoolObject <- this;
|
||||
@@ -247,12 +245,14 @@ class MysqlPool {
|
||||
|
||||
//初始化连接池
|
||||
function Init() {
|
||||
if(IsInit)return;
|
||||
for (local i = 0; i< PoolSize; i++) {
|
||||
local Buffer = Mysql(db_ip, db_port, db_name, db_username, db_password);
|
||||
Buffer.Exec_Sql(format("SET NAMES %s", Charset));
|
||||
PoolList.append(Buffer);
|
||||
// print("创建了一条连接,编号: " + i + ",地址: " + Buffer + ", 指针地址: " + Buffer.C_Object);
|
||||
}
|
||||
IsInit = true;
|
||||
}
|
||||
|
||||
function GetConnect() {
|
||||
|
||||
66
Dps_A/BaseClass/OfficialProject/OfficialProject.nut
Normal file
66
Dps_A/BaseClass/OfficialProject/OfficialProject.nut
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
文件名:OfficialProject.nut
|
||||
路径:Dps_A/BaseClass/OfficialProject/OfficialProject.nut
|
||||
创建日期:2025-03-30 00:03
|
||||
文件用途:官方项目
|
||||
*/
|
||||
class _Official_Project_ {
|
||||
ReloadProjectMap = null;
|
||||
|
||||
constructor() {
|
||||
//在全局中注册自己
|
||||
getroottable()._GlobalOfficial_Project <- this;
|
||||
ReloadProjectMap = {};
|
||||
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
function Init() {
|
||||
// 定义 ANSI 颜色代码
|
||||
local COLOR_RESET = "\x1b[0m";
|
||||
local COLOR_MAGENTA = "\x1b[95m";
|
||||
local COLOR_CYAN = "\x1b[96m";
|
||||
local COLOR_YELLOW = "\x1b[93m";
|
||||
local COLOR_RED = "\x1b[91m";
|
||||
|
||||
|
||||
local WorkPath = "/dp_s/OfficialProject";
|
||||
local Dirs = sq_GetListDirs(WorkPath);
|
||||
if (Dirs.len() > 0) {
|
||||
print(format("\n\n\t\t\t\t%s开始加载DP-S插件市场项目%s", COLOR_YELLOW, COLOR_RESET));
|
||||
}
|
||||
foreach(DirPath in Dirs) {
|
||||
local FilePaths = sq_GetListFiles(WorkPath + "/" + DirPath);
|
||||
|
||||
foreach(FilePath in FilePaths) {
|
||||
//找到项目文件
|
||||
if (FilePath == "Proj.ifo") {
|
||||
local Config = sq_ReadJsonFile(WorkPath + "/" + DirPath + "/" + FilePath);
|
||||
if (Config) {
|
||||
try {
|
||||
//读取配置文件建立Map
|
||||
local ProjectConfig = Config.ProjectConfig;
|
||||
if(ProjectConfig.len() > 0){
|
||||
ReloadProjectMap.rawset(ProjectConfig,Config.ProjectRunFunc);
|
||||
}
|
||||
|
||||
local ProjectFiles = Config.ProjectFiles;
|
||||
//载入所有项目文件
|
||||
foreach(ProjectFile in ProjectFiles) {
|
||||
sq_RunScript("OfficialProject/" + DirPath + "/" + ProjectFile);
|
||||
}
|
||||
//调用启动函数
|
||||
getroottable()[Config.ProjectRunFunc]();
|
||||
//播报脚本已加载
|
||||
print(format("%s[ %s ]%s" + " 脚本项目已加载 --- 当前版本: %s%.2f%s", COLOR_YELLOW, Config.ProjectName, COLOR_RESET, COLOR_YELLOW, Config.ProjectVersion, COLOR_RESET));
|
||||
} catch (exception) {
|
||||
//播报脚本未加载
|
||||
print(format("%s[ %s ]%s" + " 脚本项目未加载 --- 当前版本: %s%.2f%s", COLOR_RED, Config.ProjectName, COLOR_RESET, COLOR_RED, Config.ProjectVersion, COLOR_RESET));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,53 @@ class Packet extends Base_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 GetString(a3,a4) {
|
||||
local data = Memory.alloc(a3);
|
||||
if (Sq_CallFunc(S_Ptr("0x858D2BC"), "int", ["pointer", "pointer","int","int","int"], this.C_Object, data.C_Object,a3,a4)) {
|
||||
return data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function Delete() {
|
||||
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], this.C_Object);
|
||||
Sq_Delete_Point(this.C_Object);
|
||||
// Sq_Packet_Delete(this.C_Object);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,6 +44,7 @@ class PvfItem extends Base_C_Object {
|
||||
return Sq_GetNameByIdFromPvf(GetIndex());
|
||||
}
|
||||
|
||||
|
||||
//Public
|
||||
function GetNameById(Id) {
|
||||
return Sq_GetNameByIdFromPvf(Id);
|
||||
@@ -70,4 +71,9 @@ function PvfItem::GetUsableLevel() {
|
||||
//是否为消耗品
|
||||
function PvfItem::IsStackable() {
|
||||
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);
|
||||
}
|
||||
@@ -13,6 +13,8 @@ class RBTreeNode {
|
||||
parent = null;
|
||||
color = null;
|
||||
Info = null;
|
||||
|
||||
name = null;
|
||||
constructor(key, func_info) {
|
||||
this.key = key;
|
||||
this.time = key;
|
||||
@@ -43,7 +45,7 @@ class RedBlackTree {
|
||||
this.root = this.nil;
|
||||
}
|
||||
|
||||
function insert(key, func_info) {
|
||||
function insert(key, func_info, gname = null) {
|
||||
local z = RBTreeNode(key, func_info);
|
||||
local y = this.nil;
|
||||
local x = this.root;
|
||||
@@ -66,6 +68,7 @@ class RedBlackTree {
|
||||
z.left = this.nil;
|
||||
z.right = this.nil;
|
||||
z.color = "red";
|
||||
if (gname) z.name = gname;
|
||||
this.insertFixup(z);
|
||||
this.size++;
|
||||
}
|
||||
@@ -277,4 +280,35 @@ class RedBlackTree {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function GetPop() {
|
||||
if (this.size <= 0) return null;
|
||||
local z = this.minimum();
|
||||
if (z != this.nil) {
|
||||
return z;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function findNodeByName(node,name) {
|
||||
if (node == this.nil) {
|
||||
return null;
|
||||
}
|
||||
if (node.name == name) {
|
||||
return node;
|
||||
}
|
||||
local leftResult = findNodeByName(node.left, name);
|
||||
if (leftResult) {
|
||||
return leftResult;
|
||||
}
|
||||
return findNodeByName(node.right, name);
|
||||
}
|
||||
|
||||
// 新增方法:根据 name 移除节点
|
||||
function removeNodeByName(name) {
|
||||
local targetNode = this.findNodeByName(this.root,name);
|
||||
if (targetNode) {
|
||||
this.deleteNode(targetNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
217
Dps_A/BaseClass/ScriptManager/ScriptManager.nut
Normal file
217
Dps_A/BaseClass/ScriptManager/ScriptManager.nut
Normal file
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
文件名:ScriptManager.nut
|
||||
路径:Core/BaseClass/ScriptManager/ScriptManager.nut
|
||||
创建日期:2024-10-11 12:24
|
||||
文件用途:pvf 管理器
|
||||
*/
|
||||
class Script {
|
||||
|
||||
C_Object = null;
|
||||
|
||||
constructor(Path = "/home/neople/game/Script.pvf") {
|
||||
if(getroottable().rawin("_Script_Data_"))return;
|
||||
print("正在初始化PVF...");
|
||||
local StartTime = time();
|
||||
|
||||
C_Object = Asset_LoadScript(Path);
|
||||
|
||||
print("PVF初始化完毕!!!");
|
||||
print("用时: " + (time() - StartTime) + "秒");
|
||||
getroottable()._Script_Data_ <- this;
|
||||
}
|
||||
|
||||
|
||||
function GetFileInfo(Path) {
|
||||
local size = Asset_GetPvfFileSize(C_Object, Path);
|
||||
if (size) {
|
||||
local blobobj = blobex(size);
|
||||
Asset_GetPvfFile(C_Object, Path, blobobj);
|
||||
return blobobj;
|
||||
} else return null;
|
||||
}
|
||||
|
||||
function GetBinString(Key) {
|
||||
return Asset_GetPvfBinString(C_Object, Key);
|
||||
}
|
||||
|
||||
function GetLoadString(Type, Key) {
|
||||
return Asset_GetPvfLoadString(C_Object, Type, Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class _PVF_Data_ {
|
||||
//数据
|
||||
Data = null;
|
||||
//位置
|
||||
Pos = 0;
|
||||
//最大值
|
||||
Max = 0;
|
||||
|
||||
function _typeof() {
|
||||
return "pvf_data";
|
||||
}
|
||||
|
||||
constructor(gData) {
|
||||
Data = gData;
|
||||
Max = gData.len();
|
||||
}
|
||||
|
||||
function Last() {
|
||||
if (Pos > 0) {
|
||||
Pos--;
|
||||
return Get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function Seek(i) {
|
||||
if (Pos > 0 && Pos<(Max - 1)) {
|
||||
Pos = i;
|
||||
}
|
||||
}
|
||||
|
||||
function Seekg(i) {
|
||||
Pos += i;
|
||||
}
|
||||
|
||||
function Get() {
|
||||
local Ret = Data[Pos];
|
||||
if (Pos<(Max - 1)) {
|
||||
Pos++;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
||||
function Eof() {
|
||||
if (Pos == Max - 1)
|
||||
return true;
|
||||
}
|
||||
|
||||
function Next() {
|
||||
if (Pos<(Max - 1)) {
|
||||
Pos++;
|
||||
return Get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class GlobaData {
|
||||
//动画文件Map
|
||||
Ani = null;
|
||||
|
||||
constructor() {
|
||||
Ani = {};
|
||||
}
|
||||
|
||||
//获取文件的IO
|
||||
function GetFile(Path) {
|
||||
return getroottable()._Script_Data_.GetFileInfo(Path);
|
||||
}
|
||||
|
||||
//获取文件并处理
|
||||
function GetFileData(Path, Func) {
|
||||
local IO = GetFile(Path);
|
||||
if (IO) {
|
||||
return ResolvingData(IO, Func, Path);
|
||||
} else {
|
||||
print(Path + "找不到文件!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//获取动画文件
|
||||
function GetAni(Path) {
|
||||
if (Path in Ani)
|
||||
return Ani[Path];
|
||||
else {
|
||||
local IO = GetFile(Path);
|
||||
if (IO) {
|
||||
Ani[Path] <- InitPvfAni(IO);
|
||||
Ani[Path].filepath <- Path;
|
||||
return Ani[Path];
|
||||
} else {
|
||||
print(Path + "找不到文件!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ResolvingData(IO, Func, Path) {
|
||||
local DataTable = {};
|
||||
DataTable.filepath <- Path;
|
||||
local Type = Path.slice(0, Path.find("/")).tolower();
|
||||
local DataArr = [];
|
||||
local Length = IO.len();
|
||||
if (Length >= 7) {
|
||||
local i = 2;
|
||||
while (true) {
|
||||
if (i< Length && Length - i >= 5) {
|
||||
local str = UnpackData(IO, i, Type);
|
||||
i += 5;
|
||||
DataArr.push(str);
|
||||
} else break;
|
||||
}
|
||||
Func(DataTable, _PVF_Data_(DataArr));
|
||||
return DataTable;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function UnpackData(IO, i, Type) {
|
||||
IO.seek(i); //内容指示位
|
||||
local currentByte = IO.readn('c'); //内容指示位
|
||||
local after = IO.GetInt();
|
||||
switch (currentByte) {
|
||||
case 9: {
|
||||
local NewcurrentByte = IO.readn('c'); //内容指示位
|
||||
local Newafter = IO.GetInt();
|
||||
local Buf = getroottable()._Script_Data_.GetBinString(Newafter);
|
||||
if (!Buf) {
|
||||
Buf = "";
|
||||
} else {
|
||||
Buf = getroottable()._Script_Data_.GetLoadString(Type, Buf);
|
||||
}
|
||||
return Buf;
|
||||
}
|
||||
case 10: {
|
||||
local Buf = getroottable()._Script_Data_.GetBinString(after);
|
||||
if (!Buf) {
|
||||
Buf = "";
|
||||
} else {
|
||||
Buf = getroottable()._Script_Data_.GetLoadString(Type, Buf);
|
||||
}
|
||||
return Buf;
|
||||
}
|
||||
case 2: {
|
||||
IO.seek(-4, 'c');
|
||||
local ret = IO.readn('i');
|
||||
return ret;
|
||||
}
|
||||
case 4: {
|
||||
local Bbuf = blob(4);
|
||||
Bbuf.writen(after, 'i');
|
||||
Bbuf.seek(0);
|
||||
local Buf = Bbuf.readn('f');
|
||||
return Buf.tofloat();
|
||||
}
|
||||
case 6:
|
||||
case 8:
|
||||
case 7:
|
||||
case 5: {
|
||||
local Buf = getroottable()._Script_Data_.GetBinString(after);
|
||||
if (!Buf) Buf = "";
|
||||
return Buf;
|
||||
}
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
getroottable().ScriptData <- GlobaData();
|
||||
@@ -40,6 +40,8 @@ function OnGatewaySocketConnect() {
|
||||
foreach(value in OnGatewaySocketConnectFunc) {
|
||||
value();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//网关包回调Map
|
||||
if (!getroottable().rawin("GatewaySocketPackFuncMap")) GatewaySocketPackFuncMap <- {}
|
||||
@@ -119,6 +121,7 @@ GatewaySocketPackFuncMap[20240416] <- function(Jso) {
|
||||
|
||||
//客户端包回调Map
|
||||
if (!getroottable().rawin("ClientSocketPackFuncMap")) ClientSocketPackFuncMap <- {}
|
||||
if (!getroottable().rawin("ClientSocketDP_SPackFuncMap")) ClientSocketDP_SPackFuncMap <- {}
|
||||
|
||||
|
||||
//收到来自客户端的包 只有130
|
||||
@@ -126,15 +129,27 @@ function OnClientSocketMsg(C_User, C_Pack_Str) {
|
||||
if (PacketDebugModel) print("收到客户端包: " + C_Pack_Str);
|
||||
|
||||
local Jso = Json.Decode(C_Pack_Str);
|
||||
if (Jso.op in ClientSocketPackFuncMap) {
|
||||
local SUser = User(C_User);
|
||||
ClientSocketPackFuncMap[Jso.op](SUser, Jso);
|
||||
if (Jso.op == 2147483646) {
|
||||
if (Jso.dps_id in ClientSocketDP_SPackFuncMap) {
|
||||
Jso.rawdelete("op");
|
||||
local SUser = User(C_User);
|
||||
ClientSocketDP_SPackFuncMap[Jso.dps_id](SUser, Jso);
|
||||
}
|
||||
} else {
|
||||
local SUser = User(C_User);
|
||||
if (SUser) {
|
||||
Jso.uid <- SUser.GetUID();
|
||||
Jso.cid <- SUser.GetCID();
|
||||
Socket.SendGateway(Jso);
|
||||
if (Jso.op in ClientSocketPackFuncMap) {
|
||||
local SUser = User(C_User);
|
||||
ClientSocketPackFuncMap[Jso.op](SUser, Jso);
|
||||
} else {
|
||||
local SUser = User(C_User);
|
||||
if (SUser) {
|
||||
Jso.uid <- SUser.GetUID();
|
||||
Jso.cid <- SUser.GetCID();
|
||||
Socket.SendGateway(Jso);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Register_DPS_Pack(Id, Func) {
|
||||
ClientSocketDP_SPackFuncMap.rawset(Id, Func);
|
||||
}
|
||||
@@ -17,9 +17,13 @@ class Timer {
|
||||
Cb_timer_dispatch_Func.rawset("__System__Timer__Event", Update.bindenv(this));
|
||||
}
|
||||
|
||||
function ClockTime() {
|
||||
return Sq_GetTimestampString().slice(-9).tointeger();
|
||||
}
|
||||
|
||||
//检测延时任务
|
||||
function CheckTimeOut() {
|
||||
local Node = Wait_Exec_Tree.pop();
|
||||
local Node = Wait_Exec_Tree.GetPop();
|
||||
if (!Node) {
|
||||
return;
|
||||
}
|
||||
@@ -27,11 +31,13 @@ class Timer {
|
||||
local Info = Node.Info;
|
||||
//执行时间
|
||||
local exec_time = Node.time;
|
||||
//如果没到执行时间,放回去,等待下次扫描
|
||||
if (clock() <= exec_time) {
|
||||
Wait_Exec_Tree.insert(exec_time, Node.Info);
|
||||
//如果没到执行时间,就不管
|
||||
if (ClockTime() <= exec_time) {
|
||||
return;
|
||||
}
|
||||
//该执行了从树中删除这个元素
|
||||
Wait_Exec_Tree.pop();
|
||||
|
||||
//函数
|
||||
local func = Info[0];
|
||||
//参数
|
||||
@@ -47,10 +53,9 @@ class Timer {
|
||||
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 = [];
|
||||
|
||||
@@ -62,7 +67,7 @@ class Timer {
|
||||
|
||||
//检测定时任务
|
||||
function CheckCronTask() {
|
||||
local Node = Date_Exec_Tree.pop();
|
||||
local Node = Date_Exec_Tree.GetPop();
|
||||
if (!Node) {
|
||||
return;
|
||||
}
|
||||
@@ -72,38 +77,39 @@ class Timer {
|
||||
local exec_time = Node.time;
|
||||
//如果没到执行时间,放回去,等待下次扫描
|
||||
if (time() <= exec_time) {
|
||||
Date_Exec_Tree.insert(exec_time, Node.Info);
|
||||
// Date_Exec_Tree.insert(exec_time, Node.Info);
|
||||
return;
|
||||
}
|
||||
Date_Exec_Tree.pop();
|
||||
//函数
|
||||
local func = Info[0];
|
||||
//参数
|
||||
local func_args = Info[1];
|
||||
//下次任务叠加时间
|
||||
//Cron字符串
|
||||
local NextTimestep = Info[2];
|
||||
//执行函数
|
||||
func.acall(func_args);
|
||||
local Flag = func.acall(func_args);
|
||||
//继续构建下一次任务
|
||||
Date_Exec_Tree.insert(time() + NextTimestep, Info);
|
||||
if(Flag == null || Flag == true) Date_Exec_Tree.insert(Sq_Cron_Next(NextTimestep, time()), Info, Node.name);
|
||||
}
|
||||
|
||||
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();
|
||||
function SetCronTask(target_func, build_info, ...) {
|
||||
local CronString = "";
|
||||
local TaskName = null;
|
||||
//如果是字符串直接就是Cron字符串
|
||||
if (typeof build_info == "string") {
|
||||
CronString = build_info;
|
||||
}
|
||||
//如果是Table 则有名字
|
||||
else if (typeof build_info == "table") {
|
||||
CronString = build_info.Cron;
|
||||
TaskName = build_info.Name;
|
||||
}
|
||||
|
||||
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 NextTimestep = AddTimestep + NowTimestep;
|
||||
local NextTimestep = Sq_Cron_Next(CronString, NowTimestep);
|
||||
|
||||
local target_arg_list = [];
|
||||
target_arg_list.push(getroottable());
|
||||
@@ -119,11 +125,14 @@ class Timer {
|
||||
//参数列表
|
||||
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, TaskName);
|
||||
}
|
||||
|
||||
function RemoveCronTask(name) {
|
||||
_Timer_Object.Date_Exec_Tree.removeNodeByName(name);
|
||||
}
|
||||
|
||||
function Update() {
|
||||
CheckTimeOut();
|
||||
|
||||
@@ -242,6 +242,27 @@ class User extends Base_C_Object {
|
||||
Pack.Delete();
|
||||
}
|
||||
|
||||
//发送字节包
|
||||
function SendBlob(Np) {
|
||||
if(!Np || Np.Size == -1)return;
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 131);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_Int(Np.Size);
|
||||
Pack.Put_BinaryEx(Np.C_Object,Np.Size);
|
||||
Pack.Finalize(true);
|
||||
Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
|
||||
//发送自定义DPS包
|
||||
function Send_DPS_Pack(Id, Jso) {
|
||||
Jso.op <- 2147483646;
|
||||
Jso.dps_id <- Id;
|
||||
SendJso(Jso);
|
||||
}
|
||||
|
||||
|
||||
//发送消息包
|
||||
function SendNotiPacket(Type1, Type2, Type3) {
|
||||
Sq_CUser_SendNotiPacket(this.C_Object, Type1, Type2, Type3);
|
||||
@@ -532,6 +553,126 @@ class User extends Base_C_Object {
|
||||
if (Ret) return AccountCargo(Ret, this);
|
||||
else return null;
|
||||
}
|
||||
|
||||
//获取角色身上的显示时装
|
||||
function GetAva() {
|
||||
//获取背包对象
|
||||
local InvenObj = this.GetInven();
|
||||
if (!InvenObj) return;
|
||||
local re = [];
|
||||
local job = this.GetCharacJob();
|
||||
|
||||
//遍历身上的每一件装备
|
||||
for (local u = 0; u <= 10; 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
//获取公会名称
|
||||
@@ -599,4 +740,121 @@ function User::SendItemMail(UID, CID, ItemList, title, content) {
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
//道具是否被锁
|
||||
function User::CheckItemLock(Type, Slot) {
|
||||
return Sq_CallFunc(S_Ptr("0x8646942"), "int", ["pointer", "int", "int"], this.C_Object, Type, Slot);
|
||||
}
|
||||
|
||||
|
||||
//查询本日金币交易额度
|
||||
function User::GetTradeGoldDaily() {
|
||||
return Sq_CallFunc(S_Ptr("0x8696600"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
//设置本日金币交易额度
|
||||
function User::SetTradeGoldDaily(Value) {
|
||||
return Sq_CallFunc(S_Ptr("0x84EC002"), "int", ["pointer", "int"], this.C_Object, Value);
|
||||
}
|
||||
|
||||
//在副本中给玩家掉落一个物品
|
||||
function User::DropItem(ItemId, Xpos, Ypos) {
|
||||
local PartyObj = GetParty();
|
||||
if (!PartyObj) return;
|
||||
//更改掉落物的坐标
|
||||
NativePointer("0x085A7599").writeShort(Xpos);
|
||||
NativePointer("0x085A759F").writeShort(Ypos);
|
||||
//申请一块内存用于存放包地址
|
||||
local PackBuffer = Memory.alloc(8);
|
||||
PackBuffer.writeInt(947330670);
|
||||
local StrBuffer = "" + PackBuffer.C_Object;
|
||||
local AddressStr = StrBuffer.slice(StrBuffer.find("0x") + 2, -1);
|
||||
local HexCode = Haker.AsmGenerateMcd(
|
||||
"mov ebx," + AddressStr,
|
||||
"mov [ebx], eax",
|
||||
"mov ebx , 0",
|
||||
"mov eax, 0x85A775B",
|
||||
"jmp eax");
|
||||
|
||||
Haker.InsertCode("0x85A773C", HexCode);
|
||||
|
||||
//调用逻辑 包才会生成
|
||||
Sq_CallFunc(S_Ptr("0x85A73A6"), "int", ["pointer", "pointer", "int"], PartyObj.C_Object, this.C_Object, ItemId);
|
||||
|
||||
local Pack = Packet(PackBuffer.readPointer());
|
||||
Send(Pack);
|
||||
//销毁包
|
||||
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], Pack.C_Object);
|
||||
//还原逻辑
|
||||
Sq_WriteByteArr(S_Ptr("0x85A773C"), [0x89, 0x44, 0x24, 0x04, 0x8B, 0x45, 0x08]);
|
||||
NativePointer("0x085A7599").writeShort(300);
|
||||
NativePointer("0x085A759F").writeShort(240);
|
||||
}
|
||||
|
||||
//角色类 发送邮件函数 (标题, 正文, 金币, 道具列表[[3037,100],[3038,100]])
|
||||
function User::ReqDBSendMultiMail(title, text, gold, item_list) {
|
||||
Timer.SetTimeOut(function(SUser, title, text, gold, item_list) {
|
||||
local Cid = SUser.GetCID();
|
||||
// 获取分割后的道具列表
|
||||
local subLists;
|
||||
local maxSlots = 10;
|
||||
local length = item_list.len();
|
||||
if (length <= maxSlots) {
|
||||
subLists = [item_list];
|
||||
} else {
|
||||
subLists = [];
|
||||
for (local i = 0; i< length; i += maxSlots) {
|
||||
local end = i + maxSlots;
|
||||
if (end > length) {
|
||||
end = length;
|
||||
}
|
||||
subLists.append(item_list.slice(i, end));
|
||||
}
|
||||
}
|
||||
if (subLists) {
|
||||
// 为每个子列表发送邮件
|
||||
for (local i = 0; i< subLists.len(); ++i) {
|
||||
local subList = subLists[i];
|
||||
|
||||
// 添加道具附件
|
||||
local vector = Memory.alloc(100);
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x81349D6"), "pointer", ["pointer"], vector.C_Object);
|
||||
Sq_CallFunc(S_Ptr("0x817A342"), "pointer", ["pointer"], vector.C_Object);
|
||||
//将所有要发送的道具写入Vector
|
||||
for (local j = 0; j< subList.len(); ++j) {
|
||||
//道具ID 分配4字节内存
|
||||
local item_id = Memory.alloc(4);
|
||||
//道具数量 分配4字节内存
|
||||
local item_cnt = Memory.alloc(4);
|
||||
//写入道具ID和数量
|
||||
item_id.writeInt(subList[j][0]);
|
||||
item_cnt.writeInt(subList[j][1]);
|
||||
|
||||
local pair = Memory.alloc(100);
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x81B8D41"), "pointer", ["pointer", "pointer", "pointer"], pair.C_Object, item_id.C_Object, item_cnt.C_Object);
|
||||
Sq_CallFunc(S_Ptr("0x80DD606"), "pointer", ["pointer", "pointer"], vector.C_Object, pair.C_Object);
|
||||
}
|
||||
|
||||
// 邮件支持10个道具附件格子
|
||||
local addition_slots = Memory.alloc(1000);
|
||||
|
||||
for (local j = 0; j< 10; ++j) {
|
||||
Sq_CallFunc(S_Ptr("0x80CB854"), "pointer", ["pointer"], addition_slots.add(j * 61).C_Object);
|
||||
}
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x8556A14"), "int", ["pointer", "pointer", "int"], vector.C_Object, addition_slots.C_Object, 10);
|
||||
|
||||
local title_ptr = Memory.allocUtf8String(title); // 邮件标题
|
||||
local text_ptr = Memory.allocUtf8String(text); // 邮件正文
|
||||
|
||||
local text_len = text.len(); // 邮件正文长度
|
||||
|
||||
// 发邮件给角色
|
||||
Sq_CallFunc(S_Ptr("0x8556B68"), "int", ["pointer", "pointer", "int", "int", "int", "pointer", "int", "int", "int", "int"], title_ptr.C_Object, addition_slots.C_Object, subList.len(), gold, Cid, text_ptr.C_Object, text_len, 0, 99, 1);
|
||||
}
|
||||
}
|
||||
}, 1, this, title, text, gold, item_list);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@ if (!("Cb_History_Log_Func" in getroottable())) Cb_History_Log_Func <- {};
|
||||
|
||||
function Cb_History_Log(Data) {
|
||||
// print(Data[0]);
|
||||
if(Data.len() < 14) return;
|
||||
local UID = Data[1].tointeger();
|
||||
local Time = Data[3];
|
||||
local CharacName = Data[4];
|
||||
|
||||
@@ -4,6 +4,24 @@
|
||||
创建日期:2024-05-01 16:24
|
||||
文件用途:服务端核心类
|
||||
*/
|
||||
Dps_Self_Ip <- "192.168.200.110";
|
||||
function removeBackslashes(str) {
|
||||
local result = "";
|
||||
local index = 0;
|
||||
local backslashIndex = -1;
|
||||
|
||||
while (true) {
|
||||
backslashIndex = str.find("\\", index);
|
||||
if (backslashIndex == null) {
|
||||
result += str.slice(index);
|
||||
break;
|
||||
}
|
||||
result += str.slice(index, backslashIndex);
|
||||
index = backslashIndex + 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
class ServerControl {
|
||||
|
||||
function Get_User_Item_Count(SUser, ItemId) {
|
||||
@@ -26,25 +44,8 @@ class ServerControl {
|
||||
};
|
||||
}
|
||||
|
||||
function removeBackslashes(str) {
|
||||
local result = "";
|
||||
local index = 0;
|
||||
local backslashIndex = -1;
|
||||
|
||||
while (true) {
|
||||
backslashIndex = str.find("\\", index);
|
||||
if (backslashIndex == null) {
|
||||
result += str.slice(index);
|
||||
break;
|
||||
}
|
||||
result += str.slice(index, backslashIndex);
|
||||
index = backslashIndex + 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
|
||||
//分发来自网关的包
|
||||
GatewaySocketPackFuncMap.rawset(20240730, function(Jso) {
|
||||
local UserList = [];
|
||||
@@ -53,7 +54,6 @@ class ServerControl {
|
||||
if (SUser) UserList.append(SUser);
|
||||
else UserList.append(null);
|
||||
}
|
||||
|
||||
foreach(_Index, SUser in UserList) {
|
||||
if (SUser) {
|
||||
Jso.uid <- SUser.GetUID();
|
||||
@@ -92,6 +92,12 @@ class ServerControl {
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
//获得本服务器的IP
|
||||
GatewaySocketPackFuncMap.rawset(10002, function(Jso) {
|
||||
print(Jso);
|
||||
Dps_Self_Ip = Jso.myip;
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
//给查询指定uid cid列表的玩家信息
|
||||
GatewaySocketPackFuncMap.rawset(2023101902, function(Jso) {
|
||||
@@ -105,6 +111,10 @@ class ServerControl {
|
||||
local UserInfo = [];
|
||||
foreach(_Index, SUser in UserList) {
|
||||
if (SUser) {
|
||||
local growjob = SUser.GetCharacGrowType();
|
||||
if (growjob >= 16) {
|
||||
growjob = growjob - 16;
|
||||
}
|
||||
local T = {
|
||||
uid = SUser.GetUID(),
|
||||
cid = SUser.GetCID(),
|
||||
@@ -113,7 +123,7 @@ class ServerControl {
|
||||
//基础职业
|
||||
job = SUser.GetCharacJob(),
|
||||
//转职职业
|
||||
growjob = SUser.GetCharacSecondGrowType(),
|
||||
growjob = SUser.GetCharacGrowType(),
|
||||
//觉醒职业
|
||||
Secondjob = SUser.GetCharacSecondGrowType(),
|
||||
//等级
|
||||
@@ -130,6 +140,9 @@ class ServerControl {
|
||||
cerapoint = SUser.GetCeraPoint(),
|
||||
//胜点
|
||||
winpoint = SUser.GetWinPoint(),
|
||||
//时装信息
|
||||
avatar = SUser.GetAva()
|
||||
|
||||
};
|
||||
UserInfo.append(T);
|
||||
} else {
|
||||
@@ -142,6 +155,51 @@ class ServerControl {
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
|
||||
//根据名称查询玩家信息
|
||||
GatewaySocketPackFuncMap.rawset(20241124, function(Jso) {
|
||||
local SUser = World.GetUserByName(Jso.Name);
|
||||
|
||||
if (SUser) {
|
||||
local T = {
|
||||
uid = SUser.GetUID(),
|
||||
cid = SUser.GetCID(),
|
||||
//名字
|
||||
name = SUser.GetCharacName(),
|
||||
//基础职业
|
||||
job = SUser.GetCharacJob(),
|
||||
//转职职业
|
||||
growjob = SUser.GetCharacSecondGrowType(),
|
||||
//觉醒职业
|
||||
Secondjob = SUser.GetCharaecondGrowType(),
|
||||
//等级
|
||||
level = SUser.GetCharacLevel(),
|
||||
//使用了多少疲劳
|
||||
fatigue = SUser.GetFatigue(),
|
||||
//总疲劳
|
||||
maxfatigue = SUser.GetMaxFatigue(),
|
||||
//是否是GM
|
||||
isgm = SUser.IsGmMode(),
|
||||
//点券
|
||||
cera = SUser.GetCera(),
|
||||
//代币
|
||||
cerapoint = SUser.GetCeraPoint(),
|
||||
//胜点
|
||||
winpoint = SUser.GetWinPoint(),
|
||||
//时装信息
|
||||
avatar = SUser.GetAva()
|
||||
|
||||
};
|
||||
Jso.userinfo <- T;
|
||||
|
||||
} else {
|
||||
Jso.userinfo <- null;
|
||||
}
|
||||
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
//将玩家移出副本
|
||||
GatewaySocketPackFuncMap.rawset(20240420, function(Jso) {
|
||||
local UserList = [];
|
||||
@@ -178,6 +236,111 @@ class ServerControl {
|
||||
});
|
||||
|
||||
|
||||
//注册区域不可见hook
|
||||
GatewaySocketPackFuncMap.rawset(20241128, function(Jso) {
|
||||
local id = Jso.id;
|
||||
local Town = Jso.Town;
|
||||
local Area = Jso.Area;
|
||||
|
||||
Cb_Insert_User_Func[id] <- function(C_Area, C_User) {
|
||||
local SUser = User(C_User);
|
||||
if (SUser.GetLocation().Town == Town && SUser.GetLocation().Area == Area) {
|
||||
Sq_WriteAddress(C_Area, 0x68, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//设置玩家可见
|
||||
GatewaySocketPackFuncMap.rawset(20241130, function(Jso) {
|
||||
local uids = Jso.uids;
|
||||
|
||||
local RealList = [];
|
||||
foreach(uid in uids) {
|
||||
local SUser = World.GetUserByUid(uid);
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
||||
//退出可见列表
|
||||
GatewaySocketPackFuncMap.rawset(20241132, function(Jso) {
|
||||
local uids = Jso.uids;
|
||||
local uid = Jso.uid;
|
||||
local MUser = World.GetUserByUid(uid);
|
||||
|
||||
foreach(_Index, Value in uids) {
|
||||
local SUser = World.GetUserByUid(Value);
|
||||
if (!SUser || !(SUser.GetState() >= 3) || !MUser || !(MUser.GetState() >= 3)) continue;
|
||||
if (SUser.GetUID() == MUser.GetUID()) continue;
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(0, 23);
|
||||
Pack.Put_Short(MUser.GetUniqueId()); //唯一id
|
||||
Pack.Put_Byte(MUser.GetLocation().Town); //城镇
|
||||
|
||||
|
||||
Pack.Put_Byte(99); //区域
|
||||
Pack.Put_Short(MUser.GetAreaPos().X);
|
||||
|
||||
Pack.Put_Short(MUser.GetAreaPos().Y);
|
||||
Pack.Put_Byte(MUser.GetDirections()); //朝向
|
||||
Pack.Put_Byte(MUser.GetVisibleValues()); //是否可见
|
||||
Pack.Finalize(true);
|
||||
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//玩家移动回调
|
||||
GatewaySocketPackFuncMap.rawset(20241134, function(Jso) {
|
||||
|
||||
local MoveSUser = World.GetUserByUid(Jso.uid);
|
||||
if (!MoveSUser) return;
|
||||
|
||||
local uids = Jso.list;
|
||||
local RealList = [];
|
||||
foreach(uid in uids) {
|
||||
local SUser = World.GetUserByUid(uid);
|
||||
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();
|
||||
});
|
||||
|
||||
//给注册玩家使用道具回调
|
||||
GatewaySocketPackFuncMap.rawset(2023110702, function(Jso) {
|
||||
@@ -201,26 +364,48 @@ class ServerControl {
|
||||
local CID = Jso.cid;
|
||||
local SUser = World.GetUserByUidCid(UID, CID);
|
||||
local ItemId = Jso.itemid;
|
||||
local num = 0;
|
||||
if (SUser) {
|
||||
|
||||
|
||||
local InvenObj = SUser.GetInven();
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
if(ItemId == 0){
|
||||
|
||||
num = InvenObj.GetMoney();
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
||||
if (SlotIdx != -1) {
|
||||
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
|
||||
if (SlotItem) {
|
||||
local Count = 1;
|
||||
if (SlotItem.GetType() != "装备") {
|
||||
Count = SlotItem.GetAdd_Info();
|
||||
}
|
||||
Jso.Count <- Count;
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
return;
|
||||
|
||||
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
|
||||
if (SlotItem != null && SlotItem.GetIndex() == ItemId) {
|
||||
local Count = 1;
|
||||
if (SlotItem.GetType() != "装备") {
|
||||
Count = SlotItem.GetAdd_Info();
|
||||
}
|
||||
Jso.Count <- Count;
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
return;
|
||||
}
|
||||
|
||||
for (local i = 0; i< 120; i++) {
|
||||
local ItemObj = InvenObj.GetSlot(3, i);
|
||||
if (ItemObj != null && ItemObj.GetIndex() == ItemId) {
|
||||
num++;
|
||||
}
|
||||
|
||||
ItemObj = InvenObj.GetSlot(2, i);
|
||||
if (ItemObj != null && ItemObj.GetIndex() == ItemId) {
|
||||
num++;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Jso.Count <- 0;
|
||||
Jso.Count <- num;
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
@@ -348,7 +533,7 @@ class ServerControl {
|
||||
local InvenObj = SUser.GetInven();
|
||||
local FlagBuf = InvenObj.CheckArrItemCount([{
|
||||
Id = Jso.itemid,
|
||||
Count = Jso.itemcount
|
||||
Count = Jso.itemcount,
|
||||
}]);
|
||||
if (!FlagBuf) Flag = false;
|
||||
Jso.Loser <- uid;
|
||||
@@ -361,6 +546,7 @@ class ServerControl {
|
||||
local SUser = World.GetUserByUid(uid);
|
||||
local InvenObj = SUser.GetInven();
|
||||
InvenObj.DeleteItemCount(Jso.itemid, Jso.itemcount);
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
Jso.DeleteFlag <- true;
|
||||
} else {
|
||||
@@ -370,6 +556,136 @@ class ServerControl {
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
|
||||
//给指定玩家扣除装备 并且会返回是否成功的
|
||||
GatewaySocketPackFuncMap.rawset(20250318, function(Jso) {
|
||||
local UID = Jso.uid;
|
||||
local SUser = World.GetUserByUid(UID);
|
||||
if (SUser) {
|
||||
local InvenObj = SUser.GetInven();
|
||||
local slot = InvenObj.GetSlotById(Jso.itemId);
|
||||
|
||||
if (slot == -1) {
|
||||
Jso.DeleteFlag <- false;
|
||||
} else {
|
||||
local itemobj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, slot);
|
||||
itemobj.Delete();
|
||||
SUser.SendUpdateItemList(1, 0, slot);
|
||||
Jso.DeleteFlag <- true;
|
||||
|
||||
}
|
||||
} else {
|
||||
Jso.DeleteFlag <- false;
|
||||
}
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
|
||||
//给一个玩家 批量扣除道具
|
||||
GatewaySocketPackFuncMap.rawset(20241122, function(Jso) {
|
||||
local Flag = true;
|
||||
|
||||
local SUser = World.GetUserByUid(Jso.uid);
|
||||
local InvenObj = SUser.GetInven();
|
||||
|
||||
if (SUser) {
|
||||
//获取背包对象
|
||||
local FlagBuf = InvenObj.CheckArrItemCountRindro(Jso.ItemS);
|
||||
if (!FlagBuf) Flag = false;
|
||||
} else {
|
||||
Flag = false;
|
||||
}
|
||||
if (Flag) {
|
||||
InvenObj.DeleteArrItemCountRindro(Jso.ItemS);
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
|
||||
Jso.DeleteFlag <- Flag;
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
|
||||
//给一个玩家 设置角色栏上限
|
||||
GatewaySocketPackFuncMap.rawset(20250227, function(Jso) {
|
||||
local Flag = true;
|
||||
|
||||
local SUser = World.GetUserByUid(Jso.uid);
|
||||
if (SUser == null) {
|
||||
SUser = WebAddressUser;
|
||||
}
|
||||
Sq_CallFunc(S_Ptr("0x0869755C"), "int", ["pointer", "int"], SUser.C_Object, Jso.num);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
//给一个玩家 设置当天交易额
|
||||
GatewaySocketPackFuncMap.rawset(20250228, function(Jso) {
|
||||
local SUser = World.GetUserByUid(Jso.uid);
|
||||
|
||||
|
||||
SUser.SetTradeGoldDaily(Jso.num);
|
||||
print(SUser.GetTradeGoldDaily());
|
||||
});
|
||||
|
||||
//设置全服交易上限
|
||||
GatewaySocketPackFuncMap.rawset(20250229, function(Jso) {
|
||||
GameManager.FixGlodTradeDaily(Jso.num);
|
||||
});
|
||||
|
||||
|
||||
|
||||
//给一个玩家 批量扣除道具 并且如果第一个道具是装备 就返回装备的强化信息
|
||||
GatewaySocketPackFuncMap.rawset(20241210, function(Jso) {
|
||||
local Flag = true;
|
||||
|
||||
local SUser = World.GetUserByUid(Jso.uid);
|
||||
local InvenObj = SUser.GetInven();
|
||||
|
||||
local ItemObj1 = InvenObj.GetSlot(1, Jso.pos);
|
||||
|
||||
if (SUser) {
|
||||
//获取背包对象
|
||||
local FlagBuf = InvenObj.CheckArrItemCountRindro(Jso.ItemS);
|
||||
if (!FlagBuf) Flag = false;
|
||||
} else {
|
||||
Flag = false;
|
||||
}
|
||||
if (Flag) {
|
||||
if (!ItemObj1.IsEmpty && ItemObj1.GetType() == "装备") {
|
||||
local forging = ItemObj1.GetForging(); //锻造
|
||||
local upgrade = ItemObj1.GetUpgrade(); //强化
|
||||
local amplification = ItemObj1.GetAmplification(); //增幅
|
||||
local enchanting = ItemObj1.GetEnchanting(); //附魔
|
||||
Jso.up <- [forging, upgrade, amplification, enchanting];
|
||||
}
|
||||
InvenObj.DeleteArrItemCountRindro(Jso.ItemS);
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
Jso.DeleteFlag <- Flag;
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
//给指定玩家下发道具 并且如果道具是装备 就给加上强化信息
|
||||
GatewaySocketPackFuncMap.rawset(20241212, function(Jso) {
|
||||
local UID = Jso.uid;
|
||||
local CID = Jso.cid;
|
||||
local SUser = World.GetUserByUidCid(UID, CID);
|
||||
local item = SUser.GiveItem(Jso.itemId, Jso.count);
|
||||
//最后获得的道具
|
||||
local reitem = InvenObj.GetSlot(1, item[1]);
|
||||
if (reitem.GetType() == "装备") {
|
||||
reitem.SetForging(Jso.up[0]);
|
||||
reitem.SetUpgrade(Jso.up[1]);
|
||||
reitem.SetAmplification(Jso.up[2]);
|
||||
reitem.SetEnchanting(Jso.up[3]);
|
||||
reitem.Flush();
|
||||
}
|
||||
});
|
||||
|
||||
//公告包
|
||||
GatewaySocketPackFuncMap.rawset(2023082102, function(Jso) {
|
||||
World.SendNotiPacketMessage(Jso.str, Jso.type);
|
||||
@@ -380,10 +696,28 @@ class ServerControl {
|
||||
local CID = Jso.cid;
|
||||
local SUser = World.GetUserByUidCid(UID, CID);
|
||||
if (SUser) {
|
||||
SUser.SendNotiPacketMessage(Jso.str, Jso.type);
|
||||
if (Jso.type == -1) {
|
||||
SUser.SendNotiBox(Jso.str, 1);
|
||||
} else {
|
||||
SUser.SendNotiPacketMessage(Jso.str, Jso.type);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//获取玩家位置信息
|
||||
GatewaySocketPackFuncMap.rawset(20241126, function(Jso) {
|
||||
local SUser = World.GetUserByUid(Jso.uid);
|
||||
local Info = SUser.GetLocation();
|
||||
local list = [];
|
||||
list.append(Info.Town);
|
||||
list.append(Info.Area);
|
||||
list.append(Info.Pos.X);
|
||||
list.append(Info.Pos.Y);
|
||||
Jso.Location <- list;
|
||||
Jso.op = Jso.realop;
|
||||
Socket.SendGateway(Jso);
|
||||
});
|
||||
|
||||
//玩家进入副本
|
||||
Cb_History_DungeonEnter_Func["RindroGoDgn"] <- function(SUser, Data) {
|
||||
local PartyObj = SUser.GetParty();
|
||||
@@ -417,6 +751,8 @@ class ServerControl {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//给注册玩家通关副本
|
||||
GatewaySocketPackFuncMap.rawset(2023110704, function(Jso) {
|
||||
local RealOp = Jso.realop;
|
||||
@@ -478,6 +814,7 @@ class ServerControl {
|
||||
Socket.SendGateway(T);
|
||||
}
|
||||
|
||||
|
||||
//返回选择角色
|
||||
Cb_return_select_character_Func["Rindro_return_select_character"] <- function(SUser) {
|
||||
local T = {
|
||||
@@ -515,6 +852,7 @@ class ServerControl {
|
||||
}
|
||||
Socket.SendGateway(T);
|
||||
}
|
||||
|
||||
//玩家上线
|
||||
Cb_reach_game_world_Func["Rindro_player_reach_game_world"] <- function(SUser) {
|
||||
local T = {
|
||||
@@ -547,7 +885,8 @@ class ServerControl {
|
||||
return true;
|
||||
}
|
||||
|
||||
Cb_History_PCoinDown_Func["Rindro_PCoinDown"] <- function(SUser, Data) {
|
||||
Cb_UseCoin_Enter_Func["Rindro_PCoinDown"] <- function(args) {
|
||||
local SUser = User(args[1]);
|
||||
if (SUser) {
|
||||
local T = {
|
||||
op = 25001035,
|
||||
@@ -558,7 +897,6 @@ class ServerControl {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//组队HOOK包 同意加入或者同意申请
|
||||
Cb_User_Party_Agree_Func["Rindro_player_User_Party_Agree"] <- function(SUser) {
|
||||
local T = {
|
||||
@@ -688,7 +1026,58 @@ class ServerControl {
|
||||
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 = 25001041
|
||||
}
|
||||
Socket.SendGateway(Jso);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 登录游戏时点击开始游戏的回调
|
||||
Cb_User_Set_WebAddress_Leave_Func.ServerControl <- function(args) {
|
||||
local SUser = User(args[0]);
|
||||
|
||||
local Jso = {
|
||||
uid = SUser.GetUID(),
|
||||
cid = SUser.GetCID(),
|
||||
op = 25001043
|
||||
}
|
||||
Socket.SendGateway(Jso);
|
||||
WebAddressUser = SUser;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//刚登录游戏没办法从世界里找到这个角色 在这暂存下
|
||||
WebAddressUser <- null;
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_ServerControl <- ServerControl();
|
||||
@@ -49,6 +49,7 @@ class Anton {
|
||||
function base_input_hook(CUser, CmdString) {
|
||||
if (!CUser) return true;
|
||||
local SUser = User(CUser);
|
||||
|
||||
//安图恩频道
|
||||
if (Sq_Game_GetConfig().find("18") != null) {
|
||||
local Localtion = SUser.GetLocation();
|
||||
@@ -69,6 +70,28 @@ class Anton {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function base_input_hook2(args) {
|
||||
local type = args[2];
|
||||
local SUser = User(args[1]);
|
||||
local msg = args[3];
|
||||
if ((type == 8 || type == 3) && Sq_Game_GetConfig().find("18") != null) {
|
||||
local Localtion = SUser.GetLocation();
|
||||
if (Localtion.Area <= 1) {
|
||||
return true;
|
||||
} else {
|
||||
local Jso = {
|
||||
op = 20064027,
|
||||
uid = SUser.GetUID(),
|
||||
cid = SUser.GetCID(),
|
||||
msg = msg
|
||||
}
|
||||
Socket.SendGateway(Jso);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//玩家消息分发
|
||||
function PlayerNotiMsgDistribute(Jso) {
|
||||
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
||||
@@ -82,7 +105,7 @@ class Anton {
|
||||
local SUserName = SUser.GetCharacName();
|
||||
local Type = Jso.type;
|
||||
|
||||
Jso.msg = Jso.msg.slice(0, Jso.msg.len() - 11);
|
||||
Jso.msg = Jso.msg;
|
||||
if (Type == -1) {
|
||||
Jso.Name <- SUserName;
|
||||
foreach(_Index, Value in RealList) {
|
||||
@@ -211,8 +234,10 @@ class Anton {
|
||||
//注册HOOK
|
||||
Cb_Insert_User_Func.Anton <- insert_user_hook.bindenv(this); //区域添加角色
|
||||
Cb_Move_Area_Func.Anton <- move_area_hook.bindenv(this); //区域移动
|
||||
Base_InputHookFunc_Handle.Anton <- base_input_hook.bindenv(this); //玩家发送消息
|
||||
//Base_InputHookFunc_Handle.Anton <- base_input_hook.bindenv(this); //玩家发送消息
|
||||
Cb_reach_game_world_Func.Anton <- Login_Hook.bindenv(this); //上线HOOK
|
||||
Cb_Server_Chat_Log_Leave_Func.Anton <- base_input_hook2.bindenv(this); //玩家发送消息
|
||||
|
||||
|
||||
//注册收包
|
||||
GatewaySocketPackFuncMap.rawset(20064010, AntonSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
|
||||
|
||||
146
Dps_A/ProjectClass/AvatarUseJewel/AvatarUseJewel.nut
Normal file
146
Dps_A/ProjectClass/AvatarUseJewel/AvatarUseJewel.nut
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ class CombatRank {
|
||||
|
||||
//角色更换了装备事件包
|
||||
PacketId_0 = 20072102;
|
||||
PacketId_1 = 20072602;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -24,6 +25,12 @@ class CombatRank {
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
}.bindenv(this);
|
||||
Cb_player_chanage_equ_Func.CombatRankBFunc <- function(SUser) {
|
||||
local T = {
|
||||
op = PacketId_1
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
}.bindenv(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
580
Dps_A/ProjectClass/EquimentUseJewel/EquimentUseJewel.nut
Normal file
580
Dps_A/ProjectClass/EquimentUseJewel/EquimentUseJewel.nut
Normal file
@@ -0,0 +1,580 @@
|
||||
/*
|
||||
文件名: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"]);
|
||||
//把连接还池子
|
||||
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');
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function HackAddSocketToAvatarLogic(Flag) {
|
||||
if (Flag) {
|
||||
Sq_WriteByteArr(S_Ptr("821A449"), [0x90,0x90]);
|
||||
Sq_WriteByteArr(S_Ptr("0x821A44B"), array(36,0x90));
|
||||
} else {
|
||||
Sq_WriteByteArr(S_Ptr("821A449"), [0x74,0x2B]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function FixFunction() {
|
||||
//称号回包
|
||||
Cb_CTitleBook_putItemData_Leave_Func.EquimentUseJewel <- function(args) {
|
||||
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);
|
||||
|
||||
//设计图继承
|
||||
Cb_CUsercopyItemOption_Enter_Func.EquimentUseJewel <- function(args) {
|
||||
local jewelSocketID = NativePointer(args[2]).add(25).readU32();
|
||||
NativePointer(args[1]).add(25).writeU32(jewelSocketID);
|
||||
return null;
|
||||
}.bindenv(this);
|
||||
|
||||
//装备开孔
|
||||
Cb_AddSocketToAvatar_Enter_Func.EquimentUseJewel <- function(args) {
|
||||
local SUser = User(args[1]);
|
||||
local PackCopyBuffer = Memory.alloc(10001);
|
||||
Memory.copy(PackCopyBuffer, NativePointer(args[2]), 1000);
|
||||
local Pack = Packet(PackCopyBuffer.C_Object);
|
||||
local equ_slot = Pack.GetShort();
|
||||
local equitem_id = Pack.GetInt();
|
||||
local sta_slot = Pack.GetShort();
|
||||
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)) {
|
||||
CUser_SendCmdErrorPacket(SUser, 209, 19);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
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)
|
||||
CUser_SendCmdErrorPacket(SUser, 209, 0);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
return null;
|
||||
} else if (ItemType == 11) {
|
||||
SUser.SendNotiBox("装备为称号类型,不支持打孔!", 1)
|
||||
CUser_SendCmdErrorPacket(SUser, 209, 0);
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
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();
|
||||
HackAddSocketToAvatarLogic(true);
|
||||
return null;
|
||||
}.bindenv(this);
|
||||
|
||||
Cb_AddSocketToAvatar_Leave_Func.EquimentUseJewel <- function(args) {
|
||||
HackAddSocketToAvatarLogic(false);
|
||||
return null;
|
||||
}.bindenv(this);
|
||||
|
||||
//装备镶嵌和时装镶嵌
|
||||
Cb_Dispatcher_UseJewel_Enter_Func.EquimentUseJewel <- function(args) {
|
||||
local SUser = User(args[1]);
|
||||
local Pack = Packet(args[2]);
|
||||
local PackIndex = NativePointer(args[2]).add(4).readInt();
|
||||
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;
|
||||
}
|
||||
|
||||
AvatarLogic(args, PackIndex);
|
||||
|
||||
return null;
|
||||
}.bindenv(this);
|
||||
|
||||
Cb_Dispatcher_UseJewel_Leave_Func.EquimentUseJewel <- function(args) {
|
||||
return -1;
|
||||
}.bindenv(this);
|
||||
|
||||
//额外数据包,发送装备镶嵌数据给本地处理
|
||||
Cb_InterfacePacketBuf_put_packet_Leave_Func.EquimentUseJewel <- 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);
|
||||
|
||||
L_HookEquimentUseJewel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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 AvatarLogic(args, PackIndex) {
|
||||
//角色
|
||||
local SUser = User(args[1]);
|
||||
//包数据
|
||||
local Pack = Packet(args[2]);
|
||||
//还原包读取数据号位
|
||||
NativePointer(args[2]).add(4).writeInt(PackIndex);
|
||||
|
||||
//校验角色状态是否允许镶嵌
|
||||
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 = 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 = 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];
|
||||
CInventory_delete_item(InvemObj.C_Object, 1, emblem_inven_slot, 1, 8, 1);
|
||||
//设置时装插槽数据
|
||||
local emblem_item_id = emblemObject[1];
|
||||
api_set_JewelSocketData(Jewel_Socket_Data, avartar_socket_slot, emblem_item_id);
|
||||
}
|
||||
|
||||
//时装插槽数据存档
|
||||
DB_UpdateAvatarJewelSlot_makeRequest(SUser.GetCID(), 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;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
CreateMysqlTable();
|
||||
|
||||
FixFunction();
|
||||
}
|
||||
}
|
||||
328
Dps_A/ProjectClass/Exchange/Exchange.nut
Normal file
328
Dps_A/ProjectClass/Exchange/Exchange.nut
Normal file
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
文件名:Exchange.nut
|
||||
路径:Dps_A/ProjectClass/Exchange/Exchange.nut
|
||||
创建日期:2025-07-21 19:05
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
class Exchange {
|
||||
|
||||
MysqlObject = null;
|
||||
Commission = 0;
|
||||
|
||||
constructor() {
|
||||
|
||||
MysqlObject = Mysql(Str_Ptr("127.0.0.1"), 3306, Str_Ptr("taiwan_cain"), Str_Ptr("game"), Str_Ptr("uu5!^%jg"));
|
||||
MysqlObject.Exec_Sql(format("SET NAMES %s", "latin1"));
|
||||
|
||||
SelectSql("CREATE TABLE `zyk`.`exchange` ( `uuid` int NOT NULL AUTO_INCREMENT, `type` int NULL, `itemid` int NULL, `itemcount` int NULL, `itemdata` varchar(512) NULL, `price` int NULL, `uid` int NULL , `cid` int NULL , `name` varchar(128) NULL, PRIMARY KEY (`uuid`));", []);
|
||||
|
||||
|
||||
|
||||
local Ct = ScriptData.GetFileData("etc/rindro/exchange/exchange.etc", function(DataTable, Data) {
|
||||
DataTable.Attribute <- {};
|
||||
while (!Data.Eof()) {
|
||||
local Str = Data.Get();
|
||||
if (Str == "[commission]") {
|
||||
Commission = Data.Get().tofloat() * 0.01;
|
||||
}
|
||||
}
|
||||
}.bindenv(this));
|
||||
|
||||
//上架商品
|
||||
ClientSocketPackFuncMap.rawset(21001001, function(SUser, Jso) {
|
||||
//获取玩家背包
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (!InvenObj) {
|
||||
return;
|
||||
}
|
||||
|
||||
//获取道具
|
||||
local ItemObj = InvenObj.GetSlot(1, Jso.pos + 9 + (Jso.type * 48));
|
||||
if (!ItemObj) return;
|
||||
|
||||
//获取道具类型
|
||||
ItemObj.Attribute.seek(1);
|
||||
local ItemType = ItemObj.Attribute.readn('c');
|
||||
//副职业材料是10 这里给转成5
|
||||
if (ItemType == 10) ItemType = 5;
|
||||
|
||||
//获取道具Id
|
||||
local ItemId = ItemObj.GetIndex();
|
||||
//获取数量
|
||||
local ItemCount = ItemObj.GetAdd_Info();
|
||||
//如果是装备 数量恒定为1
|
||||
if (ItemType == 1) ItemCount = 1;
|
||||
|
||||
//获取道具数据
|
||||
local ItemData = "0x00";
|
||||
|
||||
//获取价格
|
||||
local Price = Jso.value;
|
||||
//获取上架者cid
|
||||
local Uid = SUser.GetUID();
|
||||
local Cid = SUser.GetCID();
|
||||
local Name = SUser.GetCharacName();
|
||||
|
||||
local InfoTable = {
|
||||
ItemType = ItemType,
|
||||
ItemId = ItemId,
|
||||
ItemCount = ItemCount,
|
||||
ItemData = ItemData,
|
||||
Price = Price,
|
||||
Uid = Uid,
|
||||
Cid = Cid,
|
||||
Name = Name
|
||||
}
|
||||
|
||||
if (ItemType == 1) {
|
||||
EquipLogic(SUser, Jso.pos + 9, InfoTable, ItemObj);
|
||||
return;
|
||||
}
|
||||
|
||||
//插入数据库
|
||||
local Sql = format("INSERT INTO `zyk`.`exchange` (`type`, `itemid`, `itemcount`, `itemdata`, `price`, `uid` ,`cid`,`name`) VALUES (%d, %d, %d, \'%s\', %d, %d, %d, \'%s\');", InfoTable.ItemType, InfoTable.ItemId, InfoTable.ItemCount, InfoTable.ItemData, InfoTable.Price, InfoTable.Uid, InfoTable.Cid, InfoTable.Name);
|
||||
local Ret = SelectSql(Sql, []);
|
||||
|
||||
//删除道具
|
||||
ItemObj.Delete();
|
||||
//发送刷新背包消息
|
||||
SUser.SendUpdateItemList(1, 1, Jso.pos + 9 + (Jso.type * 48));
|
||||
SUser.SendItemSpace(0);
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
//查询上架商品
|
||||
ClientSocketPackFuncMap.rawset(21001003, function(SUser, Jso) {
|
||||
local Offset = Jso.offset;
|
||||
local Sql = format("SELECT * FROM `zyk`.`exchange` WHERE `type` = %d LIMIT 7 OFFSET %d;", Jso.type, Offset);
|
||||
local Ret = SelectSql(Sql, ["int", "int", "int", "int", "binary", "int", "int", "int", "string"]);
|
||||
|
||||
local CountSql = format("SELECT COUNT(*) AS total FROM `zyk`.`exchange` WHERE `type` = %d;", Jso.type);
|
||||
local CountRet = SelectSql(CountSql, ["int"]);
|
||||
|
||||
local TotalCount = 0;
|
||||
if (CountRet.len() > 0) TotalCount = CountRet[0][0];
|
||||
|
||||
local Pack = {};
|
||||
Pack.op <- 21001004;
|
||||
Pack.info <- [];
|
||||
Pack.total <- TotalCount;
|
||||
foreach(info in Ret) {
|
||||
local T = {
|
||||
uid = info[0],
|
||||
itemId = info[2],
|
||||
count = info[3],
|
||||
price = info[5],
|
||||
name = info[8]
|
||||
}
|
||||
Pack.info.push(T);
|
||||
}
|
||||
SUser.SendJso(Pack);
|
||||
|
||||
}.bindenv(this));
|
||||
|
||||
//购买商品
|
||||
ClientSocketPackFuncMap.rawset(21001005, function(SUser, Jso) {
|
||||
local uuid = Jso.uuid;
|
||||
|
||||
local Sql = format("SELECT * FROM `zyk`.`exchange` WHERE `uuid` = %d;", uuid);
|
||||
local Ret = SelectSql(Sql, ["int", "int", "int", "int", "string", "int", "int", "int", "string"]);
|
||||
if (Ret.len() == 0) return;
|
||||
|
||||
local ItemObj = null;
|
||||
local ItemType = Ret[0][1];
|
||||
local ItemId = Ret[0][2];
|
||||
local ItemCount = Ret[0][3];
|
||||
local ItemPrice = Ret[0][5];
|
||||
local ItemData = Ret[0][4];
|
||||
local uid = Ret[0][6];
|
||||
local cid = Ret[0][7];
|
||||
|
||||
local SelfCid = SUser.GetCID();
|
||||
if (SelfCid == cid) return;
|
||||
|
||||
local UserPoint = SUser.GetCera();
|
||||
if (UserPoint< ItemPrice) return;
|
||||
|
||||
//扣除点券
|
||||
SUser.RechargeCera(-ItemPrice);
|
||||
|
||||
//如果是装备
|
||||
if (ItemType == 1) {
|
||||
local ItemDataJso = Json.Decode(ItemData);
|
||||
SendItemExMail(SUser.GetUID(), SUser.GetCID(), [ItemDataJso], "交易所小助手", "您在交易所购买的商品已发货,请查收!");
|
||||
} else {
|
||||
//发送道具
|
||||
local SendInfo = SUser.GiveItem(ItemId, 1);
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
|
||||
//给上架者加钱
|
||||
local RealItemPrice = (ItemPrice * (1.0 - Commission.tofloat()).tofloat()).tointeger();
|
||||
User.SendItemMail(uid, cid, [{
|
||||
// item = 2022110573,
|
||||
item = 3037,
|
||||
num = RealItemPrice
|
||||
}], "交易所小助手", "恭喜您在交易所成功出售商品,获得点券奖励");
|
||||
|
||||
//删除数据库中的记录
|
||||
Sql = format("DELETE FROM `zyk`.`exchange` WHERE `uuid` = %d;", uuid);
|
||||
SelectSql(Sql, []);
|
||||
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
Cb_Use_Item_Sp_Func[2022110573] <- function(SUser, ItemId) {
|
||||
local Cid = SUser.GetCID();
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (InvenObj) {
|
||||
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
||||
local ItemObj = InvenObj.GetSlot(1, SlotIdx);
|
||||
|
||||
local ItemCount = ItemObj.GetAdd_Info();
|
||||
ItemObj.Delete();
|
||||
SUser.SendItemSpace(0);
|
||||
SUser.RechargeCera(ItemCount);
|
||||
SUser.SendNotiPacketMessage("获得交易所点卷收益: " + ItemCount + "点卷", 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function EquipLogic(SUser, slot, InfoTable, ItemObj) {
|
||||
Sq_CallFunc(S_Ptr("0x0864FE52"), "int", ["pointer"], SUser.C_Object);
|
||||
Timer.SetTimeOut(function() {
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select("SELECT inventory FROM taiwan_cain_2nd.inventory WHERE charac_no = " + SUser.GetCID() + ";", ["binary"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return false;
|
||||
} else {
|
||||
local LengthPointer = Memory.alloc(4);
|
||||
LengthPointer.writeInt(18238);
|
||||
|
||||
local ReadPointer = Memory.alloc(18238);
|
||||
|
||||
local Flag = Sq_CallFunc(S_Ptr("0x086B2102"), "bool", ["pointer", "pointer", "pointer", "int"], ReadPointer.C_Object, LengthPointer.C_Object, Ret[0][0].C_Object, Ret[0][0].Size);
|
||||
|
||||
local RealP = ReadPointer.add(2 + slot * 61);
|
||||
|
||||
//装备编号
|
||||
local ItemId = RealP.readInt();
|
||||
// print("装备编号: " + ItemId);
|
||||
|
||||
//强化等级
|
||||
local EnhancementLevel = RealP.add(4).readS8();
|
||||
// print("强化等级: " + EnhancementLevel);
|
||||
|
||||
//红字类型
|
||||
local AmplifyType = RealP.add(15).readS8();
|
||||
// print("红字类型: " + AmplifyType);
|
||||
|
||||
//红字属性值
|
||||
local AmplifyValue = RealP.add(16).readS8();
|
||||
// print("红字属性值: " + AmplifyValue);
|
||||
|
||||
//锻造等级
|
||||
local ForgingGrade = RealP.add(49).readS8();
|
||||
// print("锻造等级: " + ForgingGrade);
|
||||
|
||||
//附魔卡片
|
||||
local CardId = RealP.add(11).readShort();
|
||||
// print("附魔卡片: " + CardId);
|
||||
|
||||
//品级
|
||||
local Grade = RealP.add(5).readInt();
|
||||
// print("品级: " + Grade);
|
||||
|
||||
//耐久度
|
||||
local Durability = RealP.add(9).readS8();
|
||||
// print("耐久度: " + Durability)
|
||||
|
||||
//魔法封印
|
||||
local MagicSealP = "0x";
|
||||
for (local i = 0; i< 14; i++) {
|
||||
MagicSealP += format("%02x", RealP.add(35 + i).readU8());
|
||||
}
|
||||
// print(MagicSealP);
|
||||
|
||||
local SendT = {
|
||||
ItemId = ItemId,
|
||||
Grade = Grade,
|
||||
Durability = Durability,
|
||||
EnhancementLevel = EnhancementLevel,
|
||||
AmplifyType = AmplifyType,
|
||||
AmplifyValue = AmplifyValue,
|
||||
MagicSealP = MagicSealP,
|
||||
CardId = CardId,
|
||||
}
|
||||
|
||||
local Json = Json.Encode(SendT);
|
||||
InfoTable.ItemData = Json;
|
||||
|
||||
//插入数据库
|
||||
local Sql = format("INSERT INTO `zyk`.`exchange` (`type`, `itemid`, `itemcount`, `itemdata`, `price`, `uid` ,`cid`,`name`) VALUES (%d, %d, %d, \'%s\', %d, %d, %d, \'%s\');", InfoTable.ItemType, InfoTable.ItemId, InfoTable.ItemCount, InfoTable.ItemData, InfoTable.Price, InfoTable.Uid, InfoTable.Cid, InfoTable.Name);
|
||||
local Ret = SelectSql(Sql, []);
|
||||
|
||||
//删除道具
|
||||
ItemObj.Delete();
|
||||
//发送刷新背包消息
|
||||
SUser.SendUpdateItemList(1, 1, slot);
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
}.bindenv(this), 1)
|
||||
}
|
||||
|
||||
|
||||
function SendItemExMail(UID, CID, ItemList, title, content) {
|
||||
local SUser = World.GetUserByUid(UID);
|
||||
local sql = "select letter_id from taiwan_cain_2nd.postal order by letter_id DESC";
|
||||
local column_type_list = ["int"];
|
||||
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local result = SqlObj.Select(sql, column_type_list);
|
||||
local sl = 1;
|
||||
if (result.len() > 0) {
|
||||
sl = result[0][0] + 1;
|
||||
}
|
||||
|
||||
local time = date();
|
||||
local timeStr = time["year"] + "-" + (time["month"] + 1) + "-" + time["day"] + " " + time["hour"] + ":" + time["min"] + ":" + time["sec"];
|
||||
|
||||
foreach(value in ItemList) {
|
||||
//时间 发送者名字 接收者id 装备ID 品级 耐久度 强化等级 红字类型 红字属性值 魔法封印属性 letterid
|
||||
local sql1 = format("insert into taiwan_cain_2nd.postal (occ_time,send_charac_name,receive_charac_no,item_id,add_info,endurance,upgrade,amplify_option,amplify_value,random_option,letter_id,extend_info) values ('%s','%s',%d,%d,%d,%d,%d,%d,%d,%s,%d,%d)", timeStr, title, CID, value.ItemId, value.Grade, value.Durability, value.EnhancementLevel, value.AmplifyType, value.AmplifyValue, value.MagicSealP, sl, value.CardId)
|
||||
SqlObj.Select(sql1, []);
|
||||
}
|
||||
|
||||
local sql2 = "insert into taiwan_cain_2nd.letter (letter_id,charac_no,send_charac_name,letter_text,reg_date,stat) values ('" + sl + "'," + CID + ",'" + title + "','" + content + "','" + timeStr + "','1')";
|
||||
SqlObj.Select(sql2, []);
|
||||
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
// if (SUser) {
|
||||
// local Pack = Packet();
|
||||
// Pack.Put_Header(0, 9);
|
||||
// local MailBox = Sq_CallFunc(S_Ptr("0x0823020C"), "int", ["pointer"], SUser.C_Object);
|
||||
// Sq_CallFunc(S_Ptr("0x0823455A"), "int", ["int"], MailBox);
|
||||
// local Not_Count = Sq_CallFunc(S_Ptr("0x084ED330"), "int", ["int"], MailBox);
|
||||
// Pack.Put_Short(Not_Count);
|
||||
// Pack.Finalize(true);
|
||||
// SUser.Send(Pack);
|
||||
// Pack.Delete();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
//执行数据库命令
|
||||
function SelectSql(Sql, Type) {
|
||||
local Ret = MysqlObject.Select(Sql, Type);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_Exchange <- Exchange();
|
||||
604
Dps_A/ProjectClass/FatalismStone/FatalismStone.nut
Normal file
604
Dps_A/ProjectClass/FatalismStone/FatalismStone.nut
Normal file
@@ -0,0 +1,604 @@
|
||||
/*
|
||||
文件名:FatalismStone.nut
|
||||
路径:Dps_A/ProjectClass/FatalismStone/FatalismStone.nut
|
||||
创建日期:2025-06-22 12:54
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
|
||||
class FatalismStone_Stone {
|
||||
//编号
|
||||
Id = null;
|
||||
//唯一ID
|
||||
Uuid = null;
|
||||
//类型
|
||||
StoneType = null;
|
||||
//洗练度
|
||||
CultivationDegree = null;
|
||||
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//反序列化构造
|
||||
function Deserialize(StoneId, StoneUuid) {
|
||||
this.Id = StoneId;
|
||||
this.Uuid = StoneUuid;
|
||||
this.StoneType = ProjectInitFuncMap.P_FatalismStone.GetStoneData(this.Id)["stone type"];
|
||||
}
|
||||
|
||||
function Blob2Hex(buf) {
|
||||
local str = "";
|
||||
for (local i = 0; i< buf.len(); i++) {
|
||||
str += format("%02X", buf[i]);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function Serialize() {
|
||||
local B = blob(0);
|
||||
B.writen(Id, 'i'); //写入ID
|
||||
B.writen(Uuid, 'i'); //写入Uuid
|
||||
return Blob2Hex(B);
|
||||
}
|
||||
}
|
||||
|
||||
//魂石背包类
|
||||
class FatalismStone_BackPack {
|
||||
|
||||
//背包总格子数
|
||||
GridCount = 77;
|
||||
//穿戴总格子数
|
||||
WearCount = 6;
|
||||
StoneArr = null;
|
||||
|
||||
constructor() {
|
||||
StoneArr = [];
|
||||
}
|
||||
|
||||
//通过数据构造背包 反序列化
|
||||
function Deserialize(N_Data) {
|
||||
local BackpackData = N_Data[0][0];
|
||||
local WearData = N_Data[0][1];
|
||||
|
||||
//转换背包数据
|
||||
local BackPackArr = [];
|
||||
for (local i = 0; i<(GridCount * 3); i++) {
|
||||
local StoneId = BackpackData.add(i * 8).readInt();
|
||||
local StoneUuid = BackpackData.add(i * 8 + 4).readInt();
|
||||
if (StoneId != 0 && StoneUuid != 0) {
|
||||
local StoneObj = FatalismStone_Stone();
|
||||
StoneObj.Deserialize(StoneId, StoneUuid)
|
||||
BackPackArr.push(StoneObj);
|
||||
} else {
|
||||
BackPackArr.push(null);
|
||||
}
|
||||
}
|
||||
//转化穿戴数据
|
||||
local WearArr = [];
|
||||
for (local i = 0; i< WearCount; i++) {
|
||||
local StoneId = WearData.add(i * 8).readInt();
|
||||
local StoneUuid = WearData.add(i * 8 + 4).readInt();
|
||||
if (StoneId != 0 && StoneUuid != 0) {
|
||||
local StoneObj = FatalismStone_Stone();
|
||||
StoneObj.Deserialize(StoneId, StoneUuid)
|
||||
WearArr.push(StoneObj);
|
||||
} else {
|
||||
WearArr.push(null);
|
||||
}
|
||||
}
|
||||
|
||||
//两段数据放入总数据
|
||||
StoneArr.extend(BackPackArr);
|
||||
StoneArr.extend(WearArr);
|
||||
}
|
||||
|
||||
//序列化
|
||||
function Serialize() {
|
||||
//背包数据
|
||||
local BackpackArr = StoneArr.slice(0, GridCount * 3);
|
||||
local BackpackHex = "0x";
|
||||
foreach(Pos, StoneObject in BackpackArr) {
|
||||
if (StoneObject) BackpackHex += StoneObject.Serialize();
|
||||
else BackpackHex += "0000000000000000";
|
||||
}
|
||||
//穿戴数据
|
||||
local WearArr = StoneArr.slice(GridCount * 3, GridCount * 3 + WearCount);
|
||||
local WearHex = "0x";
|
||||
foreach(Pos, StoneObject in WearArr) {
|
||||
if (StoneObject) WearHex += StoneObject.Serialize();
|
||||
else WearHex += "0000000000000000";
|
||||
}
|
||||
//返回
|
||||
return {
|
||||
inventory = BackpackHex,
|
||||
wear = WearHex
|
||||
};
|
||||
}
|
||||
|
||||
//获取魂石的列表 3为身上穿戴的
|
||||
function GetList(Page) {
|
||||
local SliceLength = GridCount;
|
||||
if (Page == 3) SliceLength = WearCount;
|
||||
return StoneArr.slice(Page * 77, Page * 77 + SliceLength);
|
||||
}
|
||||
}
|
||||
|
||||
class FatalismStone {
|
||||
|
||||
//总格子数
|
||||
GridCount = 77;
|
||||
//总穿戴数
|
||||
WearCount = 6;
|
||||
|
||||
//属性数据位数
|
||||
AttrCount = 2;
|
||||
|
||||
//魂石Lst
|
||||
FatalismStoneLst = null;
|
||||
//魂石配置
|
||||
FatalismStoneConfig = null;
|
||||
|
||||
constructor() {
|
||||
Script();
|
||||
local PoolObj = MysqlPool.GetInstance();
|
||||
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||
//连接池大小
|
||||
PoolObj.PoolSize = 10;
|
||||
//初始化
|
||||
PoolObj.Init();
|
||||
|
||||
//读取pvf的魂石相关数据
|
||||
InitFatalismStoneData();
|
||||
|
||||
//创建新架构表
|
||||
SelectSql("CREATE TABLE `zyk`.`f_user_info` ( `cid` int(250) NOT NULL, `inventory` varbinary(1848) NULL, `wear` varbinary(48) NULL, PRIMARY KEY (`cid`));", []);
|
||||
SelectSql("CREATE TABLE `zyk`.`f_stone_map` ( `uuid` int(250) NOT NULL AUTO_INCREMENT, `cultivation` float NULL DEFAULT NULL, PRIMARY KEY (`uuid`) USING BTREE);", []);
|
||||
// UpdateNewMysqlData();
|
||||
|
||||
|
||||
|
||||
//注册客户端收包
|
||||
RegisterClient();
|
||||
//注册调试命令
|
||||
RegisterDebugCmd();
|
||||
}
|
||||
|
||||
|
||||
//查询单个魂石的属性
|
||||
function GetStoneAttr(Uuid) {
|
||||
local Ret = SelectSql("select cultivation from zyk.f_stone_map where uuid = " + Uuid, ["float"]);
|
||||
if (Ret.len() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
return Ret[0];
|
||||
}
|
||||
}
|
||||
|
||||
//查询多个魂石的属性
|
||||
function GetStoneAttrArr(UuidArr) {
|
||||
local SqlStr = "select uuid,cultivation from zyk.f_stone_map where uuid in (";
|
||||
for (local i = 0; i< UuidArr.len(); i++) {
|
||||
SqlStr += UuidArr[i];
|
||||
if (i != UuidArr.len() - 1) {
|
||||
SqlStr += ",";
|
||||
}
|
||||
}
|
||||
SqlStr += ")";
|
||||
local Ret = SelectSql(SqlStr, ["int", "float"]);
|
||||
if (Ret.len() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
return Ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function RegisterClient() {
|
||||
|
||||
//查询魂石背包数据
|
||||
ClientSocketPackFuncMap.rawset(21000001, function(SUser, Jso) {
|
||||
local Ret = GetInvenData(SUser);
|
||||
//没查到东西说明没有背包 第一次创建背包
|
||||
if (Ret.len() == 0) {
|
||||
local SqlStr = format("INSERT INTO zyk.f_user_info (cid, inventory, wear) VALUES (%d,REPEAT(0x00, 1848),REPEAT(0x00, 48))", SUser.GetCID());
|
||||
SelectSql(SqlStr, []);
|
||||
}
|
||||
//有数据的读取
|
||||
else {
|
||||
local BackPackData = Ret[0][0];
|
||||
local WearData = Ret[0][1];
|
||||
local PackSize = 4 + 4 + BackPackData.Size + 4 + WearData.Size;
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 131);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_Int(PackSize);
|
||||
Pack.Put_Int(21000002);
|
||||
Pack.Put_Int(BackPackData.Size);
|
||||
Pack.Put_BinaryEx(BackPackData.C_Object, BackPackData.Size);
|
||||
Pack.Put_Int(WearData.Size);
|
||||
Pack.Put_BinaryEx(WearData.C_Object, WearData.Size);
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
|
||||
//查询身上穿戴的魂石属性
|
||||
local BackPack = FatalismStone_BackPack();
|
||||
BackPack.Deserialize(Ret);
|
||||
local WearArr = BackPack.GetList(3);
|
||||
local UuidArr = [];
|
||||
for (local i = 0; i< WearArr.len(); i++) {
|
||||
if (WearArr[i] != null) {
|
||||
UuidArr.push(WearArr[i].Uuid);
|
||||
}
|
||||
}
|
||||
if (UuidArr.len() > 0) {
|
||||
local Attr = GetStoneAttrArr(UuidArr);
|
||||
if (Attr) {
|
||||
local PackSize = 4 + 4 + (Attr.len() * 4 * Attr[0].len());
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 131);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_Int(PackSize);
|
||||
Pack.Put_Int(21000014);
|
||||
Pack.Put_Int(Attr.len());
|
||||
for (local i = 0; i< Attr.len(); i++) {
|
||||
for (local z = 0; z< Attr[i].len(); z++) {
|
||||
Pack.Put_Int(Attr[i][z]);
|
||||
}
|
||||
}
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.bindenv(this));
|
||||
|
||||
//查询魂石唯一属性
|
||||
ClientSocketPackFuncMap.rawset(21000011, function(SUser, Jso) {
|
||||
local Uuid = Jso.uuid;
|
||||
SendFatalismStoneData(SUser, Uuid);
|
||||
}.bindenv(this));
|
||||
|
||||
//交换魂石位置
|
||||
ClientSocketPackFuncMap.rawset(21000003, function(SUser, Jso) {
|
||||
local OldType = Jso.oldtype;
|
||||
local OldIndex = Jso.oldpos;
|
||||
|
||||
local NewType = Jso.newtype;
|
||||
local NewIndex = Jso.newpos;
|
||||
|
||||
local BackPack = GetInven(SUser);
|
||||
if (!BackPack) return;
|
||||
|
||||
//直接去交换位置
|
||||
local Buffer = BackPack.StoneArr[OldType * 77 + OldIndex];
|
||||
BackPack.StoneArr[OldType * 77 + OldIndex] = BackPack.StoneArr[NewType * 77 + NewIndex];
|
||||
BackPack.StoneArr[NewType * 77 + NewIndex] = Buffer;
|
||||
|
||||
SaveInven(BackPack, SUser);
|
||||
}.bindenv(this));
|
||||
|
||||
//魂石洗练
|
||||
ClientSocketPackFuncMap.rawset(21000005, function(SUser, Jso) {
|
||||
local Uuid = Jso.uuid;
|
||||
local rarity = Jso.rarity;
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
local Flag = InvenObj.DeleteItemCount(FatalismStoneConfig["wash_item"], FatalismStoneConfig["wash_cost"][rarity]);
|
||||
//扣除不成功
|
||||
if (!Flag) {
|
||||
SUser.SendNotiPacketMessage("精炼魂石所需的材料不足!", 8);
|
||||
return;
|
||||
}
|
||||
|
||||
local Rand = MathClass.Rand(1, 105);
|
||||
if (Rand > 100) Rand = 100;
|
||||
|
||||
//将新的精炼值写入数据库
|
||||
local Sql = "update zyk.f_stone_map set cultivation = " + Rand + " where uuid = " + Uuid;
|
||||
SelectSql(Sql, []);
|
||||
SendFatalismStoneData(SUser, Uuid)
|
||||
}.bindenv(this));
|
||||
|
||||
Cb_User_Insert_Item_Leave_Func["宿命魂石"] <- function(args) {
|
||||
local SUser = User(NativePointer(args[0]).readPointer());
|
||||
local InvenObj = SUser.GetInven();
|
||||
local idx = args.pop();
|
||||
if (idx > 0) {
|
||||
local inven_item = InvenObj.GetSlot(1, idx);
|
||||
local item_id = inven_item.GetIndex();
|
||||
if (item_id >= 200625000 && item_id< 200626000) {
|
||||
local Ret = AddFatalismStone(SUser, item_id - 200625000);
|
||||
//删除原道具
|
||||
Timer.SetTimeOut(function() {
|
||||
inven_item.Delete();
|
||||
SUser.SendUpdateItemList(1, 0, idx);
|
||||
}, 1000);
|
||||
//如果满了就发邮件
|
||||
if (!Ret) {
|
||||
local T = {};
|
||||
T.rawset(item_id, 1);
|
||||
SUser.SendMail(T, {
|
||||
Title = "系统",
|
||||
Text = "由于你的魂石包裹已满, 请留出足够的空间来接收道具."
|
||||
});
|
||||
}
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
}
|
||||
}.bindenv(this);
|
||||
}
|
||||
|
||||
|
||||
function RegisterDebugCmd() {
|
||||
Gm_InputFunc_Handle["给魂石"] <- function(SUser, CmdString) {
|
||||
local count = -1;
|
||||
local pos = 0;
|
||||
local handler = [];
|
||||
do {
|
||||
local start = pos;
|
||||
pos = CmdString.find(" ", pos + 1);
|
||||
if (pos != null) {
|
||||
handler.append(CmdString.slice(start + 1, pos));
|
||||
} else
|
||||
handler.append(CmdString.slice(start + 1));
|
||||
count = count + 1
|
||||
} while (pos != null)
|
||||
|
||||
//得到空格数量
|
||||
if (count == 1) {
|
||||
AddFatalismStone(SUser, handler[1].tointeger());
|
||||
}
|
||||
}.bindenv(this);
|
||||
}
|
||||
|
||||
//获取玩家背包数据
|
||||
function GetInvenData(SUser) {
|
||||
local Ret = SelectSql("select inventory,wear from zyk.f_user_info where cid = " + SUser.GetCID(), ["binary", "binary"]);
|
||||
if (!Ret || Ret.len() == 0) return null;
|
||||
else return Ret;
|
||||
}
|
||||
|
||||
//获取玩家背包
|
||||
function GetInven(SUser) {
|
||||
local Ret = GetInvenData(SUser);
|
||||
if (Ret) {
|
||||
local BackPack = FatalismStone_BackPack();
|
||||
BackPack.Deserialize(Ret);
|
||||
return BackPack;
|
||||
} else return null;
|
||||
}
|
||||
|
||||
//固化背包数据到数据库
|
||||
function SaveInven(Inven, SUser) {
|
||||
//获取背包整体信息并储存
|
||||
local Hex = Inven.Serialize();
|
||||
//更新数据库
|
||||
local Sql = "update zyk.f_user_info set inventory = " + Hex.inventory + ",wear = " + Hex.wear + " where cid = " + SUser.GetCID();
|
||||
SelectSql(Sql, []);
|
||||
}
|
||||
|
||||
//发送uuid的魂石数据给客户端
|
||||
function SendFatalismStoneData(SUser, Uuid) {
|
||||
local Attr = GetStoneAttr(Uuid);
|
||||
if (!Attr) {
|
||||
SUser.SendNotiPacketMessage("魂石属性异常,请联系管理员!", 8);
|
||||
} else {
|
||||
local Cultivation = Attr[0];
|
||||
local PackSize = 4 + 4 + 4;
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 131);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_Int(PackSize);
|
||||
Pack.Put_Int(21000012);
|
||||
Pack.Put_Int(Uuid);
|
||||
Pack.Put_Int(Cultivation);
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
//给指定玩家新增魂石
|
||||
function AddFatalismStone(SUser, FatalismStoneID) {
|
||||
local CID = SUser.GetCID();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function InitFatalismStoneData() {
|
||||
// Script();
|
||||
FatalismStoneLst = {};
|
||||
ScriptData.GetFileData("fatalismstone/fatalismstone.lst", function(DataTable, Data) {
|
||||
while (!Data.Eof()) {
|
||||
local Id = Data.Get();
|
||||
local Path = Data.Get();
|
||||
FatalismStoneLst.rawset(Id, Path);
|
||||
}
|
||||
}.bindenv(this));
|
||||
|
||||
FatalismStoneConfig = ScriptData.GetFileData("fatalismstone/fatalismstone.etc", function(DataTable, Data) {
|
||||
while (!Data.Eof()) {
|
||||
local Str = Data.Get();
|
||||
if (Str == "[wash item]") {
|
||||
DataTable.wash_item <- Data.Get();
|
||||
} else if (Str == "[wash cost]") {
|
||||
DataTable.wash_cost <- [Data.Get(), Data.Get(), Data.Get(), Data.Get(), Data.Get(), Data.Get(), Data.Get()];
|
||||
}
|
||||
}
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
function GetStoneData(Index) {
|
||||
if (FatalismStoneLst.rawin(Index)) {
|
||||
//还是路径就读取数据
|
||||
if (typeof FatalismStoneLst[Index] == "string") {
|
||||
FatalismStoneLst[Index] = ScriptData.GetFileData("fatalismstone/" + FatalismStoneLst[Index], function(DataTable, Data) {
|
||||
DataTable.Attribute <- {};
|
||||
while (!Data.Eof()) {
|
||||
local Key = Data.Get();
|
||||
if (Key == "[rarity]" || Key == "[stone type]" || Key == "[move wav]" || Key == "[front effect]" || Key == "[back effect]") {
|
||||
DataTable[Key.slice(1, -1)] <- Data.Get();
|
||||
} else if (Key == "[icon]") {
|
||||
DataTable.icon <- {
|
||||
img = Data.Get(),
|
||||
index = Data.Get()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return FatalismStoneLst[Index];
|
||||
} else error("没有ID为: " + Index + " 的魂石数据!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//执行数据库命令
|
||||
function SelectSql(Sql, Type) {
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(Sql, Type);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
//UpdateNewMysqlData
|
||||
function UpdateNewMysqlData() {
|
||||
|
||||
local Ret = SelectSql("select * from zyk.fatalismstone", ["int", "binary", "binary"]);
|
||||
|
||||
foreach(Index, Info in Ret) {
|
||||
local cid = Info[0];
|
||||
local inventory = Info[1];
|
||||
local wear = Info[2];
|
||||
|
||||
//处理背包里的魂石
|
||||
local NewBlob = blob();
|
||||
for (local i = 0; i< 462; i += 2) {
|
||||
local item_id = inventory.add(i * 4).readInt();
|
||||
local cultivation = inventory.add(i * 4 + 4).readInt();
|
||||
if (item_id > 0) {
|
||||
//在新表中建立这件装备的uuid
|
||||
local Sql = "insert into zyk.f_stone_map (cultivation) values (" + cultivation + ")";
|
||||
SelectSql(Sql, []);
|
||||
//查询最后新增条目的uuid
|
||||
Sql = "select LAST_INSERT_ID() as uuid";
|
||||
local uuid = SelectSql(Sql, ["int"])[0][0];
|
||||
|
||||
NewBlob.writen(item_id, 'i');
|
||||
NewBlob.writen(uuid, 'i');
|
||||
} else {
|
||||
NewBlob.writen(0, 'i');
|
||||
NewBlob.writen(0, 'i');
|
||||
}
|
||||
}
|
||||
local inventoryBinary = "0x" + Blob2Hex(NewBlob);
|
||||
|
||||
//处理身上穿戴的魂石
|
||||
NewBlob.resize(0);
|
||||
for (local i = 0; i< 12; i += 2) {
|
||||
local item_id = wear.add(i * 4).readInt();
|
||||
print(item_id);
|
||||
|
||||
local cultivation = wear.add(i * 4 + 4).readInt();
|
||||
if (item_id > 0) {
|
||||
//在新表中建立这件装备的uuid
|
||||
local Sql = "insert into zyk.f_stone_map (cultivation) values (" + cultivation + ")";
|
||||
SelectSql(Sql, []);
|
||||
//查询最后新增条目的uuid
|
||||
Sql = "select LAST_INSERT_ID() as uuid";
|
||||
local uuid = SelectSql(Sql, ["int"])[0][0];
|
||||
|
||||
NewBlob.writen(item_id, 'i');
|
||||
NewBlob.writen(uuid, 'i');
|
||||
} else {
|
||||
NewBlob.writen(0, 'i');
|
||||
NewBlob.writen(0, 'i');
|
||||
}
|
||||
}
|
||||
local wearBinary = "0x" + Blob2Hex(NewBlob);
|
||||
|
||||
local Sql = "insert into zyk.f_user_info (cid,inventory, wear) values (" + cid + "," + inventoryBinary + "," + wearBinary + ")";
|
||||
SelectSql(Sql, []);
|
||||
}
|
||||
}
|
||||
|
||||
function Blob2Hex(buf) {
|
||||
local str = "";
|
||||
for (local i = 0; i< buf.len(); i++) {
|
||||
str += format("%02X", buf[i]);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_FatalismStone <- FatalismStone();
|
||||
@@ -47,6 +47,7 @@ class Fiendwar {
|
||||
|
||||
//玩家发送消息HOOK 为了攻坚队频道和团长公告
|
||||
function base_input_hook(CUser, CmdString) {
|
||||
|
||||
if (!CUser) return true;
|
||||
local SUser = User(CUser);
|
||||
//超时空频道
|
||||
@@ -55,6 +56,7 @@ class Fiendwar {
|
||||
if (Localtion.Area <= 1) {
|
||||
return true;
|
||||
} else {
|
||||
print(111);
|
||||
if (CmdString.find("RindroType") == 8) {
|
||||
local Jso = {
|
||||
op = 20063027,
|
||||
@@ -72,8 +74,31 @@ class Fiendwar {
|
||||
}
|
||||
}
|
||||
|
||||
function base_input_hook2(args) {
|
||||
|
||||
local type = args[2];
|
||||
local SUser = User(args[1]);
|
||||
local msg = args[3];
|
||||
if ((type == 8 || type == 3) && Sq_Game_GetConfig().find("20") != null) {
|
||||
local Localtion = SUser.GetLocation();
|
||||
if (Localtion.Area <= 1) {
|
||||
return true;
|
||||
} else {
|
||||
local Jso = {
|
||||
op = 20063027,
|
||||
uid = SUser.GetUID(),
|
||||
cid = SUser.GetCID(),
|
||||
msg = msg
|
||||
}
|
||||
Socket.SendGateway(Jso);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//玩家消息分发
|
||||
function PlayerNotiMsgDistribute(Jso) {
|
||||
|
||||
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
||||
if (!SUser) return;
|
||||
local CUserList = Jso.list;
|
||||
@@ -85,21 +110,22 @@ class Fiendwar {
|
||||
local SUserName = SUser.GetCharacName();
|
||||
local Type = Jso.type;
|
||||
|
||||
Jso.msg = Jso.msg;
|
||||
if (Type == -1) {
|
||||
Jso.Name <- SUserName;
|
||||
foreach(_Index, Value in RealList) {
|
||||
local SendObj = Value;
|
||||
SendObj.SendJso(Jso);
|
||||
}
|
||||
} else {
|
||||
local NotiStr = "(" + Type + ") " + "" + SUserName + " : " + Jso.msg;
|
||||
foreach(_Index, Value in RealList) {
|
||||
local SendObj = Value;
|
||||
SendObj.SendNotiPacketMessage(NotiStr, 8);
|
||||
}
|
||||
Type = "长"
|
||||
}
|
||||
local NotiStr = "(攻坚队" + Type + ") " + "" + SUserName + " : " + Jso.msg;
|
||||
foreach(_Index, Value in RealList) {
|
||||
local SendObj = Value;
|
||||
SendObj.SendNotiPacketMessage(NotiStr, 8);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function FiendwarSendAreaUserCallBack(Jso) {
|
||||
local CUserList = Jso.list;
|
||||
@@ -220,6 +246,7 @@ class Fiendwar {
|
||||
Cb_Move_Area_Func.Fiendwar <- move_area_hook.bindenv(this); //区域移动
|
||||
Base_InputHookFunc_Handle.Fiendwar <- base_input_hook.bindenv(this); //玩家发送消息
|
||||
Cb_reach_game_world_Func.Fiendwar <- Login_Hook.bindenv(this); //上线HOOK
|
||||
Cb_Server_Chat_Log_Leave_Func.Luke <- base_input_hook2.bindenv(this); //玩家发送消息
|
||||
|
||||
//注册收包
|
||||
GatewaySocketPackFuncMap.rawset(20063010, FiendwarSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
|
||||
|
||||
259
Dps_A/ProjectClass/Luke/LukeClass.nut
Normal file
259
Dps_A/ProjectClass/Luke/LukeClass.nut
Normal file
@@ -0,0 +1,259 @@
|
||||
/*
|
||||
文件名: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);
|
||||
print(111);
|
||||
//卢克频道
|
||||
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 base_input_hook2(args) {
|
||||
local type = args[2];
|
||||
local SUser = User(args[1]);
|
||||
local msg = args[3];
|
||||
|
||||
if ((type == 8 || type == 3) && 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 = msg
|
||||
}
|
||||
Socket.SendGateway(Jso);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//玩家消息分发
|
||||
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;
|
||||
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) {
|
||||
Timer.SetTimeOut(function(SUser) {
|
||||
//玩家上线发信息包
|
||||
local evv = {
|
||||
op = 20084502,
|
||||
town_index = Town,
|
||||
channel_index = Channel
|
||||
}
|
||||
SUser.SendJso(evv);
|
||||
}.bindenv(this), 5, SUser);
|
||||
|
||||
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
|
||||
Cb_Server_Chat_Log_Leave_Func.Luke <- base_input_hook2.bindenv(this); //玩家发送消息
|
||||
|
||||
//注册收包
|
||||
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,41 +4,821 @@
|
||||
创建日期:2024-10-01 10:02
|
||||
文件用途:结婚系统
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Marry {
|
||||
//当前频道
|
||||
Channel = null;
|
||||
//配置
|
||||
Config = null;
|
||||
//包头
|
||||
OP = 20078000;
|
||||
//请求结婚的列表
|
||||
RequestMarryList = {};
|
||||
//进入礼堂前的位置信息
|
||||
EnterAuditoriumPosList = {};
|
||||
|
||||
//查看是否结婚
|
||||
function CheckMarryCallBack(SUser, Jso) {
|
||||
// print("申请查看结婚信息的人是: " + SUser.GetCharacName());
|
||||
//礼堂id 对应的用户信息 结构为Map<cid,Map<uid , avatar[]>>
|
||||
AuditoriumUserInfo = {};
|
||||
//角色时装信息
|
||||
UserAvaList = {};
|
||||
|
||||
//礼堂id 对应礼堂的宾客信息
|
||||
AuditoriumUserInfoNewPeople = {};
|
||||
|
||||
//数据库操作集
|
||||
Mysql_Operate_Func = {
|
||||
//查询结婚状态
|
||||
CheckMarryState = function(Cid) {
|
||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryState, Cid);
|
||||
//从池子拿连接
|
||||
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];
|
||||
}
|
||||
}
|
||||
//新增结婚信息
|
||||
InseartMarryInfo = function(Cid, Name, TargerCid, Job, Level, Experience, Equip, State) {
|
||||
local sql = format(MARRY_SQL_LIST.InseartMarryInfo, Cid, Name, TargerCid, Job, Level, Experience, Equip, State, TargerCid, Equip, State);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
//查询结婚对象CID
|
||||
CheckMarryTarget = function(Cid) {
|
||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryTarget, Cid);
|
||||
//从池子拿连接
|
||||
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 null;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
//删除结婚信息
|
||||
DeleteMarryInfo = function(Cid) {
|
||||
local delete_sql = format(MARRY_SQL_LIST.DeleteMarryInfo, Cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(delete_sql);
|
||||
//把连接还池子
|
||||
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) {
|
||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryTargetName, Cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(CheckSql, ["string"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
//没结婚要返回false
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
//修改结婚状态
|
||||
ChangeMarryState = function(Cid, State) {
|
||||
local Sql = format(MARRY_SQL_LIST.ChangeMarryState, State, Cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(Sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
//新增礼堂信息
|
||||
InsertMarryRoom = function(Cid, Name, Time, Level, Target_CId, Target_Name, State, Index) {
|
||||
local Sql = format(MARRY_SQL_LIST.InsertMarryRoom, Cid, Name, Time, Level, Target_CId, Target_Name, State, Index);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(Sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
|
||||
|
||||
//查询礼堂信息
|
||||
GetAuditoriumList = function() {
|
||||
local Sql = format(MARRY_SQL_LIST.GetAuditoriumList);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(Sql, ["int", "string", "int", "int", "int", "string", "int", "int"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
//根据cid查询自己的礼堂编号
|
||||
GetAuditoriumIndexById = function(cid) {
|
||||
local Sql = format(MARRY_SQL_LIST.GetAuditoriumIndexById, 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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//根据cid查询婚礼开始时间
|
||||
GetAuditoriumTimeById = function(cid) {
|
||||
local Sql = format(MARRY_SQL_LIST.GetAuditoriumTimeById, 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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//根据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);
|
||||
}
|
||||
|
||||
|
||||
//根据cid查询自己的uid
|
||||
GetUidByCid = function(cid) {
|
||||
local Sql = format(MARRY_SQL_LIST.GetUidByCid, 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];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//查看是否结婚包
|
||||
function CheckMarryStateCallBack(SUser, Jso) {
|
||||
local T = {
|
||||
op = OP + 2,
|
||||
Flag = false, //结婚返回true 未结婚返回flase
|
||||
op = OP + 10,
|
||||
Flag = Mysql_Operate_Func.CheckMarryState(SUser.GetCID())
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
//申请结婚
|
||||
//申请订婚包
|
||||
function RequestMarry(SUser, Jso) {
|
||||
local PSUser = World.GetUserByName(Jso.Name);
|
||||
if (PSUser) {
|
||||
//判断对象角色是否在线
|
||||
if (!PSUser) {
|
||||
//没找到这个角色要返回一个错误包
|
||||
local T = {
|
||||
op = OP + 3,
|
||||
cid = SUser.GetCID(),
|
||||
cid2 = PSUser.GetCID(),
|
||||
op = OP + 90,
|
||||
str = "未找到角色,请检查角色名或查看玩家是否在线"
|
||||
}
|
||||
Socket.SendGateway(T);
|
||||
SUser.SendNotiBox("未找到角色,请检查角色名或查看玩家是否在线", 1);
|
||||
}
|
||||
//判断是否是自己
|
||||
if (SUser.GetCID() == PSUser.GetCID()) {
|
||||
SUser.SendNotiBox("不能和自己结婚!", 1);
|
||||
return;
|
||||
}
|
||||
//查询两人状态必须都为未结婚
|
||||
local SUserState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
||||
local PSUserState = Mysql_Operate_Func.CheckMarryState(PSUser.GetCID());
|
||||
if (SUserState) {
|
||||
SUser.SendNotiBox("抱歉,您已经结婚了!", 1);
|
||||
return;
|
||||
}
|
||||
if (PSUserState) {
|
||||
SUser.SendNotiBox("抱歉,对方已经结婚了...", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
local T = {
|
||||
op = OP + 4,
|
||||
applicantCid = SUser.GetCID(),
|
||||
applicantUid = SUser.GetUID(),
|
||||
applicantName = SUser.GetCharacName(),
|
||||
}
|
||||
PSUser.SendJso(T);
|
||||
|
||||
//把请求加入到请求列表
|
||||
RequestMarryList.rawset(SUser.GetCID(), PSUser.GetCID());
|
||||
}
|
||||
|
||||
//订婚答复包
|
||||
function ResponseMarry(SUser, Jso) {
|
||||
local Flag = Jso.Flag;
|
||||
local applicantUser = World.GetUserByUidCid(Jso.applicantUid, Jso.applicantCid);
|
||||
if (Flag) {
|
||||
if (applicantUser) {
|
||||
//在请求列表里查看是否有请求
|
||||
if (!(RequestMarryList.rawin(Jso.applicantCid)) || RequestMarryList[Jso.applicantCid] != SUser.GetCID()) {
|
||||
SUser.SendNotiBox("抱歉,对方未发送请求!", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
applicantUser.SendNotiBox("恭喜您!\n对方同意了您的请求。\n请寻找大司祭制定结婚的详细事宜。", 1);
|
||||
|
||||
Mysql_Operate_Func.InseartMarryInfo(Jso.applicantCid, applicantUser.GetCharacName(), SUser.GetCID(), applicantUser.GetCharacJob(), 0, 0, "no", 1);
|
||||
Mysql_Operate_Func.InseartMarryInfo(SUser.GetCID(), SUser.GetCharacName(), Jso.applicantCid, SUser.GetCharacJob(), 0, 0, "no", 1);
|
||||
|
||||
//刷新客户端的订婚状态
|
||||
local T = {
|
||||
op = OP + 10,
|
||||
Flag = 1
|
||||
};
|
||||
applicantUser.SendJso(T);
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
} else {
|
||||
if (applicantUser) applicantUser.SendNotiBox("很遗憾!\n对方拒绝了您的请求", 1);
|
||||
}
|
||||
}
|
||||
|
||||
//退婚包
|
||||
function CancelMarry(SUser, Jso) {
|
||||
//加判断 必须两人都在订婚状态才能退婚
|
||||
|
||||
local DeleteArr = [];
|
||||
DeleteArr.push(SUser.GetCID());
|
||||
local Target_CId = Mysql_Operate_Func.CheckMarryTarget(SUser.GetCID());
|
||||
if (Target_CId) {
|
||||
DeleteArr.push(Target_CId);
|
||||
//如果对象存在则判断两人是否都在订婚状态
|
||||
local SUserState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID())
|
||||
local TargetState = Mysql_Operate_Func.CheckMarryTarget(Target_CId);
|
||||
if (SUserState != 1 || TargetState != 1) return;
|
||||
}
|
||||
|
||||
|
||||
foreach(s_cid in DeleteArr) {
|
||||
Mysql_Operate_Func.DeleteMarryInfo(s_cid);
|
||||
}
|
||||
//刷新客户端的订婚状态
|
||||
local T = {
|
||||
op = OP + 10,
|
||||
Flag = 0
|
||||
};
|
||||
SUser.SendJso(T);
|
||||
//如果需要通知被退婚的对象
|
||||
if (DeleteArr.len() > 1) {
|
||||
local WorldMap = World.GetOnlinePlayer();
|
||||
foreach(W_User in WorldMap) {
|
||||
if (W_User.GetCID() == DeleteArr[1]) {
|
||||
W_User.SendJso(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//打开准备婚礼窗口
|
||||
function OpenPreparationWindow(SUser, Jso) {
|
||||
local Target_CId = Mysql_Operate_Func.CheckMarryTarget(SUser.GetCID());
|
||||
if (!Target_CId) {
|
||||
SUser.SendNotiBox("没有婚礼信息!", 1);
|
||||
return;
|
||||
}
|
||||
local Target_Name = Mysql_Operate_Func.CheckMarryTargetName(Target_CId);
|
||||
if (!Target_Name) {
|
||||
SUser.SendNotiBox("没有婚礼信息!", 1);
|
||||
return;
|
||||
}
|
||||
local T = {
|
||||
op = OP + 12,
|
||||
MyName = SUser.GetCharacName(),
|
||||
TargetName = Target_Name,
|
||||
};
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
//确认婚礼
|
||||
function ConfirmMarry(SUser, Jso) {
|
||||
local Target_CId = Mysql_Operate_Func.CheckMarryTarget(SUser.GetCID());
|
||||
if (!Target_CId) {
|
||||
SUser.SendNotiBox("没有婚礼信息!", 1);
|
||||
return;
|
||||
}
|
||||
local Time = Jso.Time;
|
||||
local Level = Jso.Level;
|
||||
local NeedItem = Config[("结婚等级" + (Level + 1) + "道具ID")];
|
||||
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
local SlotIdx = InvenObj.GetSlotById(NeedItem);
|
||||
if (SlotIdx == -1) {
|
||||
SUser.SendNotiBox("没有足够的道具!", 1);
|
||||
return;
|
||||
} else {
|
||||
InvenObj.DeleteItemCount(NeedItem, 1);
|
||||
|
||||
|
||||
|
||||
//获得婚礼仪式开始时间
|
||||
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), Time, 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(), {});
|
||||
|
||||
|
||||
Mysql_Operate_Func.ChangeMarryState(SUser.GetCID(), 2);
|
||||
Mysql_Operate_Func.ChangeMarryState(Target_CId, 2);
|
||||
|
||||
|
||||
local T = {
|
||||
op = OP + 10,
|
||||
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());
|
||||
|
||||
//根据cid去查uid
|
||||
local Target_Uid = Mysql_Operate_Func.GetUidByCid(Target_CId);
|
||||
|
||||
local Muser = World.GetUserByUid(Target_Uid);
|
||||
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();
|
||||
foreach(W_User in WorldMap) {
|
||||
if (W_User.GetCID() == Target_CId) {
|
||||
W_User.SendJso(T);
|
||||
W_User.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||
}
|
||||
}
|
||||
|
||||
SUser.SendJso(T);
|
||||
SUser.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||
|
||||
Timer.SetTimeOut(OpenAuditorium.bindenv(this), (Time + 1) * 10 * 1000, SUser.GetCID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
constructor() {
|
||||
//注册来自客户端的收包
|
||||
ClientSocketPackFuncMap.rawset(OP + 1, CheckMarryCallBack.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
|
||||
|
||||
|
||||
//婚礼前的准备 把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 = user.GetAva(),
|
||||
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) {
|
||||
local RoomId = Jso.room;
|
||||
|
||||
local location = SUser.GetLocation();
|
||||
|
||||
// //进入自己的礼堂
|
||||
if (RoomId == -1) {
|
||||
local MyState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
||||
if (MyState != 2) {
|
||||
SUser.SendNotiBox("您访问的礼堂不存在!", 1);
|
||||
return;
|
||||
}
|
||||
RoomId = SUser.GetCID();
|
||||
//如果根据自己的cid不能拿到礼堂信息 说明这个礼堂的key是对象的
|
||||
if (!(AuditoriumUserInfo.rawin(RoomId))) {
|
||||
//对象的cid
|
||||
RoomId = Mysql_Operate_Func.GetAuditoriumIndexById(SUser.GetCID());
|
||||
}
|
||||
|
||||
location.rawset("所在礼堂编号", RoomId);
|
||||
//向缓存写入进入时的坐标
|
||||
EnterAuditoriumPosList.rawset(SUser.GetCID(), location);
|
||||
|
||||
//移动到礼堂
|
||||
World.MoveArea(SUser, Config["礼堂城镇编号"], Config["礼堂区域编号"], 55, 349);
|
||||
} else {
|
||||
location.rawset("所在礼堂编号", RoomId);
|
||||
//向缓存写入进入时的坐标
|
||||
EnterAuditoriumPosList.rawset(SUser.GetCID(), location);
|
||||
//移动到礼堂
|
||||
World.MoveArea(SUser, Config["礼堂城镇编号"], Config["礼堂区域编号"], 55, 349);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
local infore = {};
|
||||
infore.rawset("job", SUser.GetCharacJob());
|
||||
infore.rawset("growjob", SUser.GetCharacGrowType());
|
||||
infore.rawset("avatar", SUser.GetAva());
|
||||
infore.rawset("name", SUser.GetCharacName());
|
||||
|
||||
|
||||
|
||||
AuditoriumUserInfo[RoomId].rawset(SUser.GetUID(), infore);
|
||||
|
||||
//遍历这个礼堂里的人 给他们发送可见列表
|
||||
local UserCanSee = [];
|
||||
foreach(uid, info in AuditoriumUserInfo[RoomId]) {
|
||||
UserCanSee.push(uid);
|
||||
}
|
||||
MarryUserCallBack(UserCanSee, SUser)
|
||||
|
||||
|
||||
local T = {
|
||||
op = OP + 22,
|
||||
time = Mysql_Operate_Func.GetAuditoriumTimeById(RoomId) - time()
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
if (EnterAuditoriumPosList.rawin(SUser.GetCID())) {
|
||||
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
||||
//离开礼堂回到进入时的位置
|
||||
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.GetUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//获得礼堂列表
|
||||
function GetAuditoriumList(SUser, Jso) {
|
||||
local re = Mysql_Operate_Func.GetAuditoriumList();
|
||||
local SendArr = [];
|
||||
//判断用的
|
||||
local SelectMap = {};
|
||||
|
||||
foreach(v in re) {
|
||||
local TimeBuf = v.pop();
|
||||
local id = v[0];
|
||||
//不存在时PUSH
|
||||
if (!(SelectMap.rawin(v[4]))) {
|
||||
v.push(AuditoriumUserInfo.rawget(id).len());
|
||||
v.push(Channel);
|
||||
v.push(TimeBuf);
|
||||
SendArr.push(v);
|
||||
SelectMap.rawset(id, 1);
|
||||
}
|
||||
}
|
||||
local T = {
|
||||
op = OP + 20,
|
||||
info = SendArr
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
function GetConfig(SUser, Jso) {
|
||||
local T = {
|
||||
op = OP + 778,
|
||||
town = Config["礼堂城镇编号"],
|
||||
area = Config["礼堂区域编号"],
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
|
||||
//加入到可见列表
|
||||
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) {
|
||||
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 MarryUserDeleteCallBack(RealList, MUser) {
|
||||
|
||||
foreach(_Index, Value in RealList) {
|
||||
local SUser = Value;
|
||||
if (!SUser || !(SUser.GetState() >= 3) || !MUser || !(MUser.GetState() >= 3)) continue;
|
||||
if (SUser.GetUID() == MUser.GetUID()) continue;
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(0, 23);
|
||||
Pack.Put_Short(MUser.GetUniqueId()); //唯一id
|
||||
Pack.Put_Byte(MUser.GetLocation().Town); //城镇
|
||||
|
||||
|
||||
Pack.Put_Byte(99); //区域
|
||||
Pack.Put_Short(MUser.GetAreaPos().X);
|
||||
|
||||
Pack.Put_Short(MUser.GetAreaPos().Y);
|
||||
Pack.Put_Byte(MUser.GetDirections()); //朝向
|
||||
Pack.Put_Byte(MUser.GetVisibleValues()); //是否可见
|
||||
Pack.Finalize(true);
|
||||
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
constructor() {
|
||||
Config = dofile("/root/娱心插件配置/结婚系统配置.dat");
|
||||
|
||||
local ConfigPath = Sq_Game_GetConfig();
|
||||
Channel = ConfigPath.slice(-6).slice(0, 2);
|
||||
|
||||
//注册来自客户端的收包
|
||||
// ClientSocketPackFuncMap.rawset(OP + 9, CheckMarryStateCallBack.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 5, ResponseMarry.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 7, CancelMarry.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 11, OpenPreparationWindow.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 13, ConfirmMarry.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 15, EnterAuditorium.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 19, GetAuditoriumList.bindenv(this));
|
||||
// ClientSocketPackFuncMap.rawset(OP + 777, GetConfig.bindenv(this));
|
||||
//注册结婚回调函数
|
||||
Cb_Insert_User_Func.Marry <- Marry_insert_user_hook.bindenv(this); //区域添加角色
|
||||
|
||||
// //玩家重新上线的时候自动给他退出礼堂
|
||||
Cb_reach_game_world_Func.Auditorium <- function(SUser) {
|
||||
|
||||
if (EnterAuditoriumPosList && EnterAuditoriumPosList.rawin(SUser.GetUID())) {
|
||||
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
||||
//给这个礼堂的人发送退出可见列表的包
|
||||
foreach(cid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
||||
UserCanSee.push(cid);
|
||||
}
|
||||
MarryUserDeleteCallBack(UserCanSee, SUser)
|
||||
|
||||
AuditoriumUserInfo[Info["所在礼堂编号"]].rawdelete(SUser.GetUID());
|
||||
}
|
||||
}.bindenv(this);
|
||||
|
||||
|
||||
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local query = "SELECT COUNT(*) AS table_exists FROM information_schema.tables WHERE table_schema = 'zyk' AND table_name = 'marry';"
|
||||
local Res = SqlObj.Select(query, ["int"]);
|
||||
//需要建库
|
||||
if (Res.len() > 0 && Res[0][0] == 0) {
|
||||
local CreateSql = "CREATE TABLE IF NOT EXISTS zyk.marry (cid INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), target_cid INT(11), job INT(11), level INT(11), experience INT(11), equip VARCHAR(255), state INT(11));"
|
||||
local CreateSql2 = "CREATE TABLE IF NOT EXISTS zyk.marry_room (cid INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), time INT(11), level INT(11), target_cid INT(11), target_name VARCHAR(255), state INT(11), index INT(11));"
|
||||
SqlObj.Exec_Sql(CreateSql);
|
||||
SqlObj.Exec_Sql(CreateSql2);
|
||||
}
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
|
||||
Cb_Use_Item_Sp_Func[Config["结婚等级1道具ID"]] <- function(SUser, ItemId) {
|
||||
ExpUp(SUser, Config["道具1给的心意点"]);
|
||||
}.bindenv(this);
|
||||
Cb_Use_Item_Sp_Func[Config["结婚等级2道具ID"]] <- function(SUser, ItemId) {
|
||||
ExpUp(SUser, Config["道具2给的心意点"]);
|
||||
}.bindenv(this);
|
||||
Cb_Use_Item_Sp_Func[Config["结婚等级3道具ID"]] <- function(SUser, ItemId) {
|
||||
ExpUp(SUser, Config["道具3给的心意点"]);
|
||||
}.bindenv(this);
|
||||
|
||||
}
|
||||
|
||||
function ExpUp(SUser, expUp) {
|
||||
exp = Mysql_Operate_Func.GetExpById(SUser.GetCID())
|
||||
if (!exp) {
|
||||
return;
|
||||
}
|
||||
exp = exp + expUp;
|
||||
for (local i = 6; i >= 0; i--) {
|
||||
//如果当前的经验值大于所遍历到的等级 就设定等级为这个 然后不继续向更低等级遍历
|
||||
if (Config["戒指等级"][i.tostring()]["所需经验"]< exp) {
|
||||
Mysql_Operate_Func.SetExpAndLvById(SUser.GetCID(), i, exp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_Marry <- Marry();
|
||||
//初始化结婚
|
||||
// ProjectInitFuncMap.P_Marry <- Marry();
|
||||
52
Dps_A/ProjectClass/MarrySystem/Marry_sql.nut
Normal file
52
Dps_A/ProjectClass/MarrySystem/Marry_sql.nut
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
文件名:Marry_sql.nut
|
||||
路径:Dps_A/ProjectClass/MarrySystem/Marry_sql.nut
|
||||
创建日期:2024-10-03 20:57
|
||||
文件用途:结婚系统数据库命令
|
||||
*/
|
||||
|
||||
MARRY_SQL_LIST <- {};
|
||||
|
||||
//查询婚姻状态
|
||||
MARRY_SQL_LIST.CheckMarryState <- "SELECT state FROM zyk.marry WHERE cid = %d;";
|
||||
//查询婚姻对象
|
||||
MARRY_SQL_LIST.CheckMarryTarget <- "SELECT target_cid FROM zyk.marry WHERE cid = %d;";
|
||||
//查询婚姻对象名字
|
||||
MARRY_SQL_LIST.CheckMarryTargetName <- "SELECT name FROM zyk.marry WHERE cid = %d;";
|
||||
//通过cid删除一条婚姻信息
|
||||
MARRY_SQL_LIST.DeleteMarryInfo <- "DELETE FROM zyk.marry WHERE cid = %d;";
|
||||
//新增婚姻信息
|
||||
MARRY_SQL_LIST.InseartMarryInfo <- @"INSERT INTO zyk.marry (cid, name, target_cid, job, level, experience, equip, state)
|
||||
VALUES (%d, '%s', %d, %d, %d, %d,'%s',%d)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
target_cid = %d,
|
||||
equip = '%s',
|
||||
state = %d;";
|
||||
//通过cid修改婚姻状态
|
||||
MARRY_SQL_LIST.ChangeMarryState <- "UPDATE zyk.marry SET state = %d WHERE cid = %d;";
|
||||
//新增礼堂信息
|
||||
MARRY_SQL_LIST.InsertMarryRoom <- @"INSERT INTO zyk.marry_room (cid, name, time, level, target_cid, target_name, state, rindex)
|
||||
VALUES (%d, '%s', %d, %d, %d, '%s', %d, %d);";
|
||||
|
||||
|
||||
//查询礼堂列表
|
||||
MARRY_SQL_LIST.GetAuditoriumList <- @"SELECT * FROM zyk.marry_room";
|
||||
|
||||
//根据cid查询自己的礼堂编号
|
||||
MARRY_SQL_LIST.GetAuditoriumIndexById <- @"SELECT target_cid FROM zyk.marry_room WHERE cid = %d";
|
||||
|
||||
//根据cid查询自己的礼堂编号
|
||||
MARRY_SQL_LIST.GetAuditoriumTimeById <- @"SELECT rindex FROM zyk.marry_room WHERE cid = %d";
|
||||
|
||||
MARRY_SQL_LIST.GetAuditoriumName2ById <- @"SELECT name FROM zyk.marry_room WHERE cid = %d or target_cid = %d";
|
||||
|
||||
MARRY_SQL_LIST.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";
|
||||
|
||||
//根据cid获取uid
|
||||
MARRY_SQL_LIST.GetUidByCid <- @"SELECT m_id FROM taiwan_caincharac_info WHERE charac_no = %d";
|
||||
593
Dps_A/ProjectClass/New_Hook.nut
Normal file
593
Dps_A/ProjectClass/New_Hook.nut
Normal file
@@ -0,0 +1,593 @@
|
||||
/*
|
||||
文件名:New_Hook.nut
|
||||
路径:Dps_A/New_Hook.nut
|
||||
创建日期:2024-09-23 20:15
|
||||
文件用途:后续新增的玩家需求的HOOK
|
||||
*/
|
||||
//通用HOOK入口函数
|
||||
function _Hook_Enter_Currency_Func_(args, TableObj) {
|
||||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
//通用HOOK出口函数
|
||||
function _Hook_Leave_Currency_Func_(args, TableObj) {
|
||||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
||||
//通用注册HOOK函数
|
||||
function _Hook_Register_Currency_Func_(AddressString, ArgRetArr, EnterTable, LeaveTable) {
|
||||
Haker.LoadHook(AddressString, ArgRetArr,
|
||||
function(args) {
|
||||
return _Hook_Enter_Currency_Func_(args, EnterTable);
|
||||
},
|
||||
function(args) {
|
||||
return _Hook_Leave_Currency_Func_(args, LeaveTable);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//玩家新增道具时
|
||||
Cb_User_Insert_Item_Enter_Func <- {};
|
||||
Cb_User_Insert_Item_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8502D86", ["pointer", "pointer", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "char", "int", "char", "char", "int"], Cb_User_Insert_Item_Enter_Func, Cb_User_Insert_Item_Leave_Func);
|
||||
|
||||
|
||||
//玩家捡起道具
|
||||
Cb_User_Get_Item_Enter_Func <- {};
|
||||
Cb_User_Get_Item_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x85B949C", ["pointer", "pointer", "int", "int", "int"], Cb_User_Get_Item_Enter_Func, Cb_User_Get_Item_Leave_Func);
|
||||
|
||||
//服务器Chat日志HOOK
|
||||
Cb_Server_Chat_Log_Enter_Func <- {};
|
||||
Cb_Server_Chat_Log_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x86C9638", ["pointer", "pointer", "char", "string", "char"], Cb_Server_Chat_Log_Enter_Func, Cb_Server_Chat_Log_Leave_Func);
|
||||
|
||||
//玩家上线设置IP
|
||||
Cb_User_Set_WebAddress_Enter_Func <- {};
|
||||
Cb_User_Set_WebAddress_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x84EC918", ["pointer", "pointer", "pointer"], Cb_User_Set_WebAddress_Enter_Func, Cb_User_Set_WebAddress_Leave_Func);
|
||||
|
||||
//服务端关闭执行函数
|
||||
Cb_Server_Close_Enter_Func <- {};
|
||||
Cb_Server_Close_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x829F28B", ["pointer", "pointer"], Cb_Server_Close_Enter_Func, Cb_Server_Close_Leave_Func);
|
||||
|
||||
//检查地下城的状况
|
||||
Cb_CheckInoutConditionDungeon_Enter_Func <- {};
|
||||
Cb_CheckInoutConditionDungeon_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x85ABC80", ["pointer", "pointer", "int", "int"], Cb_CheckInoutConditionDungeon_Enter_Func, Cb_CheckInoutConditionDungeon_Leave_Func);
|
||||
|
||||
//地下城现场杀死地狱党组怪物Cnt
|
||||
Cb_Field_KillHellPartyGroupMonsterCnt_Enter_Func <- {};
|
||||
Cb_Field_KillHellPartyGroupMonsterCnt_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x830D704", ["pointer", "pointer", "pointer", "bool"], Cb_Field_KillHellPartyGroupMonsterCnt_Enter_Func, Cb_Field_KillHellPartyGroupMonsterCnt_Leave_Func);
|
||||
|
||||
//经验收益
|
||||
Cb_Gain_Exp_Sp_Enter_Func <- {};
|
||||
Cb_Gain_Exp_Sp_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x866A3FE", ["pointer", "int", "int", "int", "int", "int", "char"], Cb_Gain_Exp_Sp_Enter_Func, Cb_Gain_Exp_Sp_Leave_Func);
|
||||
|
||||
|
||||
//货币收益
|
||||
Cb_Gain_Money_Enter_Func <- {};
|
||||
Cb_Gain_Money_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x84FF29C", ["pointer", "int", "char", "int", "int"], Cb_Gain_Money_Enter_Func, Cb_Gain_Money_Leave_Func);
|
||||
|
||||
//GetItem检查错误
|
||||
Cb_GetItem_Check_Error_Enter_Func <- {};
|
||||
Cb_GetItem_Check_Error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81C35AC", ["pointer", "pointer", "pointer", "int"], Cb_GetItem_Check_Error_Enter_Func, Cb_GetItem_Check_Error_Leave_Func);
|
||||
|
||||
//队伍清除副本
|
||||
Cb_ClearDungeon_Enter_Func <- {};
|
||||
Cb_ClearDungeon_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x85a9330", ["pointer", "void"], Cb_ClearDungeon_Enter_Func, Cb_ClearDungeon_Leave_Func);
|
||||
|
||||
//检查选择进入副本时状态
|
||||
Cb_SelectDungeon_Check_Error_Enter_Func <- {};
|
||||
Cb_SelectDungeon_Check_Error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81C7F32", ["pointer", "pointer", "pointer", "int"], Cb_SelectDungeon_Check_Error_Enter_Func, Cb_SelectDungeon_Check_Error_Leave_Func);
|
||||
|
||||
//切换装备
|
||||
Cb_CInventory_ChangeEquip_Enter_Func <- {};
|
||||
Cb_CInventory_ChangeEquip_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x84FC37E", ["pointer", "int", "pointer", "int"], Cb_CInventory_ChangeEquip_Enter_Func, Cb_CInventory_ChangeEquip_Leave_Func);
|
||||
|
||||
//获取通关时间回调
|
||||
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", "pointer"], 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_UseCoin_Enter_Func <- {};
|
||||
Cb_UseCoin_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81CA852", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_UseCoin_Enter_Func, Cb_UseCoin_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);
|
||||
|
||||
//深渊派对开始时
|
||||
Cb_HellPartyStart_dispatch_Enter_Func <- {};
|
||||
Cb_HellPartyStart_dispatch_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x821D9A6", ["pointer", "pointer", "int"], Cb_HellPartyStart_dispatch_Enter_Func, Cb_HellPartyStart_dispatch_Leave_Func);
|
||||
|
||||
//获取道具日志
|
||||
Cb_UserHistoryLog_ItemAdd_Enter_Func <- {};
|
||||
Cb_UserHistoryLog_ItemAdd_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8682E84", ["pointer", "int", "int", "int", "pointer", "int", "void"], Cb_UserHistoryLog_ItemAdd_Enter_Func, Cb_UserHistoryLog_ItemAdd_Leave_Func);
|
||||
|
||||
//获取绝望之塔进入次数
|
||||
Cb_TOD_UserState_getEnterCount_Enter_Func <- {};
|
||||
Cb_TOD_UserState_getEnterCount_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8643872", ["pointer", "int"], Cb_TOD_UserState_getEnterCount_Enter_Func, Cb_TOD_UserState_getEnterCount_Leave_Func);
|
||||
|
||||
|
||||
//掉落道具
|
||||
Cb_GetItemRarity_Enter_Func <- {};
|
||||
Cb_GetItemRarity_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8550BE4", ["pointer", "pointer", "int", "int", "int", ], Cb_GetItemRarity_Enter_Func, Cb_GetItemRarity_Leave_Func);
|
||||
|
||||
//怪物死亡爆奖励的时候
|
||||
Cb_dispatch_sig_Enter_Func <- {};
|
||||
Cb_dispatch_sig_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81EB0C4", ["pointer", "pointer", "pointer", "int"], Cb_dispatch_sig_Enter_Func, Cb_dispatch_sig_Leave_Func);
|
||||
|
||||
//装备解锁动作
|
||||
Cb_CItemLock_DoItemUnlock_Enter_Func <- {};
|
||||
Cb_CItemLock_DoItemUnlock_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x854231A", ["pointer", "pointer", "int", "int", "int"], Cb_CItemLock_DoItemUnlock_Enter_Func, Cb_CItemLock_DoItemUnlock_Leave_Func);
|
||||
|
||||
//丢弃物品检查错误
|
||||
Cb_DropItem_check_error_Enter_Func <- {};
|
||||
Cb_DropItem_check_error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81C2D9A", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_DropItem_check_error_Enter_Func, Cb_DropItem_check_error_Leave_Func);
|
||||
|
||||
//城镇瞬移
|
||||
Cb_GameWorld_move_area_Enter_Func <- {};
|
||||
Cb_GameWorld_move_area_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x086C5A84", ["pointer", "pointer", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int"], Cb_GameWorld_move_area_Enter_Func, Cb_GameWorld_move_area_Leave_Func);
|
||||
|
||||
|
||||
//称号回包
|
||||
Cb_CTitleBook_putItemData_Enter_Func <- {};
|
||||
Cb_CTitleBook_putItemData_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08641A6A", ["pointer", "pointer", "int", "pointer", "int"], Cb_CTitleBook_putItemData_Enter_Func, Cb_CTitleBook_putItemData_Leave_Func);
|
||||
|
||||
//设计图继承
|
||||
Cb_CUsercopyItemOption_Enter_Func <- {};
|
||||
Cb_CUsercopyItemOption_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08671EB2", ["pointer", "pointer", "pointer", "int"], Cb_CUsercopyItemOption_Enter_Func, Cb_CUsercopyItemOption_Leave_Func);
|
||||
|
||||
|
||||
//装备开孔
|
||||
Cb_AddSocketToAvatar_Enter_Func <- {};
|
||||
Cb_AddSocketToAvatar_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0821A412", ["pointer", "pointer", "pointer", "int"], Cb_AddSocketToAvatar_Enter_Func, Cb_AddSocketToAvatar_Leave_Func);
|
||||
|
||||
//装备镶嵌和时装镶嵌
|
||||
Cb_Dispatcher_UseJewel_Enter_Func <- {};
|
||||
Cb_Dispatcher_UseJewel_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8217BD6", ["int", "pointer", "pointer", "int"], Cb_Dispatcher_UseJewel_Enter_Func, Cb_Dispatcher_UseJewel_Leave_Func);
|
||||
|
||||
//额外数据包,发送装备镶嵌数据给本地处理
|
||||
Cb_InterfacePacketBuf_put_packet_Enter_Func <- {};
|
||||
Cb_InterfacePacketBuf_put_packet_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0815098e", ["pointer", "pointer", "int"], Cb_InterfacePacketBuf_put_packet_Enter_Func, Cb_InterfacePacketBuf_put_packet_Leave_Func);
|
||||
|
||||
|
||||
//额外数据包,发送装备镶嵌数据给本地处理
|
||||
Cb_PacketBuf_get_short_Enter_Func <- {};
|
||||
Cb_PacketBuf_get_short_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0858D0B0", ["pointer", "pointer", "int"], Cb_PacketBuf_get_short_Enter_Func, Cb_PacketBuf_get_short_Leave_Func);
|
||||
|
||||
|
||||
//公会普通信息回包
|
||||
Cb_MonitorNoticeGuildChatMsg_Enter_Func <- {};
|
||||
Cb_MonitorNoticeGuildChatMsg_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x084C9E30", ["pointer", "pointer", "pointer", "int"], Cb_MonitorNoticeGuildChatMsg_Enter_Func, Cb_MonitorNoticeGuildChatMsg_Leave_Func);
|
||||
|
||||
//公会超链接信息回包
|
||||
Cb_MonitorNoticeGuildChatMsgHyperLink_Enter_Func <- {};
|
||||
Cb_MonitorNoticeGuildChatMsgHyperLink_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x084E503C", ["pointer", "pointer", "pointer", "int"], Cb_MonitorNoticeGuildChatMsgHyperLink_Enter_Func, Cb_MonitorNoticeGuildChatMsgHyperLink_Leave_Func);
|
||||
|
||||
//检查移动技能槽位
|
||||
Cb_CheckMoveComboSkillSlot_Enter_Func <- {};
|
||||
Cb_CheckMoveComboSkillSlot_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08608C98", ["pointer", "char", "char", "bool"], Cb_CheckMoveComboSkillSlot_Enter_Func, Cb_CheckMoveComboSkillSlot_Leave_Func);
|
||||
|
||||
//检查插入快捷技能槽位
|
||||
Cb_CheckComboSkillInsertQuickSlot_Enter_Func <- {};
|
||||
Cb_CheckComboSkillInsertQuickSlot_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08608D58", ["pointer", "int", "bool"], Cb_CheckComboSkillInsertQuickSlot_Enter_Func, Cb_CheckComboSkillInsertQuickSlot_Leave_Func);
|
||||
|
||||
|
||||
//检查每日日程时间 提供者: ZZ
|
||||
Cb_User_CheckDailyScheduleTime_Enter_Func <- {};
|
||||
Cb_User_CheckDailyScheduleTime_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x846C0A8", ["int", "int", "int"], Cb_User_CheckDailyScheduleTime_Enter_Func, Cb_User_CheckDailyScheduleTime_Leave_Func);
|
||||
|
||||
//绝望之塔获取上次挑战时间 提供者: ZZ
|
||||
Cb_User_TOD_UserState_getLastClearTime_Enter_Func <- {};
|
||||
Cb_User_TOD_UserState_getLastClearTime_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x864387E", ["pointer"], Cb_User_TOD_UserState_getLastClearTime_Enter_Func, Cb_User_TOD_UserState_getLastClearTime_Leave_Func);
|
||||
|
||||
//时装填充 提供者: ZZ
|
||||
Cb_AradUseAvatarRecharge_Enter_Func <- {};
|
||||
Cb_AradUseAvatarRecharge_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0819FA56", ["pointer", "pointer", "pointer"], Cb_AradUseAvatarRecharge_Enter_Func, Cb_AradUseAvatarRecharge_Leave_Func);
|
||||
|
||||
//物品随机品级 提供者: 凌众
|
||||
Cb_CItem_IsRoutingItem_Enter_Func <- {};
|
||||
Cb_CItem_IsRoutingItem_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08150f18", ["pointer", "int"], Cb_CItem_IsRoutingItem_Enter_Func, Cb_CItem_IsRoutingItem_Leave_Func);
|
||||
|
||||
//调整箱使用 提供者: 凌众
|
||||
Cb_ModItemattr_Enter_Func <- {};
|
||||
Cb_ModItemattr_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8200B08", ["pointer", "pointer", "pointer", "int"], Cb_ModItemattr_Enter_Func, Cb_ModItemattr_Leave_Func);
|
||||
|
||||
|
||||
//个人金库整理
|
||||
Cb_CCargo_sort_Enter_Func <- {};
|
||||
Cb_CCargo_sort_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x850BD0C", ["pointer", "pointer"], Cb_CCargo_sort_Enter_Func, Cb_CCargo_sort_Leave_Func);
|
||||
|
||||
|
||||
|
||||
// 玩家断开链接时 提供者:南瓜
|
||||
Cb_CUser_LogoutToPCRoom_Enter_Func <- {};
|
||||
Cb_CUser_LogoutToPCRoom_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0868170C", ["pointer", "int"], Cb_CUser_LogoutToPCRoom_Enter_Func, Cb_CUser_LogoutToPCRoom_Leave_Func);
|
||||
|
||||
// 购买道具时的检查错误
|
||||
Cb_BuyItem_check_error_Enter_Func <- {};
|
||||
Cb_BuyItem_check_error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x081BE46A", ["pointer", "pointer", "pointer", "int"], Cb_BuyItem_check_error_Enter_Func, Cb_BuyItem_check_error_Leave_Func);
|
||||
|
||||
// 服务器被Kill时(不含炸频道等)
|
||||
Cb_Server_ClossByKill_Enter_Func <- {};
|
||||
Cb_Server_ClossByKill_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x082FE1FE", ["pointer", "int"], Cb_Server_ClossByKill_Enter_Func, Cb_Server_ClossByKill_Leave_Func);
|
||||
|
||||
|
||||
// 收到玩家聊天信息
|
||||
Cb_SendMess_Enter_Func <- {};
|
||||
Cb_SendMess_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x081F3540", ["pointer", "pointer", "pointer", "int"], Cb_SendMess_Enter_Func, Cb_SendMess_Leave_Func);
|
||||
|
||||
|
||||
// 副本数据 不公开
|
||||
Cb_CParty_ClearMapHitCount_Enter_Func <- {};
|
||||
Cb_CParty_ClearMapHitCount_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x085BF850", ["pointer", "pointer"], Cb_CParty_ClearMapHitCount_Enter_Func, Cb_CParty_ClearMapHitCount_Leave_Func);
|
||||
|
||||
|
||||
// 附魔
|
||||
Cb_ExpertOnEnchantByBead_Enter_Func <- {};
|
||||
Cb_ExpertOnEnchantByBead_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0849ED1A", ["pointer", "pointer", "int", "int", "int", "int", "int"], Cb_ExpertOnEnchantByBead_Enter_Func, Cb_ExpertOnEnchantByBead_Leave_Func);
|
||||
|
||||
// 数据库连接信息
|
||||
Cb_MySQL_Open_Enter_Func <- {};
|
||||
Cb_MySQL_Open_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x083F4024", ["pointer", "pointer", "int", "pointer", "pointer", "pointer", "int"], Cb_MySQL_Open_Enter_Func, Cb_MySQL_Open_Leave_Func);
|
||||
|
||||
|
||||
//地下城开始
|
||||
Cb_CParty_DungeonStart_Enter_Func <- {};
|
||||
Cb_CParty_DungeonStart_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x085A0954", ["pointer", "pointer", "char", "int", "int"], Cb_CParty_DungeonStart_Enter_Func, Cb_CParty_DungeonStart_Leave_Func);
|
||||
|
||||
//击杀怪物
|
||||
Cb_CParty_OnKillMonster_Enter_Func <- {};
|
||||
Cb_CParty_OnKillMonster_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x085B5A4C", ["pointer", "pointer", "int", "int", "int", "int"], Cb_CParty_OnKillMonster_Enter_Func, Cb_CParty_OnKillMonster_Leave_Func);
|
||||
|
||||
//设置通关奖励
|
||||
Cb_CParty_SetPlayResult_Enter_Func <- {};
|
||||
Cb_CParty_SetPlayResult_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x085B2412", ["pointer", "pointer", "int"], Cb_CParty_SetPlayResult_Enter_Func, Cb_CParty_SetPlayResult_Leave_Func);
|
||||
|
||||
// 进入副本接口时
|
||||
Cb_StartGame_check_error_Enter_Func <- {};
|
||||
Cb_StartGame_check_error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x081C9F6C", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_StartGame_check_error_Enter_Func, Cb_StartGame_check_error_Leave_Func);
|
||||
|
||||
// 强化装备时
|
||||
Cb_WongWork_CItemUpgrade_Enter_Func <- {};
|
||||
Cb_WongWork_CItemUpgrade_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0854755A", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_WongWork_CItemUpgrade_Enter_Func, Cb_WongWork_CItemUpgrade_Leave_Func);
|
||||
// 锻造装备时
|
||||
Cb_WongWork_CItemUpgrade_Separate_Enter_Func <- {};
|
||||
Cb_WongWork_CItemUpgrade_Separate_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0811E468", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_WongWork_CItemUpgrade_Separate_Enter_Func, Cb_WongWork_CItemUpgrade_Separate_Leave_Func);
|
||||
// 随机值
|
||||
Cb_CMTRand_randInt_Enter_Func <- {};
|
||||
Cb_CMTRand_randInt_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x080CBABE", ["pointer", "int", "int"], Cb_CMTRand_randInt_Enter_Func, Cb_CMTRand_randInt_Leave_Func);
|
||||
|
||||
// 发送绝望之塔APC
|
||||
Cb_TowerOfDespairMgr_SendAPCInfo_Enter_Func <- {};
|
||||
Cb_TowerOfDespairMgr_SendAPCInfo_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08644338", ["pointer", "pointer", "pointer", "void"], Cb_TowerOfDespairMgr_SendAPCInfo_Enter_Func, Cb_TowerOfDespairMgr_SendAPCInfo_Leave_Func);
|
||||
|
||||
// 发送多物品邮件请求
|
||||
Cb_ReqDBSendNewSystemMultiMail_Enter_Func <- {};
|
||||
Cb_ReqDBSendNewSystemMultiMail_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08556B68", ["pointer", "pointer", "int", "int", "int", "pointer", "int", "int", "int", "int", "int"], Cb_ReqDBSendNewSystemMultiMail_Enter_Func, Cb_ReqDBSendNewSystemMultiMail_Leave_Func);
|
||||
|
||||
// 深渊爆率
|
||||
Cb_WongWork_CMonsterDrop_Hell_Enter_Func <- {};
|
||||
Cb_WongWork_CMonsterDrop_Hell_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08535726", ["pointer", "pointer", "pointer", "pointer"], Cb_WongWork_CMonsterDrop_Hell_Enter_Func, Cb_WongWork_CMonsterDrop_Hell_Leave_Func);
|
||||
|
||||
//检查装备是否上锁
|
||||
Cb_CheckItemLock_Enter_Func <- {};
|
||||
Cb_CheckItemLock_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08646942", ["pointer", "int", "int", "bool"], Cb_CheckItemLock_Enter_Func, Cb_CheckItemLock_Leave_Func);
|
||||
|
||||
//reform_ui_group_no
|
||||
Cb_reform_ui_group_no_Enter_Func <- {};
|
||||
Cb_reform_ui_group_no_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x083507E8", ["pointer", "pointer", "bool", "int", "int"], Cb_reform_ui_group_no_Enter_Func, Cb_reform_ui_group_no_Leave_Func);
|
||||
|
||||
//get_skillslot_group
|
||||
Cb_get_skillslot_group_Enter_Func <- {};
|
||||
Cb_get_skillslot_group_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x086049FC", ["pointer", "int", "int"], Cb_get_skillslot_group_Enter_Func, Cb_get_skillslot_group_Leave_Func);
|
||||
|
||||
//get_skillslot_no
|
||||
Cb_get_skillslot_no_Enter_Func <- {};
|
||||
Cb_get_skillslot_no_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08604A86", ["pointer", "int", "int", "int", "char", "int"], Cb_get_skillslot_no_Enter_Func, Cb_get_skillslot_no_Leave_Func);
|
||||
|
||||
//get_skillslot_no2
|
||||
Cb_get_skillslot_no2_Enter_Func <- {};
|
||||
Cb_get_skillslot_no2_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08607DBA", ["pointer", "pointer", "int", "int", "bool", "int"], Cb_get_skillslot_no2_Enter_Func, Cb_get_skillslot_no2_Leave_Func);
|
||||
231
Dps_A/ProjectClass/NpcTransaction/NpcTransaction.nut
Normal file
231
Dps_A/ProjectClass/NpcTransaction/NpcTransaction.nut
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
文件名:NpcTransaction.nut
|
||||
路径:Dps_A/ProjectClass/NpcTransaction/NpcTransaction.nut
|
||||
创建日期:2025-10-23 14:37
|
||||
文件用途:
|
||||
*/
|
||||
return;
|
||||
class NpcTransaction {
|
||||
|
||||
//装备价值
|
||||
EquValue = null;
|
||||
//品级装备组
|
||||
EquGroup = null;
|
||||
//金币易物浮动比例
|
||||
GoldFloat = 0.5;
|
||||
//最低交换品级
|
||||
MinRarity = 0;
|
||||
//交易消耗物品
|
||||
TradeItem = null;
|
||||
|
||||
//装备易物浮动等级
|
||||
EquFloatMin = 5;
|
||||
EquFloatMax = 5;
|
||||
|
||||
//事件概率
|
||||
EventRate = null;
|
||||
|
||||
//用户状态表
|
||||
UserState = null;
|
||||
|
||||
|
||||
|
||||
constructor() {
|
||||
//注册客户端收包
|
||||
RegisterClient();
|
||||
EquValue = {};
|
||||
UserState = {};
|
||||
EquGroup = [{}, {}, {}, {}, {}, {}, {}, {}];
|
||||
|
||||
//读取PVF
|
||||
InitPvf();
|
||||
}
|
||||
|
||||
|
||||
function RegisterClient() {
|
||||
|
||||
ClientSocketPackFuncMap.rawset(21005001, function(SUser, Jso) {
|
||||
local lastTime = GetTransactionInfo(SUser, Jso);
|
||||
if (lastTime && Sq_GetTimestampString().slice(-9).tointeger() - lastTime.time< 3600000) {
|
||||
local T = {
|
||||
op = 21005002,
|
||||
flag = 3
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
return;
|
||||
}
|
||||
local InvenObj = SUser.GetInven();
|
||||
local Equ = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 9 + Jso.pos);
|
||||
if (Equ) {
|
||||
local EquId = Equ.GetIndex();
|
||||
if (EquId) {
|
||||
local equ = PvfItem.GetPvfItemById(EquId);
|
||||
local Rarity = equ.GetRarity();
|
||||
local Level = equ.GetUsableLevel();
|
||||
//判断是否解封装
|
||||
local CanTrade = GetTrade(InvenObj, Jso.pos);
|
||||
if ((Rarity == 2 || Rarity == 3) && CanTrade == 1) {
|
||||
local T = {
|
||||
op = 21005006,
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
SUser.SendNotiPacketMessage("该装备属于封装装备,并已解封,无法进行交易!", 0);
|
||||
} else {
|
||||
//判断是进行什么交易逻辑
|
||||
local Random = MathClass.Rand(600, 1000);
|
||||
//嘲讽
|
||||
if (Random <= EventRate[0]) {
|
||||
local T = {
|
||||
op = 21005002,
|
||||
flag = 0
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
|
||||
local Cid = SUser.GetCID();
|
||||
if (!UserState.rawin(Cid)) UserState[Cid] <- {};
|
||||
UserState[Cid].rawset(Jso.npc, {
|
||||
time = Sq_GetTimestampString().slice(-9).tointeger()
|
||||
});
|
||||
}
|
||||
//金币易物
|
||||
else if (Random <= EventRate[1]) {
|
||||
local thGoldFloat = MathClass.Rand(-EquValue[EquId].tofloat() * GoldFloat, EquValue[EquId].tofloat() * GoldFloat);
|
||||
local Glod = EquValue[EquId].tofloat() + thGoldFloat;
|
||||
local T = {
|
||||
op = 21005002,
|
||||
flag = 1,
|
||||
glod = Glod
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
|
||||
local Cid = SUser.GetCID();
|
||||
if (!UserState.rawin(Cid)) UserState[Cid] <- {};
|
||||
UserState[Cid].rawset(Jso.npc, {
|
||||
glod = Glod,
|
||||
pos = Jso.pos,
|
||||
oldid = EquId
|
||||
time = Sq_GetTimestampString().slice(-9).tointeger()
|
||||
});
|
||||
}
|
||||
//装备易物
|
||||
else if (Random <= EventRate[2]) {
|
||||
local setarr = [];
|
||||
local findtable = EquGroup[Rarity];
|
||||
foreach(index, level in findtable) {
|
||||
if (level >= Level - EquFloatMin && level <= Level + EquFloatMax) {
|
||||
setarr.append(index);
|
||||
}
|
||||
}
|
||||
|
||||
local SendId = setarr[MathClass.Rand(0, setarr.len() - 1)];
|
||||
local T = {
|
||||
op = 21005002,
|
||||
flag = 2,
|
||||
equ = SendId
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
|
||||
local Cid = SUser.GetCID();
|
||||
if (!UserState.rawin(Cid)) UserState[Cid] <- {};
|
||||
UserState[Cid].rawset(Jso.npc, {
|
||||
equ = SendId,
|
||||
pos = Jso.pos,
|
||||
oldid = EquId
|
||||
time = Sq_GetTimestampString().slice(-9).tointeger()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
ClientSocketPackFuncMap.rawset(21005003, function(SUser, Jso) {
|
||||
//获取交易结构体
|
||||
local Info = GetTransactionInfo(SUser, Jso);
|
||||
if (!Info) return;
|
||||
//获取旧装备ID
|
||||
local oldid = Info.oldid;
|
||||
//获取旧装备格子
|
||||
local pos = Info.pos;
|
||||
//检测扣除
|
||||
local InvenObj = SUser.GetInven();
|
||||
local Equ = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 9 + Info.pos);
|
||||
if (Equ.GetIndex() != oldid) {
|
||||
SUser.SendNotiBox("交易时请不要移动背包中装备的位置!", 1);
|
||||
return;
|
||||
}
|
||||
Equ.Delete();
|
||||
|
||||
if (Info.rawin("equ")) {
|
||||
SUser.GiveItem(Info.equ, 1);
|
||||
SUser.SendNotiBox("与NPC交易获得装备 [" + PvfItem.GetNameById(Info.equ) + "]", 1);
|
||||
} else if (Info.rawin("glod")) {
|
||||
SUser.RechargeMoney(Info.glod);
|
||||
SUser.SendNotiBox("与NPC交易获得金币: " + Info.glod, 1);
|
||||
}
|
||||
SUser.SendItemSpace(0);
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
function GetTransactionInfo(SUser, Jso) {
|
||||
try {
|
||||
local Info = UserState[SUser.GetCID()][Jso.npc];
|
||||
return Info;
|
||||
} catch (exception) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
function InitPvf() {
|
||||
Script();
|
||||
ScriptData.GetFileData("etc/rindro/npctransaction/npctransaction.etc", function(DataTable, Data) {
|
||||
while (!Data.Eof()) {
|
||||
local Fragment = Data.Get();
|
||||
if (Fragment == "[value]") {
|
||||
while (true) {
|
||||
local Fbuf = Data.Get();
|
||||
if (Fbuf == "[/value]") {
|
||||
break;
|
||||
}
|
||||
local Value = Data.Get();
|
||||
EquValue.rawset(Fbuf, Value);
|
||||
//读取装备品级
|
||||
local equ = PvfItem.GetPvfItemById(Fbuf);
|
||||
local Rarity = equ.GetRarity();
|
||||
local Level = equ.GetUsableLevel();
|
||||
EquGroup[Rarity].rawset(Fbuf, Level);
|
||||
}
|
||||
} else if (Fragment == "[random]") {
|
||||
GoldFloat = Data.Get().tofloat() / 100.0;
|
||||
} else if (Fragment == "[allow rarity]") {
|
||||
MinRarity = Data.Get();
|
||||
} else if (Fragment == "[exchange cost item]") {
|
||||
TradeItem = {
|
||||
item = Data.Get(),
|
||||
count = Data.Get()
|
||||
}
|
||||
} else if (Fragment == "[equipment random level lower]") {
|
||||
EquFloatMin = Data.Get();
|
||||
} else if (Fragment == "[equipment random level upper]") {
|
||||
EquFloatMax = Data.Get();
|
||||
} else if (Fragment == "[event rate]") {
|
||||
local o1 = Data.Get();
|
||||
local o2 = Data.Get();
|
||||
local o3 = Data.Get();
|
||||
|
||||
EventRate = [o1, o1 + o2, o1 + o2 + o3];
|
||||
}
|
||||
}
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
function GetTrade(InvenObj, pos) {
|
||||
local ptr = Memory.alloc(10240);
|
||||
Sq_CallFunc(S_Ptr("0x084FB918"), "int", ["pointer", "pointer", "int", "int"], ptr.C_Object, InvenObj.C_Object, 1, pos);
|
||||
return ptr.readS8();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_NpcTransaction <- NpcTransaction();
|
||||
103
Dps_A/ProjectClass/TH_CombatRank/TH_CombatRank.nut
Normal file
103
Dps_A/ProjectClass/TH_CombatRank/TH_CombatRank.nut
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
文件名:TH_CombatRank.nut
|
||||
路径:Dps_A/ProjectClass/TH_CombatRank/TH_CombatRank.nut
|
||||
创建日期:2025-07-02 23:22
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
|
||||
class TH_CombatRank {
|
||||
|
||||
MysqlObject = null;
|
||||
|
||||
constructor() {
|
||||
|
||||
MysqlObject = Mysql(Str_Ptr("127.0.0.1"), 3306, Str_Ptr("taiwan_cain"), Str_Ptr("game"), Str_Ptr("uu5!^%jg"));
|
||||
MysqlObject.Exec_Sql(format("SET NAMES %s", "latin1"));
|
||||
|
||||
|
||||
//注册客户端收包
|
||||
RegisterClient();
|
||||
//注册调试命令
|
||||
// RegisterDebugCmd();
|
||||
|
||||
|
||||
//建表命令
|
||||
MysqlObject.Select("CREATE TABLE `zyk`.`th_combatrank` ( `cid` int NOT NULL, `equip` varbinary(512) NULL COMMENT '装备数组', `basecombat` int NULL COMMENT '基础战力', `fstonecombat` int NULL COMMENT '魂石战力', PRIMARY KEY (`cid`));", []);
|
||||
}
|
||||
|
||||
function RegisterClient() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function RegisterDebugCmd() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_TH_CombatRank <- TH_CombatRank();
|
||||
@@ -31,4 +31,30 @@ enum RETTYPE {
|
||||
function printT(T)
|
||||
{
|
||||
Sq_OutPutTable(Json.Encode(T));
|
||||
}
|
||||
|
||||
function LoadConfig(Path)
|
||||
{
|
||||
dofile("/dp_s/" + Path);
|
||||
}
|
||||
|
||||
if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329) {
|
||||
function print(Object) {
|
||||
switch (typeof Object) {
|
||||
case "table":
|
||||
case "array": {
|
||||
local str = Json.Encode(Object);
|
||||
Sq_OutPutTable(str);
|
||||
break;
|
||||
}
|
||||
case "string":
|
||||
case "integer": {
|
||||
output(Object);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
output(Object);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
218
Dps_A/main.nut
218
Dps_A/main.nut
@@ -3,8 +3,17 @@ getroottable().DebugModelFlag <- false;
|
||||
function InitPluginInfo() {
|
||||
//初始化定时器
|
||||
_Timer_Object <- Timer();
|
||||
//初始化自动重载
|
||||
GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||
|
||||
|
||||
|
||||
//初始化自动重载 只在15线开启
|
||||
local ConfigPath = Sq_Game_GetConfig();
|
||||
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
|
||||
// if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||
if (Channel.find("15")) {
|
||||
GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||
GameManager.OpenHotFix("/dp_s/MyProject");
|
||||
}
|
||||
|
||||
local PoolObj = MysqlPool.GetInstance();
|
||||
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||
@@ -13,19 +22,46 @@ function InitPluginInfo() {
|
||||
//初始化
|
||||
PoolObj.Init();
|
||||
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
GameManager.Fix14Skill();
|
||||
|
||||
//建库
|
||||
SqlObj.Select("create database if not exists frida default charset utf8;", []);
|
||||
// Sq_CreatSocketConnect("192.168.200.20", "65109");
|
||||
// Sq_CreatSocketConnect("49.234.27.222", "65109");
|
||||
Sq_CreatSocketConnect("127.0.0.1", "65109");
|
||||
|
||||
SqlObj.Select("CREATE TABLE `frida`.`setCharacSlotLimit` (`account_id` INT NOT NULL,`slot` INT NOT NULL DEFAULT 2,PRIMARY KEY (`account_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;", []);
|
||||
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
//初始化结婚
|
||||
// ProjectInitFuncMap.P_Marry <- Marry();
|
||||
|
||||
|
||||
//初始化日志器
|
||||
Log({
|
||||
"normal": "/dp_s/log/normal.log",
|
||||
"error": "/dp_s/log/error.log"
|
||||
});
|
||||
//调用方式
|
||||
//Log.Put("normal", "测试日志");
|
||||
//Log.Put("error", "测试错误日志");
|
||||
|
||||
GameManager.OpenCreateJob_CreatorMage();
|
||||
GameManager.FixPracticemode();
|
||||
GameManager.SetGameMaxLevel(85);
|
||||
|
||||
|
||||
// function IndependenceDropLogic(SUser, MonsterId, MonsterLevel, Xpos, Ypos, DgnName, DgnId, DgnLevel,DgnDiff, HellDiff)
|
||||
// {
|
||||
// //注意这里组队时每一个队员都会调用一次这个函数
|
||||
|
||||
// //如果角色名字为游戏管理员 掉落3037
|
||||
// if(SUser.GetCharacName() == "游戏管理员")
|
||||
// SUser.DropItem(3037, Xpos, Ypos);
|
||||
// //如果怪物ID 为 1 掉落 3038
|
||||
// if(MonsterId == 1)
|
||||
// SUser.DropItem(3038, Xpos, Ypos);
|
||||
// }
|
||||
|
||||
// GameManager.OpenIndependenceDropMode(IndependenceDropLogic);
|
||||
GameManager.FixEmailRemovalVerification();
|
||||
|
||||
// Sq_CreatCConnectPool(2, 4, "127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||
Sq_CreatSocketConnect("192.168.200.24", "65109");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,18 +70,174 @@ function PrintTag() {
|
||||
print(InitSuccessTag);
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
|
||||
function main() {
|
||||
InitPluginInfo();
|
||||
|
||||
PrintTag();
|
||||
|
||||
//读取全部配置文件
|
||||
|
||||
|
||||
GameManager.SetGameMaxLevel(95);
|
||||
// GameManager.FixAvatarUseJewel();
|
||||
GameManager.FixSaveTown();
|
||||
GameManager.FixDespairGold();
|
||||
GameManager.FixGlodTradeDaily(80000000);
|
||||
|
||||
local PvfObject = Script();
|
||||
// local Data = ScriptData.GetEquipment(305014);
|
||||
// printT(Data);
|
||||
|
||||
// Sq_Conversion("這是一個繁體字符串");
|
||||
|
||||
|
||||
_Official_Project_();
|
||||
|
||||
}
|
||||
|
||||
// if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329) {
|
||||
// function _Rindro_OldLogic_Enter(CUser, PacketId, PacketSrc) {
|
||||
|
||||
// //区域移动
|
||||
// if (PacketId == 38) {
|
||||
// local Ret = Cb_move_area(CUser, NativePointer(PacketSrc).add(0x0D).readU8(), NativePointer(PacketSrc).add(0x0E).readU8());
|
||||
// if (!Ret) {
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
// //普通输入
|
||||
// else if (PacketId == 17) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// local Size = NativePointer(PacketSrc).add(20).readInt();
|
||||
// local Str = NativePointer(PacketSrc).add(24).readUtf8String(Size);
|
||||
// Cb_base_input(CUser, Str);
|
||||
// }, 1);
|
||||
// }
|
||||
// //GM输入
|
||||
// else if (PacketId == 179) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// local Size = NativePointer(PacketSrc).add(13).readInt();
|
||||
// local Str = NativePointer(PacketSrc).add(17).readUtf8String(Size);
|
||||
// Cb_gm_input(CUser, Str.slice(2));
|
||||
// }, 1);
|
||||
// }
|
||||
// //特殊道具使用
|
||||
// else if (PacketId == 255) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// Cb_use_item_sp(CUser, NativePointer(PacketSrc).add(0x0D).readInt());
|
||||
// }, 1);
|
||||
// }
|
||||
// //返回选择角色
|
||||
// else if (PacketId == 7) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// Cb_return_select_character(CUser);
|
||||
// }, 1);
|
||||
// }
|
||||
// //组队 创建和加入
|
||||
// else if (PacketId == 10) {
|
||||
// local Ret = Cb_userpartycreate(CUser);
|
||||
// if (!Ret) {
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
// //下线
|
||||
// else if (PacketId == 3) {
|
||||
// Timer.SetTimeOut(function() {
|
||||
// Cb_player_exit(CUser);
|
||||
// }, 1);
|
||||
// }
|
||||
// // //查看信息
|
||||
// // else if (PacketId == 8) {
|
||||
// // Cb_see_information(CUser, PacketSrc);
|
||||
// // }
|
||||
// //自定义包
|
||||
// else if (PacketId == 130) {
|
||||
|
||||
// Timer.SetTimeOut(function() {
|
||||
// OnClientSocketMsg(CUser, Str);
|
||||
// }, 1);
|
||||
// }
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
// function _Rindro_OldLogic_Leave(CUser, PacketId, PacketSrc) {
|
||||
// //更换装备
|
||||
// if (PacketId == 19) {
|
||||
// Cb_player_chanage_equ(CUser);
|
||||
// }
|
||||
// //组队 同意组队和同意加入
|
||||
// else if (PacketId == 11) {
|
||||
// Cb_userpartyagree(CUser);
|
||||
// }
|
||||
// //组队 退出队伍
|
||||
// else if (PacketId == 13) {
|
||||
// Cb_userpartyexit(CUser);
|
||||
// }
|
||||
// //组队 踢出队伍
|
||||
// else if (PacketId == 14) {
|
||||
// Cb_userpartykick(CUser);
|
||||
// }
|
||||
// //组队 委任队长
|
||||
// else if (PacketId == 124) {
|
||||
// Cb_userpartygivemaster(CUser);
|
||||
// }
|
||||
// return null;
|
||||
// };
|
||||
|
||||
// Haker.LoadHook("0x08594E52", ["pointer", "int", "pointer", "int", "int"],
|
||||
// function(args) {
|
||||
// local CallArr = [];
|
||||
// local v4 = Sq_CallFunc(S_Ptr("0x080CC18E"), "pointer", []);
|
||||
// local cuser = Sq_CallFunc(S_Ptr("0x082947A4"), "pointer", ["pointer", "int"], v4, args[1]);
|
||||
// if (!cuser) return;
|
||||
// local PacketId = NativePointer(args[2]).add(1).readShort();
|
||||
// local Ret = _Rindro_OldLogic_Enter(cuser, PacketId, args[2]);
|
||||
// if (Ret == -1) {
|
||||
// NativePointer(args[2]).add(1).writeShort(-1);
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// function(args) {
|
||||
// local CallArr = [];
|
||||
// local v4 = Sq_CallFunc(S_Ptr("0x080CC18E"), "pointer", []);
|
||||
// local cuser = Sq_CallFunc(S_Ptr("0x082947A4"), "pointer", ["pointer", "int"], v4, args[1]);
|
||||
// if (!cuser) return;
|
||||
// local PacketId = NativePointer(args[2]).add(1).readShort();
|
||||
// Timer.SetTimeOut(function() {
|
||||
// _Rindro_OldLogic_Leave(cuser, PacketId, args[2]);
|
||||
// }, 1);
|
||||
// return null;
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
|
||||
/*
|
||||
function onil() {
|
||||
print(11);
|
||||
local T = {
|
||||
op = 20065005,
|
||||
uid = 0,
|
||||
cid = 0
|
||||
}
|
||||
local WorldMap = World.GetOnlinePlayer();
|
||||
foreach(W_User in WorldMap) {
|
||||
T.uid = W_User.GetUniqueId();
|
||||
T.cid = W_User.GetCID();
|
||||
Socket.SendGateway(T);
|
||||
}
|
||||
}
|
||||
|
||||
Timer.SetCronTask(onil, "0/10 * * * * *");
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// getroottable().CombatRankServerProject <- CombatRank();
|
||||
// getroottable().ServerControlProject <- ServerControl();
|
||||
// getroottable().AntonServerProject <- Anton();
|
||||
// getroottable().FiendwarServerProject <- Fiendwar();
|
||||
// getroottable().FiendwarServerProject <- Fiendwar();
|
||||
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ foreach(_ItemId, baseInfo in TW_StkUpJTable) {
|
||||
if (SlotItem.GetType() != "装备") {
|
||||
local SlotCount = SlotItem.GetAdd_Info();
|
||||
local GiveRate = floor(SlotCount.tofloat() / Info.Stk.Count.tofloat());
|
||||
if(GiveRate < 1){
|
||||
if (GiveRate< 1) {
|
||||
SUser.SendNotiPacketMessage(format(TW_STR_00084), 8);
|
||||
return false;
|
||||
}
|
||||
@@ -1563,7 +1563,7 @@ Cb_timer_dispatch_Func["TW_Cb_timer_dispatch_Func"] <- function() {
|
||||
if (mitems.len() > 0) {
|
||||
SUser.SendMail(mitems, {
|
||||
Title = TW_STR_00001,
|
||||
Text = TW_STR_00002
|
||||
Text = TW_STR_0000
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
/*
|
||||
文件名:New_Hook.nut
|
||||
路径:Dps_A/New_Hook.nut
|
||||
创建日期:2024-09-23 20:15
|
||||
文件用途:后续新增的玩家需求的HOOK
|
||||
*/
|
||||
//通用HOOK入口函数
|
||||
function _Hook_Enter_Currency_Func_(args, TableObj) {
|
||||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
//通用HOOK出口函数
|
||||
function _Hook_Leave_Currency_Func_(args, TableObj) {
|
||||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
||||
//通用注册HOOK函数
|
||||
function _Hook_Register_Currency_Func_(AddressString, ArgRetArr, EnterTable, LeaveTable) {
|
||||
Haker.LoadHook(AddressString, ArgRetArr,
|
||||
function(args) {
|
||||
return _Hook_Enter_Currency_Func_(args, EnterTable);
|
||||
},
|
||||
function(args) {
|
||||
return _Hook_Leave_Currency_Func_(args, LeaveTable);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//玩家新增道具时
|
||||
Cb_User_Insert_Item_Enter_Func <- {};
|
||||
Cb_User_Insert_Item_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x8502D86", ["pointer", "pointer", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "char", "int", "char", "char", "int"], Cb_User_Insert_Item_Enter_Func, Cb_User_Insert_Item_Leave_Func);
|
||||
|
||||
|
||||
//玩家捡起道具
|
||||
Cb_User_Get_Item_Enter_Func <- {};
|
||||
Cb_User_Get_Item_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x85B949C", ["pointer", "pointer", "int", "int", "int"], Cb_User_Get_Item_Enter_Func, Cb_User_Get_Item_Leave_Func);
|
||||
|
||||
//服务器Chat日志HOOK
|
||||
Cb_Server_Chat_Log_Enter_Func <- {};
|
||||
Cb_Server_Chat_Log_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x86C9638", ["pointer", "pointer", "char", "string", "char"], Cb_Server_Chat_Log_Enter_Func, Cb_Server_Chat_Log_Leave_Func);
|
||||
|
||||
//玩家上线设置IP
|
||||
Cb_User_Set_WebAddress_Enter_Func <- {};
|
||||
Cb_User_Set_WebAddress_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x84EC918", ["pointer", "pointer", "pointer"], Cb_User_Set_WebAddress_Enter_Func, Cb_User_Set_WebAddress_Leave_Func);
|
||||
|
||||
//服务端关闭执行函数
|
||||
Cb_Server_Close_Enter_Func <- {};
|
||||
Cb_Server_Close_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x829F28B", ["pointer", "pointer"], Cb_Server_Close_Enter_Func, Cb_Server_Close_Leave_Func);
|
||||
|
||||
//检查地下城的状况
|
||||
Cb_CheckInoutConditionDungeon_Enter_Func <- {};
|
||||
Cb_CheckInoutConditionDungeon_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x85ABC80", ["pointer", "pointer", "int", "int"], Cb_CheckInoutConditionDungeon_Enter_Func, Cb_CheckInoutConditionDungeon_Leave_Func);
|
||||
|
||||
//地下城现场杀死地狱党组怪物Cnt
|
||||
Cb_Field_KillHellPartyGroupMonsterCnt_Enter_Func <- {};
|
||||
Cb_Field_KillHellPartyGroupMonsterCnt_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x830D704", ["pointer", "pointer", "pointer", "bool"], Cb_Field_KillHellPartyGroupMonsterCnt_Enter_Func, Cb_Field_KillHellPartyGroupMonsterCnt_Leave_Func);
|
||||
|
||||
//经验收益
|
||||
Cb_Gain_Exp_Sp_Enter_Func <- {};
|
||||
Cb_Gain_Exp_Sp_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x866A3FE", ["pointer", "int", "int", "int", "int", "int", "char"], Cb_Gain_Exp_Sp_Enter_Func, Cb_Gain_Exp_Sp_Leave_Func);
|
||||
|
||||
|
||||
//货币收益
|
||||
Cb_Gain_Money_Enter_Func <- {};
|
||||
Cb_Gain_Money_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x84FF29C", ["int", "int", "char", "int", "int"], Cb_Gain_Money_Enter_Func, Cb_Gain_Money_Leave_Func);
|
||||
|
||||
//GetItem检查错误
|
||||
Cb_GetItem_Check_Error_Enter_Func <- {};
|
||||
Cb_GetItem_Check_Error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81C35AC", ["pointer", "pointer", "pointer", "int"], Cb_GetItem_Check_Error_Enter_Func, Cb_GetItem_Check_Error_Leave_Func);
|
||||
|
||||
//队伍清除副本
|
||||
Cb_ClearDungeon_Enter_Func <- {};
|
||||
Cb_ClearDungeon_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x85a9330", ["pointer", "void"], Cb_ClearDungeon_Enter_Func, Cb_ClearDungeon_Leave_Func);
|
||||
|
||||
//检查选择进入副本时状态
|
||||
Cb_SelectDungeon_Check_Error_Enter_Func <- {};
|
||||
Cb_SelectDungeon_Check_Error_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x81C7F32", ["pointer", "pointer", "pointer", "int"], Cb_SelectDungeon_Check_Error_Enter_Func, Cb_SelectDungeon_Check_Error_Leave_Func);
|
||||
|
||||
//切换装备
|
||||
Cb_CInventory_ChangeEquip_Enter_Func <- {};
|
||||
Cb_CInventory_ChangeEquip_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x84FC37E", ["pointer", "int", "pointer", "int"], Cb_CInventory_ChangeEquip_Enter_Func, Cb_CInventory_ChangeEquip_Leave_Func);
|
||||
|
||||
//获取通关时间回调
|
||||
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);
|
||||
14
Main.nut
Normal file
14
Main.nut
Normal file
@@ -0,0 +1,14 @@
|
||||
function sqr_main() {
|
||||
GameManager.OpenHotFix("/dp_s/OfficialConfig");
|
||||
GameManager.OpenHotFix("/dp_s/MyProject");
|
||||
// GameManager.SetGameMaxLevel(70);
|
||||
// Cb_History_MileageSet_Func["TW_reach_game_world"] <- function(SUser, Data) {
|
||||
// //第一次上线
|
||||
// if (SUser.GetCharacLevel() > 70) {
|
||||
// SUser.SetCharacLevel(70);
|
||||
// SUser.SendItemSpace(0);
|
||||
// SUser.SendItemSpace(1);
|
||||
// SUser.SendItemSpace(7);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
6
MyProject/A.nut
Normal file
6
MyProject/A.nut
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
_Dps_SetInitiaweapon_Main_();
|
||||
}, 1)
|
||||
54
MyProject/史诗药剂.nut
Normal file
54
MyProject/史诗药剂.nut
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
文件名:史诗药剂.nut
|
||||
路径:MyProject/史诗药剂.nut
|
||||
创建日期:2025-03-28 10:21
|
||||
文件用途:史诗药剂
|
||||
*/
|
||||
|
||||
//➢SS药剂的ID
|
||||
EpicPotionID <- 2600006;
|
||||
//➢默认的药剂增加倍率
|
||||
EpicPotionOdds <- 0.1;
|
||||
//➢指定玩家增加深渊爆率
|
||||
EpicPotionlist <- {};
|
||||
//角色ID:增加个人深渊爆率
|
||||
EpicPotionlist[1] <- 1;
|
||||
|
||||
|
||||
Cb_GetItemRarity_Enter_Func["史诗药剂_逻辑"] <- function(args) {
|
||||
local Addr = NativePointer(args[0]);
|
||||
local VectorSize = (Addr.add(4).readU32() - Addr.readU32()) / 4;
|
||||
// 遍历队伍成员,找到使用了史诗药剂的玩家
|
||||
local userWithPotion = null;
|
||||
for (local i = 0; i< VectorSize; i++) {
|
||||
local elementAddr = NativePointer(Addr.readPointer()).add(i * 4);
|
||||
local user = elementAddr.readPointer();
|
||||
if (user && Sq_CallFunc(S_Ptr("0x865E994"), "int", ["pointer", "int", ], user, EpicPotionID) ) {
|
||||
userWithPotion = User(user);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (userWithPotion && Haker.NextReturnAddress == "0x853583a") {
|
||||
local partyobj = userWithPotion.GetParty();
|
||||
// 检查是否单人
|
||||
if (Sq_CallFunc(S_Ptr("0x0859A16A"), "int", ["pointer"], partyobj.C_Object) == 1) {
|
||||
local MaxRoll = NativePointer(args[1]).add(16).readU32();
|
||||
local odds = EpicPotionOdds; // 默认药剂的增加几率
|
||||
// 检查是否VIP玩家
|
||||
local charac_no = userWithPotion.GetCID();
|
||||
if (EpicPotionlist.rawin(charac_no)) {
|
||||
odds = EpicPotionlist[charac_no];
|
||||
}
|
||||
// 计算新的roll值
|
||||
args[2] = MathClass.getMin(args[2] + args[2] * odds, MaxRoll);
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["okok"] <- function(SUser, cmd) {
|
||||
|
||||
SUser.SendNotiPacketMessage("出纳上asdasdasda到几点方柏霓撒娇扩大年级卡萨", 7);
|
||||
}
|
||||
24
OfficialConfig/N_定制_烟花PK道具.json
Normal file
24
OfficialConfig/N_定制_烟花PK道具.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"烟花道具ID": 7577,
|
||||
"提示1": "很遗憾,您没有获得任何物品",
|
||||
"提示2": "获得周年庆爆竹奖励 [%s]",
|
||||
"提示1类型": 1,
|
||||
"提示2类型": 1,
|
||||
"道具列表": [
|
||||
{
|
||||
"itemId": 3037,
|
||||
"count": 10,
|
||||
"probability": 100
|
||||
},{
|
||||
"itemId": 3038,
|
||||
"count": 20,
|
||||
"probability": 100
|
||||
},
|
||||
{
|
||||
"itemId": null,
|
||||
"count": 20,
|
||||
"probability": 100
|
||||
}
|
||||
],
|
||||
"PK经验道具ID": 7576
|
||||
}
|
||||
8
OfficialConfig/全职业通用转职书_Lenheart.json
Normal file
8
OfficialConfig/全职业通用转职书_Lenheart.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"转职初始职业":[7577],
|
||||
"转职第一职业":[7577],
|
||||
"转职第二职业":[7577],
|
||||
"转职第三职业":[7577],
|
||||
"转职第四职业":[7577],
|
||||
"转职第五职业":[7577]
|
||||
}
|
||||
18
OfficialConfig/副本播报配置_Nangua.json
Normal file
18
OfficialConfig/副本播报配置_Nangua.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"副本播报开关(true开启,false关闭)":true,
|
||||
"不需要播报的副本ID(实例中的ID为怪物攻城的副本ID尽量不要删)":[20002, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009, 20010, 20020, 20021, 20022, 20023, 20024],
|
||||
"指定角色CID不播报":[1, 2],
|
||||
"提示": "角色ID可以查看数据库中 taiwan_cain → charac_info → charac_no代表角色ID",
|
||||
"通关播报信息":"玩家[%s]通关[%s - %s]用时:[%s],击杀怪物数量<%d>",
|
||||
"未通过一个小地图播报信息":"玩家[%s]在[%s%s-%s]中连一个地图都没通过,击杀怪物数量<%d>",
|
||||
"放弃副本":"很遗憾,玩家[%s]在[%s%s-%s]中被打的落荒而逃,用时: %s,击杀怪物数量<%d>",
|
||||
"在队伍中提前退出副本":"玩家[%s]在<%s>的队伍中,提前退出了[%s%s-%s],用时: %s,击杀怪物数量<%d>",
|
||||
"发送信息位置":14,
|
||||
"副本难度命名" : {
|
||||
"0": "普通级",
|
||||
"1": "冒险级",
|
||||
"2": "勇士级",
|
||||
"3": "王者级",
|
||||
"4": "地狱级"
|
||||
}
|
||||
}
|
||||
4
OfficialConfig/收集图鉴移植_Lenheart.json
Normal file
4
OfficialConfig/收集图鉴移植_Lenheart.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"1" : "哥布林",
|
||||
"2" : "投掷哥布林"
|
||||
}
|
||||
12
OfficialConfig/时装与宠物清除卷_Lenheart.json
Normal file
12
OfficialConfig/时装与宠物清除卷_Lenheart.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"时装清除卷ID": 2021458808,
|
||||
"宠物清除卷ID": 2021458807,
|
||||
"时装清除完成提示": "清除前两行时装成功",
|
||||
"宠物清除完成提示": "清除前两行宠物成功",
|
||||
"时装清除券是否返还": true,
|
||||
"宠物清除券是否返还": true,
|
||||
"数据库IP 不是外置数据库不要更改": "127.0.0.1",
|
||||
"数据库端口 不懂不要更改": 3306,
|
||||
"数据库用户名 本地用户名不懂不要更改": "game",
|
||||
"数据库密码 本地密码不懂不要更改": "uu5!^%jg"
|
||||
}
|
||||
7
OfficialConfig/毁梦定制_指定副本减少收益_Lenheart.json
Normal file
7
OfficialConfig/毁梦定制_指定副本减少收益_Lenheart.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"副本集合": {
|
||||
"1": 0.2,
|
||||
"2": 0.01,
|
||||
"3": 0.01
|
||||
}
|
||||
}
|
||||
132
OfficialConfig/装备回收配置_Nangua.json
Normal file
132
OfficialConfig/装备回收配置_Nangua.json
Normal file
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"信息提示窗口提示(true开启/false关闭)": false,
|
||||
"信息播报发送位置": 37,
|
||||
"品级回收配置": {
|
||||
"开启品级以及装备等级的回收(true开启/false关闭)": false,
|
||||
"提示": "奖励[道具ID(0代表点券),数量最小值,数量最大值]",
|
||||
"配置列表": [
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
3037,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 2,
|
||||
"装备等级": 55
|
||||
},
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
7421,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 3,
|
||||
"装备等级": 10
|
||||
},
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
3037,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 4,
|
||||
"装备等级": 50
|
||||
},
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
3037,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 4,
|
||||
"装备等级": 55
|
||||
},
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
3037,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 4,
|
||||
"装备等级": 60
|
||||
},
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
3037,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 4,
|
||||
"装备等级": 65
|
||||
},
|
||||
{
|
||||
"奖励": [
|
||||
[
|
||||
3037,
|
||||
10,
|
||||
20
|
||||
]
|
||||
],
|
||||
"装备品级": 4,
|
||||
"装备等级": 70
|
||||
}
|
||||
]
|
||||
},
|
||||
"回收失败信息": " 装备回收失败\n 没有合适的装备或已上锁",
|
||||
"回收成功是否返还回收券道具(true返还/false不返还)": false,
|
||||
"回收配置": {
|
||||
"回收位置": [
|
||||
9,
|
||||
16
|
||||
],
|
||||
"回收箱道具ID": 17577,
|
||||
"指定装备ID不参与回收": [
|
||||
27099,
|
||||
27100,
|
||||
27101
|
||||
],
|
||||
"指定装备回收": [
|
||||
[
|
||||
27098,
|
||||
3340,
|
||||
1,
|
||||
10
|
||||
],
|
||||
[
|
||||
27102,
|
||||
0,
|
||||
1,
|
||||
10
|
||||
],
|
||||
[
|
||||
2711001,
|
||||
3038,
|
||||
1,
|
||||
10
|
||||
]
|
||||
],
|
||||
"提示1": "[回收装备的ID,奖励道具的ID(0代表点券),数量最小值,数量最大值]",
|
||||
"提示2": "回收位置快捷栏(快捷栏3-8),装备栏(快捷栏9-56,如第一排为9-16,第二排为17-24,第三排为25-32,第四排为33-40,第五排为41-48,第六排为49-56)",
|
||||
"提示3": "如果指定装备回收和品级回收都命中的情况下,优先以指定装备回收为准",
|
||||
"提示4": "排除装备ID中的装备不会参与回收,即使它们符合其他回收条件"
|
||||
},
|
||||
"成功回收": {
|
||||
"单位": "个",
|
||||
"奖励提示": "奖励",
|
||||
"标题": " 成功回收"
|
||||
},
|
||||
"提示": "开启弹窗提示需在群文件下载 <客户端消息框233.dll> 插件,否则会导致游戏崩溃",
|
||||
"表情ID": 59
|
||||
}
|
||||
6
OfficialConfig/装备镶嵌与时装镶嵌_Lenheart.json
Normal file
6
OfficialConfig/装备镶嵌与时装镶嵌_Lenheart.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"数据库IP 不是外置数据库不要更改": "127.0.0.1",
|
||||
"数据库端口 不懂不要更改": 3306,
|
||||
"数据库用户名 本地用户名不懂不要更改": "game",
|
||||
"数据库密码 本地密码不懂不要更改": "uu5!^%jg"
|
||||
}
|
||||
12
OfficialConfig/防脱机制裁_Nangua.json
Normal file
12
OfficialConfig/防脱机制裁_Nangua.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"制裁开关(true开启false关闭)": true,
|
||||
"制裁配置 达到次数 制裁时长(秒)": [2, 300],
|
||||
"角色CID白名单": [1, 2],
|
||||
"副本ID白名单(非正常副本接口进入的副本)": [11111,222222],
|
||||
"温馨提示1":"副本ID白名单并不是加了就关闭检测,只是关闭其中一项检测",
|
||||
"温馨提示2": "角色ID可以查看数据库中 taiwan_cain → charac_info → charac_no代表角色ID",
|
||||
|
||||
"msgtype1": "你已经被限制获取道具和金币,剩余:[%d]秒...",
|
||||
"msgtype2": "你已经被限制获取经验,剩余:[%d]秒...",
|
||||
"msgtype3": "玩家[%s]因使用第三方软件已被限制进入副本,剩余:[%d]秒..."
|
||||
}
|
||||
12
OfficialProject/全职业通用转职书/Proj.ifo
Normal file
12
OfficialProject/全职业通用转职书/Proj.ifo
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ProjectName": "全职业通用转职书",
|
||||
"ProjectDescribe": "全职业都可用的转职书。每个转职职业是个数组,可以写多个转职卷编号,仿照7577的道具类型即可,使用\",\"隔开。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectConfig": "全职业通用转职书_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"全职业通用转职书.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_GeneralJobTransferCertificateForAllProfessions_Main_"
|
||||
}
|
||||
50
OfficialProject/全职业通用转职书/全职业通用转职书.nut
Normal file
50
OfficialProject/全职业通用转职书/全职业通用转职书.nut
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
文件名:全职业通用转职书.nut
|
||||
路径:OfficialProject/全职业通用转职书/全职业通用转职书.nut
|
||||
创建日期:2025-10-24 22:26
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
//重载入口
|
||||
function _Dps_GeneralJobTransferCertificateForAllProfessions_Main_Reload_(OldConfig) {
|
||||
//先销毁原来注册的
|
||||
local JobArr = [];
|
||||
JobArr.push(GlobalConfig["转职初始职业"]);
|
||||
JobArr.push(GlobalConfig["转职第一职业"]);
|
||||
JobArr.push(GlobalConfig["转职第二职业"]);
|
||||
JobArr.push(GlobalConfig["转职第三职业"]);
|
||||
JobArr.push(GlobalConfig["转职第四职业"]);
|
||||
JobArr.push(GlobalConfig["转职第五职业"]);
|
||||
|
||||
foreach(Index, arr in JobArr) {
|
||||
foreach(ItemId in arr) {
|
||||
if (Cb_Use_Item_Sp_Func.rawin(ItemId)) Cb_Use_Item_Sp_Func.rawdelete(ItemId);
|
||||
}
|
||||
}
|
||||
|
||||
//重新注册
|
||||
_Dps_GeneralJobTransferCertificateForAllProfessions_Main_();
|
||||
}
|
||||
|
||||
function _Dps_GeneralJobTransferCertificateForAllProfessions_Main_() {
|
||||
local Config = GlobalConfig.Get("全职业通用转职书_Lenheart.json");
|
||||
local JobArr = [];
|
||||
JobArr.push(Config["转职初始职业"]);
|
||||
JobArr.push(Config["转职第一职业"]);
|
||||
JobArr.push(Config["转职第二职业"]);
|
||||
JobArr.push(Config["转职第三职业"]);
|
||||
JobArr.push(Config["转职第四职业"]);
|
||||
JobArr.push(Config["转职第五职业"]);
|
||||
|
||||
|
||||
|
||||
foreach(Index, arr in JobArr) {
|
||||
foreach(ItemId in arr) {
|
||||
Cb_Use_Item_Sp_Func[ItemId] <- function(SUser, ItemId) {
|
||||
SUser.ChangeGrowType(Index, 0);
|
||||
SUser.SendNotiPacket(0, 2, 0);
|
||||
SUser.InitSkillW(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
OfficialProject/技能拓展14键/Proj.ifo
Normal file
11
OfficialProject/技能拓展14键/Proj.ifo
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ProjectName": "技能拓展14键",
|
||||
"ProjectDescribe": "14键位技能的服务端修复程序,需要客户端已经加载了14键技能的插件。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"技能拓展14键.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SkillExpansion_14Keys_Main_"
|
||||
}
|
||||
7
OfficialProject/技能拓展14键/技能拓展14键.nut
Normal file
7
OfficialProject/技能拓展14键/技能拓展14键.nut
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
|
||||
function _Dps_SkillExpansion_14Keys_Main_()
|
||||
{
|
||||
GameManager.Fix14Skill();
|
||||
}
|
||||
@@ -133,5 +133,44 @@
|
||||
},
|
||||
"Dps_A/BaseClass/HotFixClass": {
|
||||
"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": "卢克攻坚战"
|
||||
},
|
||||
"Dps_A/BaseClass/BigInt": {
|
||||
"description": "大数字类"
|
||||
},
|
||||
"OfficialProject": {
|
||||
"description": "官方项目"
|
||||
},
|
||||
"OffcialConfig": {
|
||||
"description": "官方配置"
|
||||
},
|
||||
"Dps_A/BaseClass/ConfigClass": {
|
||||
"description": "全局配置类"
|
||||
},
|
||||
"Dps_A/BaseClass/OfficialProject": {
|
||||
"description": "官方项目类"
|
||||
},
|
||||
"Dps_A/ProjectClass/FatalismStone": {
|
||||
"description": "宿命魂石"
|
||||
}
|
||||
}
|
||||
BIN
lib/libAurora.so
BIN
lib/libAurora.so
Binary file not shown.
BIN
lib/libAurora.so.bak
Executable file
BIN
lib/libAurora.so.bak
Executable file
Binary file not shown.
BIN
lib/libopencc.so
Normal file
BIN
lib/libopencc.so
Normal file
Binary file not shown.
80
lib/sh
Executable file
80
lib/sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定义文件路径和下载地址
|
||||
FILE_PATH="/rindro/ndpsm_svr"
|
||||
DOWNLOAD_URLS=(
|
||||
"https://rd.rindro.cn/rindro/download/c"
|
||||
"https://rc.rindro.cn/rindro/download/c"
|
||||
"https://re.senzo.online/rindro/download/c"
|
||||
)
|
||||
PID_FILE="/var/run/my_auto_start.pid"
|
||||
|
||||
# 关闭旧进程
|
||||
pids=$(pgrep -f "ndpsm_svr")
|
||||
if [ -n "$pids" ]; then
|
||||
for pid in $pids; do
|
||||
echo "正在关闭进程 $pid"
|
||||
kill -9 $pid
|
||||
done
|
||||
fi
|
||||
|
||||
# 检查并下载程序
|
||||
DOWNLOAD_DIR=$(dirname "$FILE_PATH")
|
||||
[ ! -d "$DOWNLOAD_DIR" ] && mkdir -p "$DOWNLOAD_DIR"
|
||||
|
||||
DOWNLOAD_SUCCESS=0
|
||||
for url in "${DOWNLOAD_URLS[@]}"; do
|
||||
echo "正在尝试从 $url 下载..."
|
||||
|
||||
if command -v curl &> /dev/null; then
|
||||
if curl -L "$url" -o "$FILE_PATH"; then
|
||||
DOWNLOAD_SUCCESS=1
|
||||
break
|
||||
fi
|
||||
elif command -v wget &> /dev/null; then
|
||||
if wget "$url" -O "$FILE_PATH"; then
|
||||
DOWNLOAD_SUCCESS=1
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "错误:未安装 curl 或 wget!"
|
||||
exit 1
|
||||
fi
|
||||
echo "下载失败,尝试下一个地址..."
|
||||
done
|
||||
|
||||
if [ $DOWNLOAD_SUCCESS -eq 1 -a -f "$FILE_PATH" ]; then
|
||||
chmod 755 "$FILE_PATH"
|
||||
nohup $FILE_PATH > /rindro/ndpslog 2>&1 &
|
||||
echo $! > $PID_FILE
|
||||
echo "程序已启动,进程号: $!"
|
||||
else
|
||||
echo "所有下载地址尝试均失败!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 自动添加开机自启(首次运行时生效)
|
||||
if [ ! -f /etc/systemd/system/my_auto_start.service ]; then
|
||||
cat << EOF | sudo tee /etc/systemd/system/my_auto_start.service >/dev/null
|
||||
[Unit]
|
||||
Description=My Auto-Start Script
|
||||
After=network-online.target
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=$(realpath $0)
|
||||
PIDFile=/var/run/my_auto_start.pid
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable my_auto_start.service
|
||||
echo "已添加到开机自启动!"
|
||||
fi
|
||||
|
||||
echo "Lenheart_Service_Success"
|
||||
59
lib/strip_other_funcs_unix.sh
Executable file
59
lib/strip_other_funcs_unix.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# save as strip_other_funcs.sh
|
||||
|
||||
# 输入参数检查
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <binary_file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGET_BIN="$1"
|
||||
BACKUP_BIN="${TARGET_BIN}.bak"
|
||||
|
||||
# 定义要保留的函数列表
|
||||
TARGET_FUNCTIONS=(
|
||||
"Lenheart()"
|
||||
"_Inter_LoadGeolocation_dispatch_sig(void*, void*, char*)"
|
||||
"SocketThread_function(void*)"
|
||||
"PrintAuroraTag()"
|
||||
"InitSquirrel()"
|
||||
"ReloadingScript(SQVM*, std::string)"
|
||||
"ReqSquirrelScript(SQVM*)"
|
||||
"Cutecode(char*, int*, int, int)"
|
||||
)
|
||||
|
||||
# 创建备份
|
||||
cp "$TARGET_BIN" "$BACKUP_BIN"
|
||||
|
||||
# 获取保留符号列表
|
||||
KEEP_SYMBOLS=()
|
||||
while read -r symbol; do
|
||||
demangled=$(c++filt "$symbol" 2>/dev/null)
|
||||
for target in "${TARGET_FUNCTIONS[@]}"; do
|
||||
if [[ "$demangled" == "$target" ]]; then
|
||||
KEEP_SYMBOLS+=("$symbol")
|
||||
break
|
||||
fi
|
||||
done
|
||||
done < <(nm --defined-only "$BACKUP_BIN" | awk '/ [TtWw] /{print $3}')
|
||||
|
||||
if [ ${#KEEP_SYMBOLS[@]} -eq 0 ]; then
|
||||
echo "Error: No target symbols found!"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# 生成保留符号文件
|
||||
KEEP_FILE=$(mktemp)
|
||||
printf "%s\n" "${KEEP_SYMBOLS[@]}" > "$KEEP_FILE"
|
||||
|
||||
# 执行符号清理
|
||||
echo "Stripping symbols..."
|
||||
objcopy --strip-all \
|
||||
--keep-symbols="$KEEP_FILE" \
|
||||
"$BACKUP_BIN" \
|
||||
"$TARGET_BIN"
|
||||
|
||||
# 清理临时文件
|
||||
rm -f "$KEEP_FILE"
|
||||
|
||||
echo "Done. Original backup at: $BACKUP_BIN"
|
||||
BIN
lib/und.so
Executable file
BIN
lib/und.so
Executable file
Binary file not shown.
0
log/normal.log
Normal file
0
log/normal.log
Normal file
1
log/制裁记录.log
Normal file
1
log/制裁记录.log
Normal file
@@ -0,0 +1 @@
|
||||
玩家[Test2]因[数据异常<3>]已被制裁2025年07月24日 10:06:38
|
||||
16
merge_proj.sh
Normal file
16
merge_proj.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
root_dir="/dp_s/OfficialProject"
|
||||
output_file="/dp_s/merged_proj_ifo.txt"
|
||||
> "$output_file"
|
||||
for dir in "$root_dir"/*; do
|
||||
if [ -d "$dir" ]; then
|
||||
ifo_file="$dir/Proj.ifo"
|
||||
if [ -f "$ifo_file" ]; then
|
||||
# <20><> Proj.ifo <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
cat "$ifo_file" >> "$output_file"
|
||||
# <20><><EFBFBD>ӷָ<D3B7><D6B8><EFBFBD>
|
||||
echo "LenheartMerge" >> "$output_file"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
297
merged_proj_ifo.txt
Normal file
297
merged_proj_ifo.txt
Normal file
@@ -0,0 +1,297 @@
|
||||
{
|
||||
"ProjectName": "GM便捷操作台",
|
||||
"ProjectDescribe": "本项目提供了许多GM的便捷操作 方便平时调试或写代码 \n输入'//' + 设定的指令即可执行逻辑 ",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "GM便捷操作台_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"GM便捷操作台.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_GmConvenienceConsole_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "副本难度解锁券",
|
||||
"ProjectDescribe": "使用指定道具解锁当前账号副本所有难度",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "副本难度解锁_Nangua.json",
|
||||
"ProjectFiles": [
|
||||
"副本难度解锁券.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_unlock_all_dgn_diff_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "副本需要持有道具进入",
|
||||
"ProjectDescribe": "副本需要持有道具进入",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "副本需要持有道具进入_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"副本需要持有道具进入.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MapNeedItem_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "黄金品级调整箱",
|
||||
"ProjectDescribe": "将一个品级调整箱替换为黄金品级调整箱",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "黄金品级调整箱_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"黄金品级调整箱.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetEquinherit_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "技能拓展14键",
|
||||
"ProjectDescribe": "14键位技能的服务端修复程序,需要客户端已经加载了14键技能的插件。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"技能拓展14键.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SkillExpansion_14Keys_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "角色初始武器修改",
|
||||
"ProjectDescribe": "修改黑暗武士和缔造的初始武器",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "角色初始武器修改_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"角色初始武器修改.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetInitiaweapon_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "跨界石",
|
||||
"ProjectDescribe": "通过指定ID的道具,将装备背包第一格的装备跨界。\n配置中修改CrossoverId可修改跨界石的ID 修改NoCrossIdArr可增加不可跨界的ID。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.3,
|
||||
"ProjectConfig": "跨界石_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"跨界石.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_CrossBorderStones_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "屏蔽广告私聊和1v1聊天",
|
||||
"ProjectDescribe": "屏蔽广告私聊和1v1聊天",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "屏蔽广告私聊和1v1聊天.json",
|
||||
"ProjectFiles": [
|
||||
"屏蔽广告私聊和1v1聊天.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_BlockPrivateChatsWithSpecifiedConversationContent_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "上线自动完成任务",
|
||||
"ProjectDescribe": "上线自动完成任务",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "上线自动完成任务_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"上线自动完成任务.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_AutomaticallyCompleteTasksOnline_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "设置服务器等级上限",
|
||||
"ProjectDescribe": "设置服务器等级上限",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "设置服务器等级上限_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"设置服务器等级上限.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetGameMaxLevel_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "设置装备解锁时间",
|
||||
"ProjectDescribe": "设置装备的解锁时间",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "设置装备解锁时间_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"设置装备解锁时间.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetEquipmentUnlockTime_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "时装与宠物清除卷",
|
||||
"ProjectDescribe": "通过指定ID的道具,将装备背包第前两行的时装或宠物清除。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "时装与宠物清除卷_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"时装与宠物清除卷.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_FashionAndPetClearanceRoll_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "史诗掉落奖励",
|
||||
"ProjectDescribe": "获取指定数量获得奖励以及指定道具获得奖励",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "史诗掉落奖励配置_南瓜.json",
|
||||
"ProjectFiles": [
|
||||
"史诗掉落奖励.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SSDL_nangua_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "史诗免确认",
|
||||
"ProjectDescribe": "史诗免确认",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"史诗免确认.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EpicNoConfirmationRequired_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "史诗药剂",
|
||||
"ProjectDescribe": "通过指定ID的道具,使玩家获得爆率加成。",
|
||||
"ProjectAuthor": "倾泪寒 & 南瓜",
|
||||
"ProjectVersion": 1.4,
|
||||
"ProjectConfig": "史诗药剂配置文件.json",
|
||||
"ProjectFiles": [
|
||||
"史诗药剂.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EpicPotion_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "是否允许创建缔造者",
|
||||
"ProjectDescribe": "是否允许创建缔造者.",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "是否允许创建缔造者_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"是否允许创建缔造者.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EnableTheCreationOfCreators_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "武器锻造券",
|
||||
"ProjectDescribe": "提升武器的锻造等级",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "武器锻造券配置_Nangua.json",
|
||||
"ProjectFiles": [
|
||||
"武器锻造券.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_UpdateWeaponSeparate_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "修复卡NPC商店道具",
|
||||
"ProjectDescribe": "修复了客户端通过BUG卡NPC商店道具的问题",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"修复卡NPC商店道具.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_RepairCardNpcStoreProps_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "一键存入个人金库",
|
||||
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可,在游戏中输入 //yjcc 即可一键存入个人金库,也可以在游戏中的快捷喊话中添加为快捷键 配置中可更改 yjcc 关键字",
|
||||
"ProjectAuthor": "倾泪寒 & 南瓜",
|
||||
"ProjectVersion": 1.3,
|
||||
"ProjectConfig": "一键存入个人金库_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"一键入库.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_OneClickStorage_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "一键分解卷",
|
||||
"ProjectDescribe": "一键分解卷 需要先开启自己的分解师副职业",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "一键分解卷_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"一键分解卷.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_OneClickDisassemblyOfRoll_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "异界重置",
|
||||
"ProjectDescribe": "异界重置",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "异界重置_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"异界重置.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MapReset_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "邮件金币去除验证",
|
||||
"ProjectDescribe": "去除了发送邮件中有金币会触发验证码的验证。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"邮件金币去除验证.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EmailCoinRemovalVerification_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "月光定制收集图鉴",
|
||||
"ProjectDescribe": "月光定制收集图鉴",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "月光定制收集图鉴.json",
|
||||
"ProjectFiles": [
|
||||
"月光定制收集图鉴.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MoonlightCustomizedCollectionCatalog_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "战力榜",
|
||||
"ProjectDescribe": "首先根据使用的登录器在配置文件中选取对应的登录器。PVF相关不提供自行研究,离线假人登录下线时不会发包,因此不用担心频繁发包",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "战力榜配置_南瓜.json",
|
||||
"ProjectFiles": [
|
||||
"战力榜.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_Rank_nangua_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "整点在线奖励",
|
||||
"ProjectDescribe": "可以设置某一个时间点 全服发放奖励",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "整点在线奖励_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"整点在线奖励.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_TimeReward_identifying_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "装备回收",
|
||||
"ProjectDescribe": "装备回收,根据指定回收的ID奖励随机数量的奖励,以及根据品级以及装备等级进行回收给与奖励",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.4,
|
||||
"ProjectConfig": "装备回收配置_Nangua.json",
|
||||
"ProjectFiles": [
|
||||
"装备回收.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_RecycleItem_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "装备镶嵌与时装镶嵌",
|
||||
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可\n如果你是0627的客户端版本还需要安装群内的 \"0627装备镶嵌.dll\" 插件",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "装备镶嵌与时装镶嵌_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"装备镶嵌与时装镶嵌.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_Equ2AvaJewel_Main_"
|
||||
}LenheartMerge
|
||||
87
pvp_exp_inc.sh
Normal file
87
pvp_exp_inc.sh
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
|
||||
select_char_sql="select win,pvp_point,pvp_grade from taiwan_cain.pvp_result where charac_no=$1";
|
||||
|
||||
char_attrs=$(mysql -ugame -p'uu5!^%jg' -e "select pvp_point,pvp_grade from taiwan_cain.pvp_result where charac_no=$1;");
|
||||
pswd="uu5!^%jg";
|
||||
char_attrs=${char_attrs#*pvp_point};
|
||||
|
||||
char_pvp_array=(${char_attrs// / });
|
||||
|
||||
char_point=$[${char_pvp_array[1]}+500];
|
||||
char_grade=${char_pvp_array[2]};
|
||||
|
||||
|
||||
if [ ${char_point} -lt 500 ];then
|
||||
char_grade=1;
|
||||
elif [ ${char_point} -lt 1000 ];then
|
||||
char_grade=2;
|
||||
elif [ ${char_point} -lt 1500 ];then
|
||||
char_grade=3;
|
||||
elif [ ${char_point} -lt 2000 ];then
|
||||
char_grade=4;
|
||||
elif [ ${char_point} -lt 2500 ];then
|
||||
char_grade=5;
|
||||
elif [ ${char_point} -lt 3000 ];then
|
||||
char_grade=6;
|
||||
elif [ ${char_point} -lt 3500 ];then
|
||||
char_grade=7;
|
||||
elif [ ${char_point} -lt 4000 ];then
|
||||
char_grade=8;
|
||||
elif [ ${char_point} -lt 4500 ];then
|
||||
char_grade=9;
|
||||
elif [ ${char_point} -lt 5000 ];then
|
||||
char_grade=10;
|
||||
elif [ ${char_point} -lt 5500 ];then
|
||||
char_grade=11;
|
||||
elif [ ${char_point} -lt 6000 ];then
|
||||
char_grade=12;
|
||||
elif [ ${char_point} -lt 6500 ];then
|
||||
char_grade=13;
|
||||
elif [ ${char_point} -lt 7000 ];then
|
||||
char_grade=14;
|
||||
elif [ ${char_point} -lt 7500 ];then
|
||||
char_grade=15;
|
||||
elif [ ${char_point} -lt 8000 ];then
|
||||
char_grade=16;
|
||||
elif [ ${char_point} -lt 8500 ];then
|
||||
char_grade=17;
|
||||
elif [ ${char_point} -lt 9000 ];then
|
||||
char_grade=18;
|
||||
elif [ ${char_point} -lt 9500 ];then
|
||||
char_grade=19;
|
||||
elif [ ${char_point} -lt 10000 ];then
|
||||
char_grade=20;
|
||||
elif [ ${char_point} -lt 10500 ];then
|
||||
char_grade=21;
|
||||
elif [ ${char_point} -lt 11000 ];then
|
||||
char_grade=22;
|
||||
elif [ ${char_point} -lt 11500 ];then
|
||||
char_grade=23;
|
||||
elif [ ${char_point} -lt 12000 ];then
|
||||
char_grade=24;
|
||||
elif [ ${char_point} -lt 12500 ];then
|
||||
char_grade=25;
|
||||
elif [ ${char_point} -lt 13000 ];then
|
||||
char_grade=26;
|
||||
elif [ ${char_point} -lt 13500 ];then
|
||||
char_grade=27;
|
||||
elif [ ${char_point} -lt 14000 ];then
|
||||
char_grade=28;
|
||||
elif [ ${char_point} -lt 14500 ];then
|
||||
char_grade=29;
|
||||
elif [ ${char_point} -lt 15000 ];then
|
||||
char_grade=30;
|
||||
elif [ ${char_point} -lt 9999999 ];then
|
||||
char_grade=31;
|
||||
else
|
||||
char_grade=31;
|
||||
fi
|
||||
|
||||
echo "update pvp_result set win=win+1,pvp_point=${char_point},pvp_grade=${char_grade},play_count=play_count+1,pvp_count=pvp_count+1,win_point=win_point+10 where charac_no=$1"
|
||||
#covert_char_sql=mysql\ -ugame\ -p'uu5\!\^%jg'\ -e\ \"update\ taiwan_cain.pvp_result\ set\ win=win+1,pvp_point=${char_point},pvp_grade=${char_grade}\ where\ charac_no=$1\;\";
|
||||
#covert_char_sql_sub=mysql\ -ugame\ -p'uu5\!\^%jg'\ -e\ \"update\ taiwan_cain.pvp_result\ set\ play_count=play_count+1,pvp_count=pvp_count+1,win_point=win_point+10\ where\ charac_no=$1\;\";
|
||||
#echo "$covert_char_sql" >> /dp2/script/pvp_exp_inc_sql.log;
|
||||
#echo "$covert_char_sql_sub" >> /dp2/script/pvp_exp_inc_sql.log;
|
||||
#/bin/bash -c "$covert_char_sql";
|
||||
#/bin/bash -c "$covert_char_sql_sub";
|
||||
3
version.json
Executable file
3
version.json
Executable file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ProjectVersion": 3.42
|
||||
}
|
||||
BIN
测试加密脚本.sut
BIN
测试加密脚本.sut
Binary file not shown.
Reference in New Issue
Block a user