row=0 //set zero
newid=10000000000 //set newid value to a value that wont collide with existing ids
repair while characters row contains data //begin newid loop
row=row+1 //step row number
newid=newid+1 //step new id number
oldid = characters.obj_id row //get old id from row
characters.obj_id row = newid //give new id at row
character_macroses.char_obj_id = newid where char_obj_id = oldid //give new id for macros
character_quests.char_id = newid where char_id = oldid //give new id for quests
character_recipebook.char_id = newid where char_id = oldid //give new id for recipes
character_shortcuts.char_obj_id = newid where char_obj_id = oldid //give new id for shortcuts
character_skills.char_obj_id = newid where char_obj_id = oldid //give new id for skills
clan_data.leader_id = newid where leader_id = oldid //give new id for clan_data
items.owner_id = newid where char_obj_id = oldid //give new id for items
loop to repair //return to loop
row=0 //reset
clans while clans row contains data //begin clan loop
row=row+1 //step row number
newid=newid+1 //step new id number
oldclan = characters.clanid row //get old clanid from row
characters.clanid = newid //give new clanid at row
clan_data.clan_id = newid where clan_id = oldclan //give new id for clans
loop to clans //return to loop
row=0 //reset
items while items row contains data //begin items loop
row=row+1 //step row number
newid=newid+1 //step new id number
items.object_id = newid at row //give new id for item
loop to items //return to loop