-- 基础信息 local base_info = { group_id = 240202001 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { { config_id = 1001, monster_id = 20010901, pos = { x = -7.519, y = 0.002, z = -10.848 }, rot = { x = 0.000, y = 114.477, z = 0.000 }, level = 1, isElite = true }, { config_id = 1002, monster_id = 20010901, pos = { x = 6.346, y = 0.002, z = -11.304 }, rot = { x = 0.000, y = 298.874, z = 0.000 }, level = 1, isElite = true }, { config_id = 1005, monster_id = 22010203, pos = { x = -0.194, y = -0.097, z = -12.362 }, rot = { x = 0.000, y = 1.574, z = 0.000 }, level = 3, isElite = true }, { config_id = 1013, monster_id = 20010801, pos = { x = -6.278, y = 0.040, z = -5.440 }, rot = { x = 0.000, y = 51.979, z = 0.000 }, level = 1 }, { config_id = 1014, monster_id = 20010801, pos = { x = -0.105, y = 0.040, z = -8.334 }, rot = { x = 0.000, y = 81.873, z = 0.000 }, level = 1 }, { config_id = 1015, monster_id = 20010801, pos = { x = 4.972, y = 0.040, z = -5.901 }, rot = { x = 0.000, y = 298.874, z = 0.000 }, level = 1 }, { config_id = 1016, monster_id = 20010901, pos = { x = -4.539, y = 0.040, z = -8.776 }, rot = { x = 0.000, y = 218.680, z = 0.000 }, level = 1 }, { config_id = 1017, monster_id = 20010901, pos = { x = 3.979, y = 0.040, z = -8.932 }, rot = { x = 0.000, y = 0.484, z = 0.000 }, level = 1 } } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 1010, gadget_id = 70900205, pos = { x = 9.895, y = -1.608, z = 2.323 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 } } -- 区域 regions = { } -- 触发器 triggers = { { config_id = 1000003, name = "ANY_MONSTER_DIE_3", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_3", action = "action_EVENT_ANY_MONSTER_DIE_3" }, { config_id = 1000012, name = "ANY_MONSTER_LIVE_12", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "condition_EVENT_ANY_MONSTER_LIVE_12", action = "action_EVENT_ANY_MONSTER_LIVE_12" }, { config_id = 1000014, name = "CHALLENGE_FAIL_14", event = EventType.EVENT_CHALLENGE_FAIL, source = "1", condition = "", action = "action_EVENT_CHALLENGE_FAIL_14" } } -- 变量 variables = { { config_id = 1, name = "Key", value = 0, no_refresh = false }, { config_id = 2, name = "C1", value = 0, no_refresh = false }, { config_id = 3, name = "monster_wave", value = 0, no_refresh = false } } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { 1010 }, regions = { }, triggers = { "CHALLENGE_FAIL_14" }, rand_weight = 100 }, { -- suite_id = 2, -- description = suite_2, monsters = { 1013, 1014, 1015, 1016, 1017 }, gadgets = { 1010 }, regions = { }, triggers = { "ANY_MONSTER_DIE_3", "ANY_MONSTER_LIVE_12", "CHALLENGE_FAIL_14" }, rand_weight = 100 }, { -- suite_id = 3, -- description = , monsters = { 1001, 1002, 1005 }, gadgets = { 1010 }, regions = { }, triggers = { "CHALLENGE_FAIL_14" }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发条件 function condition_EVENT_ANY_MONSTER_DIE_3(context, evt) -- 判断指定group组剩余怪物数量是否是0 if ScriptLib.GetGroupMonsterCountByGroupId(context, 240202001) ~= 0 then return false end -- 判断变量"monster_wave"为0 if ScriptLib.GetGroupVariableValue(context, "monster_wave") ~= 0 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_DIE_3(context, evt) -- 添加suite3的新内容 ScriptLib.AddExtraGroupSuite(context, 240202001, 3) -- 针对当前group内变量名为 "monster_wave" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "monster_wave", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable") return -1 end return 0 end -- 触发条件 function condition_EVENT_ANY_MONSTER_LIVE_12(context, evt) if 1013 ~= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_LIVE_12(context, evt) -- 创建编号为1(该挑战的识别id),挑战内容为191的区域挑战,具体参数填写方式,见DungeonChallengeData表中的注释,所有填写的值都必须是int类型 if 0 ~= ScriptLib.ActiveChallenge(context, 1, 191, 360, 240202001, 8, 0) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_challenge") return -1 end -- 删除指定group: 240202002 ;指定config:1;物件身上指定option:7; if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240202002, 1, 7) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId") return -1 end -- 改变指定group组240202002中, configid为1的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240202002, 1, GadgetState.GearStop) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end return 0 end -- 触发操作 function action_EVENT_CHALLENGE_FAIL_14(context, evt) -- 改变指定group组240202002中, configid为1的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240202002, 1, GadgetState.Default) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end -- 设置操作台选项 if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240202002, 1, {7}) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid") return -1 end -- 重新生成指定group,指定suite if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240202007, suite = 1 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite") return -1 end -- 改变指定group组240202008中, configid为9的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240202008, 9, GadgetState.Default) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end -- 重新生成指定group,指定suite if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240202001, suite = 1 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite") return -1 end return 0 end