添加示例项目
This commit is contained in:
11
示例项目/副本需要持有道具进入/Proj.ifo
Normal file
11
示例项目/副本需要持有道具进入/Proj.ifo
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ProjectName": "副本需要持有道具进入",
|
||||
"ProjectDescribe": "副本需要持有道具进入",
|
||||
"ProjectAuthor": "凌众",
|
||||
"ProjectVersion": 1.0,
|
||||
"ProjectConfig": "副本需要持有道具进入_Lenheart.json",
|
||||
"ProjectFiles": [
|
||||
"副本需要持有道具进入.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_MapNeedItem_Main_"
|
||||
}
|
||||
38
示例项目/副本需要持有道具进入/副本需要持有道具进入.nut
Normal file
38
示例项目/副本需要持有道具进入/副本需要持有道具进入.nut
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _Dps_MapNeedItem_Main_() {
|
||||
|
||||
// 禁止进入副本
|
||||
Cb_SelectDungeon_Check_Error_Leave_Func.MapNeedItem <- function (args) {
|
||||
|
||||
|
||||
local Config = GlobalConfig.Get("副本需要持有道具进入_Lenheart.json");
|
||||
|
||||
local body = Config["副本需要持有道具才允许进入"];
|
||||
|
||||
local SUser = User(args[1]);
|
||||
|
||||
local mapid = NativePointer(args[2]).add(13).readShort();
|
||||
if(body.rawin(mapid.tostring())){
|
||||
local ItemId = body[mapid.tostring()];
|
||||
local PartyObj = SUser.GetParty();
|
||||
if (!PartyObj) {
|
||||
return;
|
||||
}
|
||||
for (local i = 0; i < 4; ++i) {
|
||||
local PSUser = PartyObj.GetUser(i);
|
||||
if (PSUser) {
|
||||
local InvenObj = SUser.GetInven();
|
||||
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
||||
if(SlotIdx == -1){
|
||||
SUser.SendNotiBox(Config["公告"]+PvfItem.GetNameById(ItemId),1);
|
||||
return 1; // 禁止进入副本
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
示例项目/副本需要持有道具进入/副本需要持有道具进入_Lenheart.json
Normal file
7
示例项目/副本需要持有道具进入/副本需要持有道具进入_Lenheart.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"公告": "缺少进入凭证:",
|
||||
"副本需要持有道具才允许进入":{
|
||||
"65":3037,
|
||||
"64":3038
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user