-- 基础信息 local base_info = { group_id = 240037002 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { } -- NPC npcs = { } -- 装置 gadgets = { } -- 区域 regions = { } -- 触发器 triggers = { { config_id = 1002002, name = "CHALLENGE_FAIL_2002", event = EventType.EVENT_CHALLENGE_FAIL, source = "1", condition = "", action = "action_EVENT_CHALLENGE_FAIL_2002", trigger_count = 0 }, { config_id = 1002003, name = "DUNGEON_ALL_AVATAR_DIE_2003", event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "condition_EVENT_DUNGEON_ALL_AVATAR_DIE_2003", action = "action_EVENT_DUNGEON_ALL_AVATAR_DIE_2003", trigger_count = 0 }, { config_id = 1002004, name = "ANY_MONSTER_LIVE_2004", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "condition_EVENT_ANY_MONSTER_LIVE_2004", action = "action_EVENT_ANY_MONSTER_LIVE_2004", trigger_count = 0 } } -- 变量 variables = { } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { }, regions = { }, triggers = { }, rand_weight = 100 }, { -- suite_id = 2, -- description = , monsters = { }, gadgets = { }, regions = { }, triggers = { "CHALLENGE_FAIL_2002", "DUNGEON_ALL_AVATAR_DIE_2003", "ANY_MONSTER_LIVE_2004" }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发操作 function action_EVENT_CHALLENGE_FAIL_2002(context, evt) -- 重新生成指定group,指定suite if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240037002, suite = 1 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite") return -1 end -- 重新生成指定group,指定suite if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240037001, suite = 1 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite") return -1 end -- 地城失败结算 if 0 ~= ScriptLib.CauseDungeonFail(context) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cause_dungeonfail") return -1 end return 0 end -- 触发条件 function condition_EVENT_DUNGEON_ALL_AVATAR_DIE_2003(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_2003(context, evt) -- 终止识别id为1的挑战,并判定失败 ScriptLib.StopChallenge(context, 1, 0) return 0 end -- 触发条件 function condition_EVENT_ANY_MONSTER_LIVE_2004(context, evt) if 2001 ~= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_LIVE_2004(context, evt) local challenge_time = 420 if -1 ~= ScriptLib.GetEffigyChallengeLimitTime(context) then challenge_time = 420 - ScriptLib.GetEffigyChallengeLimitTime(context) end if 0 ~= ScriptLib.ActiveChallenge(context, 1, 237, challenge_time, 240037002, 1, 0) then return -1 end return 0 end