商场多买多送

第一步
去frida数据执行


CREATE TABLE `gift_pack_return_award` (
`account_id` int(11) NOT NULL COMMENT '账号ID',
`item_id` int(11) NOT NULL COMMENT '道具ID',
`cumulative_quantity` int(11) NOT NULL DEFAULT '0' COMMENT '累计购买数量',
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`updated_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
PRIMARY KEY (`account_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='购买记录表';

第二步—-直接复制进frida文件找个地方粘贴上就行了

// 购买记录新增
function purchase_record_filing_insert(accountId, itemId, cumulativeQuantity) {
if (cumulativeQuantity == 0) {
api_MySQL_exec(mysql_frida, "insert INTO gift_pack_return_award (account_id, item_id, cumulative_quantity) VALUES (" + accountId + "," + itemId + "," + cumulativeQuantity + ")");
}
}


// 购买记录修改
function purchase_record_filing_update(accountId, itemId, cumulativeQuantity) {
api_MySQL_exec(mysql_frida, "REPLACE INTO gift_pack_return_award (account_id, item_id, cumulative_quantity) VALUES (" + accountId + "," + itemId + "," + cumulativeQuantity + ")");
}

//从数据库载入账号购买记录
function load_purchase_records_from_the_database(accountId) {
if (api_MySQL_exec(mysql_frida, "select cumulative_quantity from gift_pack_return_award where account_id = " + accountId + ";")) {
if (MySQL_get_n_rows(mysql_frida) == 1) {
MySQL_fetch(mysql_frida);
return api_MySQL_get_str(mysql_frida, 0);
} else {
return 0;
}
} else {
return 0;
}
}
/**
* 多买多送
*
* @param user
* @param account_id 账号ID
* @param item_id 道具ID
* @param item_cnt 数量
*/

function gift_pack_return_award(user, account_id, item_id, item_cnt) {

const cumulativeQuantity = load_purchase_records_from_the_database(account_id);

if (cumulativeQuantity == 0) {
purchase_record_filing_insert(account_id, item_id, cumulativeQuantity)
}
const quantity = load_purchase_records_from_the_database(account_id);
const a = parseInt(item_cnt);
const b = parseInt(quantity);
const number = a + b;

const charac_no = CUserCharacInfo_getCurCharacNo(user);

const itemName = api_CItem_GetItemName(item_id);

if (690001652 == item_id) {

purchase_record_filing_update(account_id, item_id, number)

if (1 == number) {

const item_list = [
[3037, 99]
];

api_WongWork_CMailBoxHelper_ReqDBSendNewSystemMultiMail(charac_no, "GM台服官方邮件", "DNF台服运营商不会已任何形式索要你的用户名密码请你不要邮寄关于您账号密码的任何信息!", 0, item_list);

api_CUser_SendNotiPacketMessage(user, "这是您购买的第:<" + number + ">套[" + itemName + "]装扮奖励[99]个无色小晶块已发送进您的邮箱!", 1);

}
if (3 == number) {
const item_list = [
[3037, 999]
];

api_WongWork_CMailBoxHelper_ReqDBSendNewSystemMultiMail(charac_no, "GM台服官方邮件", "DNF台服运营商不会已任何形式索要你的用户名密码请你不要邮寄关于您账号密码的任何信息!", 0, item_list);

api_CUser_SendNotiPacketMessage(user, "这是您购买的第:<" + number + ">套[" + itemName + "]装扮奖励[999]个无色小晶块已发送进您的邮箱!", 1);

}
if (5 == number) {

const item_list = [
[8323, 1]
];

api_WongWork_CMailBoxHelper_ReqDBSendNewSystemMultiMail(charac_no, "GM台服官方邮件", "DNF台服运营商不会已任何形式索要你的用户名密码请你不要邮寄关于您账号密码的任何信息!", 0, item_list);

api_CUser_SendNotiPacketMessage(user, "这是您购买的第:<" + number + ">套[" + itemName + "]装扮奖励[+12钻石增幅劵]已发送进您的邮箱!", 1);

}
}
}

第三步 粘贴到游戏事件下!

if (game_event == 'Item+') {

var item_id = parseInt(group[15]);

var item_cnt = parseInt(group[17]);

gift_pack_return_award(user, account_id, item_id, item_cnt);
}

——————————————————————————@青梅煮酒¥

© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容