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

475 lines
17 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 = 244007001
}
--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
{ config_id = 1021, monster_id = 22020102, pos = { x = -1.324, y = -0.102, z = -5.904 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, disableWander = true, affix = { 6110, 1008 }, isElite = true, pose_id = 101 },
{ config_id = 1022, monster_id = 22020102, pos = { x = -1.459, y = -0.102, z = -5.929 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, disableWander = true, affix = { 6110, 6112, 1008 }, isElite = true, pose_id = 101 }
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
{ config_id = 1001, gadget_id = 70360010, pos = { x = 0.173, y = -0.256, z = -0.198 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 1013, gadget_id = 44000006, pos = { x = -0.010, y = -0.102, z = 7.027 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
}
-- 区域
regions = {
}
-- 触发器
triggers = {
{ config_id = 1001002, name = "GADGET_CREATE_1002", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_1002", action = "action_EVENT_GADGET_CREATE_1002" },
{ config_id = 1001012, name = "SELECT_OPTION_1012", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1012", action = "action_EVENT_SELECT_OPTION_1012" },
{ config_id = 1001014, name = "TIMER_EVENT_1014", event = EventType.EVENT_TIMER_EVENT, source = "T1", condition = "", action = "action_EVENT_TIMER_EVENT_1014" },
{ config_id = 1001015, name = "CHALLENGE_SUCCESS_1015", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "202", condition = "", action = "action_EVENT_CHALLENGE_SUCCESS_1015" },
{ config_id = 1001016, name = "CHALLENGE_FAIL_1016", event = EventType.EVENT_CHALLENGE_FAIL, source = "202", condition = "", action = "action_EVENT_CHALLENGE_FAIL_1016" },
{ config_id = 1001017, name = "CHALLENGE_SUCCESS_1017", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "201", condition = "", action = "action_EVENT_CHALLENGE_SUCCESS_1017" },
{ config_id = 1001019, name = "DUNGEON_ALL_AVATAR_DIE_1019", event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "condition_EVENT_DUNGEON_ALL_AVATAR_DIE_1019", action = "action_EVENT_DUNGEON_ALL_AVATAR_DIE_1019", trigger_count = 0 },
{ config_id = 1001020, name = "CHALLENGE_FAIL_1020", event = EventType.EVENT_CHALLENGE_FAIL, source = "101", condition = "", action = "action_EVENT_CHALLENGE_FAIL_1020" },
{ config_id = 1001023, name = "SPECIFIC_MONSTER_HP_CHANGE_1023", event = EventType.EVENT_SPECIFIC_MONSTER_HP_CHANGE, source = "1021", condition = "condition_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1023", action = "action_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1023" },
{ config_id = 1001024, name = "SPECIFIC_MONSTER_HP_CHANGE_1024", event = EventType.EVENT_SPECIFIC_MONSTER_HP_CHANGE, source = "1022", condition = "condition_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1024", action = "action_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1024" }
}
-- 点位
points = {
{ config_id = 1003, pos = { x = -0.230, y = -0.102, z = -9.605 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 2 },
{ config_id = 1004, pos = { x = 13.897, y = -0.102, z = -5.825 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1005, pos = { x = -15.853, y = -0.102, z = -6.289 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1006, pos = { x = -0.067, y = -0.102, z = -16.197 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1007, pos = { x = 7.218, y = -0.102, z = -0.606 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1008, pos = { x = -6.361, y = -0.102, z = -0.999 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1009, pos = { x = -0.163, y = -0.102, z = -6.463 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1010, pos = { x = -8.330, y = -0.102, z = 2.398 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 },
{ config_id = 1011, pos = { x = 7.779, y = -0.102, z = 3.084 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, tag = 4 }
}
-- 变量
variables = {
{ config_id = 1, name = "IS_IN_LIMIT_TIME", value = 0, no_refresh = false },
{ config_id = 2, name = "EXTRA_MONSTER", value = 0, no_refresh = false },
{ config_id = 3, name = "IS_BOSS_DEAD", value = 0, no_refresh = false }
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 0,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = ,
monsters = { },
gadgets = { 1001, 1013 },
regions = { },
triggers = { "GADGET_CREATE_1002", "SELECT_OPTION_1012", "TIMER_EVENT_1014", "CHALLENGE_SUCCESS_1015", "CHALLENGE_FAIL_1016", "DUNGEON_ALL_AVATAR_DIE_1019", "CHALLENGE_FAIL_1020" },
rand_weight = 100
},
{
-- suite_id = 2,
-- description = ,
monsters = { },
gadgets = { },
regions = { },
triggers = { "CHALLENGE_SUCCESS_1017" },
rand_weight = 100
},
{
-- suite_id = 3,
-- description = ,
monsters = { 1021 },
gadgets = { },
regions = { },
triggers = { "SPECIFIC_MONSTER_HP_CHANGE_1023" },
rand_weight = 100
},
{
-- suite_id = 4,
-- description = ,
monsters = { 1022 },
gadgets = { },
regions = { },
triggers = { "SPECIFIC_MONSTER_HP_CHANGE_1024" },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发条件
function condition_EVENT_GADGET_CREATE_1002(context, evt)
if 1001 ~= evt.param1 then
return false
end
return true
end
-- 触发操作
function action_EVENT_GADGET_CREATE_1002(context, evt)
-- 设置操作台选项
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 244007001, 1001, {175}) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_SELECT_OPTION_1012(context, evt)
-- 判断是gadgetid 1001 option_id 175
if 1001 ~= evt.param1 then
return false
end
if 175 ~= evt.param2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_SELECT_OPTION_1012(context, evt)
-- 初始化时间变量
local challenge_time = 0
local shock_wave = 0
--------------------------------------------------------------------------------
-- 判断选择时间因子
if (0 or -1) ~= ScriptLib.GetChannellerSlabLoopDungeonLimitTime(context) then
challenge_time = ScriptLib.GetChannellerSlabLoopDungeonLimitTime(context)
end
------------------------------------------------------------
-- 判断是否每波需要额外的怪物,如果是的话改变变量
if false ~= ScriptLib.IsChannellerSlabLoopDungeonConditionSelected(context, 114) then
ScriptLib.SetGroupVariableValue(context, "EXTRA_MONSTER", 1)
end
------------------------------------------------------------
-- 判断是否每波需要额外的怪物,如果是的话改变变量
if false ~= ScriptLib.IsChannellerSlabLoopDungeonConditionSelected(context, 111) then
shock_wave = 1
end
-- 在Group244007001从怪物潮池{13031}或{13039}(带额外词缀)中随机创建一个TideIndex为1的怪物潮,创建怪物总数为1,场上怪物最少1只,最多1只, pointTag 为 2 每0尝试填充一次,填充数量为0
if shock_wave == 0 then
ScriptLib.AddExtraGroupSuite(context, 244007001, 3)
else
ScriptLib.AddExtraGroupSuite(context, 244007001, 4)
end
-- 将configid为 1001 的物件更改为状态 GadgetState.GearStop
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1001, GadgetState.GearStop) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
-- 删除指定group: 244007001 ;指定config:1001;物件身上指定option:175;
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 244007001, 1001, 175) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
return -1
end
----------------------------------------------------------------------------------------------------------------------------
-- 创建编号为110180父挑战,indexID为101
if 0 ~= ScriptLib.CreateFatherChallenge(context, 101, 110180, 999999, {success = 1, fail = 1, fail_on_wipe=false}) then
return -1
end
-- 创建编号为201的子挑战:杀怪挑战,消灭1个boss怪
if 0 ~= ScriptLib.AttachChildChallenge(context, 101, 201, 110184, {244007001,1},{},{success=0,fail=0}) then
return -1
end
-- 创建编号为202的子挑战:限时积分.如果没有选择不会开启
if 0 ~= challenge_time then
ScriptLib.AttachChildChallenge(context, 101, 202, 110182, {challenge_time,244007001,1},{},{success=0,fail=0})
else
ScriptLib.AddExtraGroupSuite(context, 244007001, 2)
end
-- 开始父挑战
if 0 ~= ScriptLib.StartFatherChallenge(context, 101) then
return -1
end
-- 延迟3秒后,向groupId为:244007001的对象,请求一次调用,并将string参数:"T1" 传递过去
if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 244007001, "T1", 5) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
return -1
end
-- 卸载回血gadget
if 0 ~= ScriptLib.RemoveEntityByConfigId(context, 244007001, EntityType.GADGET, 1013 ) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : remove_gadget_by_configid")
return -1
end
return 0
end
-- 触发操作
function action_EVENT_TIMER_EVENT_1014(context, evt)
-- 添加suite2的新内容
ScriptLib.AddExtraGroupSuite(context, 244007002, 2)
return 0
end
-- 触发操作
function action_EVENT_CHALLENGE_SUCCESS_1015(context, evt)
-- 将本组内变量名为 "IS_IN_LIMIT_TIME" 的变量设置为 1
if 0 ~= ScriptLib.SetGroupVariableValue(context, "IS_IN_LIMIT_TIME", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
-- 将本组内变量名为 "IS_BOSS_DEAD" 的变量设置为 1
if 0 ~= ScriptLib.SetGroupVariableValue(context, "IS_BOSS_DEAD", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
-- 终止识别id为101的挑战,并判定成功
ScriptLib.StopChallenge(context, 101, 1)
return 0
end
-- 触发操作
function action_EVENT_CHALLENGE_FAIL_1016(context, evt)
-- 将本组内变量名为 "IS_IN_LIMIT_TIME" 的变量设置为 0
if 0 ~= ScriptLib.SetGroupVariableValue(context, "IS_IN_LIMIT_TIME", 0) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
-- 添加suite2的新内容
ScriptLib.AddExtraGroupSuite(context, 244007001, 2)
return 0
end
-- 触发操作
function action_EVENT_CHALLENGE_SUCCESS_1017(context, evt)
-- 将本组内变量名为 "IS_BOSS_DEAD" 的变量设置为 1
if 0 ~= ScriptLib.SetGroupVariableValue(context, "IS_BOSS_DEAD", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
-- 终止识别id为101的挑战,并判定成功
ScriptLib.StopChallenge(context, 101, 1)
return 0
end
-- 触发条件
function condition_EVENT_DUNGEON_ALL_AVATAR_DIE_1019(context, evt)
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = 0
for i,v in ipairs(uid_list) do
local is_all_dead = ScriptLib.IsPlayerAllAvatarDie(context, v)
if true ~= is_all_dead then
ret = -1
break
end
end
if ret ~= 0 then
return false
end
return true
end
-- 触发操作
function action_EVENT_DUNGEON_ALL_AVATAR_DIE_1019(context, evt)
-- 终止识别id为101的挑战,并判定失败
ScriptLib.StopChallenge(context, 101, 0)
-- 地城失败结算
if 0 ~= ScriptLib.CauseDungeonFail(context) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cause_dungeonfail")
return -1
end
return 0
end
-- 触发操作
function action_EVENT_CHALLENGE_FAIL_1020(context, evt)
-- 重新生成指定group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 244007002, suite = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
-- 重新生成指定group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 244007003, suite = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
-- 重新生成指定group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 244007004, suite = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
-- 重新生成指定group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 244007005, suite = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
-- 重新生成指定group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 244007001, suite = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1023(context, evt)
--[[判断指定configid的怪物的血量小于%20时触发指定后续操作]]--
if evt.type ~= EventType.EVENT_SPECIFIC_MONSTER_HP_CHANGE or evt.param3 > 20 then
return false
end
return true
end
-- 触发操作
function action_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1023(context, evt)
-- 将本组内变量名为 "IS_BOSS_DEAD" 的变量设置为 1
if 0 ~= ScriptLib.SetGroupVariableValue(context, "IS_BOSS_DEAD", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007002, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007003, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007004, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007005, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1024(context, evt)
--[[判断指定configid的怪物的血量小于%20时触发指定后续操作]]--
if evt.type ~= EventType.EVENT_SPECIFIC_MONSTER_HP_CHANGE or evt.param3 > 20 then
return false
end
return true
end
-- 触发操作
function action_EVENT_SPECIFIC_MONSTER_HP_CHANGE_1024(context, evt)
-- 将本组内变量名为 "IS_BOSS_DEAD" 的变量设置为 1
if 0 ~= ScriptLib.SetGroupVariableValue(context, "IS_BOSS_DEAD", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007002, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007003, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007004, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
-- 杀死Group内所有monster
if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 244007005, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monster_by_group")
return -1
end
return 0
end