Rewrite on storage and internal ranking system
This commit is contained in:
@@ -177,8 +177,19 @@ local segmentTypeToString = {
|
||||
return rawget(self, "is_trash")
|
||||
end
|
||||
|
||||
local diffNumberToName = {
|
||||
[1] = "normal",
|
||||
[2] = "heroic",
|
||||
[3] = "mythic",
|
||||
[4] = "ascended",
|
||||
}
|
||||
|
||||
function classCombat:GetDifficulty()
|
||||
return self.is_boss and self.is_boss.diff
|
||||
local bossInfo = self:GetBossInfo()
|
||||
if (bossInfo) then
|
||||
local difficultyId = bossInfo.diff
|
||||
return difficultyId, diffNumberToName[difficultyId]
|
||||
end
|
||||
end
|
||||
|
||||
function classCombat:GetEncounterCleuID()
|
||||
@@ -941,7 +952,7 @@ local segmentTypeToString = {
|
||||
|
||||
---return the total of a specific attribute, example: total damage, total healing, total resources, etc
|
||||
---@param attribute number
|
||||
---@param subAttribute number
|
||||
---@param subAttribute number?
|
||||
---@param onlyGroup boolean?
|
||||
---@return number
|
||||
function classCombat:GetTotal(attribute, subAttribute, onlyGroup)
|
||||
|
||||
@@ -4910,7 +4910,7 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel
|
||||
---@type combat
|
||||
local combatObject = instance:GetCombat()
|
||||
---@type number
|
||||
local diff = combatObject:GetDifficulty()
|
||||
local diff, diffEngName = combatObject:GetDifficulty()
|
||||
---@type string
|
||||
local playerName = actorObject:Name()
|
||||
|
||||
@@ -4919,14 +4919,15 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel
|
||||
--guild ranking on a boss
|
||||
--check if is a raid encounter and if is heroic or mythic
|
||||
do
|
||||
if (diff and (diff == 15 or diff == 16)) then
|
||||
if (diff and (diff == 1 or diff == 2 or diff == 3 or diff == 4)) then --this might give errors
|
||||
local db = Details.OpenStorage()
|
||||
if (db) then
|
||||
local bestRank, encounterTable = Details.storage:GetBestFromPlayer(diff, combatObject:GetBossInfo().id, "damage", playerName, true)
|
||||
---@type details_storage_unitresult, details_encounterkillinfo
|
||||
local bestRank, encounterTable = Details222.storage.GetBestFromPlayer(diffEngName, combatObject:GetBossInfo().id, "DAMAGER", playerName, true)
|
||||
if (bestRank) then
|
||||
--discover which are the player position in the guild rank
|
||||
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, combatObject:GetBossInfo().id, "damage", playerName, true)
|
||||
local text1 = playerName .. " Guild Rank on " .. (combatObject:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
|
||||
local rankPosition = Details222.storage.GetUnitGuildRank(diffEngName, combatObject:GetBossInfo().id, "DAMAGER", playerName, true)
|
||||
local text1 = playerName .. " Guild Rank on " .. (combatObject:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank.total or SMALL_NUMBER) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
|
||||
breakdownWindowFrame:SetStatusbarText (text1, 10, "gray")
|
||||
else
|
||||
breakdownWindowFrame:SetStatusbarText()
|
||||
|
||||
Reference in New Issue
Block a user