178 lines
5.1 KiB
Go
178 lines
5.1 KiB
Go
-- 基础信息
|
||
local base_info = {
|
||
group_id = 240951001
|
||
}
|
||
|
||
-- DEFS_MISCS
|
||
local defs = {
|
||
--GroupID
|
||
group_id = 240951001,
|
||
|
||
--控制挑战开始的操作机关configID
|
||
starter_configID = 1001,
|
||
|
||
--随机时间轴。每个轴上数字间隔8~15秒,请人力随机
|
||
RandomTimeAxis = {
|
||
{2,18,38,56,81,99,115,133,148,165,180,196,211,235,257,276,300,315,330,349,367,383,400,416,431,449,471,487},
|
||
{1,17,36,53,69,89,109,134,158,173,197,213,231,249,264,289,305,324,347,362,385,407,429,453,473,491},
|
||
{2,19,42,61,85,104,128,146,167,190,209,232,255,271,288,307,327,348,368,393,412,430,455,477,500},
|
||
},
|
||
|
||
--配置每次几个洞口发球
|
||
random_thunderhole_sum = {
|
||
min = 1,
|
||
max = 2,
|
||
},
|
||
|
||
--洞口物件放在哪个suit里了
|
||
thunderhole_suite_index = 1
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 怪物
|
||
monsters = {
|
||
}
|
||
|
||
-- NPC
|
||
npcs = {
|
||
}
|
||
|
||
-- 装置
|
||
gadgets = {
|
||
{ config_id = 1001, gadget_id = 70360010, pos = { x = 0.031, y = -0.053, z = -0.025 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, state = GadgetState.GearStop },
|
||
{ config_id = 1004, gadget_id = 70330086, pos = { x = 9.258, y = 0.002, z = -0.029 }, rot = { x = 0.000, y = 270.000, z = 0.000 }, level = 1 },
|
||
{ config_id = 1005, gadget_id = 70330086, pos = { x = -9.323, y = 0.002, z = -0.046 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }
|
||
}
|
||
|
||
-- 区域
|
||
regions = {
|
||
{ config_id = 1002, shape = RegionShape.CUBIC, size = { x = 50.000, y = 20.000, z = 4.000 }, pos = { x = -0.004, y = 2.033, z = 25.004 } }
|
||
}
|
||
|
||
-- 触发器
|
||
triggers = {
|
||
{ config_id = 1001002, name = "ENTER_REGION_1002", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_1002", action = "action_EVENT_ENTER_REGION_1002", forbid_guest = false },
|
||
{ config_id = 1001003, name = "SELECT_OPTION_1003", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1003", action = "action_EVENT_SELECT_OPTION_1003", trigger_count = 0 }
|
||
}
|
||
|
||
-- 变量
|
||
variables = {
|
||
{ config_id = 1, name = "challenge", value = 0, no_refresh = false }
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 初始化配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 初始化时创建
|
||
init_config = {
|
||
suite = 1,
|
||
end_suite = 0,
|
||
rand_suite = false
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 小组配置
|
||
--
|
||
--================================================================
|
||
|
||
suites = {
|
||
{
|
||
-- suite_id = 1,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { 1001, 1004, 1005 },
|
||
regions = { 1002 },
|
||
triggers = { "ENTER_REGION_1002", "SELECT_OPTION_1003" },
|
||
rand_weight = 100
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 触发器
|
||
--
|
||
--================================================================
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_ENTER_REGION_1002(context, evt)
|
||
if evt.param1 ~= 1002 then return false end
|
||
|
||
-- 判断角色数量不少于1
|
||
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_ENTER_REGION_1002(context, evt)
|
||
-- 改变指定group组0中, configid为1001的gadget的state
|
||
if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 0, 1001, GadgetState.Default) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId")
|
||
return -1
|
||
end
|
||
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240951001, 1001, {7}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_1003(context, evt)
|
||
-- 判断是gadgetid 1001 option_id 7
|
||
if 1001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 7 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_1003(context, evt)
|
||
-- 重新生成指定group,指定suite
|
||
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240951002, suite = 2 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
|
||
return -1
|
||
end
|
||
|
||
-- 重新生成指定group,指定suite
|
||
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240951003, suite = 2 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240951001 ;指定config:1001;物件身上指定option:7;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240951001, 1001, 7) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 改变指定group组240951001中, configid为1001的gadget的state
|
||
if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240951001, 1001, GadgetState.GearStop) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
require "V2_0/ThunderHole" |