111
This commit is contained in:
@@ -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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user