Files
hk4e-go/gdconf/game_data_config/lua/scene/46001/scene46001_group246001002.lua
T
2022-11-30 00:00:20 +08:00

280 lines
9.8 KiB
Go
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.
-- 基础信息
local base_info = {
group_id = 246001002
}
-- DEFS_MISCS
-- 随机创建雷爆石/充电桩
function ElectricPowerSource_ElectricBomb_Creation (context)
-- 随机一个suite出雷爆石或充电桩
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 246001002, suite = 0, refresh_level_revise = 0, exclude_prev = false , is_force_random_suite = true}) then
return -1
end
return 0
end
-- 移除雷爆石/充电桩
function ElectricPowerSource_ElectricBomb_Removal (context)
-- 杀死充电桩/雷爆石所在Group内所有实体
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 246001002, kill_policy = GroupKillPolicy.GROUP_KILL_ALL }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_group")
return -1
end
-- 重新生成充电桩/雷爆石所在group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 246001002, suite = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
return 0
end
--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
{ config_id = 2001, gadget_id = 70330062, pos = { x = 16.000, y = -0.102, z = 5.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 2002, gadget_id = 70330062, pos = { x = 16.000, y = -0.102, z = -5.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 2003, gadget_id = 70330062, pos = { x = 21.000, y = -0.102, z = 0.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 2004, gadget_id = 70330063, pos = { x = 14.000, y = -0.102, z = 0.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, state = GadgetState.GearStart },
{ config_id = 2005, gadget_id = 70330062, pos = { x = -16.000, y = -0.102, z = 5.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 2006, gadget_id = 70330062, pos = { x = -16.000, y = -0.102, z = -5.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 2007, gadget_id = 70330062, pos = { x = -21.000, y = -0.102, z = 0.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 2008, gadget_id = 70330063, pos = { x = -14.000, y = -0.102, z = 0.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, state = GadgetState.GearStart },
{ config_id = 2009, gadget_id = 70900205, pos = { x = -0.332, y = -3.089, z = -5.981 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
}
-- 区域
regions = {
}
-- 触发器
triggers = {
{ config_id = 1002010, name = "TIMER_EVENT_2010", event = EventType.EVENT_TIMER_EVENT, source = "T1", condition = "", action = "action_EVENT_TIMER_EVENT_2010" },
{ config_id = 1002011, name = "GADGET_CREATE_2011", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_2011", action = "action_EVENT_GADGET_CREATE_2011" },
{ config_id = 1002012, name = "TIMER_EVENT_2012", event = EventType.EVENT_TIMER_EVENT, source = "T2", condition = "", action = "action_EVENT_TIMER_EVENT_2012", trigger_count = 0 },
{ config_id = 1002013, name = "GROUP_LOAD_2013", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_2013", trigger_count = 0 },
{ config_id = 1002014, name = "GADGET_CREATE_2014", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_2014", action = "action_EVENT_GADGET_CREATE_2014" }
}
-- 变量
variables = {
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 0,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = ,
monsters = { },
gadgets = { 2009 },
regions = { },
triggers = { },
rand_weight = 0
},
{
-- suite_id = 2,
-- description = 充电桩,
monsters = { },
gadgets = { 2001, 2002, 2003, 2005, 2006, 2007 },
regions = { },
triggers = { "TIMER_EVENT_2010", "GADGET_CREATE_2011" },
rand_weight = 100
},
{
-- suite_id = 3,
-- description = 雷爆石,
monsters = { },
gadgets = { 2004, 2008 },
regions = { },
triggers = { "GADGET_CREATE_2014" },
rand_weight = 100
},
{
-- suite_id = 4,
-- description = ,
monsters = { },
gadgets = { },
regions = { },
triggers = { "TIMER_EVENT_2012", "GROUP_LOAD_2013" },
rand_weight = 0
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发操作
function action_EVENT_TIMER_EVENT_2010(context, evt)
-- 将configid为 2001 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2001, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2002 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2002, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2003 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2003, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2005 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2005, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2006 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2006, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2007 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2007, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_GADGET_CREATE_2011(context, evt)
if 2001 ~= evt.param1 then
return false
end
return true
end
-- 触发操作
function action_EVENT_GADGET_CREATE_2011(context, evt)
-- 延迟2秒后,向groupId为:246001002的对象,请求一次调用,并将string参数:"T1" 传递过去
if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 246001002, "T1", 2) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
return -1
end
-- 添加suite4的新内容
ScriptLib.AddExtraGroupSuite(context, 246001002, 4)
-- 调用提示id为 460010102 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格
if 0 ~= ScriptLib.ShowReminder(context, 460010102) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui")
return -1
end
return 0
end
-- 触发操作
function action_EVENT_TIMER_EVENT_2012(context, evt)
-- 将configid为 2001 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2001, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2002 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2002, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2003 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2003, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2005 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2005, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2006 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2006, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 将configid为 2007 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 2007, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
return 0
end
-- 触发操作
function action_EVENT_GROUP_LOAD_2013(context, evt)
-- 延迟2秒后,向groupId为:246001002的对象,请求一次调用,并将string参数:"T2" 传递过去
if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 246001002, "T2", 2) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_GADGET_CREATE_2014(context, evt)
if 2004 ~= evt.param1 then
return false
end
return true
end
-- 触发操作
function action_EVENT_GADGET_CREATE_2014(context, evt)
-- 调用提示id为 460010101 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格
if 0 ~= ScriptLib.ShowReminder(context, 460010101) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui")
return -1
end
return 0
end