Thread Tools Display Modes
09-14-12, 06:50 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Vengeance module

Has anyone tried to do a Vengeance module for patch 5.0.4?

Vengeance is not capped anymore. Thus I don't know what to do with the Vengance statusbar since it's always max...how do you handle that?

This is my current dry-code:
Lua Code:
  1. local class = select(2, UnitClass("player"))
  2. if class ~= "WARRIOR" and class ~= "DRUID" and class ~= "PALADIN" and class ~= "DEATHKNIGHT" and class ~= "MONK" then
  3.   return
  4. end
  5.  
  6. local parent, ns = ...
  7. local oUF = ns.oUF or oUF
  8. if not oUF then return end
  9.  
  10. local _
  11. local vengeance = (GetSpellInfo(84839))
  12.  
  13. local numFormat = function(v)
  14.   if v > 1E10 then
  15.     return (floor(v/1E9)).."b"
  16.   elseif v > 1E9 then
  17.     return (floor((v/1E9)*10)/10).."b"
  18.   elseif v > 1E7 then
  19.     return (floor(v/1E6)).."m"
  20.   elseif v > 1E6 then
  21.     return (floor((v/1E6)*10)/10).."m"
  22.   elseif v > 1E4 then
  23.     return (floor(v/1E3)).."k"
  24.   elseif v > 1E3 then
  25.     return (floor((v/1E3)*10)/10).."k"
  26.   else
  27.     return v
  28.   end
  29. end
  30.  
  31. local Update = function(self, event, unit)
  32.   if(self.unit ~= unit) then return end
  33.   local element = self.Vengeance
  34.   local bar = self.VengeancePowerBar
  35.   if not bar:IsShown() then return end
  36.   local _, _, _, _, _, _, _, _, _, _, _, _, _, val1 = UnitBuff(unit, vengeance, nil)
  37.  
  38.   local stat, _, posBuff, _ = UnitStat("player", 3)
  39.   local basehealth = UnitHealthMax("player")-(posBuff*UnitHPPerStamina("player"))
  40.   local max = basehealth/10 + stat
  41.  
  42.   element:SetMinMaxValues(0, math.max(val1,max))
  43.   element:SetValue(val1)
  44.   if element.text then
  45.     if element.text.Override then
  46.       element.text:TextOverride(val1)
  47.     else
  48.       element.text:SetText(numFormat(val1))
  49.     end
  50.   end
  51. end
  52.  
  53. local Visibility = function(self, event, unit)
  54.   local element = self.Vengeance
  55.   local bar = self.VengeancePowerBar
  56.   if UnitHasVehicleUI("player")
  57.     or ((HasVehicleActionBar() and UnitVehicleSkin("player") and UnitVehicleSkin("player") ~= "")
  58.     or (HasOverrideActionBar() and GetOverrideBarSkin() and GetOverrideBarSkin() ~= ""))
  59.   then
  60.     bar:Hide()
  61.   elseif(class == "WARRIOR" and GetSpecialization() == 2) then
  62.     bar:Show()
  63.     element.ForceUpdate(element)
  64.   elseif(class == "PALADIN" and GetSpecialization() == 1) then
  65.     bar:Show()
  66.     element.ForceUpdate(element)
  67.   elseif(class == "DEATHKNIGHT" and GetSpecialization() == 1) then
  68.     bar:Show()
  69.     element.ForceUpdate(element)
  70.   elseif(class == "DRUID" and GetSpecialization() == 1) then
  71.     bar:Show()
  72.     element.ForceUpdate(element)
  73.   elseif(class == "MONK" and GetSpecialization() == 1) then
  74.     bar:Show()
  75.     element.ForceUpdate(element)
  76.   else
  77.     bar:Hide()
  78.   end
  79. end
  80.  
  81.  
  82. local Path = function(self, ...)
  83.   return (self.Vengeance.Override or Update) (self, ...)
  84. end
  85.  
  86. local ForceUpdate = function(element)
  87.   return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
  88. end
  89.  
  90. local Enable = function(self, unit)
  91.   local element = self.Vengeance
  92.   if(element and unit == "player") then
  93.     element.__owner = self
  94.     element.ForceUpdate = ForceUpdate
  95.  
  96.     self:RegisterEvent('UNIT_ATTACK_POWER', Path, true)
  97.     self:RegisterEvent('PLAYER_TALENT_UPDATE', Visibility, true)
  98.     self:RegisterEvent("SPELLS_CHANGED", Visibility, true)
  99.     self:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR", Visibility, true)
  100.  
  101.     local helper = CreateFrame("Frame") --this is needed...adding player_login to the visivility events doesn't do anything
  102.     helper:RegisterEvent("PLAYER_LOGIN")
  103.     helper:SetScript("OnEvent", function() Visibility(self) end)
  104.  
  105.     return true
  106.   end
  107. end
  108.  
  109. local Disable = function(self)
  110.   local element = self.Vengeance
  111.   if(element) then
  112.     self:UnregisterEvent('UNIT_ATTACK_POWER', Path)
  113.     self:UnregisterEvent('PLAYER_TALENT_UPDATE', Visibility)
  114.     self:UnregisterEvent('SPELLS_CHANGED', Visibility)
  115.     self:UnregisterEvent('UPDATE_OVERRIDE_ACTIONBAR', Visibility)
  116.   end
  117. end
  118.  
  119. oUF:AddElement('Vengeance', Path, Enable, Disable)

There are videos of Chimaeron where tanks do 300-400k dps because of such an incredible high amount of Vengeance.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-14-12 at 07:53 AM.
  Reply With Quote
09-14-12, 10:33 AM   #2
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
You probably could take a look at http://www.wowinterface.com/download...nceStatus.html

Do your play style change depending on vengeance? Different priorities or something?
  Reply With Quote
09-14-12, 11:48 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Yeah I checked that. He is basically doing the same...once the "old" max values get boosted of the charts he just uses whatever maxvalue the buff value delivers.

The vengeance formula that calculates the max value out of the health is pretty wierd though.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Vengeance module


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