code to check player for buff
What is the code you need to check if a unit("player") has a certain buff?
Woulldnt mind fitting that into my addon to check if the player has any of the following buffs:
Horn of Winter,
Mark of the Wild,
Am new to this lua stuff, so any assistance would be appreciated ....
UnitAura allows you to check for buffs, debuffs
Something like this:
Hmmmm ... I think I wasnt specific enough in the original question ...
The addon I have done is up and running on wow interface ( http://www.wowinterface.com/download...enseStats.html )
It is working fine, apart from the fact that it assumes you have no buffs currently when it does all the calculations to output your CTC.
If you get a buff that you can select from the dropdowns, then effectively the buff is added twice to the calculations (these are the only buffs available that will affect your Combat Table Coverage (well, apart from different ranks and the myriad of food buffs that give lower stat rating boosts, but that would need a list faaaaaaar too long to factor into the equations) ....
Heres a pastebin of the lua as it stands:
the issue I am running into is the UpdateBuffStats()
from line 336 to line 349
I want to check the player to see if he has any of the buffs you can select in the addon to see your raid buffed stats currently applied, and if so, to change the output of the UpdateBuffStats()
As it stands, the lines in question are :
Once getting the spellId of all buffs currently on the player (using spellId = UnitAura("player",i) ), the current values for BuffStrengthAdjust, BuffParryAdjust, BuffDodgeAdjust, BuffMasteryAdjust and BufMultiplierAdjust would need to be worked out in the following way:
I may be going about this in totally the wrong way, as it may be simpler to factor in the Current buffs when you are selecting the raid buffs from the dropdown menu (though that would be complicated when choosing from the list of food buffs )
Here's how you would modify Phanx's code to do what you want to do:
You'll have to calculate a bit differently than you've been doing, but it should actually be simpler.
|All times are GMT -6. The time now is 05:49 PM.|
vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI