-- 基础信息 local base_info = { group_id = 243005009 } -- Trigger变量 local defs = { group_main = 243005007, group_1 = 243005009, monster_1 = 9003, monster_2 = 9006, challenge1 = 201, challenge2 = 202, Region1 = 9011, Region2 = 9019, challenge_father = 999, group_core = 243005005, galleryid = 7011 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { { config_id = 9003, monster_id = 21020301, pos = { x = -13.207, y = 40.000, z = -77.079 }, rot = { x = 0.000, y = 63.972, z = 0.000 }, level = 1 }, { config_id = 9004, monster_id = 21030301, pos = { x = -8.954, y = 40.000, z = -78.498 }, rot = { x = 0.000, y = 83.591, z = 0.000 }, level = 1 }, { config_id = 9005, monster_id = 21011201, pos = { x = -13.146, y = 40.061, z = -82.305 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 9006, monster_id = 21020301, pos = { x = 2.457, y = 40.000, z = -76.646 }, rot = { x = 0.000, y = 271.104, z = 0.000 }, level = 1 }, { config_id = 9007, monster_id = 21010301, pos = { x = -5.487, y = 40.002, z = -71.790 }, rot = { x = 0.000, y = 155.049, z = 0.000 }, level = 1 }, { config_id = 9008, monster_id = 21030101, pos = { x = 6.852, y = 40.049, z = -72.010 }, rot = { x = 0.000, y = 210.873, z = 0.000 }, level = 1 }, { config_id = 9009, monster_id = 21010301, pos = { x = 5.921, y = 40.080, z = -80.489 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 9020, monster_id = 21011201, pos = { x = -13.576, y = 40.000, z = -70.122 }, rot = { x = 0.000, y = 81.669, z = 0.000 }, level = 1 } } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 9018, gadget_id = 70900205, pos = { x = 1.932, y = 39.276, z = -84.580 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 } } -- 区域 regions = { { config_id = 9011, shape = RegionShape.CUBIC, size = { x = 80.000, y = 40.000, z = 35.000 }, pos = { x = -2.900, y = 40.000, z = -77.600 } }, { config_id = 9019, shape = RegionShape.CUBIC, size = { x = 80.000, y = 40.000, z = 35.000 }, pos = { x = -2.900, y = 40.000, z = -77.600 } } } -- 触发器 triggers = { { config_id = 1009001, name = "VARIABLE_CHANGE_9001", event = EventType.EVENT_VARIABLE_CHANGE, source = "key", condition = "condition_EVENT_VARIABLE_CHANGE_9001", action = "action_EVENT_VARIABLE_CHANGE_9001", trigger_count = 0 }, { config_id = 1009002, name = "ANY_MONSTER_DIE_9002", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_9002", action = "action_EVENT_ANY_MONSTER_DIE_9002", trigger_count = 0 }, { config_id = 1009011, name = "LEAVE_REGION_9011", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "condition_EVENT_LEAVE_REGION_9011", action = "action_EVENT_LEAVE_REGION_9011", trigger_count = 0 }, { config_id = 1009012, name = "CHALLENGE_FAIL_9012", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_EVENT_CHALLENGE_FAIL_9012", trigger_count = 0 }, { config_id = 1009013, name = "CHALLENGE_SUCCESS_9013", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "" }, { config_id = 1009014, name = "ANY_MONSTER_LIVE_9014", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "condition_EVENT_ANY_MONSTER_LIVE_9014", action = "action_EVENT_ANY_MONSTER_LIVE_9014" }, { config_id = 1009015, name = "ANY_MONSTER_LIVE_9015", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "condition_EVENT_ANY_MONSTER_LIVE_9015", action = "action_EVENT_ANY_MONSTER_LIVE_9015" }, { config_id = 1009016, name = "CHALLENGE_SUCCESS_9016", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "" }, { config_id = 1009017, name = "CHALLENGE_FAIL_9017", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_EVENT_CHALLENGE_FAIL_9017", trigger_count = 0 }, { config_id = 1009019, name = "LEAVE_REGION_9019", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "condition_EVENT_LEAVE_REGION_9019", action = "action_EVENT_LEAVE_REGION_9019", trigger_count = 0 }, { config_id = 1009021, name = "VARIABLE_CHANGE_9021", event = EventType.EVENT_VARIABLE_CHANGE, source = "key", condition = "condition_EVENT_VARIABLE_CHANGE_9021", action = "action_EVENT_VARIABLE_CHANGE_9021", trigger_count = 0 }, { config_id = 1009022, name = "ANY_MONSTER_DIE_9022", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_9022", action = "action_EVENT_ANY_MONSTER_DIE_9022", trigger_count = 0 } } -- 变量 variables = { { config_id = 1, name = "c2", value = 0, no_refresh = false }, { config_id = 2, name = "key", value = 0, no_refresh = false }, { config_id = 3, name = "success", value = 0, no_refresh = false }, { config_id = 4, name = "Gflag", value = 0, no_refresh = true } } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { 9018 }, regions = { }, triggers = { }, rand_weight = 0 }, { -- suite_id = 2, -- description = , monsters = { 9003, 9004, 9005, 9020 }, gadgets = { }, regions = { 9011 }, triggers = { "VARIABLE_CHANGE_9001", "ANY_MONSTER_DIE_9002", "LEAVE_REGION_9011", "ANY_MONSTER_LIVE_9014" }, rand_weight = 100 }, { -- suite_id = 3, -- description = , monsters = { 9006, 9007, 9008, 9009 }, gadgets = { }, regions = { 9019 }, triggers = { "ANY_MONSTER_LIVE_9015", "LEAVE_REGION_9019", "VARIABLE_CHANGE_9021", "ANY_MONSTER_DIE_9022" }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发条件 function condition_EVENT_VARIABLE_CHANGE_9001(context, evt) if evt.param1 == evt.param2 then return false end -- 判断变量"key"为4 if ScriptLib.GetGroupVariableValue(context, "key") ~= 4 then return false end return true end -- 触发操作 function action_EVENT_VARIABLE_CHANGE_9001(context, evt) -- 将本组内变量名为 "success" 的变量设置为 1 if 0 ~= ScriptLib.SetGroupVariableValue(context, "success", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable") return -1 end --【修改父挑战时间】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 1 then ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>1") if 0 ~= ScriptLib.SetGroupVariableValueByGroup(context, "AddTime", 1, defs.group_core) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable_by_group") return -1 end -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001005) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end ScriptLib.PrintContextLog(context, "父挑战时间已经修改") end --【复活】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 2 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 0) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>2") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001006) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加攻击】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 3 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 1) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>3") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001007) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加移速】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 4 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 2) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>4") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001008) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【复活2】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 5 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 3) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>2") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001006) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加攻击2】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 6 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 4) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>3") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001007) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加移速2】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 7 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 5) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>4") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001008) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end return 0 end -- 触发条件 function condition_EVENT_ANY_MONSTER_DIE_9002(context, evt) --检查configeID是否大于0 if 0 >= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_DIE_9002(context, evt) -- 针对当前group内变量名为 "key" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "key", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable") return -1 end --通知父挑战积分+1 ScriptLib.ExecuteGroupLua(context, defs.group_core, "AddChildChallengeScore", {1}) return 0 end -- 触发条件 function condition_EVENT_LEAVE_REGION_9011(context, evt) -- 判断是区域8011 if ScriptLib.GetRegionConfigId(context, { region_eid = evt.source_eid }) ~= defs.Region1 then return false end -- 判断变量"success"为0 if ScriptLib.GetGroupVariableValue(context, "success") ~= 0 then return false end return true end -- 触发操作 function action_EVENT_LEAVE_REGION_9011(context, evt) --离开区域 挑战失败 ScriptLib.ExecuteGroupLua(context, defs.group_core, "StopChildChallengeFromDiffGroup", {defs.challenge1,0}) ScriptLib.PrintContextLog(context, "离开区域,挑战失败!!!!!!!!!!!") -- 针对当前group内变量名为 "f1" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValueByGroup(context, "f2", 1, defs.group_main) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable_by_group") return -1 end -- 删除suite2的所有内容 ScriptLib.RemoveExtraGroupSuite(context, defs.group_1, 2) return 0 end -- 触发操作 function action_EVENT_CHALLENGE_FAIL_9012(context, evt) -- 针对当前group内变量名为 "f1" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValueByGroup(context, "f2", 1, defs.group_main) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable_by_group") return -1 end -- 删除suite2的所有内容 ScriptLib.RemoveExtraGroupSuite(context, defs.group_1, 2) return 0 end -- 触发条件 function condition_EVENT_ANY_MONSTER_LIVE_9014(context, evt) if defs.monster_1 ~= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_LIVE_9014(context, evt) --向编号999的父挑战挂接子挑战 ScriptLib.ExecuteGroupLua(context, defs.group_core, "DefineFatherIndex",{defs.challenge_father}) ScriptLib.ExecuteGroupLua(context, defs.group_core, "DefineChildChallengeScore",{ 1, 1}) ScriptLib.ExecuteGroupLua(context, defs.group_core, "AttachChildChallengeFromDiffGroup",{defs.challenge1, 233, 4}) -- 调用提示id为 43001009 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001009) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end return 0 end -- 触发条件 function condition_EVENT_ANY_MONSTER_LIVE_9015(context, evt) if defs.monster_2 ~= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_LIVE_9015(context, evt) --向编号999的父挑战挂接子挑战 ScriptLib.ExecuteGroupLua(context, defs.group_core, "DefineFatherIndex",{defs.challenge_father}) ScriptLib.ExecuteGroupLua(context, defs.group_core, "DefineChildChallengeScore",{ 1, 1}) ScriptLib.ExecuteGroupLua(context, defs.group_core, "AttachChildChallengeFromDiffGroup",{defs.challenge1, 233, 4}) -- 调用提示id为 43001009 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001009) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end return 0 end -- 触发操作 function action_EVENT_CHALLENGE_FAIL_9017(context, evt) -- 针对当前group内变量名为 "f1" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValueByGroup(context, "f2", 1, defs.group_main) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable_by_group") return -1 end -- 删除suite2的所有内容 ScriptLib.RemoveExtraGroupSuite(context, defs.group_1, 3) return 0 end -- 触发条件 function condition_EVENT_LEAVE_REGION_9019(context, evt) -- 判断是区域8011 if ScriptLib.GetRegionConfigId(context, { region_eid = evt.source_eid }) ~= defs.Region2 then return false end -- 判断变量"success"为0 if ScriptLib.GetGroupVariableValue(context, "success") ~= 0 then return false end return true end -- 触发操作 function action_EVENT_LEAVE_REGION_9019(context, evt) --离开区域 挑战失败 ScriptLib.ExecuteGroupLua(context, defs.group_core, "StopChildChallengeFromDiffGroup", {defs.challenge1,0}) ScriptLib.PrintContextLog(context, "离开区域,挑战失败!!!!!!!!!!!") -- 针对当前group内变量名为 "f1" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValueByGroup(context, "f2", 1, defs.group_main) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable_by_group") return -1 end -- 删除suite2的所有内容 ScriptLib.RemoveExtraGroupSuite(context, defs.group_1, 3) return 0 end -- 触发条件 function condition_EVENT_VARIABLE_CHANGE_9021(context, evt) if evt.param1 == evt.param2 then return false end -- 判断变量"key"为4 if ScriptLib.GetGroupVariableValue(context, "key") ~= 4 then return false end return true end -- 触发操作 function action_EVENT_VARIABLE_CHANGE_9021(context, evt) -- 将本组内变量名为 "success" 的变量设置为 1 if 0 ~= ScriptLib.SetGroupVariableValue(context, "success", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable") return -1 end --【修改父挑战时间】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 1 then ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>1") if 0 ~= ScriptLib.SetGroupVariableValueByGroup(context, "AddTime", 1, defs.group_core) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable_by_group") return -1 end -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001005) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end ScriptLib.PrintContextLog(context, "父挑战时间已经修改") end --【复活】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 2 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 0) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>2") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001006) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加攻击】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 3 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 1) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>3") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001007) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加移速】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 4 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 2) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>4") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001008) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【复活2】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 5 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 3) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>2") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001006) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加攻击2】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 6 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 4) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>3") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001007) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end --【加移速2】 if ScriptLib.GetGroupVariableValue(context, "Gflag") == 7 then ScriptLib.AttachGalleryAbilityGroup(context, {}, defs.galleryid, 5) ScriptLib.PrintContextLog(context, "Gflag>>>>>>>>>>>>>>>>>>>>>>>>>>>4") -- 调用提示id为 400021 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 43001008) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end end return 0 end -- 触发条件 function condition_EVENT_ANY_MONSTER_DIE_9022(context, evt) --检查configeID是否大于0 if 0 >= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_ANY_MONSTER_DIE_9022(context, evt) -- 针对当前group内变量名为 "key" 的变量,进行修改,变化值为 1 if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "key", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable") return -1 end --通知父挑战积分+1 ScriptLib.ExecuteGroupLua(context, defs.group_core, "AddChildChallengeScore", {1}) return 0 end