Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Modules/Config/GeneralSection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ function _Config:LoadGeneralSection()
Stats.RebuildStatInfos()
end,
},
invisibility = {
type = "toggle",
order = 1,
name = function() return i18n("Show invisibility") end,
desc = function() return i18n("Shows/Hides the invisibility value.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.general.display); end,
get = function () return ExtendedCharacterStats.profile.general.invisibility.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.general.invisibility.display = value
Stats.RebuildStatInfos()
end,
},
},
}
end
151 changes: 151 additions & 0 deletions Modules/Data/Constants.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
local IsClassic = ECS.IsClassic
local IsWotlk = ECS.IsWotlk

---@class Data
local Data = ECSLoader:ImportModule("Data")

Expand Down Expand Up @@ -79,6 +82,154 @@ Data.Aura = {
[17800] = (ECS.IsWotlk and -5 or nil), -- Shadow Mastery 5/5
[22959] = (ECS.IsWotlk and -5 or nil), -- Improved Scorch
},
--- index 0 is for "Apply Aura: Invisibility"
--- index n is for "Apply Aura: Invisibility (n)"
--- auras with attributes "Passive spell" or "Aura is hidden" aren't listed here
Invisibility = {
[0] = {
[66] = IsClassic and 100 or nil, -- Lesser Invisibility
[3680] = 100, -- Lesser Invisibility
[4079] = 200, -- Cloaking
[4952] = 200, -- Helcular's War
[5543] = 500, -- Fade Out
[6298] = 200, -- Form of the Moonstalker
[7870] = IsWotlk and 200 or 100, -- Lesser Invisibility
[8611] = 5000, -- Phase Shift
[885] = 200, -- Invisibility
[9095] = -1000, -- Cantation of Manifestation
[9587] = 200, -- Magic Potion
[9738] = -1000, -- Rift Spawn Becomes Visible
[10228] = 300, -- Greater Invisibility
[11392] = 200, -- Invisibility
[12332] = 10000, -- Lathoric the Black
[12845] = 100, -- Lesser Invisibility
[16380] = 300, -- Greater Invisibility
[17651] = 5000, -- Image Projection
[20672] = 500, -- Fade
[23452] = 300, -- Invisibility
[24235] = 10000, -- Super Invis
[25905] = 10000, -- Invis Self
[26222] = 10000, -- Super Invis
[28500] = 200, -- Invisibility
[29309] = 5000, -- Phase Shift
[32943] = 300, -- Phasing Invisibility
[29627] = 200, -- Nether Step
[29921] = 150, -- Phasing Invisibility
[30447] = 50, -- Shadow of the Forest
[30448] = 100, -- Shadow of the Forest
[32612] = 340, -- Invisibility
[32811] = 300, -- Greater Invisibility
[41253] = 300, -- Greater Invisibility
[44312] = 9999, -- Head of the Horseman Invisible
[46021] = 350, -- Spectral Realm
[49399] = 100, -- Skeleton Invis
[50700] = 350, -- Copy of Spectral Realm (Test)
[54436] = 600, -- Demonic Empowerment
[55848] = 1000, -- Invisibility
[69107] = 300, -- Killing Spree Invis Aura
[72343] = 400, -- Hallucination
[440505] = 200, -- Invisibility
[441785] = 101, -- Drained of Blood
[1221579] = 201, -- Super Invis
[1227700] = 201, -- Invisibility
[1231389] = 10000, -- Vanish
},
[1] = {
[8203] = 1000, -- Elemental Spirit Invisibility
},
[2] = {
[17680] = 1, -- Spirit Spawn-out
[24221] = 1, -- Quest - Teleport Spawn-out
[24699] = 10000, -- Vanish
[36748] = 1, -- Smoke Spawn-out
[448779] = 5001, -- Wake Up Dead
[459280] = 101, -- Transiting Realities
[1234595] = 10000, -- Vanish
},
[4] = {
[12495] = 1000, -- Eranikus the Chained Invisibility
[29448] = 9999, -- Vanish
[32727] = 100, -- Arena Preparation
[32754] = 100, -- Invisibility
[34341] = 9999, -- Ember Blast
[38544] = 300, -- Coax Marmot
[39667] = 9999, -- Vanish
[41476] = 9999, -- Vanish
[44036] = 340, -- Fade
[44199] = 9999, -- Ember Blast
[49337] = 1000, -- Racer Slam death scene: car flip Parent
[50008] = 1, -- BOTM - Jungle Brew - Jungle Invisibility Aura
[50015] = 9999, -- You're a ...! (NPC) Death Scene
[55964] = 9999, -- Vanish
[74069] = 100, -- Spawn Invisibility Aura
},
[5] = {
[56783] = 50, -- Quest Invis Tier 4
},
[7] = {
[23303] = 100, -- Vaelen the Flayed [The Shadow Vault] - Invisibility
[27622] = 100, -- Get the Key: Vaelen's Invisibility & See Invisibility
[37754] = 5000, -- Through The Eyes of Gorefiend
[38012] = 5000, -- Garm Wolfbrother: Invisibility
[43890] = 1000, -- Flying Machine Invisibility
[45636] = 100, -- Mist of the Kvaldir
[50734] = 1000, -- Frenzyheart Chicken: Invisibility
[52060] = 300, -- Invisibility
[54500] = 1000, -- Quest Invisibility 1
[56304] = 350, -- Hodir's Helm Bunny: Invisibility
[56768] = 50, -- Quest Invis Tier 1
[56779] = 50, -- Quest Invis Tier 1
[57744] = 1000, -- Quest Invisibility 1
[59649] = 99, -- Icecrown Bomber - Cloak Dome Bunny
[60190] = 1000, -- Invisibility
[60464] = 9, -- Cloaked Alliance Peeps
[70693] = 1000, -- Uther Despawn
[74980] = 1000, -- Spy Frog Invisibility
[75779] = 1000, -- [DND] Marker
[1221135] = 101, -- Torment's Illusion
},
[8] = {
[34840] = 1000, -- Triangulation Point One Invisibility
[34858] = 2000, -- Triangulation Point Two Invisibility
[40194] = 1000, -- Bombing Run: Invisibility
[51113] = 500, -- Monte Muzzleshot's Invisibility (Mangal)
[51114] = 250, -- Monte Muzzleshot's Invisibility (Camp)
[54503] = 1000, -- Quest Invisibility 2
[56058] = 100, -- Get the Key: Instructor Hroegar's Invisibility
[59660] = 999, -- Inside Cloak Dome Individual
[60191] = 1000, -- Invisibility
[60481] = 9, -- Cloaked Horde Peeps
[73973] = 1000, -- Poster Location Marker
[75433] = 100, -- Spawn Invisibility Aura (QZS 2)
},
[9] = {
[39596] = 1000, -- Ethereum Relay
[39680] = 5000, -- Sai'kkal Invisibility
[42175] = 5000, -- Evidence Marker Invis
[52213] = 1000, -- Rainspeaker Treasures: Invisibility
[61208] = 300, -- Fjorn's Anvil - Quest Invisibility 3
[74144] = 1000, -- Poster Location Marker
[74466] = 1000, -- Raging Fire Elemental Invisibility
[75165] = 1000, -- Spirit of the Tiger Aura
[75166] = 1000, -- Spirit of the Tiger Aura (Rider)
[75179] = 1000, -- Matriarch's Shroud
},
[10] = {
[44856] = 100, -- Bash'ir Phasing Device
[45614] = 300, -- Shroud of the Scourge
[48809] = 48812, -- Binding Life
[49097] = 100, -- Out of Body Experience
[52215] = 1000, -- Kartak and Sparktouched: Invisibility
[75513] = 1000, -- Spawn Invisibility Aura (QZM)
[364459] = 1000, -- Shroud of Death
[426062] = 101, -- Quest Invisibility
[462593] = 101, -- Quest Invisibility
[468882] = 101, -- Quest Invisibility
},
[28] = {
[425147] = 101, -- Quest Invisibility
},
},
IsFeralForm = {
[768] = true, -- Cat Form
[5487] = true, -- Bear Form
Expand Down
1 change: 1 addition & 0 deletions Modules/Data/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ end

dataFunctionRefs = {
["MovementSpeed"] = function() return Data:GetMovementSpeed() end,
["Invisibility"] = function() return Data:GetInvisibility() end,
-- Melee
["MeleeAttackPower"] = function() return Data:GetMeleeAttackPower() end,
["MeleeCritChance"] = function() return Data:MeleeCrit() end,
Expand Down
35 changes: 35 additions & 0 deletions Modules/Data/General.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex
local GetDebuffDataByIndex = C_UnitAuras.GetDebuffDataByIndex
local pairs = pairs

---@class Data
local Data = ECSLoader:ImportModule("Data")
---@type DataUtils
Expand All @@ -20,4 +24,35 @@ function Data:GetMovementSpeed()

currentSpeed = currentSpeed / 7 * 100
return DataUtils:Round(currentSpeed, 0) .. "%"
end

---@return number
function Data:GetInvisibility()
local inv = 0

-- buffs
local i = 1
repeat
local aura = GetBuffDataByIndex("player", i)
if aura and aura.spellId then
for _, Id in pairs(Data.Aura.Invisibility) do
inv = inv + (Id[aura.spellId] or 0)
end
end
i = i + 1
until (not aura)

-- debuffs
i = 1
repeat
local aura = GetDebuffDataByIndex("player", i)
if aura and aura.spellId then
for _, Id in pairs(Data.Aura.Invisibility) do
inv = inv + (Id[aura.spellId] or 0)
end
end
i = i + 1
until (not aura)

return DataUtils:Round(inv, 2)
end
7 changes: 6 additions & 1 deletion Modules/Migration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ function Migration:ToLatestProfileVersion(profileVersion)
return
end

local defaultProfile = Profile:GetDefaultProfile()

if profileVersion < 24 then
ExtendedCharacterStats.profile.defense.resilienceRating = ExtendedCharacterStats.profile.defense.resilience
ExtendedCharacterStats.profile.defense.resilience = nil
end
if profileVersion < 25 then
ExtendedCharacterStats.profile.defense.resilience = nil
end
end
if profileVersion < 26 then
ExtendedCharacterStats.profile.general.invisibility = defaultProfile.profile.general.invisibility
end
end
5 changes: 5 additions & 0 deletions Modules/Profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ local function GetDefaultStatsProfile()
text = "General",

movementSpeed = {display = true, refName = "MovementSpeed", text = "Movement Speed"},
invisibility = {
display = true,
refName = "Invisibility",
text = "Invisibility",
},
},

melee = {
Expand Down
6 changes: 5 additions & 1 deletion Modules/Stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ _CreateStatInfos = function()
local profile = ExtendedCharacterStats.profile

local category = profile.general
_CreateStatInfo(category, category.movementSpeed)
_CreateStatInfo(
category,
category.movementSpeed,
category.invisibility
)

category = profile.melee
_CreateStatInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ local generalConfigTranslations = {
["esMX"] = "Muestra/oculta el valor de velocidad de movimiento",
["ptBR"] = "Mostra/oculta o valor da velocidade de movimento"
},
["Shows/Hides the invisibility value."] = {
["enUS"] = true,
["deDE"] = false,
["frFR"] = false,
["zhCN"] = false,
["ruRU"] = false,
["esES"] = false,
["esMX"] = false,
["ptBR"] = false
},
}

for k, v in pairs(generalConfigTranslations) do
Expand Down
10 changes: 10 additions & 0 deletions Modules/i18n/translations/StatTranslations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,16 @@ local statTranslations = {
["esMX"] = "Fallo de las sombras (Niv. + 3)",
["ptBR"] = "Erro de sombra (Nív. + 3)"
},
["Invisibility"] = {
["enUS"] = true,
["deDE"] = false,
["frFR"] = false,
["zhCN"] = false,
["ruRU"] = false,
["esES"] = false,
["esMX"] = false,
["ptBR"] = false
},
}

for k, v in pairs(statTranslations) do
Expand Down
Loading