Originally Posted by
Zemnexx
Hey guys, it's been quite a while since I have checked in on this forum. I have been on a hiatus from WoW for a while now. I'm getting back into it again but I am so far behind on the new features of this program and the changes to the game that I am probably not gonna get back into profile making any time soon. If you guys want, I will upload what I do have coded and what I was working on just to use as a resource and see what ideas I had. They are all PVP or arena based.
Yes please, any pvp profiles will be well appreciated. I think for most of us, myself included, we can put together a pve profile easy since its based on strict class rotation and situation rules that we can turn into code but PVP is much harder and requires extensive playing that class in PVP to be effective. I know i would love to turn my Ret Pally profile into a PVP version but i'm having issues to say the least.
Also I created a spreadsheet of all PVP(player spells) Stun/CC/Snare/Disarm/Root with name type and spell ID based off an addon which had the info (i think powerauras).
PVP debuff Spreadsheet by fmagretto
This should help people making PVP trinket code and every man for himself or Hand of freedom. On that note I ask if anyone creates such an ability to please share.
I would also advise anyone writing one to 'break early/fast'(yes i know they use the same term for error handling) and make order matter in your for loop to look for debuffs. For example
Code:
local debuff = { 45524, 1715, 3408, 59638, 20164, 25809, 31589, 51585, 50040, 50041, 31126, 31124, 122, 44614, 1604, 45524, 50040, 339, 45334, 58179, 61391, 19306, 19185, 35101, 5116, 61394, 2974, 54644, 50245, 50271, 54706, 4167, 33395, 83302, 55080, 11113, 6136, 120, 116, 44614, 31589, 63529, 20170, 87194, 31125, 3409, 26679, 64695, 63685, 8056, 8034, 18118, 18223, 63311, 23694, 1715, 12323, 39965, 55536, 13099, 29703 }
for i,v in ipairs(debuff) do
if UnitDebuffID("player",v) then return true end
end
See how the if statement immediately returns? I've notice some peoples debuff check will look like this:
Code:
local buff = { 45524, 1715, 3408, 59638, 20164, 25809, 31589, 51585, 50040, 50041, 31126, 31124, 122, 44614, 1604, 45524, 50040, 339, 45334, 58179, 61391, 19306, 19185, 35101, 5116, 61394, 2974, 54644, 50245, 50271, 54706, 4167, 33395, 83302, 55080, 11113, 6136, 120, 116, 44614, 31589, 63529, 20170, 87194, 31125, 3409, 26679, 64695, 63685, 8056, 8034, 18118, 18223, 63311, 23694, 1715, 12323, 39965, 55536, 13099, 29703 }
local havebuff = nil
for i,v in ipairs(buff) do
if UnitDebuffID(PQR_CustomTarget,v) then havebuff = 1 end
end
if havebuff then return true end
Notice the use of the boolean to check for the buff even thought you have the info you need at the time the 'havebuff' is set. That means even if it recognized you have the first debuff in the list it will continue to loop the the rest of the very long list and mind you this is happening everytime PQR ability checks this spell which may be a few times a second. I know we don't focus on efficiency much but it's something to consider if you want a responsive profile. So instead of setting a boolean in the IF just 'return true'.
Also especially with the situation above ORDER matters. If you know you are most likely to be feared then put fear in the front of the list and the least likely in the back so that it finds the most likely first and returns quick if found.
I don't mean to call anyone out, i'm just looking to help improve your own profiles. Remember that even though it seems simple every check and every bit of info you pull to make your profile takes processing time and memory just like an addon does and variables will stay there when declared so try to use locals when you don't want a global variable and if theres info u can save in a variable instead of re-requesting it then do it.
Sorry for the long post. it's ok if it's TL;DR