- Legion priest updates: replaced Shadow Orbs with Insanity for 7.0 clients, added ShadowPriestMP for 7.0 clients

This commit is contained in:
Parnic
2016-05-26 06:06:05 +00:00
parent 261b041af8
commit 7fa7d95303
3 changed files with 122 additions and 12 deletions

View File

@ -331,12 +331,6 @@ local specialPowers = {
arg2 = SPELL_POWER_DEMONIC_FURY,
eventPowerIdentifier = "DEMONIC_FURY",
},
{
class = "PRIEST",
tag = "ShadowOrbs",
arg2 = SPELL_POWER_SHADOW_ORBS,
eventPowerIdentifier = "SHADOW_ORBS",
},
{
class = "DRUID",
tag = "EclipsePower",
@ -356,19 +350,37 @@ local specialPowers = {
eventPowerIdentifier = wow_501 and "CHI" or "LIGHT_FORCE",
},
}
local wow_700 = select(4, GetBuildInfo()) >= 70000
if not wow_700 then -- Parnic: shadow orbs are no more in 7.0
specialPowers[#specialPowers + 1] =
{
class = "PRIEST",
tag = "ShadowOrbs",
arg2 = SPELL_POWER_SHADOW_ORBS,
eventPowerIdentifier = "SHADOW_ORBS",
}
else
specialPowers[#specialPowers + 1] =
{
class = "PRIEST",
tag = "Insanity",
arg2 = SPELL_POWER_INSANITY,
eventPowerIdentifier = "INSANITY_POWER",
}
end
for _, data in pairs(specialPowers) do
local class = data.class
local tag = data.tag
local arg2 = data.arg2
local arg3 = data.arg3
local _, pclass = UnitClass("player")
local _, pclass = UnitClass("player")
--local category = class == pclass and L["Power"] or nil
--local noDoc = class ~= pclass
local specialPowerEvents = "UNIT_POWER#player#" .. data.eventPowerIdentifier .. ";UNIT_MAXPOWER#player#" .. data.eventPowerIdentifier .. ";UNIT_DISPLAYPOWER#player"
DogTag:AddTag("Unit", tag, {
code = function()
return UnitPower("player", arg2, arg3)
@ -419,7 +431,7 @@ for _, data in pairs(specialPowers) do
example = class == pclass and ('[Fractional' .. tag .. '] => "%d/%d"'):format(UnitPowerMax("player",arg2, arg3)*.632, UnitPowerMax("player",arg2, arg3)) or nil,
category = category,
})
]]
end

View File

@ -0,0 +1,97 @@
local MAJOR_VERSION = "LibDogTag-Unit-3.0"
local MINOR_VERSION = 90000 + tonumber(("$Revision: 281 $"):match("%d+")) or 0
if MINOR_VERSION > _G.DogTag_Unit_MINOR_VERSION then
_G.DogTag_Unit_MINOR_VERSION = MINOR_VERSION
end
local _G, select = _G, select
local UnitClass, UnitPowerMax, UnitPower, UnitPowerType =
UnitClass, UnitPowerMax, UnitPower, UnitPowerType
DogTag_Unit_funcs[#DogTag_Unit_funcs+1] = function(DogTag_Unit, DogTag)
local L = DogTag_Unit.L
local wow_700 = select(4, GetBuildInfo()) >= 70000
local mpEvents = "ShadowPriestMana;UNIT_POWER#$unit;UNIT_MAXPOWER#$unit"
if wow_700 then
DogTag:AddTag("Unit", "ShadowPriestMP", {
code = function(unit)
if select(2, UnitClass(unit)) == "PRIEST" and UnitPowerType(unit) == SPELL_POWER_INSANITY then
return UnitPower(unit, SPELL_POWER_MANA)
else
return nil
end
end,
arg = {
'unit', 'string;undef', 'player'
},
ret = "number;nil",
events = mpEvents,
doc = L["Return the current mana of unit if unit is a shadow priest"],
example = ('[ShadowPriestMP] => "%d"'):format(UnitPowerMax("player",SPELL_POWER_MANA)*.632),
category = L["ShadowPriest"],
})
DogTag:AddTag("Unit", "MaxShadowPriestMP", {
code = function(unit)
if select(2, UnitClass(unit)) == "PRIEST" and UnitPowerType(unit) == SPELL_POWER_INSANITY then
return UnitPowerMax(unit, SPELL_POWER_MANA)
else
return nil
end
end,
arg = {
'unit', 'string;undef', 'player'
},
ret = "number;nil",
events = mpEvents,
doc = L["Return the maximum mana of unit if unit is a shadow priest"],
example = ('[MaxShadowPriestMP] => "%d"'):format(UnitPowerMax("player",SPELL_POWER_MANA)),
category = L["ShadowPriest"],
})
DogTag:AddTag("Unit", "PercentShadowPriestMP", {
alias = "[ShadowPriestMP(unit=unit) / MaxShadowPriestMP(unit=unit) * 100]:Round(1)",
arg = {
'unit', 'string;undef', 'player'
},
doc = L["Return the percentage mana of unit if unit is a shadow priest"],
example = '[PercentShadowPriestMP] => "63.2"; [PercentShadowPriestMP:Percent] => "63.2%"',
category = L["ShadowPriest"],
})
DogTag:AddTag("Unit", "MissingShadowPriestMP", {
alias = "MaxShadowPriestMP(unit=unit) - ShadowPriestMP(unit=unit)",
arg = {
'unit', 'string;undef', 'player'
},
doc = L["Return the missing mana of unit if unit is a shadow priest"],
example = ('[MissingShadowPriestMP] => "%d"'):format(UnitPowerMax("player",0)*.368),
category = L["ShadowPriest"]
})
DogTag:AddTag("Unit", "FractionalShadowPriestMP", {
alias = "Concatenate(ShadowPriestMP(unit=unit), '/', MaxShadowPriestMP(unit=unit))",
arg = {
'unit', 'string;undef', 'player'
},
doc = L["Return the current and maximum mana of unit if unit is a shadow priest"],
example = ('[FractionalShadowPriestMP] => "%d/%d"'):format(UnitPowerMax("player",0)*.632, UnitPowerMax("player",0)),
category = L["ShadowPriest"]
})
DogTag:AddTag("Unit", "IsMaxShadowPriestMP", {
alias = "Boolean(ShadowPriestMP(unit=unit) = MaxShadowPriestMP(unit=unit))",
arg = {
'unit', 'string;undef', 'player'
},
doc = L["Return True if at max mana or unit is not a shadow priest"],
example = ('[IsMaxShadowPriestMP] => %q; [IsMaxShadowPriestMP] => ""'):format(L["True"]),
category = L["ShadowPriest"]
})
end -- wow_700
end

View File

@ -19,6 +19,7 @@
<Script file="Categories\Power.lua" />
<Script file="Categories\Range.lua" />
<Script file="Categories\Reputation.lua" />
<Script file="Categories\ShadowPriestMana.lua" />
<Script file="Categories\Status.lua" />
<Script file="Categories\Talent.lua" />
<Script file="Categories\Threat.lua" />