-- 基础信息 local base_info = { group_id = 220170001 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 1001, gadget_id = 70350433, pos = { x = 56.170, y = 76.347, z = -64.344 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }, { config_id = 1002, gadget_id = 70310108, pos = { x = 51.963, y = 76.347, z = -64.344 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 } } -- 区域 regions = { { config_id = 1004, shape = RegionShape.SPHERE, radius = 5, pos = { x = 51.963, y = 76.347, z = -64.344 } } } -- 触发器 triggers = { { config_id = 1001003, name = "QUEST_FINISH_1003", event = EventType.EVENT_QUEST_FINISH, source = "", condition = "condition_EVENT_QUEST_FINISH_1003", action = "action_EVENT_QUEST_FINISH_1003" }, { config_id = 1001004, name = "ENTER_REGION_1004", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_1004", action = "action_EVENT_ENTER_REGION_1004" } } -- 变量 variables = { } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { 1001 }, regions = { }, triggers = { "QUEST_FINISH_1003" }, rand_weight = 100 }, { -- suite_id = 2, -- description = , monsters = { }, gadgets = { 1002 }, regions = { 1004 }, triggers = { "ENTER_REGION_1004" }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发条件 function condition_EVENT_QUEST_FINISH_1003(context, evt) --检查ID为303106的任务的完成状态是否为1(1=完成,0=失败) --此事件需要配合Quest表使用,在Quest表里的完成执行中配置“通知group脚本”,则该任务完成后服务端会向对应的group发送通知,参数1填写场景ID,参数2填写group ID(如果不填则会通知所有group) --检查任务ID if 303106 ~= evt.param1 then return false end --检查任务成功状态 if 1 ~= evt.param2 then return false end return true end -- 触发操作 function action_EVENT_QUEST_FINISH_1003(context, evt) -- 添加suite2的新内容 ScriptLib.AddExtraGroupSuite(context, 220170001, 2) return 0 end -- 触发条件 function condition_EVENT_ENTER_REGION_1004(context, evt) if evt.param1 ~= 1004 then return false end -- 判断角色数量不少于1 if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then return false end return true end -- 触发操作 function action_EVENT_ENTER_REGION_1004(context, evt) -- 通知任务系统完成条件类型"LUA通知",复杂参数为quest_param的进度+1 if 0 ~= ScriptLib.AddQuestProgress(context, "30312201") then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : add_quest_progress") return -1 end return 0 end