修复活动大厅
This commit is contained in:
parent
1858824fdb
commit
a5e22c39c2
1 changed files with 74 additions and 23 deletions
|
|
@ -143,6 +143,56 @@ HuodongzhongxinOBJ.openVar = {
|
|||
|
||||
HuodongzhongxinOBJ.BingMoMon = Func.require("cfg_冰魔之地刷怪")
|
||||
|
||||
HuodongzhongxinOBJ.activityMapCfg = {
|
||||
["圣域"] = function()
|
||||
return (Sys.getint(VarCfg.sys.int["圣域夺宝"]) or 0) == 1
|
||||
end,
|
||||
["起始之地"] = function()
|
||||
local status = Sys.getint(VarCfg.sys.int["冰魔之地"]) or 0
|
||||
return status == 1 or status == 2
|
||||
end,
|
||||
["魔兽前哨"] = function()
|
||||
local status = Sys.getint(VarCfg.sys.int["冰魔之地"]) or 0
|
||||
return status == 1 or status == 2
|
||||
end,
|
||||
["巨魔巢穴"] = function()
|
||||
local status = Sys.getint(VarCfg.sys.int["冰魔之地"]) or 0
|
||||
return status == 1 or status == 2
|
||||
end,
|
||||
["勇者大乱斗"] = function()
|
||||
return (Sys.getint(VarCfg.sys.int["大乱斗"]) or 0) == 1
|
||||
end,
|
||||
}
|
||||
|
||||
function HuodongzhongxinOBJ:kickPlayer(player, msg)
|
||||
if msg then
|
||||
Func.sendmsg9(player, msg)
|
||||
end
|
||||
mapmove(player, "3", 330, 330, 8)
|
||||
end
|
||||
|
||||
function HuodongzhongxinOBJ:kickPlayersInMaps(mapSet, msg)
|
||||
local player_list = getplayerlst(0)
|
||||
for _, player in ipairs(player_list or {}) do
|
||||
local mapid = getbaseinfo(player, ConstCfg.gbase.mapid)
|
||||
if mapSet[mapid] then
|
||||
self:kickPlayer(player, msg)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function HuodongzhongxinOBJ:checkActivityMap(player)
|
||||
local mapid = getbaseinfo(player, ConstCfg.gbase.mapid)
|
||||
local checkFunc = self.activityMapCfg[mapid]
|
||||
if checkFunc and not checkFunc() then
|
||||
Player.setTLint(player, VarCfg.Player.TL.int["大乱斗已报名"], 0)
|
||||
Player.setTLint(player, VarCfg.Player.TL.int["大乱斗积分"], 0)
|
||||
self:kickPlayer(player, "[活动大厅]:#70|活动已结束,已自动传送回安全区!")
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
|
||||
function HuodongzhongxinOBJ:up(actor, p1, p2, p3, data)
|
||||
|
|
@ -184,14 +234,8 @@ function huodongzhongxinobj_shengyu_start(sys)
|
|||
end
|
||||
|
||||
function huodongzhongxinobj_shengyu_end(sys)
|
||||
local player_list = getplayerlst(0)
|
||||
for i, player in ipairs(player_list or {}) do
|
||||
local mapid = getbaseinfo(player, ConstCfg.gbase.mapid)
|
||||
if mapid == "圣域" then
|
||||
MapCfg.gotomap(actor, "3", 330, 330, 8)
|
||||
end
|
||||
end
|
||||
Sys.setint(VarCfg.sys.int["圣域夺宝"], 2)
|
||||
HuodongzhongxinOBJ:kickPlayersInMaps({ ["圣域"] = true }, "[活动大厅]:#70|圣域夺宝已经结束,已自动传送回安全区!")
|
||||
sendmsg(-1, 2, string.format('{"Msg":"%s","FColor":251,"BColor":0,"Type":5,"Y":30}', string.format("[活动大厅]圣域夺宝已经结束!")))
|
||||
end
|
||||
|
||||
|
|
@ -222,18 +266,16 @@ function huodongzhongxinobj_binmo_start(sys)
|
|||
sendmsg(-1, 2, string.format('{"Msg":"%s","FColor":251,"BColor":0,"Type":5,"Y":30}', string.format("[活动大厅]冰魔之地已经开启,可通过活动大厅进入!")))
|
||||
end
|
||||
|
||||
function HuodongzhongxinOBJ_BinMo_End(sys)
|
||||
local player_list = getplayerlst(0)
|
||||
for i, player in ipairs(player_list or {}) do
|
||||
local mapid = getbaseinfo(player, ConstCfg.gbase.mapid)
|
||||
if mapid == "起始之地" or mapid == "魔兽前哨" or mapid == "巨魔巢穴" then
|
||||
MapCfg.gotomap(player, "3", 330, 330, 8)
|
||||
end
|
||||
end
|
||||
function huodongzhongxinobj_binmo_on(sys)
|
||||
Sys.setint(VarCfg.sys.int["冰魔之地"], 3)
|
||||
HuodongzhongxinOBJ:kickPlayersInMaps({ ["起始之地"] = true, ["魔兽前哨"] = true, ["巨魔巢穴"] = true }, "[活动大厅]:#70|冰魔之地已经结束,已自动传送回安全区!")
|
||||
sendmsg(-1, 2, string.format('{"Msg":"%s","FColor":251,"BColor":0,"Type":5,"Y":30}', string.format("[活动大厅]冰魔之地已经结束!")))
|
||||
end
|
||||
|
||||
function HuodongzhongxinOBJ_BinMo_End(sys)
|
||||
huodongzhongxinobj_binmo_on(sys)
|
||||
end
|
||||
|
||||
function huodongzhongxinobj_binmo_closemap(sys)
|
||||
Sys.setint(VarCfg.sys.int["冰魔之地"], 2)
|
||||
sendmsg(-1, 2, string.format('{"Msg":"%s","FColor":251,"BColor":0,"Type":5,"Y":30}', string.format("[活动大厅]冰魔之地已经关闭入口!")))
|
||||
|
|
@ -285,14 +327,15 @@ function huodongzhongxinobj_daluandou_end(sys)
|
|||
if Sys.getint(VarCfg.sys.int["大乱斗"]) > 0 then
|
||||
Sys.setint(VarCfg.sys.int["大乱斗"], 0)
|
||||
local player_list = getplayerlst(0)
|
||||
for i, player in ipairs(player_list or {}) do
|
||||
local _bool = Player.getTLint(player, VarCfg.Player.TL.int["大乱斗已报名"])
|
||||
if _bool then
|
||||
local _mapid = getbaseinfo(player, ConstCfg.gbase.mapid)
|
||||
if _mapid == "勇者大乱斗" then
|
||||
Player.setTLint(player, VarCfg.Player.TL.int["大乱斗已报名"], 0)
|
||||
MapCfg.gotomap(player, "3", 330, 330, 8)
|
||||
end
|
||||
for _, player in ipairs(player_list or {}) do
|
||||
local mapid = getbaseinfo(player, ConstCfg.gbase.mapid)
|
||||
local isApply = (Player.getTLint(player, VarCfg.Player.TL.int["大乱斗已报名"]) or 0) > 0
|
||||
if isApply or mapid == "勇者大乱斗" then
|
||||
Player.setTLint(player, VarCfg.Player.TL.int["大乱斗已报名"], 0)
|
||||
Player.setTLint(player, VarCfg.Player.TL.int["大乱斗积分"], 0)
|
||||
end
|
||||
if mapid == "勇者大乱斗" then
|
||||
HuodongzhongxinOBJ:kickPlayer(player, "[活动大厅]:#70|勇者大乱斗已经结束,已自动传送回安全区!")
|
||||
end
|
||||
end
|
||||
sendmsg(-1, 2, string.format('{"Msg":"%s","FColor":251,"BColor":0,"Type":5,"Y":30}', string.format("[活动大厅]勇者大乱斗已经结束,奖励直接发送到胜利者邮件,请保持在线!")))
|
||||
|
|
@ -356,6 +399,14 @@ local function HuodongzhongxinOBJ_killplay(actor, killed, Info)
|
|||
end
|
||||
GameEvent.add(EventCfg.onkillplay, HuodongzhongxinOBJ_killplay, HuodongzhongxinOBJ)
|
||||
|
||||
GameEvent.add(EventCfg.onLogin, function(actor)
|
||||
HuodongzhongxinOBJ:checkActivityMap(actor)
|
||||
end, HuodongzhongxinOBJ)
|
||||
|
||||
GameEvent.add(EventCfg.goEnterMap, function(actor)
|
||||
HuodongzhongxinOBJ:checkActivityMap(actor)
|
||||
end, HuodongzhongxinOBJ)
|
||||
|
||||
|
||||
------* 大乱斗获取排名
|
||||
function HuodongzhongxinOBJ:luandouGetData(actor, p1, p2, p3, sendata)
|
||||
|
|
|
|||
Loading…
Reference in a new issue