We began to make something like this a while ago but never got to do it in the end, thanks I'll give it a go
Just noticed one thing
You use delitem and then additem no?...
That will mess up the pet items (the new item just won't work and will be deleted on next restart)