if type(moxue_NPC) ~= "table" then moxue_NPC = {} end local function onTimerMin(_actID) for i = 1, 6 do local npc = moxue_NPC[i] if npc ~= nil then npc.monid = npc.monid or 0 npc.time = npc.time or 0 if npc.monid == 0 and npc.time <= 0 and npc.mapid ~= nil and npc.npcid ~= nil and npc.x ~= nil and npc.y ~= nil and npc.z ~= nil then npc.monid = map.MapCreateCreature(npc.mapid, -1, npc.npcid, npc.x, npc.y, npc.z) if npc.monid ~= nil and npc.monid ~= 0 then unit.AddBuff(npc.mapid, -1, npc.monid, 6935801, npc.monid) end elseif npc.monid == 0 and npc.time > 0 then npc.time = npc.time - 1 end end end end return { onTimerMin = onTimerMin, }