Originally Posted by Fizzlemizz
I'm not exactly sure what you mean by this. Is it that you never see this triggered?
Lua Code:
else if amount > CritMaticData[spellName].highestCrit then if spellName == "Auto Attack" then return end CritMaticData[spellName].highestCrit = amount PlaySound(888, "SFX") CritMatic.ShowNewCritMessage(spellName, amount) print("New highest crit hit for " .. spellName .. ": " .. CritMaticData[spellName].highestCrit) end end
Or something else?
Edit: Taking a closer look:
Lua Code:
if eventType == "SWING_DAMAGE" then spellName = "Auto Attack" spellID = 6603 -- or specify the path to a melee icon, if you have one amount, _, _, _, _, _, critical = unpack(eventInfo, 12, 18) else spellID, spellName, spellSchool = unpack(eventInfo, 12, 14) amount, overhealing, absorbed, critical = unpack(eventInfo, 15, 21) end
If the eventType is not "SWING_DAMAGE" then critical is unpacked from argument 18 not 21
Lua Code:
amount, overhealing, _, _, _, absorbed, critical = unpack(eventInfo, 15, 21)
|
That worked but caused 1 problem now.
edit
The heals crits don't save in the tool-tip or Normal Heals. but works with spell_damage normals hits and Crits
The all messages are fix.
Code:
if eventType == "SWING_DAMAGE" then
spellName = "Auto Attack"
spellID = 6603 -- or specify the path to a melee icon, if you have one
amount, _, _, _, _, _, critical = unpack(eventInfo, 12, 18)
elseif eventType == "SPELL_HEAL" or eventType == "SPELL_PERIODIC_HEAL" then
spellID, spellName, spellSchool = unpack(eventInfo, 12, 14)
amount, overhealing, absorbed, critical = unpack(eventInfo, 15, 18)
elseif eventType == "SPELL_DAMAGE" or eventType == "SPELL_PERIODIC_DAMAGE" then
spellID, spellName, spellSchool = unpack(eventInfo, 12, 14)
amount, overhealing, _, _, _, absorbed, critical = unpack(eventInfo, 15, 21)
end
if sourceGUID == UnitGUID("player") and destGUID ~= UnitGUID("player") and (eventType == "SPELL_DAMAGE" or eventType == "SWING_DAMAGE" or eventType == "RANGE_DAMAGE" or eventType == "SPELL_HEAL" or eventType == "SPELL_PERIODIC_HEAL" or eventType == "SPELL_PERIODIC_DAMAGE") and amount > 0 then
if spellName then
CritMaticData[spellName] = CritMaticData[spellName] or {
highestCrit = 0,
highestNormal = 0,
highestHeal = 0,
highestHealCrit = 0,
spellIcon = GetSpellTexture(spellID)
}
print(CombatLogGetCurrentEventInfo())
if eventType == "SPELL_HEAL" or eventType == "SPELL_PERIODIC_HEAL" then
if critical then
-- When the event is a heal and it's a critical heal.
if amount > CritMaticData[spellName].highestHealCrit then
CritMaticData[spellName].highestHealCrit = amount
PlaySound(888, "SFX")
CritMatic.ShowNewHealCritMessage(spellName, amount)
print("New highest crit heal for " .. spellName .. ": " .. CritMaticData[spellName].highestHealCrit)
end
elseif not critical then
-- When the event is a heal but it's not a critical heal.
if amount > CritMaticData[spellName].highestHeal then
CritMaticData[spellName].highestHeal = amount
PlaySound(10049, "SFX")
CritMatic.ShowNewHealMessage(spellName, amount)
print("New highest normal heal for " .. spellName .. ": " .. CritMaticData[spellName].highestHeal)
end
end
elseif eventType == "SPELL_DAMAGE" or eventType == "SWING_DAMAGE" or eventType == "SPELL_PERIODIC_DAMAGE" then
if critical then
-- When the event is damage and it's a critical hit.
if amount > CritMaticData[spellName].highestCrit then
CritMaticData[spellName].highestCrit = amount
PlaySound(888, "SFX")
CritMatic.ShowNewCritMessage(spellName, amount)
print("New highest crit hit for " .. spellName .. ": " .. CritMaticData[spellName].highestCrit)
end
elseif not critical then
-- When the event is damage but it's not a critical hit.
if amount > CritMaticData[spellName].highestNormal then
CritMaticData[spellName].highestNormal = amount
PlaySound(10049, "SFX")
CritMatic.ShowNewNormalMessage(spellName, amount)
print("New highest normal hit for " .. spellName .. ": " .. CritMaticData[spellName].highestNormal)
end
end
end
end