From the Super Mario Wiki
Retrieved from "https://www.mariowiki.com/index.php?title=Royal_Flail&oldid=2397463"
The Royal Flail is a key item from Wario: Master of Disguise. Wario finds it in a purple treasure chest inside Poobah the Pharaoh's Pyramid. The chest is hidden in a room in the upper right corner of the pyramid which requires traversing multiple dark rooms to access. Two Scare-Ohs! guard the room, and the chest only appears after they're defeated.
During Episode 5, Wario and Goodstyle discover a mural which has a spot where something can be inserted when their progress is halted by a door they can't open. The flail fits in the mural perfectly, and the door opens, allowing them to proceed further into the pyramid.