This is what I'd suggest. Since all 3 spells only work on friendly targets, that's one less thing to be checked. Also combining it into a single
/cast command ensures only one spell gets called and makes it easier to work on. Only the first condition that matches gets run and the rest are ignored.
Code:
#showtooltip
/cast [@mouseover,nodead] Blessing of Protection; [@mouseover,combat] Intercession; [@mouseover] Redemption
Here's the logic.
- Is mouseover alive?
- <Yes> Cast Blessing of Protection
- <No> Are we in combat?
- <Yes> Cast Intercession
- <No> Cast Redemption
Note: Most unit conditions result in
false if the unit doesn't exist ([no...] is an inverse function), so it should default to showing Blessing of Protection if there is no mouseover.