todownstairs = todownstairs or 0 toupstairs = toupstairs or 0 curGodcrenum = curGodcrenum or 0 curEvilcrenum = curEvilcrenum or 0 Evilbosshour = Evilbosshour or -1 Evilbossmin = Evilbossmin or -1 local function onTimerMin(_actID) local curhour = tonumber(os.date("%H")) local curmin = tonumber(os.date("%M")) if curmin == 0 then if curGodcrenum == 0 then ZLP_godlittleboss() curGodcrenum = curGodcrenum + 1 if math.random(2) < 2 then ZLP_godlittleboss() curGodcrenum = curGodcrenum + 1 end elseif curGodcrenum == 1 then if math.random(2) < 2 then ZLP_godlittleboss() curGodcrenum = curGodcrenum + 1 end end if curEvilcrenum == 0 then ZLP_evillittleboss() curEvilcrenum = curEvilcrenum + 1 if math.random(2) < 2 then ZLP_evillittleboss() curEvilcrenum = curEvilcrenum + 1 end elseif curEvilcrenum == 1 then if math.random(2) < 2 then ZLP_evillittleboss() curEvilcrenum = curEvilcrenum + 1 end end end if curhour >= 19 and curhour <= 20 then if todownstairs == 0 then map.CreateInstance(52649718, 1) toupstairs = map.MapCreateColCreature(52649718, 1, 5610071, 170, 258, 40, 1, "") ZLP_godboss() end else if todownstairs ~= 0 or toupstairs ~= 0 then -- Получаем всех игроков в инстансе и выкидываем их перед удалением local RoleTbl = map.GetMapAllRoleID(52649718, 1) if RoleTbl ~= nil then for _, v in pairs(RoleTbl) do if v ~= nil and v ~= 0 then -- Проверяем, что игрок действительно в этом инстансе local playerMap, playerInstance = role.GetRoleMapID(v) if playerMap == 52649718 and playerInstance == 1 then -- Выкидываем на безопасную карту выхода role.RoleGotoNewMap(52649718, 1, v, 3424073512, 610, 23094, 669) end end end end map.MapDeleteCreature(52646902, 1, todownstairs) map.MapDeleteCreature(52649718, 1, toupstairs) map.DeleteInstance(52649718, 1) todownstairs = 0 toupstairs = 0 end end if curhour >= 19 and curhour <= 20 then if Evilbosshour == -1 and Evilbossmin == -1 then Evilbosshour = math.random(curhour, 20) if curhour ~= Evilbosshour then Evilbossmin = math.random(0, 59) else Evilbossmin = math.random(curmin, 59) if curmin == 59 then Evilbossmin = 0 Evilbosshour = Evilbosshour + 1 else Evilbossmin = Evilbossmin + 1 end end else if Evilbosshour == curhour and Evilbossmin == curmin then ZLP_evilboss() end end else if Evilbosshour ~= -1 or Evilbossmin ~= -1 then Evilbosshour = -1 Evilbossmin = -1 end end end return { onTimerMin = onTimerMin, }