Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --blade flurry stuff--------------------------------------------------------------------
- local cleaner, updater, bladeflurrytargets = 0, 0, {}
- local bftcf = CreateFrame('Button', 'BladeFlurryTargetCountFrame', UIParent)
- bftcf:SetSize(50,50)
- bftcf:SetPoint('CENTER', UIParent, 'CENTER')
- bftcf:Hide()
- bftcf:RegisterEvent('PLAYER_ENTERING_WORLD')
- bftcf:RegisterUnitEvent('UNIT_AURA', 'player')
- local bftcftext = bftcf:CreateFontString(nil, 'OVERLAY')
- bftcftext:SetFont(FONTSTRINGHERE, 11, 'OUTLINE')
- bftcftext:SetAllPoints()
- bftcf:SetScript('OnEvent', function(self, elapsed, unit)
- if (event == 'PLAYER_ENTERING_WORLD' and InCombatLockdown()) or (event == 'UNIT_AURA' and InCombatLockdown()) then
- if UnitBuff('player', 'Blade Flurry') then
- bftcf:Show()
- bftcf:SetScript('OnUpdate', bftcupdater)
- else
- bftcf:Hide()
- bftcf:SetScript('OnUpdate', nil)
- end
- end
- end)
- local bftcupdater = function('OnUpdate', self, elapsed, updater, cleaner, bladeflurrytargets)
- updater = updater + elapsed
- cleaner = cleaner + elapsed
- while updater >= 0.25 do --update the text value every 1/4 second to give ~real time analysis
- bftcftext:SetText(#bladeflurrytargets)
- updater = updater - 0.25
- end
- while cleaner >= 2.6 do --clear the table every main hand attack base line speed interval(way faster than this with slice and dice, but just to make sure) to be sure every target that's going to be hit has been hit
- for k, v in next, bladeflurrytargets, nil do
- if GetTime() > v then --it's been more than 2.6 seconds since the target has last been hit, thus we assume the target is not currently being hit by bladeflurry, so we nil out its key and value so it's removed from the #bladeflurrytargets value
- k, v = nil, nil
- end
- end
- cleaner = cleaner - 2.6
- end
- end
- --outgoingdmg stuff--------------------------------------------------------------------
- local outgoing = CreateFrame('MessageFrame', 'OutgoingDmgFrame', UIParent)
- outgoing:SetSize(100,100)
- outgoing:SetFont(FONT, 11, 'OUTLINE')
- outgoing:SetJustifyH('LEFT')
- outgoing:SetJustifyV('BOTTOM')
- outgoing:SetPoint('BOTTOMLEFT', 'TARGETTARGETFRAME', 'TOPLEFT', 0, 30)
- outgoing:SetFading(true)
- outgoing:SetFadeDuration(1)
- outgoing:SetInsertMode('BOTTOM')
- outgoing:SetTimeVisible(5)
- outgoing:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- outgoing:SetScript('OnEvent', function(self, event, ...)
- local _, a2, _, _, _, a6, _, _, _, _, _, _, a13, _, _, _, a17, a18, a19, a20, _ = ...
- local icon, texture, text, modifier, r, g, b
- if a2 == UnitGUID('player') or a2 == UnitGUID('pet') or a2 == UnitGUID('vehicle') then --support pets and vehicles
- if event == 'SWING_DAMAGE' then
- texture = GetInventoryItemTexture('player', 16) --main hand weapon icon
- texture = texture..':28:28:0:0:30:30:2:28:2:28|t'
- if a20 then --glancing
- modifier = '~'
- elseif a19 then --crit
- modifier = '+'
- else --blocked, absorbed, overkill, or normal white attack
- modifier = ''
- end
- if a17 or a18 then --absorbed or blocked
- text = a13 - (a17 or a18)..' ('..a17 or a18..')'
- else
- text = a13
- end
- outgoing:AddMessage(texture..' '..modifier..text, 1, 1, 1)
- elseif event == 'SWING_MISSED' and a13 == 'MISS' then
- texture = GetInventoryItemTexture('player', 16) --main hand weapon icon
- texture = texture..':28:28:0:0:30:30:2:28:2:28|t'
- outgoing:AddMessage(texture..' '..a13, 0.53, 0.53, 0.53)
- elseif event == 'SPELL_DAMAGE' then
- texture = select(3, GetSpellInfo(a10))
- texture = texture..':28:28:0:0:30:30:2:28:2:28|t'
- if a19 then --crit
- modifier = '+'
- else
- modifier = ''
- end
- if a18 then --resist
- text = a13 - a18..' ('..a18..')'
- else
- text = a13
- end
- if a10 == 13877 then --blade flurry
- bladeflurrytargets[a6] = a1 + 2.6
- end
- r, g, b = COMBAT_LOG_DEFAULT_COLORS.schoolColoring[a12]
- r, g, b = r*255, g*255, b*255
- outgoing:AddMessage(texture..' '..modifier..text, r, g, b)
- elseif event == 'SPELL_MISSED' and a13 == 'MISS' then
- texture = select(3, GetSpellInfo(a10))
- texture = texture..':28:28:0:0:30:30:2:28:2:28|t'
- outgoing:AddMessage(texture..' '..a13, 0.53, 0.53, 0.53)
- elseif event == 'SPELL_PERIODIC_DAMAGE' then
- texture = select(3, GetSpellInfo(a10))
- texture = texture..':28:28:0:0:30:30:2:28:2:28|t'
- if a19 then --crit
- modifier = '+'
- else
- modifier = ''
- end
- if a18 then --resist
- text = a13 - a18..' ('..a18..')'
- else
- text = a13
- end
- r, g, b = COMBAT_LOG_DEFAULT_COLORS.schoolColoring[a12] --color text by spellschool
- r, g, b = r*255, g*255, b*255
- outgoing:AddMessage(texture..' '..modifier..text, r, g, b)
- elseif event == 'SPELL_PERIODIC_MISSED' and a13 == 'MISS' then
- texture = select(3, GetSpellInfo(a10))
- texture = texture..':28:28:0:0:30:30:2:28:2:28|t'
- outgoing:AddMessage(texture..' '..a13, 0.53, 0.53, 0.53)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement