更新一个新Hook 更新毁梦定制的播报

This commit is contained in:
lenheart 2025-12-25 23:34:50 +08:00
parent 36d66526c7
commit 2ca4ce76d7
2 changed files with 191 additions and 0 deletions

View File

@ -77,9 +77,195 @@ class WarehouseLockC {
// 下面是 毁梦的播报
_HM_DQJY_ <- ["0", "0"]
_HM_DQJYHD_ <- "0"
function _Dps_JYYJBB2_Main_() {
Cb_History_ItemUp_Func["交易邮件播报"] <- function(SUser, args) {
local reason = args[18];
if (reason == "1" || reason == "17") {
local username = SUser.GetCharacName();
local username2 = getContentBetweenDelimiters(args[20]);
local pvfitem = PvfItem.GetNameById(args[15].tointeger());
if (reason == "17") {
username = getContentBetweenDelimiters(args[20]);
username2 = getContentBetweenDelimiters(args[19]);
}
if ((_HM_DQJY_[0] == username && _HM_DQJY_[1] == username2) || (_HM_DQJY_[1] == username && _HM_DQJY_[0] == username2)) { //这里就不用播报谁和谁交易 谁拿到什么就行了
if (_HM_DQJYHD_ != username) {
World.SendNotiPacketMessage(format("[%s]得到以下物品", username), 14);
_HM_DQJYHD_ = username;
}
World.SendNotiPacketMessage(format("[%s]数量[%s]", pvfitem, args[17]), 14);
} else {
_HM_DQJY_[0] = username;
_HM_DQJY_[1] = username2;
World.SendNotiPacketMessage(format("玩家[%s]与[%s]交易信息", username, username2), 14);
World.SendNotiPacketMessage(format("[%s]得到以下物品", username), 14);
World.SendNotiPacketMessage(format("[%s]数量[%s]", pvfitem, args[17]), 14);
_HM_DQJYHD_ = username;
}
}
Timer.SetTimeOut(function() {
_HM_DQJY_[0] = "0";
_HM_DQJY_[1] = "0";
_HM_DQJYHD_ = "0";
}, 50);
}
Cb_History_MoneyUp_Func["交易邮件播报"] <- function(SUser, args) {
local reason = args[16];
if (reason == "1" || reason == "11") {
local username = SUser.GetCharacName();
local username2 = "";
if (reason == "11") {
username2 = _HM_DQJY_[0];
} else {
username2 = getFirstBracketContent(args[17]);
}
if ((_HM_DQJY_[0] == username && _HM_DQJY_[1] == username2) || (_HM_DQJY_[1] == username && _HM_DQJY_[0] == username2)) { //这里就不用播报谁和谁交易 谁拿到什么就行了
if (_HM_DQJYHD_ != username) {
World.SendNotiPacketMessage(format("[%s]得到以下物品", username), 14);
_HM_DQJYHD_ = username;
}
World.SendNotiPacketMessage(format("[金钱]数量[%s]", args[15]), 14);
} else {
_HM_DQJY_[0] = username;
_HM_DQJY_[1] = username2;
World.SendNotiPacketMessage(format("玩家[%s]与[%s]交易信息", SUser.GetCharacName(), username2), 14);
World.SendNotiPacketMessage(format("[%s]得到以下物品", SUser.GetCharacName()), 14);
World.SendNotiPacketMessage(format("[金钱]数量[%s]", args[15]), 14);
_HM_DQJYHD_ = username;
}
}
Timer.SetTimeOut(function() {
_HM_DQJY_[0] = "0";
_HM_DQJY_[1] = "0";
}, 50);
}
Cb_User_Vend_Item_Leave_Func["交易播报2"] <- function(args) {
Timer.SetTimeOut(function() {
local username = User(args[1]).GetCharacName();
local id = NativePointer(args[2]).add(10).readInt();
local CheckSql = "SELECT item_id,unit_price,owner_id FROM taiwan_cain_auction_gold.auction_history_" + getYearMonth() + " where auction_id = " + id + ";";
//从池子拿连接
local SqlObj = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj.Select(CheckSql, ["int", "int", "int"]);
MysqlPool.GetInstance().PutConnect(SqlObj);
local itemId = Ret[0][0];
local unitPrice = Ret[0][1];
local maijiacid = Ret[0][2];
if (maijiacid == User(args[1]).GetCID()) return;
local CheckSql2 = "SELECT price FROM taiwan_cain_auction_gold.auction_history_buyer_" + getYearMonth() + " ORDER BY occ_time DESC LIMIT 1;";
//从池子拿连接
local SqlObj2 = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj2.Select(CheckSql2, ["int"]);
MysqlPool.GetInstance().PutConnect(SqlObj2);
local price = Ret[0][0];
local num = price / unitPrice;
local CheckSql3 = "SELECT charac_name FROM taiwan_cain.charac_info where charac_no = " + maijiacid;
//从池子拿连接
local SqlObj3 = MysqlPool.GetInstance().GetConnect();
local Ret = SqlObj3.Select(CheckSql3, ["string"]);
MysqlPool.GetInstance().PutConnect(SqlObj3);
local mjname = Ret[0][0];
World.SendNotiPacketMessage(format("玩家[%s]在拍卖行用[%d]金币从[%s]手里购得[%s]物品[%d]个", username, price, mjname, PvfItem.GetNameById(itemId), num), 14);
}, 100);
}
Cb_UserHistoryLog_ItemAdd_Enter_Func["史诗掉落播报"] <- function(args) {
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) {
local MsgObj = AdMsg();
MsgObj.PutType(14);
CntMsgObj.PutColorString("玩家[" + SUser.GetCharacName() + "]于", [255, 20, 0]);
CntMsgObj.PutColorString(getSFMTime(), [255, 20, 0]);
CntMsgObj.PutColorString("在[" + Dungeon_Name + "]" + "获得史诗装备", [255, 20, 0]);
MsgObj.PutEquipment("[" + PvfItem.GetNameById(item_id) + "]", ItemObj, [255, 180, 0]);
CntMsgObj.PutColorString("一件", [255, 20, 0]);
MsgObj.Finalize();
World.SendAll(MsgObj.MakePack());
MsgObj.Delete();
}
}
function getYearMonth() {
local now = date();
return format("%d%02d", now.year, now.month + 1);
}
function getSFMTime() {
local now = date();
return format("%02d:%02d:%02d", now.hour, now.min, now.sec);
}
}
function getFirstBracketContent(str) {
local startPos = str.find("(");
if (startPos == null) return null;
local endPos = str.find(")", startPos + 1);
if (endPos == null) return null;
// 提取括号内的内容(不包括括号本身)
return str.slice(startPos + 1, endPos);
}
function getContentBetweenDelimiters(str, delimiter = "\"") {
// 检查输入有效性
if (typeof str != "string" || str.len() == 0) return null;
if (typeof delimiter != "string" || delimiter.len() == 0) return null;
// 查找第一个分隔符的位置
local firstPos = str.find(delimiter);
if (firstPos == null) return null;
// 从第一个分隔符后开始查找第二个分隔符
local secondPos = str.find(delimiter, firstPos + delimiter.len());
if (secondPos == null) return null;
// 提取两个分隔符之间的内容
return str.slice(firstPos + delimiter.len(), secondPos);
}
Timer.SetTimeOut(function() { Timer.SetTimeOut(function() {
getroottable()._WarehouseLock_ <- WarehouseLockC(); getroottable()._WarehouseLock_ <- WarehouseLockC();
_Dps_JYYJBB2_Main_();
print("双端插件·毁梦定制战力系统 - 已加载"); print("双端插件·毁梦定制战力系统 - 已加载");
}, 1); }, 1);

View File

@ -661,6 +661,11 @@ Cb_MailBox11_Send_Enter_Func <- {};
Cb_MailBox11_Send_Leave_Func <- {}; Cb_MailBox11_Send_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x86847ea", ["pointer", "pointer", "pointer", "int"], Cb_MailBox11_Send_Enter_Func, Cb_MailBox11_Send_Leave_Func); _Hook_Register_Currency_Func_("0x86847ea", ["pointer", "pointer", "pointer", "int"], Cb_MailBox11_Send_Enter_Func, Cb_MailBox11_Send_Leave_Func);
Cb_User_Vend_Item_Enter_Func <- {};
Cb_User_Vend_Item_Leave_Func <- {};
_Hook_Register_Currency_Func_("0x84D7C8E", ["pointer", "pointer", "pointer", "int"], Cb_User_Vend_Item_Enter_Func, Cb_User_Vend_Item_Leave_Func);
function _Hook_Register_Currency_DelayHook_() { function _Hook_Register_Currency_DelayHook_() {
//五国时的热点函数 //五国时的热点函数
//获取Item Rarity //获取Item Rarity