111
This commit is contained in:
@@ -138,6 +138,21 @@ Gm_InputFunc_Handle["完成任务"] <- function(SUser, CmdString) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["测试"] <- function(SUser, CmdString) {
|
||||
SUser.ClearQuest_Gm(674);
|
||||
SUser.ClearQuest_Gm(649);
|
||||
|
||||
SUser.ClearQuest_Gm(675);
|
||||
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);
|
||||
@@ -302,6 +317,8 @@ function TestCronTask(str) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle.WEQ <- function(SUser, CmdString) {
|
||||
// // World.MoveArea(SUser, 1, 0, 55, 349);
|
||||
|
||||
@@ -333,6 +350,9 @@ Gm_InputFunc_Handle.WEQ <- function(SUser, CmdString) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle.QS <- function(SUser, CmdString) {
|
||||
SUser.RechargeCeraPoint(10000);
|
||||
};
|
||||
@@ -357,103 +377,250 @@ function UserdataSliceStr(Data) {
|
||||
return Ret;
|
||||
}
|
||||
|
||||
// MultiMailBoxCloseRindroMap <- null;
|
||||
// Cb_MultiMailBoxReqSend_Enter_Func.CloseRindro <- function(args) {
|
||||
// MultiMailBoxCloseRindroMap = Memory.alloc(144370 * 4);
|
||||
// MultiMailBoxCloseRindroMap.add(144369 * 4).writeInt(0);
|
||||
// args[1] = MultiMailBoxCloseRindroMap.C_Object;
|
||||
// return args;
|
||||
// }
|
||||
// Cb_MultiMailBoxReqSend_Leave_Func.CloseRindro <- function(args) {
|
||||
// MultiMailBoxCloseRindroMap = null;
|
||||
// }
|
||||
|
||||
// //Hook
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
//品级对应的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] // 金色
|
||||
};
|
||||
|
||||
function xorEncryptDecrypt(BlobObj, Key) {
|
||||
for (local i = 0; i< Key.len(); i++) {
|
||||
local currentKeyChar = Key[i % Key.len()];
|
||||
BlobObj[i] = BlobObj[i] ^ currentKeyChar;
|
||||
//通过道具ID获取RGB
|
||||
function RarityColor(item_id) {
|
||||
local PvfItemObj = PvfItem.GetPvfItemById(item_id);
|
||||
if (PvfItemObj == null) {
|
||||
return;
|
||||
}
|
||||
local Arr = [];
|
||||
foreach(value in BlobObj) {
|
||||
Arr.append(value);
|
||||
}
|
||||
return Arr;
|
||||
local CItem_get_rarity = PvfItemObj.GetRarity(); // 装备品级
|
||||
return rarityColorMap[(CItem_get_rarity).tostring()];
|
||||
}
|
||||
|
||||
function base64_encode(input) {
|
||||
local base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
local inputLength = input.len();
|
||||
local i = 0;
|
||||
local j = 0;
|
||||
local charArray3 = array(3);
|
||||
local charArray4 = array(4);
|
||||
local encoded = "";
|
||||
|
||||
while (inputLength--) {
|
||||
charArray3[i++] = input[inputLength];
|
||||
if (i == 3) {
|
||||
charArray4[0] = (charArray3[0] & 0xfc) >> 2;
|
||||
charArray4[1] = ((charArray3[0] & 0x03) << 4) + ((charArray3[1] & 0xf0) >> 4);
|
||||
charArray4[2] = ((charArray3[1] & 0x0f) << 2) + ((charArray3[2] & 0xc0) >> 6);
|
||||
charArray4[3] = charArray3[2] & 0x3f;
|
||||
user_equ_plan <- {};
|
||||
|
||||
for (i = 0; i< 4; i++) {
|
||||
encoded += base64_chars[charArray4[i]];
|
||||
function GetEquip(SUser) {
|
||||
//获取玩家背包
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (!InvenObj) {
|
||||
return;
|
||||
}
|
||||
local equArr = {};
|
||||
|
||||
// 读穿戴装备(10-21) + 时装(0-9)
|
||||
for (local i = 0; i< 26; i++) {
|
||||
// // 跳过非上衣时装,若需要换全部时装注释掉这段if
|
||||
// if (i != 3 && (i < 10 || i > 21)) {
|
||||
// equArr[i] <- {
|
||||
// "id": 0,
|
||||
// "lv": 0
|
||||
// };
|
||||
// continue;
|
||||
// }
|
||||
|
||||
local ItemObj = InvenObj.GetSlot(0, i);
|
||||
local equId = ItemObj.GetIndex();
|
||||
local item_upgrade = ItemObj.GetUpgrade();
|
||||
local item_name = PvfItem.GetNameById(equId);
|
||||
if (item_upgrade > 0) {
|
||||
item_name = "+" + item_upgrade + " " + item_name;
|
||||
}
|
||||
//id:装备id lv:时装数据库uid/装备品级
|
||||
equArr[i] <- {
|
||||
"id": equId > 0 ? equId : 0,
|
||||
"lv": equId > 0 ? NativePointer(ItemObj.C_Object).add(7).readU32() : 0
|
||||
};
|
||||
|
||||
if (equId > 0) {
|
||||
local AdMsgObj = AdMsg();
|
||||
AdMsgObj.PutType(2);
|
||||
AdMsgObj.PutString(" ");
|
||||
AdMsgObj.PutEquipment("[" + item_name + "]", ItemObj, RarityColor(equId));
|
||||
AdMsgObj.PutString("已登记");
|
||||
AdMsgObj.Finalize();
|
||||
SUser.Send(AdMsgObj.MakePack());
|
||||
AdMsgObj.Delete();
|
||||
}
|
||||
}
|
||||
return equArr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SaveEquipPlan(SUser, id) {
|
||||
local charac_no = SUser.GetCID().tostring();
|
||||
if (!(charac_no in user_equ_plan)) {
|
||||
user_equ_plan[charac_no] <- {};
|
||||
}
|
||||
local info = GetEquip(SUser);
|
||||
user_equ_plan[charac_no]["equPlan" + id] <- info;
|
||||
local AdMsgObj = AdMsg();
|
||||
AdMsgObj.PutType(2);
|
||||
AdMsgObj.PutString(" ");
|
||||
AdMsgObj.PutString("方案[" + id + "]已启用");
|
||||
AdMsgObj.Finalize();
|
||||
World.SendAll(AdMsgObj.MakePack());
|
||||
AdMsgObj.Delete();
|
||||
}
|
||||
|
||||
function PutOnEquip(SUser, equPlan, id) {
|
||||
local charac_no = SUser.GetCID().tostring();
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (!InvenObj) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 遍历遍历穿戴栏0-21 时装栏 0-104 和 装备栏 3-56
|
||||
for (local i = 0; i< 22; i++) {
|
||||
if (equPlan[i].id) {
|
||||
local type = i< 10 ? 2 : 1; // type 1装备 2时装
|
||||
local startIndex = type == 2 ? 0 : 3; // 背包时装栏从0开始,背包装备栏从3开始
|
||||
local endIndex = type == 2 ? 105 : 57; //背包时装栏到104,背包装备栏到56
|
||||
for (local j = startIndex; j< endIndex; j++) {
|
||||
local equOut = InvenObj.GetSlot(type, j);
|
||||
local equId = equOut.GetIndex();
|
||||
if (equPlan[i].id == equId && equPlan[i].lv == NativePointer(equOut.C_Object).add(7).readU32()) {
|
||||
Sq_CallFunc(S_Ptr("0x0865EED2"), "int", ["pointer", "int", "int", "int"], SUser.C_Object, type == 2 ? 1 : 0, j, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i) {
|
||||
for (j = i; j< 3; j++) {
|
||||
charArray3[j] = 0;
|
||||
}
|
||||
SUser.SendItemSpace(1);
|
||||
SUser.SendItemSpace(0);
|
||||
SUser.SendItemSpace(7);
|
||||
|
||||
charArray4[0] = (charArray3[0] & 0xfc) >> 2;
|
||||
charArray4[1] = ((charArray3[0] & 0x03) << 4) + ((charArray3[1] & 0xf0) >> 4);
|
||||
charArray4[2] = ((charArray3[1] & 0x0f) << 2) + ((charArray3[2] & 0xc0) >> 6);
|
||||
charArray4[3] = charArray3[2] & 0x3f;
|
||||
|
||||
for (j = 0; j< i + 1; j++) {
|
||||
encoded += base64_chars[charArray4[j]];
|
||||
}
|
||||
SUser.SendNotiPacket(0, 2, 0);
|
||||
SUser.SendNotiPacket(1, 2, 1);
|
||||
SUser.SendNotiPacket(7, 2, 7);
|
||||
|
||||
while (i++<3) {
|
||||
encoded += "=";
|
||||
}
|
||||
}
|
||||
local Bq = Sq_CallFunc(S_Ptr("0x80DD584"), "pointer", ["pointer", "int"], SUser.C_Object, 2);
|
||||
Sq_CallFunc(S_Ptr("0x85427A0"), "void", ["pointer", "pointer"], Bq, SUser.C_Object);
|
||||
// RefreshTheLockOfEquipment(SUser, InvenObj);
|
||||
// Sq_CallFunc(S_Ptr("0x84FAE0A"), "void", ["pointer", "int", "int", "int"], InvenObj.C_Object, NativePointer(InvenObj.C_Object).readInt(), 21, 0);
|
||||
|
||||
return encoded;
|
||||
// 刷新装备栏锁头(不含穿戴栏暂无法刷新)
|
||||
// Sq_CallFunc(S_Ptr("0x84FAF8E"), "void", ["pointer"], InvenObj.C_Object);
|
||||
//// 刷新时装栏锁头(不含穿戴栏暂无法刷新)
|
||||
//Sq_CallFunc(S_Ptr("0x084FAFBE"), "void", ["pointer"], InvenObj.C_Object);
|
||||
// 刷新技能
|
||||
Sq_CallFunc(S_Ptr("0x866C46A"), "void", ["pointer"], SUser.C_Object);
|
||||
//// 刷新角色状态
|
||||
//Sq_CallFunc(S_Ptr("0x867BA5C"), "int", ["pointer", "int", "int", "int"], SUser.C_Object, 0, 2, 0);
|
||||
//Sq_CallFunc(S_Ptr("0x867BA5C"), "int", ["pointer", "int", "int", "int"], SUser.C_Object, 1, 2, 1);
|
||||
user_equ_plan[charac_no].startTime <- time(); // 记录结束时间
|
||||
SUser.SendNotiPacketMessage("装备方案[" + id + "]切换结束!!", 2);
|
||||
}
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
local Key = "desaqe";
|
||||
local Str = "Test Data";
|
||||
print("old: " + Str);
|
||||
local StrPointer = Memory.allocUtf8String(Str);
|
||||
local BlobObj = StrPointer.readBinary(Str.len());
|
||||
local Arr = xorEncryptDecrypt(BlobObj, Key);
|
||||
StrPointer.writeByteArray(Arr);
|
||||
//此时str已不可读 需要掌控其指针 与 长度
|
||||
local NewStrPointer = StrPointer;
|
||||
local encodestr = base64_encode(NewStrPointer.readUtf8String(Str.len()));
|
||||
print("encode: " + encodestr);
|
||||
function RefreshTheLockOfEquipment(SUser, InvenObj) {
|
||||
local Pack = Packet();
|
||||
//Clear
|
||||
Sq_CallFunc(S_Ptr("0x80CB8E6"), "int", ["pointer"], Pack.C_Object);
|
||||
Pack.Put_Header(0, 251);
|
||||
//GetIndex
|
||||
local Index = Sq_CallFunc(S_Ptr("0x8110B4C"), "int", ["pointer"], Pack.C_Object);
|
||||
Pack.Put_Short(0);
|
||||
local V7 = 0;
|
||||
for (local i = 0; i< 21; i++) {
|
||||
local Flag = NativePointer(InvenObj.C_Object).add((61 * i) + 48).readU8();
|
||||
if (Flag) {
|
||||
Pack.Put_Byte(0);
|
||||
Pack.Put_Short(i);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_Int(500000);
|
||||
// local Bq = Sq_CallFunc(S_Ptr("0x828B5DE"), "pointer", ["pointer", "int"], SUser.C_Object, 2);
|
||||
// Sq_CallFunc(S_Ptr("0x828B5DE"), "char", ["pointer", "pointer"], Bq, Pack.C_Object);
|
||||
V7++;
|
||||
}
|
||||
}
|
||||
local Buf = Memory.alloc(4);
|
||||
Buf.writeInt(Index);
|
||||
Sq_CallFunc(S_Ptr("0x8110B28"), "int", ["pointer", "pointer", "int"], Pack.C_Object, Buf.C_Object, V7);
|
||||
Pack.Finalize(1);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
|
||||
print("发包了");
|
||||
}
|
||||
|
||||
function api_PutOnEquip(SUser, id) {
|
||||
local charac_no = SUser.GetCID().tostring();
|
||||
if (!(charac_no in user_equ_plan)) {
|
||||
SUser.SendNotiPacketMessage("方案不存在!!", 2);
|
||||
return;
|
||||
}
|
||||
local equPlanKey = "equPlan" + id;
|
||||
if (!user_equ_plan[charac_no].rawin(equPlanKey)) {
|
||||
SUser.SendNotiPacketMessage("方案[" + id + "]不存在!!!", 2);
|
||||
return;
|
||||
}
|
||||
local equPlan = user_equ_plan[charac_no][equPlanKey];
|
||||
|
||||
//换装指令冷却时间,5scd
|
||||
if (user_equ_plan[charac_no].rawin("startTime")) {
|
||||
local currentTime = time();
|
||||
local timeDiff = user_equ_plan[charac_no].startTime - currentTime + 5;
|
||||
if (timeDiff > 0) {
|
||||
SUser.SendNotiPacketMessage("换装功能冷却中,还有<" + timeDiff + ">秒才能使用!", 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PutOnEquip(SUser, equPlan, id);
|
||||
}
|
||||
|
||||
function MoveItem_send(SUser, type, slot, Bodyslot) {
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 19);
|
||||
Pack.Put_Byte(1); //默认1
|
||||
Pack.Put_Byte(type); //协议, 0时装 1装备
|
||||
Pack.Put_Short(slot); // 背包槽位slot
|
||||
Pack.Put_Int(1); // 默认1未知
|
||||
Pack.Put_Byte(3); // 默认3穿戴栏
|
||||
Pack.Put_Short(Bodyslot); //穿戴栏slot(0-25)
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
local v6 = Sq_CallFunc(S_Ptr("0x081935A2"), "pointer", []);
|
||||
Sq_CallFunc(S_Ptr("0x867BA5C"), "int", ["pointer", "pointer", "int", "int", "int", "int"], v6, SUser.C_Object, type, slot, 3, Bodyslot);
|
||||
Pack.Delete();
|
||||
}
|
||||
|
||||
function Save_equFnc(SUser, CmdString) {
|
||||
local arr = split(CmdString, " ");
|
||||
local id = arr[1].tointeger();
|
||||
SaveEquipPlan(SUser, id);
|
||||
}
|
||||
|
||||
|
||||
// 注册命令1
|
||||
Gm_InputFunc_Handle.rawset("pl", Save_equFnc);
|
||||
|
||||
function change_equFnc(SUser, CmdString) {
|
||||
local arr = split(CmdString, " ");
|
||||
local id = arr[1].tointeger();
|
||||
api_PutOnEquip(SUser, id);
|
||||
}
|
||||
|
||||
// 注册命令
|
||||
Gm_InputFunc_Handle.rawset("on", change_equFnc);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
local BlobObj = NewStrPointer.readBinary(Str.len());
|
||||
local Arr = xorEncryptDecrypt(BlobObj, Key);
|
||||
NewStrPointer.writeByteArray(Arr);
|
||||
print("new: " + NewStrPointer.readUtf8String());
|
||||
}, 1);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//分割道具列表
|
||||
@@ -583,13 +750,41 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||
// [3038, 200]
|
||||
// ]);
|
||||
|
||||
SUser.DropItem(27095, 800, 200);
|
||||
local InvenObj = SUser.GetInven();
|
||||
for (local i = 0; i< 21; i++) {
|
||||
local Flag = NativePointer(InvenObj.C_Object).add((61 * i) + 48).readU8();
|
||||
print("i: " + i + " Flag: " + Flag);
|
||||
}
|
||||
|
||||
|
||||
// SUser.MainTaskCompleted();
|
||||
};
|
||||
|
||||
|
||||
// getroottable()._LenheartUserLoseEfficacyState_ <- Memory.alloc(577477);
|
||||
// Memory.reset(getroottable()._LenheartUserLoseEfficacyState_,577477);
|
||||
// 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();
|
||||
// // print("对话长度:" + StrLen);
|
||||
// print("对话:" + Str);
|
||||
// if(Str.find("asd") != null){
|
||||
// args[1] = getroottable()._LenheartUserLoseEfficacyState_.C_Object;
|
||||
// print("屏蔽词");
|
||||
// return args;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -671,15 +866,61 @@ ClientSocketPackFuncMap.rawset(21091001, function(SUser, Jso) {
|
||||
// // SUser.SendNotiPacketMessage("出纳上到几点方柏霓撒娇扩大年级卡萨", 7);
|
||||
// }
|
||||
|
||||
// //定义一个显示的变量
|
||||
// getroottable().TaskCount <- 0;
|
||||
|
||||
// //任务
|
||||
// function Task() {
|
||||
// getroottable().TaskCount++;
|
||||
// print("定时任务执行了一次,当前执行次数为:" + getroottable().TaskCount);
|
||||
// }
|
||||
|
||||
// //注册一个定时任务 每五秒执行一次 任务名为 TestCronName
|
||||
// Timer.SetCronTask(Task, {
|
||||
// Cron = "0/5 * * * * *",
|
||||
// Name = "TestCronName"
|
||||
// });
|
||||
|
||||
|
||||
function _Jump_DropItem_check_error_()
|
||||
{
|
||||
//如果没有创建过这个模拟内存就创建
|
||||
if(!getroottable().rawin("_EmptyCharacInfo_Flag_")){
|
||||
getroottable()._EmptyCharacInfo_Flag_ <- Memory.alloc(17);
|
||||
Memory.reset(getroottable()._EmptyCharacInfo_Flag_,17);
|
||||
}
|
||||
//如果没有创建过这个跳转Flag就创建并初始化
|
||||
if(!getroottable().rawin("_EmptyHook_Flag_")){
|
||||
getroottable()._EmptyHook_Flag_ <- false;
|
||||
}
|
||||
}
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
// //私有方法 发送带参数的Post请求
|
||||
// local SO = Http("129.211.27.104", "9080");
|
||||
// local Res = SO.Post("/dof/chat", Json.Encode({
|
||||
// username = "系统公告",
|
||||
// text = "倾泪寒在格蓝迪发电站爆出了【雷剑-苦轮】!真是人品爆炸!!!",
|
||||
// groupId = 850022626
|
||||
// }), "application/json");
|
||||
|
||||
|
||||
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
}, 1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Gm_InputFunc_Handle["aaa"] <- function(SUser, cmd) {
|
||||
// 获取角色背包
|
||||
local InvenObj = SUser.GetInven();
|
||||
|
||||
Reference in New Issue
Block a user