So I've been looking for an add-on or macro that helps me conjuring food and drink with the matching spell rank, depending on the level of my current target. I couldn't find any and so I simply decided to write my own set of macros to do the job.
I've been testing these macros for the last few days and I'd like to share them with the community because they're incredibly helpful IMO.
To make it work, you'll need 4 different macros. The first one is to register a virtual button and the other three macros will use this button to actually cast the spell you want.
First macro:
Register a virtual button - there is NO visual confirmation in your UI after clicking this macro. If nothing changes, then it worked as intended.
You HAVE TO use this macro once every time you log-in on your mage. Otherwise the conjuring macros below WILL NOT work!
Code:
/run local b=_G["conjure"]or CreateFrame("Button","conjure",UIParent,"SecureActionButtonTemplate");b:SetAttribute("type", "spell");function GSNBR(spell, rank) return string.format("%s(Rank %i)",spell,rank) end
Macro for conjuring water:
Code:
/run local b,m,f,u=_G["conjure"],math.min,math.floor,UnitLevel;t=u("target");l=m(t>0 and t or u("player"),65);b:SetAttribute("spell",GSNBR("Conjure Water",m(9,f((l-5)*0.1+f(l*(1/60))+2+(IsShiftKeyDown() and 1 or 0)))));
/click conjure
Macro for conjuring food:
Code:
/run local b,m,u=_G["conjure"],math.min,UnitLevel;local t=u("target");local l=m((t>0 and t or u("player")),65);b:SetAttribute("spell",GSNBR("Conjure Food",m(8,math.floor((l-5)*0.1+2+(IsShiftKeyDown() and 1 or 0)))));
/click conjure
Macro for conjuring refreshment:
Code:
/run local b,l=_G["conjure"],UnitLevel("target");b:SetAttribute("spell",GSNBR("Conjure Refreshment",l>0 and l<80 and 1 or 2));
/click conjure
How to use them?
Simple: After you created those 4 macros in your client, target someone or something (even NPCs) and click one of the conjuring macros above. After the macro did some math stuff and solved the Riemann-Hypothesis, you might get your desired item ;)
Additional info:
The conjuring macros even allow to increase the calculated spell rank by 1. Just use Shift+Click on the macro and it will conjure food/drink for level 25, if your target was in level range 15-24 for example.
Disclaimer:
Due to the character limit of 255 characters per macro, I removed most of the unnecessary white-space characters. This might make the code look ugly, but at least I got all the functionality in I wanted.
Now I'll hope at least some of you guys find these macros as helpful as I do.
Kind regards and see you in game :)