Maharshi made a pact with several adventurers trapped within the bottle, to assist them in defeating his own son. The plan was to break the bottle, release the city and give up his own life to remove Ravana's immortality.
His last master was his own son, Ravana, who made two of his three wishes.
Wish 1 - A wish for irrefutable commands. Ravana's voice carries enchantments over the minds of mortals. His words can influence minds similar to the charm spells
Wish 2 - A wish to know and touch all places under the sun. Maharshi created the Sun's Touch Gada to fulfill his son's wish.
Jin made a wish during the events of Kaseraksa's slave revolt.
Wish 1 - Jin wished for Maharshi to cast the fly spell on his companions and humans fleeing Kaseraksa. This allowed Jin and his companions to chase down Bor Mudmantle who was attempting to steal the 6 Demon Bag, and assisted them in defeating the Ma Shihun who was released during these events..