添加示例项目
This commit is contained in:
11
示例项目/门票进入副本/Proj.ifo
Normal file
11
示例项目/门票进入副本/Proj.ifo
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ProjectName": "门票进入副本",
|
||||
"ProjectDescribe": "添加副本使用指定道具进入规则",
|
||||
"ProjectAuthor": "猫咪",
|
||||
"ProjectVersion": 1.2,
|
||||
"ProjectConfig": "门票进入副本配置_Maomi.json",
|
||||
"ProjectFiles": [
|
||||
"门票进入副本.nut"
|
||||
],
|
||||
"ProjectRunFunc": "_Dps_TicketAccessToDungeon_Maomi_Main_"
|
||||
}
|
||||
50
示例项目/门票进入副本/门票进入副本.nut
Normal file
50
示例项目/门票进入副本/门票进入副本.nut
Normal file
@@ -0,0 +1,50 @@
|
||||
function get_required_gradeByMaomi(dgn_id, dgn_diff) {
|
||||
local Config = GlobalConfig.Get("门票进入副本配置_Maomi.json");
|
||||
if (Config["门票进入副本"]["副本配置"].rawin(dgn_id.tostring())) {
|
||||
local requirements = Config["门票进入副本"]["副本配置"][dgn_id.tostring()];
|
||||
for (local i = 0; i< requirements.len(); i += 2) {
|
||||
if (requirements[i] == dgn_diff) {
|
||||
return requirements[i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function _Dps_TicketAccessToDungeon_Maomi_Main_() {
|
||||
|
||||
Cb_SelectDungeon_Check_Error_Leave_Func.Check_TicketByMaomi <- function(args) {
|
||||
|
||||
local Config = sq_ReadJsonFile("/dp_s/OfficialConfig" + "/" + "门票进入副本配置_Maomi.json");
|
||||
// local Config = GlobalConfig.Get("门票进入副本配置_Maomi.json");
|
||||
|
||||
local SUser = User(args[1]);
|
||||
local msg_base = args[2];
|
||||
local dgn_id = NativePointer(msg_base).add(13).readU16(); // 获取副本ID
|
||||
local dgn_diff = NativePointer(msg_base).add(15).readU8(); // 获取副本难度
|
||||
local PartyObj = SUser.GetParty();
|
||||
|
||||
local required_Item = get_required_gradeByMaomi(dgn_id, dgn_diff);
|
||||
local diff_name = Config["副本难度命名"][(dgn_diff).tostring()];
|
||||
|
||||
if (!required_Item) return null;
|
||||
|
||||
if (PartyObj && Config["门票进入副本"]["门票进入副本开关(true为开启,false为关闭)"]) {
|
||||
for (local i = 0; i< 4; ++i) {
|
||||
local Tuser = PartyObj.GetUser(i);
|
||||
if (Tuser) {
|
||||
local InvenObj = Tuser.GetInven();
|
||||
if (InvenObj) {
|
||||
if (InvenObj.CheckItemCount(required_Item, 1)){
|
||||
InvenObj.DeleteItemCount(required_Item, 1);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SUser.SendNotiBox("队伍中所有玩家均无副本所需门票,无法进入!", 2)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
示例项目/门票进入副本/门票进入副本配置_Maomi.json
Normal file
29
示例项目/门票进入副本/门票进入副本配置_Maomi.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"门票进入副本": {
|
||||
"提示": "门票进入副本配置(副本ID[普通级,门票,冒险级,门票,勇士级,门票,王者级,门票,地狱级,门票])",
|
||||
"门票进入副本开关(true为开启,false为关闭)": true,
|
||||
"副本配置": {
|
||||
"1": [
|
||||
0,
|
||||
3037,
|
||||
1,
|
||||
3037,
|
||||
2,
|
||||
3037,
|
||||
3,
|
||||
3037,
|
||||
4,
|
||||
3037,
|
||||
5,
|
||||
3037
|
||||
]
|
||||
}
|
||||
},
|
||||
"副本难度命名": {
|
||||
"0": "普通级",
|
||||
"1": "冒险级",
|
||||
"2": "勇士级",
|
||||
"3": "王者级",
|
||||
"4": "地狱级"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user