Details | Compare with Previous | View Log
Line No. | Rev | Author | Line |
---|---|---|---|
1 | 3 | Maccaa-89712 | --------------------------------------------------------- |
2 | Maccaa-89712 | -- KillingBlows |
|
3 | Maccaa-89712 | --------------------------------------------------------- |
|
4 | Maccaa-89712 | KillDB = KillDB or { Enabled = true } |
|
5 | Maccaa-89712 | local KillTimer, KillCounter |
|
6 | 8 | Maccaa-89712 | local KB_FILTER_ENEMY = bit.bor( |
7 | Maccaa-89712 | COMBATLOG_OBJECT_AFFILIATION_PARTY, |
|
8 | Maccaa-89712 | COMBATLOG_OBJECT_AFFILIATION_RAID, |
|
9 | Maccaa-89712 | COMBATLOG_OBJECT_AFFILIATION_OUTSIDER, |
|
10 | Maccaa-89712 | COMBATLOG_OBJECT_REACTION_NEUTRAL, |
|
11 | Maccaa-89712 | COMBATLOG_OBJECT_REACTION_HOSTILE, |
|
12 | Maccaa-89712 | COMBATLOG_OBJECT_CONTROL_PLAYER, |
|
13 | Maccaa-89712 | COMBATLOG_OBJECT_TYPE_PLAYER |
|
14 | Maccaa-89712 | ) |
|
15 | 3 | Maccaa-89712 | --------------------------------------------------------- |
16 | Maccaa-89712 | local OnLoad = function(self) |
|
17 | Maccaa-89712 | self:UnregisterEvent("VARIABLES_LOADED") |
|
18 | Maccaa-89712 | SLASH_KillingBlow1 = "/killblow" |
|
19 | Maccaa-89712 | SlashCmdList["KillingBlow"] = function() |
|
20 | Maccaa-89712 | KillDB.Enabled = not KillDB.Enabled |
|
21 | Maccaa-89712 | DEFAULT_CHAT_FRAME:AddMessage("|cff00aa00Killing Blows|r: Enabled = "..tostring(KillDB.Enabled)) |
|
22 | Maccaa-89712 | end |
|
23 | Maccaa-89712 | end |
|
24 | Maccaa-89712 | --------------------------------------------------------- |
|
25 | Maccaa-89712 | local OnEvent = function(self, event, ...) |
|
26 | Maccaa-89712 | if (event == "VARIABLES_LOADED") then |
|
27 | Maccaa-89712 | OnLoad(self) |
|
28 | Maccaa-89712 | elseif (event == "COMBAT_LOG_EVENT_UNFILTERED") then |
|
29 | 7 | Maccaa-89712 | local _, cmbEvent, sGUID, _, _, _, _, dFlag = select(1, ...) |
30 | 3 | Maccaa-89712 | if (cmbEvent == "PARTY_KILL") then |
31 | 8 | Maccaa-89712 | if (sGUID == UnitGUID("player") and CombatLog_Object_IsA(dFlag, KB_FILTER_ENEMY) and KillDB.Enabled) then |
32 | 3 | Maccaa-89712 | if (not KillTimer or (GetTime() - KillTimer > 60)) then |
33 | Maccaa-89712 | PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\firstblood.mp3") |
|
34 | Maccaa-89712 | KillCounter = 0 |
|
35 | Maccaa-89712 | elseif (GetTime() - KillTimer <= 60) then |
|
36 | Maccaa-89712 | KillCounter = KillCounter + 1 |
|
37 | Maccaa-89712 | if (KillCounter == 1) then |
|
38 | Maccaa-89712 | PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\dominating.mp3") |
|
39 | Maccaa-89712 | elseif (KillCounter == 2) then |
|
40 | Maccaa-89712 | PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\killingspree.mp3") |
|
41 | Maccaa-89712 | elseif (KillCounter == 3) then |
|
42 | Maccaa-89712 | PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\unstoppable.mp3") |
|
43 | Maccaa-89712 | elseif (KillCounter > 3) then |
|
44 | Maccaa-89712 | PlaySoundFile("Interface\\AddOns\\KillingBlows\\Sounds\\godlike.mp3") |
|
45 | Maccaa-89712 | end |
|
46 | Maccaa-89712 | end |
|
47 | Maccaa-89712 | KillTimer = GetTime() |
|
48 | Maccaa-89712 | end |
|
49 | Maccaa-89712 | end |
|
50 | Maccaa-89712 | end |
|
51 | Maccaa-89712 | end |
|
52 | Maccaa-89712 | --------------------------------------------------------- |
|
53 | Maccaa-89712 | local f = CreateFrame("Frame", nil, UIParent) --Frame, nil, UIParent |
|
54 | Maccaa-89712 | f:RegisterEvent("VARIABLES_LOADED") |
|
55 | Maccaa-89712 | f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") |
|
56 | Maccaa-89712 | f:SetScript("OnEvent", OnEvent) |