WoWInterface SVN KillingBlows

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 1 to Rev 3
    Reverse comparison

Rev 1 → Rev 3

KillingBlows/KillingBlows.toc New file
0,0 → 1,7
## Interface: 20400
## Title: Killing Blows
## Author: Macca
## Notes: Plays sounds when you kill another player.
## SavedVariables: KillDB
 
KillingBlows.lua
\ No newline at end of file
KillingBlows/KillingBlows.lua New file
0,0 → 1,47
---------------------------------------------------------
-- KillingBlows
---------------------------------------------------------
KillDB = KillDB or { Enabled = true }
local KillTimer, KillCounter
---------------------------------------------------------
local OnLoad = function(self)
self:UnregisterEvent("VARIABLES_LOADED")
SLASH_KillingBlow1 = "/killblow"
SlashCmdList["KillingBlow"] = function()
KillDB.Enabled = not KillDB.Enabled
DEFAULT_CHAT_FRAME:AddMessage("|cff00aa00Killing Blows|r: Enabled = "..tostring(KillDB.Enabled))
end
end
---------------------------------------------------------
local OnEvent = function(self, event, ...)
if (event == "VARIABLES_LOADED") then
OnLoad(self)
elseif (event == "COMBAT_LOG_EVENT_UNFILTERED") then
local _, cmbEvent, sGUID, _, _, dGUID, _, dFlag = select(1, ...)
if (cmbEvent == "PARTY_KILL") then
if (sGUID == UnitGUID("player") and KillDB.Enabled) then
if (not KillTimer or (GetTime() - KillTimer > 60)) then
PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\firstblood.mp3")
KillCounter = 0
elseif (GetTime() - KillTimer <= 60) then
KillCounter = KillCounter + 1
if (KillCounter == 1) then
PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\dominating.mp3")
elseif (KillCounter == 2) then
PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\killingspree.mp3")
elseif (KillCounter == 3) then
PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\unstoppable.mp3")
elseif (KillCounter > 3) then
PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\godlike.mp3")
end
end
KillTimer = GetTime()
end
end
end
end
---------------------------------------------------------
local f = CreateFrame("Frame", nil, UIParent) --Frame, nil, UIParent
f:RegisterEvent("VARIABLES_LOADED")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f:SetScript("OnEvent", OnEvent)
\ No newline at end of file