111
This commit is contained in:
parent
2ef9cfef42
commit
10de73a395
|
|
@ -11,7 +11,9 @@ 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) {
|
||||
|
|
@ -26,6 +28,8 @@ class Memory {
|
|||
}
|
||||
|
||||
class NativePointer extends Base_C_Object {
|
||||
//大小
|
||||
Size = -1;
|
||||
|
||||
function _tyoeof()
|
||||
{
|
||||
|
|
@ -35,6 +39,7 @@ class NativePointer extends Base_C_Object {
|
|||
constructor(T) {
|
||||
if (typeof T == "integer") {
|
||||
base.constructor(Sq_New_Point(T));
|
||||
Size = T;
|
||||
//注册销毁伪析构
|
||||
Register_Destruction(C_Object, this);
|
||||
} else if (typeof T == "userdata") {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class Script {
|
|||
C_Object = null;
|
||||
|
||||
constructor(Path = "/home/neople/game/Script.pvf") {
|
||||
if(getroottable().rawin("_Script_Data_"))return;
|
||||
print("正在初始化PVF...");
|
||||
local StartTime = time();
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ function OnGatewaySocketConnect() {
|
|||
foreach(value in OnGatewaySocketConnectFunc) {
|
||||
value();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//网关包回调Map
|
||||
if (!getroottable().rawin("GatewaySocketPackFuncMap")) GatewaySocketPackFuncMap <- {}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,19 @@ 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;
|
||||
|
|
@ -781,7 +794,7 @@ function User::DropItem(ItemId, Xpos, Ypos) {
|
|||
|
||||
//角色类 发送邮件函数 (标题, 正文, 金币, 道具列表[[3037,100],[3038,100]])
|
||||
function User::ReqDBSendMultiMail(title, text, gold, item_list) {
|
||||
Timer.SetTimeOut(function(SUser,title, text, gold, item_list) {
|
||||
Timer.SetTimeOut(function(SUser, title, text, gold, item_list) {
|
||||
local Cid = SUser.GetCID();
|
||||
// 获取分割后的道具列表
|
||||
local subLists;
|
||||
|
|
@ -843,5 +856,5 @@ function User::ReqDBSendMultiMail(title, text, gold, item_list) {
|
|||
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);
|
||||
}, 1, this, title, text, gold, item_list);
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ Gm_InputFunc_Handle.KickMySelf <- function(SUser, CmdString) {
|
|||
SUser.Kick();
|
||||
};
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["升级"] <- function(SUser, CmdString) {
|
||||
local count = -1;
|
||||
local pos = 0;
|
||||
|
|
@ -48,22 +49,18 @@ Gm_InputFunc_Handle["升级"] <- function(SUser, CmdString) {
|
|||
|
||||
//得到空格数量
|
||||
if (count == 1) {
|
||||
print(handler[1].tointeger());
|
||||
SUser.SetCharacLevel(handler[1].tointeger());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["cs"] <- function(SUser, CmdString) {
|
||||
local InvenObj = SUser.GetInven();
|
||||
local slot = InvenObj.GetSlotById(26058);
|
||||
|
||||
if (slot == -1) {
|
||||
return;
|
||||
}
|
||||
local itemobj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, slot);
|
||||
|
||||
itemobj.Delete();
|
||||
SUser.SendUpdateItemList(1, 0, slot);
|
||||
SUser.ReqDBSendMultiMail("标题", "内容", 0, [
|
||||
[3037, 100],
|
||||
[3038, 100]
|
||||
]);
|
||||
}
|
||||
|
||||
Gm_InputFunc_Handle["给"] <- function(SUser, CmdString) {
|
||||
|
|
@ -89,6 +86,7 @@ Gm_InputFunc_Handle["给"] <- function(SUser, CmdString) {
|
|||
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
|
||||
}
|
||||
}
|
||||
|
||||
Gm_InputFunc_Handle["转职"] <- function(SUser, CmdString) {
|
||||
local count = -1;
|
||||
local pos = 0;
|
||||
|
|
@ -147,12 +145,6 @@ Gm_InputFunc_Handle["测试"] <- function(SUser, CmdString) {
|
|||
SUser.ClearQuest_Gm(650);
|
||||
}
|
||||
|
||||
|
||||
Cb_History_MileageSet_Func["_DPS_上线自动完成任务_"] <- function(SUser, Data) {
|
||||
SUser.ClearQuest_Gm(101);
|
||||
}
|
||||
|
||||
|
||||
Gm_InputFunc_Handle.M <- function(SUser, CmdString) {
|
||||
local PartyObj = SUser.GetParty();
|
||||
// Sq_CallFunc(S_Ptr("0x85A73A6"), "int", ["pointer", "pointer", "int"], PartyObj.C_Object, SUser.C_Object, 3037);
|
||||
|
|
@ -173,31 +165,59 @@ Gm_InputFunc_Handle.W <- function(SUser, CmdString) {
|
|||
};
|
||||
|
||||
Gm_InputFunc_Handle.Q <- function(SUser, CmdString) {
|
||||
local PartyObj = SUser.GetParty();
|
||||
if (PartyObj) {
|
||||
local Buf = 18126;
|
||||
PartyObj.ForeachMember(function(SUser, Pos) {
|
||||
print(Pos + "号位玩家的" + Buf + "名字是: " + SUser.GetCharacName());
|
||||
})
|
||||
// print(UserBuf.GetName());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
function calculate_grade(point) {
|
||||
if (point< 500) return 1;
|
||||
else if (point< 1000) return 2;
|
||||
else if (point< 1500) return 3;
|
||||
else if (point< 2000) return 4;
|
||||
else if (point< 2500) return 5;
|
||||
else if (point< 3000) return 6;
|
||||
else if (point< 3500) return 7;
|
||||
else if (point< 4000) return 8;
|
||||
else if (point< 4500) return 9;
|
||||
else if (point< 5000) return 10;
|
||||
else if (point< 5500) return 11;
|
||||
else if (point< 6000) return 12;
|
||||
else if (point< 6500) return 13;
|
||||
else if (point< 7000) return 14;
|
||||
else if (point< 7500) return 15;
|
||||
else if (point< 8000) return 16;
|
||||
else if (point< 8500) return 17;
|
||||
else if (point< 9000) return 18;
|
||||
else if (point< 9500) return 19;
|
||||
else if (point< 10000) return 20;
|
||||
else if (point< 10500) return 21;
|
||||
else if (point< 11000) return 22;
|
||||
else if (point< 11500) return 23;
|
||||
else if (point< 12000) return 24;
|
||||
else if (point< 12500) return 25;
|
||||
else if (point< 13000) return 26;
|
||||
else if (point< 13500) return 27;
|
||||
else if (point< 14000) return 28;
|
||||
else if (point< 14500) return 29;
|
||||
else if (point< 15000) return 30;
|
||||
else return 31;
|
||||
}
|
||||
|
||||
Gm_InputFunc_Handle.FI <- function(SUser, CmdString) {
|
||||
// local PartyObj = SUser.GetParty();
|
||||
// if (PartyObj) {
|
||||
// local Bfobj = PartyObj.GetBattleField();
|
||||
// print(Bfobj.GetHellDifficulty());
|
||||
// // print(n);
|
||||
// }
|
||||
|
||||
|
||||
SUser.SendNotiForColorAIdPacketMessage([
|
||||
[" → ", 0, [0xff, 0xff, 0xff]],
|
||||
["无色", 1, [255, 215, 0], 3037],
|
||||
[" x" + (1).tostring(), 0, [0xff, 0xff, 0xff]]
|
||||
], 6);
|
||||
local Cid = SUser.GetCID();
|
||||
Sq_CallFunc(S_Ptr("0x8686FEE"), "void", ["pointer", "bool"], SUser.C_Object, true);
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local sql = format("SELECT pvp_point, pvp_grade FROM pvp_result WHERE charac_no = %d", Cid);
|
||||
local result = SqlObj.Select(sql, ["int", "int"]);
|
||||
// 解析查询结果
|
||||
local pvp_point = result[0][0];
|
||||
local pvp_grade = result[0][1];
|
||||
// 计算新的PVP积分和等级
|
||||
local new_point = pvp_point + 500;
|
||||
local new_grade = calculate_grade(new_point);
|
||||
local newsql = format("UPDATE pvp_result SET win = win + 1, pvp_point = %d, pvp_grade = %d, play_count = play_count + 1,pvp_count = pvp_count + 1, win_point = win_point + 10 WHERE charac_no = %d", new_point, new_grade, Cid);
|
||||
SqlObj.Exec_Sql(newsql);
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
};
|
||||
|
||||
Gm_InputFunc_Handle.UINJ <- function(SUser, CmdString) {
|
||||
|
|
@ -236,6 +256,7 @@ Gm_InputFunc_Handle.T <- function(SUser, CmdString) {
|
|||
SUser.SendNotiPacketMessage("GetMaxFatigue: " + SUser.GetMaxFatigue(), 8);
|
||||
SUser.SendNotiPacketMessage("GetParty: " + SUser.GetParty(), 8);
|
||||
|
||||
SUser.SendNotiBox("测试", 1);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -341,12 +362,22 @@ Gm_InputFunc_Handle.WEQ <- function(SUser, CmdString) {
|
|||
// local C = NativePointer(B).add(101);
|
||||
// local D = NativePointer(C).add(8).readInt();
|
||||
|
||||
//附魔不报错
|
||||
Haker.LoadHook("0x081D233A", ["pointer", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
return 0;
|
||||
});
|
||||
|
||||
Sq_CallFunc(S_Ptr("0x84EC002"), "int", ["pointer", "int"], SUser.C_Object, 0);
|
||||
|
||||
local D = Sq_CallFunc(S_Ptr("0x8696600"), "int", ["pointer"], SUser.C_Object);
|
||||
print(D);
|
||||
|
||||
Haker.LoadHook("0x081D24B8", ["pointer", "pointer", "pointer", "pointer", "int"],
|
||||
function(args) {
|
||||
return null;
|
||||
},
|
||||
function(args) {
|
||||
return null;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -882,20 +913,102 @@ ClientSocketPackFuncMap.rawset(21091001, function(SUser, Jso) {
|
|||
// });
|
||||
|
||||
|
||||
function _Jump_DropItem_check_error_()
|
||||
{
|
||||
function _Jump_DropItem_check_error_() {
|
||||
//如果没有创建过这个模拟内存就创建
|
||||
if(!getroottable().rawin("_EmptyCharacInfo_Flag_")){
|
||||
if (!getroottable().rawin("_EmptyCharacInfo_Flag_")) {
|
||||
getroottable()._EmptyCharacInfo_Flag_ <- Memory.alloc(17);
|
||||
Memory.reset(getroottable()._EmptyCharacInfo_Flag_,17);
|
||||
Memory.reset(getroottable()._EmptyCharacInfo_Flag_, 17);
|
||||
}
|
||||
//如果没有创建过这个跳转Flag就创建并初始化
|
||||
if(!getroottable().rawin("_EmptyHook_Flag_")){
|
||||
if (!getroottable().rawin("_EmptyHook_Flag_")) {
|
||||
getroottable()._EmptyHook_Flag_ <- false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _Dps_UpdateCreatureEnchantMysql_(card_id, charac_no, uuid) {
|
||||
local sql = "select card from `taiwan_cain_2nd`.`creature_items_enchant` where ui_id = " + uuid + ";";
|
||||
local column_type_list = ["int"];
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local result = SqlObj.Select(sql, column_type_list);
|
||||
local UpdateSql = "update `taiwan_cain_2nd`.`creature_items_enchant` set `card` = " + card_id + " where `ui_id` = " + uuid + ";";
|
||||
if (result.len() <= 0 || result[0].len() <= 0) {
|
||||
UpdateSql = "INSERT INTO `taiwan_cain_2nd`.`creature_items_enchant`(`ui_id`, `charac_no`, `card`) VALUES (" + uuid + "," + charac_no + "," + card_id + ");";
|
||||
}
|
||||
SqlObj.Exec_Sql(UpdateSql);
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
|
||||
function _Dps_GetCreatureEnchantMysql_(charac_no) {
|
||||
local sql = "select ui_id,card from `taiwan_cain_2nd`.`creature_items_enchant` where charac_no = " + charac_no + ";";
|
||||
local column_type_list = ["int", "int"];
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local result = SqlObj.Select(sql, column_type_list);
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
return result;
|
||||
}
|
||||
|
||||
// MultiBox_Lottery_SetCount <- 0;
|
||||
// MultiBox_Lottery_SetInfo <- [];
|
||||
Timer.SetTimeOut(function() {
|
||||
// GameManager.OpenHotFix("/dp_s/OfficialConfig");
|
||||
|
||||
// Haker.LoadHook("0x080FE2B6", ["pointer", "pointer"],
|
||||
// function(args) {
|
||||
// // print("args 0 : " + args[0]);
|
||||
// return args;
|
||||
// },
|
||||
// function(args) {
|
||||
// // print(args.pop());
|
||||
// local ItemObj = Item(args.pop());
|
||||
// print(ItemObj.GetIndex());
|
||||
// return null;
|
||||
// });
|
||||
|
||||
// Haker.LoadHook("0x08674968", ["pointer", "int", "int", "int"],
|
||||
// function(args) {
|
||||
// print("args 1 : " + args[1]);
|
||||
// print("args 2 : " + args[2]);
|
||||
// // args[1] = 3;
|
||||
// // args[2] = 109;
|
||||
// return args;
|
||||
// },
|
||||
// function(args) {
|
||||
// print(args.pop());
|
||||
// args.push(1);
|
||||
// return null;
|
||||
// });
|
||||
|
||||
// //获取坐标
|
||||
// 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) {
|
||||
// local T = {
|
||||
// op = 20096009,
|
||||
// cid = SUser.GetCID(),
|
||||
// uid = SUser.GetUID(),
|
||||
// zdygg = handler[1]
|
||||
// }
|
||||
// Socket.SendGateway(T);
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
// GameManager.SetGameMaxLevel(85);
|
||||
|
||||
// //私有方法 发送带参数的Post请求
|
||||
// local SO = Http("129.211.27.104", "9080");
|
||||
// local Res = SO.Post("/dof/chat", Json.Encode({
|
||||
|
|
@ -903,121 +1016,279 @@ Timer.SetTimeOut(function() {
|
|||
// text = "倾泪寒在格蓝迪发电站爆出了【雷剑-苦轮】!真是人品爆炸!!!",
|
||||
// groupId = 850022626
|
||||
// }), "application/json");
|
||||
// _Dps_CollectIllustrationsAndTransplantThem_Main_();
|
||||
|
||||
// Cb_DropItem_check_error_Enter_Func.Rindro <- function(args){
|
||||
// getroottable()._EmptyHook_Flag_ = true;
|
||||
// args[1] = getroottable()._EmptyCharacInfo_Flag_.C_Object;
|
||||
// return args;
|
||||
// }
|
||||
// Cb_DropItem_check_error_Leave_Func.Rindro <- function(args){
|
||||
// if(getroottable()._EmptyHook_Flag_){
|
||||
// getroottable()._EmptyHook_Flag_ = false;
|
||||
// return 19;
|
||||
// //初始建表指令
|
||||
// local CreateSql = "CREATE TABLE `taiwan_cain_2nd`.`creature_items_enchant` (`ui_id` int(11) NOT NULL DEFAULT '0',`charac_no` int(11) DEFAULT NULL,`card` int(11) NOT NULL DEFAULT '0',PRIMARY KEY (`ui_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
||||
// local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
// SqlObj.Exec_Sql(CreateSql);
|
||||
// MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
// print(666);
|
||||
// //忽略宠物附魔错误
|
||||
// Sq_WriteByteArr(S_Ptr("0x850dede"), array(2, 0x90));
|
||||
|
||||
// Cb_ExpertOnEnchantByBead_Leave_Func["宠物附魔"] <- function(args) {
|
||||
// if (args[5] > 56) {
|
||||
// local SUser = User(args[1]);
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// local Bead_id = InvenObj.GetSlot(1, args[3]).GetIndex()
|
||||
// local PvfItemObj = PvfItem.GetPvfItemById(InvenObj.GetSlot(1, args[3]).GetIndex())
|
||||
// local Card_Id = Sq_CallFunc(S_Ptr("0x0849F530"), "int", ["pointer"], PvfItemObj.C_Object);
|
||||
// local a7 = args[5] - 57;
|
||||
// local ItemObj = InvenObj.GetSlot(3, a7)
|
||||
// local Item_Id = ItemObj.GetIndex();
|
||||
// NativePointer(ItemObj.C_Object).add(13).writeU32(Card_Id);
|
||||
// if (a7< 140) {
|
||||
// local uuid = NativePointer(ItemObj.C_Object).add(7).readInt();
|
||||
// _Dps_UpdateCreatureEnchantMysql_(Card_Id, SUser.GetCID(), uuid);
|
||||
// }
|
||||
// local Pack = Packet();
|
||||
// Pack.Put_Header(1, 275);
|
||||
// Pack.Put_Byte(1);
|
||||
// Pack.Finalize(true);
|
||||
// SUser.Send(Pack);
|
||||
// Pack.Delete();
|
||||
// SUser.SendUpdateItemList(1, 7, a7);
|
||||
// InvenObj.DeleteItemCount(Bead_id, 1);
|
||||
// SUser.SendUpdateItemList(1, 0, args[3]);
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
// Cb_reach_game_world_Func["宠物附魔"] <- function(SUser) {
|
||||
// local Data = _Dps_GetCreatureEnchantMysql_(SUser.GetCID());
|
||||
// local DMap = {};
|
||||
// foreach(data_obj in Data) {
|
||||
// local uuid = data_obj[0];
|
||||
// local card_id = data_obj[1];
|
||||
// DMap.rawset(uuid, card_id);
|
||||
// }
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// for (local i = 0; i< 141; i++) {
|
||||
// local equ;
|
||||
// if (i == 140) {
|
||||
// equ = InvenObj.GetSlot(0, 22); //获取当前格子的宠物
|
||||
// } else {
|
||||
// equ = InvenObj.GetSlot(3, i);
|
||||
// }
|
||||
// local equ_uuid = NativePointer(equ.C_Object).add(7).readInt();
|
||||
// if (DMap.rawin(equ_uuid)) {
|
||||
// NativePointer(equ.C_Object).add(13).writeU32(DMap[equ_uuid]);
|
||||
// if (i == 140) SUser.SendUpdateItemList(1, 0, 22);
|
||||
// else SUser.SendUpdateItemList(1, 7, i);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// PacketDebugModel <- true;
|
||||
|
||||
// User.SendItemMail(1, 1, [{
|
||||
// item = 3037,
|
||||
// num = 10
|
||||
// }], "标题", "内容");
|
||||
|
||||
|
||||
|
||||
// Haker.LoadHook("0x085F2CC6", ["pointer", "pointer", "pointer", "int", "int", "int", "pointer", "int"],
|
||||
// function(args) {
|
||||
// foreach(value in args) {
|
||||
// print(value);
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// function(args) {
|
||||
// return null;
|
||||
// });
|
||||
}, 1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["aaa"] <- function(SUser, cmd) {
|
||||
// 获取角色背包
|
||||
|
||||
local InvenObj = SUser.GetInven();
|
||||
// 角色仓库
|
||||
local CargoObj = Sq_CallFunc(S_Ptr("0x08151a94"), "pointer", ["pointer"], SUser.C_Object);
|
||||
// 添加计数器
|
||||
local transferCount = 0;
|
||||
// 遍历背包消耗品栏及材料栏
|
||||
for (local i = 57; i <= 152; ++i) {
|
||||
// 获取背包物品
|
||||
local ItemObj = InvenObj.GetSlot(1, i);
|
||||
// 获取背包物品ID
|
||||
local Item_Id = ItemObj.GetIndex();
|
||||
local ItemName = PvfItem.GetNameById(Item_Id);
|
||||
// 如果物品ID为0或3037,跳过(在此可以添加其他需要跳过的物品ID)
|
||||
if (Item_Id == 0 || Item_Id == 3037) {
|
||||
continue;
|
||||
}
|
||||
// local Equ = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 9);
|
||||
|
||||
// 角色仓库是否存在背包物品
|
||||
local CargoSlot = Sq_CallFunc(S_Ptr("0x850bc14"), "int", ["pointer", "int"], CargoObj, Item_Id);
|
||||
// 如果角色仓库中没有该物品,跳过
|
||||
if (CargoSlot == -1) {
|
||||
continue;
|
||||
}
|
||||
// local Flag = Sq_CallFunc(S_Ptr("0x081201DC"), "bool", ["pointer"], Equ.C_Object);
|
||||
// print(Flag);
|
||||
|
||||
// 获取仓库物品指针
|
||||
local cargoItemPointer = NativePointer(CargoObj).add(4).readPointer();
|
||||
// 获取角色仓库物品对象
|
||||
local cargoItemObj = NativePointer(cargoItemPointer).add(61 * CargoSlot);
|
||||
// 获取角色仓库物品ID
|
||||
local cargoItemId = NativePointer(cargoItemPointer).add(61 * CargoSlot + 2).readU32();
|
||||
// 获取角色仓库物品数量
|
||||
local cargoItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], cargoItemObj.C_Object);
|
||||
|
||||
// 获取物品对象
|
||||
local PvfItem = PvfItem.GetPvfItemById(cargoItemId);
|
||||
local ptr = Memory.alloc(10240);
|
||||
ptr.Output(48);
|
||||
Sq_CallFunc(S_Ptr("0x084FB918"), "int", ["pointer", "pointer", "int", "int"], ptr.C_Object, InvenObj.C_Object, 1, 9);
|
||||
ptr.Output(48);
|
||||
// local TradeSpace = Sq_CallFunc(S_Ptr("0x08120242"), "bool", ["pointer"], SUser.C_Object, Inven.INVENTORY_TYPE_ITEM, 0);
|
||||
// print(ptr.);
|
||||
return;
|
||||
|
||||
// 获取物品可堆叠数量
|
||||
local getStackableLimit = Sq_CallFunc(S_Ptr("0x0822C9FC"), "int", ["pointer"], PvfItem.C_Object);
|
||||
// 获取角色背包
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// local ItemObj = InvenObj.GetSlot(1, 9);
|
||||
// print("Id:" + ItemObj.GetIndex());
|
||||
// print("Address:" + ItemObj.C_Object);
|
||||
|
||||
// 如果仓库已达堆叠上限,跳过此物品
|
||||
if (cargoItemCount >= getStackableLimit) {
|
||||
continue;
|
||||
}
|
||||
// print(NativePointer(ItemObj.C_Object).add(47).readS8());
|
||||
// NativePointer(ItemObj.C_Object).add(48).writeS8(100);
|
||||
// NativePointer(ItemObj.C_Object).add(49).writeS8(11);
|
||||
|
||||
// 获取背包物品数量
|
||||
local inventoryItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], ItemObj.C_Object);
|
||||
// 获取物品是否可堆叠
|
||||
local checkStackableLimit = Sq_CallFunc(S_Ptr("0x08501A79"), "int", ["int", "int"], cargoItemId, cargoItemCount + inventoryItemCount);
|
||||
// 尝试将物品储存至角色仓库中
|
||||
local tryAddStackItem = Sq_CallFunc(S_Ptr("0x0850B4B0"), "int", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||
if (tryAddStackItem >= 0) {
|
||||
// 正式将物品插入角色仓库中
|
||||
Sq_CallFunc(S_Ptr("0x850b672"), "pointer", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||
// 删除背包中的物品
|
||||
ItemObj.Delete();
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||
}
|
||||
// NativePointer(ItemObj.C_Object).add(50).writeS8(16);
|
||||
// NativePointer(ItemObj.C_Object).add(51).writeS8(100);
|
||||
// NativePointer(ItemObj.C_Object).add(52).writeS8(11);
|
||||
|
||||
// 处理可堆叠物品
|
||||
if (checkStackableLimit == 0) {
|
||||
// 获取物品总数
|
||||
local totalCount = cargoItemCount + inventoryItemCount;
|
||||
// NativePointer(ItemObj.C_Object).add(54).writeS8(16);
|
||||
// NativePointer(ItemObj.C_Object).add(55).writeS8(100);
|
||||
// NativePointer(ItemObj.C_Object).add(56).writeS8(11);
|
||||
|
||||
// 如果总数不超过上限,全部堆到仓库
|
||||
if (totalCount <= getStackableLimit) {
|
||||
// 将物品堆到仓库
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, totalCount);
|
||||
// 删除背包中的物品
|
||||
ItemObj.Delete();
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||
} else {
|
||||
// 如果总数超过上限
|
||||
// 将仓库的物品数量设置为最大数量
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, getStackableLimit);
|
||||
// 将背包数量减去转移至仓库的数量
|
||||
local transferAmount = getStackableLimit - cargoItemCount;
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], ItemObj.C_Object, totalCount - getStackableLimit);
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + transferAmount, 8);
|
||||
// ItemObj.Flush();
|
||||
// SUser.SendUpdateItemList(1, 0, 9);
|
||||
// ItemObj.Output();
|
||||
|
||||
// local OldData = blob(0);
|
||||
// foreach (value in ItemObj.Attribute) {
|
||||
// OldData.writen(value,'b');
|
||||
// // OldData.seek(1,'c');
|
||||
// }
|
||||
|
||||
// ItemObj.Attribute.seek(37);
|
||||
// local Address = ItemObj.Attribute.readn('i');
|
||||
// print(Address);
|
||||
// local Count = Sq_CallFunc(S_Ptr("0x08514E6E"), "int", ["pointer"], ItemObj.C_Object);
|
||||
// print("魔法封印装备的数量: " + Count);
|
||||
// local SendInfo = SUser.GiveItem(2243114, 1);
|
||||
|
||||
// local NewItemObj = InvenObj.GetSlot(1, SendInfo[1]);
|
||||
// if(NewItemObj){
|
||||
// NewItemObj.Attribute = OldData;
|
||||
// NewItemObj.Flush();
|
||||
// NewItemObj.Output();
|
||||
// SUser.SendUpdateItemList(1,0, SendInfo[1]);
|
||||
// }
|
||||
|
||||
// SUser.SendItemSpace(0);
|
||||
//先执行背包固化 把最新数据存到数据库
|
||||
Sq_CallFunc(S_Ptr("0x0864FE52"), "int", ["pointer"], SUser.C_Object);
|
||||
// Sq_CallFunc(S_Ptr("0x086501C8"), "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 = 1;", ["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 Slot = 0;
|
||||
local RealP = ReadPointer.add(2 + (9 + Slot) * 61);
|
||||
|
||||
//打印数据
|
||||
RealP.Output(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).readS8());
|
||||
}
|
||||
print(MagicSealP);
|
||||
|
||||
local SendT = {
|
||||
ItemId = ItemId,
|
||||
Grade = Grade,
|
||||
Durability = Durability,
|
||||
EnhancementLevel = EnhancementLevel,
|
||||
AmplifyType = AmplifyType,
|
||||
AmplifyValue = AmplifyValue,
|
||||
MagicSealP = MagicSealP,
|
||||
CardId = CardId,
|
||||
}
|
||||
SendItemExMail(1, 1, [SendT], "GM", "GM");
|
||||
}
|
||||
}, 1)
|
||||
}
|
||||
|
||||
// 通知客户端更新背包
|
||||
SUser.SendUpdateItemList(1, 0, i);
|
||||
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;
|
||||
}
|
||||
|
||||
if (transferCount == 0) {
|
||||
SUser.SendNotiBox("没有可转移的物品!", 1);
|
||||
}
|
||||
// 通知客户端更新仓库
|
||||
SUser.SendItemSpace(2);
|
||||
local time = date();
|
||||
local timeStr = time["year"] + "-" + (time["month"] + 1) + "-" + time["day"] + " " + time["hour"] + ":" + time["min"] + ":" + time["sec"];
|
||||
|
||||
print(666);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["bbb"] <- function(SUser, cmd) {
|
||||
// print(124124);
|
||||
// Sq_CUser_RechargeCoupons(SUser.C_Object, 909999);
|
||||
// Sq_CallFunc(S_Ptr("0x0817A1B4"), "int", ["pointer","int"], SUser.C_Object,100000);
|
||||
SUser.GiveItem(2220112, 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1134,4 +1405,167 @@ Register_DPS_Pack(1, function(SUser, Pack) {
|
|||
// Msg = MsgBuffer,
|
||||
// };
|
||||
// SUser.SendJso(evv);
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// /*
|
||||
// 文件名:收集图鉴_移植.nut
|
||||
// 路径:OfficialProject/收集图鉴_移植/收集图鉴_移植.nut
|
||||
// 创建日期:2025-05-05 05:22
|
||||
// 文件用途:
|
||||
// */
|
||||
|
||||
// function collect_check(id) {
|
||||
// local CheckSql = "select id from `collect`.`s_item` where id = " + id + ";";
|
||||
// //从池子拿连接
|
||||
// local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
// local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||
// //把连接还池子
|
||||
// MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
// if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
// return false;
|
||||
// } else {
|
||||
// return Ret[0][0];
|
||||
// }
|
||||
// }
|
||||
|
||||
// function collect_check_has(uid, item) {
|
||||
// local CheckSql = "select num from `collect`.`g_user_item` where uid = " + uid + " and item = " + item + ";";
|
||||
// //从池子拿连接
|
||||
// local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
// local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||
// //把连接还池子
|
||||
// MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
// if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
// return false;
|
||||
// } else {
|
||||
// return Ret[0][0];
|
||||
// }
|
||||
// }
|
||||
|
||||
// function collect_update(uid, item, type, num) {
|
||||
// local CheckSql = "select id,num from `collect`.`g_user_item` where uid = " + uid + " and item = " + item + ";";
|
||||
// //从池子拿连接
|
||||
// local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
// local Ret = SqlObj.Select(CheckSql, ["int", "int"]);
|
||||
// if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
// local InsertSql = "INSERT INTO `collect`.`g_user_item`(`uid`,`item`,`type`,`num`) VALUES(" + uid + "," + item + "," + type + "," + num + ");";
|
||||
// SqlObj.Exec_Sql(InsertSql);
|
||||
// } else {
|
||||
// local id = Ret[0][0];
|
||||
// local newnum = Ret[0][1] + num;
|
||||
// local UpdateSql = "update `collect`.`g_user_item` set num = " + newnum + " where id = " + id + ";";
|
||||
// SqlObj.Exec_Sql(UpdateSql);
|
||||
// }
|
||||
// //把连接还池子
|
||||
// MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
// }
|
||||
|
||||
// function collect_equ(SUser, Slot) { //将装备收录进图鉴user slot
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// local EquObj = InvenObj.GetSlot(1, Slot);
|
||||
// local EquId = EquObj.GetIndex();
|
||||
// local Msg = "";
|
||||
// if (collect_check(equ_id)) { //是否支持收录
|
||||
// local mid = SUser.GetUID();
|
||||
// if (collect_check_has(mid, equ_id)) { //是否已收录
|
||||
// msg = "已收录过该装备。";
|
||||
// } else {
|
||||
// local ItemName = PvfItem.GetNameById(EquId);
|
||||
// Sq_CallFunc(S_Ptr("0x080CB7D8"), "int", ["pointer"], EquObj.C_Object);
|
||||
// SUser.SendUpdateItemList(1, 0, Slot);
|
||||
// collect_update(mid, equ_id, 1, 1); //更新图鉴
|
||||
// msg = "装备[" + equ_name + "]已成功收录至图鉴。";
|
||||
// }
|
||||
// } else {
|
||||
// msg = "该装备不支持图鉴收录。";
|
||||
// }
|
||||
// SUser.SendNotiPacketMessage(msg, 0);
|
||||
// }
|
||||
|
||||
// if (!getroottable().rawin("collcet_monster_cache")) collcet_monster_cache <- {};
|
||||
|
||||
// function _Dps_CollectIllustrationsAndTransplantThem_Main_() {
|
||||
|
||||
// Cb_CParty_DungeonStart_Enter_Func["收集图鉴移植"] <- function(args) {
|
||||
// local PartyObj = Party(args[0]);
|
||||
// PartyObj.ForeachMember(function(SUser, Index) {
|
||||
// local mid = SUser.GetUID();
|
||||
// collcet_monster_cache[mid] <- {};
|
||||
// });
|
||||
// }
|
||||
|
||||
// Cb_CParty_OnKillMonster_Enter_Func["收集图鉴移植"] <- function(args) {
|
||||
// local SUser = User(args[1]);
|
||||
// local MonsterId = args[2];
|
||||
// local Config = GlobalConfig.Get("收集图鉴移植_Lenheart.json");
|
||||
// if (Config.rawin(MonsterId.tostring())) {
|
||||
// local MonsterName = Config[MonsterId.tostring()];
|
||||
// local mid = SUser.GetUID();
|
||||
// if (collcet_monster_cache.rawin(mid)) {
|
||||
// collcet_monster_cache[mid][MonsterId] <- 1;
|
||||
// SUser.SendNotiPacketMessage("获得[" + MonsterName + "]。碎片1个。", 0);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// Cb_CParty_SetPlayResult_Enter_Func["收集图鉴移植"] <- function(args) {
|
||||
// local PartyObj = Party(args[0]);
|
||||
// PartyObj.ForeachMember(function(SUser, Index) {
|
||||
// local mid = SUser.GetUID();
|
||||
// if (collcet_monster_cache.rawin(mid)) {
|
||||
// foreach(key, value in collcet_monster_cache[mid]) {
|
||||
// collect_update(mid, key, 2, value);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// // 跳过指定道具ID原逻辑1
|
||||
// Cb_UseLimitCube_Check_Error_Leave_Func["收集图鉴移植"] <- function(args) {
|
||||
// local ItemObj = Item(args[5]);
|
||||
// local ItemId = ItemObj.GetIndex();
|
||||
// if (ItemId == 690000274) {
|
||||
// return 17;
|
||||
// }
|
||||
// }
|
||||
|
||||
// Cb_UseLimitCube_Process_Leave_Func["收集图鉴移植"] <- function(args) {
|
||||
// local SUser = User(args[1]);
|
||||
// local msg_base = args[2];
|
||||
// if (msg_base) {
|
||||
// local slot = NativePointer(msg_base).add(13).readShort();
|
||||
// local boxslot = NativePointer(msg_base).add(19).readShort();
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// local boxobj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, boxslot);
|
||||
// local box_index = boxobj.GetIndex();
|
||||
// local ItemObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, slot);
|
||||
// local Item_Id = ItemObj.GetIndex();
|
||||
// if (!ItemObj) return;
|
||||
// if (box_index == 690000274) {
|
||||
// local msg = "";
|
||||
// if (collect_check(Item_Id)) {
|
||||
// local mid = SUser.GetUID();
|
||||
// if (collect_check_has(mid, Item_Id)) {
|
||||
// msg = "已收录过该装备。";
|
||||
// } else {
|
||||
// local ItemName = PvfItem.GetNameById(Item_Id);
|
||||
// Sq_CallFunc(S_Ptr("0x080CB7D8"), "int", ["pointer"], ItemObj.C_Object);
|
||||
// collect_update(mid, Item_Id, 1, 1); //更新图鉴
|
||||
// SUser.SendUpdateItemList(Inven.INVENTORY_TYPE_ITEM, 0, slot);
|
||||
// msg = "装备[" + ItemName + "]已成功收录至图鉴。";
|
||||
// }
|
||||
// }else msg = "该装备不支持图鉴收录。";
|
||||
// SUser.SendNotiPacketMessage(msg, 0);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
|
@ -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,7 @@
|
|||
创建日期:2024-05-01 16:24
|
||||
文件用途:服务端核心类
|
||||
*/
|
||||
Dps_Self_Ip <- "192.168.200.110";
|
||||
function removeBackslashes(str) {
|
||||
local result = "";
|
||||
local index = 0;
|
||||
|
|
@ -91,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) {
|
||||
|
|
@ -359,8 +366,17 @@ class ServerControl {
|
|||
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);
|
||||
|
||||
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
|
||||
|
|
@ -375,7 +391,6 @@ class ServerControl {
|
|||
return;
|
||||
}
|
||||
|
||||
print(num);
|
||||
for (local i = 0; i< 120; i++) {
|
||||
local ItemObj = InvenObj.GetSlot(3, i);
|
||||
if (ItemObj != null && ItemObj.GetIndex() == ItemId) {
|
||||
|
|
@ -387,7 +402,7 @@ class ServerControl {
|
|||
num++;
|
||||
}
|
||||
};
|
||||
print(num);
|
||||
}
|
||||
}
|
||||
|
||||
Jso.Count <- num;
|
||||
|
|
@ -741,9 +756,7 @@ class ServerControl {
|
|||
//给注册玩家通关副本
|
||||
GatewaySocketPackFuncMap.rawset(2023110704, function(Jso) {
|
||||
local RealOp = Jso.realop;
|
||||
print("注册副本了");
|
||||
Cb_ClearDungeon_Enter_Func[RealOp] <- function(arg) {
|
||||
print("通关副本了");
|
||||
local PartyObj = Party(arg[0]);
|
||||
if (PartyObj) {
|
||||
local Bfobj = PartyObj.GetBattleField();
|
||||
|
|
@ -839,6 +852,7 @@ class ServerControl {
|
|||
}
|
||||
Socket.SendGateway(T);
|
||||
}
|
||||
|
||||
//玩家上线
|
||||
Cb_reach_game_world_Func["Rindro_player_reach_game_world"] <- function(SUser) {
|
||||
local T = {
|
||||
|
|
@ -1013,7 +1027,6 @@ class ServerControl {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
Cb_GetUserInfo_Leave_Func.ServerControl <- function(args) {
|
||||
if (args.pop() >= 0) {
|
||||
local SUser = User(args[1]);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
@ -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();
|
||||
|
|
@ -9,7 +9,7 @@ function _Hook_Enter_Currency_Func_(args, TableObj) {
|
|||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf != null) Ret = Buf;
|
||||
if (Buf) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ function _Hook_Leave_Currency_Func_(args, TableObj) {
|
|||
local Ret = null;
|
||||
foreach(Func in TableObj) {
|
||||
local Buf = Func(args);
|
||||
if (Buf != null) Ret = Buf;
|
||||
if (Buf) Ret = Buf;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ _Hook_Register_Currency_Func_("0x866A3FE", ["pointer", "int", "int", "int", "int
|
|||
//货币收益
|
||||
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);
|
||||
_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 <- {};
|
||||
|
|
@ -457,21 +457,29 @@ 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 <- {};
|
||||
|
|
@ -485,9 +493,101 @@ _Hook_Register_Currency_Func_("0x081BE46A", ["pointer", "pointer", "pointer", "i
|
|||
// 服务器被Kill时(不含炸频道等)
|
||||
Cb_Server_ClossByKill_Enter_Func <- {};
|
||||
Cb_Server_ClossByKill_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x082FD90E", ["pointer", "int"], 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);
|
||||
_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);
|
||||
|
|
@ -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();
|
||||
|
|
@ -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();
|
||||
|
|
@ -24,7 +24,10 @@ function InitPluginInfo() {
|
|||
|
||||
GameManager.Fix14Skill();
|
||||
|
||||
Sq_CreatSocketConnect("192.168.200.20", "65109");
|
||||
// Sq_CreatSocketConnect("192.168.200.20", "65109");
|
||||
// Sq_CreatSocketConnect("49.234.27.222", "65109");
|
||||
Sq_CreatSocketConnect("127.0.0.1", "65109");
|
||||
|
||||
|
||||
//初始化结婚
|
||||
// ProjectInitFuncMap.P_Marry <- Marry();
|
||||
|
|
@ -41,6 +44,7 @@ function InitPluginInfo() {
|
|||
|
||||
GameManager.OpenCreateJob_CreatorMage();
|
||||
GameManager.FixPracticemode();
|
||||
GameManager.SetGameMaxLevel(85);
|
||||
|
||||
|
||||
// function IndependenceDropLogic(SUser, MonsterId, MonsterLevel, Xpos, Ypos, DgnName, DgnId, DgnLevel,DgnDiff, HellDiff)
|
||||
|
|
@ -67,8 +71,8 @@ function PrintTag() {
|
|||
}
|
||||
|
||||
|
||||
function main() {
|
||||
|
||||
function main() {
|
||||
InitPluginInfo();
|
||||
|
||||
PrintTag();
|
||||
|
|
@ -82,7 +86,7 @@ function main() {
|
|||
GameManager.FixDespairGold();
|
||||
GameManager.FixGlodTradeDaily(80000000);
|
||||
|
||||
// local PvfObject = Script();
|
||||
local PvfObject = Script();
|
||||
// local Data = ScriptData.GetEquipment(305014);
|
||||
// printT(Data);
|
||||
|
||||
|
|
@ -91,7 +95,7 @@ function main() {
|
|||
|
||||
_Official_Project_();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329) {
|
||||
// function _Rindro_OldLogic_Enter(CUser, PacketId, PacketSrc) {
|
||||
|
|
@ -210,10 +214,6 @@ function main() {
|
|||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
function onil() {
|
||||
print(11);
|
||||
|
|
@ -238,4 +238,6 @@ Timer.SetCronTask(onil, "0/10 * * * * *");
|
|||
// getroottable().CombatRankServerProject <- CombatRank();
|
||||
// getroottable().ServerControlProject <- ServerControl();
|
||||
// getroottable().AntonServerProject <- Anton();
|
||||
// getroottable().FiendwarServerProject <- Fiendwar();
|
||||
// getroottable().FiendwarServerProject <- Fiendwar();
|
||||
|
||||
|
||||
|
|
|
|||
15
Main.nut
15
Main.nut
|
|
@ -1,5 +1,5 @@
|
|||
function sqr_main() {
|
||||
// GameManager.OpenHotFix("/dp_s/OfficialConfig");
|
||||
GameManager.OpenHotFix("/dp_s/OfficialConfig");
|
||||
GameManager.OpenHotFix("/dp_s/MyProject");
|
||||
// GameManager.SetGameMaxLevel(70);
|
||||
// Cb_History_MileageSet_Func["TW_reach_game_world"] <- function(SUser, Data) {
|
||||
|
|
@ -12,16 +12,3 @@ function sqr_main() {
|
|||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["op"] <- function(SUser, CmdString) {
|
||||
|
||||
local Jso = {
|
||||
op <- "20060007";
|
||||
uid <- SUser.GetUID();
|
||||
cid <- SUser.GetCID();
|
||||
}
|
||||
print(111);
|
||||
Socket.SendGateway(Jso);
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"发送道具指令": "GiveItem",
|
||||
"转职觉醒指令": "GrowType",
|
||||
"完成任务指令": "MakeQuest",
|
||||
"设置等级指令": "SetLevel",
|
||||
"获取位置指令": "GetLocation",
|
||||
"踢玩家下线指令": "KickPlayer",
|
||||
|
||||
"发送道具指令例子": "当有一个空格时跟道具编号 当有两个空格时 跟道具编号和发送数量 例: '//GiveItem 3037' '//GiveItem 3037 100'",
|
||||
"转职觉醒指令例子": "当有一个空格时跟转职职业 当有两个空格时 跟转职职业和是否觉醒 例: '//GrowType 1' '//GrowType 1 1'",
|
||||
"完成任务指令例子": "当有一个空格时跟任务编号 例: '//MakeQuest 1'",
|
||||
"设置等级指令例子": "当有一个空格时跟设定等级 例: '//SetLevel 100'",
|
||||
"获取位置指令例子": "无特殊用法 '//GetLocation'",
|
||||
"踢玩家下线指令例子": "当有一个空格时跟想要踢除的玩家名字 例: '//KickPlayer 倾泪寒'",
|
||||
"说明" : "所有指令都可更改 相对于的触发方式输入自己设定的指令即可"
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"分解卷的道具ID": 17577,
|
||||
"是否返还_true代表返还false代表不返还": true,
|
||||
"一键分解的起始位置_就是背包从第几格开始": 0,
|
||||
"一键分解的结束位置_就是背包到第几格结束": 16
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"一键存仓命令": "yjcc"
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"需要完成的任务编号" : [674,649,675,650],
|
||||
"注意事项": "请确保你的任务需求等级是1级,否则可能无法完成。请在PVF中更改任务需要的等级。"
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"转职初始职业":[7577],
|
||||
"转职第一职业":[7577],
|
||||
"转职第二职业":[7577],
|
||||
"转职第三职业":[7577],
|
||||
"转职第四职业":[7577],
|
||||
"转职第五职业":[7577]
|
||||
}
|
||||
|
|
@ -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": "地狱级"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"公告": "缺少进入凭证:",
|
||||
"副本需要持有道具才允许进入":{
|
||||
"65":3038,
|
||||
"64":3038
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"无需配置":0
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
{
|
||||
"奖励控制": {
|
||||
"开关说明(true为开启,false为关闭)这是提示请无视,后面的0也不用管":0,
|
||||
"多件史诗奖励控制开关": true,
|
||||
"多件神器奖励控制开关": false,
|
||||
"多件稀有奖励控制开关": false,
|
||||
"稀有装备开关如果开启会导致可以在副本内丢弃拾取领取奖励,需搭配禁止丢弃物品使用(这是提示请无视,后面的0也不用管)":0,
|
||||
"tips>>>如果奖励填0代表点券(这是提示请无视,后面的0也不用管)":0,
|
||||
"多件SS对应奖励(史诗)": {
|
||||
"2": [
|
||||
[3038, 2],
|
||||
[3037, 10]
|
||||
],
|
||||
"3": [
|
||||
[0, 10000],
|
||||
[123014, 10]
|
||||
],
|
||||
"4": [
|
||||
[0, 50000],
|
||||
[3037, 2000],
|
||||
[3038, 2000]
|
||||
],
|
||||
"5": [
|
||||
[0, 50000],
|
||||
[3037, 2000],
|
||||
[3038, 2000]
|
||||
]
|
||||
},
|
||||
"多件神器对应奖励": {
|
||||
"2": [
|
||||
[3038, 1],
|
||||
[3037, 5]
|
||||
],
|
||||
"3": [
|
||||
[0, 5000],
|
||||
[123014, 5]
|
||||
],
|
||||
"4": [
|
||||
[0, 20000],
|
||||
[3037, 1000],
|
||||
[3038, 1000]
|
||||
],
|
||||
"5": [
|
||||
[0, 20000],
|
||||
[3037, 1000],
|
||||
[3038, 1000]
|
||||
]
|
||||
},
|
||||
"多件稀有对应奖励": {
|
||||
"2": [
|
||||
[3038, 1],
|
||||
[3037, 2]
|
||||
],
|
||||
"3": [
|
||||
[0, 2000],
|
||||
[123014, 2]
|
||||
],
|
||||
"4": [
|
||||
[0, 10000],
|
||||
[3037, 500],
|
||||
[3038, 500]
|
||||
],
|
||||
"5": [
|
||||
[0, 10000],
|
||||
[3037, 500],
|
||||
[3038, 500]
|
||||
]
|
||||
}
|
||||
},
|
||||
"指定道具奖励控制": {
|
||||
"指定道具奖励控制开关": true,
|
||||
"指定道具对应奖励": {
|
||||
"3037": [
|
||||
[3038, 2],
|
||||
[3037, 10]
|
||||
],
|
||||
"3038": [
|
||||
[0, 10000],
|
||||
[123014, 10]
|
||||
],
|
||||
"3039": [
|
||||
[0, 50000],
|
||||
[3037, 2000],
|
||||
[3038, 2000]
|
||||
]
|
||||
}
|
||||
},
|
||||
"信息播报":{
|
||||
"发送位置":14,
|
||||
"标题":["-----------☆天降鸿运☆--------------", [255, 130, 0]],
|
||||
"内容颜色":[255, 120, 0],
|
||||
"结尾":["-----------☆恭喜这逼☆--------------", [255, 130, 0]]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"EpicPotionID": 2600006,
|
||||
"EpicPotionOdds": 1.0,
|
||||
"EpicPotionlist": {
|
||||
"1": 1.1,
|
||||
"2": 1.0
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"屏蔽词": ["测试屏蔽词","烟雨"]
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"重置券id": 7577
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"1" : "哥布林",
|
||||
"2" : "投掷哥布林"
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"奖励时间和内容": {
|
||||
"20:00":[
|
||||
[3037,10],
|
||||
[3038,10]
|
||||
],
|
||||
"21:00":[
|
||||
[3037,10],
|
||||
[3038,10]
|
||||
]
|
||||
},
|
||||
"公告":"%s 的在线奖励以发放,请注意查收"
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"是否允许创建": true
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"数据库IP 不是外置数据库不要更改": "127.0.0.1",
|
||||
"数据库端口 不懂不要更改": 3306,
|
||||
"数据库用户名 本地用户名不懂不要更改": "game",
|
||||
"数据库密码 本地密码不懂不要更改": "uu5!^%jg"
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"副本集合": {
|
||||
"1": 0.2,
|
||||
"2": 0.01,
|
||||
"3": 0.01
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"缔造武器": 27600,
|
||||
"黑暗武士武器":35001
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"等级上限": 86
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"设置装备解锁需要的冷却时间_单位秒": 10
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"CrossoverStr1": "装备栏1号位没有装备..",
|
||||
"CrossoverStr2": "跨界失败,请检查一下账号金库是否没有开启或者没有空位",
|
||||
"CrossoverStr3": "跨界失败",
|
||||
"CrossoverStr4": "跨界成功,已经装备栏第一格的 [%s] 转移至账号金库",
|
||||
"CrossoverStr5": "跨界失败, [%s] 不可以跨界",
|
||||
"CrossoverId": 17577,
|
||||
"NoCrossIdArr" : [26058]
|
||||
}
|
||||
|
|
@ -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]秒..."
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"黄金品级调整箱id": 897
|
||||
|
||||
}
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
function _Dps_GmConvenienceConsole_Logic_() {
|
||||
local Config = GlobalConfig.Get("GM便捷操作台_Lenheart.json");
|
||||
|
||||
|
||||
Gm_InputFunc_Handle[Config["发送道具指令"]] <- 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) {
|
||||
local Ret = SUser.GiveItem(handler[1].tointeger(), 1);
|
||||
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
|
||||
} else if (count == 2) {
|
||||
local Ret = SUser.GiveItem(handler[1].tointeger(), handler[2].tointeger());
|
||||
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
|
||||
}
|
||||
}
|
||||
|
||||
Gm_InputFunc_Handle[Config["转职觉醒指令"]] <- 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) {
|
||||
SUser.ChangeGrowType(handler[1].tointeger(), 0);
|
||||
SUser.SendNotiPacket(0, 2, 0);
|
||||
SUser.InitSkillW(handler[1].tointeger(), 0);
|
||||
} else if (count == 2) {
|
||||
SUser.ChangeGrowType(handler[1].tointeger(), handler[2].tointeger());
|
||||
SUser.SendNotiPacket(0, 2, 0);
|
||||
SUser.InitSkillW(handler[1].tointeger(), handler[2].tointeger());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Gm_InputFunc_Handle[Config["完成任务指令"]] <- 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) {
|
||||
SUser.ClearQuest_Gm(handler[1].tointeger());
|
||||
}
|
||||
}
|
||||
|
||||
Gm_InputFunc_Handle[Config["设置等级指令"]] <- 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) {
|
||||
SUser.SetCharacLevel(handler[1].tointeger());
|
||||
}
|
||||
}
|
||||
|
||||
//获取位置信息
|
||||
Gm_InputFunc_Handle[Config["获取位置指令"]] <- function(SUser, CmdString) {
|
||||
local Location = SUser.GetLocation();
|
||||
SUser.SendNotiPacketMessage("X坐标: " + Location.Pos.X, 8);
|
||||
SUser.SendNotiPacketMessage("Y坐标: " + Location.Pos.Y, 8);
|
||||
SUser.SendNotiPacketMessage("城镇编号: " + Location.Town, 8);
|
||||
SUser.SendNotiPacketMessage("区域编号: " + Location.Area, 8);
|
||||
};
|
||||
|
||||
//踢人下线
|
||||
Gm_InputFunc_Handle[Config["踢玩家下线指令"]] <- 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) {
|
||||
local TUser = World.GetUserByName(handler[1]);
|
||||
if(TUser)TUser.Kick();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
function _Dps_GmConvenienceConsole_Main_() {
|
||||
_Dps_GmConvenienceConsole_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_GmConvenienceConsole_Main_Reload_(OldConfig) {
|
||||
|
||||
foreach (Key,Value in OldConfig) {
|
||||
try {
|
||||
Gm_InputFunc_Handle.rawdelete(Key);
|
||||
} catch (exception){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_Dps_GmConvenienceConsole_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "GM便捷操作台",
|
||||
"ProjectDescribe": "本项目提供了许多GM的便捷操作 方便平时调试或写代码 \n输入'//' + 设定的指令即可执行逻辑 ",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "GM便捷操作台_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"GM便捷操作台.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_GmConvenienceConsole_Main_"
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "一键分解卷",
|
||||
"ProjectDescribe": "一键分解卷 需要先开启自己的分解师副职业",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "一键分解卷_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"一键分解卷.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_OneClickDisassemblyOfRoll_Main_"
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
function _Dps_OneClickDisassemblyOfRoll_Logic_() {
|
||||
|
||||
local Config = GlobalConfig.Get("一键分解卷_Lenheart.json");
|
||||
//分解券
|
||||
Cb_Use_Item_Sp_Func[Config["分解卷的道具ID"]] <- function(SUser, ItemId) {
|
||||
local Config = GlobalConfig.Get("一键分解卷_Lenheart.json");
|
||||
if (Config["是否返还_true代表返还false代表不返还"])
|
||||
SUser.GiveItem(ItemId, 1);
|
||||
|
||||
local is = SUser.GetCurCharacExpertJob();
|
||||
if (!is) {
|
||||
SUser.SendNotiPacketMessage("未开启分解机", 8);
|
||||
return;
|
||||
}
|
||||
local inven = SUser.GetInven();
|
||||
|
||||
for (local i = (9 + Config["一键分解的起始位置_就是背包从第几格开始"]); i <= (48 + Config["一键分解的结束位置_就是背包到第几格结束"]); i++)
|
||||
{
|
||||
local itemObj = inven.GetSlot(1, i);
|
||||
local itemid = itemObj.GetIndex();
|
||||
|
||||
//如果这个位置有道具
|
||||
if (itemid != 0) {
|
||||
|
||||
local pvfitem = PvfItem.GetPvfItemById(itemid);
|
||||
|
||||
local rarity = pvfitem.GetRarity();
|
||||
if (rarity <= 3) {
|
||||
SUser.DisPatcher_DisJointItem_disjoint(i);
|
||||
}
|
||||
}
|
||||
SUser.SendItemSpace(0);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function _Dps_OneClickDisassemblyOfRoll_Main_() {
|
||||
_Dps_OneClickDisassemblyOfRoll_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_OneClickDisassemblyOfRoll_Main_Reload_(OldConfig) {
|
||||
Cb_Use_Item_Sp_Func.rawdelete(OldConfig["分解卷的道具ID"]);
|
||||
_Dps_OneClickDisassemblyOfRoll_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "一键存入个人金库",
|
||||
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可,在游戏中输入 //yjcc 即可一键存入个人金库,也可以在游戏中的快捷喊话中添加为快捷键 配置中可更改 yjcc 关键字",
|
||||
"ProjectAuthor": "倾泪寒 & 南瓜",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "一键存入个人金库_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"一键入库.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_OneClickStorage_Main_"
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
/*
|
||||
文件名:一键入库.nut
|
||||
路径:MyProject/一键入库.nut
|
||||
创建日期:2025-03-25 14:42
|
||||
文件用途:一键入库
|
||||
*/
|
||||
|
||||
function _Dps_OneClickStorage_Logic_() {
|
||||
local Config = GlobalConfig.Get("一键存入个人金库_Lenheart.json");
|
||||
//在游戏中输入//一键入库即可调用
|
||||
Gm_InputFunc_Handle[Config["一键存仓命令"]] <- function(SUser, Cmd) {
|
||||
// 获取角色背包
|
||||
local InvenObj = SUser.GetInven();
|
||||
// 角色仓库
|
||||
local CargoObj = Sq_CallFunc(S_Ptr("0x08151a94"), "pointer", ["pointer"], SUser.C_Object);
|
||||
// 添加计数器
|
||||
local transferCount = 0;
|
||||
// 遍历背包消耗品栏及材料栏
|
||||
for (local i = 57; i <= 152; ++i) {
|
||||
// 获取背包物品
|
||||
local ItemObj = InvenObj.GetSlot(1, i);
|
||||
// 获取背包物品ID
|
||||
local Item_Id = ItemObj.GetIndex();
|
||||
local ItemName = PvfItem.GetNameById(Item_Id);
|
||||
// 如果物品ID为0或3037,跳过(在此可以添加其他需要跳过的物品ID)
|
||||
if (Item_Id == 0 || Item_Id == 3037) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 角色仓库是否存在背包物品
|
||||
local CargoSlot = Sq_CallFunc(S_Ptr("0x850bc14"), "int", ["pointer", "int"], CargoObj, Item_Id);
|
||||
// 如果角色仓库中没有该物品,跳过
|
||||
if (CargoSlot == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取仓库物品指针
|
||||
local cargoItemPointer = NativePointer(CargoObj).add(4).readPointer();
|
||||
// 获取角色仓库物品对象
|
||||
local cargoItemObj = NativePointer(cargoItemPointer).add(61 * CargoSlot);
|
||||
// 获取角色仓库物品ID
|
||||
local cargoItemId = NativePointer(cargoItemPointer).add(61 * CargoSlot + 2).readU32();
|
||||
// 获取角色仓库物品数量
|
||||
local cargoItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], cargoItemObj.C_Object);
|
||||
|
||||
// 获取物品对象
|
||||
local PvfItem = PvfItem.GetPvfItemById(cargoItemId);
|
||||
|
||||
// 获取物品可堆叠数量
|
||||
local getStackableLimit = Sq_CallFunc(S_Ptr("0x0822C9FC"), "int", ["pointer"], PvfItem.C_Object);
|
||||
|
||||
// 如果仓库已达堆叠上限,跳过此物品
|
||||
if (cargoItemCount >= getStackableLimit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取背包物品数量
|
||||
local inventoryItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], ItemObj.C_Object);
|
||||
// 获取物品是否可堆叠
|
||||
local checkStackableLimit = Sq_CallFunc(S_Ptr("0x08501A79"), "int", ["int", "int"], cargoItemId, cargoItemCount + inventoryItemCount);
|
||||
// 尝试将物品储存至角色仓库中
|
||||
local tryAddStackItem = Sq_CallFunc(S_Ptr("0x0850B4B0"), "int", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||
if (tryAddStackItem >= 0) {
|
||||
// 正式将物品插入角色仓库中
|
||||
Sq_CallFunc(S_Ptr("0x850b672"), "pointer", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||
// 删除背包中的物品
|
||||
ItemObj.Delete();
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||
}
|
||||
|
||||
// 处理可堆叠物品
|
||||
if (checkStackableLimit == 0) {
|
||||
// 获取物品总数
|
||||
local totalCount = cargoItemCount + inventoryItemCount;
|
||||
|
||||
// 如果总数不超过上限,全部堆到仓库
|
||||
if (totalCount <= getStackableLimit) {
|
||||
// 将物品堆到仓库
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, totalCount);
|
||||
// 删除背包中的物品
|
||||
ItemObj.Delete();
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||
} else {
|
||||
// 如果总数超过上限
|
||||
// 将仓库的物品数量设置为最大数量
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, getStackableLimit);
|
||||
// 将背包数量减去转移至仓库的数量
|
||||
local transferAmount = getStackableLimit - cargoItemCount;
|
||||
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], ItemObj.C_Object, totalCount - getStackableLimit);
|
||||
transferCount++;
|
||||
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + transferAmount, 8);
|
||||
}
|
||||
}
|
||||
|
||||
// 通知客户端更新背包
|
||||
SUser.SendUpdateItemList(1, 0, i);
|
||||
}
|
||||
|
||||
if (transferCount == 0) {
|
||||
SUser.SendNotiBox("没有可转移的物品!", 1);
|
||||
}
|
||||
// 通知客户端更新仓库
|
||||
SUser.SendItemSpace(2);
|
||||
}
|
||||
}
|
||||
//启动函数 自定义的需要写在ifo中
|
||||
function _Dps_OneClickStorage_Main_() {
|
||||
_Dps_OneClickStorage_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_OneClickStorage_Main_Reload(OldConfig) {
|
||||
Gm_InputFunc_Handle.rawdelete(OldConfig["一键存仓命令"]);
|
||||
_Dps_OneClickStorage_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "上线自动完成任务",
|
||||
"ProjectDescribe": "上线自动完成任务",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "上线自动完成任务_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"上线自动完成任务.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_AutomaticallyCompleteTasksOnline_Main_"
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
function _Dps_AutomaticallyCompleteTasksOnline_Main_() {
|
||||
Cb_History_MileageSet_Func["_DPS_上线自动完成任务_"] <- function(SUser, Data) {
|
||||
local Config = GlobalConfig.Get("上线自动完成任务_Lenheart.json");
|
||||
local QuestArr = Config["需要完成的任务编号"];
|
||||
foreach(QuestId in QuestArr) {
|
||||
SUser.ClearQuest_Gm(QuestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "修复卡NPC商店道具",
|
||||
"ProjectDescribe": "修复了客户端通过BUG卡NPC商店道具的问题",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"修复卡NPC商店道具.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_RepairCardNpcStoreProps_Main_"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
|
||||
|
||||
function _Dps_RepairCardNpcStoreProps_Main_()
|
||||
{
|
||||
Cb_BuyItem_Get_Data_Leave_Func["_DPS_RepairCardNpcStoreProps_"] <- function (args)
|
||||
{
|
||||
if(NativePointer(args[3]).add(156).readInt() < 0){
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"ProjectName": "全职业通用转职书",
|
||||
"ProjectDescribe": "全职业都可用的转职书。每个转职职业是个数组,可以写多个转职卷编号,仿照7577的道具类型即可,使用\",\"隔开。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectConfig": "全职业通用转职书_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"全职业通用转职书.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_GeneralJobTransferCertificateForAllProfessions_Main_"
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "副本需要持有道具进入",
|
||||
"ProjectDescribe": "副本需要持有道具进入",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "副本需要持有道具进入_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"副本需要持有道具进入.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MapNeedItem_Main_"
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
function _Dps_MapNeedItem_Main_() {
|
||||
|
||||
// 禁止进入副本
|
||||
Cb_SelectDungeon_Check_Error_Leave_Func.MapNeedItem <- function (args) {
|
||||
|
||||
|
||||
local Config = GlobalConfig.Get("副本需要持有道具进入_Lenheart.json");
|
||||
|
||||
local body = Config["副本需要持有道具才允许进入"];
|
||||
|
||||
local SUser = User(args[1]);
|
||||
|
||||
local mapid = NativePointer(args[2]).add(13).readShort();
|
||||
if(body.rawin(mapid.tostring())){
|
||||
local ItemId = body[mapid.tostring()];
|
||||
local PartyObj = SUser.GetParty();
|
||||
if (!PartyObj) {
|
||||
return;
|
||||
}
|
||||
for (local i = 0; i < 4; ++i) {
|
||||
local PSUser = PartyObj.GetUser(i);
|
||||
if (PSUser) {
|
||||
local InvenObj = SUser.GetInven();
|
||||
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
||||
if(SlotIdx == -1){
|
||||
SUser.SendNotiBox(Config["公告"]+PvfItem.GetNameById(ItemId),1);
|
||||
return 1; // 禁止进入副本
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "史诗免确认",
|
||||
"ProjectDescribe": "史诗免确认",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"史诗免确认.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EpicNoConfirmationRequired_Main_"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
function _Dps_EpicNoConfirmationRequired_Main_() {
|
||||
NativePointer("0x085A56CE").add(2).writeU8(9);
|
||||
Cb_CItem_IsRoutingItem_Leave_Func["DPSOFFICIAL"] <- function (args)
|
||||
{
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "史诗掉落奖励",
|
||||
"ProjectDescribe": "获取指定数量获得奖励以及指定道具获得奖励",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "史诗掉落奖励配置_南瓜.json",
|
||||
"ProjectFiles": [
|
||||
"史诗掉落奖励.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SSDL_nangua_Main_"
|
||||
}
|
||||
|
|
@ -1,333 +0,0 @@
|
|||
_SpecialItemBynangua <- {
|
||||
"Rarity4": {},
|
||||
"Rarity3": {},
|
||||
"Rarity2": {}
|
||||
}
|
||||
|
||||
function _Dps_SSDL_nangua_Main_() {
|
||||
//进入副本
|
||||
Cb_History_DungeonEnter_Func.RindroSSEnterByNangua <- function(SUser, Data) {
|
||||
_SpecialItemBynangua.Rarity4.rawset(SUser.GetCID(), []);
|
||||
_SpecialItemBynangua.Rarity3.rawset(SUser.GetCID(), []);
|
||||
_SpecialItemBynangua.Rarity2.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
|
||||
//离开副本
|
||||
Cb_History_DungeonLeave_Func.RindroSSLeaveByNangua <- function(SUser, Data) {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local PartyObj = SUser.GetParty();
|
||||
if (!PartyObj) return;
|
||||
local Bfobj = PartyObj.GetBattleField();
|
||||
local DgnObj = Bfobj.GetDgn();
|
||||
if (DgnObj) {
|
||||
local Dungeon_Name = DgnObj.GetName();
|
||||
|
||||
// 处理史诗装备
|
||||
if (_SpecialItemBynangua.Rarity4.rawin(SUser.GetCID())) {
|
||||
local ItemObjS = _SpecialItemBynangua.Rarity4[SUser.GetCID()];
|
||||
if (ItemObjS != null && ItemObjS.len() > 0) {
|
||||
local config = Cofig["奖励控制"]["多件SS对应奖励(史诗)"];
|
||||
local key = ItemObjS.len().tostring();
|
||||
if (config.rawin(key)) {
|
||||
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得史诗装备");
|
||||
foreach(ItemObj in ItemObjS) {
|
||||
local item_id = ItemObj.GetIndex();
|
||||
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
|
||||
}
|
||||
Nangua_SSMSG.SendCntMsg(ItemObjS.len());
|
||||
Nangua_SSMSG.SendMiddle();
|
||||
ProcessRewards(SUser, config[key]);
|
||||
Nangua_SSMSG.EndMsg();
|
||||
}
|
||||
}
|
||||
_SpecialItemBynangua.Rarity4.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
|
||||
// 处理神器装备
|
||||
if (_SpecialItemBynangua.Rarity3.rawin(SUser.GetCID())) {
|
||||
local ItemObjS = _SpecialItemBynangua.Rarity3[SUser.GetCID()];
|
||||
if (ItemObjS != null && ItemObjS.len() > 0) {
|
||||
local config = Cofig["奖励控制"]["多件神器对应奖励"];
|
||||
local key = ItemObjS.len().tostring();
|
||||
if (config.rawin(key)) {
|
||||
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得神器装备");
|
||||
foreach(ItemObj in ItemObjS) {
|
||||
local item_id = ItemObj.GetIndex();
|
||||
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
|
||||
}
|
||||
Nangua_SSMSG.SendCntMsg(ItemObjS.len());
|
||||
Nangua_SSMSG.SendMiddle();
|
||||
ProcessRewards(SUser, config[key]);
|
||||
Nangua_SSMSG.EndMsg();
|
||||
}
|
||||
}
|
||||
_SpecialItemBynangua.Rarity3.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
|
||||
// 处理稀有装备
|
||||
if (_SpecialItemBynangua.Rarity2.rawin(SUser.GetCID())) {
|
||||
local ItemObjS = _SpecialItemBynangua.Rarity2[SUser.GetCID()];
|
||||
if (ItemObjS != null && ItemObjS.len() > 0) {
|
||||
local config = Cofig["奖励控制"]["多件稀有对应奖励"];
|
||||
local key = ItemObjS.len().tostring();
|
||||
if (config.rawin(key)) {
|
||||
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得稀有装备");
|
||||
foreach(ItemObj in ItemObjS) {
|
||||
local item_id = ItemObj.GetIndex();
|
||||
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
|
||||
}
|
||||
Nangua_SSMSG.SendCntMsg(ItemObjS.len());
|
||||
Nangua_SSMSG.SendMiddle();
|
||||
ProcessRewards(SUser, config[key]);
|
||||
Nangua_SSMSG.EndMsg();
|
||||
}
|
||||
}
|
||||
_SpecialItemBynangua.Rarity2.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cb_UserHistoryLog_ItemAdd_Enter_Func.ItemAddByNangua <- function(args) {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local SUser = User(NativePointer(args[0]).readPointer());
|
||||
local InvenObj = SUser.GetInven();
|
||||
local ItemObj = Item(args[4]);
|
||||
local type = args[5];
|
||||
local PartyObj = SUser.GetParty();
|
||||
if (!PartyObj) return;
|
||||
local Bfobj = PartyObj.GetBattleField();
|
||||
local DgnObj = Bfobj.GetDgn();
|
||||
if (!DgnObj) return;
|
||||
local Dungeon_Name = DgnObj.GetName();
|
||||
if (!ItemObj) return;
|
||||
local item_id = ItemObj.GetIndex();
|
||||
local ItemType = Sq_CallFunc(S_Ptr("0x085018D2"), "int", ["pointer", "int"], InvenObj.C_Object, item_id);
|
||||
local pvfitem = PvfItem.GetPvfItemById(item_id);
|
||||
|
||||
// 史诗装备记录
|
||||
if (pvfitem.GetRarity() == 4 && type == 4 && ItemType == 1 && Cofig["奖励控制"]["多件史诗奖励控制开关"]) {
|
||||
if (!_SpecialItemBynangua.Rarity4.rawin(SUser.GetCID())) {
|
||||
_SpecialItemBynangua.Rarity4.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
_SpecialItemBynangua.Rarity4[SUser.GetCID()].append(ItemObj);
|
||||
}
|
||||
// 神器装备记录
|
||||
else if (pvfitem.GetRarity() == 3 && type == 4 && ItemType == 1 && Cofig["奖励控制"]["多件神器奖励控制开关"]) {
|
||||
if (!_SpecialItemBynangua.Rarity3.rawin(SUser.GetCID())) {
|
||||
_SpecialItemBynangua.Rarity3.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
_SpecialItemBynangua.Rarity3[SUser.GetCID()].append(ItemObj);
|
||||
}
|
||||
// 稀有装备记录
|
||||
else if (pvfitem.GetRarity() == 2 && type == 4 && ItemType == 1 && Cofig["奖励控制"]["多件稀有奖励控制开关"]) {
|
||||
if (!_SpecialItemBynangua.Rarity2.rawin(SUser.GetCID())) {
|
||||
_SpecialItemBynangua.Rarity2.rawset(SUser.GetCID(), []);
|
||||
}
|
||||
_SpecialItemBynangua.Rarity2[SUser.GetCID()].append(ItemObj);
|
||||
}
|
||||
|
||||
// 指定道具奖励逻辑保持不变
|
||||
if (!Cofig["指定道具奖励控制"]["指定道具奖励控制开关"]) return;
|
||||
local Itemid = item_id.tostring();
|
||||
if (Cofig["指定道具奖励控制"]["指定道具对应奖励"].rawin(Itemid) && type == 4) {
|
||||
Nangua_SSMSG.SendTitle(SUser, Dungeon_Name, "中获得特定道具");
|
||||
Nangua_SSMSG.ItemMsg(item_id, ItemObj);
|
||||
Nangua_SSMSG.SendMiddle();
|
||||
ProcessRewards(SUser, Cofig["指定道具奖励控制"]["指定道具对应奖励"][Itemid]);
|
||||
Nangua_SSMSG.EndMsg();
|
||||
}
|
||||
}
|
||||
// 处理奖励逻辑
|
||||
function ProcessRewards(SUser, rewards) {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local config = Cofig["信息播报"];
|
||||
local totalRewards = [];
|
||||
local rewardMessages = [];
|
||||
// 遍历奖励列表
|
||||
foreach(reward in rewards) {
|
||||
local itemId = reward[0];
|
||||
local itemCnt = reward[1];
|
||||
if (itemId == 0) {
|
||||
// 点券奖励
|
||||
local ceraMsgObj = AdMsg();
|
||||
ceraMsgObj.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
ceraMsgObj.PutString(" ");
|
||||
}
|
||||
ceraMsgObj.PutColorString("点券", config["内容颜色"]);
|
||||
ceraMsgObj.PutColorString("[" + itemCnt + "]", [255, 20, 0]);
|
||||
ceraMsgObj.Finalize();
|
||||
World.SendAll(ceraMsgObj.MakePack());
|
||||
ceraMsgObj.Delete();
|
||||
SUser.RechargeCera(itemCnt);
|
||||
} else {
|
||||
totalRewards.append([itemId, itemCnt]);
|
||||
local itemName = PvfItem.GetNameById(itemId);
|
||||
local color = Nangua_SSMSG.RarityColor(itemId);
|
||||
rewardMessages.append([itemName, itemCnt, color]);
|
||||
}
|
||||
}
|
||||
Nangua_SSMSG.api_CUser_Add_Item_list(SUser, totalRewards);
|
||||
// 发送奖励物品信息通知
|
||||
if (rewardMessages.len() > 0) {
|
||||
local rewardMsgObj = AdMsg();
|
||||
rewardMsgObj.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
rewardMsgObj.PutString(" ");
|
||||
}
|
||||
foreach(message in rewardMessages) {
|
||||
rewardMsgObj.PutColorString("[" + message[0] + "]", message[2]);
|
||||
rewardMsgObj.PutColorString("<" + message[1] + ">", [255, 20, 0]);
|
||||
rewardMsgObj.PutColorString("个", config["内容颜色"]);
|
||||
}
|
||||
rewardMsgObj.Finalize();
|
||||
World.SendAll(rewardMsgObj.MakePack());
|
||||
rewardMsgObj.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Nangua_SSMSG {
|
||||
function SendTitle(SUser, Dungeon_Name, msg) {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local config = Cofig["信息播报"];
|
||||
local title = AdMsg();
|
||||
title.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
title.PutString(" ");
|
||||
}
|
||||
title.PutColorString(config["标题"][0], config["标题"][1]);
|
||||
title.PutColorString("恭喜玩家", config["内容颜色"]);
|
||||
title.PutColorString("[" + SUser.GetCharacName() + "]", [255, 20, 0]);
|
||||
title.PutColorString("在", config["内容颜色"]);
|
||||
title.PutColorString("[" + Dungeon_Name + "]", [255, 20, 0]);
|
||||
title.PutColorString("" + msg + "", config["内容颜色"]);
|
||||
title.Finalize();
|
||||
World.SendAll(title.MakePack());
|
||||
title.Delete();
|
||||
}
|
||||
|
||||
function SendMiddle() {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local config = Cofig["信息播报"];
|
||||
local MiddleMsgObj = AdMsg();
|
||||
MiddleMsgObj.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
MiddleMsgObj.PutString(" ");
|
||||
}
|
||||
MiddleMsgObj.PutColorString("特此奖励:", config["内容颜色"]);
|
||||
MiddleMsgObj.Finalize();
|
||||
World.SendAll(MiddleMsgObj.MakePack());
|
||||
MiddleMsgObj.Delete();
|
||||
}
|
||||
|
||||
function SendCntMsg(cnt) {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local config = Cofig["信息播报"];
|
||||
local CntMsgObj = AdMsg();
|
||||
CntMsgObj.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
CntMsgObj.PutString(" ");
|
||||
}
|
||||
CntMsgObj.PutColorString("合计", config["内容颜色"]);
|
||||
CntMsgObj.PutColorString("[" + cnt + "]", [255, 20, 0]);
|
||||
CntMsgObj.PutColorString("件装备", config["内容颜色"]);
|
||||
CntMsgObj.Finalize();
|
||||
World.SendAll(CntMsgObj.MakePack());
|
||||
CntMsgObj.Delete();
|
||||
}
|
||||
|
||||
function ItemMsg(item_id, ItemObj) {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local config = Cofig["信息播报"];
|
||||
local MsgObj = AdMsg();
|
||||
MsgObj.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
MsgObj.PutString(" ");
|
||||
}
|
||||
MsgObj.PutEquipment("[" + PvfItem.GetNameById(item_id) + "]", ItemObj, Nangua_SSMSG.RarityColor(item_id));
|
||||
MsgObj.Finalize();
|
||||
World.SendAll(MsgObj.MakePack());
|
||||
MsgObj.Delete();
|
||||
}
|
||||
|
||||
function EndMsg() {
|
||||
local Cofig = GlobalConfig.Get("史诗掉落奖励配置_南瓜.json");
|
||||
local config = Cofig["信息播报"];
|
||||
local endMsgObj = AdMsg();
|
||||
endMsgObj.PutType(config["发送位置"]);
|
||||
if (config["发送位置"] != 14) {
|
||||
endMsgObj.PutString(" ");
|
||||
}
|
||||
endMsgObj.PutColorString(config["结尾"][0], config["结尾"][1]);
|
||||
endMsgObj.Finalize();
|
||||
World.SendAll(endMsgObj.MakePack());
|
||||
endMsgObj.Delete();
|
||||
}
|
||||
function api_CUser_Add_Item_list(SUser, item_list) {
|
||||
for (local i = 0; i < item_list.len(); i++) {
|
||||
local item_id = item_list[i][0]; // 道具代码
|
||||
local quantity = item_list[i][1]; // 道具数量
|
||||
local cnt = Nangua_SSMSG.checkInventorySlot(SUser, item_id);
|
||||
if (cnt == 1) {
|
||||
SUser.GiveItem(item_id, quantity); //使用窗口发送奖励
|
||||
} else {
|
||||
local RewardItems = [];
|
||||
RewardItems.append([item_id, quantity]);
|
||||
local title = "GM"
|
||||
local Text = "由于背包空间不足,已通过邮件发送,请查收!"
|
||||
//角色类 发送邮件函数 (标题, 正文, 金币, 道具列表[[3037,100],[3038,100]])
|
||||
SUser.ReqDBSendMultiMail(title, Text, 0, RewardItems)
|
||||
}
|
||||
}
|
||||
Nangua_SSMSG.SendItemWindowNotification(SUser, item_list);
|
||||
}
|
||||
function SendItemWindowNotification(SUser, item_list) {
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 163); //协议
|
||||
Pack.Put_Byte(1); //默认1
|
||||
Pack.Put_Short(0); //槽位id 填入0即可
|
||||
Pack.Put_Int(0); //未知 0以上即可
|
||||
Pack.Put_Short(item_list.len()); //道具组数
|
||||
//写入道具代码和道具数量
|
||||
for (local i = 0; i < item_list.len(); i++) {
|
||||
Pack.Put_Int(item_list[i][0]); //道具代码
|
||||
Pack.Put_Int(item_list[i][1]); //道具数量 装备/时装时 任意均可
|
||||
}
|
||||
Pack.Finalize(true); //确定发包内容
|
||||
SUser.Send(Pack); //发包
|
||||
Pack.Delete(); //清空buff区
|
||||
}
|
||||
/**
|
||||
* 根据道具类型背包空格数量
|
||||
* @param {pointer} SUser - 用户
|
||||
* @param {int} item_id - 需要查找的道具ID
|
||||
* @returns {int} - 空格数量
|
||||
*/
|
||||
function checkInventorySlot(SUser, itemid) {
|
||||
local InvenObj = SUser.GetInven();
|
||||
local type = Sq_CallFunc(S_Ptr("0x085018D2"), "int", ["pointer", "int"], InvenObj.C_Object, itemid);
|
||||
local cnt = Sq_CallFunc(S_Ptr("0x08504F64"), "int", ["pointer", "int", "int"], InvenObj.C_Object, type, 1);
|
||||
|
||||
return cnt;
|
||||
}
|
||||
function RarityColor(item_id) {
|
||||
local PvfItemObj = PvfItem.GetPvfItemById(item_id);
|
||||
if (PvfItemObj == null) {
|
||||
return;
|
||||
}
|
||||
local CItem_get_rarity = PvfItemObj.GetRarity(); // 装备品级
|
||||
return Nangua_SSMSG.rarityColorMap[(CItem_get_rarity).tostring()];
|
||||
}
|
||||
//品级对应的RGB
|
||||
rarityColorMap = {
|
||||
"0": [255, 255, 255], // 普通
|
||||
"1": [104, 213, 237], // 高级
|
||||
"2": [179, 107, 255], // 稀有
|
||||
"3": [255, 0, 255], // 神器
|
||||
"4": [255, 180, 0], // 史诗
|
||||
"5": [255, 102, 102], // 勇者
|
||||
"6": [255, 20, 147], // 深粉红色
|
||||
"7": [255, 215, 0] // 金色
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "史诗药剂",
|
||||
"ProjectDescribe": "通过指定ID的道具,使玩家获得爆率加成。",
|
||||
"ProjectAuthor": "倾泪寒 & 南瓜",
|
||||
"ProjectVersion": 1.4,
|
||||
"ProjectConfig": "史诗药剂配置文件.json",
|
||||
"ProjectFiles": [
|
||||
"史诗药剂.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EpicPotion_Main_"
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
文件名:史诗药剂.nut
|
||||
路径:MyProject/史诗药剂.nut
|
||||
创建日期:2025-03-28 10:21
|
||||
文件用途:史诗药剂
|
||||
*/
|
||||
|
||||
//启动函数 自定义的需要写在ifo中
|
||||
function _Dps_EpicPotion_Main_() {
|
||||
//注册获取道具稀有度进入回调
|
||||
Cb_GetItemRarity_Enter_Func["史诗药剂_逻辑"] <- function(args) {
|
||||
local Cofig = GlobalConfig.Get("史诗药剂配置文件.json");
|
||||
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, Cofig.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 = Cofig.EpicPotionOdds; // 默认药剂的增加几率
|
||||
// 检查是否VIP玩家
|
||||
local charac_no = userWithPotion.GetCID();
|
||||
if (Cofig.EpicPotionlist.rawin(charac_no)) {
|
||||
odds = Cofig.EpicPotionlist[charac_no];
|
||||
}
|
||||
// 计算新的roll值
|
||||
args[2] = MathClass.getMin(args[2] + args[2] * odds, MaxRoll);
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "屏蔽广告私聊和1v1聊天",
|
||||
"ProjectDescribe": "屏蔽广告私聊和1v1聊天",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "屏蔽广告私聊和1v1聊天.json",
|
||||
"ProjectFiles": [
|
||||
"屏蔽广告私聊和1v1聊天.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_BlockPrivateChatsWithSpecifiedConversationContent_Main_"
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
文件名:屏蔽指定对话内容的私聊和1v1聊天.nut
|
||||
路径:OfficialProject/屏蔽指定对话内容的私聊和1v1聊天/屏蔽指定对话内容的私聊和1v1聊天.nut
|
||||
创建日期:2025-04-19 19:17
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
getroottable()._LenheartUserLoseEfficacyState_ <- Memory.alloc(577477);
|
||||
Memory.reset(getroottable()._LenheartUserLoseEfficacyState_, 577477);
|
||||
|
||||
function _Dps_BlockPrivateChatsWithSpecifiedConversationContent_Main_() {
|
||||
Cb_SendMess_Enter_Func["Rindro"] <- function(args) {
|
||||
local PackCopyBuffer = Memory.alloc(10001);
|
||||
Memory.copy(PackCopyBuffer, NativePointer(args[2]), 1000);
|
||||
local Pack = Packet(PackCopyBuffer.C_Object);
|
||||
local Type = Pack.GetByte();
|
||||
if (Type == 1 || Type == 33) {
|
||||
Pack.GetShort();
|
||||
Pack.GetInt();
|
||||
local StrLen = Pack.GetInt();
|
||||
local SStr = Pack.GetString(256, StrLen);
|
||||
local Str = SStr.readUtf8String();
|
||||
local Conifg = GlobalConfig.Get("屏蔽广告私聊和1v1聊天.json");
|
||||
foreach(substr in Conifg["屏蔽词"]) {
|
||||
if (Str.find(substr) != null) {
|
||||
args[1] = getroottable()._LenheartUserLoseEfficacyState_.C_Object;
|
||||
return args;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "异界重置",
|
||||
"ProjectDescribe": "异界重置",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "异界重置_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"异界重置.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MapReset_Main_"
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
function _Dps_MapReset_Logic_() {
|
||||
|
||||
|
||||
}
|
||||
function _Dps_MapReset_Main_() {
|
||||
|
||||
local Config = GlobalConfig.Get("异界重置_Lenheart.json");
|
||||
//异界重置
|
||||
Cb_Use_Item_Sp_Func[Config["重置券id"]] <- function(SUser, ItemId) {
|
||||
for (local i = 0; i< 6; i++) {
|
||||
local dimensionInout = _Rindro_CDataManager_get_dimensionInout(Sq_CallFunc(S_Ptr("0x80CC19B"), "pointer"), i);
|
||||
_Rindro_CUserCharacInfo_setDemensionInoutValue(SUser.C_Object, i, dimensionInout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function _Rindro_CDataManager_get_dimensionInout(a, b) {
|
||||
return Sq_CallFunc(S_Ptr("0x0822b612"), "int", ["pointer", "int"], a, b);
|
||||
}
|
||||
|
||||
|
||||
function _Rindro_CUserCharacInfo_setDemensionInoutValue(a, b, c) {
|
||||
return Sq_CallFunc(S_Ptr("0x0822f184"), "int", ["pointer", "int", "int"], a, b, c);
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "整点在线奖励",
|
||||
"ProjectDescribe": "可以设置某一个时间点 全服发放奖励",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "整点在线奖励_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"整点在线奖励.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_TimeReward_identifying_Main_"
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
_TimeReward_identifying_Rindro_ <- 0;
|
||||
|
||||
function _Dps_TimeReward_identifying_Main_() {
|
||||
|
||||
Cb_timer_dispatch_Func.Time <- function() {
|
||||
local Config = GlobalConfig.Get("整点在线奖励_Lenheart.json");
|
||||
local DateObj = date();
|
||||
local HourminTime = DateObj.hour + ":" + DateObj.min;
|
||||
|
||||
if (!(HourminTime in Config["奖励时间和内容"])) {
|
||||
_TimeReward_identifying_Rindro_ = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_TimeReward_identifying_Rindro_ != 0) {
|
||||
return;
|
||||
}
|
||||
_TimeReward_identifying_Rindro_ = 1;
|
||||
|
||||
local reward = Config["奖励时间和内容"][HourminTime];
|
||||
local users = World.GetOnlinePlayer();
|
||||
users.apply(function(SUser) {
|
||||
foreach(itemR in reward) {
|
||||
SUser.GiveItem(itemR[0], itemR[1]);
|
||||
}
|
||||
});
|
||||
World.SendNotiPacketMessage(format(Config["公告"], HourminTime), 14);
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "时装与宠物清除卷",
|
||||
"ProjectDescribe": "通过指定ID的道具,将装备背包第前两行的时装或宠物清除。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "时装与宠物清除卷_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"时装与宠物清除卷.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_FashionAndPetClearanceRoll_Main_"
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
文件名:时装与宠物清除卷.nut
|
||||
路径:OfficialProject/时装与宠物清除卷/时装与宠物清除卷.nut
|
||||
创建日期:2025-04-01 21:42
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
function _Dps_FashionAndPetClearanceRoll_Logic_() {
|
||||
local Config = GlobalConfig.Get("时装与宠物清除卷_Lenheart.json");
|
||||
local PoolObj = MysqlPool.GetInstance();
|
||||
local Ip = Config["数据库IP 不是外置数据库不要更改"];
|
||||
local Port = Config["数据库端口 不懂不要更改"];
|
||||
local DbName = Config["数据库用户名 本地用户名不懂不要更改"];
|
||||
local Password = Config["数据库密码 本地密码不懂不要更改"];
|
||||
//设置数据库连接信息
|
||||
PoolObj.SetBaseConfiguration(Ip, Port, DbName, Password);
|
||||
//连接池大小
|
||||
PoolObj.PoolSize = 10;
|
||||
//初始化
|
||||
PoolObj.Init();
|
||||
//宠物删除
|
||||
Cb_Use_Item_Sp_Func[Config["宠物清除卷ID"]] <- function(SUser, ItemId) {
|
||||
if (Config["宠物清除券是否返还"]) SUser.GiveItem(ItemId, 1);
|
||||
local Cid = SUser.GetCID();
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (InvenObj) {
|
||||
for (local i = 0; i <= 13; i++) {
|
||||
local ItemObj = InvenObj.GetSlot(3, i);
|
||||
local Flag = false;
|
||||
if (ItemObj) {
|
||||
ItemObj.Delete();
|
||||
}
|
||||
}
|
||||
local Sql = "delete from taiwan_cain_2nd.creature_items where charac_no=" + Cid + " and slot < 13 ;";
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(Sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
SUser.SendItemSpace(7);
|
||||
SUser.SendNotiPacketMessage(Config["宠物清除完成提示"], 8);
|
||||
}
|
||||
}
|
||||
|
||||
//时装删除
|
||||
Cb_Use_Item_Sp_Func[Config["时装清除卷ID"]] <- function(SUser, ItemId) {
|
||||
if (Config["时装清除券是否返还"]) SUser.GiveItem(ItemId, 1);
|
||||
local Cid = SUser.GetCID();
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (InvenObj) {
|
||||
for (local i = 0; i <= 13; i++) {
|
||||
local ItemObj = InvenObj.GetSlot(2, i);
|
||||
if (ItemObj) {
|
||||
ItemObj.Delete();
|
||||
}
|
||||
}
|
||||
local Sql = "delete from taiwan_cain_2nd.user_items where charac_no=" + Cid + " and slot >= 10 and slot <= 23";
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(Sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
SUser.SendItemSpace(1);
|
||||
SUser.SendNotiPacketMessage(Config["时装清除完成提示"], 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _Dps_FashionAndPetClearanceRoll_Main_() {
|
||||
_Dps_FashionAndPetClearanceRoll_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_FashionAndPetClearanceRoll_Main_Reload_(OldConfig) {
|
||||
Cb_Use_Item_Sp_Func.rawdelete(OldConfig["宠物清除卷ID"]);
|
||||
Cb_Use_Item_Sp_Func.rawdelete(OldConfig["时装清除卷ID"]);
|
||||
|
||||
_Dps_FashionAndPetClearanceRoll_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "是否允许创建缔造者",
|
||||
"ProjectDescribe": "是否允许创建缔造者.",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "是否允许创建缔造者_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"是否允许创建缔造者.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EnableTheCreationOfCreators_Main_"
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
function _Dps_EnableTheCreationOfCreators_Logic_()
|
||||
{
|
||||
local Config = GlobalConfig.Get("是否允许创建缔造者_Lenheart.json");
|
||||
Sq_WriteByteArr(S_Ptr("0x81C029F"), Config["是否允许创建"] ? [0xF] : [0xA]);
|
||||
}
|
||||
|
||||
|
||||
function _Dps_EnableTheCreationOfCreators_Main_()
|
||||
{
|
||||
GameManager.OpenCreateJob_CreatorMage();
|
||||
}
|
||||
|
||||
function _Dps_EnableTheCreationOfCreators_Main_Reload_(OldConfig)
|
||||
{
|
||||
GameManager.OpenCreateJob_CreatorMage();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "月光定制收集图鉴",
|
||||
"ProjectDescribe": "月光定制收集图鉴",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "月光定制收集图鉴.json",
|
||||
"ProjectFiles": [
|
||||
"月光定制收集图鉴.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MoonlightCustomizedCollectionCatalog_Main_"
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
文件名:月光定制收集图鉴.nut
|
||||
路径:OfficialProject/月光定制收集图鉴/月光定制收集图鉴.nut
|
||||
创建日期:2025-04-20 11:38
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
getroottable()._MoonlightCustomizedCollectionCatalogMysql_ <- null;
|
||||
|
||||
function InitMysql() {
|
||||
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) {
|
||||
local Config = GlobalConfig.Get("装备镶嵌与时装镶嵌_Lenheart.json");
|
||||
local Ip = Config["数据库IP 不是外置数据库不要更改"];
|
||||
local Port = Config["数据库端口 不懂不要更改"];
|
||||
local DbName = Config["数据库用户名 本地用户名不懂不要更改"];
|
||||
local Password = Config["数据库密码 本地密码不懂不要更改"];
|
||||
getroottable()._MoonlightCustomizedCollectionCatalogMysql_ = Mysql(Str_Ptr(Ip), Port, Str_Ptr("taiwan_cain"), Str_Ptr(DbName), Str_Ptr(Password));
|
||||
}
|
||||
}
|
||||
|
||||
function _Moonlight_collect_check(id) {
|
||||
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) return;
|
||||
local SqlObj = getroottable()._MoonlightCustomizedCollectionCatalogMysql_;
|
||||
local CheckSql = "select id from `collect`.`s_item` where id = " + id + ";";
|
||||
local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return false;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
function _Moonlight_collect_check_has(uid, item) {
|
||||
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) return;
|
||||
local SqlObj = getroottable()._MoonlightCustomizedCollectionCatalogMysql_;
|
||||
local CheckSql = "select num from `collect`.`g_user_item` where uid = " + uid + " and item = " + item + ";";
|
||||
local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return false;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
function _Moonlight_collect_update(uid, item, type, num) {
|
||||
if (!getroottable()._MoonlightCustomizedCollectionCatalogMysql_) return;
|
||||
local SqlObj = getroottable()._MoonlightCustomizedCollectionCatalogMysql_;
|
||||
local CheckSql = "select id,num from `collect`.`g_user_item` where uid = " + uid + " and item = " + item + ";";
|
||||
local Ret = SqlObj.Select(CheckSql, ["int", "int"]);
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
local InsertSql = "INSERT INTO `collect`.`g_user_item`(`uid`,`item`,`type`,`num`) VALUES(" + uid + "," + item + "," + type + "," + num + ");";
|
||||
SqlObj.Exec_Sql(InsertSql);
|
||||
} else {
|
||||
local id = Ret[0][0]
|
||||
local num = Ret[0][1];
|
||||
local UpdateSql = "update `collect`.`g_user_item` set num = ' + num + ' where id = ' + id + ';";
|
||||
SqlObj.Exec_Sql(UpdateSql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _Moonlight_collect_equ(user,slot)
|
||||
{
|
||||
// local inven =
|
||||
}
|
||||
|
||||
|
||||
function _Dps_MoonlightCustomizedCollectionCatalog_Main_() {
|
||||
InitMysql();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "装备镶嵌与时装镶嵌",
|
||||
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可\n如果你是0627的客户端版本还需要安装群内的 \"0627装备镶嵌.dll\" 插件",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "装备镶嵌与时装镶嵌_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"装备镶嵌与时装镶嵌.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_Equ2AvaJewel_Main_"
|
||||
}
|
||||
|
|
@ -1,590 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
||||
function _Dps_Equ2AvaJewel_Main_() {
|
||||
local Config = GlobalConfig.Get("装备镶嵌与时装镶嵌_Lenheart.json");
|
||||
local PoolObj = MysqlPool.GetInstance();
|
||||
local Ip = Config["数据库IP 不是外置数据库不要更改"];
|
||||
local Port = Config["数据库端口 不懂不要更改"];
|
||||
local DbName = Config["数据库用户名 本地用户名不懂不要更改"];
|
||||
local Password = Config["数据库密码 本地密码不懂不要更改"];
|
||||
//设置数据库连接信息
|
||||
PoolObj.SetBaseConfiguration(Ip, Port, DbName, Password);
|
||||
//连接池大小
|
||||
PoolObj.PoolSize = 10;
|
||||
//初始化
|
||||
PoolObj.Init();
|
||||
//装备镶嵌修复
|
||||
getroottable()._EquimentUseJewel_Object <- EquimentUseJewel();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "角色初始武器修改",
|
||||
"ProjectDescribe": "修改黑暗武士和缔造的初始武器",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "角色初始武器修改_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"角色初始武器修改.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetInitiaweapon_Main_"
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
function _Dps_SetInitiaweapon_Logic_() {
|
||||
local Config = GlobalConfig.Get("角色初始武器修改_Lenheart.json");
|
||||
NativePointer("0x081C0CB2").writeInt(Config["黑暗武士武器"].tointeger());
|
||||
NativePointer("0x081C0CBB").writeInt(Config["缔造武器"].tointeger());
|
||||
}
|
||||
|
||||
function _Dps_SetInitiaweapon_Main_() {
|
||||
_Dps_SetInitiaweapon_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_SetInitiaweapon_Main_Reload_(OldConfig) {
|
||||
_Dps_SetInitiaweapon_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "设置服务器等级上限",
|
||||
"ProjectDescribe": "设置服务器等级上限",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "设置服务器等级上限_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"设置服务器等级上限.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetGameMaxLevel_Main_"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
function _Dps_SetGameMaxLevel_Logic_() {
|
||||
local Config = GlobalConfig.Get("设置服务器等级上限_Lenheart.json");
|
||||
GameManager.SetGameMaxLevel(Config["等级上限"]);
|
||||
}
|
||||
|
||||
function _Dps_SetGameMaxLevel_Main_() {
|
||||
_Dps_SetGameMaxLevel_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_SetGameMaxLevel_Main_Reload() {
|
||||
_Dps_SetGameMaxLevel_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "设置装备解锁时间",
|
||||
"ProjectDescribe": "设置装备的解锁时间",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "设置装备解锁时间_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"设置装备解锁时间.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetEquipmentUnlockTime_Main_"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
function _Dps_SetEquipmentUnlockTime_Logic_() {
|
||||
local Config = GlobalConfig.Get("设置装备解锁时间_Lenheart.json");
|
||||
GameManager.SetItemLockTime(Config["设置装备解锁需要的冷却时间_单位秒"]);
|
||||
}
|
||||
|
||||
function _Dps_SetEquipmentUnlockTime_Main_() {
|
||||
_Dps_SetEquipmentUnlockTime_Logic_();
|
||||
}
|
||||
|
||||
function _Dps_SetEquipmentUnlockTime_Main_Reload(OldConfig) {
|
||||
_Dps_SetEquipmentUnlockTime_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "跨界石",
|
||||
"ProjectDescribe": "通过指定ID的道具,将装备背包第一格的装备跨界。\n配置中修改CrossoverId可修改跨界石的ID 修改NoCrossIdArr可增加不可跨界的ID。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.3,
|
||||
"ProjectConfig": "跨界石_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"跨界石.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_CrossBorderStones_Main_"
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
|
||||
|
||||
|
||||
function _Dps_CrossBorderStones_Logic_()
|
||||
{
|
||||
local Cofig = GlobalConfig.Get("跨界石_Lenheart.json");
|
||||
|
||||
Cb_Use_Item_Sp_Func[Cofig.CrossoverId.tointeger()] <- function(SUser, ItemId) {
|
||||
local Cofig = GlobalConfig.Get("跨界石_Lenheart.json");
|
||||
|
||||
//获取账号金库对象
|
||||
local CargoObj = SUser.GetAccountCargo();
|
||||
//获取账号金库中的一个空格子
|
||||
local EmptySlot = CargoObj.GetEmptySlot();
|
||||
|
||||
//如果没有空格子
|
||||
if (EmptySlot == -1) {
|
||||
SUser.SendNotiPacketMessage(Cofig.CrossoverStr2, 8);
|
||||
//不扣除道具
|
||||
SUser.GiveItem(ItemId, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
//获取角色背包
|
||||
local InvenObj = SUser.GetInven();
|
||||
//获取需要转移的装备 这里默认写的装备栏第一个格子
|
||||
local ItemObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 9);
|
||||
//获取装备ID
|
||||
local EquipId = ItemObj.GetIndex();
|
||||
//获取装备名字
|
||||
local ItemName = PvfItem.GetNameById(EquipId);
|
||||
//获取配置中不可跨界的ID数组
|
||||
local NoCrossId = Cofig.NoCrossIdArr;
|
||||
//如果这个装备不可跨界
|
||||
if (NoCrossId.find(EquipId) != null) {
|
||||
SUser.SendNotiPacketMessage(format(Cofig.CrossoverStr5, ItemName), 7);
|
||||
//不扣除道具
|
||||
SUser.GiveItem(ItemId, 1);
|
||||
return;
|
||||
}
|
||||
//如果没找到这个格子的装备
|
||||
if (!ItemName) {
|
||||
SUser.SendNotiPacketMessage(Cofig.CrossoverStr1, 8);
|
||||
//不扣除道具
|
||||
SUser.GiveItem(ItemId, 1);
|
||||
return;
|
||||
}
|
||||
//跨界
|
||||
local Flag = CargoObj.InsertItem(ItemObj, EmptySlot);
|
||||
if (Flag == -1) {
|
||||
SUser.SendNotiPacketMessage(Cofig.CrossoverStr3, 8);
|
||||
//不扣除道具
|
||||
SUser.GiveItem(ItemId, 1);
|
||||
} else {
|
||||
//销毁背包中的道具
|
||||
ItemObj.Delete();
|
||||
//刷新玩家背包列表
|
||||
SUser.SendUpdateItemList(1, 0, 9);
|
||||
//刷新账号金库列表
|
||||
CargoObj.SendItemList();
|
||||
SUser.SendNotiPacketMessage(format(Cofig.CrossoverStr4, ItemName), 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//加载入口
|
||||
function _Dps_CrossBorderStones_Main_() {
|
||||
_Dps_CrossBorderStones_Logic_();
|
||||
}
|
||||
|
||||
//重载入口
|
||||
function _Dps_CrossBorderStones_Main_Reload_(OldConfig) {
|
||||
//先销毁原来注册的
|
||||
Cb_Use_Item_Sp_Func.rawdelete(OldConfig.CrossoverId.tointeger());
|
||||
|
||||
//重新注册
|
||||
_Dps_CrossBorderStones_Logic_();
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"ProjectName": "黄金品级调整箱",
|
||||
"ProjectDescribe": "将一个品级调整箱替换为黄金品级调整箱",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectConfig": "黄金品级调整箱_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"黄金品级调整箱.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_SetEquinherit_Main_"
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
function _Dps_SetEquinherit_Main_() {
|
||||
Cb_ModItemattr_Leave_Func.addinfoMax <- function(args) {
|
||||
local Config = GlobalConfig.Get("黄金品级调整箱_Lenheart.json");
|
||||
local SUser = User(args[1]);
|
||||
local pack = NativePointer(args[2]);
|
||||
local a = NativePointer(pack.add(20).readPointer());
|
||||
local itemSold = a.add(13).add(6).readShort();
|
||||
local equSold = a.add(13).add(0).readShort();
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (InvenObj) {
|
||||
local ItemObj = InvenObj.GetSlot(1, itemSold);
|
||||
local equObj = InvenObj.GetSlot(1, equSold);
|
||||
|
||||
if (ItemObj.GetIndex() == Config["黄金品级调整箱id"]) {
|
||||
equObj.SetAdd_Info(999999998);
|
||||
equObj.Flush();
|
||||
SUser.SendUpdateItemList(1, 0, equSold);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -169,5 +169,8 @@
|
|||
},
|
||||
"Dps_A/BaseClass/OfficialProject": {
|
||||
"description": "官方项目类"
|
||||
},
|
||||
"Dps_A/ProjectClass/FatalismStone": {
|
||||
"description": "宿命魂石"
|
||||
}
|
||||
}
|
||||
BIN
lib/libAurora.so
BIN
lib/libAurora.so
Binary file not shown.
Binary file not shown.
|
|
@ -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"
|
||||
|
|
@ -19,7 +19,7 @@ TARGET_FUNCTIONS=(
|
|||
"InitSquirrel()"
|
||||
"ReloadingScript(SQVM*, std::string)"
|
||||
"ReqSquirrelScript(SQVM*)"
|
||||
"Cutecode(char*, int*, int)"
|
||||
"Cutecode(char*, int*, int, int)"
|
||||
)
|
||||
|
||||
# 创建备份
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
玩家[Test2]因[数据异常<3>]已被制裁2025年07月24日 10:06:38
|
||||
|
|
@ -9,6 +9,17 @@
|
|||
],
|
||||
"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": "副本需要持有道具进入",
|
||||
|
|
@ -163,6 +174,17 @@
|
|||
],
|
||||
"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商店道具的问题",
|
||||
|
|
@ -178,7 +200,7 @@
|
|||
"ProjectName": "一键存入个人金库",
|
||||
"ProjectDescribe": "使用之前,请务必保证安装了群内的 \"客户端消息框233.dll\" 插件,这个插件放入你客户端的插件加载目录即可,在游戏中输入 //yjcc 即可一键存入个人金库,也可以在游戏中的快捷喊话中添加为快捷键 配置中可更改 yjcc 关键字",
|
||||
"ProjectAuthor": "倾泪寒 & 南瓜",
|
||||
"ProjectVersion": 1.1,
|
||||
"ProjectVersion": 1.3,
|
||||
"ProjectConfig": "一键存入个人金库_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"一键入库.nut"
|
||||
|
|
@ -207,6 +229,17 @@
|
|||
],
|
||||
"ProjectRunFunc": "_Dps_MapReset_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "邮件金币去除验证",
|
||||
"ProjectDescribe": "去除了发送邮件中有金币会触发验证码的验证。",
|
||||
"ProjectAuthor": "倾泪寒",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "",
|
||||
"ProjectFiles": [
|
||||
"邮件金币去除验证.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_EmailCoinRemovalVerification_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "月光定制收集图鉴",
|
||||
"ProjectDescribe": "月光定制收集图鉴",
|
||||
|
|
@ -218,6 +251,17 @@
|
|||
],
|
||||
"ProjectRunFunc": "_Dps_MoonlightCustomizedCollectionCatalog_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "战力榜",
|
||||
"ProjectDescribe": "首先根据使用的登录器在配置文件中选取对应的登录器。PVF相关不提供自行研究,离线假人登录下线时不会发包,因此不用担心频繁发包",
|
||||
"ProjectAuthor": "南瓜",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "战力榜配置_南瓜.json",
|
||||
"ProjectFiles": [
|
||||
"战力榜.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_Rank_nangua_Main_"
|
||||
}LenheartMerge
|
||||
{
|
||||
"ProjectName": "整点在线奖励",
|
||||
"ProjectDescribe": "可以设置某一个时间点 全服发放奖励",
|
||||
|
|
@ -229,6 +273,17 @@
|
|||
],
|
||||
"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\" 插件",
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
Loading…
Reference in New Issue