添加示例项目
This commit is contained in:
29
示例项目/黄金品级调整箱/黄金品级调整箱.nut
Normal file
29
示例项目/黄金品级调整箱/黄金品级调整箱.nut
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
function _Dps_SetEquinherit_Main_() {
|
||||
Cb_ModItemattr_Enter_Func.addinfoMax <- function(args) {
|
||||
//print("触发回调");
|
||||
local Config = GlobalConfig.Get("黄金品级调整箱_Lenheart.json");
|
||||
local SUser = User(args[1]);
|
||||
local pack = NativePointer(args[2]);
|
||||
local a = NativePointer(pack.add(20).readPointer());
|
||||
local itemSold = a.add(13).add(6).readShort();
|
||||
local equSold = a.add(13).add(0).readShort();
|
||||
local InvenObj = SUser.GetInven();
|
||||
print("InvenObj = " + InvenObj);
|
||||
if (InvenObj) {
|
||||
local ItemObj = InvenObj.GetSlot(1, itemSold);
|
||||
local equObj = InvenObj.GetSlot(1, equSold);
|
||||
//print("ItemObj = " + ItemObj);
|
||||
//print("equObj = " + equObj);
|
||||
//print("ItemObj.GetIndex() = " + ItemObj.GetIndex());
|
||||
if (ItemObj.GetIndex() == Config["黄金品级调整箱id"]) {
|
||||
Timer.SetTimeOut(function() {
|
||||
equObj.SetAdd_Info(999999998);
|
||||
equObj.Flush();
|
||||
SUser.SendUpdateItemList(1, 0, equSold);
|
||||
//print("调整成功");
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user