There are 100 friends and $n$ enemies in a room. In the next room, there are $100+n$ open boxes, and $100+n$ keys, one corresponding to each box. They are numbered for easy identification. A box can be locked without using a key. Upto 2 keys can be placed in a box before locking it. A key cannot be locked inside its own box. The friends and enemies not yet called are allowed to have private chats while the game is in progress.
One by one, people are called into the room. First a friend is called, then an enemy is called, then a friend, then an enemy and so on. If $n<100$, only friends will be called once the enemies have run out. A person can pick up 0,1 or 2 keys lying around and lock them into a single box. Then he comes back and makes a public statement(s) that can be heard by everyone. Then he leaves the game and can not communicate further.
Finally, the king enters the room. He has a lockpick that can be used to break open exactly one box. After this, he will try to open all the boxes. The friends want him to succeed and the enemies want him to fail.
What is the largest value of $n$ for which the friends guarantee a win?
P.S. People can use computers for making decisions beyond human thinking.