Oh boy, this is always a tough behavior to break, but with patience and consistency, it can be done. I would refrain from the water pistol tho........
When you are about to leave the room, can you use distraction by giving a treat that requires some work, or a special off limit toy perhaps? Ignoring the behavior is the best and will over time work, but it will take a long time. Perhaps the tv for distraction? My birds get very quiet when. The house is quiet, but some birds don't like loud noises and will get quiet, perhaps the tv up loud might work also.
When I leave one of my birds, I g et very excited about a distraction toy or treat as I go near them and try and keep it from them, they work to take it away from me and then feel like it's forbidden and concentrate on it as I walk away and tell them I'll be back soon, which they now repeat when I leave.
Good luck and keep us posted on what works.