WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   OpenRDX: Feature Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=104)
-   -   Word of Glory Predicted Health (https://www.wowinterface.com/forums/showthread.php?t=38406)

unlimit 01-15-11 03:09 PM

Word of Glory Predicted Health
 
So I made a Word of Glory predicted health feature (Thanks Crispii for the code!), only to realize after using it for the night that WoG has a coefficient with SpellPower and AttackPower (hurpdurp?). So, now I'm wondering if there's anyway to directly call to that spell and find out the exact amount, since it doesn't change unless there is a change in spellpower/attackpower?

Or maybe I'm thinking about it the wrong way.

Here's what I have so far:

Code:

function FracHealthWOG()
  local hpa = 2678
  local pta = UnitPower(uid, 9);
  local a = (UnitHealth(uid)+(hpa*pta));
  local b = UnitHealthMax(uid);
  if(b<1) then return 0; end
  a=a/b;
  if a<0 then
    return 0;
  elseif a>1 then
    return 1;
  else
    return a;
  end
end
wog = FracHealthWOG();

Also, would there be an easy way to automatically change PTA, which is either 1,2,3 (holy power) to 3 when Hand of Light (my mastery buff) pops up?

Thanks!

unlimit 01-15-11 05:31 PM

Answered my question regarding hand of light:

Code:

function FracHealthWOG()
  local hpa = 2678
  local hol = GetSpellInfo(76672)
  local pta
  if UnitAura(uid, hol) then
        pta = 3;
  else
        pta = UnitPower(uid,9);
  end
  local a = (UnitHealth(uid)+(hpa*pta));
  local b = UnitHealthMax(uid);
  if(b<1) then return 0; end
  a=a/b;
  if a<0 then
    return 0;
  elseif a>1 then
    return 1;
  else
    return a;
  end
end
wog = FracHealthWOG();


Cripsii 01-15-11 07:31 PM

WHat is hpa?

unlimit 01-15-11 07:47 PM

HPA = healing point amount, meaning how much Word of Glory hits for, although I want to change it to automatically update based on when WoG updates, I want to be able to automatically find out how much WoG heals for, like is there an API function for that or something? S_S

Cripsii 01-15-11 10:17 PM

For WOG:

In RET and PROT Spec:

WoG Heal = 2133 + (0.209*Spellpower)
The 2133 constant is the median of WoG base heal


In HOLY Spec:

You must add a Variable: K
K = Divinity * Conviction * (1 + Seal of Insight + Walk in Light)
=> K = 1.06 * 1.09 * (1 + 0.05 + 0.15 )

WoG Heal (Holy spec) = K * (2133 + (0.209*Spellpower))

With that you can easily get the heal of WoG:

For a Holypala :
Heal = (1.06*1.09*(1+0.05+0.15))*(2133 + (0.209*SP))

You can check the conviction buff and all other aura in the formula for better view. You also you can Get The SP var with GetSpellBonusHealing() API.

edit: If Wog is Glyphed just multiply by 1.1 => FinalHealForCustomHolyPala = 1.1*Heal
Enjoy !

Cheer !

unlimit 01-15-11 10:32 PM

Thank you Crispii! That is a thousand times more accurate already.

I believe word of glory also does a percentage based on attackpower too, though, or am I incorrect?

unlimit 01-15-11 11:09 PM

Yep, it definitely takes a bit from AP, about 19.8%.

Final code here and perfectly accurate! :D Thanks a lot Crispii for your help and the original code! =D

Code:

function FracHealthWOG()
  local heal = 2133+(0.209*GetSpellBonusHealing()+0.198*UnitAttackPower(uid));
  local holypower
  if UnitAura(uid, GetSpellInfo(76672)) then holypower = UnitPower(uid,9)+3;
  else holypower = UnitPower(uid,9);
  end
  local a = (UnitHealth(uid)+(heal*holypower));
  local b = UnitHealthMax(uid);
  if(b<1) then return 0; end
  a=a/b;
  if a<0 then
    return 0;
  elseif a>1 then
    return 1;
  else
    return a;
  end
end
wog = FracHealthWOG();



All times are GMT -6. The time now is 08:39 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI