/branches/preview/Aloft/AloftCrowdControl
-- TODO: clean all this up, use spell id for basic mapping, get rid of redundant GetSpellInfo() calls, etc |
local POLYMORPH_SPELL_ID = 118 |
local spellIdList = |
{ |
-- mage |
[ 118] = true, -- Polymorph: Sheep |
[POLYMORPH_SPELL_ID] = true, -- Polymorph: Sheep |
[61721] = true, -- Polymorph: Rabbit |
[28271] = true, -- Polymorph: Turtle |
[61780] = true, -- Polymorph: Turkey |
-- is the crowd control spell cancelled on damage? (if false, it is supposed to run to its full duration) |
local spellDamageCancel = |
{ |
[GetSpellInfo( 118)] = true, -- Polymorph: Sheep |
[GetSpellInfo(POLYMORPH_SPELL_ID)] = true, -- Polymorph: Sheep |
[GetSpellInfo(61721)] = true, -- Polymorph: Rabbit |
[GetSpellInfo(28271)] = true, -- Polymorph: Turtle |
[GetSpellInfo(61780)] = true, -- Polymorph: Turkey |
-- duration of last resort: hardcoded |
local spellGrossDuration = |
{ |
[GetSpellInfo( 118)] = { [86] = 50, }, -- Polymorph: Sheep |
[GetSpellInfo(POLYMORPH_SPELL_ID)] = { [86] = 50, }, -- Polymorph: Sheep |
[GetSpellInfo(61721)] = { [86] = 50, }, -- Polymorph: Rabbit |
[GetSpellInfo(28271)] = { [86] = 50, }, -- Polymorph: Turtle |
[GetSpellInfo(61780)] = { [86] = 50, }, -- Polymorph: Turkey |
local name, rank, icon, cost, isFunnel, powerType, castTime, minRange, maxRange = GetSpellInfo(spellId) |
if not self.spellInfoList[name] then self.spellInfoList[name] = { } end |
self.spellInfoList[name][rank] = { duration = 0, icon = icon } |
-- ChatFrame7:AddMessage("AloftCrowdControl:OnEnable(): " .. tostring(name) .. "/" .. tostring(rank) .. "/" .. tostring(self.spellInfoList[name][rank].duration) .. "/" .. tostring(self.spellInfoList[name][rank].icon)) |
-- ChatFrame7:AddMessage("AloftCrowdControl:OnEnable(): " .. tostring(name) .. "/" .. tostring(rank) .. "/" .. tostring(type(rank)) .. "/" .. tostring(self.spellInfoList[name][rank].duration) .. "/" .. tostring(self.spellInfoList[name][rank].icon)) |
end |
end |
crowdControlDuration = 30 |
local now = GetTime() |
local _, _, icon, _, _, _, _, _, _ = GetSpellInfo(POLYMORPH_SPELL_ID) |
self.crowdControlSpellName = "Spell Name" |
self.crowdControlSpellRank = "Rank" |
self.crowdControlSpellIcon = (self.spellInfoList["Polymorph"] and self.spellInfoList["Polymorph"]["Rank 1"] and self.spellInfoList["Polymorph"]["Rank 1"].icon) or "" |
self.crowdControlSpellIcon = icon |
self.endTime = now + crowdControlDuration |
local value, width = self:CalculateFrameWidth(aloftData, crowdControlDuration, now, self.endTime) |
-- self.crowdControlFrame.crowdControlRegion:Show() |
-- ChatFrame7:AddMessage("AloftCrowdControl:OnConfigModeChanged(): show/" .. tostring(self.crowdControlFrame.crowdControlRegion:IsVisible())) |
crowdControlNameplate = aloftData |
self:SendMessage("Aloft:OnCrowdControlBarShow") |
return |