Small Fixe's that i've noticed :)

p:getPosition():sndMagicEffect(27)
	p:additem(items[present],count[present])

to:

p:getPosition():sendMagicEffect(27)
	p:addItem(items[present],count[present])