ID this Hannah-Barbera cartoon from the 60's

I remember a scene from what I thought was a Hanna-Barbera cartoon from the 60’s. It may have been a secondary feature of another cartoon, like Jonny Quest.

The theme was Arabic, and the scene involved a party of adventurers trying to get past a locked door. There was a genie (possibly not the rub-the-lantern kind, but a human wizard) who turned each of the adventurers into smoke to flow through the gaps around the door. He’d proclaim “Shazam Smokarr!” with a flourish, and the adventurer would turn to smoke. He went through 5-6 other people, each time getting a little more exhausted with his spell. The last participant got a weakly-intoned “shazam smokarr.” Then, the genie looked at his fingertips, saying “My goodness! I am almost out of magic!”

He pondered his dilemma for a few seconds, and said “Ah hah! I got it! Shazam Watarr!” He then turned into a puddle of water and seeped under the door.

I googled. It’s not Shazzan. Shazzan was a giant who held the hero kids in the palm of his hand. This genie was a normal-sized portly man with a turban, curly-toed boots, and Van Dyke mustache.

The voice actor was in a lot of other cartoons, usually as a pompous scholarly figure, but not in any major roles that I can remember.

This scene keeps haunting me. Maybe it was a HB knockoff, or I’m conflating it with another cartoon. I’m asking you, my SDMB scholars of completely useless information, to please help a brother out!

Sounds like Arabian Knights, the Hanna-Barbera segment from The Banana Splits Adventure Hour

Edited to add:

According to Chat GPT, it was specifically the following episode:

The specific scene is from “The Royal Visitor”, the final Arabian Knights episode. In the episode summary, Fariik the Magician turns the others into smoke using “Rosan Smokar” so they can enter a pyramid, becomes exhausted, says he is almost out of magic, then uses “Rosan Watar” to turn himself into liquid and seep inside. That lines up almost perfectly with your memory of “Shazam Smokarr” and “Shazam Watarr.”

Wiki article on the show:

It’s almost certainly The Arabian Knights, which as Dorjan says was a segment on The Banana Splits Adventure Hour. The magic word was not “Shazam” but “Rosan.”

The premise was a team of adventurers in ancient Persia, each with some special power or talent. According to wikipedia, the magician character (“Fariik the Magician”) was voiced by John Stephenson, who was indeed a prolific voice actor. Perhaps best known as the original voice of Dr. Quest on Jonny Quest, before the role was taken over by the more familiar voice of Don Messick.

I remember it as “Rosan Kobar!”

And one of the other Knights could turn himself into any animal by proclaiming, “Size of a (animal)!”, clap his hands, and turn into that animal.

Here’s the scene (which includes ricepad’s “size of” memory.

Wow! Thanks for the immediate response! Dopers rule!

For somebody who was out of magic, he sure seemed to have a lot left.