Skip to content

Commit

Permalink
Stable v2.75-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihapro committed Aug 31, 2013
1 parent b346237 commit 5926ddb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
11 changes: 8 additions & 3 deletions MPR/MPR.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MPR = CreateFrame("frame","MPRFrame")
MPR.Version = "v2.75"
MPR.Version = "v2.76"
MPR.VersionNotes = {"Reimplented DKP penalty system (/MPR PENALTIES or /MPR DKP)"}
local ClassColors = {["DEATHKNIGHT"] = "C41F3B", ["DEATH KNIGHT"] = "C41F3B", ["DRUID"] = "FF7D0A", ["HUNTER"] = "ABD473", ["MAGE"] = "69CCF0", ["PALADIN"] = "F58CBA",
["PRIEST"] = "FFFFFF", ["ROGUE"] = "FFF569", ["SHAMAN"] = "0070DE", ["WARLOCK"] = "9482C9", ["WARRIOR"] = "C79C6E"}
Expand Down Expand Up @@ -910,7 +910,7 @@ function MPR:COMBAT_LOG_EVENT_UNFILTERED(...)

-- for fun!
if overkill > 0 and destName == self.BossData[self.DataDeaths[#self.DataDeaths].ID][1] then
MPR:RaidReport(string.format("%s finished off %s with melee attack (A: %i / O: %i)!",sourceName,destName,amount,overkill))
MPR:RaidReport(string.format("%s finished off %s with a melee attack (A: %i / O: %i)!",sourceName,destName,amount,overkill))
end
elseif event == "SWING_MISSED" then
local spellName = ACTION_SWING
Expand All @@ -929,7 +929,7 @@ function MPR:COMBAT_LOG_EVENT_UNFILTERED(...)

-- for fun!
if overkill > 0 and destName == self.BossData[self.DataDeaths[#self.DataDeaths].ID][1] then
MPR:RaidReport(string.format("%s finished off %s with ranged attack (A: %i / O: %i)!",sourceName,destName,amount,overkill))
MPR:RaidReport(string.format("%s finished off %s with %s (A: %i / O: %i)!",sourceName,destName,spellId and GetSpellLink(spellId) or "a ranged attack",amount,overkill))
end
elseif event == "RANGE_MISSED" then
local missType = select(12, ...)
Expand Down Expand Up @@ -1123,6 +1123,11 @@ function MPR:COMBAT_LOG_EVENT_UNFILTERED(...)
if contains(spellsPeriodicDamage,spellName) and UnitInRaid(destName) then
self:ReportSpellDamage(spellId,destName,amount,critical)
end

-- for fun!
if overkill > 0 and destName == self.BossData[self.DataDeaths[#self.DataDeaths].ID][1] then
MPR:RaidReport(string.format("%s finished off %s with a periodic tick of %s (A: %i / O: %i)!",sourceName,destName,GetSpellLink(spellId),amount,overkill))
end
elseif event == "SPELL_PERIODIC_HEAL" then
local amount, overheal, absorbed, critical = select(12, ...)
local school = spellSchool
Expand Down
8 changes: 4 additions & 4 deletions MPR/MPR_Penalties.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function MPR_Penalties:HandleClick_UndoDeduct(n)
local i = MPR_Penalties.Rows[n]["Index"]
local Player, DKP = MPR.DataPenalties[i].Player, MPR.DataPenalties[i].DKP
local NewNet = MPR_Penalties:DeductDKP(Player,-MPR.DataPenalties[i].DKP) -- we deduct negative value, - - => +
if type(NewNet) == "number" then
if type(NewNet) == "number" then
MPR.DataPenalties[i].Status = 0
MPR_Penalties:AnnounceUndoDeduct(Player,DKP,MPR.DataPenalties[i].SpellID)
else
Expand Down Expand Up @@ -344,7 +344,7 @@ function MPR_Penalties:HandleHits(Targets,Spell,SpellID)
table.insert(DeductedPlayers,{Name = Target, Net = NewNet, Amount = Data.Amount, Overkill = Data.Overkill})
Status = 1 -- deducted
else
List = false -- error, don't log this
--List = false -- error, don't log this
MPR:SelfReport(string.format("ERROR: Couldn't deduct %s DKP from %s. %s",DKP or MPR:CS("nil","FF0000"),Target or MPR:CS("unknown player","FF0000"),type(NewNet) == "string" and MPR:CS(NewNet,"FF0000") or "No message given."))
end
end
Expand Down Expand Up @@ -425,7 +425,7 @@ function MPR_Penalties:AnnounceDeductions(Players,DKP,Spell,SpellID)
MPR:SelfReport(string.format("Deducted %i DKP from %s (New NET: %s). Reason: %s",DKP,Name,Net,Reason))
end
if MPR.Settings["PENALTIES_WHISPER"] then
MPR:Whisper(Name, string.format("Deducted %i DKP (New NET: %s). Reason: %s",DKP,NewNet,Reason))
MPR:Whisper(Name, string.format("Deducted %i DKP (New NET: %s). Reason: %s",DKP,Net,Reason))
end
if MPR.Settings["PENALTIES_RAID"] then
if UnitInRaid("player") then
Expand Down Expand Up @@ -482,7 +482,7 @@ function MPR_Penalties:AnnounceUndoDeduct(Name,DKP,SpellID)
end
end
if MPR.Settings["PENALTIES_GUILD"] then
SendChatMessage(string.format("<MPR> Deducted %i DKP from %s. Reason: %s",DKP,Name,Reason), "GUILD")
SendChatMessage(string.format("<MPR> Deduction to %s for %s has been undone. %i DKP restored.",Name,Reason,DKP), "GUILD")
end
end

Expand Down
30 changes: 15 additions & 15 deletions MPR/MPR_Timers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ MPR_Timers.TimerWarns = {
[2] = {[3] = {false, 6}, [2] = {false, 6}, [1] = {false, 6}},
},
[9] = { -- BQL
[1] = {[10] = {false, 3}}, -- Incite Terror: 10s,5s
[2] = {[5] = {false, 7}}, -- Swarming Shadows: 3s,2s,1s
[1] = {[20] = {false, 3}, [10] = {false, 3}}, -- Incite Terror: 20s,10s
[2] = {[5] = {false, 7}}, -- Swarming Shadows: 5s
[3] = {[30] = {false, 8}, [20] = {false, 8}, [10] = {false, 8}, [5] = {false, 7}}, -- Berserk: 30s,20s,10s,5s
},
[12] = { -- LK
Expand Down Expand Up @@ -282,19 +282,19 @@ function MPR_Timers:OnUpdate(elapsed)
if not Label3HasText and (e ~= 12 or self.QuakeCount ~= 1) then
self.Label3:SetText("")
self.Label3:Hide()
if not Label2HasText then
self.Label2:SetText("")
self.Label2:Hide()
if not Label1HasText then
self.Label1:SetText("No timers active.")
end
self:SetHeight(43)
else
self:SetHeight(56)
end
else
self:SetHeight(69)
end
end
if not Label2HasText then
self.Label2:SetText("")
self.Label2:Hide()
end
if not Label1HasText then
self.Label1:SetText("")
self.Label1:Hide()
end
if not Label1HasText and not Label2HasText and not Label3HasText and (e ~= 12 or self.QuakeCount ~= 1) then
self.Label1:SetText("No timers active.")
end
self:SetHeight(Label3HasText and 69 or Label2HasText and 56 or 43)

if e == 12 then -- LK only
self.TimeSinceLastUpdate = self.TimeSinceLastUpdate + elapsed
Expand Down

0 comments on commit 5926ddb

Please sign in to comment.