mid_autumnNPC = mid_autumnNPC or {} chuansongrenIn = chuansongrenIn or 0 curNum = curNum or 0 local function onTimerMin(_actID) local curmon = tonumber(os.date("%m")) local curday = tonumber(os.date("%d")) local curhour = tonumber(os.date("%H")) local curmin = tonumber(os.date("%M")) if MidautumnDay == 1 and curmon == 9 and curday < 20 then if #mid_autumnNPC == 0 then mid_autumnNPC[1] = map.MapCreateCreature(3424073512, -1, 5600066, 603, 23094, 683) mid_autumnNPC[2] = map.MapCreateCreature(3424073512, -1, 5600067, 597, 23094, 687) end if curmin % 2 == 0 then if curLajiao ~= nil then for k, v in pairs(curLajiao) do local recId = map.MapCreateColCreature(lajiao[v].map, -1, 5600068, lajiao[v].x, lajiao[v].y, lajiao[v].z) cre.SetCreatureScriptData(lajiao[v].map, -1, recId, 1, 0, v) table.remove(curLajiao, k) end end if curYutu ~= nil then for k, v in pairs(curYutu) do local recId = map.MapCreateColCreature(yutu[v].map, -1, yutu[v].creid, yutu[v].x, yutu[v].y, yutu[v].z) cre.SetCreatureScriptData(yutu[v].map, -1, recId, 1, 0, v) table.remove(curYutu, k) end end end if curhour >= 20 and curhour <= 22 then if chuansongrenIn == 0 then chuansongrenIn = map.MapCreateColCreature(3424073512, -1, 5600069, 591, 23094, 639) map.MapCreateColCreature(3373743400, 1, 5600070, 1047, 5855, 1033) map.MapCreateColCreature(3373743400, 1, 5600071, 698, 948, 682) map.MapCreateColCreature(3373743400, 1, 5600072, 684, 1105, 698) map.MapCreateColCreature(3373743400, 1, 5600074, 697, 1126, 696) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 300052) msg.DispatchBroadcast(MsgID, -1, -1, -1) end if curmin == 20 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 300053) msg.DispatchMapMsgEvent(MsgID, 3373743400, 1) end if curhour == 22 and curmin == 30 then for i = 0, 5 do act.SetActScriptData(44, 1, i + 6, act.GetActScriptData(44, 1, i)) act.SetActScriptData(44, 1, i, 0) act.SaveActScriptData(44) end for i = 9, 11 do act.SetActScriptData(44, 1, i + 3, act.GetActScriptData(44, 1, i)) act.SaveActScriptData(44) end local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 300054) msg.AddMsgEvent(MsgID, 2, act.GetActScriptData(44, 1, 11)) msg.AddMsgEvent(MsgID, 2, act.GetActScriptData(44, 1, 10)) msg.AddMsgEvent(MsgID, 2, act.GetActScriptData(44, 1, 9)) msg.DispatchBroadcast(MsgID, -1, -1, -1) end if curhour == 22 and curmin == 59 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 300056) msg.DispatchMapMsgEvent(MsgID, 3373743400, 1) end if curS58pos ~= nil then for k, v in pairs(curS58pos) do local recId = map.MapCreateColCreature(3373743400, 1, 5600073, S58pos[v].x, S58pos[v].y, S58pos[v].z) cre.SetCreatureScriptData(3373743400, 1, recId, 1, 0, v) table.remove(curS58pos, k) end end if curmin % 10 == 0 then curNum = 0 end elseif chuansongrenIn ~= 0 then map.MapDeleteCreature(3424073512, -1, chuansongrenIn) chuansongrenIn = 0 end end end return { onTimerMin = onTimerMin, }