Add scrolling text files
This commit is contained in:
6
WeakAuras/Projects/ScrollingText/display.lua
Normal file
6
WeakAuras/Projects/ScrollingText/display.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
function()
|
||||||
|
if aura_env.state then
|
||||||
|
local hit = ("%-8s %-8s"):format(aura_env.state.amount, aura_env.state.percent)
|
||||||
|
return hit, aura_env.state.name
|
||||||
|
end
|
||||||
|
end
|
||||||
File diff suppressed because one or more lines are too long
130
WeakAuras/Projects/ScrollingText/init.lua
Normal file
130
WeakAuras/Projects/ScrollingText/init.lua
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
aura_env.envTypes = {
|
||||||
|
["Drowning"] = 132322,
|
||||||
|
["Falling"] = 450905,
|
||||||
|
["Fatigue"] = 237555,
|
||||||
|
["Fire"] = 135805,
|
||||||
|
["Lava"] = 237583,
|
||||||
|
["Slime"] = 132108,
|
||||||
|
}
|
||||||
|
|
||||||
|
aura_env.spellSchools = {
|
||||||
|
--single schools
|
||||||
|
[1] = { "Physical", 1 },
|
||||||
|
[2] = { "Holy", 2 },
|
||||||
|
[4] = { "Fire", 4 },
|
||||||
|
[8] = { "Nature", 8 },
|
||||||
|
[16] = { "Frost", 16 },
|
||||||
|
[32] = { "Shadow", 32 },
|
||||||
|
[64] = { "Arcane", 64 },
|
||||||
|
--double schools
|
||||||
|
[3] = { "Holystrike (Holy+Physical)", 0 },
|
||||||
|
[5] = { "Flamestrike (Fire+Physical)", 0 },
|
||||||
|
[6] = { "Radiant (Fire+Holy)", 0 },
|
||||||
|
[9] = { "Stormstrike (Nature+Physical)", 0 },
|
||||||
|
[10] = { "Holystorm (Nature+Holy)", 0 },
|
||||||
|
[12] = { "Firestorm (Nature+Fire)", 0 },
|
||||||
|
[17] = { "Froststrike (Frost+Physical)", 0 },
|
||||||
|
[18] = { "Holyfrost (Frost+Holy)", 0 },
|
||||||
|
[20] = { "Frostfire (Frost+Fire)", 0 },
|
||||||
|
[24] = { "Froststorm (Frost+Nature)", 0 },
|
||||||
|
[33] = { "Shadowstrike (Shadow+Physical)", 0 },
|
||||||
|
[34] = { "Twilight (Shadow+Holy)", 0 },
|
||||||
|
[36] = { "Shadowflame (Shadow+Fire)", 0 },
|
||||||
|
[40] = { "Plague (Shadow+Nature)", 0 },
|
||||||
|
[48] = { "Shadowfrost (Shadow+Frost)", 0 },
|
||||||
|
[65] = { "Spellstrike (Arcane+Physical)", 0 },
|
||||||
|
[66] = { "Divine (Arcane+Holy)", 0 },
|
||||||
|
[68] = { "Spellfire (Arcane+Fire)", 0 },
|
||||||
|
[72] = { "Astral (Arcane+Nature)", 0 },
|
||||||
|
[80] = { "Spellfrost (Arcane+Frost)", 0 },
|
||||||
|
[96] = { "Spellshadow (Arcane+Shadow)", 0 },
|
||||||
|
--triple and multi schools
|
||||||
|
[28] = { "Elemental (Frost+Nature+Fire)", 0 },
|
||||||
|
[124] = { "Chromatic (Arcane+Shadow+Frost+Nature+Fire)", 0 },
|
||||||
|
[126] = { "Magic (Arcane+Shadow+Frost+Nature+Fire+Holy)", 0 },
|
||||||
|
[127] = { "Chaos (Arcane+Shadow+Frost+Nature+Fire+Holy+Physical)", 0 },
|
||||||
|
}
|
||||||
|
|
||||||
|
aura_env.schoolColors = {
|
||||||
|
[0] = "ffffff", --No school
|
||||||
|
[1] = "ffff00", --Physical
|
||||||
|
[2] = "ffe680", --Holy
|
||||||
|
[4] = "ff8000", --Fire
|
||||||
|
[8] = "50ff61", --Nature
|
||||||
|
[16] = "80ffff", --Frost
|
||||||
|
[32] = "8080ff", --Shadow
|
||||||
|
[64] = "ff80ff", --Arcane
|
||||||
|
[99] = "00ff00", --HEAL
|
||||||
|
}
|
||||||
|
|
||||||
|
aura_env.maxHealth = UnitHealthMax("player")
|
||||||
|
|
||||||
|
aura_env.format = function(value)
|
||||||
|
if not value or type(value) ~= "number" then return end
|
||||||
|
|
||||||
|
if aura_env.config.format == 1 then
|
||||||
|
if value > 999999999 then
|
||||||
|
value = string.format("%.2fB", value / 1000000000)
|
||||||
|
elseif value > 999999 then
|
||||||
|
value = string.format("%.2fM", value / 1000000)
|
||||||
|
elseif value > 99999 then
|
||||||
|
value = string.format("%.fK", value / 1000)
|
||||||
|
elseif value > 999 then
|
||||||
|
value = string.format("%.1fK", value / 1000)
|
||||||
|
elseif value <= 0 then
|
||||||
|
value = 0
|
||||||
|
end
|
||||||
|
elseif aura_env.config.format == 2 then
|
||||||
|
if value > 999999999 then
|
||||||
|
value = ("%d,%03d,%03d,%03d"):format(
|
||||||
|
floor(value / 1000000000),
|
||||||
|
floor(value / 1000000) % 1000,
|
||||||
|
floor(value / 1000) % 1000,
|
||||||
|
value % 1000
|
||||||
|
)
|
||||||
|
elseif value > 999999 then
|
||||||
|
value = ("%d,%03d,%03d"):format(floor(value / 1000000), floor(value / 1000) % 1000, value % 1000)
|
||||||
|
elseif value > 999 then
|
||||||
|
value = ("%d,%03d"):format(floor(value / 1000), value % 1000)
|
||||||
|
elseif value <= 0 then
|
||||||
|
value = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
local aura_env = aura_env
|
||||||
|
local sort1 = function(a, b) return a.state.index > b.state.index end
|
||||||
|
local sort2 = function(a, b) return a.state.index < b.state.index end
|
||||||
|
aura_env.sortAndOffset = function(options)
|
||||||
|
local spacing = aura_env.config.spacing or 2
|
||||||
|
local count = options and 1 or 0
|
||||||
|
local t = {}
|
||||||
|
|
||||||
|
for k, v in pairs(WeakAuras.clones[aura_env.id]) do
|
||||||
|
if v.state and v.state.show and v.state.index then table.insert(t, v) end
|
||||||
|
end
|
||||||
|
|
||||||
|
if aura_env.config.sorting == 1 then
|
||||||
|
table.sort(t, sort1)
|
||||||
|
elseif aura_env.config.sorting == 2 then
|
||||||
|
table.sort(t, sort2)
|
||||||
|
end
|
||||||
|
|
||||||
|
for i, region in pairs(t) do
|
||||||
|
if region.toShow then
|
||||||
|
local xOffset = 0
|
||||||
|
local yOffset = 0
|
||||||
|
if aura_env.config.side == 1 then --TOP
|
||||||
|
yOffset = 0 + (region.height + spacing) * count
|
||||||
|
elseif aura_env.config.side == 2 then --BOTTOM
|
||||||
|
yOffset = 0 - (region.height + spacing) * count
|
||||||
|
end
|
||||||
|
|
||||||
|
region:SetAnchor("CENTER", WeakAuras.regions[aura_env.id].region, "CENTER")
|
||||||
|
region:SetOffset(xOffset, yOffset)
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
568
WeakAuras/Projects/ScrollingText/trigger.lua
Normal file
568
WeakAuras/Projects/ScrollingText/trigger.lua
Normal file
@@ -0,0 +1,568 @@
|
|||||||
|
-- COMBAT_LOG_EVENT_UNFILTERED AURA_INIT
|
||||||
|
|
||||||
|
function(
|
||||||
|
states,
|
||||||
|
event,
|
||||||
|
tstamp,
|
||||||
|
message,
|
||||||
|
hideCaster,
|
||||||
|
srcGUID,
|
||||||
|
srcName,
|
||||||
|
srcFlags,
|
||||||
|
srcRFlags,
|
||||||
|
destGUID,
|
||||||
|
destName,
|
||||||
|
destFlags,
|
||||||
|
destRFlags,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
if event == "OPTIONS" then
|
||||||
|
local amount1 = Round(UnitHealth("player") / 100 * 25)
|
||||||
|
local amount2 = Round(UnitHealth("player") / 100 * 15)
|
||||||
|
states[""] = {
|
||||||
|
name = "PARRY",
|
||||||
|
icon = 644389,
|
||||||
|
amount = "",
|
||||||
|
percent = "",
|
||||||
|
school = "unknown",
|
||||||
|
index = 3,
|
||||||
|
value = UnitHealthMax("player"),
|
||||||
|
total = UnitHealthMax("player"),
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
changed = true,
|
||||||
|
show = true,
|
||||||
|
}
|
||||||
|
states[1] = {
|
||||||
|
name = "Evil Fire Spell",
|
||||||
|
icon = 644389,
|
||||||
|
amount = aura_env.format(amount1),
|
||||||
|
percent = "[25%]",
|
||||||
|
schoolIndex = 4,
|
||||||
|
index = 2,
|
||||||
|
value = UnitHealth("player") / 100 * 50,
|
||||||
|
total = UnitHealthMax("player"),
|
||||||
|
additionalProgress = { [1] = { direction = "forward", width = amount1 } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
changed = true,
|
||||||
|
show = true,
|
||||||
|
}
|
||||||
|
states[2] = {
|
||||||
|
name = "Evil Shadow Spell",
|
||||||
|
icon = 644389,
|
||||||
|
amount = aura_env.format(amount2),
|
||||||
|
percent = "[15%]",
|
||||||
|
schoolIndex = 32,
|
||||||
|
index = 1,
|
||||||
|
value = UnitHealth("player") / 100 * 35,
|
||||||
|
total = UnitHealthMax("player"),
|
||||||
|
additionalProgress = { [1] = { direction = "forward", width = amount2 } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
changed = true,
|
||||||
|
show = true,
|
||||||
|
}
|
||||||
|
states[3] = {
|
||||||
|
name = "Healing",
|
||||||
|
icon = 644389,
|
||||||
|
amount = aura_env.format(amount2),
|
||||||
|
percent = "[15%]",
|
||||||
|
schoolIndex = 99,
|
||||||
|
index = 1,
|
||||||
|
value = UnitHealth("player") / 100 * 35,
|
||||||
|
total = UnitHealthMax("player"),
|
||||||
|
additionalProgress = { [1] = { direction = "forward", width = amount2 } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
changed = true,
|
||||||
|
show = true,
|
||||||
|
}
|
||||||
|
local aura_env = aura_env
|
||||||
|
C_Timer.After(0.1, function() aura_env.sortAndOffset(true) end)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
if event == "COMBAT_LOG_EVENT_UNFILTERED" and destGUID == WeakAuras.myGUID and ... then
|
||||||
|
local c = aura_env.config
|
||||||
|
if message == "SWING_DAMAGE" and c.swing then
|
||||||
|
local amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ...
|
||||||
|
if amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local threshold = amount * 100 / healthMax
|
||||||
|
if threshold >= c.threshold then
|
||||||
|
local schools = aura_env.spellSchools
|
||||||
|
local SC, SCI = 0, 0
|
||||||
|
if schools[school] then
|
||||||
|
SC, SCI = schools[school][1], schools[school][2]
|
||||||
|
end
|
||||||
|
local healthPercentLost = string.format("%.1f%%", threshold)
|
||||||
|
--formatted health
|
||||||
|
local healthAfterHit = overkill > 0 and 0 or healthCurrent - amount
|
||||||
|
--formatted amount
|
||||||
|
local color = aura_env.schoolColors[school] or "ffffff"
|
||||||
|
local prefix = critical and "|cFFFFD100CRIT:|r"
|
||||||
|
or glancing and "|cFFFFD100GLANCE:|r"
|
||||||
|
or crushing and "|cFFFFD100CRUSH:|r"
|
||||||
|
or "|cFFFFD100HIT:|r"
|
||||||
|
local Famount = ("%s |cFF%s%s|r|n"):format(prefix, color, aura_env.format(amount))
|
||||||
|
--formatted absorb
|
||||||
|
local Fabsorbed = absorbed
|
||||||
|
and ("|cFFFFD100ABSORBED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(absorbed))
|
||||||
|
or ""
|
||||||
|
--formatted block
|
||||||
|
local Fblocked = blocked
|
||||||
|
and ("|cFFFFD100BLOCKED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(blocked))
|
||||||
|
or ""
|
||||||
|
--formatted resist
|
||||||
|
local Fresisted = resisted
|
||||||
|
and ("|cFFFFD100RESISTED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(resisted))
|
||||||
|
or ""
|
||||||
|
--formatted overkill
|
||||||
|
local Foverkill = overkill > 0
|
||||||
|
and ("|cFFFFD100OVERKILL:|r |cFFFFFFFF%s|r"):format(aura_env.format(overkill))
|
||||||
|
or ""
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = srcName and ("|cFFFFFFFF%s|r"):format(srcName) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local Finfo = ("|cFFFFFFFFMelee hit|r [%s]"):format(SC == 0 and "unknown" or SC)
|
||||||
|
local Fdamage = ("|cFF00FF00%s|r > |cFF00FF00%s|r (%s)"):format(
|
||||||
|
aura_env.format(healthCurrent),
|
||||||
|
aura_env.format(healthAfterHit),
|
||||||
|
healthPercentLost
|
||||||
|
)
|
||||||
|
local Fdetails = ("%s%s%s%s%s"):format(Famount, Fabsorbed, Fblocked, Fresisted, Foverkill)
|
||||||
|
local tooltip = ("%s %s|n|n%s|n%s|n|n%s"):format(Ftime, Fname, Finfo, Fdamage, Fdetails)
|
||||||
|
local new = {
|
||||||
|
name = "",
|
||||||
|
icon = 135274,
|
||||||
|
spellid = 0,
|
||||||
|
amount = aura_env.format(amount),
|
||||||
|
percent = ("[%s]"):format(healthPercentLost),
|
||||||
|
school = SC,
|
||||||
|
schoolIndex = SCI,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
death = overkill > 0,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = { direction = "backward", width = amount } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif message == "SWING_MISSED" and c.missType then
|
||||||
|
local missType, isOffHand, amount = ...
|
||||||
|
if amount and amount >= c.missThreshold or not amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local Famount = amount and ("|cFFFFD100HIT:|r |cFFFFFFFF%s|r"):format(aura_env.format(amount)) or ""
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = srcName and ("|cFFFFFFFF%s|r"):format(srcName) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local tooltip = ("%s %s|n|n|cFFFFFFFFMelee hit|r |cFFFF0000%s|r|n%s"):format(
|
||||||
|
Ftime,
|
||||||
|
Fname,
|
||||||
|
missType,
|
||||||
|
Famount
|
||||||
|
)
|
||||||
|
local new = {
|
||||||
|
name = missType,
|
||||||
|
icon = 135274,
|
||||||
|
spellid = 0,
|
||||||
|
amount = amount and aura_env.format(amount) or "",
|
||||||
|
percent = "",
|
||||||
|
school = "unknown",
|
||||||
|
schoolIndex = 0,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = {} },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
elseif message == "ENVIRONMENTAL_DAMAGE" and c.env then --enviromental
|
||||||
|
local envType, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ...
|
||||||
|
if amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local threshold = amount * 100 / healthMax
|
||||||
|
if threshold >= c.threshold then
|
||||||
|
local schools = aura_env.spellSchools
|
||||||
|
local SC, SCI = 0, 0
|
||||||
|
if schools[school] then
|
||||||
|
SC, SCI = schools[school][1], schools[school][2]
|
||||||
|
end
|
||||||
|
|
||||||
|
local healthPercentLost = string.format("%.1f%%", threshold)
|
||||||
|
|
||||||
|
--formatted health
|
||||||
|
local healthAfterHit = overkill > 0 and 0 or healthCurrent - amount
|
||||||
|
--formatted amount
|
||||||
|
local color = aura_env.schoolColors[school] or "ffffff"
|
||||||
|
local prefix = critical and "|cFFFFD100CRIT:|r"
|
||||||
|
or glancing and "|cFFFFD100GLANCE:|r"
|
||||||
|
or crushing and "|cFFFFD100CRUSH:|r"
|
||||||
|
or "|cFFFFD100HIT:|r"
|
||||||
|
|
||||||
|
local Famount = ("%s |cFF%s%s|r|n"):format(prefix, color, aura_env.format(amount))
|
||||||
|
--formatted absorb
|
||||||
|
local Fabsorbed = absorbed
|
||||||
|
and ("|cFFFFD100ABSORBED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(absorbed))
|
||||||
|
or ""
|
||||||
|
--formatted block
|
||||||
|
local Fblocked = blocked
|
||||||
|
and ("|cFFFFD100BLOCKED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(blocked))
|
||||||
|
or ""
|
||||||
|
--formatted resist
|
||||||
|
local Fresisted = resisted
|
||||||
|
and ("|cFFFFD100RESISTED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(resisted))
|
||||||
|
or ""
|
||||||
|
--formatted overkill
|
||||||
|
local Foverkill = overkill > 0
|
||||||
|
and ("|cFFFFD100OVERKILL:|r |cFFFFFFFF%s|r"):format(aura_env.format(overkill))
|
||||||
|
or ""
|
||||||
|
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = srcName and ("|cFFFFFFFF%s|r"):format(srcName) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local Finfo = ("|cFFFFFFFFEnvironmental|r [%s]"):format(SC == 0 and "unknown" or SC)
|
||||||
|
local Fdamage = ("|cFF00FF00%s|r > |cFF00FF00%s|r (%s)"):format(
|
||||||
|
aura_env.format(healthCurrent),
|
||||||
|
aura_env.format(healthAfterHit),
|
||||||
|
healthPercentLost
|
||||||
|
)
|
||||||
|
local Fdetails = ("%s%s%s%s%s"):format(Famount, Fabsorbed, Fblocked, Fresisted, Foverkill)
|
||||||
|
local tooltip = ("%s %s|n|n%s|n%s|n|n%s"):format(Ftime, Fname, Finfo, Fdamage, Fdetails)
|
||||||
|
|
||||||
|
local eTypes = aura_env.envTypes
|
||||||
|
|
||||||
|
local new = {
|
||||||
|
name = envType,
|
||||||
|
icon = eTypes[envType] or 132996,
|
||||||
|
spellid = 0,
|
||||||
|
amount = aura_env.format(amount),
|
||||||
|
percent = ("[%s]"):format(healthPercentLost),
|
||||||
|
school = SC,
|
||||||
|
schoolIndex = SCI,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
death = overkill > 0,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = { direction = "forward", width = amount } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif message == "ENVIRONMENTAL_MISSED" and c.missType then
|
||||||
|
local envType, missType, isOffHand, amount = ...
|
||||||
|
if amount and amount >= c.missThreshold or not amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local Famount = amount and ("|cFFFFD100HIT:|r |cFFFFFFFF%s|r"):format(aura_env.format(amount)) or ""
|
||||||
|
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = envType and ("|cFFFFFFFF%s|r"):format(envType) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local tooltip = ("%s %s|n|n|cFFFFFFFFEnvironmental|r |cFFFF0000%s|r|n%s"):format(
|
||||||
|
Ftime,
|
||||||
|
Fname,
|
||||||
|
missType,
|
||||||
|
Famount
|
||||||
|
)
|
||||||
|
|
||||||
|
local eTypes = aura_env.envTypes
|
||||||
|
|
||||||
|
local new = {
|
||||||
|
name = missType,
|
||||||
|
icon = eTypes[envType] or 132996,
|
||||||
|
spellid = 0,
|
||||||
|
amount = amount and aura_env.format(amount) or "",
|
||||||
|
percent = "",
|
||||||
|
school = "unknown",
|
||||||
|
schoolIndex = 0,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = {} },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
elseif string.find(message, "_DAMAGE") and c.other then
|
||||||
|
--SPELL_DAMAGE SPELL_PERIODIC_DAMAGE RANGE_DAMAGE
|
||||||
|
local spellid, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing =
|
||||||
|
...
|
||||||
|
if (c.stagger and spellid ~= 124255 or not c.stagger) and amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local threshold = amount * 100 / healthMax
|
||||||
|
if threshold >= c.threshold then
|
||||||
|
local schools = aura_env.spellSchools
|
||||||
|
local SC, SCI = 0, 0
|
||||||
|
if schools[school] then
|
||||||
|
SC, SCI = schools[school][1], schools[school][2]
|
||||||
|
end
|
||||||
|
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local healthPercentLost = string.format("%.1f%%", threshold)
|
||||||
|
|
||||||
|
--formatted health
|
||||||
|
local healthAfterHit = overkill > 0 and 0 or healthCurrent - amount
|
||||||
|
--formatted amount
|
||||||
|
local color = aura_env.schoolColors[school] or "ffffff"
|
||||||
|
local prefix = critical and "|cFFFFD100CRIT:|r"
|
||||||
|
or glancing and "|cFFFFD100GLANCE:|r"
|
||||||
|
or crushing and "|cFFFFD100CRUSH:|r"
|
||||||
|
or "|cFFFFD100HIT:|r"
|
||||||
|
|
||||||
|
local Famount = ("%s |cFF%s%s|r|n"):format(prefix, color, aura_env.format(amount))
|
||||||
|
--formatted absorb
|
||||||
|
local Fabsorbed = absorbed
|
||||||
|
and ("|cFFFFD100ABSORBED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(absorbed))
|
||||||
|
or ""
|
||||||
|
--formatted block
|
||||||
|
local Fblocked = blocked
|
||||||
|
and ("|cFFFFD100BLOCKED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(blocked))
|
||||||
|
or ""
|
||||||
|
--formatted resist
|
||||||
|
local Fresisted = resisted
|
||||||
|
and ("|cFFFFD100RESISTED:|r |cFFFFFFFF%s|r|n"):format(aura_env.format(resisted))
|
||||||
|
or ""
|
||||||
|
--formatted overkill
|
||||||
|
local Foverkill = overkill > 0
|
||||||
|
and ("|cFFFFD100OVERKILL:|r |cFFFFFFFF%s|r"):format(aura_env.format(overkill))
|
||||||
|
or ""
|
||||||
|
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = srcName and ("|cFFFFFFFF%s|r"):format(srcName) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local Finfo = ("|cFFFFFFFF%s|r [|cFF%s%s|r]"):format(
|
||||||
|
spellName or "unknown",
|
||||||
|
color,
|
||||||
|
SC == 0 and "unknown" or SC
|
||||||
|
)
|
||||||
|
local Fdamage = ("|cFF00FF00%s|r > |cFF00FF00%s|r (%s)"):format(
|
||||||
|
aura_env.format(healthCurrent),
|
||||||
|
aura_env.format(healthAfterHit),
|
||||||
|
healthPercentLost
|
||||||
|
)
|
||||||
|
local Fdetails = ("%s%s%s%s%s"):format(Famount, Fabsorbed, Fblocked, Fresisted, Foverkill)
|
||||||
|
local tooltip = ("%s %s|n|n%s|nspellID: |cFF00FFFF%s|r|n|n%s|n|n%s"):format(
|
||||||
|
Ftime,
|
||||||
|
Fname,
|
||||||
|
Finfo,
|
||||||
|
spellid or "",
|
||||||
|
Fdamage,
|
||||||
|
Fdetails
|
||||||
|
)
|
||||||
|
|
||||||
|
local new = {
|
||||||
|
name = spellName,
|
||||||
|
icon = GetSpellTexture(spellid),
|
||||||
|
spellid = spellid,
|
||||||
|
amount = aura_env.format(amount),
|
||||||
|
percent = ("[%s]"):format(healthPercentLost),
|
||||||
|
school = SC,
|
||||||
|
schoolIndex = SCI,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
death = overkill > 0,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = { direction = "forward", width = amount } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif string.find(message, "_HEAL") and c.other then
|
||||||
|
local spellid, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing =
|
||||||
|
...
|
||||||
|
if c.healing and amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local threshold = amount * 100 / healthMax
|
||||||
|
if threshold >= c.hthreshold then
|
||||||
|
local SC, SCI = 0, 99
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local healthPercentLost = string.format("%.1f%%", threshold)
|
||||||
|
local healthAfterHit = min(healthMax, healthCurrent + amount)
|
||||||
|
local color = aura_env.schoolColors[school] or "ffffff"
|
||||||
|
local prefix = critical and "|cFFFFD100CRIT:|r" or "|cFFFFD100HIT:|r"
|
||||||
|
local Famount = ("%s |cFF%s%s|r|n"):format(prefix, color, aura_env.format(amount))
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = srcName and ("|cFFFFFFFF%s|r"):format(srcName) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local Finfo = ("|cFFFFFFFF%s|r [|cFF%s%s|r]"):format(
|
||||||
|
spellName or "unknown",
|
||||||
|
color,
|
||||||
|
SC == 0 and "" or SC
|
||||||
|
)
|
||||||
|
local Fdamage = ("|cFF00FF00%s|r > |cFF00FF00%s|r (%s)"):format(
|
||||||
|
aura_env.format(healthCurrent),
|
||||||
|
aura_env.format(healthAfterHit),
|
||||||
|
healthPercentLost
|
||||||
|
)
|
||||||
|
local Fdetails = ("%s"):format(Famount)
|
||||||
|
local tooltip = ("%s %s|n|n%s|nspellID: |cFF00FFFF%s|r|n|n%s|n|n%s"):format(
|
||||||
|
Ftime,
|
||||||
|
Fname,
|
||||||
|
Finfo,
|
||||||
|
spellid or "",
|
||||||
|
Fdamage,
|
||||||
|
Fdetails
|
||||||
|
)
|
||||||
|
|
||||||
|
local new = {
|
||||||
|
name = spellName,
|
||||||
|
icon = GetSpellTexture(spellid),
|
||||||
|
spellid = spellid,
|
||||||
|
amount = aura_env.format(amount),
|
||||||
|
percent = ("[%s]"):format(healthPercentLost),
|
||||||
|
school = SC,
|
||||||
|
schoolIndex = SCI,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
death = overkill > 0,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = { direction = "forward", width = amount } },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif string.find(message, "_MISSED") and c.missType then
|
||||||
|
--SPELL_MISSED SPELL_PERIODIC_MISSED RANGE_MISSED
|
||||||
|
local spellid, spellName, school, missType, isOffHand, amount = ...
|
||||||
|
if c.stagger and spellid ~= 124255 or not c.stagger then
|
||||||
|
if amount and amount >= c.missThreshold or not amount then
|
||||||
|
local healthCurrent, healthMax = UnitHealth("player"), UnitHealthMax("player")
|
||||||
|
local Famount = amount and ("|cFFFFD100HIT:|r |cFFFFFFFF%s|r"):format(aura_env.format(amount)) or ""
|
||||||
|
|
||||||
|
local Ftime = ('|cFFFFD100"%s"|r'):format(date("%H:%M:%S"))
|
||||||
|
local Fname = srcName and ("|cFFFFFFFF%s|r"):format(srcName) or "|cFFbbbbbbUNKNOWN|r"
|
||||||
|
local tooltip = ("%s %s|n|n|cFFFFFFFF%s|r |cFFFF0000%s|r|nspellID: |cFF00FFFF%s|r|n%s"):format(
|
||||||
|
Ftime,
|
||||||
|
Fname,
|
||||||
|
spellName,
|
||||||
|
missType,
|
||||||
|
spellid,
|
||||||
|
Famount
|
||||||
|
)
|
||||||
|
|
||||||
|
local new = {
|
||||||
|
name = missType,
|
||||||
|
icon = GetSpellTexture(spellid),
|
||||||
|
spellid = spellid,
|
||||||
|
amount = amount and aura_env.format(amount) or "",
|
||||||
|
percent = "",
|
||||||
|
school = "unknown",
|
||||||
|
schoolIndex = 0,
|
||||||
|
index = 0,
|
||||||
|
value = healthCurrent or 100,
|
||||||
|
total = healthMax or 100,
|
||||||
|
tooltip = tooltip,
|
||||||
|
duration = c.duration,
|
||||||
|
expirationTime = GetTime() + c.duration,
|
||||||
|
additionalProgress = { [1] = {} },
|
||||||
|
progressType = "static",
|
||||||
|
autoHide = true,
|
||||||
|
show = true,
|
||||||
|
changed = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
tinsert(states, new)
|
||||||
|
for k, v in pairs(states) do
|
||||||
|
v.index = v.index + 1
|
||||||
|
v.changed = true
|
||||||
|
if v.index > c.limit then --clone limit
|
||||||
|
v.show = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
15
WeakAuras/Projects/ScrollingText/vars.lua
Normal file
15
WeakAuras/Projects/ScrollingText/vars.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
school = {
|
||||||
|
display = "Damage School name",
|
||||||
|
type = "string",
|
||||||
|
},
|
||||||
|
schoolIndex = {
|
||||||
|
display = "Damage School index",
|
||||||
|
type = "number",
|
||||||
|
},
|
||||||
|
additionalProgress = 1,
|
||||||
|
death = {
|
||||||
|
display = "Death",
|
||||||
|
type = "bool",
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user