function NPC:spawn()
	local ent = {
		x = self.x*16+8,
		y = self.y*16+8,
		mx = 0, my = 0,
		spawn = self,
		type = self.type,
		flagnum = self.flagnum,
		event = self.event,
		flags = self.flags,
		anim = 1,
		stage = self.stage
	}
	if NPC[self.type].spawnOffset
		ent.x = ent.x + NPC[self.type].spawnOffset[1]
		ent.y = ent.y + NPC[self.type].spawnOffset[2]
	end
	return ent
end
