添加配置表

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,49 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || DarkPressure 黑夜压力分区
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 用于向服务器发送当前玩家缩在的黑夜压力区域
|| LogName || /
|| Protection || /
=====================================================================================================================
=======================================================================================]]
--local DarkLevel = 0
local extrTriggers = {
initialtrigger = {
["In_Region"] = { config_id = 80000001, name = "In_Region", event= EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_PlayerInRegion", trigger_count = 0, forbid_guest = false },
}
}
function action_PlayerInRegion( context,evt )
if evt.param1 ~= regionID then
return 0
end
--根据LD在group中填写的数值设置当前区域等级
ScriptLib.PrintContextLog(context, "## DK_LOG : Set SetDarkPressureLevel To "..DarkLevel)
ScriptLib.SetDarkPressureLevel(context, DarkLevel)
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,39 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
function SLC_DarkStair_SetState( context )
ScriptLib.PrintContextLog(context, "## DS_LOG : ServerLuaCall Start2222")
ScriptLib.PrintContextLog(context, "## DS_LOG : target_eid = "..context.target_entity_id)
local configID = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.target_entity_id })
ScriptLib.PrintContextLog(context, "## DS_LOG : configID = "..configID)
local curState = ScriptLib.GetGadgetStateByConfigId(context, 0, configID)
ScriptLib.PrintContextLog(context, "## DS_LOG : curState = "..curState)
local curIndex = 1
for i,v in ipairs(stair_mode[configID]) do
if v==curState then
curIndex = i
break
end
end
ScriptLib.PrintContextLog(context, "## DS_LOG : curIndex = "..curIndex)
if curIndex + 1 <= #stair_mode[configID] then
curIndex = curIndex + 1
else
curIndex = 1
end
ScriptLib.PrintContextLog(context, "## DS_LOG : nextIndex = "..curIndex.." state = "..stair_mode[configID][curIndex])
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, configID, stair_mode[configID][curIndex])
return 0
end

View File

@@ -0,0 +1,492 @@
--2.5换人挑战玩法
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--miscs配置内容
--[[
击杀数量,每击杀一定数量的怪物,换一个刷怪池子,到最后一个池子时无限刷怪
没有精英怪
一关内最多5个池子难度会逐渐提升一关定时4分钟
普通玩家可能只能刷到池子3能拿到所有奖励头部玩家能刷到池子5后面的2个池子就是用于给头部玩家进行
--fever进度升级节点
local fever_progress_table = {
0,40,120,270,570,800
}
--各等级fever的下降速率
local fever_attenuation = {
-1,-1,-2,-2,-3
}
--地城对应的天气配置
local DungeonWeather = {
10039,10040,10041,10042
}
--怪物潮
local monster_tide = {
[1] = {2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2048,2049,2050,2051},
[2] = {2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2052,2053,2054,2055},
[3] = {2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2056,2057,2058,2059},
[4] = {2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2056,2057,2058,2059},
[5] = {2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2056,2057,2058,2059},
}
local defs = {
group_id = 235801002,
worktop_id = 123, --操作台对应的操作数
air_wall = 2005, --场内空气墙对应的ConfigID
minion_fever = 5, --普通怪物死亡增加的热度值
game_time = 360, --挑战时间
min_monster_count = 5, --场上最少怪物数量
max_monster_count = 5, --场上最多怪物数量
environment_suite = 4, --环境灯光所在的Suite
noswitch_punishment_interval = 30, --不换人开始有惩罚的最小时间间隔
num_killed_per_tide = {20, 20, 20, 20, 0} --每组怪物潮对应需要的杀怪数量
}
--配置一个region,覆盖场内的战斗空间,用来在玩家进入时创建空气墙
]]
local local_defs = {
worktop_option = 30110,
progress_key = 1,
team_global_value = "FEVER_LEVEL",
team_noswitch_pubishment = "NOSWITCH_PUNISHMENT",
team_has_switch = "HAS_SWITCHED_TEAM",
burn_effect_level = 2,
environment_change_level = 1,
base_upgrade_reminder = 358010102,
team_noswitch_pubishment_reminder = 144,
punish_inAdvance_reminder = 201
}
local time_axis = {
--扣分时间轴,每秒掉一定的分数
fever_axis = {1},
noswitch_punishment_axis = {defs.noswitch_punishment_interval},
noswitch_punishment_inAdvance_axis = {defs.noswitch_punishment_interval-(defs.punish_inAdvance_reminder_time or 3)}
}
local Tri = {
[1] = { name = "group_load", config_id = 8000001, event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
[2] = { name = "select_option", config_id = 8000002, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0},
[3] = { name = "time_axis_pass", config_id = 8000003, event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_time_axis_pass", trigger_count = 0},
[4] = { name = "gallery_progress_pass", config_id = 8000004, event = EventType.EVENT_GALLERY_PROGRESS_PASS, source = "", condition = "", action = "action_gallery_progress_pass", trigger_count = 0},
[5] = { name = "monster_tide_die", config_id = 8000005, event = EventType.EVENT_MONSTER_TIDE_DIE, source = "", condition = "", action = "action_monster_tide_die", trigger_count = 0},
[6] = { name = "monster_die_before_leave_scene", config_id = 8000006, event = EventType.EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE, source = "", condition = "", action = "action_monster_die_before_leave_scene", trigger_count = 0},
[7] = { name = "gallery_stop", config_id = 8000007, event = EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_gallery_stop", trigger_count = 0},
[8] = { name = "sumo_switch_team", config_id = 8000008, event = EventType.EVENT_SUMO_SWITCH_TEAM_EVENT, source = "", condition = "", action = "action_sumo_switch_team", trigger_count = 0},
[9] = { name = "dungeon_all_avatar_die", config_id = 8000009, event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_dungeon_all_avatar_die", trigger_count = 0},
[10] = { name = "dungeon_settle", config_id = 8000010, event = EventType.EVENT_DUNGEON_SETTLE, source = "", condition = "", action = "action_dungeon_settle", trigger_count = 0},
[11] = { name = "enter_start_region", config_id = 8000011, event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_start_region", trigger_count = 0},
}
function Initialize()
for k,v in pairs(Tri) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
for config_id,infos in pairs(monsters) do
table.insert(infos.affix, 9009)
end
table.insert(variables,{ config_id=50000001,name = "current_monster_tide", value = 0})
table.insert(variables,{ config_id=50000002,name = "current_elite", value = 1})
table.insert(variables,{ config_id=50000003,name = "fever_ratio", value = 1})
--用于记录当前是否开启不换队惩罚,用于客户端断线重连时恢复状态
table.insert(variables,{ config_id=50000004,name = "is_noswitch_punishment", value = 0})
--用于记录当前怪物潮中的击杀数量,当击杀数量达到配置数量时,加载下一波怪物潮
table.insert(variables,{ config_id=50000005,name = "num_current_minion_killed", value = 0})
--用于记录是否已经创建空气墙,防止玩家卡在空气墙外
table.insert(variables,{ config_id=50000006,name = "is_air_wall_created", value = 0})
--用于记录当前怪物潮是否处于切换状态
table.insert(variables,{ config_id=50000007,name = "is_tide_being_switched", value = 0})
end
------------------------------------------------------------------
--group load后加载操作台选项
function action_group_load(context,evt)
ScriptLib.SetWorktopOptionsByGroupId(context, defs.group_id, defs.worktop_id, {local_defs.worktop_option})
--开场就直接加载氛围物件,不要等玩家开启挑战
--加载环境氛围物件
ScriptLib.AddExtraGroupSuite(context,defs.group_id, defs.environment_suite)
return 0
end
--按下操作台按键,启动玩法
function action_select_option(context,evt)
--如果空气墙没有提前创建,那么不会处理开始事件
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
return -1
end
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.worktop_id, local_defs.worktop_option)
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.worktop_id, GadgetState.GearStop)
LF_Start_Play(context)
return 0
end
--时间轴tick事件根据tick的时间轴不同处理不同逻辑
function action_time_axis_pass(context,evt)
--纯数量刷怪不再走刷怪Tick
--fever条tick扣分
if (evt.source_name == "FEVER_AXIS") then
LF_Update_Fever(context,LF_Get_Fever_Subnum(context))
end
--提前显示一下需要换队
if (evt.source_name == "NOSWITCH_PUNISHMENT_INADVANCE_AXIS") then
ScriptLib.ShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {defs.punish_inAdvance_reminder_time or 3})
end
--不换队tick如果长时间不换队则将设置惩罚gv
if (evt.source_name == "NOSWITCH_PUNISHMENT_AXIS") then
ScriptLib.ShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {0})
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",1)
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,1)
end
return 0
end
--fever升级时给team挂global value并激活场景氛围物件
function action_gallery_progress_pass(context,evt)
local fever_level = evt.param1
ScriptLib.PrintContextLog(context,"FS: Fever uprade to level "..fever_level)
ScriptLib.ShowReminder(context, local_defs.base_upgrade_reminder+fever_level)
LF_Set_Team_Global_Value(context,local_defs.team_global_value,fever_level)
LF_Activate_Environment_Gadget(context,fever_level)
return 0
end
function action_gallery_stop(context,evt)
LF_Stop_Play(context)
return 0
end
--当前的怪物潮刷完的时候,重置当前的怪物潮或者刷下一波怪物潮
function action_monster_tide_die(context,evt)
-- ScriptLib.PrintContextLog(context,"FS: Tide Clear"..evt.param1)
-- local is_being_switched = ScriptLib.GetGroupVariableValue(context,"is_tide_being_switched")
-- ScriptLib.PrintContextLog(context,"FS: Tide Switch"..is_being_switched)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
local current_tide_list = monster_tide[current_monster_tide]
-- ScriptLib.PrintContextLog(context,"FS: Tide Max"..(#current_tide_list))
--不在刷够怪物切换怪物潮的过程中
--如果当前怪物潮已经被杀完了
if evt.param1 >= #current_tide_list then
if defs.num_killed_per_tide[current_monster_tide] == 0 then
LF_Refresh_Monster_Tide(context,"Current")
else
LF_Refresh_Monster_Tide(context,"Next")
end
end
return 0
end
--有怪死亡时计分并更新fever条,怪物死亡只处理积分
function action_monster_die_before_leave_scene(context,evt)
local monster_eid = evt.source_eid
local monster_cid = evt.param1
local fever_ratio = ScriptLib.GetGroupVariableValue(context,"fever_ratio")
local monster_fever = monsters[monster_cid].kill_score
LF_Update_Fever(context,monster_fever*fever_ratio)
LF_Update_Score(context,monster_eid)
return 0
end
function LF_Refresh_Monster_Tide(context, refresh_mode)
local current_monster_tide_index = LF_Get_Current_Monster_Tide(context)
-- ScriptLib.KillMonsterTide(context, defs.group_id, LF_Get_Current_Tide_Num(context))
-- ScriptLib.SetGroupVariableValue(context,"is_tide_being_switched",1)
if refresh_mode == "Current" then
LF_Set_Current_Monster_Tide(context, current_monster_tide_index)
LF_Create_Monster_Tide(context,current_monster_tide_index)
ScriptLib.PrintContextLog(context,"FS: Tide Clear Refresh Current")
end
if refresh_mode == "Next" then
LF_Set_Current_Monster_Tide(context, current_monster_tide_index + 1)
LF_Create_Monster_Tide(context,current_monster_tide_index + 1)
ScriptLib.PrintContextLog(context,"FS: Tide Clear Refresh Next")
end
-- LF_Set_Current_Tide_Minion_Killed(context,0)
-- ScriptLib.SetGroupVariableValue(context,"is_tide_being_switched",0)
end
--玩家换队时触发启动一个一定时间的时间轴时间轴tick时修改global value给玩家挂debuff
function action_sumo_switch_team(context,evt)
--刚刚换队先清掉team上的换队惩罚global value并开始计时如果tick时没有换队则挂上惩罚标记gv
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,0)
ScriptLib.EndTimeAxis(context,"NOSWITCH_PUNISHMENT_AXIS")
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_AXIS",time_axis.noswitch_punishment_axis,false)
--清理换队提示
ScriptLib.EndTimeAxis(context,"NOSWITCH_PUNISHMENT_INADVANCE_AXIS")
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_INADVANCE_AXIS",time_axis.noswitch_punishment_inAdvance_axis,false)
--换队增加热情值
LF_Update_Fever(context,defs.switch_team_fever)
--换队的时候给服务端发送消息让客户端显示惩罚倒计时UI
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {})
ScriptLib.PrintContextLog(context,"FS: Clear reminder result"..ret)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
end
--玩家进入区域直接创建空气墙,防止卡延迟出圈
function action_enter_start_region(context,evt)
--加载空气墙
ScriptLib.CreateGadget(context,{config_id = defs.air_wall})
ScriptLib.SetGroupVariableValue(context,"is_air_wall_created",1)
return 0
end
--团灭触发,直接结束玩法
function action_dungeon_all_avatar_die(context,evt)
LF_Stop_Play(context)
return 0
end
function action_dungeon_settle(context,evt)
LF_Stop_Play(context)
return 0
end
------------------------------------------------------------------
--辅助方法---------------------------------------------------------
------------------------------------------------------------------
--关卡相关方法-----------------------------------------------------
--启动玩法方法,初始化各种东西
function LF_Start_Play(context)
ScriptLib.StartGallery(context, defs.gallery_id)
ScriptLib.InitGalleryProgressScore(context, "fever", defs.gallery_id, fever_progress_table, GalleryProgressScoreUIType.GALLERY_PROGRESS_SCORE_UI_TYPE_SUMO_STAGE, GalleryProgressScoreType.GALLERY_PROGRESS_SCORE_NO_DEGRADE)
ScriptLib.InitTimeAxis(context,"FEVER_AXIS",time_axis.fever_axis,true)
LF_Set_Current_Tide_Num(context,0)
LF_Set_Current_Monster_Tide(context,1)
LF_Create_Monster_Tide(context,1)
--启动玩法时给第一队挂一下gv防止一开始就受到惩罚并开启时间轴开始计时
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,0)
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_AXIS",time_axis.noswitch_punishment_axis,false)
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_INADVANCE_AXIS",time_axis.noswitch_punishment_inAdvance_axis,false)
--玩法开始的时候给服务端发送消息让客户端显示惩罚倒计时UI
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.air_wall)
--玩法结束,清理掉当前的怪物潮
ScriptLib.KillMonsterTide(context, defs.group_id, current_monster_tide)
ScriptLib.StopGallery(context, defs.gallery_id,true)
ScriptLib.EndTimeAxis(context,"FEVER_AXIS")
--关闭一下地城,以正确触发重新挑战
ScriptLib.CauseDungeonFail(context)
end
--启动一波指定ID的怪物潮需要传入该波怪物潮的ID具体配置在miscs中定义
function LF_Create_Monster_Tide(context,monster_tide_index)
ScriptLib.PrintContextLog(context,"FS: Creating monster tide ["..monster_tide_index.."]")
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
ScriptLib.AutoMonsterTide(context, tide_num+1, defs.group_id, monster_config_id_list, #monster_config_id_list, tide_suite_config[current_monster_tide].min, tide_suite_config[current_monster_tide].max)
end
--刷新指定
--通用类方法-------------------------------------------------------
--切换场上的场景氛围物件状态
function LF_Activate_Environment_Gadget(context,fever_level)
ScriptLib.PrintContextLog(context,"FS: Activate environment gadgets! Fever Level_"..fever_level)
--根据当前的fever等级改变天气
if (fever_level>local_defs.environment_change_level) then
ScriptLib.PrintContextLog(context,"FS: Changing environment weather!")
local ret = ScriptLib.SetWeatherAreaState(context, DungeonWeather[fever_level],1)
ScriptLib.PrintContextLog(context,"FS: The result of starting weather ".. DungeonWeather[fever_level].."is "..ret)
local ret = ScriptLib.EnterWeatherArea(context, DungeonWeather[fever_level])
ScriptLib.PrintContextLog(context,"FS: The result of changing weather".. DungeonWeather[fever_level].."is "..ret)
end
--切换场上所有的物件的状态
for i = 1, #suites[defs.environment_suite].gadgets do
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 101)
end
if (fever_level<#fever_progress_table-2 and fever_level>=local_defs.burn_effect_level) then
--喷大火5秒后转回小火
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
end
end
--给team挂global value角色处理各种特殊效果
function LF_Set_Team_Global_Value(context,gv_name,value)
--ScriptLib.PrintContextLog(context,"FS: Sending global values to team!")
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetTeamEntityGlobalFloatValue(context, uid_list, gv_name, value)
end
-----CRUD类方法----------------------------------------------------
--更新fever条fever_delta为fever条改变值
function LF_Update_Fever(context,fever_delta)
-- ScriptLib.PrintContextLog(context,"FS: Update Fever!")
ScriptLib.AddGalleryProgressScore(context, "fever", defs.gallery_id, fever_delta)
end
--更新积分需要传入目标monster的entity id
function LF_Update_Score(context,monster_eid)
-- ScriptLib.PrintContextLog(context,"FS: Update Score!")
local uid_list = ScriptLib.GetSceneUidList(context)
local monster_id = ScriptLib.GetMonsterIdByEntityId(context,monster_eid)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["monster_id"] = monster_id})
end
--返回当前等级下的积分衰减速率
function LF_Get_Fever_Subnum(context)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
for i = 1, #fever_progress_table-1 do
local lower_bound = fever_progress_table[i]
local higher_bound = fever_progress_table[i+1]
if fever>=lower_bound and fever<higher_bound then
return fever_attenuation[i]
end
end
return -1
end
--设置当前怪物潮的波次数注意不等于怪物潮的index。每次创建怪物潮会使波次数+1方便索引新的怪物潮
function LF_Set_Current_Tide_Num(context,value)
ScriptLib.SetGroupTempValue(context, "MinionTide", value, {})
end
--获取当前怪物潮的波次数注意不等于怪物潮的index。每次创建怪物潮会使波次数+1方便索引新的怪物潮
function LF_Get_Current_Tide_Num(context)
return ScriptLib.GetGroupTempValue(context, "MinionTide", {})
end
--设置当前怪物潮波次的index
function LF_Set_Current_Monster_Tide(context,index)
ScriptLib.SetGroupVariableValue(context,"current_monster_tide",index)
end
--获取当前怪物潮波次的index
function LF_Get_Current_Monster_Tide(context)
local monster_tide = ScriptLib.GetGroupVariableValue(context,"current_monster_tide")
return monster_tide
end
--2.5新增
--获取当前怪物潮的击杀数量
function LF_Get_Current_Tide_Minion_Killed(context)
local num_minion_killed = ScriptLib.GetGroupVariableValue(context,"num_current_minion_killed")
return num_minion_killed
end
--增加当前怪物潮的击杀数量
function LF_Add_Current_Tide_Minion_Killed(context, num)
ScriptLib.ChangeGroupVariableValue(context,"num_current_minion_killed",num)
end
--设置当前怪物潮的击杀数量
function LF_Set_Current_Tide_Minion_Killed(context, num)
ScriptLib.SetGroupVariableValue(context,"num_current_minion_killed", num)
end
--根据gadget的config_id查询gadget_id
function LF_Get_Gadget_Id_By_Config_Id(context, config_id)
return gadgets[config_id].gadget_id
end
------------------------------------------------------------------
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
end
------------------------------------------------------------------
Initialize()

View File

@@ -0,0 +1,688 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
----fever进度升级节点
--local fever_progress_table = {
-- 0,50,100,200,300,500
--}
----各等级fever的下降速率
--local fever_attenuation = {
-- -1,-2,-3,-4,-5
--}
--
--local monster_tide = {
-- [1] = {2001,2002,2003,2004,2005,2006,2007},
-- [2] = {2008,2009,2010,2011,2012,2013,2014}
--}
--
--local elite = {
-- 2015,2016,2017,2018,2019,2020,2021
--}
--local elite = {
-- [1] = {2001},
-- [2] = {2011,2012},
-- [3] = {2038,2039},
-- [4] = {2040}
--}
--
--local elite_born_points = {
-- 3001,3002,3003,3004,3005,3006,3007
--}
--defs.punish_inAdvance_reminder_time = 3
------
--local defs = {
-- group_id = 235801002,
-- worktop_id = 123,
-- minion_fever = 5,
-- game_time = 360,
-- minion_interval = 120,
-- elite_interval = 30,
-- elite_fever = 50,
-- min_monster_count = 5,
-- max_monster_count = 5,
-- environment_suite = 4,
--}
local local_defs = {
worktop_option = 30110,
progress_key = 1,
team_global_value = "FEVER_LEVEL",
team_noswitch_pubishment = "NOSWITCH_PUNISHMENT",
team_has_switch = "HAS_SWITCHED_TEAM",
burn_effect_level = 2,
environment_change_level = 1,
base_upgrade_reminder = 358010102,
team_noswitch_pubishment_reminder = 144,
punish_inAdvance_reminder = 201
}
local time_axis = {
--小怪潮替换时间轴,每次触发时替换小怪潮
minion_tide_axis = {defs.minion_tide_interval},
--精英怪潮替换时间轴,每次触发时替换精英怪潮
elite_tide_axis = {defs.elite_tide_interval},
--精英怪时间轴,每次触发时刷新一只精英怪
elite_axis = {defs.elite_interval},
--扣分时间轴,每秒掉一定的分数
fever_axis = {1},
noswitch_punishment_axis = {defs.noswitch_punishment_interval},
noswitch_punishment_inAdvance_axis = {defs.noswitch_punishment_interval-(defs.punish_inAdvance_reminder_time or 3)}
}
local Tri = {
[1] = { name = "group_load", config_id = 8000001, event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
[2] = { name = "select_option", config_id = 8000002, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0},
[3] = { name = "time_axis_pass", config_id = 8000003, event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_time_axis_pass", trigger_count = 0},
[4] = { name = "gallery_progress_pass", config_id = 8000004, event = EventType.EVENT_GALLERY_PROGRESS_PASS, source = "", condition = "", action = "action_gallery_progress_pass", trigger_count = 0},
[5] = { name = "monster_tide_die", config_id = 8000005, event = EventType.EVENT_MONSTER_TIDE_DIE, source = "", condition = "", action = "action_monster_tide_die", trigger_count = 0},
[6] = { name = "monster_die_before_leave_scene", config_id = 8000006, event = EventType.EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE, source = "", condition = "", action = "action_monster_die_before_leave_scene", trigger_count = 0},
[7] = { name = "gallery_stop", config_id = 8000007, event = EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_gallery_stop", trigger_count = 0},
[8] = { name = "sumo_switch_team", config_id = 8000008, event = EventType.EVENT_SUMO_SWITCH_TEAM_EVENT, source = "", condition = "", action = "action_sumo_switch_team", trigger_count = 0},
[9] = { name = "dungeon_all_avatar_die", config_id = 8000009, event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_dungeon_all_avatar_die", trigger_count = 0},
[10] = { name = "dungeon_settle", config_id = 8000010, event = EventType.EVENT_DUNGEON_SETTLE, source = "", condition = "", action = "action_dungeon_settle", trigger_count = 0},
[11] = { name = "enter_start_region", config_id = 8000011, event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_start_region", trigger_count = 0},
-- [12] = { name = "monster_create", config_id = 8000012, event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "", action = "action_monster_create", trigger_count = 0},
[13] = { name = "monster_tide_over", config_id = 8000013, event = EventType.EVENT_MONSTER_TIDE_OVER, source = "", condition = "", action = "action_monster_tide_over", trigger_count = 0},
}
function Initialize()
for k,v in pairs(Tri) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
for config_id,infos in pairs(monsters) do
table.insert(infos.affix, 9009)
end
table.insert(variables,{ config_id=50000001,name = "current_monster_tide", value = 0})
table.insert(variables,{ config_id=50000002,name = "current_elite", value = 1})
table.insert(variables,{ config_id=50000003,name = "fever_ratio", value = 1})
--用于记录当前是否开启不换队惩罚,用于客户端断线重连时恢复状态
table.insert(variables,{ config_id=50000004,name = "is_noswitch_punishment", value = 0})
--用于记录当前精英是否在场,精英在场时,怪物潮不做刷新
table.insert(variables,{ config_id=50000005,name = "is_elite_on_ground", value = 0})
--用于记录当前怪物潮是否结束,当精英死亡时判断当前怪物潮是否处于结束状态,如果是,则直接加载下一波怪物潮
table.insert(variables,{ config_id=50000006,name = "is_current_minion_tide_end", value = 0})
--用于记录是否已经创建空气墙,防止玩家卡在空气墙外
table.insert(variables,{ config_id=50000007,name = "is_air_wall_created", value = 0})
--用于记录场上的怪物总数,当需要切怪物潮时,需要先判断场上已经没有怪物了
table.insert(variables,{ config_id=50000008,name = "monster_count", value = 0})
--用于标记需要监听场上怪物死亡直到怪物数量为0
table.insert(variables,{ config_id=50000009,name = "last_end_tide", value = 0})
table.insert(variables,{ config_id=50000010,name = "refresh_end_tide", value = 0})
end
------------------------------------------------------------------
--group load后加载操作台选项
function action_group_load(context,evt)
ScriptLib.SetWorktopOptionsByGroupId(context, defs.group_id, defs.worktop_id, {local_defs.worktop_option})
--开场就直接加载氛围物件,不要等玩家开启挑战
--加载环境氛围物件
ScriptLib.AddExtraGroupSuite(context,defs.group_id,defs.environment_suite)
return 0
end
--按下操作台按键,启动玩法
function action_select_option(context,evt)
--如果空气墙没有提前创建,那么不会处理开始事件
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
return -1
end
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.worktop_id, local_defs.worktop_option)
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.worktop_id, GadgetState.GearStop)
LF_Start_Play(context)
return 0
end
--时间轴tick事件根据tick的时间轴不同处理不同逻辑
function action_time_axis_pass(context,evt)
--小怪时间轴tick将小怪潮的index指向下一位修改group variable
if (evt.source_name == "MINION_TIDE_AXIS") then
ScriptLib.PrintContextLog(context,"FS: MINION_TIDE_AXIS tick!")
LF_Refresh_Currtent_Monster_Tide(context)
end
--精英波次时间轴tick将精英怪的index指向下一位
if (evt.source_name == "ELITE_TIDE_AXIS") then
ScriptLib.PrintContextLog(context,"FS: ELITE_TIDE_AXIS tick!")
local current_elite_index = LF_Get_Current_Elite_Index(context)
LF_Set_Current_Elite_Index(context,current_elite_index+1)
end
--精英时间轴tick刷新下一只精英
if (evt.source_name == "ELITE_AXIS") then
ScriptLib.PrintContextLog(context,"FS: ELITE_AXIS tick!")
local current_elite_index = LF_Get_Current_Elite_Index(context)
LF_Create_Elite_Monster(context,current_elite_index)
--性能优化:刷出精英怪时,暂停怪物潮
ScriptLib.PrintContextLog(context,"FS: elite created. Stop monster tide ["..LF_Get_Current_Tide_Num(context).."]")
ScriptLib.PauseAutoMonsterTide(context, defs.group_id, LF_Get_Current_Tide_Num(context))
end
--fever条tick扣分
if (evt.source_name == "FEVER_AXIS") then
LF_Update_Fever(context,LF_Get_Fever_Subnum(context))
end
--提前显示一下需要换队
if (evt.source_name == "NOSWITCH_PUNISHMENT_INADVANCE_AXIS") then
ScriptLib.ShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {defs.punish_inAdvance_reminder_time or 3})
end
--不换队tick如果长时间不换队则将设置惩罚gv
if (evt.source_name == "NOSWITCH_PUNISHMENT_AXIS") then
--ScriptLib.PrintContextLog(context,"FS: Showing reminder "..local_defs.team_noswitch_pubishment_reminder)
ScriptLib.ShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {0})
--ScriptLib.ShowReminder(context, local_defs.team_noswitch_pubishment_reminder)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",1)
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,1)
end
return 0
end
--fever升级时给team挂global value并激活场景氛围物件
function action_gallery_progress_pass(context,evt)
local fever_level = evt.param1
ScriptLib.PrintContextLog(context,"FS: Fever uprade to level "..fever_level)
ScriptLib.ShowReminder(context, local_defs.base_upgrade_reminder+fever_level)
LF_Set_Team_Global_Value(context,local_defs.team_global_value,fever_level)
LF_Activate_Environment_Gadget(context,fever_level)
return 0
end
function action_gallery_stop(context,evt)
LF_Stop_Play(context)
return 0
end
--当前的怪物潮刷完的时候,重置当前的怪物潮,这里只处理怪物潮的怪物
function action_monster_tide_die(context,evt)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
local tide_index = tonumber(evt.source_name)
local refresh_end_tide = ScriptLib.GetGroupVariableValue(context,"refresh_end_tide")
if tide_index == refresh_end_tide then
local elite_num = ScriptLib.GetGroupVariableValue(context,"is_elite_on_ground")
local monster_count = ScriptLib.GetGroupMonsterCount(context)
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 死亡的怪物来源于刷新时手动结束的怪物潮,剩余总怪物数量"..monster_count.."精英怪"..elite_num)
if monster_count == elite_num and elite_num ~= 0 then
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 场上仅剩精英怪,标记需要在精英怪死亡时创建新的怪物潮")
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
end
if monster_count == 0 then
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 场上没有怪物了,直接创建")
LF_Create_Monster_Tide(context,current_monster_tide)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
end
return 0
end
--如果当前怪物潮已经被杀完了,且精英怪不在场
if (evt.param1 >= #monster_tide[current_monster_tide]) then
--标记非手动结束的怪物潮里的怪已经刷完了
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
local is_elite_on_ground = ScriptLib.GetGroupVariableValue(context,"is_elite_on_ground")
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 怪物潮"..tide_index.."所有怪物清空")
if (is_elite_on_ground == 0) then
--精英不在场,才能开一个新的怪物潮
ScriptLib.PrintContextLog(context,"FS: [TIDE_DIE] 场上没有精英怪,获取当前对应波次,创建怪物潮")
LF_Create_Monster_Tide(context,current_monster_tide)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
end
end
return 0
end
--记录当前结束的MonsterTideIndex
function action_monster_tide_over(context, evt)
local end_index = tonumber(evt.source_name)
if end_index ~= nil then
ScriptLib.SetGroupVariableValue(context,"last_end_tide", end_index)
ScriptLib.PrintContextLog(context,"FS:[DEBUG][TIDE_OVER] 当前怪物潮结束,波次"..end_index)
end
return 0
end
--有怪死亡时计分并更新fever条这里只处理怪物计分和精英怪阻塞
function action_monster_die_before_leave_scene(context,evt)
local monster_eid = evt.source_eid
local monster_cid = evt.param1
local is_elite = LF_Is_Elite(context,monster_cid)
local fever_ratio = ScriptLib.GetGroupVariableValue(context,"fever_ratio")
local monster_fever = monsters[monster_cid].kill_score
LF_Update_Fever(context,monster_fever*fever_ratio)
LF_Update_Score(context,monster_eid)
--死的是精英怪,看看之前有没有阻塞
if is_elite then
--精英死亡时,检测该组刷新的精英怪数量,如果全部死亡就重新开始计时
local elite_num = ScriptLib.GetGroupVariableValue(context,"is_elite_on_ground")
if elite_num > 1 then
--场上还有别的精英怪
ScriptLib.SetGroupVariableValue(context,"is_elite_on_ground",elite_num-1)
else
ScriptLib.SetGroupVariableValue(context,"is_elite_on_ground",0)
ScriptLib.EndTimeAxis(context,"ELITE_AXIS")
ScriptLib.InitTimeAxis(context,"ELITE_AXIS",time_axis.elite_axis,false)
if ScriptLib.GetGroupVariableValue(context,"is_current_minion_tide_end") == 0 then
if not LF_Is_Current_Index_End(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG][MonDie] 精英怪死亡当前怪物潮没有触发OVER继续刷新,波次"..LF_Get_Current_Tide_Num(context))
ScriptLib.ContinueAutoMonster(context, defs.group_id, LF_Get_Current_Tide_Num(context))
else
if 0 == ScriptLib.GetGroupMonsterCount(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [MonDie]精英怪死亡当前怪物潮已经触发OVER且场上没有Monster重新创建怪物潮")
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
LF_Create_Monster_Tide(context,current_monster_tide)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
end
end
else
--当前怪物潮已经结束了,因为场上有精英怪被卡住了。精英死亡时,手动开启新的怪物潮
if 0 == ScriptLib.GetGroupMonsterCount(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG][MonDie] 精英怪死亡且场上没有怪物,波次"..LF_Get_Current_Tide_Num(context))
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
LF_Create_Monster_Tide(context,current_monster_tide)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
end
end
end
end
return 0
end
--玩家换队时触发启动一个一定时间的时间轴时间轴tick时修改global value给玩家挂debuff
function action_sumo_switch_team(context,evt)
--刚刚换队先清掉team上的换队惩罚global value并开始计时如果tick时没有换队则挂上惩罚标记gv
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,0)
ScriptLib.EndTimeAxis(context,"NOSWITCH_PUNISHMENT_AXIS")
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_AXIS",time_axis.noswitch_punishment_axis,false)
--清理换队提示
ScriptLib.EndTimeAxis(context,"NOSWITCH_PUNISHMENT_INADVANCE_AXIS")
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_INADVANCE_AXIS",time_axis.noswitch_punishment_inAdvance_axis,false)
--换队增加热情值
LF_Update_Fever(context,defs.switch_team_fever)
--换队的时候给服务端发送消息让客户端显示惩罚倒计时UI
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {})
ScriptLib.PrintContextLog(context,"FS: Clear reminder result"..ret)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
--ScriptLib.PrintContextLog(context,"FS: team has changed, team_has_change = 1")
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
end
--玩家进入区域直接创建空气墙,防止卡延迟出圈
function action_enter_start_region(context,evt)
--加载空气墙
ScriptLib.CreateGadget(context,{config_id = defs.air_wall})
ScriptLib.SetGroupVariableValue(context,"is_air_wall_created",1)
return 0
end
--团灭触发,直接结束玩法
function action_dungeon_all_avatar_die(context,evt)
LF_Stop_Play(context)
return 0
end
function action_dungeon_settle(context,evt)
LF_Stop_Play(context)
return 0
end
------------------------------------------------------------------
--辅助方法---------------------------------------------------------
------------------------------------------------------------------
--关卡相关方法-----------------------------------------------------
--启动玩法方法,初始化各种东西
function LF_Start_Play(context)
ScriptLib.StartGallery(context, defs.gallery_id)
ScriptLib.InitGalleryProgressScore(context, "fever", defs.gallery_id, fever_progress_table, GalleryProgressScoreUIType.GALLERY_PROGRESS_SCORE_UI_TYPE_SUMO_STAGE, GalleryProgressScoreType.GALLERY_PROGRESS_SCORE_NO_DEGRADE)
ScriptLib.InitTimeAxis(context,"FEVER_AXIS",time_axis.fever_axis,true)
ScriptLib.InitTimeAxis(context,"MINION_TIDE_AXIS",time_axis.minion_tide_axis,true)
ScriptLib.InitTimeAxis(context,"ELITE_TIDE_AXIS",time_axis.elite_tide_axis,true)
ScriptLib.InitTimeAxis(context,"ELITE_AXIS",time_axis.elite_axis,false)
LF_Set_Current_Tide_Num(context,0)
LF_Set_Current_Monster_Tide(context,1)
LF_Set_Current_Elite_Index(context,1)
LF_Create_Monster_Tide(context,1)
--启动玩法时给第一队挂一下gv防止一开始就受到惩罚并开启时间轴开始计时
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,0)
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_AXIS",time_axis.noswitch_punishment_axis,false)
ScriptLib.InitTimeAxis(context,"NOSWITCH_PUNISHMENT_INADVANCE_AXIS",time_axis.noswitch_punishment_inAdvance_axis,false)
--玩法开始的时候给服务端发送消息让客户端显示惩罚倒计时UI
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
--加载空气墙
ScriptLib.CreateGadget(context,{config_id = defs.air_wall})
end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.air_wall)
--玩法结束,清理掉当前的怪物潮
if not LF_Is_Current_Index_End(context) then
ScriptLib.KillMonsterTide(context, defs.group_id, current_monster_tide)
end
ScriptLib.StopGallery(context, defs.gallery_id,true)
ScriptLib.EndTimeAxis(context,"FEVER_AXIS")
ScriptLib.EndTimeAxis(context,"MINION_TIDE_AXIS")
ScriptLib.EndTimeAxis(context,"ELITE_AXIS")
ScriptLib.EndTimeAxis(context,"ELITE_TIDE_AXIS")
--关闭一下地城,以正确触发重新挑战
ScriptLib.CauseDungeonFail(context)
end
--启动一波指定ID的怪物潮需要传入该波怪物潮的ID具体配置在miscs中定义
function LF_Create_Monster_Tide(context,monster_tide_index)
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
ScriptLib.PrintContextLog(context,"FS: [DEBUG][CREATE] 创建怪物潮,怪物波次 ["..monster_tide_index.."]".."怪物潮INDEX"..(tide_num+1))
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
ScriptLib.AutoMonsterTide(context, tide_num+1, defs.group_id, monster_config_id_list, #monster_config_id_list, tide_suite_config[current_monster_tide].min, tide_suite_config[current_monster_tide].max)
end
--停止目前的怪物潮,下次刷新新配置的怪物潮
function LF_Refresh_Currtent_Monster_Tide(context)
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [REFRESH]时间轴刷新怪物潮,标记当前怪物潮结束")
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--标记当前怪物潮结束,如果怪物潮没有结束则手动结束
local tide_index = LF_Get_Current_Tide_Num(context)
ScriptLib.SetGroupVariableValue(context,"refresh_end_tide",tide_index)
if not LF_Is_Current_Index_End(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [REFRESH]手动结束当前怪物潮")
ScriptLib.EndMonsterTide(context, defs.group_id, tide_index, 1)
end
-- ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
LF_Set_Current_Monster_Tide(context,current_monster_tide+1)
--如果场上没有怪就直接创建
if 0 == ScriptLib.GetGroupMonsterCount(context) then
LF_Create_Monster_Tide(context,current_monster_tide+1)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [REFRESH]更新怪物潮,刷新怪物,并且标记这一波怪没有结束")
end
end
--在随机的位置,刷新指定序列的精英怪
function LF_Create_Elite_Monster(context,elite_index)
local elite_list = elite[elite_index]
ScriptLib.PrintContextLog(context,"FS: Creating elite nums_"..#elite_list)
--生成一个点的序列表,每次随机的时候把结果踢出
local point_index = {}
local choices = {}
for i=1,#elite_born_points do
table.insert(point_index,i)
end
for i=1,#elite_list do
local randomNum = math.random(1,#point_index)
table.insert(choices, point_index[randomNum])
table.remove(point_index, randomNum)
end
for i=1,#elite_list do
for k,v in pairs(points) do
if elite_born_points[choices[i]] == v.config_id then
ScriptLib.PrintContextLog(context,"FS: Creating elite ["..elite_list[i].."] at point "..v.pos.x..","..v.pos.y..","..v.pos.z)
ScriptLib.CreateMonsterByConfigIdByPos(context, elite_list[i], v.pos, v.rot)
end
end
end
ScriptLib.SetGroupVariableValue(context,"is_elite_on_ground",#elite_list)
end
--从1~max间随机nums个
function LF_Random_Choice(max, nums)
local choices = {}
local list = {}
for i=1,nums do
local randomNum = math.random(1,#list)
table.insert(choices, list[randomNum])
table.remove(list, randomNum)
end
return choices
end
function LF_Is_Current_Index_End(context)
if LF_Get_Current_Tide_Num(context) > ScriptLib.GetGroupVariableValue(context,"last_end_tide") then
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [JUDGE]判断当前怪物潮没有结束")
return false
end
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [JUDGE] 判断当前怪物潮已经结束")
return true
end
--通用类方法-------------------------------------------------------
--切换场上的场景氛围物件状态
function LF_Activate_Environment_Gadget(context,fever_level)
ScriptLib.PrintContextLog(context,"FS: Activate environment gadgets!")
--根据当前的fever等级改变天气
if (fever_level>local_defs.environment_change_level) then
ScriptLib.PrintContextLog(context,"FS: Changing environment weather!")
local ret = ScriptLib.SetWeatherAreaState(context, DungeonWeather[fever_level],1)
--ScriptLib.PrintContextLog(context,"FS: The result of starting weather ".. DungeonWeather[fever_level].."is "..ret)
local ret = ScriptLib.EnterWeatherArea(context, DungeonWeather[fever_level])
--ScriptLib.PrintContextLog(context,"FS: The result of changing weather".. DungeonWeather[fever_level].."is "..ret)
end
--切换场上所有的物件的状态
for i = 1, #suites[defs.environment_suite].gadgets do
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 101)
end
if (fever_level<#fever_progress_table-2 and fever_level>=local_defs.burn_effect_level) then
--喷大火5秒后转回小火
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
end
end
--给team挂global value角色处理各种特殊效果
function LF_Set_Team_Global_Value(context,gv_name,value)
--ScriptLib.PrintContextLog(context,"FS: Sending global values to team!")
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetTeamEntityGlobalFloatValue(context, uid_list, gv_name, value)
end
-----CRUD类方法----------------------------------------------------
--更新fever条fever_delta为fever条改变值
function LF_Update_Fever(context,fever_delta)
ScriptLib.AddGalleryProgressScore(context, "fever", defs.gallery_id, fever_delta)
end
--更新积分需要传入目标monster的entity id
function LF_Update_Score(context,monster_eid)
local uid_list = ScriptLib.GetSceneUidList(context)
local monster_id = ScriptLib.GetMonsterIdByEntityId(context,monster_eid)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["monster_id"] = monster_id})
end
--返回当前等级下的积分衰减速率
function LF_Get_Fever_Subnum(context)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
for i = 1, #fever_progress_table-1 do
local lower_bound = fever_progress_table[i]
local higher_bound = fever_progress_table[i+1]
if fever>=lower_bound and fever<higher_bound then
return fever_attenuation[i]
end
end
return -1
end
--增加场上的怪物总数
function LF_Add_MonsterCount(context, num)
-- local monster_count = ScriptLib.GetGroupVariableValue(context,"monster_count")
-- ScriptLib.SetGroupVariableValue(context,"monster_count", monster_count+num)
ScriptLib.ChangeGroupVariableValue(context,"monster_count",num)
end
function LF_Get_MonsterCount(context)
local monster_count = ScriptLib.GetGroupVariableValue(context,"monster_count")
return monster_count
end
--设置当前怪物潮的波次数注意不等于怪物潮的index。每次创建怪物潮会使波次数+1方便索引新的怪物潮
function LF_Set_Current_Tide_Num(context,value)
ScriptLib.SetGroupTempValue(context, "MinionTide", value, {})
end
--获取当前怪物潮的波次数注意不等于怪物潮的index。每次创建怪物潮会使波次数+1方便索引新的怪物潮
function LF_Get_Current_Tide_Num(context)
return ScriptLib.GetGroupTempValue(context, "MinionTide", {})
end
--设置当前大怪的进度index
function LF_Set_Current_Elite_Index(context,index)
ScriptLib.SetGroupVariableValue(context,"current_elite",index)
end
--获取当前大怪的进度index
function LF_Get_Current_Elite_Index(context)
local elite_index = ScriptLib.GetGroupVariableValue(context,"current_elite")
return elite_index
end
--设置当前怪物潮波次的index
function LF_Set_Current_Monster_Tide(context,index)
ScriptLib.SetGroupVariableValue(context,"current_monster_tide",index)
end
--获取当前怪物潮波次的index
function LF_Get_Current_Monster_Tide(context)
local monster_tide = ScriptLib.GetGroupVariableValue(context,"current_monster_tide")
return monster_tide
end
--根据config id 返回一个点位
function LF_Get_Point(context,point_cid)
for i = 1,#points do
if (points[i].config_id == point_cid) then
return points[i]
end
end
return -1
end
--根据gadget的config_id查询gadget_id
function LF_Get_Gadget_Id_By_Config_Id(context, config_id)
return gadgets[config_id].gadget_id
end
--返回一个指定configid的怪物是否是大怪
function LF_Is_Elite(context,monster_cid)
for i=1,#elite do
for k,cfg_id in pairs(elite[i]) do
if monster_cid == cfg_id then
return true
end
end
end
return false
end
------------------------------------------------------------------
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
end
------------------------------------------------------------------
Initialize()

View File

@@ -0,0 +1,407 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || GiliGiliI_Boss 渊下宫循环BOSS
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本循环BOSS挑战
|| LogName || ## GiliGili_LOG
|| Protection || groupunload、challengefail、challengesuccess时回收怪物
=====================================================================================================================
-- local LowBossID = {1,1}
-- local MidBossID = {1,1}
-- local HighBossID = {1,1}
-- local LowChallengeID = 1
-- local MidChallengeID = 1
-- local HighChallengeID = 1
-- local SwitchGadgetID = 1
-- local MovePlatID = 1
-- local BlackBall = {75023,75024,75025,75026,75027,75028,75029,75030}
=======================================================================================]]
--b1326549 循环版龙蜥挑战,怪物脱战后直接触发挑战失败 function SLC_Reset_Battle(context)
local darkBallNum = 5
local intervalTime = {60}
local groupID = 177005075
local watcherRange = 100
local noticeTimer = {10}
local extrTriggers = {
initialtrigger = {
["Interact_Dwon"] = { config_id = 80000003, name = "Interact_Dwon", event= EventType.EVENT_MICHIAE_INTERACT, source = "", condition = "", action = "action_InteractDwon", trigger_count = 0 },
["Challenge_Success"] = { config_id = 80000004, name = "Challenge_Success", event= EventType.EVENT_CHALLENGE_SUCCESS, source = "233", condition = "", action = "action_ChallengeSuccess", trigger_count = 0 },
["Challenge_Fail"] = { config_id = 80000005, name = "Challenge_Fail", event= EventType.EVENT_CHALLENGE_FAIL, source = "233", condition = "", action = "action_ChallengeFail", trigger_count = 0 },
["Time_Axis"] = { config_id = 80000006, name = "Time_Axis", event= EventType.EVENT_TIME_AXIS_PASS, source = "darkballinterval", condition = "", action = "action_TimeAxis", trigger_count = 0 },
["Boss_Die"] = { config_id = 80000008, name = "Boss_Die", event= EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "", action = "action_WhenBossDie", trigger_count = 0, tag = "999" },
["Group_Unload"] = { config_id = 80000009, name = "Group_Unload", event= EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_GroupUnload", trigger_count = 0 },
["Notice_Timer"] = { config_id = 80000010, name = "Notice_Timer", event= EventType.EVENT_TIME_AXIS_PASS, source = "noticetimer", condition = "", action = "action_NoticeTimer", trigger_count = 0 },
["Enter_Region"] = { config_id = 80000011, name = "Enter_Region", event= EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_EnterRegion", trigger_count = 0,forbid_guest = false },
["Leave_Region"] = { config_id = 80000012, name = "Leave_Region", event= EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_LeaveRegion", trigger_count = 0,forbid_guest = false },
}
}
function SLC_Deny_Lock_On(context,isOn)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 深海龙蜥循环boss将墙壁的DenyLockOn设置为"..isOn)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, wall_1, "SGV_deny_lock_on" ,isOn)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, wall_2, "SGV_deny_lock_on" ,isOn)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, wall_3, "SGV_deny_lock_on" ,isOn)
return 0
end
--龙蜥向group通知脱战直接重置boss
function SLC_Reset_Battle(context)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 龙蜥脱战,直接挑战失败")
-- if ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) == 2 then
-- --移除掉两只水龙蜥
-- ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, LowBossID[1])
-- ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, LowBossID[2])
-- --再重新创建出来
-- ScriptLib.CreateMonster(context, { config_id = LowBossID[1], delay_time = 0 })
-- ScriptLib.CreateMonster(context, { config_id = LowBossID[2], delay_time = 0 })
-- elseif ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) == 3 then
-- --移除掉两只水龙蜥
-- ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, MidBossID[1])
-- ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, MidBossID[2])
-- --再重新创建出来
-- ScriptLib.CreateMonster(context, { config_id = MidBossID[1], delay_time = 0 })
-- ScriptLib.CreateMonster(context, { config_id = MidBossID[2], delay_time = 0 })
-- elseif ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) == 4 then
-- --移除掉两只水龙蜥
-- ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, HighBossID[1])
-- ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, HighBossID[2])
-- --再重新创建出来
-- ScriptLib.CreateMonster(context, { config_id = HighBossID[1], delay_time = 0 })
-- ScriptLib.CreateMonster(context, { config_id = HighBossID[2], delay_time = 0 })
-- end
ScriptLib.StopChallenge(context, 233, 0)
ScriptLib.CreateGadget(context,{config_id = wall_1})
ScriptLib.CreateGadget(context,{config_id = wall_2})
ScriptLib.CreateGadget(context,{config_id = wall_3})
--ScriptLib.SetGroupVariableValue(context, "challenge_state", 0)
return 0
end
function GetPointDistance(x1,y1,x2,y2)
return math.sqrt(math.pow((y2-y1),2)+math.pow((x2-x1),2))
end
function action_WhenBossDie(context, evt)
return 0
end
function action_TimeAxis( context, evt )
ScriptLib.PrintContextLog(context, "## GiliGili_LOG : Time_Axis")
if ScriptLib.GetGroupTempValue(context, "DarkBallNotice", {})==0 then
--杀黑球提示
ScriptLib.ShowReminder(context, 600101)
ScriptLib.SetGroupTempValue(context, "DarkBallNotice", 1, {})
end
--复制黑球List同时筛选出剩余的球
local leaveNum = 0
local tempList = {}
for i,v in ipairs(BlackBall) do
if ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
leaveNum = leaveNum + 1
else
table.insert(tempList, v)
end
end
--获取需要补的球数
local upNum = darkBallNum-leaveNum
if upNum <= 0 then
return 0
end
--补齐黑球到指定数量
for i=1,upNum do
local randomIndex = math.random(1,#tempList)
ScriptLib.CreateGadget(context, { config_id = tempList[randomIndex] })
table.remove(tempList, randomIndex)
end
return 0
end
function action_EnterRegion( context, evt )
if evt.param1 ~= vision_region then
return 0
end
--进入优化圈,开启可见部分
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {vision_type_id})
return 0
end
function action_LeaveRegion( context, evt )
if evt.param1 ~= vision_region then
return 0
end
--离开优化圈,还原视野
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {1})
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) == 0 then
--设置挑战失败
ScriptLib.StopChallenge(context, 233, 0)
end
return 0
end
function action_GroupUnload( context, evt )
--取消时间轴
ScriptLib.EndTimeAxis(context, "darkballinterval")
ScriptLib.EndTimeAxis(context, "noticetimer")
-- --移除额外的suite
-- if ScriptLib.GetGroupTempValue(context, "ChallengeMode", {})~= 0 then
-- ScriptLib.RemoveExtraGroupSuite(context, groupID, ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}))
-- end
-- --删除黑球
-- for i,v in ipairs(BlackBall) do
-- if ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
-- ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, v)
-- end
-- end
--重置到suite1
ScriptLib.RefreshGroup(context, { group_id = groupID, suite = 1})
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
return 0
end
function action_ChallengeFail( context, evt )
-- --回收Suit
-- ScriptLib.RemoveExtraGroupSuite(context, groupID, ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}))
-- --回收千灯之地
-- ScriptLib.KillEntityByConfigId(context, {config_id = MovePlatID})
-- --切换开启机关状态
-- ScriptLib.CreateGadget(context, {config_id = SwitchGadgetID})
-- --删除黑球
-- for i,v in ipairs(BlackBall) do
-- if ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
-- ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, v)
-- end
-- end
--重置到suite1
ScriptLib.RefreshGroup(context, { group_id = groupID, suite = 1})
--取消时间轴
ScriptLib.EndTimeAxis(context, "darkballinterval")
ScriptLib.EndTimeAxis(context, "noticetimer")
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
return 0
end
function action_ChallengeSuccess( context, evt )
local uidList = ScriptLib.GetSceneUidList(context)
-- --回收Suit
-- ScriptLib.RemoveExtraGroupSuite(context, groupID, ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}))
-- --回收千灯之地
-- ScriptLib.KillEntityByConfigId(context, {config_id = MovePlatID})
-- --切换开启机关状态
-- ScriptLib.CreateGadget(context, {config_id = SwitchGadgetID})
-- --删除黑球
-- for i,v in ipairs(BlackBall) do
-- if ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
-- ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, v)
-- end
-- end
--重置到suite1
ScriptLib.RefreshGroup(context, { group_id = groupID, suite = 1})
--取消时间轴
ScriptLib.EndTimeAxis(context, "darkballinterval")
ScriptLib.EndTimeAxis(context, "noticetimer")
local centerPos = ScriptLib.GetPosByEntityId(context, ScriptLib.GetEntityIdByConfigId(context, SwitchGadgetID))
--计陈列室
if ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) == 2 then
for i,v in ipairs(uidList) do
local playerPos = ScriptLib.GetPosByEntityId(context, ScriptLib.GetAvatarEntityIdByUid(context, v))
if GetPointDistance(playerPos.x, playerPos.z, centerPos.x, centerPos.z)<=watcherRange and math.abs(playerPos.y - centerPos.y)<50 then
ScriptLib.AddExhibitionAccumulableData(context, v, "Activity_Michiae_watcher_boss_easy", 1)
end
end
elseif ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) == 3 then
for i,v in ipairs(uidList) do
local playerPos = ScriptLib.GetPosByEntityId(context, ScriptLib.GetAvatarEntityIdByUid(context, v))
if GetPointDistance(playerPos.x, playerPos.z, centerPos.x, centerPos.z)<=watcherRange and math.abs(playerPos.y - centerPos.y)<50 then
ScriptLib.AddExhibitionAccumulableData(context, v, "Activity_Michiae_watcher_boss_easy", 1)
ScriptLib.AddExhibitionAccumulableData(context, v, "Activity_Michiae_watcher_boss_normal", 1)
end
end
elseif ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) == 4 then
for i,v in ipairs(uidList) do
local playerPos = ScriptLib.GetPosByEntityId(context, ScriptLib.GetAvatarEntityIdByUid(context, v))
if GetPointDistance(playerPos.x, playerPos.z, centerPos.x, centerPos.z)<=watcherRange and math.abs(playerPos.y - centerPos.y)<50 then
ScriptLib.AddExhibitionAccumulableData(context, v, "Activity_Michiae_watcher_boss_easy", 1)
ScriptLib.AddExhibitionAccumulableData(context, v, "Activity_Michiae_watcher_boss_normal", 1)
ScriptLib.AddExhibitionAccumulableData(context, v, "Activity_Michiae_watcher_boss_hard", 1)
end
end
end
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
return 0
end
function action_InteractDwon( context, evt )
ScriptLib.PrintContextLog(context, "## GiliGili_LOG : Interact_Dwon")
if ScriptLib.GetGroupTempValue(context, "ChallengeMode", {})~=0 then
return 0
end
if evt.param2 == 1 then
--开启低级挑战
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 2, {})
-- ScriptLib.CreateMonster(context, { config_id = LowBossID[1], delay_time = 0 })
-- ScriptLib.CreateMonster(context, { config_id = LowBossID[2], delay_time = 0 })
--创建挑战
ScriptLib.StartChallenge(context,233, LowChallengeID,{1,999,2})
ScriptLib.AddExtraGroupSuite(context, groupID, 2)
--黑球时间轴
ScriptLib.InitTimeAxis(context, "darkballinterval", intervalTime, true)
--千灯之地时间轴
ScriptLib.InitTimeAxis(context, "noticetimer", noticeTimer, false)
elseif evt.param2 == 2 then
--开启中级挑战
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 3, {})
--创建挑战
ScriptLib.StartChallenge(context,233, MidChallengeID,{1,999,2})
ScriptLib.AddExtraGroupSuite(context, groupID, 3)
--黑球时间轴
ScriptLib.InitTimeAxis(context, "darkballinterval", intervalTime, true)
--千灯之地时间轴
ScriptLib.InitTimeAxis(context, "noticetimer", noticeTimer, false)
elseif evt.param2 == 3 then
--开启高级挑战
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 4, {})
--创建挑战
ScriptLib.StartChallenge(context,233, HighChallengeID,{1,999,2})
ScriptLib.AddExtraGroupSuite(context, groupID, 4)
--黑球时间轴
ScriptLib.InitTimeAxis(context, "darkballinterval", intervalTime, true)
--千灯之地时间轴
ScriptLib.InitTimeAxis(context, "noticetimer", noticeTimer, false)
end
--切换开启机关状态
ScriptLib.KillEntityByConfigId(context, {config_id = SwitchGadgetID})
--清空黑球提示计数
ScriptLib.SetGroupTempValue(context, "DarkBallNotice", 0, {})
return 0
end
function action_NoticeTimer( context, evt )
--站在千灯之地内回能量提示
ScriptLib.ShowReminder(context, 600100)
--创建千灯之地
ScriptLib.CreateGadget(context, { config_id = MovePlatID })
--开启移动平台
ScriptLib.StartPlatform(context, MovePlatID)
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,371 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || GiliGiliI_Boss 渊下宫循环BOSS
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本循环BOSS挑战、任务版
|| LogName || ## GiliGili_LOG
|| Protection || groupunload下线等情况由任务负责回滚关卡做一层保底
=====================================================================================================================
-- local LowBossID = {1,1}
-- local MidBossID = {1,1}
-- local HighBossID = {1,1}
-- local LowChallengeID = 1
-- local MidChallengeID = 1
-- local HighChallengeID = 1
-- local SwitchGadgetID = 1
-- local MovePlatID = 1
-- local BlackBall = {75023,75024,75025,75026,75027,75028,75029,75030}
--local groupID = 0
--local questID = 0
--local bright_area = 22019
=======================================================================================]]
local global = {
darkBallNum = 5,
intervalTime = {60}
}
local extrTriggers = {
initialtrigger = {
["Time_Axis"] = { config_id = 80000006, name = "Time_Axis", event= EventType.EVENT_TIME_AXIS_PASS, source = "darkballinterval", condition = "", action = "action_TimeAxis", trigger_count = 0 },
["Boss_Die"] = { config_id = 80000008, name = "Boss_Die", event= EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "", action = "action_WhenBossDie", trigger_count = 0, tag = "999" },
["Group_Unload"] = { config_id = 80000009, name = "Group_Unload", event= EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_GroupUnload", trigger_count = 0 },
["Monster_Battle"] = { config_id = 80000010, name = "Monster_Battle", event= EventType.EVENT_MONSTER_BATTLE, source = "", condition = "", action = "action_MonsterBattle", trigger_count = 0 },
["Notice_Timer"] = { config_id = 80000011, name = "Notice_Timer", event= EventType.EVENT_TIME_AXIS_PASS, source = "noticetimer", condition = "", action = "action_NoticeTimer", trigger_count = 0 },
["In_Battle"] = { config_id = 80000012, name = "In_Battle", event= EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_Enter_Battle_Region", trigger_count = 0, forbid_guest = false },
["Leave_Battle"] = { config_id = 80000013, name = "Leave_Battle", event= EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_Leave_Battle_Region", trigger_count = 0, forbid_guest = false },
["Battle_Timer"] = { config_id = 80000014, name = "Battle_Timer", event= EventType.EVENT_TIME_AXIS_PASS, source = "battletimer", condition = "", action = "action_BattleTimer", trigger_count = 0 },
["Enter_Region"] = { config_id = 80000015, name = "Enter_Region", event= EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_EnterRegion", trigger_count = 0,forbid_guest = false },
["Leave_Region"] = { config_id = 80000016, name = "Leave_Region", event= EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_LeaveRegion", trigger_count = 0,forbid_guest = false },
}
}
function SLC_Monster_In_Battle(context)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 怪物入战停止Tck")
--删除重复入战逻辑
ScriptLib.EndTimeAxis(context, "battletimer")
return 0
end
function SLC_Deny_Lock_On(context,isOn)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 深海龙蜥循环boss将墙壁的DenyLockOn设置为"..isOn)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, wall_1, "SGV_deny_lock_on" ,isOn)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, wall_2, "SGV_deny_lock_on" ,isOn)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, wall_3, "SGV_deny_lock_on" ,isOn)
return 0
end
--龙蜥向group通知脱战直接重置boss
function SLC_Reset_Battle(context)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 深海龙蜥脱战server lua call销毁并重新创建龙蜥")
--删除重复入战逻辑
ScriptLib.EndTimeAxis(context, "battletimer")
--移除掉两只水龙蜥
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, monster_1)
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.MONSTER, monster_2)
--再重新创建出来
ScriptLib.CreateMonster(context, { config_id = monster_1, delay_time = 0 })
ScriptLib.CreateMonster(context, { config_id = monster_2, delay_time = 0 })
LF_RemoveBattleEntity(context)
--龙蜥试图脱战重刷时会先尝试找圈内合法的玩家作为authority。如果此时圈内没有玩家再随缘给authority
local uidlist = ScriptLib.GetSceneUidList(context)
local has_avatar_in_region = false
for i = 1, #uidlist do
if LF_Avatar_is_in_region(context,uidlist[i],enter_battle_region) then
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 龙蜥重置尝试将Authority设置给圈内玩家"..uidlist[i])
--将Authority强行设置为进圈的玩家
ScriptLib.ForceRefreshAuthorityByConfigId(context, monster_1, uidlist[i])
ScriptLib.ForceRefreshAuthorityByConfigId(context, monster_2, uidlist[i])
has_avatar_in_region = true
break
end
end
if (has_avatar_in_region) then
local ret1 = ScriptLib.SetMonsterBattleByGroup(context, monster_1, groupID)
local ret2 = ScriptLib.SetMonsterBattleByGroup(context, monster_2, groupID)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 设置怪物入战的结果为"..ret1)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 设置怪物入战的结果为"..ret2)
end
ScriptLib.CreateGadget(context,{config_id = wall_1})
ScriptLib.CreateGadget(context,{config_id = wall_2})
ScriptLib.CreateGadget(context,{config_id = wall_3})
--ScriptLib.SetGroupVariableValue(context, "challenge_state", 0)
return 0
end
function LF_RemoveBattleEntity(context)
--删除黑球
for i,v in ipairs(BlackBall) do
if ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, v)
end
end
--删除千灯之地
ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, bright_area)
--取消时间轴
ScriptLib.EndTimeAxis(context, "darkballinterval")
ScriptLib.EndTimeAxis(context, "noticetimer")
return 0
end
function LF_Avatar_is_in_region(context,uid,region_id)
local avatar_id = ScriptLib.GetAvatarEntityIdByUid(context, uid)
local pos1 = ScriptLib.GetPosByEntityId(context, avatar_id)
local region = regions[region_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
function action_EnterRegion( context, evt )
if evt.param1 ~= vision_region then
return 0
end
--进入优化圈,开启可见部分
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {vision_type_id})
return 0
end
function action_LeaveRegion( context, evt )
if evt.param1 ~= vision_region then
return 0
end
--离开优化圈,还原视野
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {1})
--删除相关内容
LF_RemoveBattleEntity(context)
return 0
end
--处理玩家出战斗圈转移authority
function action_Leave_Battle_Region(context, evt)
if evt.param1 ~= enter_battle_region then
return 0
end
--玩家出圈清除context.uid的eyePoint视野锚点区域
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 玩家出战斗圈"..context.uid)
--尝试转移config_id的authority, 当uid和config_id的authority不一致时尝试转移到region_config_id里的玩家。
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 尝试重新分配authority")
local ret1 = ScriptLib.TryReallocateEntityAuthority(context, context.uid, monster_1, evt.param1)
local ret2 = ScriptLib.TryReallocateEntityAuthority(context, context.uid, monster_2, evt.param1)
return 0
end
--战斗期间入圈,让怪物强制入战
function action_Enter_Battle_Region(context, evt)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 玩家进战斗圈")
if evt.param1 ~= enter_battle_region then
return 0
end
--玩家进圈时先查询入战region范围内是否存在玩家
--如果存在说明该玩家不是第一个进入region的那么圈内其他玩家中一定有authority因为出圈会强制重新分配入圈的时候会强制分配
--如果不存在说明该玩家是第一个进入region的将authority分配给他
local no_avatar_in_region = true
local uidlist = ScriptLib.GetSceneUidList(context)
if next(uidlist)== nil then
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 没有取到uidlist认为是上线触发region的情况强制把authority刷给进圈的玩家")
--将Authority强行设置为进圈的玩家
ScriptLib.ForceRefreshAuthorityByConfigId(context, monster_1, context.uid)
ScriptLib.ForceRefreshAuthorityByConfigId(context, monster_2, context.uid)
return 0
end
for i = 1, #uidlist do
if (LF_Avatar_is_in_region(context,uidlist[i],enter_battle_region) and uidlist[i] ~= context.uid) then
no_avatar_in_region = false
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 圈内存在玩家:"..uidlist[i].."不分配authortiy")
break
end
end
if (no_avatar_in_region) then
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 第一个进入region的玩家"..context.uid.."分配authortiy")
--将Authority强行设置为进圈的玩家
ScriptLib.ForceRefreshAuthorityByConfigId(context, monster_1, context.uid)
ScriptLib.ForceRefreshAuthorityByConfigId(context, monster_2, context.uid)
end
--重复入战逻辑,防止角色死亡没入战;需要在怪物入战后关闭
ScriptLib.InitTimeAxis(context, "battletimer", {5}, true)
local ret1 = ScriptLib.SetMonsterBattleByGroup(context, monster_1, groupID)
local ret2 = ScriptLib.SetMonsterBattleByGroup(context, monster_2, groupID)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 设置怪物入战的结果为"..ret1)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 设置怪物入战的结果为"..ret2)
return 0
end
function action_BattleTimer( context, evt )
ScriptLib.PrintContextLog(context, "## GiliGili_LOG : 入战TICK尝试拉起怪物")
local ret1 = ScriptLib.SetMonsterBattleByGroup(context, monster_1, groupID)
local ret2 = ScriptLib.SetMonsterBattleByGroup(context, monster_2, groupID)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 设置怪物入战的结果为"..ret1)
ScriptLib.PrintContextLog(context,"DeepseaDrakeBoss: 设置怪物入战的结果为"..ret2)
return 0
end
function action_TimeAxis( context, evt )
ScriptLib.PrintContextLog(context, "## GiliGili_LOG : Time_Axis")
if ScriptLib.GetGroupTempValue(context, "DarkBallNotice", {})==0 then
--杀黑球提示
ScriptLib.ShowReminder(context, 600101)
ScriptLib.SetGroupTempValue(context, "DarkBallNotice", 1, {})
end
--复制黑球List同时筛选出剩余的球
local leaveNum = 0
local tempList = {}
for i,v in ipairs(BlackBall) do
if ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
leaveNum = leaveNum + 1
else
table.insert(tempList, v)
end
end
--获取需要补的球数
local upNum = global.darkBallNum-leaveNum
if upNum <= 0 then
return 0
end
--补齐黑球到指定数量
for i=1,upNum do
local randomIndex = math.random(1,#tempList)
ScriptLib.CreateGadget(context, { config_id = tempList[randomIndex] })
table.remove(tempList, randomIndex)
end
return 0
end
function action_MonsterBattle( context, evt )
--开启时间轴
ScriptLib.InitTimeAxis(context, "darkballinterval", global.intervalTime, true)
--开启一个时间轴延迟触发reminder
ScriptLib.InitTimeAxis(context, "noticetimer", {5}, false)
--清空黑球提示计数
ScriptLib.SetGroupTempValue(context, "DarkBallNotice", 0, {})
--创建千灯之地 交给任务环控制了
--ScriptLib.CreateGadget(context, { config_id = bright_area })
--ScriptLib.StartPlatform(context, bright_area)
return 0
end
function action_NoticeTimer( context, evt )
--站在千灯之地内回能量提示
ScriptLib.ShowReminder(context, 600100)
--创建千灯之地
ScriptLib.CreateGadget(context, { config_id = bright_area })
--开启移动平台
ScriptLib.StartPlatform(context, bright_area)
return 0
end
function action_GroupUnload( context, evt )
LF_RemoveBattleEntity(context)
return 0
end
function action_WhenBossDie( context, evt )
local tempList = ScriptLib.GetGroupAliveMonsterList(context, groupID)
ScriptLib.PrintContextLog(context, "## GiliGili_LOG : Monster Die")
if next(tempList)==nil then
ScriptLib.PrintContextLog(context, "## GiliGili_LOG : Monste All Die")
LF_RemoveBattleEntity(context)
--发送成功消息
ScriptLib.AddQuestProgress(context, ""..questID)
end
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
table.insert(suites[2].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,237 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || HM_BalloonGallery 家园射气球
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 家园射气球玩法
|| LogName || ## HM_LOG
|| Protection || group卸载时关闭gallery
=====================================================================================================================
=======================================================================================]]
local extrTriggers = {
initialtrigger = {
["Gallery_Start"] = { config_id = 80000001, name = "Gallery_Start", event= EventType.EVENT_GALLERY_START, source = "", condition = "", action = "action_GalleryStart", trigger_count = 0 },
["Gallery_Stop"] = { config_id = 80000002, name = "Gallery_Stop", event= EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_GalleryStop", trigger_count = 0 },
["Time_Axis"] = { config_id = 80000003, name = "Time_Axis", event= EventType.EVENT_TIME_AXIS_PASS, source = "balloonInterval", condition = "", action = "action_TimeAxis", trigger_count = 0 },
["Gadget_Die"] = { config_id = 80000006, name = "Gadget_Die", event= EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_GadgetDie", trigger_count = 0 },
["UIInteract"] = { config_id = 80000007, name = "UIInteract", event= EventType.EVENT_SELECT_UIINTERACT, source = "", condition = "", action = "action_UIInteract", trigger_count = 0 },
["Time_Axis2"] = { config_id = 80000008, name = "Time_Axis2", event= EventType.EVENT_TIME_AXIS_PASS, source = "balloonInterval_2", condition = "", action = "action_TimeAxis_2", trigger_count = 0 },
["Group_Unload"] = { config_id = 80000009, name = "Group_Unload", event= EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_GroupUnload", trigger_count = 0 },
}
}
galleryID = 410002
function getRandomSize( context )
local MAX = 0
local defaultSize = {x= 4, y= 4, z= 4}
for i,v in ipairs(randomSize) do
MAX = MAX + v.weight
end
local randomNum = math.random(0,MAX)
for i,v in ipairs(randomSize) do
if randomNum <= v.weight then
return v.size
else
randomNum = randomNum - v.weight
end
end
return defaultSize
end
function action_GroupUnload( context, evt )
--关局
ScriptLib.SetGroupTempValue(context, "isInGallery", 0, {})
ScriptLib.PrintContextLog(context, "## HM_LOG : group unload")
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, boardID, 0)
--关闭时间轴
ScriptLib.EndTimeAxis(context, "balloonInterval")
ScriptLib.EndTimeAxis(context, "balloonInterval_2")
--回收
ScriptLib.KillExtraGroupSuite(context, 0, suitID)
ScriptLib.KillExtraGroupSuite(context, 0, suitID_2)
--StopGalleryByReason 0-NONE 1-超时 2-客户端中断 3-lua设置成功 4-lua设置失败
ScriptLib.StopGalleryByReason(context, galleryID, 2)
return 0
end
function Homeworld_Gallery_ShootBalloon( context, param1 )
if param1 == 1 then
ScriptLib.PrintContextLog(context, "## HM_LOG : getScore Low")
ScriptLib.UpdatePlayerGalleryScore(context, 410002, {["score"]=lowScore})
elseif param1 == 2 then
ScriptLib.PrintContextLog(context, "## HM_LOG : getScore High")
ScriptLib.UpdatePlayerGalleryScore(context, 410002, {["score"]=highScore})
end
return 0
end
function action_GadgetDie( context,evt )
if ScriptLib.GetGroupTempValue(context, "isInGallery", {})==0 then
return 0
end
local areaClear = true
local areaClear_2 = true
for i,v in ipairs(suites[suitID].gadgets) do
if v ~= evt.param1 and ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
areaClear = false
break
end
end
for i,v in ipairs(suites[suitID_2].gadgets) do
if v ~= evt.param1 and ScriptLib.GetGadgetStateByConfigId(context, 0, v) ~= -1 then
areaClear_2 = false
break
end
end
if areaClear then
ScriptLib.PrintContextLog(context, "## HM_LOG : TimeAxis Restart")
--关闭时间轴
ScriptLib.EndTimeAxis(context, "balloonInterval")
--创建
ScriptLib.CreateGadgetWave(context, areaID, suitID, 10, {x= 20, y = 10, z = 20}, getRandomSize(context))
--开启一个时间轴
ScriptLib.InitTimeAxis(context, "balloonInterval", intervalTime, true)
end
if areaClear_2 then
ScriptLib.PrintContextLog(context, "## HM_LOG : TimeAxis_2 Restart")
--关闭时间轴
ScriptLib.EndTimeAxis(context, "balloonInterval_2")
--创建
ScriptLib.CreateGadgetWave(context, areaID_2, suitID_2, 10, {x= 20, y = 10, z = 20}, getRandomSize( context ))
--开启一个时间轴
ScriptLib.InitTimeAxis(context, "balloonInterval_2", intervalTime, true)
end
return 0
end
function action_GalleryStart( context,evt )
if evt.param1 ~= galleryID then
ScriptLib.PrintContextLog(context, "## HM_LOG : galleryID not existent")
return 0
end
--开局
ScriptLib.SetGroupTempValue(context, "isInGallery", 1, {})
ScriptLib.PrintContextLog(context, "## HM_LOG : gallery start")
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, boardID, 201)
--开启时间轴
ScriptLib.InitTimeAxis(context, "balloonInterval", intervalTime, true)
ScriptLib.InitTimeAxis(context, "balloonInterval_2", intervalTime, true)
--创建
ScriptLib.CreateGadgetWave(context, areaID, suitID, 10, {x= 20, y = 10, z = 20}, getRandomSize( context ))
ScriptLib.CreateGadgetWave(context, areaID_2, suitID_2, 10, {x= 20, y = 10, z = 20}, getRandomSize( context ))
return 0
end
function action_GalleryStop( context,evt )
if evt.param1 ~= galleryID then
ScriptLib.PrintContextLog(context, "## HM_LOG : galleryID not existent")
return 0
end
--关局
ScriptLib.SetGroupTempValue(context, "isInGallery", 0, {})
ScriptLib.PrintContextLog(context, "## HM_LOG : gallery Stop")
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, boardID, 0)
--关闭时间轴
ScriptLib.EndTimeAxis(context, "balloonInterval")
ScriptLib.EndTimeAxis(context, "balloonInterval_2")
--回收
ScriptLib.KillExtraGroupSuite(context, 0, suitID)
ScriptLib.KillExtraGroupSuite(context, 0, suitID_2)
return 0
end
function action_TimeAxis( context, evt)
--回收
ScriptLib.KillExtraGroupSuite(context, 0, suitID)
--创建
ScriptLib.CreateGadgetWave(context, areaID, suitID, 10, {x= 20, y = 10, z = 20}, getRandomSize( context ))
return 0
end
function action_TimeAxis_2( context, evt)
--回收
ScriptLib.KillExtraGroupSuite(context, 0, suitID_2)
--创建
ScriptLib.CreateGadgetWave(context, areaID_2, suitID_2, 10, {x= 20, y = 10, z = 20}, getRandomSize( context ))
return 0
end
function action_UIInteract( context, evt )
if evt.param1 == 1 then
--开启一个时间轴
ScriptLib.PrintContextLog(context, "## HM_LOG : StateChange Play Start")
-- ScriptLib.InitTimeAxis(context, "balloonInterval", intervalTime, true)
if ScriptLib.StartHomeGallery(context, galleryID, context.uid) == -1 then
ScriptLib.SendServerMessageByLuaKey(context, "HOMEOWRLD_DUPLICATE_GALLERY", {context.uid})
end
end
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,678 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || Hurarongdao 华容道玩法
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本,华容道玩法,设置可移动板块的按键、记录板块位置、判定解谜成功
|| LogName || ## ReviveBoss_LOG
|| Protection || 使用var来记录当前板块的位置在groupload时使用createbypos恢复
=====================================================================================================================
local PlatList = {76001,76002,76003,76004,0,76006,76007,76008,76009}
local initPlatList = {0,76001,76002,76003,76004,76006,76007,76008,76009}
local groupID = 177005076
local ArrayID = 700500010
local operatorConfigID = 76010
local successOptionID = 703
local offeringConfigID = 76014
local borderConfigID = 76018
local lastOfferingConfigID = 76011
local completeConfigID = 76016
local centreConfigID = 76016
local successConfigID = 0
local OptionID = 705
local RestartOption = 704
local PointList ={
{pos={x=242.596, y=325.599, z=284.231}, rot={x=0 ,y=306.31, z=0}},
{pos={x=241.107, y=325.599, z=282.2}, rot={x=0 ,y=306.31, z=0}},
{pos={x=239.68, y=325.599, z=280.16}, rot={x=0 ,y=306.31, z=0}},
{pos={x=240.584, y=325.599, z=285.718}, rot={x=0 ,y=306.31, z=0}},
{pos={x=239.099, y=325.599, z=283.706}, rot={x=0 ,y=306.31, z=0}},
{pos={x=237.562, y=325.599, z=281.526}, rot={x=0 ,y=306.31, z=0}},
{pos={x=238.57, y=325.599, z=287.208}, rot={x=0 ,y=306.31, z=0}},
{pos={x=237.091, y=325.599, z=285.201}, rot={x=0 ,y=306.31, z=0}},
{pos={x=235.627, y=325.599, z=283.219}, rot={x=0 ,y=306.31, z=0}},
}
======================================================================================================================]]
--12.21 迭代,为了保证只有一个按键 新增了function SLC_Huarongdao_Selecte( context, isSelected) 删除了LF_SetOption中的按键设置逻辑 在action_PlatReachPoint中新增设置按键逻辑
--12.22 迭代,新增了一个按键缓存功能,如果玩家一次踩到多块版,只显示第一个板的按键,离开第一块板的区域时检查缓存中时候还有可用的板
--12.29 BUG修复流程中出现了没有被删除的板块为了防止LD这边的return问题把逻辑迁移到re那个什么 b1331347
local extrTriggers = {
initialtrigger = {
["Reach_Point"] = { config_id = 8000001, name = "Reach_Point", event= EventType.EVENT_PLATFORM_REACH_POINT, source = "", condition = "", action = "action_PlatReachPoint", trigger_count = 0 },
["Option_Down"] = { config_id = 8000002, name = "Option_Down", event= EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_OptionDown", trigger_count = 0 },
["Gadget_State_Change"] = { config_id = 8000003, name = "Gadget_State_Change", event= EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_GadgetStateChange", trigger_count = 0 },
["Group_Load"] = { config_id = 8000005, name = "Group_Load", event= EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_GroupLoad", trigger_count = 0 },
}
}
local referenceConfigID = 76021
--在tempvalue组里插入数据返回其当前所在的位置singlMode为true表示自动过滤重复数据
function LF_TempValueInsert( context, key, value, isSingleMode )
for i=1,10 do
local curSlot = LF_GetTempValueByIndex( context, key, i )
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 缓存加值循环")
if curSlot == value and isSingleMode then
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 出现了重复的ID")
return -1
end
if curSlot == nil then
--插值
ScriptLib.SetGroupTempValue(context, key..i, value,{})
--记录长度
if ScriptLib.GetGroupTempValue(context, key.."Size", {}) == 0 then
ScriptLib.SetGroupTempValue(context, key.."Size", 1, {})
elseif ScriptLib.GetGroupTempValue(context, key.."Size", {}) <10 then
ScriptLib.ChangeGroupTempValue(context, key.."Size", 1, {})
end
return i
end
end
return -1
end
function LF_TempValueRemoveByIndex( context, key, index )
local sum = LF_TempValueGetSize( context, key )
if sum == 0 then
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 有问题,缓存是空的")
return -1
elseif index>sum then
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : index越界了兄弟")
return -1
end
--取成List
local tempList = {}
for i=1,sum do
table.insert(tempList, ScriptLib.GetGroupTempValue(context, key..i, {}))
end
table.remove(tempList,index)
--记录长度
ScriptLib.ChangeGroupTempValue(context, key.."Size", -1, {})
--List转回TempValue
for i=1,sum-1 do
ScriptLib.SetGroupTempValue(context, key..i, tempList[i], {})
end
ScriptLib.SetGroupTempValue(context, key..sum, 0, {})
return 0
end
function LF_TempValueRemoveByValue( context, key, value )
local sum = LF_TempValueGetSize( context, key )
local i = 1
for i=1,sum do
if ScriptLib.GetGroupTempValue(context, key..i, {})==value then
--删一个值
LF_TempValueRemoveByIndex( context, key, i )
--i = i - 1
end
end
return 0
end
function LF_GetTempValueByIndex( context, key, index )
local sum = LF_TempValueGetSize( context, key )
if index > sum then
return nil
end
return ScriptLib.GetGroupTempValue(context, key..index, {})
end
function LF_TempValueGetSize( context, key )
return ScriptLib.GetGroupTempValue(context, key.."Size", {})
end
function SLC_Huarongdao_Selecte( context, isSelected)
--获取当前拼图的configID
local configID = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.target_entity_id })
if isSelected == 1 then
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : In Select")
--将所有被踩到的拼图加入缓存区
local i = LF_TempValueInsert( context, "SelectPlat", configID, true )
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 当前进入的是第 "..i.." 块拼图")
--如果是第一块进入的拼图
if i == 1 then
--设置操作台按键、拼图发光
ScriptLib.SetEntityServerGlobalValueByConfigId(context, configID, "SGV_HUARONGDAO_MOVE", 1)
--当前非移动状态则直接设置按键否则需要在reachpoint时补按键
if ScriptLib.GetGroupTempValue(context, "PlatInMove",{})==0 then
ScriptLib.SetWorktopOptionsByGroupId(context, groupID, configID, {OptionID})
end
end
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 缓存容量: "..i)
--测试LOG
-- for i=1,10 do
-- if ScriptLib.GetGroupTempValue(context, "SelectPlat"..i, {}) == 0 then
-- break
-- else
-- ScriptLib.PrintContextLog(context, "## HRD_LOG2 : AfterInsert Slot "..i.." Value ==== "..ScriptLib.GetGroupTempValue(context, "SelectPlat"..i, {}))
-- end
-- end
else
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : Out Select")
--取消操作台按键,拼图不发光
ScriptLib.SetEntityServerGlobalValueByConfigId(context, configID, "SGV_HUARONGDAO_MOVE", 0)
ScriptLib.DelWorktopOptionByGroupId(context, groupID, configID, OptionID)
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 删除按键configID = "..configID)
--将离开范围的拼图移除缓存区
LF_TempValueRemoveByValue( context, "SelectPlat", configID )
--如果缓存区还有拼图,设置发光和按键
if ScriptLib.GetGroupTempValue(context, "SelectPlat1", {}) ~= 0 and ScriptLib.GetGroupTempValue(context, "PlatInMove",{})==0 then
ScriptLib.SetEntityServerGlobalValueByConfigId(context, ScriptLib.GetGroupTempValue(context, "SelectPlat1", {}), "SGV_HUARONGDAO_MOVE", 1)
ScriptLib.SetWorktopOptionsByGroupId(context, groupID, ScriptLib.GetGroupTempValue(context, "SelectPlat1", {}), {OptionID})
end
--测试LOG
for i=1,10 do
if ScriptLib.GetGroupTempValue(context, "SelectPlat"..i, {}) == 0 then
break
else
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : AfterInsert Slot "..i.." Value ==== "..ScriptLib.GetGroupTempValue(context, "SelectPlat"..i, {}))
end
end
end
return 0
end
function action_OptionDown( context,evt )
--联机下不可使用
if ScriptLib.CheckIsInMpMode(context) then
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 联机下不可使用")
ScriptLib.AssignPlayerShowTemplateReminder(context, 165, {param_vec={},param_uid_vec={},uid_vec={context.uid}})
return 0
end
--板块移动按键,按下后移动板块
if evt.param2 == OptionID then
ScriptLib.SetGroupTempValue(context, "PlatInMove",1,{})
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 平台移动ConfigID = "..evt.param1)
local BlankPoint = LF_GetBlankPoint(context)
--删除缓存
local sum = LF_TempValueGetSize( context, "SelectPlat" )
for i=2,sum do
ScriptLib.PrintContextLog(context, "## HRD_LOG2 : 按下按键,删除缓存, value = "..ScriptLib.GetGroupTempValue(context, "SelectPlat"..i,{}))
LF_TempValueRemoveByIndex( context, "SelectPlat", i )
end
--清理按键和状态
for i,v in ipairs(PlatList) do
--除了被移动的板块,其他板块都清理状态
if v ~= 0 and v ~= evt.param1 then
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, v, 0)
end
--移动过程中,所有平台清理按键
if v ~= 0 then
ScriptLib.DelWorktopOptionByGroupId(context, groupID, v, OptionID)
end
end
ScriptLib.PrintContextLog(context, "## HRD_LOG : Start Move")
ScriptLib.SetPlatformPointArray(context, evt.param1, ArrayID, {BlankPoint}, {route_type = 0})
--更新variable列表
for i=1,9 do
if ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i) == evt.param1 then
ScriptLib.SetGroupVariableValue(context, "PlatPoint"..i, 0)
break
end
end
ScriptLib.SetGroupVariableValue(context, "PlatPoint"..BlankPoint, evt.param1)
ScriptLib.PrintContextLog(context, "## HRD_LOG : Set Point"..BlankPoint.." to "..evt.param1)
--提前准备好状态
LF_SetOption(context)
--测试LOG
-- for i=1,9 do
-- ScriptLib.PrintContextLog(context, "## HRD_LOG : Get Point Value Point "..i.." IS "..ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i))
-- end
elseif evt.param2 == RestartOption then
--按下重来按键后,恢复到初始图案
ScriptLib.SetGroupTempValue(context, "PlatInMove",0,{})
--删除缓存
local sum = LF_TempValueGetSize( context, "SelectPlat" )
if sum~= 0 then
for i= 1,sum do
LF_TempValueRemoveByIndex( context, "SelectPlat", i )
end
end
for i=1,9 do
local CurConfigID = ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i)
ScriptLib.PrintContextLog(context, "## HRD_LOG : Get Point Value Point "..i.." IS "..CurConfigID)
if CurConfigID~=0 then
ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, CurConfigID)
end
--把初始数据塞回去
ScriptLib.SetGroupVariableValue(context, "PlatPoint"..i, initPlatList[i])
end
--创建散装板块
for i=1,9 do
local CurConfigID = ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i)
ScriptLib.PrintContextLog(context, "## HRD_LOG : Get Point Value Point "..i.." IS "..CurConfigID)
if CurConfigID~=0 then
ScriptLib.CreateGadgetByConfigIdByPos(context, CurConfigID, PointList[i].pos, PointList[i].rot)
end
end
LF_SetPlatState(context, 0)
LF_SetOption(context)
elseif evt.param2 == successOptionID then
--按下任务流转按键
--任务进度流转,关卡进度流转
ScriptLib.AddQuestProgress(context, "7227622")
ScriptLib.SetGroupVariableValue(context, "stageflag", 1)
ScriptLib.SetGroupVariableValue(context, "PuzzleFlag", 3)
--删除操作台按键
ScriptLib.DelWorktopOptionByGroupId(context, groupID, operatorConfigID, successOptionID)
--删除底板、参照板、散装板
ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, baseConfigID )
ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, referenceConfigID )
ScriptLib.RemoveExtraGroupSuite(context, groupID, 2)
--创建完整板
ScriptLib.CreateGadget(context, { config_id = borderConfigID })
end
return 0
end
function action_GroupLoad( context, evt)
ScriptLib.PrintContextLog(context, "## HRD_LOG : Group加载")
ScriptLib.SetGroupTempValue(context, "PlatInMove",0,{})
--根据任务状态还原
local uidList = ScriptLib.GetSceneUidList(context)
if next(uidList)~=nil then
local avatar_entity = ScriptLib.GetAvatarEntityIdByUid(context, uidList[1])
ScriptLib.PrintContextLog(context, "## HRD_LOG : QuestState is "..ScriptLib.GetQuestState(context, avatar_entity, 7227622))
if ScriptLib.GetQuestState(context, avatar_entity, 7227622) == QuestState.UNFINISHED then
-- 将本组内变量名为 "stageflag" 的变量设置为 0
ScriptLib.SetGroupVariableValue(context, "stageflag", 0)
-- 增加启动按钮
ScriptLib.SetWorktopOptionsByGroupId(context, 177005076, 76010, {703})
--加载底板
ScriptLib.CreateGadget(context, { config_id = 76019 })
--加载原版参照
ScriptLib.CreateGadget(context, { config_id = 76021 })
-- 卸载完整华容道
ScriptLib.RemoveEntityByConfigId(context, 177005076, EntityType.GADGET, 76018 )
-- 添加suite2的所有内容
ScriptLib.AddExtraGroupSuite(context, 177005076, 2)
-- 将本组内变量名为 "stageflag" 的变量设置为 0
ScriptLib.SetGroupVariableValue(context, "PuzzleFlag", 2)
end
end
ScriptLib.PrintContextLog(context, "## HRD_LOG : 重载后PUZZLEFLAG = "..ScriptLib.GetGroupVariableValue(context, "PuzzleFlag"))
--根据玩法状态创建板块
if ScriptLib.GetGroupVariableValue(context, "PuzzleFlag")==1 or ScriptLib.GetGroupVariableValue(context, "PuzzleFlag")==2 then
--创建散装板块
for i=1,9 do
local CurConfigID = ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i)
ScriptLib.PrintContextLog(context, "## HRD_LOG : Get Point Value Point "..i.." IS "..CurConfigID)
if CurConfigID~=0 then
ScriptLib.CreateGadgetByConfigIdByPos(context, CurConfigID, PointList[i].pos, PointList[i].rot)
end
end
--根据玩法状态设置平台状态
if ScriptLib.GetGroupVariableValue(context, "PuzzleFlag") == 1 then
--重设状态,开启按键
LF_SetPlatState(context, 0)
LF_SetOption(context)
end
--LD在WQ中处理了
-- elseif ScriptLib.GetGroupVariableValue(context, "PuzzleFlag")>2 then
-- --创建整体板块
-- ScriptLib.CreateGadget(context, { config_id = borderConfigID })
end
--删除缓存
local sum = LF_TempValueGetSize( context, "SelectPlat" )
ScriptLib.PrintContextLog(context, "## HRD_LOG : Group加载, 缓存尺寸为"..sum)
if sum~= 0 then
for i= 1,sum do
LF_TempValueRemoveByIndex( context, "SelectPlat", i )
end
end
return 0
end
--查空point
function LF_GetBlankPoint( context)
for i=1,9 do
if ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i) == 0 then
--ScriptLib.PrintContextLog(context, "## HRD_LOG : BlankPoint Is"..i)
return i
end
end
end
--查找可移动操作台
function LF_FindMoveablePlat( context)
local BlankPoint = LF_GetBlankPoint(context)
local MoveablePlatList = {}
--在最左列
if BlankPoint%3 == 1 then
if BlankPoint - 3 > 0 then
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint - 3)
table.insert(MoveablePlatList, BlankPoint - 3)
end
if BlankPoint + 3 < 10 then
table.insert(MoveablePlatList, BlankPoint + 3)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint + 3)
end
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint + 1)
table.insert(MoveablePlatList, BlankPoint + 1)
end
--在最右列
if BlankPoint%3 == 0 then
if BlankPoint - 3 > 0 then
table.insert(MoveablePlatList, BlankPoint - 3)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint - 3)
end
if BlankPoint + 3 < 10 then
table.insert(MoveablePlatList, BlankPoint + 3)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint + 3)
end
table.insert(MoveablePlatList, BlankPoint - 1)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint - 1)
end
--在中列
if BlankPoint%3 == 2 then
if BlankPoint - 3 > 0 then
table.insert(MoveablePlatList, BlankPoint - 3)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint - 3)
end
if BlankPoint + 3 < 10 then
table.insert(MoveablePlatList, BlankPoint + 3)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint + 3)
end
table.insert(MoveablePlatList, BlankPoint + 1)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint + 1)
table.insert(MoveablePlatList, BlankPoint - 1)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : Find Moveable Point"..BlankPoint - 1)
end
return MoveablePlatList
end
--设置操作台按键
function LF_SetOption(context)
local MoveablePlatList = LF_FindMoveablePlat( context)
for i,v in ipairs(MoveablePlatList) do
local PlatConfigID = ScriptLib.GetGroupVariableValue(context, "PlatPoint"..v)
ScriptLib.PrintContextLog(context, "## HRD_LOG : SET OPTION, PLATCONFIGID IS "..PlatConfigID)
--ScriptLib.SetWorktopOptionsByGroupId(context, groupID, PlatConfigID, {OptionID})
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, PlatConfigID, 203)
end
return 0
end
--设置平台到指定的state
function LF_SetPlatState( context, gadgetState )
for i,v in ipairs(PlatList) do
if v ~= 0 then
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, v, gadgetState)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, v, "SGV_HUARONGDAO_MOVE", 0)
end
end
return 0
end
--成功判定
function CheckPointAndPlat( context)
for i=1,9 do
if ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i) ~= PlatList[i] then
ScriptLib.PrintContextLog(context, "## HRD_LOG : Not Right")
return false
end
end
ScriptLib.PrintContextLog(context, "## HRD_LOG : Right")
return true
end
--创建一个开始按键
function action_GadgetStateChange( context,evt )
--完成第一次碎片提交
if evt.param2 == offeringConfigID and evt.param1 == 201 then
ScriptLib.PrintContextLog(context, "## HRD_LOG : set RestartOption ")
--设置操作台开关显示为——重启玩法
ScriptLib.SetWorktopOptionsByGroupId(context, groupID, operatorConfigID, {RestartOption})
--创建散装板块
for i=1,9 do
local CurConfigID = ScriptLib.GetGroupVariableValue(context, "PlatPoint"..i)
ScriptLib.PrintContextLog(context, "## HRD_LOG : Get Point Value Point "..i.." IS "..CurConfigID)
if CurConfigID~=0 then
ScriptLib.CreateGadgetByConfigIdByPos(context, CurConfigID, PointList[i].pos, PointList[i].rot)
end
end
--设置玩法状态
ScriptLib.SetGroupVariableValue(context, "PuzzleFlag", 1)
--设置板块按键
LF_SetPlatState(context, 0)
LF_SetOption(context)
end
--完成第二次碎片提交
if evt.param2 == lastOfferingConfigID and evt.param1 == 201 then
--切换整版拼图状态
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, completeConfigID, 201)
--创建中心拼图
ScriptLib.CreateGadget(context, { config_id = centreConfigID })
--设置玩法状态
ScriptLib.SetGroupVariableValue(context, "PuzzleFlag", 4)
end
return 0
end
--移动平台reach point判定是否成功重设按键
function action_PlatReachPoint( context,evt )
ScriptLib.PrintContextLog(context, "## HRD_LOG : reachPoint")
if CheckPointAndPlat(context) == true then
--设置挑战完成
ScriptLib.SetWorktopOptionsByGroupId(context, groupID, operatorConfigID, {successOptionID})
--设置玩法状态
ScriptLib.SetGroupVariableValue(context, "PuzzleFlag", 2)
--设置平台状态到201发光
LF_SetPlatState(context, 201)
--创建一次光效
ScriptLib.CreateGadget(context, { config_id = successConfigID })
else
ScriptLib.SetGroupTempValue(context, "PlatInMove",0,{})
--重新设置操作台按键
--ScriptLib.PrintContextLog(context, "## HRD_LOG : ReSet Option")
-- LF_SetOption(context)
--ScriptLib.PrintContextLog(context, "## HRD_LOG : SGV = "..ScriptLib.GetGadgetAbilityFloatValue(context, groupID, evt.param1, "SGV_HUARONGDAO_MOVE"))
if LF_GetTempValueByIndex( context, "SelectPlat", 1 )~=nil then
ScriptLib.SetWorktopOptionsByGroupId(context, groupID, LF_GetTempValueByIndex( context, "SelectPlat", 1 ), {OptionID})
ScriptLib.SetEntityServerGlobalValueByConfigId(context, LF_GetTempValueByIndex( context, "SelectPlat", 1 ), "SGV_HUARONGDAO_MOVE", 1)
end
end
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,156 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || RecircleChallenge
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本,黑色剑气循环挑战
|| LogName || ## RC_LOG
|| Protection || 挑战成功、失败group卸载时清空怪物所有玩家出圈时设置挑战失败
=====================================================================================================================
-- local defs = {
-- --groupID
-- groupID = 177006001,
-- --挑战操作台
-- challenge_gadget = 1006,
-- --挑战时间
-- duration = 240,
-- --出范围失败region
-- regionID = 1008,
-- --挑战ID
-- challengeID = 111195,
-- --怪物列表
-- monster_array = {1001,1002,1003,1004,1005},
-- monster_min = 5,
-- monster_max = 5,
-- monster_count = 5
-- }
=======================================================================================]]
local extrTriggers = {
initialtrigger = {
["Interact_Dwon"] = { config_id = 80000002, name = "Interact_Dwon", event= EventType.EVENT_MICHIAE_INTERACT, source = "", condition = "", action = "action_InteractDwon", trigger_count = 0 },
["Challenge_Success"] = { config_id = 80000003, name = "Challenge_Success", event= EventType.EVENT_CHALLENGE_SUCCESS, source = "233", condition = "", action = "action_ChallengeSuccess", trigger_count = 0 },
["Challenge_Fail"] = { config_id = 80000004, name = "Challenge_Fail", event= EventType.EVENT_CHALLENGE_FAIL, source = "233", condition = "", action = "action_ChallengeFail", trigger_count = 0 },
["Group_Unload"] = { config_id = 80000005, name = "Group_Unload", event= EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_GroupUnload", trigger_count = 0 },
["Leave_Region"] = { config_id = 80000006, name = "Leave_Region", event= EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_LeaveRegion", trigger_count = 0,forbid_guest = false },
["Group_Refresh"] = { config_id = 80000007, name = "Group_Refresh", event= EventType.EVENT_GROUP_REFRESH, source = "", condition = "", action = "action_GroupRefresh", trigger_count = 0 },
}
}
--local challengeID = 0
--local groupID = 1
--local switchGadgetID = 1
local challengeRange = 50
function LF_GetPointDistance(x1,y1,x2,y2)
return math.sqrt(math.pow((y2-y1),2)+math.pow((x2-x1),2))
end
function action_LeaveRegion( context, evt)
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR })~=0 then
return 0
end
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
ScriptLib.StopChallenge(context, 233, 0)
return 0
end
function action_GroupRefresh( context, evt )
ScriptLib.PrintContextLog(context,"RC_LOG: Group Refresh")
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
return 0
end
function action_GroupUnload( context, evt)
ScriptLib.PrintContextLog(context,"RC_LOG: Group Unload")
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
if ScriptLib.GetGadgetStateByConfigId(context, defs.groupID, defs.challenge_gadget) == 202 then
return 0
end
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 0)
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
return 0
end
function action_InteractDwon( context, evt )
ScriptLib.PrintContextLog(context,"RC_LOG: ChallengeMode = "..ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}))
if evt.param1 ~= 2 then
return 0
end
if ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}) ~=0 then
return 0
end
ScriptLib.PrintContextLog(context,"RC_LOG: Start Challenge")
ScriptLib.StartChallenge(context, 233, defs.challengeID,{defs.duration,defs.groupID,defs.monster_count})
--ScriptLib.ActiveChallenge(context, 233, defs.challengeID, defs.duration, defs.groupID, defs.monster_count, 0 )
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 201)
ScriptLib.AutoMonsterTide(context, 1, defs.groupID, defs.monster_array, defs.monster_count, defs.monster_min, defs.monster_max)
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 1, {})
return 0
end
function action_ChallengeSuccess( context, evt )
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
ScriptLib.updateBundleMarkShowStateByGroupId(context, defs.groupID, false)
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 202)
return 0
end
function action_ChallengeFail( context, evt )
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 0)
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,317 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || ReviveBoss 双子BOSS挑战
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本复活怪物挑战挑战需要杀死两个能互相复活的怪物挑战部分LD自行处理
|| LogName || ## ReviveBoss_LOG
|| Protection || 1. 使用精确计数而非判定当前group怪物清空防止LD布设小怪导致挑战无法完成
=====================================================================================================================
--local BossConfigID = {1,1}
--local bossReviveTime = 30
--local ReviveGadgetID = 0
--local OperatorConfigID = 0
--local OptionID = 0
--local ChallengeID = 0
--local ChallengeDuration = 0
--local ChestID = 0
--local GroupID = 0
=======================================================================================]]
--12.23 b1328470 LD自行处理失败使用不可言说控制所有逻辑
local Global = {
DieY = 105
}
local extrTriggers = {
initialtrigger = {
["Boss_Die"] = { config_id = 8000001, name = "Boss_Die", event= EventType.EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE, source = "", condition = "condition_WhenBossDie", action = "action_WhenBossDie", trigger_count = 0 },
["Revive_Timer"] = { config_id = 8000002, name = "Revive_Timer", event= EventType.EVENT_TIME_AXIS_PASS, source = "bossReviveTimer", condition = "", action = "action_BossReviveTimer", trigger_count = 0 },
["Challenge_Success"] = { config_id = 8000003, name = "Challenge_Success", event= EventType.EVENT_CHALLENGE_SUCCESS, source = "233", condition = "", action = "action_ChallengeSuccess", trigger_count = 0 },
["Challenge_Fail"] = { config_id = 8000004, name = "Challenge_Fail", event= EventType.EVENT_CHALLENGE_FAIL, source = "233", condition = "", action = "action_ChallengeFail", trigger_count = 0 },
["Group_Unload"] = { config_id = 8000005, name = "Group_Unload", event= EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_GroupUnload", trigger_count = 0 },
["Option_Down"] = { config_id = 8000006, name = "Option_Down", event= EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_OptionDown", trigger_count = 0 },
["Time_Axis"] = { config_id = 8000007, name = "Time_Axis", event= EventType.EVENT_TIME_AXIS_PASS, source = "revivenotice", condition = "", action = "action_TimeAxis", trigger_count = 0 },
["Group_Load"] = { config_id = 8000009, name = "Group_Load", event= EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_GroupLoad", trigger_count = 0 },
["State_Change"] = { config_id = 8000010, name = "State_Change", event= EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_GadgetStateChange", trigger_count = 0 },
}
}
function action_ChallengeSuccess( context, evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Challenge_Success")
--收怪
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[1])
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[2])
--收复活法阵
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.GADGET, ReviveGadgetID)
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 202)
ScriptLib.EndTimeAxis(context, "bossReviveTimer")
ScriptLib.EndTimeAxis(context, "revivenotice")
ScriptLib.CreateGadget(context, { config_id = ChestID })
ScriptLib.SetGroupVariableValue(context, "isFinish", 2)
return 0
end
function action_GadgetStateChange( context, evt )
if evt.param1 ~= 0 or evt.param2 ~= OperatorConfigID then
return 0
end
--设置按键
ScriptLib.SetWorktopOptionsByGroupId(context, GroupID, OperatorConfigID, {OptionID})
--设置进度
ScriptLib.SetGroupVariableValue(context, "isFinish", 1)
return 0
end
function action_ChallengeFail( context, evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Challenge_Fail")
--收怪
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[1])
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[2])
--收复活法阵
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.GADGET, ReviveGadgetID)
--恢复按键
ScriptLib.SetWorktopOptionsByGroupId(context, GroupID, OperatorConfigID, {OptionID})
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 0)
--删除时间轴
ScriptLib.EndTimeAxis(context, "bossReviveTimer")
ScriptLib.EndTimeAxis(context, "revivenotice")
return 0
end
function action_GroupUnload( context, evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Group Group_Unload")
if ScriptLib.GetGroupVariableValue(context, "isFinish") ~= 1 then
return 0
end
--收怪
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[1])
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[2])
--恢复按键
ScriptLib.SetWorktopOptionsByGroupId(context, GroupID, OperatorConfigID, {OptionID})
--收复活法阵
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.GADGET, ReviveGadgetID)
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 0)
--删除时间轴
ScriptLib.EndTimeAxis(context, "bossReviveTimer")
ScriptLib.EndTimeAxis(context, "revivenotice")
return 0
end
function action_GroupLoad( context, evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Group Group Load")
if ScriptLib.GetGroupVariableValue(context, "isFinish")==0 then
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 204)
elseif ScriptLib.GetGroupVariableValue(context, "isFinish")==1 then
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 0)
elseif ScriptLib.GetGroupVariableValue(context, "isFinish")==2 then
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 202)
end
--收复活法阵
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.GADGET, ReviveGadgetID)
--收怪
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[1])
ScriptLib.RemoveEntityByConfigId(context, GroupID, EntityType.MONSTER, BossConfigID[2])
return 0
end
function action_OptionDown( context, evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Option_Down")
--开挑战参数固定直接写死触发一次variablechange之后挑战完成 233为挑战ID 3代表需要触发的EVENT类型999为triggertag1为触发次数
ScriptLib.StartChallenge(context, 233, ChallengeID, {ChallengeDuration,1,999,1})
--放怪
ScriptLib.CreateMonster(context, { config_id = BossConfigID[1], delay_time = 0 })
ScriptLib.CreateMonster(context, { config_id = BossConfigID[2], delay_time = 0 })
--删按键
ScriptLib.DelWorktopOptionByGroupId(context, GroupID, OperatorConfigID, OptionID)
--设置BOSS变量
ScriptLib.SetGroupTempValue(context, "DieBossCount", 0, {})
--设置挑战台状态
ScriptLib.SetGadgetStateByConfigId(context, OperatorConfigID, 201)
return 0
end
function action_TimeAxis( context, evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Notice Time_Axis")
--播出第二个计时通知
ScriptLib.ShowReminder(context, 400129)
return 0
end
function action_WhenBossDie(context,evt )
--设置挑战成功
ScriptLib.StopChallenge(context, 233, 1)
return 0
end
function condition_WhenBossDie( context,evt )
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Monster_Die")
if evt.param1 ~= BossConfigID[1] and evt.param1 ~= BossConfigID[2] then
return false
end
--死亡BOSS数量累加
if ScriptLib.ChangeGroupTempValue(context, "DieBossCount", 1, {}) == -1 then
ScriptLib.PrintContextLog(context, "## RB_LOG : init DieBossCount")
ScriptLib.SetGroupTempValue(context, "DieBossCount", 1, {})
end
--获取当前Boss死亡数量
if ScriptLib.GetGroupTempValue(context, "DieBossCount", {}) == 1 then
ScriptLib.PrintContextLog(context, "## RB_LOG : entityID: "..evt.source_eid)
local DiePos = ScriptLib.GetPosByEntityId(context, evt.source_eid)
--开启复活时间轴
ScriptLib.InitTimeAxis(context, "bossReviveTimer", {bossReviveTime}, false)
--记下当前死亡的BOSSconfigID
ScriptLib.SetGroupTempValue(context, "DieBossID", evt.param1, {})
if Global.DieY <105 or math.abs(DiePos.y-Global.DieY)<30 then
local monsterConfig = {}
for i,v in ipairs(monsters) do
if v.config_id == evt.param1 then
monsterConfig = v
end
end
--使用config位置创生
ScriptLib.SetGroupTempValue(context, "DieX", math.floor(monsterConfig.pos.x), {})
ScriptLib.SetGroupTempValue(context, "DieY", math.floor(monsterConfig.pos.y), {})
ScriptLib.SetGroupTempValue(context, "DieZ", math.floor(monsterConfig.pos.z), {})
ScriptLib.PrintContextLog(context, "## RB_LOG : X: "..monsterConfig.pos.x)
ScriptLib.PrintContextLog(context, "## RB_LOG : Y: "..monsterConfig.pos.y)
ScriptLib.PrintContextLog(context, "## RB_LOG : Z: "..monsterConfig.pos.z)
else
--记下当前死亡BOSS的POS
ScriptLib.SetGroupTempValue(context, "DieX", math.floor(DiePos.x), {})
ScriptLib.SetGroupTempValue(context, "DieY", math.floor(DiePos.y), {})
ScriptLib.SetGroupTempValue(context, "DieZ", math.floor(DiePos.z), {})
ScriptLib.PrintContextLog(context, "## RB_LOG : X: "..ScriptLib.GetGroupTempValue(context, "DieX",{}))
ScriptLib.PrintContextLog(context, "## RB_LOG : Y: "..ScriptLib.GetGroupTempValue(context, "DieY",{}))
ScriptLib.PrintContextLog(context, "## RB_LOG : Z: "..ScriptLib.GetGroupTempValue(context, "DieZ",{}))
end
--在死亡点创建Gadget
ScriptLib.CreateGadgetByConfigIdByPos(context, ReviveGadgetID, {x= ScriptLib.GetGroupTempValue(context, "DieX", {}) ,y= ScriptLib.GetGroupTempValue(context, "DieY", {}) ,z= ScriptLib.GetGroupTempValue(context, "DieZ", {}) }, {x=0,y=0,z=0})
--播出第一个计时通知消息,并开启计时器
ScriptLib.ShowReminder(context, 400128)
ScriptLib.InitTimeAxis(context, "revivenotice", {10}, false)
return false
end
return true
end
function action_BossReviveTimer( context,evt)
ScriptLib.PrintContextLog(context, "## ReviveBoss_LOG : Revive_Timer")
--复活死亡的BOSS
--取出当前死亡的BOSSconfigID
local ReviveID = ScriptLib.GetGroupTempValue(context, "DieBossID", {})
ScriptLib.CreateMonsterByConfigIdByPos(context, ReviveID, {x= ScriptLib.GetGroupTempValue(context, "DieX", {}) ,y= ScriptLib.GetGroupTempValue(context, "DieY", {}) ,z= ScriptLib.GetGroupTempValue(context, "DieZ", {}) }, {x=0,y=0,z=0})
--死亡计数-1
ScriptLib.ChangeGroupTempValue(context, "DieBossCount", -1, {})
--移除定点gadget
ScriptLib.KillEntityByConfigId(context, {config_id = ReviveGadgetID})
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,63 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || ReviveCrystalEnergy 雕像刷新循环玩法
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本,中心雕像交互后刷新循环玩法
|| LogName || ## ReviveCrystal_LOG
|| Protection || /
=====================================================================================================================
=======================================================================================]]
local extrTriggers = {
initialtrigger = {
["Interact_Dwon"] = { config_id = 80000002, name = "Interact_Dwon", event= EventType.EVENT_MICHIAE_INTERACT, source = "", condition = "", action = "action_InteractDwon", trigger_count = 0 },
}
}
--local refreshGroupIDList = {}
function action_InteractDwon( context, evt )
ScriptLib.PrintContextLog(context,"## ReviveCrystal_LOG: Interact_Dwon")
if evt.param1 == 4 then
--以雕像为中心发送reminder
ScriptLib.ShowReminderRadius(context, 600103, {x= 283, y= 314, z= 335}, 50)
elseif evt.param1 == 1 then
--刷新挑战group重新开UI开关
for i,v in ipairs(refreshGroupIDList) do
ScriptLib.PrintContextLog(context,"## ReviveCrystal_LOG: revive id is "..v)
ScriptLib.RefreshGroup(context, { group_id = v, suite = 1 })
--打开地图UI开关
ScriptLib.updateBundleMarkShowStateByGroupId(context, v, true)
end
--刷新非挑战group不开UI开关
for i,v in ipairs(refreshEnergyGroupIDList) do
ScriptLib.PrintContextLog(context,"## ReviveCrystal_LOG: revive id is "..v)
ScriptLib.RefreshGroup(context, { group_id = v, suite = 1 })
end
end
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,45 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
local extrTriggers = {
initialtrigger = {
["GadgetStateChange"] = { config_id = 8000004, name = "GadgetStateChange", event= EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_GadgetStateChange", trigger_count = 0 },
["Group_Load"] = { config_id = 8000005, name = "Group_Load", event= EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_GroupLoad", trigger_count = 0 },
["Player_Die"] = { name = "any_player_die", config_id = 8000012, event = EventType.EVENT_SCENE_MP_PLAY_ALL_AVATAR_DIE, source = "", condition = "", action = "action_any_player_die", trigger_count = 0 }
}
}
function action_GroupLoad( context, evt)
ScriptLib.PrintContextLog(context, "## TEST_LOG : Group Load")
return 0
end
function action_GadgetStateChange( context, evt )
-- ScriptLib.PrintContextLog(context, "## TEST_LOG : Group Refresh 144001009 Return "..ScriptLib.RefreshGroup(context, { group_id = 144001009, suite = 1 }))
-- ScriptLib.PrintContextLog(context, "## TEST_LOG : Group Refresh 177005038 Return "..ScriptLib.RefreshGroup(context, { group_id = 177005038, suite = 1 }))
return 0
end
function action_any_player_die(context, evt)
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || Wathcer_Energy 千灯垂绿watcher
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本,千灯垂绿的陈列室计数、运营埋点
|| LogName || /
|| Protection || /
=====================================================================================================================
=======================================================================================]]
local extrTriggers = {
initialtrigger = {
["Option_Down"] = { config_id = 80000002, name = "Option_Down", event= EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_OptionDown", trigger_count = 0, forbid_guest = false },
}
}
local optionID = 700
function action_OptionDown( context, evt )
if evt.param2 ~= optionID then
return 0
end
ScriptLib.DelWorktopOptionByGroupId(context, 0, evt.param1, optionID)
ScriptLib.AddRegionalPlayVarValue(context, context.uid, 2501, 30)
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, evt.param1, 201)
--陈列室记录
ScriptLib.AddExhibitionAccumulableData(context, context.uid, "Activity_Michiae_watcher_energy_charge", 1)
--运营数据埋点
ScriptLib.MarkGroupLuaAction(context, "MichiaeMatsuri_2","" , { EnergyAdd = 30, CurEnergy = math.floor(ScriptLib.GetRegionalPlayVarValue(context, context.uid, 2501)), CurPressure = math.floor(ScriptLib.GetRegionalPlayVarValue(context, context.uid, 2500)) })
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,43 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || Wathcer_Puzzle 光线解谜Watcher
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本,光线解谜陈列室计数
|| LogName || /
|| Protection || /
=====================================================================================================================
=======================================================================================]]
local extrTriggers = {
initialtrigger = {
["GadgetStateChange"] = { config_id = 80000004, name = "GadgetStateChange", event= EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_GadgetStateChange", trigger_count = 0 },
}
}
function action_GadgetStateChange( context, evt )
if evt.param1 ~= 201 or ScriptLib.GetGadgetIdByEntityId(context, evt.source_eid) ~= 70330141 then
return 0
end
ScriptLib.AddExhibitionAccumulableData(context, ScriptLib.GetSceneOwnerUid(context), "Activity_Michiae_watcher_refraction_puzzle", 1)
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()

View File

@@ -0,0 +1,48 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || Wathcer_Tower 暗夜塔Wathcer
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5版本,暗夜塔陈列室、运营埋点
|| LogName || /
|| Protection || /
=====================================================================================================================
=======================================================================================]]
local extrTriggers = {
initialtrigger = {
["GadgetStateChange"] = { config_id = 80000004, name = "GadgetStateChange", event= EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_GadgetStateChange", trigger_count = 0 },
}
}
function action_GadgetStateChange( context, evt )
if evt.param1 ~= 201 or ScriptLib.GetGadgetIdByEntityId(context, evt.source_eid) ~= 70330154 then
return 0
end
--陈列室计数
ScriptLib.AddExhibitionAccumulableData(context, ScriptLib.GetSceneOwnerUid(context), "Activity_Michiae_watcher_abyss_tower", 1)
--运营数据埋点
ScriptLib.MarkGroupLuaAction(context, "MichiaeMatsuri_1","" , {})
return 0
end
function LF_Initialize_Group()
for k,v in pairs(extrTriggers.initialtrigger) do
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
return 0
end
LF_Initialize_Group()