local DakimakuraWeapons = require("DakimakuraList")
local OpaiZList = require("OpaiZList")
local function pickDaki()
 -- print(" pickDaki started")
    local pick = ZombRand(0,DakimakuraWeapons:size()-1)
    local dakiPicked = DakimakuraWeapons:get(pick)
   --print(" pickDaki dakiPicked")
    return dakiPicked
end
local function pickManga()

       local pick = ZombRand(0,OpaiZList:size()-1)
       local mangaPicked = OpaiZList:get(pick)

       return mangaPicked
   end




local function OnFillContainer(roomName, containerType, itemContainer)

    --print("OnFillContainer Base.dakiDummy found")
    if itemContainer then
        local manga = itemContainer:getFirstTypeRecurse("Base.mangaDummy")
        local daki = itemContainer:getFirstTypeRecurse("Base.dakiDummy")
        local obj
        local objName
        local x
        local y
        local z
        if (daki or manga) and isDebugEnabled() then
               obj = itemContainer:getParent()
               objName = obj:getName() or obj:getTextureName() or "Nil Name"
               x = obj:getX()
               y = obj:getY()
               z = obj:getZ()
        end
        if daki then
              itemContainer:Remove(daki)
              itemContainer:AddItem(pickDaki())
          if isDebugEnabled() then print("----Daki Spawned in container: "..objName.."--- At: " .. x .. " , "..y.." , "..z.." ----")end
        end
        if manga then
              itemContainer:Remove(manga)
              itemContainer:AddItem(pickManga())
      
        
          if isDebugEnabled() then print("----manga Spawned in container: "..objName.."--- At: " .. x .. " , "..y.." , "..z.." ----")end
        end
   end

end

Events.OnFillContainer.Add(OnFillContainer) 