GSServer-CBT/soggy_resources/lua/Scene/20000/scene20000_group220000036.lua
Akbar Yahya e0d4d8040c melon
2022-11-21 16:30:31 +08:00

132 lines
3.3 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
{ config_id = 91, gadget_id = 70800001, pos = { x = 143.2, y = 1.1, z = -2.4 }, rot = { x = 0.0, y = 215.0, z = 0.0 }, level = 1 }
}
-- 区域
regions = {
{ config_id = 56, shape = RegionShape.SPHERE, radius = 5, pos = { x = 142.8, y = 1.1, z = -2.8 } },
{ config_id = 57, shape = RegionShape.SPHERE, radius = 5, pos = { x = 142.0, y = 1.1, z = -1.8 } }
}
-- 触发器
triggers = {
{ name = "GADGET_CREATE_56", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_56", action = "action_EVENT_GADGET_CREATE_56", trigger_count = 0 },
{ name = "SELECT_OPTION_57", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_57", action = "action_EVENT_SELECT_OPTION_57", trigger_count = 0 }
}
-- 变量
variables = {
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
rand_suite = false,
npcs = { }
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 0,
-- description = ,
monsters = { },
gadgets = { 91 },
regions = { 56, 57 },
triggers = { "GADGET_CREATE_56", "SELECT_OPTION_57" },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发条件
function condition_EVENT_GADGET_CREATE_56(context, evt)
if 91 ~= evt.param1 then
return false
end
return true
end
-- 触发操作
function action_EVENT_GADGET_CREATE_56(context, evt)
-- 设置操作台选项
if 0 ~= ScriptLib.SetWorktopOptions(context, {24}) then
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_SELECT_OPTION_57(context, evt)
-- 判断是gadgetid 91 option_id 24
if 91 ~= evt.param1 then
return false
end
if 24 ~= evt.param2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_SELECT_OPTION_57(context, evt)
-- 当option_id为24时开启封印战斗战斗区域半径为10圈内进度每秒增长1圈外进度每秒衰减2进度达到60时判定为战斗成功填0则取默认值100进度衰减到0后5秒判定为战斗失败
if 24 == evt.param2 then
local ret = ScriptLib.StartSealBattle(context, {radius = 10, in_add = 1, out_sub = 2, fail_time = 5, max_progress = 60})
--ScriptLib.PrintLog("StartSealBattle ret: " ..ret)
end
-- 重新生成指定group指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 220000037, suite = 1 }) then
return -1
end
-- 删除指定group 220000036 指定config91物件身上指定option24
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 220000036, 91, 24) then
return -1
end
-- 将configid为 91 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 91, GadgetState.GearStart) then
return -1
end
return 0
end