添加配置表

This commit is contained in:
flswld
2022-11-30 00:00:20 +08:00
parent f70a890338
commit d7f3f3b866
33382 changed files with 8476601 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--[[
=====================================================================================================================
|| Filename || Activity_GachaSync
|| RelVersion || 2.7
|| Owner || chao.jin
|| Description || 2.7 家具扭蛋活动进入Region时修改玩家SGV
|| LogName || ##[GachaSync]
|| Protection ||
=====================================================================================================================
--[[misc
defs = {
region_sync = 1001, --活动划定的同步SGV的Region
sync_element = 1, --同步元素类型 1火2水3冰4雷
}
=====================================================================================================================]]
local GachaSync_Triggers = {
[1] = { name = "enter_region", config_id = 8002001, event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_region", trigger_count = 0, forbid_guest = false},
[2] = { name = "leave_region", config_id = 8002002, event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_region", trigger_count = 0, forbid_guest = false },
[3] = { name = "group_load", config_id = 8002003, event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
}
function action_enter_region(context,evt)
if evt.param1 == defs.region_sync then
ScriptLib.PrintContextLog(context,"##[GachaSync]:玩家进入活动Group范围")
ScriptLib.SetTeamServerGlobalValue(context, context.uid, "SGV_ActivityGacha_ElemSyncRegion", defs.sync_element)
end
return 0
end
function action_leave_region(context,evt)
if evt.param1 == defs.region_sync then
ScriptLib.PrintContextLog(context,"##[GachaSync]:玩家离开活动Group范围")
ScriptLib.SetTeamServerGlobalValue(context, context.uid, "SGV_ActivityGacha_ElemSyncRegion", 0)
end
return 0
end
function action_group_load(context,evt)
if base_info.group_id == 133001079 then
ScriptLib.PrintContextLog(context,"##[GachaSync]:修改Group天气")
ScriptLib.SetWeatherAreaState(context, 1009, 1)
end
return 0
end
function GachaSync_Initialize()
for k,v in pairs(GachaSync_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
GachaSync_Initialize()

View File

@@ -0,0 +1,449 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--[[
=====================================================================================================================
|| Filename || Activity_LumenArena
|| RelVersion || 2.7
|| Owner || chao.jin
|| Description || 2.7 流明石活动最后一天的无双活动
|| LogName || ##[LumenArena]
|| Protection ||
=====================================================================================================================
--[[misc
defs = {
region_vision = 1001, --性能优化圈的范围
operator_id = 574048, --操作台的configid
option_id = 175, --操作台的option id
Pursina_id = 574021, --挖掘桩的configid
mud_cover_id = 574040, -- 包裹住光钉的黑泥包裹物
delay_time = 5, -- 场上刷出黑泥地毯之后,多久刷出黑泥包裹物
reminder_id = 400138, -- 每波刷出黑泥时弹出remindert提示
}
black_mud_list = {
[1] = {core_id = 574028, mud_id = 574034, charge_point_mud_cover_id = 574095},
[2] = {core_id = 574029, mud_id = 574035, charge_point_mud_cover_id = 574096},
[3] = {core_id = 574030, mud_id = 574036, charge_point_mud_cover_id = 574095},
[4] = {core_id = 574031, mud_id = 574037, charge_point_mud_cover_id = 574096},
[5] = {core_id = 574032, mud_id = 574038, charge_point_mud_cover_id = 574095},
[6] = {core_id = 574033, mud_id = 574039, charge_point_mud_cover_id = 574096},
}
charge_point_list = {
[574095] = 574093,
[574096] = 574094,
}
monster_list = {
---1波丘丘人
{ tide_mons = {574002,574003,574004,574005,574006,574050}, mud = {}, next_tide = 2,min = 6, max = 6, next_time = 2},
--- 黑泥波+史莱姆
{ tide_mons = {574007,574008,574009,574010,574052}, mud = {3}, next_tide = 3,min = 5, max = 5, tide_delay = 4, next_time = 2},
---3波精英暴徒+丘丘人
{ tide_mons = {574011,574012,574013,574014,574015,574054}, mud = {}, next_tide = 4,min = 6, max = 6, next_time = 2},
--- 黑泥波+史莱姆
{ tide_mons = {574016,574017,574018,574019,574020}, mud = {4}, next_tide = 5,min = 5, max = 5, tide_delay = 4, next_time = 2},
---5波遗迹怪
{ tide_mons = {574058,574059,574057}, mud = {}, next_tide = 6,min = 3, max = 3, next_time = 2},
--- 黑泥波+丘丘人
{ tide_mons = {574061,574062,574063,574064,574065,574066}, mud = {1}, next_tide = 7,min = 6, max = 6, tide_delay = 4, next_time = 2},
---7波遗迹
{ tide_mons = {574067,574068,574069}, mud = {}, next_tide = 8,min = 2, max = 2, next_time = 2},
--- 黑泥波+丘丘人
{ tide_mons = {574071,574072,574073,574074,574075,574076}, mud = {4,6}, next_tide = 9,min = 6, max = 6, tide_delay = 5, next_time = 2},
---9波猎犬
{ tide_mons = {574077,574078,574079,574080,574081}, mud = {}, next_tide = 10,min = 4, max = 4, next_time = 2},
--- 黑泥波+丘丘人
{ tide_mons = {574083,574084,574085,574086,574087,574088}, mud = {1,3,4}, next_tide = 11,min = 6, max = 6, tide_delay = 5, next_time = 2},
---11波黑蛇骑士
{ tide_mons = {574089,574090}, mud = {}, next_tide = 6,min = 2, max = 2, next_time = 2},
}
tide_mons 当前波次使用的怪物潮List
mud 当前波次对应的黑泥索引,如果本波没有黑泥则为空
next_tide 下一波刷新的怪物索引
min max 怪物潮使用的最小和最大数量
tide_delay 当前怪物潮的刷怪延迟,如果没有黑泥则不会延迟刷怪
next_time 刷新下一波怪物的延迟时间
=====================================================================================================================]]
local default_infos = {
gallery_id = 19001,
mud_gadget_id = 70290233,
}
local PURSINA_STATE= {
LOCKED = 0,
IDLE = 201,
RUNNING = 202,
CLOSING = 203,
}
local PURSINA_ROTATE = {
LOW = 1,
MID = 2,
HIGH= 3,
}
local LumenArena_Triggers = {
[1] = { name = "group_load", config_id = 8001001, event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
[2] = { name = "select_option", config_id = 8001002, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0},
[3] = { name = "monster_tide_die", config_id = 8001003, event = EventType.EVENT_MONSTER_TIDE_DIE, source = "", condition = "", action = "action_monster_tide_die", trigger_count = 0},
[4] = { name = "monster_die_before_leave_scene", config_id = 8001004, event = EventType.EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE, source = "", condition = "", action = "action_monster_die_before_leave_scene", trigger_count = 0},
[5] = { name = "gallery_stop", config_id = 8001005, event = EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_gallery_stop", trigger_count = 0},
-- [6] = { name = "enter_vision_region", config_id = 8001006, event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_vision_region", trigger_count = 0},
-- [7] = { name = "leave_vision_region", config_id = 8001007, event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_vision_region", trigger_count = 0},
[8] = { name = "group_will_unload", config_id = 8001008, event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_group_will_unload", trigger_count = 0},
[9] = { name = "time_axis_pass", config_id = 8001009, event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_time_axis_pass", trigger_count = 0},
[10] = { name = "any_gadget_die", config_id = 8001010, event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0},
[11] = { name = "gadget_create", config_id = 8001011, event = EventType.EVENT_GADGET_CREATE, source = "", condition = "", action = "action_gadget_create", trigger_count = 0},
[12] = { name = "leave_fail_region", config_id = 8001012, event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_fail_region", trigger_count = 0},
}
--玩家和操作台交互起Gallery挑战
function action_group_load(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenArena]:Group 加载完毕")
LF_ResetTempValues(context)
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, defs.operator_id, {7})
ScriptLib.SetGadgetStateByConfigId(context, defs.Pursina_id, PURSINA_STATE.IDLE)
return 0
end
--玩家和操作台交互起Gallery挑战
function action_select_option(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenArena]:开启Gallery流程")
local uidList = ScriptLib.GetSceneUidList(context)
ScriptLib.SetPlayerStartGallery(context, default_infos.gallery_id, {uidList[1]})
ScriptLib.SetGroupTempValue(context, "Gallery_Started", 1, {})
ScriptLib.InitTimeAxis(context, "PURSINA_HIGH", {90}, false)
ScriptLib.SetGadgetStateByConfigId(context, defs.Pursina_id, PURSINA_STATE.RUNNING)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Pursina_id, "SGV_PURSINA_ROTATE", PURSINA_ROTATE.MID)
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.pursina_tip)
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, defs.operator_id, 7)
for cover_id,charger_id in pairs(charge_point_list) do
if 0 == ScriptLib.GetEntityIdByConfigId(context, charger_id) then
ScriptLib.CreateGadget(context, {config_id = charger_id})
ScriptLib.PrintContextLog(context,"##[LumenArena]:创建充能萤火虫")
end
end
LF_CreateMud(context)
ScriptLib.CreateGadget(context, {config_id = defs.enemy_gadget})
return 0
end
--当前的怪物潮刷清空时,处理下一波怪物
function action_monster_tide_die(context,evt)
local tide_index = ScriptLib.GetGroupTempValue(context, "Cur_Tide_Index", {})
if evt.param1 >= #monster_list[tide_index].tide_mons then
ScriptLib.PrintContextLog(context,"##[LumenArena]:当前怪物潮怪物全部清空")
local next_refresh_time = monster_list[tide_index].next_time
if 0 ~= next_refresh_time then
ScriptLib.InitTimeAxis(context, "REFRESH_NEXT_TIDE", {next_refresh_time}, false)
else
LF_CreateMud(context)
end
end
return 0
end
--怪物死亡时同步
function action_monster_die_before_leave_scene(context, evt)
local mon_id = monsters[evt.param1].monster_id
ScriptLib.PrintContextLog(context,"##[LumenArena]:怪物死亡同步Gallery怪物ID"..mon_id)
ScriptLib.UpdatePlayerGalleryScore(context, 19001, {["uid"] = context.owner_uid, ["monster_id"] = mon_id})
return 0
end
--在特定黑泥刷新时,创建黑泥包裹物,移除充能光虫
function action_gadget_create(context, evt)
if charge_point_list[evt.param1] ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenArena]:黑泥包裹物创建,移除发光虫")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, charge_point_list[evt.param1]) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, charge_point_list[evt.param1])
end
end
return 0
end
--玩家脱离挑战区域结束Gallery
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
ScriptLib.PrintContextLog(context,"##[LumenArena]:玩家离开挑战区域,挑战失败")
ScriptLib.StopGallery(context, default_infos.gallery_id, true)
end
return 0
end
--黑泥清除同步
function action_any_gadget_die(context,evt)
ScriptLib.PrintContextLog(context,"##[LumenArena]:黑泥死亡"..evt.param1)
if 0 == ScriptLib.GetGroupTempValue(context, "Gallery_Started", {}) then
ScriptLib.PrintContextLog(context,"##[LumenArena]:Gallery未开启不处理")
return 0
end
for k,mud_kv in pairs(black_mud_list) do
if evt.param1 == mud_kv.core_id then
ScriptLib.PrintContextLog(context,"##[LumenArena]:清除黑泥核心,移除黑泥白盒, 同步Gallery")
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, mud_kv.mud_id)
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_kv.mud_id, entity_type = EntityType.GADGET })
--根据场上黑泥核心的状态移除包裹物
local cover_id = mud_kv.charge_point_mud_cover_id
local core_nums = 0
for k,mud_infos in pairs(black_mud_list) do
if cover_id == mud_infos.charge_point_mud_cover_id then
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, mud_infos.core_id) then
core_nums = core_nums + 1
end
end
end
if core_nums == 0 then
ScriptLib.PrintContextLog(context,"##[LumenArena]:移除黑泥包裹物,创建对应发光虫")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, mud_kv.charge_point_mud_cover_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_kv.charge_point_mud_cover_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, mud_kv.charge_point_mud_cover_id)
end
if 0 == ScriptLib.GetEntityIdByConfigId(context, charge_point_list[mud_kv.charge_point_mud_cover_id]) then
ScriptLib.CreateGadget(context, {config_id = charge_point_list[mud_kv.charge_point_mud_cover_id]})
end
end
ScriptLib.UpdatePlayerGalleryScore(context, 19001, {["uid"] = context.owner_uid, ["clean_mud_num"] = 1})
ScriptLib.ChangeGroupTempValue(context, "Mud_Num", -1, {})
end
end
if 0 == ScriptLib.GetGroupTempValue(context, "Mud_Num", {}) then
ScriptLib.PrintContextLog(context,"##[LumenArena]:场上黑泥清除完毕,恢复光钉状态")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.mud_cover_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = defs.mud_cover_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.mud_cover_id)
end
local roate_state = ScriptLib.GetGroupTempValue(context, "Pursina_Rotate", {})
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Pursina_id, "SGV_PURSINA_ROTATE", roate_state)
ScriptLib.SetGroupTempValue(context, "BeCovered", 0, {})
end
return 0
end
--最后一分钟升级光钉
function action_time_axis_pass(context, evt)
if evt.source_name == "PURSINA_HIGH" then
ScriptLib.PrintContextLog(context,"##[LumenArena]:剩余时间1分钟升级光钉至高速")
if 0 == ScriptLib.GetGroupTempValue(context, "Mud_Num", {}) then
ScriptLib.SetGroupTempValue(context, "Pursina_Rotate", PURSINA_ROTATE.HIGH, {})
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Pursina_id, "SGV_PURSINA_ROTATE", PURSINA_ROTATE.HIGH)
end
ScriptLib.SetGroupTempValue(context, "Pursina_Rotate", PURSINA_ROTATE.HIGH, {})
end
if evt.source_name == "MUD_REFRESH" then
ScriptLib.PrintContextLog(context,"##[LumenArena]:检测是否有黑泥")
if 0 ~= ScriptLib.GetGroupTempValue(context, "Mud_Num", {}) then
--判一下是否存在黑泥包裹物
if 0 == ScriptLib.GetEntityIdByConfigId(context, defs.mud_cover_id) then
ScriptLib.PrintContextLog(context,"##[LumenArena]:创建黑泥包裹物")
ScriptLib.ShowReminder(context, defs.reminder_id2)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Pursina_id, "SGV_PURSINA_ROTATE", PURSINA_ROTATE.LOW)
ScriptLib.CreateGadget(context, {config_id = defs.mud_cover_id})
ScriptLib.SetGroupTempValue(context, "BeCovered", 1, {})
end
end
end
if evt.source_name == "REFRESH_NEXT_TIDE" then
ScriptLib.PrintContextLog(context,"##[LumenArena]:创建下一波怪物潮和黑泥")
LF_CreateMud(context)
end
if evt.source_name == "REFRESH_NEXT_TIDE_MONS" then
ScriptLib.PrintContextLog(context,"##[LumenArena]:创建下一波怪物潮和黑泥")
LF_CreateMonsterTide(context)
end
return 0
end
--挑战结束重置所有的Group内容
function action_gallery_stop(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenArena]:Gallery结束重置Group内容")
if evt.param3 == 1 then
ScriptLib.PrintContextLog(context,"##[LumenArena]:同步进度")
--废弃 ScriptLib.SetGroupVariableValue(context, "succeed", 1)
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
end
ScriptLib.SetGroupTempValue(context, "Gallery_Started", 0, {})
LF_StopPlay(context)
return 0
end
--性能优化
function action_enter_vision_region(context,evt)
if evt.param1 == defs.region_vision then
ScriptLib.PrintContextLog(context,"##[LumenArena]:玩家进入活动Group优化范围开启性能优化")
ScriptLib.ForbidPlayerRegionVision(context, context.uid)
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0,60010020})
end
return 0
end
function action_leave_vision_region(context,evt)
if evt.param1 == defs.region_vision then
ScriptLib.PrintContextLog(context,"##[LumenArena]:玩家离开活动Group优化范围关闭性能优化")
ScriptLib.RevertPlayerRegionVision(context, context.uid)
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {1})
end
return 0
end
function action_group_will_unload(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenArena]:Group卸载")
LF_StopPlay(context)
return 0
end
--挑战结束
function LF_StopPlay(context)
ScriptLib.PrintContextLog(context,"##[LumenArena]:进行停止处理")
if 0 ~= ScriptLib.GetGroupTempValue(context, "Gallery_Started", {}) then
ScriptLib.PrintContextLog(context,"##[LumenArena]:Gallery未结束失败处理Gallery")
ScriptLib.StopGallery(context, default_infos.gallery_id, true)
end
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, 574048, {7})
ScriptLib.SetGadgetStateByConfigId(context, defs.Pursina_id, PURSINA_STATE.CLOSING)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Pursina_id, "SGV_PURSINA_ROTATE", 0)
ScriptLib.CreateGadget(context, {config_id = defs.pursina_tip})
LF_ClearGadgetsAndMonsters(context)
LF_StopAllTimeAxis(context)
LF_ResetTempValues(context)
return 0
end
--刷新怪物潮
function LF_CreateMonsterTide(context)
if 1 ~= ScriptLib.GetGroupTempValue(context, "Gallery_Started", {}) then
ScriptLib.PrintContextLog(context,"##[LumenArena]:Gallery结束停止刷新")
return 0
end
ScriptLib.PrintContextLog(context,"##[LumenArena]:补充怪物潮")
--刷新怪物潮
local cur_tide_index = ScriptLib.GetGroupTempValue(context, "Tide_Index", {})
ScriptLib.SetGroupTempValue(context, "Cur_Tide_Index", cur_tide_index, {})
local cur_tide_num = ScriptLib.GetGroupTempValue(context, "Tide_Num", {})
local cur_mons_list = monster_list[cur_tide_index].tide_mons
local next_tide_index = monster_list[cur_tide_index].next_tide
ScriptLib.SetGroupTempValue(context, "Tide_Index", next_tide_index, {})
ScriptLib.ChangeGroupTempValue(context, "Tide_Num", 1, {})
ScriptLib.AutoMonsterTide(context, cur_tide_num, base_info.group_id, cur_mons_list, #cur_mons_list, monster_list[cur_tide_index].min, monster_list[cur_tide_index].max)
ScriptLib.PrintContextLog(context,"##[LumenArena]:刷新一波新的怪物潮")
end
--创建黑泥
function LF_CreateMud(context)
ScriptLib.PrintContextLog(context,"##[LumenArena]:进入创建黑泥流程")
if 1 ~= ScriptLib.GetGroupTempValue(context, "Gallery_Started", {}) then
ScriptLib.PrintContextLog(context,"##[LumenArena]:Gallery结束,停止刷新")
return 0
end
local cur_tide_index = ScriptLib.GetGroupTempValue(context, "Tide_Index", {})
local time_refresh_delay = monster_list[cur_tide_index].tide_delay
--创建黑泥
local cur_mud_list = monster_list[cur_tide_index].mud
if #cur_mud_list ~= 0 then
ScriptLib.PrintContextLog(context,"##[LumenArena]:补充黑泥")
for i=1,#cur_mud_list do
local mud_index = cur_mud_list[i]
--如果场上对应的黑泥核心还存在,就不刷新黑泥
if 0 == ScriptLib.GetEntityIdByConfigId(context, black_mud_list[mud_index].core_id) then
ScriptLib.CreateGadget(context, {config_id = black_mud_list[mud_index].core_id})
ScriptLib.CreateGadget(context, {config_id = black_mud_list[mud_index].mud_id})
if 0 == ScriptLib.GetEntityIdByConfigId(context, black_mud_list[mud_index].charge_point_mud_cover_id) then
ScriptLib.CreateGadget(context, {config_id = black_mud_list[mud_index].charge_point_mud_cover_id})
end
ScriptLib.ChangeGroupTempValue(context, "Mud_Num", 1, {})
end
end
--延迟刷新包裹物
ScriptLib.InitTimeAxis(context, "MUD_REFRESH", {5}, false)
--如果已经被包裹了则不提示
if 0 == ScriptLib.GetGroupTempValue(context, "BeCovered", {}) then
ScriptLib.ShowReminder(context, defs.reminder_id)
end
end
--延迟刷新怪物潮
if time_refresh_delay ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenArena]:开启时间轴"..time_refresh_delay.."秒后刷怪")
ScriptLib.InitTimeAxis(context, "REFRESH_NEXT_TIDE_MONS", {time_refresh_delay}, false)
else
LF_CreateMonsterTide(context)
end
end
function LF_ResetTempValues(context)
ScriptLib.PrintContextLog(context,"##[LumenArena]:重置所有TempValue")
ScriptLib.SetGroupTempValue(context, "Tide_Index", 1, {}) --怪物潮索引,决定使用的哪一波怪物潮
ScriptLib.SetGroupTempValue(context, "Cur_Tide_Index", 1, {}) --当前使用的怪物潮INDEX
ScriptLib.SetGroupTempValue(context, "Tide_Num", 1, {}) --怪物潮Index计数标记当前怪物潮刷到哪一波了
ScriptLib.SetGroupTempValue(context, "Mud_Num", 0, {}) --场上的黑泥数量
ScriptLib.SetGroupTempValue(context, "Pursina_Rotate", PURSINA_ROTATE.MID, {})
ScriptLib.SetGroupTempValue(context, "Gallery_Started", 0, {})
ScriptLib.SetGroupTempValue(context, "BeCovered", 0, {})
end
function LF_StopAllTimeAxis(context)
ScriptLib.PrintContextLog(context,"##[LumenArena]:停止时间轴")
ScriptLib.EndTimeAxis(context, "PURSINA_HIGH")
ScriptLib.EndTimeAxis(context, "MUD_REFRESH")
ScriptLib.EndTimeAxis(context, "REFRESH_NEXT_TIDE")
ScriptLib.EndTimeAxis(context, "REFRESH_NEXT_TIDE_MONS")
end
function LF_ClearGadgetsAndMonsters(context)
ScriptLib.PrintContextLog(context,"##[LumenArena]:移除黑泥核心、黑泥、黑泥包裹物和萤火虫")
local cur_tide_num = ScriptLib.GetGroupTempValue(context, "Tide_Num", {})
ScriptLib.KillMonsterTide(context, base_info.group_id, cur_tide_num-1)
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
for k,v in pairs(black_mud_list) do
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, v.core_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, v.core_id)
end
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, v.mud_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = v.mud_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, v.mud_id)
end
end
for cover_id,charger_id in pairs(charge_point_list) do
if 0 == ScriptLib.GetEntityIdByConfigId(context, charger_id) then
ScriptLib.CreateGadget(context, {config_id = charger_id})
end
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, cover_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, cover_id)
end
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, charger_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, charger_id)
end
end
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.mud_cover_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.mud_cover_id)
end
end
function LumenArena_Initialize()
for config_id,infos in pairs(monsters) do
if infos.affix ~= nil then
table.insert(infos.affix, 4160)
table.insert(infos.affix, 9009)
else
infos["affix"] = {4160,9009}
end
end
for k,v in pairs(LumenArena_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
LumenArena_Initialize()

View File

@@ -0,0 +1,498 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--======================================================================================================================
--|| Filename || Activity_LumenCharge
--|| RelVersion || V2_7
--|| Owner || chao-jin
--|| Description ||
--|| LogName || ##[Activity_LumenCharge]
--|| Protection ||
--======================================================================================================================
--[[Defs & Miscs
local defs = {
challenge_time = 300,
pursina = 581032,
pursina_tip = 581105,
muds_lv1 = {581066,581067,581068,581069,581070,581071},
muds_lv2 = {581014,581016},
score_lv1 = 3,
score_lv2 = 6,
fail_region = 581197,
}
local extra_info = {
start_operator = 581002,
lantern = 581011,
}
local mud_list = {
--普通黑泥
[581016] = { mud_id = 581009, cover_list= {}, respawn_time = 8, mutex_id = 0, score = 6, cover_content = {} },
[581014] = { mud_id = 581008, cover_list= {}, respawn_time = 8, mutex_id = 0, score = 6, cover_content = {} },
--黑泥核心1
[581066] = { mud_id = 581082, cover_list= {581094}, respawn_time = 4, mutex_id = 581067, score = 3,
cover_content = {
[1] = {581025},
[2] = {581033},
[3] = {581051},
[4] = {581079},
[5] = {581123},}
},
--黑泥核心2
[581068] = { mud_id = 581081, cover_list= {581095,581096}, respawn_time = 4, mutex_id = 581071, score = 3,
cover_content = {
[1] = {581020,581026},
[2] = {581049,581044},
[3] = {581054,581055},
[4] = {581108,581080},
[5] = {581127,581124},}
},
--黑泥核心3
[581069] = { mud_id = 581083, cover_list= {581093}, respawn_time = 4, mutex_id = 581070, score = 3,
cover_content = {
[1] = {581022},
[2] = {581045},
[3] = {581099},
[4] = {581098},
[5] = {581125},}
},
--黑泥核心4
[581067] = {mud_id = 581084, cover_list = {581091, 581092}, respawn_time = 6, mutex_id = 581066, score = 3,
cover_content = {
[1] = {581031,581036},
[2] = {581053,581046},
[3] = {581056,581100},
[4] = {581101,581113},
[5] = {581126,581128},},
},
--黑泥核心5
[581070] = {mud_id = 581085, cover_list = {581087, 581088}, respawn_time = 6, mutex_id = 581069, score = 3,
cover_content = {
[1] = {581029,581039},
[2] = {581047,581048},
[3] = {581102,581103},
[4] = {581115,581116},
[5] = {581129,581130},},
},
--黑泥核心6
[581071] = {mud_id = 581086, cover_list = {581017,581019,581089, 581090}, respawn_time = 6, mutex_id = 581068, score = 3,
cover_content = {
[1] = {581040,581041,581042,581043},
[2] = {581052,581058,581059,581050},
[3] = {581104,581106,581057,581076},
[4] = {581078,581119,581118,581117},
[5] = {581122,581131,581132,581139},},
},
}
--====================================================================================================================]]
--======================================================================================================================
local LumenCharge_Triggers = {
{ config_id = 9100401, name = "group_load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
{ config_id = 9100402, name = "add_charge_progress", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "condition_add_charge_progress", action = "", trigger_count = 0, tag = "1001" },
{ config_id = 9100403, name = "variable_change", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_variable_change", trigger_count = 0,},
{ config_id = 9100404, name = "select_option", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0,},
{ config_id = 9100405, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0,},
{ config_id = 9100406, name = "challenge_fail", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0,},
{ config_id = 9100407, name = "any_gadget_die", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0},
{ config_id = 9100408, name = "leave_fail_region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_fail_region", trigger_count = 0},
{ config_id = 9100409, name = "time_axis_pass", event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_time_axis_pass", trigger_count = 0},
}
--Events
--Group加载时处理内容
function action_group_load(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:加载Group")
ScriptLib.ActivateGroupLinkBundle(context, base_info.group_id)
LF_ResetAllValues(context)
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, extra_info.start_operator, {7})
return 0
end
--处理进度计数,当能量增加时增加进度
function condition_add_charge_progress(context, evt)
if evt.source_name == "energy" and evt.param1 ~= 0 then
return true
end
return false
end
--处理能量进度变化时的进度显示
function action_variable_change(context, evt)
if evt.source_name == "energy" then
--充能进度10%刷怪
if evt.param1 == 10 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第1波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, 5)
ScriptLib.CreateGadget(context, {config_id = defs.enemy_gadget})
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 9)
end
--充能进度35%刷怪
if evt.param1 == 35 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第2波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, 6)
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 11)
end
--充能进度60%刷怪
if evt.param1 == 60 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第3波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, 7)
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 13)
end
--充能进度85%刷怪
if evt.param1 == 85 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第4波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, 17)
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 15)
--移除BGM物件
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除BGM物件")
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
end
end
return 0
end
--玩家与操作台交互
function action_select_option(context, evt)
if extra_info.start_operator ~= evt.param1 then
return 0
end
LF_ResetAllValues(context)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:开启挑战")
ScriptLib.CreateFatherChallenge(context, 1, 2009007, defs.challenge_time, {success = 10, fail = 5})
ScriptLib.AttachChildChallenge(context, 1, 2009009, 2009009, { defs.challenge_time, 3, 1002, 100},{},{success = 1,fail = 1})
ScriptLib.AttachChildChallenge(context, 1, 2009010, 2009010, { defs.challenge_time, 3, 1003, 100},{},{success = 1,fail = 1})
ScriptLib.AttachChildChallenge(context, 1, 2009008, 2009008, { defs.challenge_time, 3, 1001, 100},{},{success = 10,fail = 5})
ScriptLib.StartFatherChallenge(context,1)
--启动reminder开灯
ScriptLib.ShowReminder(context, 4000143)
ScriptLib.SetGadgetStateByConfigId(context, extra_info.lantern, GadgetState.GearStart)
--刷新黑泥对应Group
ScriptLib.AddExtraGroupSuite(context, 166001581, 2)
ScriptLib.AddExtraGroupSuite(context, 166001581, 3)
ScriptLib.AddExtraGroupSuite(context, 166001581, 4)
--处理光钉,启动,嘲讽
LF_StartPursina(context)
LF_SetPursinaMidSpeed(context)
--开启充能进度时间轴
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, extra_info.start_operator, 7)
ScriptLib.InitTimeAxis(context, "energyBasic", {2}, true)
return 0
end
--玩家距离过远挑战失败
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:玩家脱离战斗区域,手动结束挑战")
ScriptLib.StopChallenge(context, 1, 0)
end
return 0
end
--处理时间轴
function action_time_axis_pass(context, evt)
--充能的时间轴
if evt.source_name == "energyBasic" then
--增加进度
ScriptLib.ChangeGroupVariableValue(context, "energy", 1)
end
--黑泥重生的时间轴
local core_id = tonumber(evt.source_name)
if core_id ~= nil then
if mud_list[core_id] ~= nil then
--普通黑泥,没有互斥,直接创生核心和黑泥
if mud_list[core_id].mutex_id == 0 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[普通黑泥]时间轴触发")
LF_CreateMudSet(context, core_id)
else
--核心黑泥
--互斥黑泥不存在
if 0 == ScriptLib.GetEntityIdByConfigId(context, mud_list[core_id].mutex_id) then
LF_CreateMudSet(context, core_id)
ScriptLib.EndTimeAxis(context, tostring(core_id))
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[核心黑泥]复活完成,关闭自身时间轴")
else
--互斥黑泥存在
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[核心黑泥]互斥黑泥存在,此次不刷新"..(mud_list[core_id].mutex_id ))
return 0
end
end
end
end
return 0
end
--处理黑泥死亡,加进度,计入统计
function action_any_gadget_die(context,evt)
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009007) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战未開啟,不處理")
return 0
end
local core_id = evt.param1
--确定死亡的是黑泥核心
if mud_list[core_id] ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:增加清除黑泥的总计数")
ScriptLib.ChangeGroupTempValue(context, "MUD_REMOVED", 1, {})
if 1 ~= ScriptLib.GetGroupTempValue(context, "PURSINA_WORKING", {}) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:光钉损坏中,清除黑泥不增加进度")
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:清除黑泥,增加进度")
for i=1,mud_list[core_id].score do
ScriptLib.ChangeGroupVariableValue(context, "energy", 1)
end
end
--移除黑泥对应的组件
LF_RemoveMudSet(context,core_id)
if mud_list[core_id].mutex_id == 0 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建普通黑泥复生时间轴")
ScriptLib.InitTimeAxis(context, tostring(core_id), {mud_list[core_id].respawn_time}, false)
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建核心黑泥复生时间轴")
ScriptLib.InitTimeAxis(context, tostring(core_id), {mud_list[core_id].respawn_time}, true)
end
end
return 0
end
--处理挑战成功
function action_challenge_success(context, evt)
if evt.param1 ~= 2009007 then
return 0
end
ScriptLib.PrintContextLog(context,"##[LumenCharge]:总挑战成功")
--处理运营数据
local transaction = evt.param_str1
local used_time = defs.challenge_time - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:埋点数据, 挑战成功,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009007,["end_reason"] = 1,["use_time"]= used_time ,["remove_mud"]= remove_mud,["luminous_level"] = lumen_level})
--Group流转
LF_ClearGroup(context)
--跳转到EndSuite
ScriptLib.GoToGroupSuite(context, base_info.group_id, 16)
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)
return 0
end
--处理挑战失败
function action_challenge_fail(context, evt)
if evt.param1 ~= 2009007 then
return 0
end
ScriptLib.PrintContextLog(context,"##[LumenCharge]:总挑战失败")
--处理运营数据
local transaction = evt.param_str1
local used_time = defs.challenge_time - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
if evt.param2 <= 0 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:埋点数据,时间用尽,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009007,["end_reason"] = 2,["use_time"]= used_time ,["remove_mud"]= remove_mud, ["luminous_level"] = lumen_level})
else
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:埋点数据,团灭,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009007,["end_reason"] = 0,["use_time"]= used_time ,["remove_mud"]= remove_mud, ["luminous_level"] = lumen_level})
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战失败,未团灭")
end
end
--重置部分内容
LF_ClearGroup(context)
ScriptLib.CreateGadget(context, {config_id = defs.pursina_tip})
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, extra_info.start_operator, {7})
return 0
end
--======================================================================================================================
--LevelFunctions
--Group结束重置内容
function LF_ClearGroup(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除Group额外内容")
LF_StopPursina(context)
LF_SetPursinaNormal(context)
--保底移除BGM物件
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
--移除额外Suite
for i=1,17 do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i+1)
end
--停掉时间轴
ScriptLib.EndTimeAxis(context, "energyBasic")
for core_id,infos in pairs(mud_list) do
ScriptLib.EndTimeAxis(context, tostring(core_id))
end
end
--初始化所有变量
function LF_ResetAllValues(context)
ScriptLib.SetGroupTempValue(context, "MUD_REMOVED", 0, {})
ScriptLib.SetGroupVariableValue(context, "energy", 0)
ScriptLib.SetGroupVariableValue(context, "stage", 1)
end
--无特效和无冲击波状态
function LF_SetPursinaNormal(context)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:光钉移除破损状态效果")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 0)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--故障状态
function LF_SetPursinaBroken(context)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:光钉破损")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 1)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 0, {})
end
--中速正常运转
function LF_SetPursinaMidSpeed(context)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:正常充能")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 2)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--高速运转,这里第二天玩法里用不到
function LF_SetPursinaHighSpeed(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 3)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--启动光钉,打开嘲讽
function LF_StartPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:启动光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 202)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_TAUNT", 1)
--启动时移除指示物
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.pursina_tip)
end
--停止光钉,关闭嘲讽
function LF_StopPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:关闭光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 203)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 0, {})
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_TAUNT", 0)
end
--创建黑泥套组
function LF_CreateMudSet(context, core_id)
if mud_list[core_id] ~= nil then
local covers = mud_list[core_id].cover_list
local content = mud_list[core_id].cover_content
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建黑泥,黑泥白盒")
ScriptLib.CreateGadget(context, {config_id = core_id})
ScriptLib.CreateGadget(context, {config_id = mud_list[core_id].mud_id})
if #covers ~= 0 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建黑泥包裹物")
for k,cover_id in pairs(covers) do
ScriptLib.CreateGadget(context, {config_id = cover_id})
end
end
if #content ~= 0 then
-- local cur_stage = ScriptLib.GetGroupVariableValue(context, "stage")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:遍历移除包裹内容物")
-- 这里遍历了所有stage的包裹物全部尝试进行一次移除
for stage_index=1,5 do
for k,content_id in pairs(content[stage_index]) do
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, content_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, content_id)
end
end
end
end
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[WARINING] 使用了错误的黑泥核心ID注意检查")
end
end
--移除黑泥套组
function LF_RemoveMudSet(context, core_id)
if mud_list[core_id] ~= nil then
local covers = mud_list[core_id].cover_list
local content= mud_list[core_id].cover_content
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除黑泥白盒")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, mud_list[core_id].mud_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_list[core_id].mud_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, mud_list[core_id].mud_id)
end
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除黑泥包裹物")
for k,cover_id in pairs(covers) do
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, cover_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = cover_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, cover_id)
end
end
local cur_stage = ScriptLib.GetGroupVariableValue(context, "stage")
if content[cur_stage] ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建包裹内容物")
for k,content_id in pairs(content[cur_stage]) do
ScriptLib.CreateGadget(context, {config_id = content_id})
end
end
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[WARINING] 使用了错误的黑泥核心ID注意检查")
end
end
--移除黑泥套组,创建内容物
--======================================================================================================================
--ServerLuaCalls
function SLC_PausePursina(context)
LF_SetPursinaBroken(context)
ScriptLib.EndTimeAxis(context, "energyBasic")
return 0
end
function SLC_ResumePursina(context)
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009007) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战已结束,不再恢复时间轴")
return 0
end
LF_SetPursinaMidSpeed(context)
ScriptLib.InitTimeAxis(context, "energyBasic", {2}, true)
return 0
end
--=====================================================================================================================
--初始化GroupTrigger
function LumenCharge_Initialize()
for config_id,infos in pairs(monsters) do
if infos.affix ~= nil then
table.insert(infos.affix, 4160)
else
infos["affix"] = {4160}
end
end
for k,v in pairs(LumenCharge_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
LumenCharge_Initialize()

View File

@@ -0,0 +1,237 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--[[
=====================================================================================================================
|| Filename || Activity_LumenProtect
|| RelVersion || 2.7
|| Owner || chao.jin
|| Description || 2.7 流明石活动 第二天的保护增幅仪活动
|| LogName || ##[LumenProtect]
|| Protection ||
=====================================================================================================================
--[[misc
defs = {
start_operator = 45001, --交互后开始的操作台ConfigID
protect_target = 44003, --需要保护的目标ConfigID
air_wall = , --空气墙的configID
pursina = 45010, --光钉ConfigID
challenge_time = 180, --挑战需要的时间
mons_num = 6,-- 需要杀死的所有怪物数量
}
修改变量challenge_start 来触发挑战开始
=====================================================================================================================]]
local LumenProtect_Triggers = {
{ config_id = 9100201, name = "group_load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0 },
{ config_id = 9100202, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0 },
{ config_id = 9100203, name = "challenge_fail", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0 },
{ config_id = 9100204, name = "variable_change", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_variable_change", trigger_count = 0,},
{ config_id = 9100205, name = "group_will_unload", event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_group_will_unload", trigger_count = 0,},
{ config_id = 9100206, name = "gadget_hp_change", event = EventType.EVENT_SPECIFIC_GADGET_HP_CHANGE, source = tostring(defs.protect_target), condition = "", action = "action_gadget_hp_change", trigger_count = 0,},
{ config_id = 9100207, name = "leave_fail_region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_fail_region", trigger_count = 0},
{ config_id = 9100208, name = "any_gadget_die", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_gadget_die", trigger_count = 0},
{ config_id = 9100209, name = "pause_battle_bgm", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "", action = "action_pause_battle_bgm", trigger_count = 0},
}
function action_group_load(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenProtect]:[GroupLoad] 加载Group")
--显示Group黄圈
ScriptLib.SetGroupTempValue(context, "ProtectHP", 100, {})
ScriptLib.ActivateGroupLinkBundle(context, base_info.group_id)
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, defs.start_operator, {7})
return 0
end
function action_challenge_success(context, evt)
local used_time = defs.challenge_time - evt.param2
local gadget_hp = ScriptLib.GetGroupTempValue(context, "ProtectHP", {})
--挑战默认流水号
local transaction = evt.param_str1
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
if evt.param1 == 2009001 then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:挑战成功推进进度清除Group内容延迟卸载")
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
LF_ClearGroup(context)
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)
end
if evt.param1 == 2009002 then
--拿父挑战的流水号
transaction = ScriptLib.GetChallengeTransaction(context, 1)
ScriptLib.PrintContextLog(context,"##[LumenProtect]:埋点数据,保护成功,流水号"..transaction.."耗时"..used_time.."剩余血量"..gadget_hp.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_1", transaction, {["end_reason"] = 1,["use_time"]= used_time ,["hp_left"]= gadget_hp,["luminous_level"] = lumen_level})
end
if evt.param1 == 2009003 then
--拿父挑战的流水号
transaction = ScriptLib.GetChallengeTransaction(context, 1)
ScriptLib.PrintContextLog(context,"##[LumenProtect]:埋点数据,杀怪成功,流水号"..transaction.."耗时"..used_time.."剩余血量"..gadget_hp.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_1", transaction, {["end_reason"] = 2,["use_time"]= used_time ,["hp_left"]= gadget_hp,["luminous_level"] = lumen_level})
end
return 0
end
--挑战失败,处理显示
function action_challenge_fail(context, evt)
if evt.param1 == 2009001 then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:挑战失败重置Group内容让玩家重新挑战")
local used_time = defs.challenge_time + 5 - evt.param2
local gadget_hp = ScriptLib.GetGroupTempValue(context, "ProtectHP", {})
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
local transaction = evt.param_str1
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:埋点数据,团灭,流水号"..transaction.."耗时"..used_time.."剩余血量"..gadget_hp.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_1", transaction, {["end_reason"] = 0,["use_time"]= used_time ,["hp_left"]= gadget_hp,["luminous_level"] = lumen_level})
else
--运营数据埋点,不是触发Leave导致的失败
if 4 ~= ScriptLib.GetGroupTempValue(context, "END_REASON", {}) then
--检测一下对应物件是否还存在
if 0 == ScriptLib.GetEntityIdByConfigId(context, defs.protect_target) then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:埋点数据,装置被破坏,流水号"..transaction.."耗时"..used_time.."剩余血量"..gadget_hp.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_1", transaction, {["end_reason"] = 3,["use_time"]= used_time ,["hp_left"]= 0,["luminous_level"] = lumen_level})
end
end
end
-- ScriptLib.CreateGadget(context, {config_id = defs.start_operator})
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, defs.start_operator, {7})
ScriptLib.CreateGadget(context, {config_id = defs.pursina_tip})
LF_ClearGroup(context)
end
return 0
end
--监听物件变化
function action_gadget_hp_change(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenProtect]: 更新物件血量")
ScriptLib.SetGroupTempValue(context, "ProtectHP", evt.param3, {})
return 0
end
--玩家脱离战斗区域
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:玩家脱离战斗区域,手动结束挑战")
ScriptLib.SetGroupTempValue(context, "END_REASON", 4, {})
ScriptLib.StopChallenge(context, 1, 0)
end
return 0
end
--处理光钉状态
function action_variable_change(context, evt)
if evt.source_name == "pursina_state" then
if evt.param1 == 0 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 0)
return 0
end
if evt.param1 == 1 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 1)
return 0
end
if evt.param1 == 2 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 2)
return 0
end
if evt.param3 == 3 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 3)
return 0
end
end
--defs.challenge_time
if evt.source_name == "challenge_start" and evt.param1 ~= 0 then
ScriptLib.CreateFatherChallenge(context, 1, 2009001, defs.challenge_time+5, {success = 10, fail = 5})
ScriptLib.AttachChildChallenge(context, 1, 2009003, 2009003, {defs.challenge_time, base_info.group_id, defs.protect_target, 1},{},{success = 10,fail = 5})
ScriptLib.AttachChildChallenge(context, 1, 2009002, 2009002, {defs.challenge_time, base_info.group_id, defs.mons_num, 0},{},{success = 10,fail = 1})
ScriptLib.StartFatherChallenge(context,1)
ScriptLib.DelWorktopOptionByGroupId(context, 166001606, defs.start_operator, 7)
-- ScriptLib.KillEntityByConfigId(context, { config_id = defs.start_operator })
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.pursina_tip)
ScriptLib.SetGroupTempValue(context, "ProtectHP", 100, {})
ScriptLib.CreateGadget(context, {config_id=defs.enemy_gadget})
ScriptLib.SetGroupTempValue(context, "END_REASON", 0, {})
end
return 0
end
--Group卸载
function action_group_will_unload(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenProtect]:Group卸载清除内容")
LF_ClearGroup(context)
return 0
end
--清除Group额外添加的内容
function LF_ClearGroup(context)
ScriptLib.PrintContextLog(context,"##[LumenProtect]:重置Group内容")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
for i=1,7 do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i+1)
end
for core_id,mud_id in pairs(mud_list) do
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, core_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, core_id)
end
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, mud_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, mud_id)
end
end
for k,gen_id in pairs(generators) do
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, gen_id) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, gen_id)
end
end
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 0)
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.air_wall) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.air_wall)
end
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.protect_target) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.protect_target)
end
ScriptLib.SetGroupVariableValue(context, "challenge_start", 0)
end
--处理黑泥和黑泥白盒的死亡关系
function action_gadget_die(context, evt)
if mud_list[evt.param1] ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:黑泥死亡,清除对应白盒")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, mud_list[evt.param1]) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_list[evt.param1], entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, mud_list[evt.param1])
end
end
return 0
end
--处理BGM物件
function action_pause_battle_bgm(context, evt)
if evt.param1 == 606056 then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:刷最后一波怪移除BGM入战物件")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
end
return 0
end
function LumenProtect_Initialize()
for config_id,infos in pairs(monsters) do
if infos.affix ~= nil then
table.insert(infos.affix, 4160)
else
infos["affix"] = {4160}
end
end
table.insert(variables, { config_id=50000001,name = "pursina_state", value = 0,no_refresh = false})
table.insert(variables, { config_id=50000002,name = "challenge_start", value = 0,no_refresh = false})
for k,v in pairs(LumenProtect_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
LumenProtect_Initialize()

View File

@@ -0,0 +1,86 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--======================================================================================================================
--|| Filename || Activity_LumenPursina
--|| RelVersion || V2_7
--|| Owner || chao-jin
--|| Description ||
--|| LogName || ##[Activity_LumenPursina]
--|| Protection ||
--======================================================================================================================
--[[Defs & Miscs
defs = {
pursina = ,光钉的configID
}
--====================================================================================================================]]
local LumenPursina_Triggers = {
{config_id = 8002001, name = "pursina_state", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_pursina_state", trigger_count = 0},
{config_id = 8002002, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0 },
}
--Events
function action_pursina_state(context, evt)
if evt.source_name == "pursina_state" then
if evt.param1 == 0 then
LF_PursinaStop(context)
return 0
end
if evt.param1 == 1 then
LF_PursinaLow(context)
return 0
end
if evt.param1 == 2 then
LF_PursinaMid(context)
return 0
end
if evt.param3 == 3 then
LF_PursinaHigh(context)
return 0
end
end
return 0
end
function action_challenge_success(context, evt)
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
return 0
end
--======================================================================================================================
--LevelFunctions
function LF_PursinaStop(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 0)
end
function LF_PursinaLow(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 1)
end
function LF_PursinaMid(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 2)
end
function LF_PursinaHigh(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 3)
end
function LumenPursina_Initialize()
for config_id,infos in pairs(monsters) do
if infos.affix ~= nil then
table.insert(infos.affix, 4160)
else
infos["affix"] = {4160}
end
end
table.insert(variables, { config_id=50000001,name = "pursina_state", value = 0,no_refresh = false})
table.insert(variables, { config_id=50000002,name = "ChallengeSuccess", value = 0,no_refresh = false})
for k,v in pairs(LumenPursina_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
LumenPursina_Initialize()

View File

@@ -0,0 +1,131 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--======================================================================================================================
--|| Filename || Activity_LumenTransport
--|| RelVersion || V2_7
--|| Owner || chao-jin
--|| Description ||
--|| LogName || ##[Activity_LumenTransport]
--|| Protection ||
--======================================================================================================================
--Defs & Miscs
--======================================================================================================================
local LumenTransport_Triggers = {
-- {config_id = 8002001, name = "pursina_state", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_pursina_state", trigger_count = 0},
{config_id = 8002002, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0 },
{config_id = 8002003, name = "challenge_fail", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0 },
{config_id = 8002004, name = "any_gadget_die", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0},
{config_id = 8002005, name = "group_load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
}
local cores = {582021,582022,582031,582058,582059,582060,582095,582096,582097,582101,582127,582128,582148,582045,582169,582171,582173,582175,582190,582207,582208,582209,582210,582211}
--Events
--[[ 运输关卡不需要此段内容
function action_pursina_state(context, evt)
if evt.source_name == "pursina_state" then
if evt.param1 == 0 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 0)
return 0
end
if evt.param1 == 1 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 1)
return 0
end
if evt.param1 == 2 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 2)
return 0
end
if evt.param3 == 3 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 3)
return 0
end
end
return 0
end
]]
function action_challenge_success(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenTransport]:挑战成功")
local used_time = 300 - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local uid_list = ScriptLib.GetSceneUidList(context)
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
ScriptLib.PrintContextLog(context,"##[LumenTransport]:挑战成功,发送埋点数据,流水号"..(evt.param_str1).."耗时"..used_time.."清除黑泥数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", evt.param_str1, {["challenge_id"] = 2009006,["end_reason"] = 1,["use_time"]= used_time ,["remove_mud"]= remove_mud,["luminous_level"] = lumen_level})
for i=1,9 do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i+1)
end
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
ScriptLib.GoToGroupSuite(context, base_info.group_id, 11)
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)
return 0
end
function action_challenge_fail(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenTransport]:挑战失败")
local used_time = 300 - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
if evt.param2 <= 0 then
ScriptLib.PrintContextLog(context,"##[LumenTransport]:挑战超时失败,发送埋点数据,流水号"..(evt.param_str1).."耗时"..used_time.."清除黑泥数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", evt.param_str1, {["challenge_id"] = 2009006,["end_reason"] = 2,["use_time"]= used_time ,["remove_mud"]= remove_mud,["luminous_level"] = lumen_level})
else
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
ScriptLib.PrintContextLog(context,"##[LumenTransport]:挑战团灭,发送埋点数据,流水号"..(evt.param_str1).."耗时"..used_time.."清除黑泥数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", evt.param_str1, {["challenge_id"] = 2009006,["end_reason"] = 0,["use_time"]= used_time ,["remove_mud"]= remove_mud,["luminous_level"] = lumen_level})
end
end
ScriptLib.SetGroupTempValue(context, "MUD_REMOVED", 0, {})
for i=1,9 do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i+1)
end
ScriptLib.RefreshGroup(context, {group_id = base_info.group_id, suite = 1})
return 0
end
function action_any_gadget_die(context,evt)
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009006) then
ScriptLib.PrintContextLog(context,"##[LumenTransport]:挑战未開啟,不處理")
return 0
end
for k,v in pairs(cores) do
if evt.param1 == v then
ScriptLib.PrintContextLog(context,"##[LumenProtect]:黑泥死亡增加统计")
ScriptLib.ChangeGroupTempValue(context, "MUD_REMOVED", 1, {})
end
end
return 0
end
function action_group_load( context, evt )
ScriptLib.SetGroupTempValue(context, "MUD_REMOVED", 0, {})
--保底
ScriptLib.RefreshGroup(context, {group_id = base_info.group_id, suite = 1})
return 0
end
--======================================================================================================================
--LevelFunctions
function LumenTransport_Initialize()
for config_id,infos in pairs(monsters) do
if infos.affix ~= nil then
table.insert(infos.affix, 4160)
else
infos["affix"] = {4160}
end
end
-- table.insert(variables, { config_id=50000001,name = "pursina_state", value = 0,no_refresh = false})
-- table.insert(variables, { config_id=50000002,name = "ChallengeSuccess", value = 0,no_refresh = false})
for k,v in pairs(LumenTransport_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
LumenTransport_Initialize()

View File

@@ -0,0 +1,295 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_7]
--======================================================================================================================
--|| Filename || Activity_LumenWipeout
--|| RelVersion || V2_7
--|| Owner || chao-jin
--|| Description ||
--|| LogName || ##[Activity_LumenWipeout]
--|| Protection ||
--[[======================================================================================================================
--Defs & Miscs
local defs = {
pursina = 630015,
pursina_tip = 630087,
fail_region = 630038
}
local mud_list = {
[630009] = 630063,
[630012] = 630062,
[630023] = 630028,
}
local extra_infos = {
start_operator = 630002,
mud_cover = 630096,
}
--======================================================================================================================]]
local LumenWipeout_Triggers = {
{config_id = 8002001, name = "pursina_state", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_pursina_state", trigger_count = 0},
{config_id = 8002002, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0 },
{config_id = 8002003, name = "challenge_fail", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0 },
{config_id = 8002004, name = "any_gadget_die", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0},
{config_id = 8002005, name = "group_load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
{config_id = 8002006, name = "leave_fail_region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_fail_region", trigger_count = 0},
{config_id = 8002007, name = "gadget_create", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "", action = "action_gadget_create", trigger_count = 0},
{config_id = 8002008, name = "time_axis_pass", event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_time_axis_pass", trigger_count = 0},
{config_id = 8002009, name = "select_option", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0},
{config_id = 8002010, name = "pause_battle_bgm", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "", action = "action_pause_battle_bgm", trigger_count = 0},
}
--Events
function action_pursina_state(context, evt)
if evt.source_name == "pursina_state" then
if evt.param1 == 0 then
LF_SetPursinaNormal(context)
return 0
end
if evt.param1 == 1 then
LF_SetPursinaBroken(context)
return 0
end
if evt.param1 == 2 then
LF_SetPursinaMidSpeed(context)
return 0
end
if evt.param3 == 3 then
LF_SetPursinaHighSpeed(context)
return 0
end
end
return 0
end
--挑战成功处理
function action_challenge_success(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:挑战成功")
--运营用的埋点数据
local used_time = 300 - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local transaction = evt.param_str1
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:埋点数据,挑战成功,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009002,["end_reason"] = 1,["use_time"]= used_time ,["remove_mud"]= remove_mud,["luminous_level"] = lumen_level})
LF_ClearGroup(context)
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
ScriptLib.GoToGroupSuite(context, base_info.group_id, 10)
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)
return 0
end
--处理BGM物件
function action_pause_battle_bgm(context, evt)
if evt.param1 == 630078 then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:刷最后一波怪移除BGM入战物件")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
end
return 0
end
--挑战失败处理
function action_challenge_fail(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:挑战失败")
--运营用的埋点数据
local used_time = 300 - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
local transaction = evt.param_str1
if evt.param2 <= 0 then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:埋点数据,时间用尽,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009002,["end_reason"] = 2,["use_time"]= used_time ,["remove_mud"]= remove_mud, ["luminous_level"] = lumen_level})
else
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:埋点数据,团灭,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009002,["end_reason"] = 0,["use_time"]= used_time ,["remove_mud"]= remove_mud, ["luminous_level"] = lumen_level})
end
end
--清除额外内容并恢复
LF_ClearGroup(context)
ScriptLib.CreateGadget(context, {config_id = defs.pursina_tip})
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, extra_infos.start_operator, {7})
return 0
end
--Group加载
function action_group_load( context, evt )
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:加载Group,初始化一些内容")
ScriptLib.SetGroupTempValue(context, "MUD_REMOVED", 0, {})
return 0
end
--玩家脱离战斗区域,挑战失败
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:玩家脱离战斗区域,手动结束挑战")
ScriptLib.StopChallenge(context, 233, 0)
end
return 0
end
-- 触发操作
function action_select_option(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:开启挑战")
--记录场上的黑泥数量
ScriptLib.SetGroupTempValue(context, "MUD_NUMS", 0, {})
ScriptLib.SetGroupTempValue(context, "MUD_REMIND", 0, {})
--开启挑战
ScriptLib.ActiveChallenge(context, 233, 2009005, 300, 166001630, 29, 0)
ScriptLib.DelWorktopOptionByGroupId(context, 166001630, 630002, 7)
--启动光钉
LF_StartPursina(context)
LF_SetPursinaNormal(context)
ScriptLib.InitTimeAxis(context, "pursinaDelay", {2}, false)
--创建两个喷气岩
ScriptLib.CreateGadget(context, { config_id = 630068 })
ScriptLib.CreateGadget(context, { config_id = 630076 })
ScriptLib.CreateGadget(context, { config_id = defs.enemy_gadget })
--刷第一波怪
ScriptLib.AddExtraGroupSuite(context, 166001630, 2)
ScriptLib.ShowReminder(context, 400012)
local pos = {x=993, y=737, z=409}
ScriptLib.ScenePlaySound(context, {play_pos = pos, sound_name = "LevelHornSound001", play_type= 1, is_broadcast = false })
return 0
end
-- 黑泥创生处理
function action_gadget_create(context,evt)
--黑泥核心创建时,同步创建黑泥
if mud_list[evt.param1] ~= nil then
-- ScriptLib.CreateGadget(context, {config_id = mud_list[evt.param1]})
ScriptLib.ChangeGroupTempValue(context, "MUD_NUMS", 1, {})
--创建黑泥,看看光钉的工作状态
if 0 ~= ScriptLib.GetGroupTempValue(context, "MUD_NUMS", {}) then
if 1 == ScriptLib.GetGroupTempValue(context, "PURSINA_WORKING", {}) then
if 0 == ScriptLib.GetGroupTempValue(context, "MUD_REMIND", {}) then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:弹出第一次Reminder")
ScriptLib.ShowReminder(context, 4000146)
ScriptLib.SetGroupTempValue(context, "MUD_REMIND",1, {})
end
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:创建黑泥,光钉在工作中,光钉损坏")
ScriptLib.ShowReminder(context, 4000151)
LF_SetPursinaBroken(context)
end
end
end
if evt.param1 == extra_infos.start_operator then
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, extra_infos.start_operator, {7})
end
return 0
end
--统计黑泥核心死亡数量
function action_any_gadget_die(context,evt)
if mud_list[evt.param1] ~= nil then
--移除对应的黑泥白盒
ScriptLib.ChangeGroupTempValue(context, "MUD_NUMS", -1, {})
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_list[evt.param1], entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, 166001630, EntityType.GADGET, mud_list[evt.param1])
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009005) then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:挑战未开始,不增加统计")
return 0
end
--场上没有黑泥了,移除包裹物,恢复光钉
if 0 == ScriptLib.GetGroupTempValue(context, "MUD_NUMS", {}) then
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, extra_infos.mud_cover) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = extra_infos.mud_cover, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, 166001630, EntityType.GADGET, extra_infos.mud_cover)
end
LF_SetPursinaMidSpeed(context)
end
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:黑泥核心死亡,增加统计")
ScriptLib.ChangeGroupTempValue(context, "MUD_REMOVED", 1, {})
end
return 0
end
--时间轴移动
function action_time_axis_pass(context,evt)
if evt.source_name == "pursinaDelay" then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:光钉开始正常运转")
LF_SetPursinaMidSpeed(context)
ScriptLib.ShowReminder(context, 4000145)
end
return 0
end
--======================================================================================================================
--LevelFunctions
function LF_ClearGroup(context)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:移除Group额外内容")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
end
for i=1,8 do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i+1)
end
LF_SetPursinaNormal(context)
LF_StopPursina(context)
ScriptLib.EndTimeAxis(context, "pursinaDelay")
end
--无特效和无冲击波状态
function LF_SetPursinaNormal(context)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:光钉移除破损状态效果")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 0)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--故障状态
function LF_SetPursinaBroken(context)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:光钉破损")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 1)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 0, {})
end
--中速正常运转
function LF_SetPursinaMidSpeed(context)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:正常充能")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 2)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--高速运转,这里第三天玩法里用不到
function LF_SetPursinaHighSpeed(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_ROTATE", 3)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--启动光钉
function LF_StartPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:启动光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 202)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
--启动时移除指示物
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.pursina_tip)
end
--停止光钉
function LF_StopPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:关闭光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 203)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 0, {})
end
function LumenWipeout_Initialize()
for config_id,infos in pairs(monsters) do
if infos.affix ~= nil then
table.insert(infos.affix, 4160)
else
infos["affix"] = {4160}
end
end
table.insert(variables, { config_id=50000001,name = "pursina_state", value = 0,no_refresh = false})
table.insert(variables, { config_id=50000002,name = "ChallengeSuccess", value = 0,no_refresh = false})
-- suites[1].triggers = {}
for k,v in pairs(LumenWipeout_Triggers) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
LumenWipeout_Initialize()

View File

@@ -0,0 +1,119 @@
--[[======================================
|| filename: BW_NearBossAuthorityChange
|| owner: chen.chen
|| description: 用于处理联机下怪物authority的切换问题
|| LogName: ##[BW_NearBossAuthorityChange]
|| Protection:
=======================================]]--
local extraTriggers={
{ name = "leave_battle_region", config_id = 8000001,event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_battle_region", trigger_count = 0, forbid_guest = false },
{ name = "enter_battle_region", config_id = 8000002,event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_battle_region", trigger_count = 0 , forbid_guest = false },
}
function LF_Initialize_Group(triggers, suites)
local id=8100001
for i=1,#monsters do
if monsters[i].config_id == defs.bossConfigId then
local configId=monsters[i].config_id
local insertRegion={ config_id = id, shape = RegionShape.SPHERE, radius = 40, pos=monsters[i].pos, area_id = monsters[i].area_id}
table.insert(regions,insertRegion)
for j=1,#suites do
for k=1,#suites[j].monsters do
if suites[j].monsters[k]==configId then
table.insert(suites[j].regions,id)
end
end
end
break
end
end
for i=1,#extraTriggers do
table.insert(triggers, extraTriggers[i])
table.insert(suites[init_config.suite].triggers,extraTriggers[i].name)
end
--初始化
end
--处理玩家出战斗圈转移authority
function action_leave_battle_region(context, evt)
if evt.param1 ~= 8100001 then
return 0
end
--玩家出圈
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 玩家出战斗圈"..context.uid)
--尝试转移config_id的authority, 当uid和config_id的authority不一致时尝试转移到region_config_id里的玩家。
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 尝试重新分配authority")
if defs.bossConfigId~=nil then
ScriptLib.TryReallocateEntityAuthority(context, context.uid, defs.bossConfigId, evt.param1)
end
return 0
end
--角色入圈尝试切auth
function action_enter_battle_region(context, evt)
if evt.param1 ~= 8100001 then
return 0
end
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 玩家进战斗圈")
--玩家进圈时先查询入战region范围内是否存在玩家
--如果存在说明该玩家不是第一个进入region的那么圈内其他玩家中一定有authority因为出圈会强制重新分配入圈的时候会强制分配
--如果不存在说明该玩家是第一个进入region的将authority分配给他
local no_avatar_in_region = true
local uidlist = ScriptLib.GetSceneUidList(context)
if uidlist == -1 or uidlist == nil or #uidlist == 0 then
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 没有取到uidlist认为是上线触发region的情况强制把authority刷给进圈的玩家")
--将Authority强行设置为进圈的玩家
ScriptLib.ForceRefreshAuthorityByConfigId(context, defs.bossConfigId, context.uid)
return 0
end
local region = {}
for i = 1, #regions do
if regions[i].config_id == 8100001 then
region = regions[i]
break
end
end
--如果没找到,则报错并返回
if region.config_id==nil then
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 8110001未找到")
return 0
end
for i = 1, #uidlist do
if (LF_Avatar_is_in_region(context,uidlist[i],region) and uidlist[i] ~= context.uid) then
no_avatar_in_region = false
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 圈内存在玩家:"..uidlist[i].."不分配authortiy")
break
end
end
if (no_avatar_in_region) then
ScriptLib.PrintContextLog(context,"BW_NearBossAuthorityChange: 第一个进入region的玩家"..context.uid.."分配authortiy")
--将Authority强行设置为进圈的玩家
ScriptLib.ForceRefreshAuthorityByConfigId(context, defs.bossConfigId, context.uid)
end
return 0
end
function LF_Avatar_is_in_region(context,uid,region)
local avatar_id = ScriptLib.GetAvatarEntityIdByUid(context, uid)
local pos1 = ScriptLib.GetPosByEntityId(context, avatar_id)
local X = pos1.x - region.pos.x
local Y = pos1.y - region.pos.y
local Z = pos1.z - region.pos.z
if region.shape == RegionShape.SPHERE then
if math.sqrt(X*X+Y*Y+Z*Z) <= region.radius then
return true
else
return false
end
elseif region.shape == RegionShape.CUBIC then
if math.abs(X) > region.size.x/2 or math.abs(Y) > region.size.y/2 or math.abs(Z) > region.size.z/2 then
return false
else
return true
end
end
end
LF_Initialize_Group(triggers, suites)

View File

@@ -0,0 +1,55 @@
--[[======================================
|| filename: CYDungeon_CheckPoint_Controller
|| owner: juntao.chen
|| description: 层岩间章 任务地城1 复活点控制器
|| LogName: CYDungeon_CheckPoint
|| Protection: [Protection]
=======================================]]
--需求misc
--[[
--key填regionid
--value为pointid
local Check_Point_List = {
[1] = 1,
[1] = 1,
[1] = 1,
}
]]
local temp_Tirgger = {
{event = EventType.EVENT_ENTER_REGION, source = "", action = "action_EVENT_ENTER_REGION"},
}
function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## CYDungeon_CheckPoint action_EVENT_ENTER_REGION:evt.param1="..evt.param1)
for k , v in pairs(Check_Point_List) do
if k == evt.param1 then
ScriptLib.PrintContextLog(context,"## CYDungeon_CheckPoint action_EVENT_ENTER_REGION: ActivateDungeonCheckPoint = "..v)
ScriptLib.ActivateDungeonCheckPoint(context,v)
end
end
return 0
end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = "temp_Trigger_"..k
v.config_id = 40000000 + k
v.trigger_count = 0
v.condition = ""
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--加变量
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
table.insert(variables,v)
end
end
return 0
end
Initialize()

View File

@@ -0,0 +1,347 @@
--[[======================================
|| filename: HM_FindTubby
|| owner: juntao.chen
|| description: 家园group玩法--找阿圆
|| LogName: HM_FindTubby
|| Protection: [Protection]
=======================================]]
--[[【玩法简述】
group由 1个操作台 & 12个阿圆(gadget) 组成
开启操作台后每个阶段会从所有阿圆中抽5个刷出所有玩家开始寻找阿圆。
每个阶段持续30秒或直到所有阿圆被找到。
每个阶段结束后会立即开启新阶段。
总时间120s结束后强行结束阶段清空重置group。
所有玩家根据找到的阿圆数量计分。
相邻两轮阿圆不会重复被选。
]]
--[[
家园新增接口:
计时相关
EventType.EVENT_TIME_AXIS_PASSS
criptLib.InitTimeAxis
ScriptLib.EndTimeAxis
清空物件(每阶段结束,未找到的阿圆会被清空,刷出新的一波)
ScriptLib.KillEntityByConfigId
创建物件(被找的阿圆不会在默认suite会随机挑选n个创建)
ScriptLib.CreateGadget
]]
--[[
defs需求
defs.Game_Time = 120, --全局时长
defs.Stage_Time = 30, --每个阶段多久
defs.Stage_Tubby_Count = 5, --每个阶段要找多少个阿圆
defs.Tubby_Count = 12, --总共有多少个阿圆
]]
local HM_FindTubby = {
Board_Gadget_ID = 77307018,
Tubby_Gadget_ID = 77307019,
Game_Time = defs.Game_Time, --全局时长
Stage_Time = defs.Stage_Time, --每个阶段多久
Stage_Tubby_Count = defs.Stage_Tubby_Count, --每个阶段要找多少个阿圆
Tubby_Count = defs.Tubby_Count, --总共有多少个阿圆
Tubby_Option_ID = 327, --阿圆的交互选项 geardata id
galleryID = 20001
}
local temp_Variables = {
{ config_id=50000001,name = "cur_tide_total_num", value = 0, no_refresh = false },
{ config_id=50000002,name = "cur_tide_left_num", value = 0, no_refresh = false },
{ config_id=50000003,name = "score", value = 0, no_refresh = false },
{ config_id=50000004,name = "endgame", value = 0, no_refresh = false },
}
local temp_Tirgger = {
{event = EventType.EVENT_SELECT_UIINTERACT, source = "", action = "action_EVENT_SELECT_UIINTERACT"},
{event = EventType.EVENT_LEAVE_REGION, source = "", action = "action_EVENT_LEAVE_REGION",forbid_guest = false,},
{event = EventType.EVENT_ENTER_REGION, source = "", action = "action_EVENT_ENTER_REGION",forbid_guest = false,},
{event = EventType.EVENT_SELECT_OPTION, source = "", action = "action_EVENT_SELECT_OPTION",forbid_guest = false},
{event = EventType.EVENT_TIME_AXIS_PASS, source = "stage", action = "action_EVENT_TIME_AXIS_PASS_stage"},
{event = EventType.EVENT_TIME_AXIS_PASS, source = "game", action = "action_EVENT_TIME_AXIS_PASS_game"},
{event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", action = "action_EVENT_GROUP_WILL_UNLOAD"},
{event = EventType.EVENT_GALLERY_START, source = "", action = "action_EVENT_GALLERY_START"},
{event = EventType.EVENT_GALLERY_STOP, source = "", action = "action_EVENT_GALLERY_STOP"},
--gm测试用
{event = EventType.EVENT_VARIABLE_CHANGE, source = "", action = "action_EVENT_VARIABLE_CHANGE"},
}
--ENTER时如果玩家还在gallery里重新放回注册名单用于处理重连、灭掉的情况
function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_ENTER_REGION:"..context.uid)
if ScriptLib.IsGalleryStart(context, HM_FindTubby.galleryID) then
local _list = ScriptLib.GetGalleryUidList(context,HM_FindTubby.galleryID)
for i = 1 , #_list do
if _list[i] == context.uid then ScriptLib.SetGroupTempValue(context,"player_"..context.uid,1,{}) end
end
end
return 0
end
--离场踢出注册名单
function action_EVENT_LEAVE_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_LEAVE_REGION:"..context.uid)
ScriptLib.SetGroupTempValue(context,"player_"..context.uid,0,{})
return 0
end
--gm测试指令
function action_EVENT_VARIABLE_CHANGE(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_VARIABLE_CHANGE:".. "source_name=".. evt.source_name.."|Value="..evt.param1)
return 0
end
--gallery开启时玩法启动
function action_EVENT_GALLERY_START(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_GALLERY_START:".."func")
--注册所有阿圆的config_id 顺便初始化tempvalue
local _tubby_count = 0
for k , v in pairs(gadgets) do
if v.gadget_id == HM_FindTubby.Tubby_Gadget_ID then
_tubby_count = _tubby_count +1
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_UIINTERACT:注册".."Tubby_".._tubby_count..", cid="..v.config_id)
ScriptLib.SetGroupTempValue(context,"Tubby_".._tubby_count,v.config_id,{})
ScriptLib.SetGroupTempValue(context,"Used_".._tubby_count,0,{})
ScriptLib.SetGroupTempValue(context,"cid_selectable_"..v.config_id,1,{})
end
end
--校验阿圆数量,不对则退出报错
if _tubby_count ~= HM_FindTubby.Tubby_Count then
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_UIINTERACT:".."[Warnning]阿圆数量不对".."_tubby_count=".._tubby_count.."HM_FindTubby.Tubby_Count"..HM_FindTubby.Tubby_Count)
return 0
end
--注册参与者的uid用于拾取校验
local _uidlist = ScriptLib.GetSceneUidList(context)
for i = 1 ,#_uidlist do
ScriptLib.SetGroupTempValue(context,"player_".._uidlist[i],1,{})
ScriptLib.PrintContextLog(context,"## HM_FindTubby UpdatePlayerGalleryScore: 注册uid|".. "player_".._uidlist[i])
end
ScriptLib.PrintContextLog(context,"## HM_FindTubby UpdatePlayerGalleryScore:".. "cur_tide_total_num="..HM_FindTubby.Stage_Tubby_Count)
ScriptLib.UpdatePlayerGalleryScore(context, HM_FindTubby.galleryID, {["cur_tide_total_num"] = HM_FindTubby.Stage_Tubby_Count})
--开始流程
ScriptLib.InitTimeAxis(context, "game", {HM_FindTubby.Game_Time}, false)
LF_Stage_Start(context)
return 0
end
--gallery被中断时的处理
function action_EVENT_GALLERY_STOP(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_GALLERY_STOP:".."func")
LF_Stage_End(context,4)
return 0
end
--unload时关gallery
function action_EVENT_GROUP_WILL_UNLOAD(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_GROUP_WILL_UNLOAD:".."func")
ScriptLib.StopGalleryByReason(context, HM_FindTubby.galleryID, 2)
return 0
end
--游戏总时间到,执行:
function action_EVENT_TIME_AXIS_PASS_game(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_TIME_AXIS_PASS_game:".."func")
LF_Stage_End(context,3)
return 0
end
--点击计分板“开始游戏”选项,执行:
function action_EVENT_SELECT_UIINTERACT(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_UIINTERACT:lua版本[2022_3_25_205659]".."| [evt.param1]="..evt.param1.."|group_id="..base_info.group_id)
--判断交互对象是不是计分板
--[[ if evt.param1 ~= 2 then
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_UIINTERACT:".."[Warnning]交互id不对")
return 0
end ]]
--开gallery
if ScriptLib.StartHomeGallery(context, HM_FindTubby.galleryID, context.uid) == -1 then
ScriptLib.SendServerMessageByLuaKey(context, "HOMEOWRLD_DUPLICATE_GALLERY", {context.uid})
return 0
end
--关闭计分板交互
for k , v in pairs(gadgets) do
if v.gadget_id == HM_FindTubby.Board_Gadget_ID then
ScriptLib.SetGadgetStateByConfigId(context, v.config_id, 201)
break
end
end
return 0
end
--每轮开始时生成所有阿圆
function LF_Stage_Start(context)
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."func")
--先计算出要生成哪几个
local _create_list = LF_Cal_Tubby(context,HM_FindTubby.Stage_Tubby_Count)
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."#_create_list="..#_create_list)
--create
for i = 1 , #_create_list do
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."i="..i)
local _cid = ScriptLib.GetGroupTempValue(context,"Tubby_".._create_list[i],{})
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."正在创建Tubby_".._create_list[i]..", cid=".._cid)
ScriptLib.CreateGadget(context,{config_id = _cid})
ScriptLib.SetWorktopOptionsByGroupId(context,base_info.group_id,_cid, {HM_FindTubby.Tubby_Option_ID})
ScriptLib.SetGroupTempValue(context,"cid_selectable_".. _cid,1,{}) --防止重复拾取标记
ScriptLib.SetGroupTempValue(context,"Used_".._create_list[i] , 1 , {}) --用过标记
end
--stage计时器
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."InitTimeAxis stage|"..HM_FindTubby.Stage_Time-5 .."|"..HM_FindTubby.Stage_Time)
ScriptLib.InitTimeAxis(context, "stage", {HM_FindTubby.Stage_Time-5,HM_FindTubby.Stage_Time}, true)
--通知gallery这一波stage的计时
ScriptLib.PrintContextLog(context,"## HM_FindTubby UpdatePlayerGalleryScore:".. "stage_time="..HM_FindTubby.Stage_Time)
ScriptLib.UpdatePlayerGalleryScore(context, HM_FindTubby.galleryID, {["stage_time"] = HM_FindTubby.Stage_Time})
--初始化:"已找到的阿圆"计数器
ScriptLib.SetGroupTempValue(context,"cur_stage_Tubby_found",0,{})
ScriptLib.PrintContextLog(context,"## HM_FindTubby UpdatePlayerGalleryScore:".. "cur_tide_left_num="..HM_FindTubby.Stage_Tubby_Count)
ScriptLib.UpdatePlayerGalleryScore(context, HM_FindTubby.galleryID, {["cur_tide_left_num"] = HM_FindTubby.Stage_Tubby_Count})
--reminder
local _curuidlist = ScriptLib.GetSceneUidList(context)
local _targetuidlist = {}
for i = 1 , #_curuidlist do
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."player_".._curuidlist[i])
if ScriptLib.GetGroupTempValue(context,"player_".._curuidlist[i],{}) == 1 then
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."player_".._curuidlist[i].." = 1")
table.insert(_targetuidlist,_curuidlist[i])
end
end
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_Start:".."#_targetuidlist="..#_targetuidlist)
ScriptLib.SetTeamEntityGlobalFloatValue(context, _targetuidlist, "GV_Reminder_3", 1)
--ScriptLib.AssignPlayerShowTemplateReminder(context, 176, {param_vec={},param_uid_vec={},uid_vec=_targetuidlist})
return 0
end
--不放回抽取n只阿圆(排除上一轮抽过的)
function LF_Cal_Tubby(context,n)
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Cal_Tubby:".."func")
--先确定哪些上一轮没用过
local _list_temp = {}
for i = 1 , HM_FindTubby.Tubby_Count do
if ScriptLib.GetGroupTempValue(context,"Used_"..i , {}) ~= 1 then
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Cal_Tubby:".."如果上一轮没用过加入_list_temp="..i)
--如果上一轮没用过加入_list_temp
table.insert(_list_temp,i)
else
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Cal_Tubby:".."如果上一轮用过,将用过标记重置="..i)
--如果上一轮用过,将用过标记重置
ScriptLib.SetGroupTempValue(context,"Used_"..i , 0 , {})
end
end
--开抽从_list_temp中不放回抽取n个到_list_result
local _list_result = {}
math.randomseed(ScriptLib.GetServerTime(context))
for i = 1 , n do
local _rand = math.random(#_list_temp)
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Cal_Tubby:".."踢出temp加入result_rand=".._rand..", _list_temp[_rand]=".._list_temp[_rand])
--踢出temp加入result
table.insert(_list_result,_list_temp[_rand])
table.remove(_list_temp,_rand)
end
return _list_result
end
--和阿圆交互,执行:
function action_EVENT_SELECT_OPTION(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_OPTION:")
if ScriptLib.GetGroupTempValue(context,"player_"..context.uid,{}) ~= 1 then
ScriptLib.SetTeamEntityGlobalFloatValue(context, {context.uid}, "GV_Reminder_1", 1)
--ScriptLib.AssignPlayerShowTemplateReminder(context, 174, {param_vec={},param_uid_vec={},uid_vec={context.uid}})
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_OPTION:".. "该玩家无法拾取")
return 0
end
if ScriptLib.GetGroupTempValue(context,"cid_selectable_".. evt.param1,{}) == 1 then
ScriptLib.SetGroupTempValue(context,"cid_selectable_".. evt.param1,0,{}) --防止重复拾取标记 重置
--给玩家计分
ScriptLib.PrintContextLog(context,"## HM_FindTubby UpdatePlayerGalleryScore:".. "score="..1)
ScriptLib.UpdatePlayerGalleryScore(context, HM_FindTubby.galleryID, {["score"] = 1})
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_SELECT_OPTION:".."有人捡到了阿圆,uid="..context.uid)
ScriptLib.KillEntityByConfigId(context, {config_id=evt.param1, entity_type = EntityType.GADGET})
--计算本波剩余数量更新gallery显示
ScriptLib.ChangeGroupTempValue(context,"cur_stage_Tubby_found",1,{})
local _found = ScriptLib.GetGroupTempValue(context,"cur_stage_Tubby_found",{})
if HM_FindTubby.Stage_Tubby_Count - _found > 0 then
ScriptLib.PrintContextLog(context,"## HM_FindTubby UpdatePlayerGalleryScore:".. "cur_tide_left_num="..HM_FindTubby.Stage_Tubby_Count-_found)
ScriptLib.UpdatePlayerGalleryScore(context, HM_FindTubby.galleryID, {["cur_tide_left_num"] = HM_FindTubby.Stage_Tubby_Count-_found})
end
--判断本轮阿圆是不是找完
if _found == HM_FindTubby.Stage_Tubby_Count then
LF_Stage_End(context,1)
end
end
return 0
end
--阶段倒计时结束,执行:
function action_EVENT_TIME_AXIS_PASS_stage(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_TIME_AXIS_PASS_stage:".."evt.param1 = "..evt.param1)
if evt.param1 == 1 then
--reminder
local _curuidlist = ScriptLib.GetSceneUidList(context)
local _targetuidlist = {}
for i = 1 , #_curuidlist do
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_TIME_AXIS_PASS_stage:".."player_".._curuidlist[i])
if ScriptLib.GetGroupTempValue(context,"player_".._curuidlist[i],{}) == 1 then
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_TIME_AXIS_PASS_stage:".."player_".._curuidlist[i].." = 1")
table.insert(_targetuidlist,_curuidlist[i])
end
end
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_TIME_AXIS_PASS_stage:".."#_targetuidlist="..#_targetuidlist)
ScriptLib.SetTeamEntityGlobalFloatValue(context, _targetuidlist, "GV_Reminder_2", 1)
--ScriptLib.AssignPlayerShowTemplateReminder(context, 175, {param_vec={},param_uid_vec={},uid_vec=_targetuidlist})
end
if evt.param1 == 2 then
LF_Stage_End(context,2)
end
return 0
end
--阶段结束有4个原因1找到全部阿圆2stage结束3game结束4客户端UI手动中断gallery
function LF_Stage_End(context,reason)
ScriptLib.PrintContextLog(context,"## HM_FindTubby LF_Stage_End:".."reason="..reason)
--如果是阿圆被找完,重置时间轴
if reason == 1 then
end
--如果是倒计时结束,清空剩余阿圆
if reason == 2 then
for i = 1 , HM_FindTubby.Tubby_Count do
local _cid = ScriptLib.GetGroupTempValue(context,"Tubby_" .. i ,{})
if ScriptLib.GetGroupTempValue(context,"cid_selectable_".._cid,{}) == 1 then
ScriptLib.KillEntityByConfigId(context, {config_id=_cid, entity_type = EntityType.GADGET})
ScriptLib.SetGroupTempValue(context,"cid_selectable_".. _cid,0,{}) --防止重复拾取标记 重置
end
end
end
--如果是总时间完结游戏结束return
if reason == 3 then
ScriptLib.EndTimeAxis(context,"stage")
ScriptLib.StopGallery(context, HM_FindTubby.galleryID, false)
ScriptLib.RefreshGroup(context,{group_id = base_info.group_id,suite = 1})
return 0
end
--如果是gallery中断游戏结束return
if reason == 4 then
ScriptLib.EndTimeAxis(context,"stage")
ScriptLib.EndTimeAxis(context,"game")
ScriptLib.RefreshGroup(context,{group_id = base_info.group_id,suite = 1})
return 0
end
--如果游戏还未结束,重新刷下一轮阿圆
LF_Stage_Start(context)
return 0
end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = "temp_Trigger_"..k
v.config_id = 40000000 + k
v.trigger_count = 0
v.condition = ""
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--加变量
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
table.insert(variables,v)
end
end
return 0
end
Initialize()

View File

@@ -0,0 +1,812 @@
--[[======================================
|| filename: Rogue_Cell
|| owner: juntao.chen
|| description: 肉鸽每个房间的re(和谐)quire
|| LogName: Rogue_Cell
|| Protection: [Protection]
=======================================]]
--[[
defs.center_point = 111,
defs.rogue_exit123
]]
local Rogue_Cell = {
Monster_Pool_Info =
{
--丘丘人杂鱼+弓箭手+火斧暴徒+雷斧暴徒
[33001] = {total_count=12, min_count=6, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+萨满+岩盾暴徒+木盾暴徒
[33002] = {total_count=12, min_count=6, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+冰萨满+冰盾暴徒
[33003] = {total_count=12, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+草萨满+雷萨满+火暴徒+火法
[33004] = {total_count=12, min_count=3, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+水萨满+风萨满+岩盾暴徒
[33005] = {total_count=12, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--雷斧暴徒+火斧暴徒+岩盾暴徒
[33006] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火史莱姆+爆弹丘丘+火深渊法师
[33007] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--水史莱姆+冰弹丘丘+水深渊法师
[33008] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--雷史莱姆+雷丘丘萨满+雷深渊法师
[33009] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--大冰史莱姆+冰弹丘丘+冰深渊法师
[33010] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--大雷史莱姆+雷深渊法师+雷丘丘王
[33011] = {total_count=5, min_count=1, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--大岩史莱姆+岩盾丘丘人+岩盔王
[33012] = {total_count=5, min_count=2, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--大冰史莱姆+冰深渊法师+霜铠王
[33013] = {total_count=5, min_count=1, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--冰火雷三深渊法师
[33014] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--冰火水三深渊法师
[33015] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷飘浮灵+水漂浮灵+雷史莱姆+水史莱姆
[33016] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--火飘浮灵+风漂浮灵+火史莱姆
[33017] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--冰飘浮灵+水漂浮灵+冰史莱姆+水史莱姆
[33020] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--独眼小宝+独眼大宝
[33021] = {total_count=2, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--歼击机关+侦察机关
[33022] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--巡弋机关+防卫机关
[33023] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥水+岩龙蜥冰
[33024] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥火+岩龙蜥雷
[33029] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--小水龙蜥
[33030] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--小冰龙蜥+小雷龙蜥
[33031] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--大深海龙蜥
[33036] = {total_count=2, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--雷小狗
[33037] = {total_count=8, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--岩小狗
[33038] = {total_count=8, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--雷大狗
[33039] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩大狗
[33040] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--火深渊+雷小狗
[33041] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--水深渊+岩小狗
[33042] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--纯水之猪+纯水之鼠+纯水之鹤
[33043] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--纯水之鸭+纯水之雀+纯水之蛙
[33044] = {total_count=5, min_count=3, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥火+火骗骗花
[33045] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥冰+冰骗骗花
[33046] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥雷+雷骗骗花
[33047] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火咏者+草丘丘萨满+风丘丘萨满
[33048] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--水使徒+雷丘丘萨满+风丘丘萨满
[33049] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷咏者+水丘丘萨满+风丘丘萨满
[33050] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火咏者+火深渊法师
[33051] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--水使徒+水深渊法师
[33052] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷咏者+雷深渊法师
[33053] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众债务处理人+火铳
[33019] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众冰铳+冰莹术士
[33025] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众雷莹术士+雷锤
[33027] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--镜女+冰铳+冰莹术士
[33028] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火海乱鬼+浪人暗部
[33032] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷海乱鬼+浪人山贼
[33033] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众岩使+雷锤+债务处理人
[33034] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团铲子+火瓶子+水瓶子+空手肌肉男
[33018] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团船橹+电瓶子+冰瓶子+锤子肌肉男+空手肌肉男
[33035] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团铲子+冰瓶子+水瓶子+斥候+锤子肌肉男
[33054] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团船橹+水瓶子+电瓶子+空手肌肉男+锤子肌肉男
[33055] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团空手胖+火瓶子+电瓶子+斥候+锤子肌肉男
[33056] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--雷锤+风拳+水铳
[33057] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷莹术士+冰铳
[33058] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--海乱鬼火+海乱鬼雷
[33059] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--浪人+浪人暗部+浪人山贼
[33060] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--恒常机关阵列
[33061] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--大小宝rush
[33062] = {total_count=4, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--遗迹机关rush
[33063] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--幼岩龙蜥rush
[33064] = {total_count=4, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥rush
[33065] = {total_count=4, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥水
[33066] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥火
[33067] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥冰
[33068] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥电
[33069] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--浪人rush
[33070] = {total_count=9, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--海乱鬼rush
[33071] = {total_count=4, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--魔偶剑鬼
[33072] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--剑鬼三兄弟
[33073] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--先遣队rush冰水倾向
[33074] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--先遣队rush雷火倾向
[33075] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--债务处理人rush
[33076] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--藏镜仕女+冰萤术士+雷萤术士rush
[33077] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火深渊法师+雷小狗rush
[33078] = {total_count=4, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--水深渊法师+岩小狗rush
[33079] = {total_count=4, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--火咏者rush
[33080] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--水使徒rush
[33081] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--火咏者+雷大狗rush
[33082] = {total_count=2, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--水使徒+岩大狗rush
[33083] = {total_count=2, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--火骗骗花rush
[33084] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--冰骗骗花rush
[33085] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--爆炎树
[33086] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--急冻树
[33087] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--无相火
[33088] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--无相冰
[33089] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+弓箭手+火斧暴徒+雷斧暴徒
[33090] = {total_count=12, min_count=6, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--雷斧暴徒+火斧暴徒+岩盾暴徒
[33091] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--独眼小宝+独眼大宝
[33092] = {total_count=2, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥水+岩龙蜥冰
[33093] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥火+岩龙蜥雷
[33094] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--小水龙蜥
[33095] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--小冰龙蜥+小雷龙蜥
[33096] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--雷小狗
[33097] = {total_count=8, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--岩小狗
[33098] = {total_count=8, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--火深渊+雷小狗
[33099] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--水深渊+岩小狗
[33100] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--纯水之猪+纯水之鼠+纯水之鹤
[33101] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--纯水之鸭+纯水之雀+纯水之蛙
[33102] = {total_count=5, min_count=3, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--火咏者+草丘丘萨满+风丘丘萨满
[33103] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--水使徒+雷丘丘萨满+风丘丘萨满
[33104] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷咏者+水丘丘萨满+风丘丘萨满
[33105] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团船橹+电瓶子+冰瓶子+锤子肌肉男+空手肌肉男
[33106] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团铲子+冰瓶子+水瓶子+斥候+锤子肌肉男
[33107] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团船橹+水瓶子+电瓶子+空手肌肉男+锤子肌肉男
[33108] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团空手胖+火瓶子+电瓶子+斥候+锤子肌肉男
[33109] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--雷锤+风拳+水铳
[33110] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷莹术士+冰铳
[33111] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--大小宝rush
[33112] = {total_count=4, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--遗迹机关rush
[33113] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--幼岩龙蜥rush
[33114] = {total_count=4, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥rush
[33115] = {total_count=4, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--浪人rush
[33116] = {total_count=9, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--海乱鬼rush
[33117] = {total_count=4, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--先遣队rush冰水倾向
[33118] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--先遣队rush雷火倾向
[33119] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--债务处理人rush
[33120] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火深渊法师+雷小狗rush
[33121] = {total_count=4, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--水深渊法师+岩小狗rush
[33122] = {total_count=4, min_count=4, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--火咏者rush
[33123] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--水使徒rush
[33124] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--火骗骗花rush
[33125] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--冰骗骗花rush
[33126] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+萨满+岩盾暴徒+木盾暴徒
[33127] = {total_count=12, min_count=6, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+冰萨满+冰盾暴徒
[33128] = {total_count=12, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+草萨满+雷萨满+火暴徒+火法
[33129] = {total_count=12, min_count=3, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--丘丘人杂鱼+水萨满+风萨满+岩盾暴徒
[33130] = {total_count=12, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--火史莱姆+爆弹丘丘+火深渊法师
[33131] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--水史莱姆+冰弹丘丘+水深渊法师
[33132] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--雷史莱姆+雷丘丘萨满+雷深渊法师
[33133] = {total_count=6, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--大雷史莱姆+雷深渊法师+雷丘丘王
[33134] = {total_count=5, min_count=1, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--大岩史莱姆+岩盾丘丘人+岩盔王
[33135] = {total_count=5, min_count=2, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--大冰史莱姆+冰深渊法师+霜铠王
[33136] = {total_count=5, min_count=1, max_count=4, fill_time=0, fill_count=0, is_ordered = true},
--冰火雷三深渊法师
[33137] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--冰火水三深渊法师
[33138] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火飘浮灵+风漂浮灵+火史莱姆
[33139] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--盗宝团铲子+火瓶子+水瓶子+空手肌肉男
[33140] = {total_count=10, min_count=5, max_count=5, fill_time=0, fill_count=0, is_ordered = true},
--愚人众债务处理人+火铳
[33141] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--冰飘浮灵+水漂浮灵+冰史莱姆+水史莱姆
[33142] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--歼击机关+侦察机关
[33143] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--巡弋机关+防卫机关
[33144] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众冰铳+冰莹术士
[33145] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众雷莹术士+雷锤
[33146] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--镜女+冰铳+冰莹术士
[33147] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火海乱鬼+浪人暗部
[33148] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--雷海乱鬼+浪人山贼
[33149] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--愚人众岩使+雷锤+债务处理人
[33150] = {total_count=3, min_count=2, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--大深海龙蜥
[33151] = {total_count=2, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--雷大狗
[33152] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩大狗
[33153] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥火+火骗骗花
[33154] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥冰+冰骗骗花
[33155] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--岩龙蜥雷+雷骗骗花
[33156] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--海乱鬼火+海乱鬼雷
[33157] = {total_count=2, min_count=1, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--浪人+浪人暗部+浪人山贼
[33158] = {total_count=6, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--藏镜仕女+冰萤术士+雷萤术士rush
[33159] = {total_count=3, min_count=3, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
--火咏者+雷大狗rush
[33160] = {total_count=2, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--水使徒+岩大狗rush
[33161] = {total_count=2, min_count=2, max_count=2, fill_time=0, fill_count=0, is_ordered = true},
--爆炎树
[33162] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--急冻树
[33163] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋小冰史莱姆
[33164] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋小火史莱姆
[33165] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋小水史莱姆
[33166] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋小雷史莱姆
[33167] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋小岩史莱姆
[33168] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋丘丘人潮
[33169] = {total_count=30, min_count=6, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--彩蛋盗宝团潮
[33170] = {total_count=30, min_count=6, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--雷飘浮灵+水漂浮灵+雷史莱姆+水史莱姆
[33171] = {total_count=6, min_count=4, max_count=6, fill_time=0, fill_count=0, is_ordered = true},
--恒常机关阵列
[33172] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥水
[33173] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥火
[33174] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥冰
[33175] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--古岩龙蜥电
[33176] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--魔偶剑鬼
[33177] = {total_count=1, min_count=1, max_count=1, fill_time=0, fill_count=0, is_ordered = true},
--剑鬼三兄弟
[33178] = {total_count=3, min_count=1, max_count=3, fill_time=0, fill_count=0, is_ordered = true},
},
Time_ChallengeID = 111197, --需要限时的挑战id
HP_ChallengeID = 111198, --需要加血量的挑战id
Time_Challenge_Time = 120, --限时挑战时间
Center_Point_Config_ID = defs.center_point, --中心点
Operator_Config_ID = 20000001, --普通开怪操作台cfgid
Operator_Gadget_ID = 70800187, --普通开怪操作台gadgetid
Difficulty_Operator_Config_ID = 20000002, --高难开怪xxx
Difficulty_Operator_Gadget_ID = 70800188, --高难开怪xxx
Prepare_Operator_Config_ID = 20000003, --备战操作台xxx
Prepare_Operator_Gadget_ID = 70800186, --备战操作台xxx
AirWall_Config_ID = 20000004, --空气墙
AirWall_Gadget_ID = 70800170, --空气墙
Portal_Config_ID = 20000005, --传送门
Portal_Gadget_ID = 70800208, --传送门
Operator_BOSS_Config_ID = 20000006, --BOSS版开怪操作台
Operator_BOSS_Gadget_ID = 70800206, --BOSS版开怪操作台
}
local temp_Variables_Rogue_Cell = {
{ config_id=51110001,name = "gm_EVENT_ROGUE_OPEN_ACCESS", value = 0, no_refresh = false },
{ config_id=51110002,name = "gm_EVENT_ROGUE_CREAGE_REPAIR_GADGET", value = 0, no_refresh = false },
{ config_id=51110003,name = "gm_EVENT_ROGUE_CREAGE_FIGHT_GADGET", value = 0, no_refresh = false },
{ config_id=51110004,name = "gm_EVENT_ROGUE_START_FIGHT", value = 0, no_refresh = false },
{ config_id=51110005,name = "gm_poolid", value = 0, no_refresh = false },
}
local temp_Tirgger_Rogue_Cell = {
{event = EventType.EVENT_CHALLENGE_SUCCESS,source = "",condition="",action="action_EVENT_CHALLENGE_SUCCESS",trigger_count=0},
{event = EventType.EVENT_ROGUE_OPEN_ACCESS,source = "",condition="",action="action_EVENT_ROGUE_OPEN_ACCESS",trigger_count=0},
{event = EventType.EVENT_ROGUE_CREAGE_REPAIR_GADGET,source = "",condition="",action="action_EVENT_ROGUE_CREAGE_REPAIR_GADGET",trigger_count=0},
{event = EventType.EVENT_ROGUE_CREAGE_FIGHT_GADGET,source = "",condition="",action="action_EVENT_ROGUE_CREAGE_FIGHT_GADGET",trigger_count=0},
{event = EventType.EVENT_ROGUE_START_FIGHT,source = "",condition="",action="action_EVENT_ROGUE_START_FIGHT",trigger_count=0},
{event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_EVENT_CHALLENGE_FAIL",trigger_count = 0},
{event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD",trigger_count = 0},
--{event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "", action = "action_EVENT_ANY_MONSTER_LIVE",trigger_count = 0},
{event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_EVENT_ENTER_REGION",trigger_count = 0},
--gm指令用
{event = EventType.EVENT_VARIABLE_CHANGE, source = "gm_EVENT_ROGUE_OPEN_ACCESS", condition = "", action = "action_EVENT_ROGUE_OPEN_ACCESS",trigger_count = 0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "gm_EVENT_ROGUE_CREAGE_REPAIR_GADGET", condition = "", action = "action_EVENT_ROGUE_CREAGE_REPAIR_GADGET",trigger_count = 0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "gm_EVENT_ROGUE_CREAGE_FIGHT_GADGET", condition = "", action = "action_EVENT_ROGUE_CREAGE_FIGHT_GADGET",trigger_count = 0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "gm_EVENT_ROGUE_START_FIGHT", condition = "", action = "action_EVENT_ROGUE_START_FIGHT",trigger_count = 0},
}
--靠近操作台时显示reminder
function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ENTER_REGION:")
if ScriptLib.GetGroupTempValue(context,"ShowReminder",{}) == 1 then
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ENTER_REGION:ShowReminder="..1)
local _vec = ScriptLib.GetRogueDiaryRoundAndRoom(context)
if #_vec == 2 then
local _stage = _vec[1]
local _cell = _vec[2]
ScriptLib.AssignPlayerShowTemplateReminder(context, 167+_stage, {param_vec={_cell},param_uid_vec={},uid_vec={evt.uid}})
else
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ENTER_REGION[Warning]:#_vec="..#_vec)
end
end
return 0
end
--怪物挂sgv【已废弃】
--[[ function action_EVENT_ANY_MONSTER_LIVE(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ANY_MONSTER_LIVE:")
local _sgv1 = ScriptLib.GetGroupTempValue(context,"sgv1",{})
local _sgv2 = ScriptLib.GetGroupTempValue(context,"sgv2",{})
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ANY_MONSTER_LIVE:p1="..evt.param1.."|sgv1=".._sgv1.."|sgv2=".._sgv2)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, evt.param1, "SGV_Rogue_Affixes_Level", _sgv1)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, evt.param1, "SGV_Rogue_Is_Hard", _sgv2)
return 0
end ]]
--初始化打开所有空气墙门
function action_EVENT_GROUP_LOAD(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_GROUP_LOAD:[version]2022_3_18_004149")
local _stage = ScriptLib.GetRogueDiaryDungeonStage(context)
ScriptLib.SetGroupTempValue(context,"_stage",_stage,{})
ScriptLib.CreateGadget(context,{config_id = Rogue_Cell.Operator_Config_ID})
ScriptLib.CreateGadget(context,{config_id = Rogue_Cell.Difficulty_Operator_Config_ID})
ScriptLib.CreateGadget(context,{config_id = Rogue_Cell.Prepare_Operator_Config_ID})
ScriptLib.CreateGadget(context,{config_id = Rogue_Cell.Operator_BOSS_Config_ID})
return 0
end
--杀怪完毕
function action_EVENT_CHALLENGE_SUCCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_CHALLENGE_SUCCESS:")
ScriptLib.FinishRogueDiaryDungeonSingleRoom(context,false)
return 0
end
--通知打开通路
function action_EVENT_ROGUE_OPEN_ACCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_OPEN_ACCESS:evt.param1 ="..evt.param1)
ScriptLib.SetGadgetStateByConfigId(context, Rogue_Cell.Prepare_Operator_Config_ID, 0)
if evt.param1 == 1 then
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_OPEN_ACCESS:defs.rogue_exit ="..defs.rogue_exit)
ScriptLib.CreateGadget(context,{config_id = defs.rogue_exit})
end
return 0
end
--通知创建备战操作台
function action_EVENT_ROGUE_CREAGE_REPAIR_GADGET(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_CREAGE_REPAIR_GADGET:")
ScriptLib.SetGadgetStateByConfigId(context, Rogue_Cell.Prepare_Operator_Config_ID, 201)
return 0
end
--通知创建刷怪操作台
function action_EVENT_ROGUE_CREAGE_FIGHT_GADGET(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_CREAGE_FIGHT_GADGET: evt.param1 = "..evt.param1)
local _needwait = ScriptLib.GetGroupTempValue(context,"Need_Wait",{})
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_CREAGE_FIGHT_GADGET: _needwait = ".._needwait)
if _needwait ~= 1 then
LF_Create_Fight_Operator(context,evt.param1,evt.param2)
ScriptLib.SetGroupTempValue(context,"ShowReminder",1,{})
else
--延迟创建等房间转好了。地城2的情况
--记录下是否高难
ScriptLib.SetGroupTempValue(context,"operator_is_hard",evt.param1,{})
--记录下是否boss
ScriptLib.SetGroupTempValue(context,"operator_is_boss",evt.param2,{})
end
return 0
end
function LF_Create_Fight_Operator(context,p1,p2)
ScriptLib.PrintContextLog(context,"## Rogue_Cell LF_Create_Fight_Operator: p1="..p1.."|p2="..p2)
ScriptLib.SetGadgetStateByConfigId(context, Rogue_Cell.Prepare_Operator_Config_ID, 0) --刷怪操作台创建的时候也要隐藏整备操作台
if p1 == 1 then
ScriptLib.PrintContextLog(context,"## Rogue_Cell LF_Create_Fight_Operator:刷高难操作台")
ScriptLib.SetGadgetStateByConfigId(context, Rogue_Cell.Difficulty_Operator_Config_ID, 201)
ScriptLib.SetGroupTempValue(context,"operator_config_id",Rogue_Cell.Difficulty_Operator_Config_ID,{})
else
if p2 == 1 then
ScriptLib.PrintContextLog(context,"## Rogue_Cell LF_Create_Fight_Operator:刷BOSS操作台")
ScriptLib.SetGadgetStateByConfigId(context, Rogue_Cell.Operator_BOSS_Config_ID, 201)
ScriptLib.SetGroupTempValue(context,"operator_config_id",Rogue_Cell.Operator_BOSS_Config_ID,{})
else
ScriptLib.PrintContextLog(context,"## Rogue_Cell LF_Create_Fight_Operator:刷普通操作台")
ScriptLib.SetGadgetStateByConfigId(context, Rogue_Cell.Operator_Config_ID, 201)
ScriptLib.SetGroupTempValue(context,"operator_config_id",Rogue_Cell.Operator_Config_ID,{})
end
end
return 0
end
--通知刷怪
function action_EVENT_ROGUE_START_FIGHT(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_START_FIGHT:p1="..evt.param1.." | p2="..evt.param2.." | p3="..evt.param3)
local _poolid = evt.param1
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_START_FIGHT:_poolid=".._poolid)
if _poolid == 0 then _poolid = ScriptLib.GetGroupVariableValue(context,"gm_poolid") end
local _challengeid = evt.param2
if _challengeid == 0 then _challengeid = 111196 end
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_START_FIGHT:开挑战")
--开挑战
if _challengeid == Rogue_Cell.Time_ChallengeID then --如果该挑战是需要限时的
--用限时的方式开启(带时间参数)
ScriptLib.ActiveChallenge(context, 1, _challengeid, Rogue_Cell.Time_Challenge_Time,base_info.group_id, Rogue_Cell.Monster_Pool_Info[_poolid].total_count, 0)
else
--普通方式开启
ScriptLib.ActiveChallenge(context, 1, _challengeid, base_info.group_id,Rogue_Cell.Monster_Pool_Info[_poolid].total_count, 0, 0)
end
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ROGUE_START_FIGHT:刷怪")
--查询并记录sgv
local _sgv1 = 0
local _sgv2 = 0
_sgv1 = evt.param3
if Rogue_Cell.HP_ChallengeID == evt.param2 then
_sgv2 = 1
else
_sgv2 = 0
end
--特判彩蛋关无sgv
if _poolid == 33169 or _poolid == 33170 then
_sgv1 = 0
_sgv2 = 0
end
--刷怪
if Rogue_Cell.Monster_Pool_Info[_poolid] == nil then
ScriptLib.PrintContextLog(context,"## 【error】 Rogue_Cell action_EVENT_SELECT_OPTION:".."找不到资源包配置")
return 0
end
local _info = Rogue_Cell.Monster_Pool_Info[_poolid]
_info.tag = 2 --point点的tag都是2 加下
_info.sgv_map = {
SGV_Rogue_Affixes_Level = _sgv1,
SGV_Rogue_Is_Hard = _sgv2,
}
ScriptLib.AutoPoolMonsterTide(context,1,base_info.group_id,{_poolid},0,{},{},_info)
--销毁操作台
local _cid = ScriptLib.GetGroupTempValue(context,"operator_config_id",{})
ScriptLib.SetGadgetStateByConfigId(context, _cid, 0)
ScriptLib.SetGroupTempValue(context,"ShowReminder",0,{})
return 0
end
--失败重新创建操作台
function action_EVENT_CHALLENGE_FAIL(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_CHALLENGE_FAIL:")
--清空怪物潮
local _poolid = ScriptLib.GetGroupTempValue(context,"poolid",{})
ScriptLib.ClearPoolMonsterTide(context, base_info.group_id, 1)
--通知服务器
ScriptLib.FinishRogueDiaryDungeonSingleRoom(context,true)
local _cid = ScriptLib.GetGroupTempValue(context,"operator_config_id",{})
ScriptLib.SetGadgetStateByConfigId(context, _cid, 201)
return 0
end
--已废弃
function SLC_Monster_Ready(context)
--[[ local _sgv1 = ScriptLib.GetGroupTempValue(context,"sgv1",{})
local _sgv2 = ScriptLib.GetGroupTempValue(context,"sgv2",{})
ScriptLib.PrintContextLog(context,"## Rogue_Cell SLC_Monster_Ready:p1="..context.source_entity_id.."|sgv1=".._sgv1.."|sgv2=".._sgv2)
ScriptLib.SetEntityServerGlobalValueByEntityId(context, context.source_entity_id, "SGV_Rogue_Affixes_Level", _sgv1)
ScriptLib.SetEntityServerGlobalValueByEntityId(context, context.source_entity_id, "SGV_Rogue_Is_Hard", _sgv2) ]]
return 0
end
function SLC_StageReady_Rogue(context)
ScriptLib.PrintContextLog(context,"## Rogue_Cell SLC_StageReady_Rogue:")
local _stage = ScriptLib.GetGroupTempValue(context,"_stage",{})
if _stage == 1 then
ScriptLib.AssignPlayerShowTemplateReminder(context,184,{param_uid_vec={},param_vec={},uid_vec={context.uid}})
elseif _stage == 2 then
ScriptLib.AssignPlayerShowTemplateReminder(context,185,{param_uid_vec={},param_vec={},uid_vec={context.uid}})
elseif _stage == 3 then
ScriptLib.AssignPlayerShowTemplateReminder(context,186,{param_uid_vec={},param_vec={},uid_vec={context.uid}})
elseif _stage == 4 then
ScriptLib.AssignPlayerShowTemplateReminder(context,187,{param_uid_vec={},param_vec={},uid_vec={context.uid}})
end
return 0
end
--初始化
function Initialize()
--在中心点加操作台(玩法特有)
for k,v in pairs(points) do
if v.config_id == Rogue_Cell.Center_Point_Config_ID then
local _pos = {x =v.pos.x, y =v.pos.y+2, z = v.pos.z}
--普通开怪操作台
table.insert(gadgets,{config_id=Rogue_Cell.Operator_Config_ID,gadget_id=Rogue_Cell.Operator_Gadget_ID,pos=_pos,rot=v.rot,level=1})
table.insert(suites[init_config.suite].gadgets,Rogue_Cell.Operator_Config_ID)
--选难度开怪操作台
table.insert(gadgets,{config_id=Rogue_Cell.Difficulty_Operator_Config_ID,gadget_id=Rogue_Cell.Difficulty_Operator_Gadget_ID,pos=_pos,rot=v.rot,level=1})
table.insert(suites[init_config.suite].gadgets,Rogue_Cell.Difficulty_Operator_Config_ID)
--备战操作台
table.insert(gadgets,{config_id=Rogue_Cell.Prepare_Operator_Config_ID,gadget_id=Rogue_Cell.Prepare_Operator_Gadget_ID,pos=_pos,rot=v.rot,level=1})
table.insert(suites[init_config.suite].gadgets,Rogue_Cell.Prepare_Operator_Config_ID)
--boss版开怪操作台
table.insert(gadgets,{config_id=Rogue_Cell.Operator_BOSS_Config_ID,gadget_id=Rogue_Cell.Operator_BOSS_Gadget_ID,pos=_pos,rot=v.rot,level=1})
table.insert(suites[init_config.suite].gadgets,Rogue_Cell.Operator_BOSS_Config_ID)
--reminder用region
table.insert(regions,{ config_id = 30000001, shape = RegionShape.SPHERE, radius = 10, pos = v.pos })
table.insert(suites[init_config.suite].regions,30000001)
end
end
--加触发器
if temp_Tirgger_Rogue_Cell ~= nil then
for k,v in pairs(temp_Tirgger_Rogue_Cell) do
v.name = "temp_Tirgger_"..k
v.config_id = 40000000 + k
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--加变量
if temp_Variables_Rogue_Cell ~= nil then
for k,v in pairs(temp_Variables_Rogue_Cell) do
table.insert(variables,v)
end
end
return 0
end
Initialize()

View File

@@ -0,0 +1,92 @@
--[[======================================
|| filename: Rogue_Terraion_1
|| owner: juntao.chen
|| description: 肉鸽地城1的re(和谐)quire用于地城1特有的地形控制开门、刷空气墙等
|| LogName: Rogue_Terraion_1
|| Protection: [Protection]
=======================================]]
--[[
需求defs:
defs.airwall = 9999 --空气墙的configid
defs.bridge = 9999 --通往下个房间的光桥
]]
local next_group_info = {
[246201001] = {246201002,2009,2015},
[246201002] = {246201003,3009,3015},
[246201003] = {246201004,4007,4015},
[246201004] = {246201001,1009,1015},
}
local last_group_info = {
[246201001] = {246201004,4007,4015},
[246201002] = {246201001,1009,1015},
[246201003] = {246201002,2009,2015},
[246201004] = {246201003,3009,3015},
}
local temp_Variables_Rogue_Terrain_1 = {
}
local temp_Tirgger_Rogue_Terrain_1 = {
--{event = EventType.EVENT_CHALLENGE_SUCCESS,source = "",condition="",action="action_t1_EVENT_CHALLENGE_SUCCESS",trigger_count=0},
{event = EventType.EVENT_ROGUE_START_FIGHT,source = "",condition="",action="action_t1_EVENT_ROGUE_START_FIGHT",trigger_count=0},
{event = EventType.EVENT_ROGUE_OPEN_ACCESS,source = "",condition="",action="action_t1_EVENT_ROGUE_OPEN_ACCESS",trigger_count=0},
--{event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_t1_EVENT_CHALLENGE_FAIL",trigger_count = 0},
--{event = EventType.EVENT_ROGUE_CREAGE_REPAIR_GADGET,source = "",condition="",action="action_t1_EVENT_ROGUE_CREAGE_REPAIR_GADGET",trigger_count=0},
--{event = EventType.EVENT_ROGUE_CREAGE_FIGHT_GADGET,source = "",condition="",action="action_t1_EVENT_ROGUE_CREAGE_FIGHT_GADGET",trigger_count=0},
}
function action_t1_EVENT_ROGUE_OPEN_ACCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_1 action_t1_EVENT_ROGUE_OPEN_ACCESS:")
if evt.param1 == 1 then return 0 end --通关后不需要开通路
LF_Open_Door(context)
return 0
end
function action_t1_EVENT_ROGUE_START_FIGHT(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_1 action_t1_EVENT_ROGUE_START_FIGHT:")
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_1 action_t1_EVENT_ROGUE_START_FIGHT:创建空气墙")
LF_Close_Door(context)
return 0
end
function LF_Close_Door(context)
for k,v in pairs(last_group_info) do
if k == base_info.group_id then
ScriptLib.SetGroupGadgetStateByConfigId(context, v[1], v[3], 0)
ScriptLib.SetGroupGadgetStateByConfigId(context, v[1], v[2], 0)
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, defs.air_wall, 0)
end
end
return 0
end
function LF_Open_Door(context)
for k,v in pairs(next_group_info) do
if k == base_info.group_id then
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, defs.bridge, 201)
ScriptLib.SetGroupGadgetStateByConfigId(context, v[1], v[2], 201)
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, defs.air_wall, 202)
end
end
return 0
end
--初始化
function Initialize_1()
--加触发器
if temp_Tirgger_Rogue_Terrain_1 ~= nil then
for k,v in pairs(temp_Tirgger_Rogue_Terrain_1) do
v.name = "temp_Tirgger_1_"..k
v.config_id = 40100000 + k
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--加变量
if temp_Variables_Rogue_Terrain_1 ~= nil then
for k,v in pairs(temp_Variables_Rogue_Terrain_1) do
table.insert(variables,v)
end
end
return 0
end
Initialize_1()

View File

@@ -0,0 +1,130 @@
--[[
local defs={
air_wall = 999,
}
]]
local T_Gruop_ID = 246202004
local T_Air_Wall = 4001
local Next_Group_List = {
[246202001] = 246202002,
[246202002] = 246202003,
[246202003] = 246202005,
[246202005] = 246202006,
[246202006] = 246202007,
[246202007] = 246202001,
}
local temp_Gadget = {
{ config_id = 20000991, gadget_id = 70800183, pos = { x = 17.537, y = -43.175, z = 0.008 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
}
local temp_Variables_Rogue_Terrain_2 = {
{ config_id=50000001,name = "Terrain", value = 2, no_refresh = false },
{ config_id=50000002,name = "Ready", value = 0, no_refresh = false },
}
local temp_Tirgger_Rogue_Terrain_2 = {
{event = EventType.EVENT_CHALLENGE_SUCCESS,source = "",condition="",action="action_t2_EVENT_CHALLENGE_SUCCESS",trigger_count=0},
{event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_t2_EVENT_GROUP_LOAD",trigger_count = 0},
{event = EventType.EVENT_ROGUE_OPEN_ACCESS, source = "", condition = "", action = "action_t2_action_EVENT_ROGUE_OPEN_ACCESS",trigger_count = 0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "Ready", condition = "", action = "action_t2_EVENT_VARIABLE_CHANGE_Ready", trigger_count = 0 },
{event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_t2_EVENT_SELECT_OPTION", trigger_count = 0 },
{event = EventType.EVENT_GADGET_STATE_CHANGE,source = "",condition="",action="action_t2_EVENT_GADGET_STATE_CHANGE",trigger_count=0},
{event = EventType.EVENT_ROGUE_START_FIGHT,source = "",condition="",action="action_t2_EVENT_ROGUE_START_FIGHT",trigger_count=0},
}
--通知下个group延迟创建操作台时点1开始战斗
function action_t2_EVENT_ROGUE_START_FIGHT(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_EVENT_ROGUE_START_FIGHT:")
LF_Notify_Next_Group_Wait(context)
return 0
end
--通知下个group延迟创建操作台时点2触发备战
function action_t2_EVENT_GADGET_STATE_CHANGE(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_EVENT_GADGET_STATE_CHANGE:p1="..evt.param1.."|p2="..evt.param2)
if evt.param1 ~= 201 then return 0 end
if evt.param2 == Rogue_Cell.Prepare_Operator_Config_ID then
LF_Notify_Next_Group_Wait(context)
end
return 0
end
function LF_Notify_Next_Group_Wait(context)
for k , v in pairs(Next_Group_List) do
local _targetgroup = 0
if k ==base_info.group_id then
_targetgroup = v
ScriptLib.SetGroupTempValue(context,"Need_Wait",1,{ group_id = _targetgroup})
end
end
return 0
end
function action_t2_EVENT_SELECT_OPTION(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_EVENT_SELECT_OPTION:")
if evt.param1 == 20000991 then
ScriptLib.SetGroupVariableValueByGroup(context,"Turn",4,T_Gruop_ID)
end
ScriptLib.RefreshGroup(context, {group_id = base_info.group_id, suite = 1})
ScriptLib.KillEntityByConfigId(context, {config_id=20000991, entity_type = EntityType.GADGET})
ScriptLib.KillEntityByConfigId(context, {group_id = T_Gruop_ID, config_id= T_Air_Wall, entity_type = EntityType.GADGET})
return 0
end
function action_t2_EVENT_VARIABLE_CHANGE_Ready(context,evt)
local _wait = ScriptLib.GetGroupTempValue(context,"Need_Wait",{})
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_EVENT_VARIABLE_CHANGE_Ready: _wait=".._wait)
if _wait == 1 then
ScriptLib.SetGroupTempValue(context,"Need_Wait",0,{})
local _hard = ScriptLib.GetGroupTempValue(context,"operator_is_hard",{})
local _boss = ScriptLib.GetGroupTempValue(context,"operator_is_boss",{})
LF_Create_Fight_Operator(context,_hard,_boss)
local _vec = ScriptLib.GetRogueDiaryRoundAndRoom(context)
--地城2特殊处理创建操作台时给个reminder
if #_vec == 2 then
local _stage = _vec[1]
local _cell = _vec[2]
local _uidlist = ScriptLib.GetSceneUidList(context)
ScriptLib.AssignPlayerShowTemplateReminder(context, 167+_stage, {param_vec={_cell},param_uid_vec={},uid_vec={_uidlist[1]}})
else
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ENTER_REGION[Warning]:#_vec="..#_vec)
end
end
return 0
end
function action_t2_action_EVENT_ROGUE_OPEN_ACCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_action_EVENT_ROGUE_OPEN_ACCESS:")
if evt.param1 == 1 then return 0 end --通关后不需要开通路
ScriptLib.CreateGadget(context, { config_id = 20000991})
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, 20000991, {198})
return 0
end
function action_t2_EVENT_CHALLENGE_SUCCESS(context,evt)
ScriptLib.SetGroupVariableValueByGroup(context,"Clear",0,T_Gruop_ID)
return 0
end
function action_t2_EVENT_GROUP_LOAD(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_EVENT_GROUP_LOAD:")
ScriptLib.SetGroupTempValue(context,"Need_Wait",0,{})
return 0
end
--初始化
function Initialize_2()
--加变量
if temp_Variables_Rogue_Terrain_2 ~= nil then
for k,v in pairs(temp_Variables_Rogue_Terrain_2) do
table.insert(variables,v)
end
end
--加触发器
if temp_Tirgger_Rogue_Terrain_2 ~= nil then
for k,v in pairs(temp_Tirgger_Rogue_Terrain_2) do
v.name = "temp_Tirgger2_"..k
v.config_id = 40200000 + k
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--地城2部分
--加奇点传送门
for k , v in pairs(temp_Gadget) do
table.insert(gadgets,v)
end
return 0
end
Initialize_2()

View File

@@ -0,0 +1,182 @@
--[[
local defs={
Portal_Eff = 999,
Portal_Trigger = 999,
Streaming_Gadget = 999,
Region = 999,
air_wall = 999,
air_wall = 999,
}
]]
local t3_last_group = {
[246203001] = 246203004,
[246203002] = 246203001,
[246203003] = 246203002,
[246203004] = 246203003,
}
local t3_next_group = {
[246203001] = 246203002,
[246203002] = 246203003,
[246203003] = 246203004,
[246203004] = 246203001,
}
local t3_time_order = {
{1,2,3,4}
}
local temp_Variables_Rogue_Terrain_3 = {
{ config_id=50000001,name = "Is_Inited", value = 0, no_refresh = false },
{ config_id=50000002,name = "Unload", value = 0, no_refresh = false },
{ config_id=50000003,name = "Can_Be_Inited", value = 1, no_refresh = false },
}
local temp_Tirgger_Rogue_Terrain_3 = {
--[[
{event = EventType.EVENT_CHALLENGE_SUCCESS,source = "",condition="",action="action_t3_EVENT_CHALLENGE_SUCCESS",trigger_count=0},
{event = EventType.EVENT_ROGUE_START_FIGHT,source = "",condition="",action="action_t3_EVENT_ROGUE_START_FIGHT",trigger_count=0},
{event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_t3_EVENT_CHALLENGE_FAIL",trigger_count = 0},
{event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_t3_EVENT_GROUP_LOAD",trigger_count = 0},
]]
{event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_t3_EVENT_ENTER_REGION", trigger_count = 0 },
{event = EventType.EVENT_ROGUE_OPEN_ACCESS,source = "",condition="",action="action_t3_EVENT_ROGUE_OPEN_ACCESS",trigger_count=0},
{event = EventType.EVENT_PLATFORM_REACH_POINT,source = "",condition="",action="action_t3_EVENT_PLATFORM_REACH_POINT",trigger_count=0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "Unload", condition = "", action = "action_t3_EVENT_VARIABLE_CHANGE_Unload", trigger_count = 0 },
}
--确认走到下个房间后,卸载本间表现物件
function action_t3_EVENT_VARIABLE_CHANGE_Unload(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_VARIABLE_CHANGE_Unload")
--触发器卸载streaming物件卸载
ScriptLib.KillEntityByConfigId(context, {config_id=defs.Streaming_Gadget, entity_type = EntityType.GADGET})
ScriptLib.KillEntityByConfigId(context, {config_id=defs.Portal_Trigger, entity_type = EntityType.GADGET})
--罗盘和指针卸载
ScriptLib.KillEntityByConfigId(context, {config_id=defs.clock, entity_type = EntityType.GADGET})
ScriptLib.KillEntityByConfigId(context, {config_id=defs.pointer, entity_type = EntityType.GADGET})
--传送门贴图恢复原状,回到禁止触发状态
ScriptLib.SetGadgetStateByConfigId(context,defs.Portal_Eff,100+defs.pointarray)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Portal_Eff, "SGV_Disable", 1)
return 0
end
--指针转动完成
function action_t3_EVENT_PLATFORM_REACH_POINT(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_PLATFORM_REACH_POINT:p1="..evt.param1)
--罗盘刻度
local _t = defs.pointarray +1
if _t == 5 then _t = 1 end
ScriptLib.SetEntityServerGlobalValueByConfigId(context,defs.clock,"SGV_Time",_t)
--传送门贴图
ScriptLib.SetGadgetStateByConfigId(context,defs.Portal_Eff,100+_t)
--传送门可触发
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Portal_Eff, "SGV_Disable", 0)
--关空气墙
ScriptLib.KillEntityByConfigId(context, {config_id=defs.air_wall, entity_type = EntityType.GADGET})
return 0
end
--玩家进入房间
function action_t3_EVENT_ENTER_REGION(context,evt)
if evt.param1 ~= defs.Region then return 0 end
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ENTER_REGION:")
if ScriptLib.GetGroupVariableValue(context,"Is_Inited") ~= 1 and ScriptLib.GetGroupVariableValue(context,"Can_Be_Inited") == 1 then
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ENTER_REGION:Is_Inited=1")
if ScriptLib.CreateGadget(context,{config_id = defs.clock}) ~= 0 then ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ENTER_REGION:defs.clock=create fail") end
if ScriptLib.CreateGadget(context,{config_id = defs.pointer}) ~= 0 then ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ENTER_REGION:defs.pointer=create fail") end
if ScriptLib.CreateGadget(context,{config_id = defs.air_wall}) ~= 0 then ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ENTER_REGION:defs.air_wall=create fail") end
--传送门贴图恢复原状,回到禁止触发状态
ScriptLib.SetGadgetStateByConfigId(context,defs.Portal_Eff,100+defs.pointarray)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.Portal_Eff, "SGV_Disable", 1)
ScriptLib.SetGroupVariableValue(context,"Is_Inited",1)
for k , v in pairs(t3_last_group) do
ScriptLib.SetGroupVariableValueByGroup(context,"Can_Be_Inited",0,k) --任意房间被初始化所有房间的值要设成0防止还有各种奇怪方式触发到别的房间的region同一时间只能有一个房间初始化直到玩家打通房间
if k == base_info.group_id then
ScriptLib.SetGroupVariableValueByGroup(context,"Unload",0,v)
ScriptLib.SetGroupVariableValueByGroup(context,"Is_Inited",0,v)
end
end
end
return 0
end
--打开前往下一间的通路:
function action_t3_EVENT_ROGUE_OPEN_ACCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ROGUE_OPEN_ACCESS:")
if evt.param1 == 1 then return 0 end --通关后不需要开通路
--创建streaming物件预加载目标位置场景
ScriptLib.CreateGadget(context,{config_id = defs.Streaming_Gadget})
local _t = defs.pointarray +1
if _t == 5 then _t = 1 end
--开始拨动指针
ScriptLib.SetPlatformPointArray(context, defs.pointer, defs.pointarray, {defs.pointarray,_t}, {route_type = 0, turn_mode = false})
--如果是第一间,那么注目天空轮盘
local _vec = ScriptLib.GetRogueDiaryRoundAndRoom(context)
if #_vec == 2 then
local _stage = _vec[1]
local _cell = _vec[2]
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ROGUE_OPEN_ACCESS:_stage=".._stage .."|_cell=".._cell)
if _stage == 1 and _cell == 2 then --此时cell已经变成2 因为打完了第一间
for k,v in pairs(gadgets) do
if v.config_id == defs.clock then
ScriptLib.BeginCameraSceneLook(context, { look_pos = v.pos, duration = 2, is_force = false, is_broadcast = false, is_recover_keep_current = true, delay = 1, is_set_follow_pos =false, follow_pos = {x=0,y=0,z=0}, is_force_walk =true, is_change_play_mode = true, screen_x = 0, screen_y = 0, is_set_screenXY = false, other_params ={}, keep_rot_type = KeepRotType.KEEP_ROT_XY, custom_radius = 0})
end
end
end
else
ScriptLib.PrintContextLog(context,"## Rogue_Cell action_EVENT_ENTER_REGION[Warning]:#_vec="..#_vec)
end
--通知下一个房间可以被Inited
for k , v in pairs(t3_next_group) do
if k == base_info.group_id then
ScriptLib.SetGroupVariableValueByGroup(context,"Can_Be_Inited",1,v)
end
end
return 0
end
--[[
function action_t3_EVENT_CHALLENGE_SUCCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_CHALLENGE_SUCCESS:")
return 0
end
function action_t3_EVENT_ROGUE_START_FIGHT(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ROGUE_START_FIGHT:")
return 0
end
function action_t3_EVENT_CHALLENGE_FAIL(context,evt)
return 0
end
function action_t3_EVENT_GROUP_LOAD(context,evt)
return 0
end
]]
function SLC_Active_Portal(context)
ScriptLib.CreateGadget(context, { config_id = defs.Portal_Trigger })
return 0
end
--初始化
function Initialize_3()
--加触发器
if temp_Tirgger_Rogue_Terrain_3 ~= nil then
for k,v in pairs(temp_Tirgger_Rogue_Terrain_3) do
v.name = "temp_Tirgger3_"..k
v.config_id = 40300000 + k
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--加变量
if temp_Variables_Rogue_Terrain_3 ~= nil then
for k,v in pairs(temp_Variables_Rogue_Terrain_3) do
table.insert(variables,v)
end
end
--给传送门增加sgv
for k,v in pairs(gadgets) do
if v.gadget_id == 70800140 then
v.server_global_value_config = { ["SGV_Disable"] = 1}
end
end
--给钟增加sgv
for k,v in pairs(gadgets) do
if v.gadget_id == 70800163 then
v.server_global_value_config = { ["SGV_Time"] = defs.pointarray}
end
end
return 0
end
Initialize_3()

View File

@@ -0,0 +1,454 @@
--[[======================================
|| filename: || YeLan_BoxPusher
|| owner: || siyu.li
|| description: || 根据夜兰地城需求增加了路径屏蔽的功能
|| LogName: ||
|| Protection: || TimeAxisPass检测箱子到达点位
=======================================]]
--[[
设置var: level_start为1以开启推箱子流程
用var_change接source为"level_finish"即可响应箱子推完的结果
local defs = {
box_gadget_id_1 = 1, --可推箱子的gadget_id
box_gadget_id_2 = 2, --可推箱子的gadget_id
config_suites = {1} --注册逻辑的suite队列
point_array_id = 1, --点阵id
option_id = 1, --推动的option_id
reminder_level_boarder = 1,
reminder_array_boarder = 1,
reminder_box_conflict = 1,
reminder_right_pos = 1
}
--地形信息0-墙面,1-地面,2-空气墙
local level_map = {
{0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0},
{0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0},
{1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1},
{0,0,0,0,0,0,0,0,2,1,0,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,2,1,0,1,1,1,1,1,1}
}
--点阵id信息
local point_map = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 0, 9,10,11,12, 0, 0},
{13,14,15,16,17,18,19,20,21,22, 0,23, 0,24,25,26,27},
{ 0, 0, 0, 0, 0, 0, 0, 0, 2,28, 0,29,30,31,32,33,34},
{ 0, 0, 0, 0, 0, 0, 0, 0, 2,35, 0,36,37,38,39,40,41}
}
--箱子信息
local box_config = {
[1] = {config_id = 1001, pos = {x=8,z=3}},
[2] = {config_id = 1002, pos = {x=11,z=1}},
[3] = {config_id = 1003, pos = {x=12,z=2}},
[4] = {config_id = 1004, pos = {x=13,z=2}}
}
--关卡结算信息
local level_finish_config = {
box_config_id = {1,3} --box_config中序列
target_point_id = {11,22} --点阵id
}
--路径摘除信息(pont_id)
local illegal_path = {
{1,2},
{3,4}
}
--]]
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local Tri = {
{ name = "Group_Load", config_id = 8000001, event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0 },
{ name = "Gadget_Create", config_id = 8000002, event = EventType.EVENT_GADGET_CREATE, source = "", condition = "", action = "action_gadget_create", trigger_count = 0 },
{ name = "Select_Option", config_id = 8000003, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0 },
{ name = "Platform_Reach_Point", config_id = 8000004, event = EventType.EVENT_PLATFORM_REACH_POINT, source = "", condition = "", action = "action_platform_reach_point", trigger_count = 0 },
{ name = "Group_Refresh", config_id = 8000005, event = EventType.EVENT_GROUP_REFRESH, source = "", condition = "", action = "action_group_refresh", trigger_count = 0 },
--{ name = "Avatar_Near_Platform", config_id = 8000006, event = EventType.EVENT_AVATAR_NEAR_PLATFORM, source = "", condition = "", action = "action_avatar_near_platform", trigger_count = 0 }
{ name = "Time_Axis_Pass", config_id = 8000006, event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_time_axis_pass", trigger_count = 0 },
{ name = "Level_Start", config_id = 8000007, event = EventType.EVENT_VARIABLE_CHANGE, source = "level_start", condition = "", action = "action_level_start", trigger_count = 0 },
}
--[[local Var = {
{ name = "level_start", value = 0 }
}
--]]
function Initialize()
--[[ for i,v in ipairs(Var) do
table.insert(variables, v)
end--]]
--ScriptLib.PrintLog("## YeLan_BoxPusher_Initialize 1")
for i,v in ipairs(Tri) do
table.insert(triggers, v)
for m,n in ipairs(defs.config_suites) do
--ScriptLib.PrintLog("## YeLan_BoxPusher_Initialize 2")
table.insert(suites[n].triggers, v.name)
end
end
end
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function LF_Notify(context, r_id)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Notify | reminder_id="..r_id)
ScriptLib.ShowReminder(context, r_id)
end
--初始化所有box的位置
function LF_Init_Level(context)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Init_Level")
ScriptLib.SetGroupTempValue(context, "next_point_x", 0, {})
ScriptLib.SetGroupTempValue(context, "next_point_z", 0, {})
for i,v in ipairs(box_config) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v.config_id)
local _ret,R_pos,R_rot = ScriptLib.GetPlatformArrayInfoByPointId(context, defs.point_array_id, point_map[v.pos.z][v.pos.x])
local _pos = {x=R_pos.x,y=R_pos.y,z=R_pos.z}
local _rot = {x=0,y=0,z=0}
ScriptLib.CreateGadgetByConfigIdByPos(context, v.config_id, _pos, _rot)
ScriptLib.SetPlatformPointArray(context, v.config_id, defs.point_array_id, {point_map[v.pos.z][v.pos.x]}, {})
ScriptLib.SetGroupTempValue(context, "box_pos_x_"..i, v.pos.x, {})
ScriptLib.SetGroupTempValue(context, "box_pos_z_"..i, v.pos.z, {})
end
end
function LF_Get_Entity_Pos(context, uid, cid)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Get_Entity_Pos")
local _eid = 0
--转译entityId
if uid ~= 0 then
_eid = ScriptLib.GetAvatarEntityIdByUid(context, uid)
elseif cid ~= 0 then
_eid = ScriptLib.GetEntityIdByConfigId(context, cid)
end
--返回安全值,印象中直接返回_array时table里不干净
local _array = ScriptLib.GetPosByEntityId(context, _eid)
local _res = {}
if _array.x == 0 and _array.y == 0 and _array.z == 0 then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : Get Pos Fail !!! | uid="..uid.." | cid="..cid)
_res.error = 1
return _res
end
_res.x = _array.x
_res.y = _array.y
_res.z = _array.z
return _res
end
function LF_Get_Push_Direction(context, avatar, target)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Get_Push_Direction")
local _direction = {x=0,y=0,z=0}
_direction.x = target.x - avatar.x
_direction.y = target.y - avatar.y
_direction.z = target.z - avatar.z
local _direct = ""
local _angle = 0
--世界坐标系正X为up,正Z为left
if _direction.x == 0 then
if _direction.z >= 0 then
_direct = "left"
else _direct = "right"
end
else
_angle = math.deg(math.atan(_direction.z/_direction.x))
if math.abs(_angle) <= 45 then
if _direction.x > 0 then
_direct = "up"
else _direct = "down"
end
else
if _direction.z > 0 then
_direct = "left"
else _direct = "right"
end
end
end
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Get_Entity_Pos | _direct = ".._direct)
return _direct
end
function LF_Try_Push_Box(context, config_id, direction)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Try_Push_Box | config_id = "..config_id.." | direction = "..direction)
local _box = ScriptLib.GetPlatformPointArray(context, config_id)
local _box_point = _box[2]
local _is_found = false
--以i,j获取当前的坐标
for _j,_list in ipairs(point_map) do
if _is_found == true then
break
end
for _i,point in ipairs(_list) do
if point == _box_point then
--检测地图连通性
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Try_Push_Box | Point_Map_Pos | x=".._i.." | z=".._j)
local _connection = LF_Check_Target_Position(context, _i, _j, direction)
if #_connection == 2 then
--执行箱子移动
LF_Execute_Box_Move(context, config_id, {_i,_j}, _connection)
end
_is_found = true
break
end
end
end
end
function LF_Check_Target_Position(context, x, z, forward)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Check_Target_Position | x="..x.."|z="..z.."|forward="..forward)
local res = {}
local _x = x
local _z = z
local _forward = forward
--由于关卡方向与地图方向可能不一致,需要额外做一次旋转
--[[if forward == "up" then _forward = "left"
elseif forward == "left" then _forward = "down"
elseif forward == "down" then _forward = "right"
else _forward = "up"
end--]]
if _forward == "up" then
_z = _z - 1
elseif _forward == "down" then
_z = _z + 1
elseif _forward == "right" then
_x = _x + 1
elseif _forward == "left" then
_x = _x - 1
else
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : Invalid Box Direction !!! | forward=".._forward)
return res
end
--判地图边界
if _x < 1 or _x > #level_map[z] or _z < 1 or _z > #level_map then
LF_Notify(context, defs.reminder_level_boarder)
return res
end
--判路点边界
if point_map[_z][_x] == 0 then
LF_Notify(context, defs.reminder_array_boarder)
return res
end
--判路径连通
if illegal_path ~= nil then
local value1 = point_map[z][x]
local value2 = point_map[_z][_x]
for idx,array in ipairs(illegal_path) do
if math.max(value1, value2) == math.max(array[1], array[2]) and math.min(value1, value2) == math.min(array[1], array[2]) then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : Route is Illegal !!".." idx="..idx)
LF_Notify(context, defs.reminder_array_boarder)
return res
end
end
end
--判有无箱子
for _box,_pos in ipairs(box_config) do
if ScriptLib.GetGroupTempValue(context, "box_pos_x_".._box, {}) == _x and ScriptLib.GetGroupTempValue(context, "box_pos_z_".._box, {}) == _z then
LF_Notify(context, defs.reminder_box_conflict)
return res
end
end
res[1] = _x
res[2] = _z
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Check_Target_Position |_x=".._x.."|_z=".._z)
return res
end
function LF_Execute_Box_Move(context, config_id, source, vector)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Execute_Box_Move | config_id="..config_id)
--下option锁推箱子操作
LF_Lock_Operation(context, true)
--ScriptLib.SetGroupGadgetStateByConfigId(context, 0, config_id, 201)
ScriptLib.SetGroupTempValue(context, "next_point_x", vector[1], {})
ScriptLib.SetGroupTempValue(context, "next_point_z", vector[2], {})
ScriptLib.SetPlatformPointArray(context, config_id, defs.point_array_id, {point_map[source[2]][source[1]] ,point_map[vector[2]][vector[1]]}, {})
--增加一个时间轴保底
ScriptLib.InitTimeAxis(context, tostring(config_id), {4}, true)
end
function LF_Lock_Operation(context, is_locked)
if is_locked == true then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Lock_Operation | is_locked = true")
for i,v in ipairs(box_config) do
ScriptLib.DelWorktopOptionByGroupId(context, 0, v.config_id, defs.option_id)
end
elseif is_locked == false then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Lock_Operation | is_locked = false")
for id,box in ipairs(box_config) do
ScriptLib.SetWorktopOptionsByGroupId(context, 0, box.config_id, {defs.option_id})
--停止时间轴
ScriptLib.EndTimeAxis(context, tostring(box.config_id))
--清空目标点cache
ScriptLib.SetGroupTempValue(context, "next_point_x", 0, {})
ScriptLib.SetGroupTempValue(context, "next_point_z", 0, {})
end
end
end
--处理正确终点的箱子表现
function LF_Check_Is_Correct_Target_Point(context, box_id, x, z)
if level_finish_config.box_config_id == nil or level_finish_config.target_point_id == nil then
return false
end
for i,v in ipairs(level_finish_config.box_config_id) do
if v == box_id then
local x_ = ScriptLib.GetGroupTempValue(context, "box_pos_x_"..v, {})
local z_ = ScriptLib.GetGroupTempValue(context, "box_pos_z_"..v, {})
local is_pos_correct = false
for m,n in ipairs(level_finish_config.target_point_id) do
--对应箱子推到了正确的point决定state
if point_map[z_][x_] == n then
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, box_config[box_id].config_id, 202)
LF_Notify(context, defs.reminder_right_pos)
is_pos_correct = true
end
end
if is_pos_correct == false then
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, box_config[box_id].config_id, 201)
end
end
end
return true
end
function LF_Check_Is_Level_Finish(context)
if level_finish_config.box_config_id == nil or level_finish_config.target_point_id == nil then
return false
end
--判断是否所有箱子都在正确的点
for i,v in ipairs(level_finish_config.box_config_id) do
local x_ = ScriptLib.GetGroupTempValue(context, "box_pos_x_"..v, {})
local z_ = ScriptLib.GetGroupTempValue(context, "box_pos_z_"..v, {})
local is_right_pos = false
for m,n in ipairs(level_finish_config.target_point_id) do
if point_map[z_][x_] == n then
is_right_pos = true
end
end
if is_right_pos == false then
return false
end
end
--没有中断则所有点位都正确,完成关卡
LF_Level_Finish(context)
return true
end
function LF_Level_Finish(context)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Level_Finish")
--[[if init_config.end_suite ~= 0 then
ScriptLib.GoToGroupSuite(context, 0, init_config.end_suite)
end--]]
ScriptLib.SetGroupTempValue(context, "level_finish", 1, {})
end
--=====================================
function action_group_load(context, evt)
--local cur_suite = ScriptLib.GetGroupSuite(context, 0)
--if cur_suite ~= init_config.end_suite then
LF_Init_Level(context)
--end
return 0
end
function action_group_refresh(context, evt)
--local cur_suite = ScriptLib.GetGroupSuite(context, 0)
--if cur_suite ~= init_config.end_suite then
LF_Init_Level(context)
--end
return 0
end
function action_gadget_create(context, evt)
if ScriptLib.GetGroupVariableValue(context, "level_start") ~= 1 then
return -1
end
if gadgets[evt.param1].gadget_id == defs.box_gadget_id_1 or gadgets[evt.param1].gadget_id == defs.box_gadget_id_2 then
ScriptLib.SetWorktopOptionsByGroupId(context, 0, evt.param1, {defs.option_id})
return 0
end
return -1
end
function action_level_start(context, evt)
if evt.param1 == 1 then
for i,v in ipairs(box_config) do
ScriptLib.SetWorktopOptionsByGroupId(context, 0, v.config_id, {defs.option_id})
ScriptLib.SetGadgetStateByConfigId(context, v.config_id,201)
end
end
return 0
end
function action_select_option(context, evt)
if evt.param2 ~= defs.option_id then
return -1
end
--获取玩家位置与箱子位置
local _avatar_pos = LF_Get_Entity_Pos(context, context.uid, 0)
local _box_pos = LF_Get_Entity_Pos(context, 0, evt.param1)
if _avatar_pos.error == 1 or _box_pos.error == 1 then
ScriptLib.PrintContextLog(context, "YeLan_BoxPusher : Invalid entity pos !!!!")
return -1
end
--计算推动方向
local _dir = LF_Get_Push_Direction(context, _avatar_pos, _box_pos)
LF_Try_Push_Box(context, evt.param1, _dir)
return 0
end
function action_platform_reach_point(context, evt)
--记录下个理论点位
local _x = ScriptLib.GetGroupTempValue(context, "next_point_x", {})
local _z = ScriptLib.GetGroupTempValue(context, "next_point_z", {})
if _x == 0 or _z == 0 then
return -1
end
if point_map[_z][_x] == evt.param3 then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : reach point ".._x.."|".._z)
for idx,box in ipairs(box_config) do
if box.config_id == evt.param1 then
ScriptLib.SetGroupTempValue(context, "box_pos_x_"..idx, _x, {})
ScriptLib.SetGroupTempValue(context, "box_pos_z_"..idx, _z, {})
--ScriptLib.SetGroupGadgetStateByConfigId(context, 0, evt.param1, 0)
LF_Lock_Operation(context, false)
--检测箱子抵达正确位置
LF_Check_Is_Correct_Target_Point(context, idx, _x, _z)
--检测关卡是否完成
LF_Check_Is_Level_Finish(context)
return 0
end
end
end
return -1
end
function action_time_axis_pass(context, evt)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : TimeAxisPass -> "..evt.source_name)
--[[if ScriptLib.GetGadgetStateByConfigId(context, 0, tonumber(evt.source_name)) ~= 201 then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : T.A.P fail by state")
return -1
end--]]
local _x = 0
local _z = 0
for m,n in ipairs(box_config) do
if tostring(n.config_id) == evt.source_name then
_x = ScriptLib.GetGroupTempValue(context, "box_pos_x_"..m, {})
_z = ScriptLib.GetGroupTempValue(context, "box_pos_z_"..m, {})
break
end
end
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : Get Box Protected")
local _ret,R_pos,R_rot = ScriptLib.GetPlatformArrayInfoByPointId(context, defs.point_array_id, point_map[_z][_x])
local _eid = ScriptLib.GetEntityIdByConfigId(context, tonumber(evt.source_name))
local _pos = ScriptLib.GetPosByEntityId(context, _eid)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : Get Box Real Pos | ".._pos.x.." | ".._pos.z)
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : Get Box Theory Pos | "..R_pos.x.." | "..R_pos.z)
if math.ceil(_pos.x) ~= math.ceil(R_pos.x) or math.ceil(_pos.z) ~= math.ceil(R_pos.z) then
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : T.A.P fail by pos")
return -1
end
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : T.A.P success")
LF_Lock_Operation(context, false)
return 0
end
Initialize()

View File

@@ -0,0 +1,349 @@
--[[======================================
|| filename: rogue_rotate_whitebox
|| owner: juntao.chen
|| description: 旋转地城白盒用re(和谐)quire
|| LogName: rogue_rotate_whitebox
|| Protection: [Protection]
=======================================]]
--[[
该require只用来接收variable"Turn"=1、2、3、4消息并修改core_config_id的state、通知city旋转
旋转完毕后会发出variable"Turn"=0的消息
【物件旋转&状态记录实现方式】
prefab
由三层节点组成分别为1号轴、2号轴、3号轴。1号轴只会转动rotation.x、2号轴只会转动rotation.y、三号轴只会转动rotaion.z
这些轴的相对位置并不是固定的高层级会影响低层级。所以要用tempvalue来记录轴在哪
SceneObj_Level_Common_Property_Prop_C2_RotateCore_01
>Anchor_X
>Anchor_Y
>Anchor_Z
>Cube
JSON层
物件的state由一个三位数组成,数字从左到右分别代表三层节点的rotaion。
每个数字只能是0、1、2、3分别代表rotation=0、90、180、270。
以上对应关系配置在JSON中的"turnStateMap"中。
lua层
有三个tempvalueAxis_1~3分别代表1~3号轴在哪个面。
tempvalue值枚举
1 北
2 顶
3 西
-1 南
-2 底
-3 东
当玩家尝试使房间向[东、南、西、北]滚动时调用不同的LF_Turn
]]
local rogue_rotate_whitebox = {
core_config_id = {4009,4012},
Other_Axis_List={ --该列表用于查询沿某面旋转时,转动的另外四个面分别是什么
{2,3,-2,-3,}, --正向转动1面(北面)时,周边四个面顺序
{3,1,-3,-1,}, --正向转动2面(顶面)时,周边四个面顺序
{1,2,-1,-2,}, --正向转动3面(西面)时,周边四个面顺序
},
}
local temp_Variables_Turn = {
{ config_id=50000001,name = "Turn", value = 0, no_refresh = false },
{ config_id=50000002,name = "Clear", value = 0, no_refresh = false },
{ config_id=50000003,name = "Current_Room", value = 0, no_refresh = false },
}
local temp_Tirgger_Turn = {
{event = EventType.EVENT_VARIABLE_CHANGE, source = "Turn", condition = "", action = "action_EVENT_VARIABLE_CHANGE_Turn",trigger_count = 0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "Clear", condition = "", action = "action_EVENT_VARIABLE_CHANGE_Clear",trigger_count = 0},
{event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_EVENT_VARIABLE_CHANGE_Debug",trigger_count = 0},
{event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_Turn",trigger_count = 0},
{event = EventType.EVENT_TIME_AXIS_PASS, source = "TurnEnd", condition = "", action = "action_EVENT_TIME_AXIS_PASS_TurnEnd",trigger_count = 0},
}
--清除localgadget
function action_EVENT_VARIABLE_CHANGE_Clear(context,evt)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox action_EVENT_VARIABLE_CHANGE_Clear:".."func")
local _uid = ScriptLib.GetSceneUidList(context)[1]
ScriptLib.SetTeamEntityGlobalFloatValue(context,{_uid}, "GV_Clear_Gadget", 1)
return 0
end
function LF_Clear(context)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Clear:".."func")
local _uid = ScriptLib.GetSceneUidList(context)[1]
ScriptLib.SetTeamEntityGlobalFloatValue(context, {_uid}, "GV_Clear_Gadget", 1)
return 0
end
function action_EVENT_VARIABLE_CHANGE_Debug(context,evt)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox 变量变化|"..evt.source_name..":" .. evt.param2 .." > " .. evt.param1)
return 0
end
function action_EVENT_GROUP_LOAD_Turn(context,evt)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox action_EVENT_GROUP_LOAD:".."func")
--各轴物件的三个轴的默认位置。
for i = 1 , #rogue_rotate_whitebox.core_config_id do
ScriptLib.SetGroupTempValue(context,"Axis_"..i.."_1",1,{})
ScriptLib.SetGroupTempValue(context,"Axis_"..i.."_2",2,{})
ScriptLib.SetGroupTempValue(context,"Axis_"..i.."_3",3,{})
ScriptLib.SetGroupTempValue(context,"SGV_Turn_".. i,0,{})
end
--当前房间是
ScriptLib.SetGroupVariableValue(context,"Current_Room",-2)
--四周房间是
ScriptLib.SetGroupTempValue(context,"Room_W",3,{})
ScriptLib.SetGroupTempValue(context,"Room_N",1,{})
return 0
end
function action_EVENT_VARIABLE_CHANGE_Turn(context,evt)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox action_EVENT_VARIABLE_CHANGE:".."evt.source_name="..evt.source_name .. ", evt.param1 = ".. evt.param1)
if evt.source_name == "Turn" then --玩家尝试向某方向滚动轴物件。由group逻辑修改。LD发起
ScriptLib.SetEntityServerGlobalValueByConfigId(context, rogue_rotate_whitebox.core_config_id[1], "SGV_Avatar_Transfer", evt.param1)
if evt.param1 == 1 then --东
LF_Turn(context, 1, -1,1)
elseif evt.param1 == 2 then --南
LF_Turn(context, 3, 1,1)
elseif evt.param1 == 3 then --西
LF_Turn(context, 1, 1,1)
elseif evt.param1 == 4 then --北
LF_Turn(context, 3, -1,1)
end
end
return 0
end
--[[执行旋转(参数含义:
Axis:绕着哪个面转动,详见上文关键字[tempvalue值枚举]
direction:1为顺时针-1为逆时针(其实就是使rotaion+90还是-90)
core_id:转哪个物件
比如尝试向东滚动,即绕着北面逆时针转动,调用方式:LF_Turn(context, 1, -1)
]]
function LF_Turn(context, Axis, direction,core_id)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."Axis="..Axis..", direction"..direction..", core_id"..core_id)
--物件当前state
local _cur_state = ScriptLib.GetGroupTempValue(context,"SGV_Turn_"..core_id,{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_cur_state=".._cur_state)
--查找123号轴哪个在这个面上或反面所以判断绝对值
local _axis = 0
local _axis_value = 0
for i = 3 , 1 , -1 do
--此处为3、2、1的查找优先级13号轴都能转的情况下优先转3号轴。
--因为13轴在同一面的时候转3轴可能导致Y轴走到上面导致南北向无轴可用。由于prefab的层级关系3号轴转动不影响12号轴优先转3
local __v = ScriptLib.GetGroupTempValue(context,"Axis_"..core_id.."_" ..i,{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."Axis_"..core_id.."_" ..i..".".."__v="..__v)
if Axis == math.abs(__v) then
_axis = i --确定转动该轴
_axis_value = __v --该轴所在面
break
end
end
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_axis=".._axis)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_axis_value=".._axis_value)
local _axis_value_abs = math.abs(_axis_value)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_axis_value_abs=".._axis_value_abs)
--转动方向(需要获取一遍轴的正负值,因为轴有可能在反面,此时转动方向就取反)
local _dir = direction * _axis_value / _axis_value_abs
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_dir=".._dir)
--state原值补零(强行3位数,用于后续拼接)
local _str = string.format("%03d",_cur_state)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_str=".._str)
--截取目标位代表要被修改rotation的轴
local _num = string.sub(_str,_axis,_axis)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_num=".._num)
--转换,算出新数字(根据转动方向要么+1要么-1,0123循环
_num = LF_Find_Next_Value_In_List(context,{"0","1","2","3"},_num,_dir)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_num=".._num)
--替换旧数字
local _result = ""
for i = 1 ,3 do
if _axis == i then
_result = _result .. _num--如果是目标位,拼接上新数字
else
_result = _result .. string.sub(_str,i,i)--如果不是目标位,拼接原有数字
end
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."coreid="..core_id.." | ".."_result=".._result)
end
--ScriptLib.SetGadgetStateByConfigId(context,rogue_rotate_whitebox.core_config_id,tonumber(_result))
--判断其他轴是否要随着这次转动而变化。
LF_Change_The_Other_Axis(context,_axis,_axis_value,direction,core_id)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."ChangeToTargetLevelTag param="..core_id .. "00" .. _result)
ScriptLib.ChangeToTargetLevelTag(context, tonumber(core_id .. "00" .. _result))
if core_id == 1 then
--转动外层
local _other_core_dir = direction * -1
LF_Turn(context, Axis, _other_core_dir,2)
--拉镜头
local _uid = ScriptLib.GetSceneUidList(context)[1]
ScriptLib.SetTeamEntityGlobalFloatValue(context, {_uid}, "GV_Camera_Distance", 1)
--切leveltag
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Turn:".."切leveltag ".."_result=".._result)
--计算下一个房间
LF_Get_Next_Room(context,Axis,direction)
end
--切state
ScriptLib.SetEntityServerGlobalValueByConfigId(context, rogue_rotate_whitebox.core_config_id[core_id], "SGV_Turn", tonumber(_result))
ScriptLib.SetGroupTempValue(context,"SGV_Turn_".. core_id,tonumber(_result),{})
--保底计时器
ScriptLib.InitTimeAxis(context, "TurnEnd", {7}, false)
return 0
end
--计算出下一个房间是啥
function LF_Get_Next_Room(context,Axis,direction)
--只要知道共点的三个面是什么房间,就能确定六面,所以要存取当前房间、北边房间、西边房间
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Get_Next_Room:".."func")
local _cur = ScriptLib.GetGroupVariableValue(context,"Current_Room")
local _w = ScriptLib.GetGroupTempValue(context,"Room_W",{})
local _n = ScriptLib.GetGroupTempValue(context,"Room_N",{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Get_Next_Room:".."_cur=".._cur .."|_w=".._w.."|_n=".._n)
if Axis == 1 then
--N不动W和cur根据direction动
_result = LF_Find_Next_Value_In_List(context,rogue_rotate_whitebox.Other_Axis_List[math.abs(_n)],_cur,direction*math.abs(_n)/_n*(-1))
ScriptLib.SetGroupTempValue(context,"nextroom", _result,{})
if direction == 1 then
ScriptLib.SetGroupTempValue(context,"Room_W", _cur * (-1) ,{})
else
ScriptLib.SetGroupTempValue(context,"Room_W", _cur,{})
end
elseif Axis == 3 then
--W不动N和cur根据direction动
_result = LF_Find_Next_Value_In_List(context,rogue_rotate_whitebox.Other_Axis_List[math.abs(_w)],_cur,direction*math.abs(_w)/_w*-1)
ScriptLib.SetGroupTempValue(context,"nextroom", _result,{})
if direction == 1 then
ScriptLib.SetGroupTempValue(context,"Room_N", _cur ,{})
else
ScriptLib.SetGroupTempValue(context,"Room_N", _cur * (-1) ,{})
end
end
return 0
end
--高层级的轴会影响低层级的轴转1号轴影响23转2号轴影响3转3号轴会直接走到return
function LF_Change_The_Other_Axis(context,Rotated_Axis,Rotated_Axis_Value,direction,core_id)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_The_Other_Axis:".."Rotated_Axis="..Rotated_Axis..", Rotated_Axis_Value="..Rotated_Axis_Value..", coreid="..core_id)
for i = Rotated_Axis + 1,3 do
--遍历低层级的轴
local list = rogue_rotate_whitebox.Other_Axis_List[math.abs(Rotated_Axis_Value)]
local _other_axis_value = ScriptLib.GetGroupTempValue(context,"Axis_"..core_id.."_" ..i,{})
local _next_value = LF_Find_Next_Value_In_List(context,list,_other_axis_value,direction)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_The_Other_Axis:settemp - ".."Axis_"..core_id.."_" ..i.."=".._next_value)
if _next_value ~= nil then
--nil的情况代表3号轴不在1号轴的周边四面此时3号轴也不会变化。正常不会出现nil因为13轴共线的时候优先转3
ScriptLib.SetGroupTempValue(context,"Axis_"..core_id.."_" .. i, _next_value , {})
else
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_The_Other_Axis:[Warning]_next_value=nil!!!")
end
end
--log
local _v1 = ScriptLib.GetGroupTempValue(context,"Axis_"..core_id.."_1",{})
local _v2 = ScriptLib.GetGroupTempValue(context,"Axis_"..core_id.."_2",{})
local _v3 = ScriptLib.GetGroupTempValue(context,"Axis_"..core_id.."_3",{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_The_Other_Axis:result core_id="..core_id.."|v1=".._v1.."|v2=".._v2.."|v3=".._v3)
--[[ local _axis_value = ScriptLib.GetGroupTempValue(context,Rotated_Axis,{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_The_Other_Axis:".."_axis_value=".._axis_value)
local _other_axis_value = ScriptLib.GetGroupTempValue(context,_other_axis,{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_The_Other_Axis:".."_other_axis_value=".._other_axis_value)
--按照x、y、z的顺序沿前面轴旋转时会影响后面但后面轴不影响前面。
if math.abs(_axis_value) > math.abs(_other_axis_value) then
function LF_Change_Axis(context,Rotated_Axis,_other_axis,direction)
end ]]
return 0
end
--[[ --根据Rotated_Axis_Value、direction修改Other_Axis的轴
function LF_Change_Axis(context,Rotated_Axis_Value,Other_Axis,direction)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_Axis:Rotated_Axis_Value="..Rotated_Axis_Value..", Other_Axis="..Other_Axis..", direction"..direction)
--查[Other_Axis_List]得出新轴
local _Other_Axis_Old_Value = ScriptLib.GetGroupTempValue(context,Other_Axis,{})
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_Axis:_Other_Axis_Old_Value=".._Other_Axis_Old_Value)
local _TargetList =rogue_rotate_whitebox.Other_Axis_List[math.abs(Rotated_Axis_Value)]
local _TargetAxis_New_Value
for i = 1 , #_TargetList do
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_Axis:_TargetList[i]=".._TargetList[i])
if _TargetList[i] == _Other_Axis_Old_Value then
_TargetAxis_New_Value = LF_Find_Next_Value_In_List(context,_TargetList,i,direction)
break
end
end
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Change_Axis:_TargetAxis_New_Value=".._TargetAxis_New_Value)
--赋值
ScriptLib.SetGroupTempValue(context,Other_Axis,_TargetAxis_New_Value,{})
end ]]
--沿着list找上一个或下一个(首尾循环)
function LF_Find_Next_Value_In_List(context,list,v,direction)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox LF_Find_Next_Value_In_List:"..", v="..v..", direction"..direction)
local origin_key = 0
for i = 1 ,#list do
if list[i] == v then
origin_key = i
break
end
end
if origin_key == 0 then
return nil
else
if origin_key + direction == 0 then
target_key = #list
elseif origin_key + direction == #list +1 then
target_key = 1
else
target_key = origin_key + direction
end
return list[target_key]
end
end
function SLC_StageReady_Quest(context)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox SLC_StageReady_Quest:")
ScriptLib.AssignPlayerShowTemplateReminder(context,177,{param_uid_vec={},param_vec={},uid_vec={context.uid}})
return 0
end
function SLC_Reset_SGV(context)
if ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id}) ~= rogue_rotate_whitebox.core_config_id[1] then return 0 end
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox SLC_Reset_SGV:")
--查找当前玩家站的面是哪个,传值给"Current_Room",
--[[
1 北
2 顶
3 西
-1 南
-2 底
-3 东
]]
local _cur_bottom_room = ScriptLib.GetGroupTempValue(context,"nextroom",{})
ScriptLib.SetGroupVariableValue(context, "Current_Room", _cur_bottom_room)
ScriptLib.SetGroupVariableValue(context, "Turn", 0)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, rogue_rotate_whitebox.core_config_id[1], "SGV_Avatar_Transfer", 0)
return 0
end
function action_EVENT_TIME_AXIS_PASS_TurnEnd(context,evt)
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox action_EVENT_TIME_AXIS_PASS_TurnEnd:")
if ScriptLib.GetGroupVariableValue(context,"Turn") ~=0 then
ScriptLib.PrintContextLog(context,"## rogue_rotate_whitebox action_EVENT_TIME_AXIS_PASS_TurnEnd: 触发保底 Turn变量在7秒后还未归0!!!请检查SLC是否调用成功")
local _cur_bottom_room = ScriptLib.GetGroupTempValue(context,"nextroom",{})
ScriptLib.SetGroupVariableValue(context, "Current_Room", _cur_bottom_room)
ScriptLib.SetGroupVariableValue(context, "Turn", 0)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, rogue_rotate_whitebox.core_config_id[1], "SGV_Avatar_Transfer", 0)
end
return 0
end
--[[
--游戏总时间到,执行:
function action_EVENT_TIME_AXIS_PASS_game(context,evt)
ScriptLib.PrintContextLog(context,"## HM_FindTubby action_EVENT_TIME_AXIS_PASS_game:".."func")
LF_Stage_End(context,3)
return 0
end
]]
--初始化
function Initialize()
--加触发器
for k,v in pairs(temp_Tirgger_Turn) do
v.name = "temp_Tirgger_Turn_"..k
v.config_id = 40000000 + k
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
--加变量
for k,v in pairs(temp_Variables_Turn) do
table.insert(variables,v)
end
return 0
end
Initialize()