-- 基础信息 local base_info = { group_id = 201053016 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 16001, gadget_id = 70900201, pos = { x = -71.284, y = 127.989, z = 75.019 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 16002, gadget_id = 71700099, pos = { x = -71.313, y = 127.459, z = 75.019 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, persistent = true } } -- 区域 regions = { { config_id = 16005, shape = RegionShape.SPHERE, radius = 8, pos = { x = -66.750, y = 126.465, z = 74.812 } } } -- 触发器 triggers = { { config_id = 1016003, name = "QUEST_FINISH_16003", event = EventType.EVENT_QUEST_FINISH, source = "7180004", condition = "condition_EVENT_QUEST_FINISH_16003", action = "action_EVENT_QUEST_FINISH_16003" }, { config_id = 1016004, name = "TIMER_EVENT_16004", event = EventType.EVENT_TIMER_EVENT, source = "outtime", condition = "", action = "action_EVENT_TIMER_EVENT_16004" }, { config_id = 1016005, name = "ENTER_REGION_16005", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_16005", action = "action_EVENT_ENTER_REGION_16005" } } -- 变量 variables = { } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { }, regions = { 16005 }, triggers = { "ENTER_REGION_16005" }, rand_weight = 100 }, { -- suite_id = 2, -- description = , monsters = { }, gadgets = { 16001, 16002 }, regions = { }, triggers = { }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发条件 function condition_EVENT_QUEST_FINISH_16003(context, evt) --检查ID为7180004的任务的完成状态是否为1(1=完成,0=失败) --此事件需要配合Quest表使用,在Quest表里的完成执行中配置“通知group脚本”,则该任务完成后服务端会向对应的group发送通知,参数1填写场景ID,参数2填写group ID(如果不填则会通知所有group) --检查任务ID if 7180004 ~= evt.param1 then return false end --检查任务成功状态 if 1 ~= evt.param2 then return false end return true end -- 触发操作 function action_EVENT_QUEST_FINISH_16003(context, evt) -- 延迟1秒后,向groupId为:201053016的对象,请求一次调用,并将string参数:"outtime" 传递过去 if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 201053016, "outtime", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 16001 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end return 0 end -- 触发操作 function action_EVENT_TIMER_EVENT_16004(context, evt) -- 调用提示id为 101700803 的提示UI,会显示在屏幕中央偏下位置,id索引自 ReminderData表格 if 0 ~= ScriptLib.ShowReminder(context, 101700803) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui") return -1 end -- 通知任务系统完成条件类型"LUA通知",复杂参数为quest_param的进度+1 if 0 ~= ScriptLib.AddQuestProgress(context, "7180005") then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : add_quest_progress") return -1 end return 0 end -- 触发条件 function condition_EVENT_ENTER_REGION_16005(context, evt) if evt.param1 ~= 16005 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_16005(context, evt) -- 通知任务系统完成条件类型"LUA通知",复杂参数为quest_param的进度+1 if 0 ~= ScriptLib.AddQuestProgress(context, "7180004") then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : add_quest_progress") return -1 end return 0 end