function SnakeEvent.win(winner)
local bag = winner:addItem(SnakeEvent.reward.bagId, 1)
if bag then
for _, it in pairs(SnakeEvent.reward.items) do
if it.chance >= math.random(1, 100) then
bag:addItem(it.itemId, it.count)
end
end
winner:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You reward: %s.\nCheck your inbox!", bag:getContentDescription()))
end
if SnakeEvent.debug then
print(string.format("[SnakeEvent/Debug] %s is the winner.", winner:getName()))
end
end