Grasscutter_Resources/Resources/Scripts/Scene/20011/scene20011_group220011003.lua
Alexander Hartmann 56284e8ece
improve lisas dungeon scripts readability (#22)
Co-authored-by: hartie95 <mail@hartie95.de>
2022-10-18 10:25:19 +05:30

413 lines
18 KiB
Lua

group_id = 220011003
monsters = {
{ config_id = 3001, monster_id = 21010401, pos = { x = 488.998, y = -24.119, z = 126.999 }, rot = { x = 0, y = 239.999, z = 0 }, level = 3, pose_id = 402 },
{ config_id = 3002, monster_id = 21010401, pos = { x = 488.459, y = -23.42, z = 116.25 }, rot = { x = 0, y = 305.466, z = 0 }, level = 3, pose_id = 402 },
{ config_id = 3003, monster_id = 20011101, pos = { x = 486.595, y = -23.615, z = 120.939 }, rot = { x = 0, y = 269.28, z = 0 }, level = 3, disableWander = true },
{ config_id = 3004, monster_id = 21010401, pos = { x = 489.836, y = -22.88, z = 121.183 }, rot = { x = 0, y = 280.53, z = 0 }, level = 3, pose_id = 402 },
{ config_id = 3005, monster_id = 21010201, pos = { x = 480.113, y = -22.88, z = 126.691 }, rot = { x = 0, y = 140.117, z = 0 }, level = 3 },
{ config_id = 3006, monster_id = 21010201, pos = { x = 481.056, y = -22.88, z = 116.133 }, rot = { x = 0, y = 53.65, z = 0 }, level = 3 },
{ config_id = 3007, monster_id = 21010201, pos = { x = 491.968, y = -23.01, z = 116.6 }, rot = { x = 0, y = 297.97, z = 0 }, level = 3 },
{ config_id = 3008, monster_id = 21010201, pos = { x = 492.038, y = -23.01, z = 126.518 }, rot = { x = 0, y = 225.324, z = 0 }, level = 3 }
}
npcs = { }
gadgets = {
{ config_id = 3009, gadget_id = 70350002, pos = { x = 463.668, y = -9.541, z = 120.944 }, rot = { x = 0, y = 90, z = 0 }, level = 1 },
{ config_id = 3010, gadget_id = 70350002, pos = { x = 500.938, y = -23.18, z = 121.64 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3011, gadget_id = 70310001, pos = { x = 460.074, y = -7.317, z = 126.777 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3012, gadget_id = 70310001, pos = { x = 460.087, y = -7.185, z = 115.093 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3013, gadget_id = 70310002, pos = { x = 498.672, y = -18.596, z = 127.408 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3014, gadget_id = 70310002, pos = { x = 498.679, y = -18.511, z = 116.032 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3015, gadget_id = 70310002, pos = { x = 430.307, y = -13.33, z = 128.477 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3016, gadget_id = 70310002, pos = { x = 430.301, y = -13.358, z = 114.697 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3017, gadget_id = 70310002, pos = { x = 430.318, y = -19.403, z = 128.472 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3018, gadget_id = 70310002, pos = { x = 430.298, y = -19.434, z = 114.665 }, rot = { x = 0, y = 270, z = 0 }, level = 1 },
{ config_id = 3019, gadget_id = 70900202, pos = { x = 511.916, y = -24.254, z = 121.694 }, rot = { x = 0, y = 48.844, z = 0 }, level = 1 },
{ config_id = 3020, gadget_id = 70900202, pos = { x = 532.83, y = -23.262, z = 123.108 }, rot = { x = 0, y = 215.626, z = 0 }, level = 1 },
{ config_id = 3021, gadget_id = 70220013, pos = { x = 458.379, y = -9.35, z = 111.762 }, rot = { x = 0, y = 147.084, z = 0 }, level = 1 },
{ config_id = 3022, gadget_id = 70220013, pos = { x = 455.744, y = -9.3, z = 111.288 }, rot = { x = 0, y = 241.337, z = 0 }, level = 1 },
{ config_id = 3023, gadget_id = 70220013, pos = { x = 453.328, y = -9.254, z = 110.179 }, rot = { x = 0, y = 163.634, z = 0 }, level = 1 },
{ config_id = 3024, gadget_id = 70220013, pos = { x = 459.152, y = -9.254, z = 109.246 }, rot = { x = 0, y = 238.989, z = 0 }, level = 1 },
{ config_id = 3025, gadget_id = 70211101, pos = { x = 456.424, y = -9.254, z = 107.768 }, rot = { x = 0, y = 245.888, z = 0 }, level = 1, drop_tag = "解谜低级蒙德", isOneoff = true },
{ config_id = 3026, gadget_id = 70220014, pos = { x = 455.003, y = -9.366, z = 109.295 }, rot = { x = 0, y = 299.25, z = 0 }, level = 1 },
{ config_id = 3027, gadget_id = 70220014, pos = { x = 456.474, y = -9.254, z = 113.151 }, rot = { x = 0, y = 34.842, z = 0 }, level = 1 },
{ config_id = 3028, gadget_id = 70220014, pos = { x = 454.405, y = -9.35, z = 110.894 }, rot = { x = 0, y = 48.81, z = 0 }, level = 1 }
}
regions = {
{ config_id = 11, shape = RegionShape.SPHERE, radius = 7.3, pos = { x = 435.196, y = -7.707, z = 121.122 } },
{ config_id = 26, shape = RegionShape.CUBIC, size = { x = 10, y = 8, z = 15 }, pos = { x = 506.843, y = -22.5, z = 121.314 } },
{ config_id = 40, shape = RegionShape.SPHERE, radius = 5, pos = { x = 422.789, y = -24.284, z = 120.497 } },
{ config_id = 41, shape = RegionShape.CUBIC, size = { x = 15, y = 3, z = 15 }, pos = { x = 426.984, y = -17.041, z = 121.846 } }
}
triggers = {
{ config_id = 1000011, name = "ENTER_REGION_11", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_11", action = "action_EVENT_ENTER_REGION_11", forbid_guest = false },
{ config_id = 1000012, name = "VARIABLE_CHANGE_12", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "condition_EVENT_VARIABLE_CHANGE_12", action = "action_EVENT_VARIABLE_CHANGE_12" },
{ config_id = 1000022, name = "ANY_MONSTER_DIE_22", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_22", action = "action_EVENT_ANY_MONSTER_DIE_22" },
{ config_id = 1000026, name = "ENTER_REGION_26", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_26", action = "action_EVENT_ENTER_REGION_26", forbid_guest = false },
{ config_id = 1000040, name = "ENTER_REGION_40", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_40", action = "action_EVENT_ENTER_REGION_40", forbid_guest = false },
{ config_id = 1000041, name = "ENTER_REGION_41", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_41", action = "action_EVENT_ENTER_REGION_41", forbid_guest = false },
{ config_id = 1000066, name = "ANY_MONSTER_DIE_66", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_66", action = "action_EVENT_ANY_MONSTER_DIE_66" },
{ config_id = 1000067, name = "ANY_MONSTER_DIE_67", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_67", action = "action_EVENT_ANY_MONSTER_DIE_67" },
{ config_id = 1000068, name = "ANY_MONSTER_DIE_68", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_68", action = "action_EVENT_ANY_MONSTER_DIE_68" },
{ config_id = 1000069, name = "ANY_MONSTER_DIE_69", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_69", action = "action_EVENT_ANY_MONSTER_DIE_69" },
{ config_id = 1000070, name = "ANY_MONSTER_DIE_70", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_70", action = "action_EVENT_ANY_MONSTER_DIE_70" },
{ config_id = 1000071, name = "ANY_MONSTER_DIE_71", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_71", action = "action_EVENT_ANY_MONSTER_DIE_71" },
{ config_id = 1000072, name = "ANY_MONSTER_DIE_72", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_72", action = "action_EVENT_ANY_MONSTER_DIE_72" },
{ config_id = 1000073, name = "ANY_MONSTER_DIE_73", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_73", action = "action_EVENT_ANY_MONSTER_DIE_73" }
}
variables = {
{ configId = 1, name = "Key", value = 0, no_refresh = false }
}
init_config = {
suite = 1,
end_suite = 0,
rand_suite = true
}
suites = {{
monsters = {3001, 3002, 3003, 3004},
gadgets = {3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028},
regions = {11, 26, 40, 41},
triggers = {"ENTER_REGION_11", "VARIABLE_CHANGE_12", "ANY_MONSTER_DIE_22", "ENTER_REGION_26", "ENTER_REGION_40", "ENTER_REGION_41", "ANY_MONSTER_DIE_66", "ANY_MONSTER_DIE_67", "ANY_MONSTER_DIE_68", "ANY_MONSTER_DIE_69", "ANY_MONSTER_DIE_70", "ANY_MONSTER_DIE_71", "ANY_MONSTER_DIE_72", "ANY_MONSTER_DIE_73"},
rand_weight = 100
}}
function condition_EVENT_ENTER_REGION_11(context, args)
if args.param1 ~= 11 then
return false
end
local avatarEntityCount = ScriptLib.GetRegionEntityCount(context, {
region_eid = args.source_eid,
entity_type = EntityType.AVATAR
})
if avatarEntityCount < 1 then
return false
end
return true
end
function action_EVENT_ENTER_REGION_11(context, args)
ScriptLib.AddExtraGroupSuite(context, 220011007, 6)
ScriptLib.RemoveExtraGroupSuite(context, 220011007, 5)
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3009, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3011, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3012, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
return 0
end
function condition_EVENT_VARIABLE_CHANGE_12(context, args)
if args.param1 == args.param2 then
return false
end
if ScriptLib.GetGroupVariableValue(context, "Key") ~= 8 then
return false
end
return true
end
function action_EVENT_VARIABLE_CHANGE_12(context, args)
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3010, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3013, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3014, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.CreateGadget(context, { config_id = 3019 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : dungeon_settle")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_22(context, args)
if ScriptLib.GetGroupMonsterCount(context) ~= 1 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_22(context, args)
if 0 ~= ScriptLib.ShowReminder(context, 1037001) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui")
return -1
end
return 0
end
function condition_EVENT_ENTER_REGION_26(context, args)
if args.param1 ~= 26 then
return false
end
local avatarEntityCount = ScriptLib.GetRegionEntityCount(context, {
region_eid = args.source_eid,
entity_type = EntityType.AVATAR
})
if avatarEntityCount < 1 then
return false
end
return true
end
function action_EVENT_ENTER_REGION_26(context, args)
ScriptLib.AddExtraGroupSuite(context, 220011007, 7)
ScriptLib.RemoveExtraGroupSuite(context, 220011007, 6)
if 0 ~= ScriptLib.ShowReminder(context, 1041022) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_reminder_ui")
return -1
end
local var2 = ScriptLib.KillGroupEntity(context, {
group_id = 220011003,
monsters = {},
gadgets = {3019}
})
if 0 ~= var2 then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monsters_and_gadgets_by_group")
return -1
end
if 0 ~= ScriptLib.CreateGadget(context, { config_id = 3020 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : dungeon_settle")
return -1
end
return 0
end
function condition_EVENT_ENTER_REGION_40(context, args)
if args.param1 ~= 40 then
return false
end
local avatarEntityCount = ScriptLib.GetRegionEntityCount(context, {
region_eid = args.source_eid,
entity_type = EntityType.AVATAR
})
if avatarEntityCount < 1 then
return false
end
return true
end
function action_EVENT_ENTER_REGION_40(context, args)
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3017, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3018, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
return 0
end
function condition_EVENT_ENTER_REGION_41(context, args)
if args.param1 ~= 41 then
return false
end
local avatarEntityCount = ScriptLib.GetRegionEntityCount(context, {
region_eid = args.source_eid,
entity_type = EntityType.AVATAR
})
if avatarEntityCount < 1 then
return false
end
return true
end
function action_EVENT_ENTER_REGION_41(context, args)
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3015, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 3016, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
local var3 = ScriptLib.KillGroupEntity(context, {
group_id = 220011002,
monsters = {},
gadgets = {2014}
})
if 0 ~= var3 then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_monsters_and_gadgets_by_group")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_66(context, args)
if args.param1 ~= 3005 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_66(context, args)
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_67(context, args)
if 3006 ~= args.param1 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_67(context, args)
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_68(context, args)
if 3007 ~= args.param1 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_68(context, args)
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_69(context, args)
if 3008 ~= args.param1 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_69(context, args)
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_70(context, args)
if args.param1 ~= 3002 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_70(context, args)
if 0 ~= ScriptLib.CreateMonster(context, { config_id = 3006, delay_time = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_monster")
return -1
end
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_71(context, args)
if args.param1 ~= 3001 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_71(context, args)
if 0 ~= ScriptLib.CreateMonster(context, { config_id = 3005, delay_time = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_monster")
return -1
end
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_72(context, args)
if args.param1 ~= 3004 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_72(context, args)
if 0 ~= ScriptLib.CreateMonster(context, { config_id = 3007, }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_monster")
return -1
end
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
if 0 ~= ScriptLib.CreateMonster(context, { config_id = 3008, delay_time = 1 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_monster")
return -1
end
return 0
end
function condition_EVENT_ANY_MONSTER_DIE_73(context, args)
if args.param1 ~= 3003 then
return false
end
return true
end
function action_EVENT_ANY_MONSTER_DIE_73(context, args)
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "Key", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end