Thread Tools Display Modes
01-12-06, 02:17 PM   #1
LordRhys
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 5
Question Trying to cast best bless/buff for target level

I'm trying to figure out how to write a small script/mod that will allow you to cast the best buff/bless for self/target without getting the Target too Low level error and having to cast from spell book. I would like to be able to have 1 action button that will call the mods function with the appropriate spell. I am having difficulty determing what API calls I need to use besides the Unit ones. Any help would be appreciated. Thanks
  Reply With Quote
01-13-06, 11:00 AM   #2
TheKID97
A Defias Bandit
Join Date: Jan 2006
Posts: 2
I use a simple macro for buffs.

/script r=Spell_Rank;l={1,10,20,30,40,50,60};if not UnitIsFriend("player","target")then TargetUnit("player");end;t=UnitLevel("target");for i=r,1,-1 do if (t>=l[i]-10) then CastSpellByName("Mark of The Wild(Rank "..i..")");break;end;end

(Credit to Ashnod, as I simply copied and pasted rather than writing one.)

simply replace "Spell_Rank" in the first line with the highest rank you can cast and "Mark of the Wild" with the buff of your choice. It does the rest, inculding self cast if taget is hostile or nothing is targeted.

Edit:
Forgot to mention, the script will need minor customization depending on level limits of other buffs, ex:

/script Pre="Power Word: Fortitude(Rank " Sp={1,2,14,26,38,50} if (UnitLevel("target") ~= nil and UnitIsFriend("player","target")) then for i=6,1,-1 do if (UnitLevel("target") >= Sp[i]) then CastSpellByName(Pre..i..") ") return end end end

(clearly writen with minor differances, but just using it as an illustration that you need to be aware of the level cut-off of each Rank of the buff you want to use.)

Last edited by TheKID97 : 01-13-06 at 12:17 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trying to cast best bless/buff for target level

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off