177 lines
4.5 KiB
Go
177 lines
4.5 KiB
Go
-- 基础信息
|
||
local base_info = {
|
||
group_id = 240028002
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 怪物
|
||
monsters = {
|
||
{ config_id = 2001, monster_id = 20040102, pos = { x = 0.000, y = 0.000, z = 0.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, title_id = 10004, special_name_id = 10020 }
|
||
}
|
||
|
||
-- NPC
|
||
npcs = {
|
||
}
|
||
|
||
-- 装置
|
||
gadgets = {
|
||
{ config_id = 2002, gadget_id = 70900205, pos = { x = -1.674, y = -2.446, z = -5.656 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
|
||
{ config_id = 2005, gadget_id = 44000006, pos = { x = 0.000, y = 0.000, z = 19.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
|
||
}
|
||
|
||
-- 区域
|
||
regions = {
|
||
}
|
||
|
||
-- 触发器
|
||
triggers = {
|
||
{ config_id = 1002003, name = "CHALLENGE_FAIL_2003", event = EventType.EVENT_CHALLENGE_FAIL, source = "1", condition = "", action = "action_EVENT_CHALLENGE_FAIL_2003", trigger_count = 0 },
|
||
{ config_id = 1002004, name = "DUNGEON_ALL_AVATAR_DIE_2004", event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "condition_EVENT_DUNGEON_ALL_AVATAR_DIE_2004", action = "action_EVENT_DUNGEON_ALL_AVATAR_DIE_2004", trigger_count = 0 },
|
||
{ config_id = 1002008, name = "ANY_MONSTER_LIVE_2008", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "condition_EVENT_ANY_MONSTER_LIVE_2008", action = "action_EVENT_ANY_MONSTER_LIVE_2008", trigger_count = 0 }
|
||
}
|
||
|
||
-- 变量
|
||
variables = {
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 初始化配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 初始化时创建
|
||
init_config = {
|
||
suite = 1,
|
||
end_suite = 0,
|
||
rand_suite = false
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 小组配置
|
||
--
|
||
--================================================================
|
||
|
||
suites = {
|
||
{
|
||
-- suite_id = 1,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { 2002, 2005 },
|
||
regions = { },
|
||
triggers = { },
|
||
rand_weight = 100
|
||
},
|
||
{
|
||
-- suite_id = 2,
|
||
-- description = ,
|
||
monsters = { 2001 },
|
||
gadgets = { 2002 },
|
||
regions = { },
|
||
triggers = { "CHALLENGE_FAIL_2003", "DUNGEON_ALL_AVATAR_DIE_2004", "ANY_MONSTER_LIVE_2008" },
|
||
rand_weight = 100
|
||
},
|
||
{
|
||
-- suite_id = 3,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { 2002 },
|
||
regions = { },
|
||
triggers = { },
|
||
rand_weight = 100
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 触发器
|
||
--
|
||
--================================================================
|
||
|
||
-- 触发操作
|
||
function action_EVENT_CHALLENGE_FAIL_2003(context, evt)
|
||
-- 重新生成指定group,指定suite
|
||
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240028001, suite = 1 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
|
||
return -1
|
||
end
|
||
|
||
-- 重新生成指定group,指定suite
|
||
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 240028002, suite = 3 }) 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_2004(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_2004(context, evt)
|
||
-- 终止识别id为1的挑战,并判定失败
|
||
ScriptLib.StopChallenge(context, 1, 0)
|
||
|
||
-- 地城失败结算
|
||
if 0 ~= ScriptLib.CauseDungeonFail(context) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cause_dungeonfail")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_ANY_MONSTER_LIVE_2008(context, evt)
|
||
if 2001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_ANY_MONSTER_LIVE_2008(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, 215, challenge_time, 240028002, 1, 0) then
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end |