86 lines
2.3 KiB
Plaintext
86 lines
2.3 KiB
Plaintext
function _Dps_HZZDQXHDJZDDSQSHZ_Main_() {
|
|
local Config = GlobalConfig.Get("红字自动取消和道具自动打上全身红字.json");
|
|
Cb_Use_Item_Sp_Func[Config["全身红字道具"][0]] <- function(SUser, ItemId) {
|
|
qsdshz(SUser, 1281);
|
|
}
|
|
|
|
Cb_Use_Item_Sp_Func[Config["全身红字道具"][1]] <- function(SUser, ItemId) {
|
|
qsdshz(SUser, 1282);
|
|
}
|
|
|
|
Cb_Use_Item_Sp_Func[Config["全身红字道具"][2]] <- function(SUser, ItemId) {
|
|
qsdshz(SUser, 1283);
|
|
}
|
|
|
|
Cb_Use_Item_Sp_Func[Config["全身红字道具"][3]] <- function(SUser, ItemId) {
|
|
qsdshz(SUser, 1284);
|
|
}
|
|
|
|
|
|
|
|
|
|
//自动取消红字
|
|
Cb_User_Insert_Item_Leave_Func.hzzdqc <- 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();
|
|
local pvfitem = PvfItem.GetPvfItemById(item_id);
|
|
if (Sq_CallFunc(S_Ptr("0x08150812"), "int", ["pointer"], inven_item.C_Object)) {
|
|
if(inven_item.GetAmplification() >=1281 &&inven_item.GetAmplification()<= 1284){
|
|
|
|
inven_item.SetAmplification(0);
|
|
inven_item.Flush();
|
|
SUser.SendUpdateItemList(1, 0, idx);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
function qsdshz(SUser, type) {
|
|
|
|
local InvenObj = SUser.GetInven();
|
|
//遍历身上的每一件装备
|
|
/*
|
|
for (local u = 10; u <= 21; u++) {
|
|
if (u != 11) {
|
|
|
|
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
|
if (EquObj && !EquObj.IsEmpty) {
|
|
local ItemId1 = EquObj.GetIndex();
|
|
|
|
EquObj.SetAmplification(type);
|
|
EquObj.Flush();
|
|
SUser.SendUpdateItemList(1, 3, u);
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
|
|
for (local u = 9; u <= 56; u++) {
|
|
|
|
|
|
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, u);
|
|
if (EquObj && !EquObj.IsEmpty) {
|
|
local ItemId1 = EquObj.GetIndex();
|
|
|
|
EquObj.SetAmplification(type);
|
|
EquObj.Flush();
|
|
SUser.SendUpdateItemList(1, 0, u);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|