local abilityToCrit = {
--Dragonknight
--Ardent Flame
["Dragonknight Standard"] = STAT_SPELL_CRITICAL,
["Shifting Standard"] = STAT_SPELL_CRITICAL,
["Standard of Might"] = STAT_SPELL_CRITICAL,
["Fiery Grip"] = STAT_SPELL_CRITICAL,
["Empowering Chains"] = STAT_SPELL_CRITICAL,
["Extended Chains"] = STAT_SPELL_CRITICAL,
["Searing Strike"] = STAT_CRITICAL_STRIKE, --(dot: spell)
["Unstable Flame"] = STAT_CRITICAL_STRIKE, --(dot: spell)
["Burning Embers"] = STAT_CRITICAL_STRIKE, --(dot: spell)
["Fiery Breath"] = STAT_SPELL_CRITICAL,
["Burning Breath"] = STAT_SPELL_CRITICAL,
["Engulfing Flames"] = STAT_SPELL_CRITICAL,
["Lava Whip"] = STAT_CRITICAL_STRIKE,
["Molten Whip"] = STAT_CRITICAL_STRIKE,
["Flame Lash"] = STAT_CRITICAL_STRIKE,
["Inferno"] = STAT_SPELL_CRITICAL,
["Flames of Oblivion"] = STAT_SPELL_CRITICAL,
["Sea of Flames"] = STAT_SPELL_CRITICAL,
--Draconic Power
["Dragon Leap"] = STAT_CRITICAL_STRIKE,
["Take Flight"] = STAT_CRITICAL_STRIKE,
["Ferocious Leap"] = STAT_CRITICAL_STRIKE,
-- ["Spiked Armor"] = ???,
-- ["Razor Armor"] = ???,
["Volatile Armor"] = STAT_SPELL_CRITICAL,
["Dark Talons"] = STAT_SPELL_CRITICAL,
["Burning Talons"] = STAT_SPELL_CRITICAL,
["Choking Talons"] = STAT_SPELL_CRITICAL,
-- ["Dragon Blood"] = ???,
-- ["Green Dragon Blood"] = ???,
-- ["Coagulating Blood"] = ???,
-- ["Reflective Scale"] = ???,
-- ["Reflective Plate"] = ???,
-- ["Dragon Fire Scale"] = ???,
["Inhale"] = STAT_SPELL_CRITICAL,
["Deep Breath"] = STAT_SPELL_CRITICAL,
["Draw Essence"] = STAT_SPELL_CRITICAL,
--Earthen Heart
["Magma Armor"] = STAT_SPELL_CRITICAL,
["Magma Shell"] = STAT_SPELL_CRITICAL,
["Corrosive Armor"] = STAT_SPELL_CRITICAL,
["Stonefist"] = STAT_SPELL_CRITICAL,
["Obsidian Shard"] = STAT_SPELL_CRITICAL,
["Stone Giant"] = STAT_SPELL_CRITICAL,
-- ["Molten Weapons"] = ???,
-- ["Igneous Weapons"] = ???,
-- ["Molten Armaments"] = ???,
-- ["Obsidian Shield"] = ???,
-- ["Igneous Shield"] = ???,
["Fragmented Shield"] = STAT_SPELL_CRITICAL,
["Petrify"] = STAT_SPELL_CRITICAL,
["Fossilize"] = STAT_SPELL_CRITICAL,
["Shattering Rocks"] = STAT_SPELL_CRITICAL,
-- ["Ash Cloud"] = ???,
["Cinder Storm"] = STAT_SPELL_CRITICAL,
-- ["Eruption"] = ???,
--NightBlade
--Assassination
["Death Stroke"] = STAT_CRITICAL_STRIKE,
["Incapacitating Strike"] = STAT_CRITICAL_STRIKE,
["Soul Harvest"] = STAT_CRITICAL_STRIKE,
["Assassin's Blade"] = STAT_CRITICAL_STRIKE,
["Killer's Blade"] = STAT_CRITICAL_STRIKE,
["Impale"] = STAT_CRITICAL_STRIKE,
["Teleport Strike"] = STAT_CRITICAL_STRIKE,
["Lotus Fan"] = STAT_CRITICAL_STRIKE,
["Ambush"] = STAT_CRITICAL_STRIKE,
-- ["Blur"] = ???,
-- ["Mirage"] = ???,
-- ["Double Take"] = ???,
-- ["Mark Target"] = ???,
-- ["Piercing Mark"] = ???,
-- ["Reaper's Mark"] = ???,
-- ["Haste"] = ???,
-- ["Focused Attacks"] = ???,
-- ["Incapacitate"] = ???,
--Shadow
-- ["Consuming Darkness"] = ???,
-- ["Bolstering Darkness"] = ???,
["Morph Veil of Blades"] = STAT_SPELL_CRITICAL,
-- ["Shadow Cloak"] = ???,
-- ["Shadowy Disguise"] = ???,
-- ["Dark Cloak"] = ???,
["Veiled Strike"] = STAT_CRITICAL_STRIKE,
["Surprise Attack"] = STAT_CRITICAL_STRIKE,
["Concealed Weapon"] = STAT_CRITICAL_STRIKE,
["Path of Darkness"] = STAT_SPELL_CRITICAL,
["Twisting Path"] = STAT_SPELL_CRITICAL,
["Refreshing Path"] = STAT_SPELL_CRITICAL,
-- ["Aspect of Terror"] = ???,
-- ["Mass Hysteria"] = ???,
-- ["Manifestation of Terror"] = ???,
-- ["Summon Shade"] = ???,
-- ["Dark Shades"] = ???,
-- ["Shadow Image"] = ???,
--Siphoning
["Soul Shred"] = STAT_SPELL_CRITICAL,
["Soul Siphon"] = STAT_SPELL_CRITICAL,
["Soul Tether"] = STAT_SPELL_CRITICAL,
["Strife"] = STAT_SPELL_CRITICAL,
["Funnel Health"] = STAT_SPELL_CRITICAL,
["Swallow Soul"] = STAT_SPELL_CRITICAL,
["Agony"] = STAT_SPELL_CRITICAL,
["Prolonged Suffering"] = STAT_SPELL_CRITICAL,
["Malefic Wreath"] = STAT_SPELL_CRITICAL,
["Cripple"] = STAT_SPELL_CRITICAL,
["Debilitate"] = STAT_SPELL_CRITICAL,
["Crippling Grasp"] = STAT_SPELL_CRITICAL,
-- ["Siphonig Strikes"] = ???,
-- ["Leeching Strikes"] = ???,
-- ["Siphoning Attacks"] = ???,
["Drain Power"] = STAT_SPELL_CRITICAL,
["Power Extraction"] = STAT_SPELL_CRITICAL,
["Sap Essence"] = STAT_SPELL_CRITICAL,
--Sorcerer
--Daedric Summoning
["Summon Storm Atronach"] = STAT_SPELL_CRITICAL,
["Daedric Curse"] = STAT_SPELL_CRITICAL,
--Dark Magic
["Crystal Shard"] = STAT_SPELL_CRITICAL,
["Shattering Prison"] = STAT_SPELL_CRITICAL,
["Daedric Mines"] = STAT_SPELL_CRITICAL,
--Storm Calling
["Overload"] = STAT_SPELL_CRITICAL,
["Mages Fury"] = STAT_SPELL_CRITICAL,
["Lightning Form"] = STAT_SPELL_CRITICAL,
["Lightning Splash"] = STAT_SPELL_CRITICAL,
["Morph Sreak"] = STAT_SPELL_CRITICAL,
--Templar
--Aedric Spear
["Radial Sweep"] = STAT_CRITICAL_STRIKE,
["Puncturing Strikes"] = STAT_CRITICAL_STRIKE,
["Piercing Javelin"] = STAT_SPELL_CRITICAL,
["Focused Charge"] = STAT_CRITICAL_STRIKE,
["Spear Shards"] = STAT_SPELL_CRITICAL,
["Sun Shield"] = STAT_SPELL_CRITICAL,
--Passive Abilities
["Burning Light"] = STAT_SPELL_CRITICAL,
--Dawn's Wrath
["Nova"] = STAT_SPELL_CRITICAL,
["Sun Fire"] = STAT_SPELL_CRITICAL,
["Solar Flare"] = STAT_SPELL_CRITICAL,
["Backlash"] = STAT_SPELL_CRITICAL,
["Unstable Core"] = STAT_SPELL_CRITICAL,
["Searing Light"] = STAT_SPELL_CRITICAL,
--Restoring Light
["Rite of Passage"] = STAT_SPELL_CRITICAL,
["Rushed Ceremony"] = STAT_SPELL_CRITICAL,
["Healing Ritual"] = STAT_SPELL_CRITICAL,
["Cleansing Ritual"] = STAT_SPELL_CRITICAL,
["Rune Focus"] = STAT_SPELL_CRITICAL,
--2 handed, 1Hand and Shield, Duel Wield, Bow: weapon
--Exceptions:
--Dual Wielding
--Sparks: na/Morph Ember Explosion: Weapon
--Bow
--Volley: Weapon/Morph Scorched Earth: Weapon, DoT: Spell
--Snipe: Weapon/Morph Lethal Arrow: Weapon, DoT: Spell
--Destruction Staff, Restoration Staff: spell
--Fighters Guild:
["Dawnbreaker"] = STAT_CRITICAL_STRIKE,
["Silver Bolts"] = STAT_CRITICAL_STRIKE,
["Turn Undead"] = STAT_SPELL_CRITICAL,
["Expert Hunter"] = STAT_SPELL_CRITICAL,
["Trap Beast"] = STAT_SPELL_CRITICAL,
--Mages Guild spell (only where a damage output is concerned)
--Undaunted spell (only where a damage output is concerned)
--Soul Magic spell (only where a damage output is concerned)
--Lycanthropy
["Pounce"] = STAT_CRITICAL_STRIKE,
["Hircine's Bounty"] = STAT_SPELL_CRITICAL,
["Piercing Howl"] = STAT_CRITICAL_STRIKE,
["Infectious Claw"] = STAT_CRITICAL_STRIKE,
["Claws of Life"] = STAT_CRITICAL_STRIKE, --HoT: Spell
--Vampirism spell
}
local translations = {
--German
["Drachenritter-Standarte"] = "Dragonknight Standard",
["feuriger Griff"] = "Fiery Grip",
["versengender Schlag"] = "Searing Strike",
["feuriger Odem"] = "Fiery Breath",
--French
["Étendard des Chevaliers-dragons"] = "Dragonknight Standard",
["Poigne ardente"] = "Fiery Grip",
["Frappe incendiaire"] = "Searing Strike",
["Souffle ardent"] = "Fiery Breath",
}
local function AddCriticalChance(self)
local control = WINDOW_MANAGER:GetMouseOverControl()
if control then
local abilityId
if control.actionId then
abilityId = control.actionId
elseif control.index and control.lineIndex and control.skillType then
abilityId = GetSkillAbilityId(control.skillType, control.lineIndex, control.index)
end
if abilityId then
local abilityName = zo_strformat("<<1>>", GetAbilityName(abilityId))
if #abilityName > 0 then
abilityName = translations[abilityName] or abilityName
local stat = abilityToCrit[abilityName]
if stat == STAT_SPELL_CRITICAL then
name = ZO_TOOLTIP_DEFAULT_COLOR:Colorize(GetString(SI_STAT_SPELL_CRITICAL))
value = ("%04.02f%%"):format(GetPlayerStat(STAT_SPELL_CRITICAL, STAT_BONUS_OPTION_APPLY_BONUS, STAT_SOFT_CAP_OPTION_APPLY_SOFT_CAP) / 10)
elseif stat == STAT_CRITICAL_STRIKE then
name = ZO_TOOLTIP_DEFAULT_COLOR:Colorize(GetString(SI_STAT_CRITICAL_STRIKE))
value = ("%04.02f%%"):format(GetPlayerStat(STAT_CRITICAL_STRIKE, STAT_BONUS_OPTION_APPLY_BONUS, STAT_SOFT_CAP_OPTION_APPLY_SOFT_CAP) / 10)
end
if name and value then
self:AddVerticalPadding(-6)
self:AddLine(name, "ZoFontWinH4", 1, 1, 1, LEFT, MODIFY_TEXT_TYPE_NONE, TEXT_ALIGN_LEFT, true)
self:AddVerticalPadding(-25)
self:AddLine(value, "ZoFontWinH4", 1, 1, 1, RIGHT, MODIFY_TEXT_TYPE_NONE, TEXT_ALIGN_RIGHT, true)
self:AddVerticalPadding(6)
end
end
end
end
end
local function AbilityAddControl(self, control)
if control:GetName() == "AbilityTooltipDivider2" then
AddCriticalChance(self)
end
end
local function SkillAddControl(self, control)
if control:GetName() == "SkillTooltipDivider2" then
AddCriticalChance(self)
end
end
local function OnAddOnLoaded(eventCode, addonName)
if addonName:find("^ZO_") then return end
EVENT_MANAGER:UnregisterForEvent("CRITIP", eventCode)
ZO_PreHook(AbilityTooltip, "AddControl", AbilityAddControl)
ZO_PreHook(SkillTooltip, "AddControl", SkillAddControl)
end
EVENT_MANAGER:RegisterForEvent("CRITIP", EVENT_ADD_ON_LOADED, OnAddOnLoaded)