NOTE: testing has revealed that the current Mastery returned as a percentage must be divided by 100 for the calculations in the code that is included in the preceding post to be correct. (Don't I wish the EF Heal-at-Once was 1,404,959 for 2 HP, 2 BoG, and mastery 23.89% -- with my paladin's max health at 571,270
! <sigh>)
theckhd wrote:Seems roughly correct to me. The only minor things I might point out are:
- hpUsed should probably account for Divine Purpose and the T16 4-piece bonus (both of those allow you to cast it for free at 3-HP strength).
Yes, accounting for DP occurred to me while I was coding the call to the function in the addon source. The amount of HP available is now passed as an argument, the value of which is 3 HP if there is a DP proc active, else the amount calculated above as "hpUsed = min(3, c_hp)" is passed.
However, I haven't considered the Tier 16 4-piece bonus until now (although I've known about it for a while). I don't have the 4-piece set for testing, only the shoulders and gauntlets of the T16 2-piece set for protection. But it does have a spell ID (
http://www.wowhead.com/spell=144566#used-by-itemset) and
GetSpellInfo(144566) returns the string "Item - Paladin T16 Protection 4P Bonus".
So, I expect that
- Code: Select all
name = UnitBuff("player","Item - Paladin T16 Protection 4P Bonus")
should simply return that name, without other data, while there are at least 3 BoG and the paladin is equipped with the T16 4-piece set. If the buff does not exist,
UnitBuff() returns a nil. (Such is the case for Sanctified Wrath, which is displayed in the UI while AW is in effect.) If that proves to be the case, then I can simply set a flag when
UnitBuff() reports it, and test the flag after the addon gets the status of all buffs. When the "Gear Bonus" flag is boolean
true, then the available HP passed to the function would be three charges. (I am handling DP procs the same way,
i.e., by using a flag set when the paladin has the DP buff.)
However, I cannot know for sure until I get the gear to test it, or someone tests that for me. :-)
theckhd wrote:
There ought to be a method to get SpellPower directly, similar to UnitAttackPower. You may want to use that instead so that in Warlords it works seamlessly (in WoD we get a 1:1 conversion on AP:SP, not 2:1).
Certainly, there
ought to be one. But I have never found an API call that returns Spell Power. There is one for
UnitRangedAttackPower()(
http://wowpedia.org/API_UnitRangedAttackPower) which returns amounts respectively for the base, positive buffs, and negative buffs, as
UnitAttackPower() does for melee.
GetOverrideSpellPowerByAP() "returns how much spell power is returned by attack power" (at least for a Shaman)(
http://wowprogramming.com/docs/api_categories). There are two more API function calls like that one which have the string "SpellPower" in their name, but they are undocumented by Wowpedia and by WoWProgramming respectively.
Without a specific tool like the software used to generate the Global Functions list on Wowpedia (
http://wowpedia.org/Global_functions) -- an extremely long list -- that I might be able to use for a narrow search, the only thing that I can do is search such lists for possible names.
If indeed there is no "get Spell Power" API function, then I doubt that Blizzard will create that API call for WoD, or will publicize it if they do. Frankly, I will be
stunned if they rectify the damage they have evidently done to PLAYER_TALENT_UPDATE, whether also to God-only-knows what else, during WoD development. They don't acknowledge bugs that I discovered in the game-client Lua intepreter, and endeavored to report without any meaningful support from Blizzard for doing that, and they have not rectified them.
I don't know about you, but for the past four weeks the WoW software has been producing one or more new anomalies almost every time that I run it
! Today, the first time that I chose to log-on to my paladin, the message "Character not found" was displayed, then I was returned to the character selection dialog. Fortunately, it worked on the second attempt. But who knows when, if ever, it will fail again?
Which is to say, I doubt that I will be updating any addon for Warlords of Draenor anytime soon -- if ever. At this point, I don't have any enthusiasm for playing WoD itself. WoW just is not as much fun to play as it once was. The unimaginative hand-eye-coordination whack-a-mole "quests" created by Fargo "You Must Suffer To Be A Hero" are very much responsible for that. Often "winning" such a "quest" is essential to the success of the player, but some are glitched and evidently cannot be completed, and whether the player can complete yet others apparently depends upon the RNG. There are just too many glitches and hitches -- never mind the sheer inanities -- that, inevitably, leave me wondering why I should bother. WoW is not an actual fantasy RPG, it is a parody of one.
Be that as it is, thank-you for your help. I appreciate it.
--- Adeya
nil carborundum illegitimi