wrong kokspflanze,
Since Synx7 already told the idea behind it, ill tell you :)
basically when there is a levle up (eventid 22) you have to get the next best item below the new level (which should not be fetched from _char due to the fact that it the CurLevel column takes longer to update... and low levels wouldnt get new items since they levelup too fast...)
After you have the newest item below the new level all you gotta do it replace refitemid from _Items for the corrsponding previous item.
Hopefully, thats enough.