I don't know how I missed this one before! This one is going right to the top of my favourite trigger examples.
This is the best example I've seen of Fizban's .contains format, mentioned in
www.tbamud.com/forum/2-general/1674-trig...command-example#1933
and
www.tbamud.com/forum/4-development/1678-...r-help-pls-look#1952
It is also a great use of remotes.
As far as I can see (and as to be expected in one of Fizban's triggers) the ifs seem to hold no loopholes. If the player has previous opened the chest, don't let allow the chest to be opened. If not, let the chest be opened. Does the chest have treasure inside? If yes, attach a note to the player's file so that this player can't open the chest in the future. Don't attach the note if the treasure has already been taken by someone else.
Thanks to Liko, for posting it (wow, almost two years ago!) and to Fizban for writing it.