this don't work in EE cause the limited wish genie does not have a circle so you can not target him, but in the original gives the hardest battle i did ever find in the game. i discovered it once abusing of the limited wish in the pocket plane. there, and also in EE the bug persist, the genie after giving you the choice of limited wish does not disappear. it happened that i used many limited wishes and wishes in one of the rooms where the trials are done and in the end i had it almost completely filled with neutral genies, some i could target and others i could not.
one day i decided to get rid of them, at least the ones i could target and i begun to attack them one by one. doing this i triggered some chain reaction effect and one by one all the genies become hostile.
what a fight! to beat a single genie is not a problem for a ToB level party, when you have so many that attack you at the same time it becomes a completely different matter of things, they hit hard...
i report this cause maybe some not EE user can try the battle, and in comparison tactics fire giants or the final battle are a piece of cake.
i will test if in EE is possible to have the genies become hostile using some aoe not neutral friendly spell, ADHW surely does not work, in the case i will report it here.
EDIT: tested, and i discovered that to have the genie not disappearing to be in the pocket plane is not needed, what is needed is that the chosen limited wish has to be the one that summons vampires, as the undeads spawn a script removes every buff of the nearby toons, and this probably includes the genie himself and probably break the script that make him disappear. with other limited wish outcomes the genie disappears.
sadly the genie has high magic resistance, but the cleric's aoe flame spell ignore it, so i was able to do damage to him, i tested with a single genie up to cause him more than 600 dmg. he never becomes hostile and seems that as long as is neutral is also impossible to kill him. seems that the EE users can not fight this battle, and maybe is a good thing, imagine how hard would be killing a hundred of pissed off hostile genies with high magical resistance you can not target with spells or weapons, so using only aoe that bypass magical resistance and maybe with the fighter's guard.