Added augmented buffs in the Auras tab of players which received Ebon Might and Precience
- Forcing update interval to 0.1 on arenas matches using the real-time dps feature. - Framework Update. - Lib Open Raid Update. - More parser cleanups and code improvements. - Auras tab now ignores regular "world auras" (those weekly buffs of reputation, etc)
This commit is contained in:
@@ -269,6 +269,7 @@
|
||||
---@field damage_taken number amount of damage the actor took during the segment
|
||||
---@field damage_from table<string, boolean> store the name of the actors which damaged the actor, format: [actorName] = true
|
||||
---@field totalabsorbed number amount of damage dealt by the actor by got absorbed by the target, this is a "ABSORB" type of miss but still counts as damage done
|
||||
---@field augmentedSpellsContainer spellcontainer
|
||||
|
||||
---@class actorheal : actor
|
||||
---@field healing_taken number amount of healing the actor took during the segment
|
||||
|
||||
+90
-47
@@ -1,41 +1,74 @@
|
||||
|
||||
local DF = _G ["DetailsFramework"]
|
||||
local _
|
||||
|
||||
if (not DF or not DetailsFrameworkCanLoad) then
|
||||
local detailsFramework = _G ["DetailsFramework"]
|
||||
if (not detailsFramework or not DetailsFrameworkCanLoad) then
|
||||
return
|
||||
end
|
||||
|
||||
--runs when the addon received addon_loaded
|
||||
local addonPreLoad = function(addonFrame, event, ...)
|
||||
--check if the saved variables table is created, if not create one
|
||||
_G[addonFrame.__savedVarsName] = _G[addonFrame.__savedVarsName] or {}
|
||||
local _
|
||||
local CONST_DEFAULT_PROFILE_NAME = "default"
|
||||
|
||||
if (addonFrame.__savedVarsDefaultTemplate) then
|
||||
--load saved vars for this character
|
||||
DF.SavedVars.LoadSavedVarsForPlayer(addonFrame)
|
||||
---@class df_addon : table
|
||||
---@field __name string the addon toc name
|
||||
---@field __savedGlobalVarsName string the name of the global saved variables
|
||||
---@field __savedVarsDefaultTemplate table the default template for the saved variables
|
||||
---@field __frame frame a frame to use for events
|
||||
---@field OnLoaded fun(addon:df_addon, profileTable:table) runs when the addon is loaded at event "ADDON_LOADED"
|
||||
---@field OnInit fun(addon:df_addon, profileTable:table) runs when the addon is initialized at event "PLAYER_LOGIN"
|
||||
---@field OnProfileChanged fun(addon:df_addon, profileTable:table) runs when the profile is changed
|
||||
|
||||
--runs when the addon received addon_loaded
|
||||
local addonLoaded = function(addonFrame, event, addonName)
|
||||
if (addonName ~= addonFrame.__name) then
|
||||
return
|
||||
end
|
||||
|
||||
if (addonFrame.OnLoad) then
|
||||
DF:Dispatch(addonFrame.OnLoad, addonFrame, ...)
|
||||
local addonObject = addonFrame.__addonObject
|
||||
|
||||
if (not addonObject.__savedGlobalVarsName) then
|
||||
if (addonObject.OnLoad) then
|
||||
detailsFramework:Dispatch(addonObject.OnLoad, addonObject)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local playerGUID = UnitGUID("player") --the guid points to a profile name
|
||||
|
||||
---@type table
|
||||
local savedVariables = detailsFramework.SavedVars.GetSavedVariables(addonObject)
|
||||
|
||||
--check if the player has a profileId saved
|
||||
local playerProfileId = savedVariables.profile_ids[playerGUID]
|
||||
if (not playerProfileId) then
|
||||
--it doesn't, set it to use the default profile
|
||||
playerProfileId = CONST_DEFAULT_PROFILE_NAME
|
||||
savedVariables.profile_ids[playerGUID] = playerProfileId
|
||||
end
|
||||
|
||||
local profileTable = detailsFramework.SavedVars.GetProfile(addonObject)
|
||||
|
||||
if (addonObject.OnLoad) then
|
||||
detailsFramework:Dispatch(addonObject.OnLoad, addonObject, profileTable)
|
||||
end
|
||||
end
|
||||
|
||||
--runs when the addon received player_login
|
||||
local addonInit = function(addonFrame, event, ...)
|
||||
if (addonFrame.OnInit) then
|
||||
DF:Dispatch(addonFrame.OnInit, addonFrame, ...)
|
||||
--runs when the addon received PLAYER_LOGIN
|
||||
local addonInit = function(addonFrame)
|
||||
local addonObject = addonFrame.__addonObject
|
||||
|
||||
if (addonObject.OnInit) then
|
||||
local profileTable = detailsFramework.SavedVars.GetProfile(addonObject)
|
||||
detailsFramework:Dispatch(addonObject.OnInit, addonObject, profileTable)
|
||||
end
|
||||
end
|
||||
|
||||
--when the player logout or reloadUI
|
||||
local addonUnload = function(addonFrame, event, ...)
|
||||
--close saved tables
|
||||
DF.SavedVars.CloseSavedTable(addonFrame.db)
|
||||
local addonUnload = function(addonFrame)
|
||||
local addonObject = addonFrame.__addonObject
|
||||
detailsFramework.SavedVars.SaveProfile(addonObject)
|
||||
end
|
||||
|
||||
local addonEvents = {
|
||||
["ADDON_LOADED"] = addonPreLoad,
|
||||
["ADDON_LOADED"] = addonLoaded,
|
||||
["PLAYER_LOGIN"] = addonInit,
|
||||
["PLAYER_LOGOUT"] = addonUnload,
|
||||
}
|
||||
@@ -47,36 +80,46 @@ local addonOnEvent = function(addonFrame, event, ...)
|
||||
else
|
||||
--might be a registered event from the user
|
||||
if (addonFrame[event]) then
|
||||
DF:CoreDispatch(addonFrame.__name, addonFrame[event], addonFrame, event, ...)
|
||||
detailsFramework:CoreDispatch(addonFrame.__name, addonFrame[event], addonFrame, event, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local getAddonName = function(addonFrame)
|
||||
return addonFrame:GetName()
|
||||
detailsFramework.AddonMixin = {
|
||||
|
||||
}
|
||||
|
||||
---create an addon object
|
||||
---@param addonName addonname
|
||||
---@param globalSavedVariablesName string
|
||||
---@param savedVarsTemplate table
|
||||
---@return frame
|
||||
function detailsFramework:CreateNewAddOn(addonName, globalSavedVariablesName, savedVarsTemplate)
|
||||
local newAddonObject = {}
|
||||
|
||||
---@type frame
|
||||
local addonFrame = CreateFrame("frame")
|
||||
newAddonObject.__name = addonName
|
||||
newAddonObject.__savedGlobalVarsName = globalSavedVariablesName
|
||||
newAddonObject.__savedVarsDefaultTemplate = savedVarsTemplate or {}
|
||||
newAddonObject.__frame = addonFrame
|
||||
|
||||
addonFrame.__name = addonName
|
||||
addonFrame.__savedGlobalVarsName = globalSavedVariablesName
|
||||
addonFrame.__savedVarsDefaultTemplate = newAddonObject.__savedVarsDefaultTemplate
|
||||
addonFrame.__addonObject = newAddonObject
|
||||
|
||||
addonFrame:RegisterEvent("ADDON_LOADED")
|
||||
addonFrame:RegisterEvent("PLAYER_LOGIN")
|
||||
addonFrame:RegisterEvent("PLAYER_LOGOUT")
|
||||
addonFrame:SetScript("OnEvent", addonOnEvent)
|
||||
|
||||
return newAddonObject
|
||||
end
|
||||
|
||||
function DF:CreateNewAddOn(addonName, globalSavedVariablesName, savedVarsTemplate)
|
||||
local newAddon = CreateFrame("frame", addonName, UIParent)
|
||||
newAddon.__name = addonName
|
||||
newAddon.__savedVarsName = globalSavedVariablesName
|
||||
newAddon.__savedVarsDefaultTemplate = savedVarsTemplate
|
||||
|
||||
newAddon.GetAddonName = getAddonName
|
||||
|
||||
newAddon:RegisterEvent("ADDON_LOADED")
|
||||
newAddon:RegisterEvent("PLAYER_LOGIN")
|
||||
newAddon:RegisterEvent("PLAYER_LOGOUT")
|
||||
newAddon:SetScript("OnEvent", addonOnEvent)
|
||||
|
||||
return newAddon
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
--old create addon
|
||||
function DF:CreateAddOn (name, global_saved, global_table, options_table, broker)
|
||||
function detailsFramework:CreateAddOn(name, global_saved, global_table, options_table, broker)
|
||||
|
||||
local addon = LibStub("AceAddon-3.0"):NewAddon (name, "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0", "DetailsFramework-1.0", "AceComm-3.0")
|
||||
_G [name] = addon
|
||||
@@ -86,7 +129,7 @@ function DF:CreateAddOn (name, global_saved, global_table, options_table, broker
|
||||
|
||||
if (global_saved) then
|
||||
if (broker and broker.Minimap and not global_table.Minimap) then
|
||||
DF:Msg(name, "broker.Minimap is true but no global.Minimap declared.")
|
||||
detailsFramework:Msg(name, "broker.Minimap is true but no global.Minimap declared.")
|
||||
end
|
||||
self.db = LibStub("AceDB-3.0"):New (global_saved, global_table or {}, true)
|
||||
end
|
||||
@@ -124,9 +167,9 @@ function DF:CreateAddOn (name, global_saved, global_table, options_table, broker
|
||||
if (addon.OnInit) then
|
||||
xpcall(addon.OnInit, geterrorhandler(), addon)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
return addon
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -1120,6 +1120,9 @@ end
|
||||
local atlas
|
||||
if (type(texture) == "string") then
|
||||
atlas = C_Texture.GetAtlasInfo(texture)
|
||||
if (atlas) then
|
||||
atlas = texture
|
||||
end
|
||||
end
|
||||
|
||||
local normalTexture = button:GetNormalTexture()
|
||||
|
||||
+24
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 451
|
||||
local dversion = 453
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary(major, minor)
|
||||
|
||||
@@ -578,6 +578,29 @@ function DF.table.copytocompress(t1, t2)
|
||||
return t1
|
||||
end
|
||||
|
||||
---remove from table1 the values that are also on table2
|
||||
---@param table1 table the table to have the values removed
|
||||
---@param table2 table the reference table
|
||||
function DF.table.removeduplicate(table1, table2)
|
||||
for key, value in pairs(table2) do
|
||||
if (type(value) == "table") then
|
||||
if (table1[key]) then
|
||||
DF.SavedVars.removeduplicate(value, table1[key])
|
||||
end
|
||||
else
|
||||
if (type(table1[key]) == "number" and type(value) == "number") then
|
||||
if (DF:IsNearlyEqual(table1[key], value, 0.0001)) then
|
||||
table1[key] = nil
|
||||
end
|
||||
else
|
||||
if (table1[key] == value) then
|
||||
table1[key] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---add the indexes of table2 into the end of the table table1
|
||||
---@param t1 table
|
||||
---@param t2 table
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
<Script file="header.lua"/>
|
||||
<Script file="containers.lua"/>
|
||||
<Script file="iteminfo.lua"/>
|
||||
<Script file="savedvars.lua"/>
|
||||
<Script file="addon.lua"/>
|
||||
<Script file="colors.lua"/>
|
||||
<Script file="help.lua"/>
|
||||
@@ -17,7 +18,6 @@
|
||||
<Script file="scrollbar.lua"/>
|
||||
<Script file="spells.lua"/>
|
||||
<Script file="math.lua"/>
|
||||
<Script file="savedvars.lua"/>
|
||||
<Script file="languages.lua"/>
|
||||
<Script file="timebar.lua"/>
|
||||
<Script file="charts.lua"/>
|
||||
@@ -34,6 +34,7 @@
|
||||
<Include file="normal_bar.xml"/>
|
||||
<Include file="panel.xml"/>
|
||||
|
||||
<Include file="unitframe.lua"/>
|
||||
<Script file="icon.lua"/>
|
||||
<Script file="pictureedit.lua"/>
|
||||
<Script file="auras.lua"/>
|
||||
|
||||
@@ -974,4 +974,208 @@ detailsFramework.ValueMixin = {
|
||||
SetMaxValueIfBigger = function(self, ...)
|
||||
self.maxValue = math.max(self.maxValue, ...)
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--statusbar mixin
|
||||
|
||||
--[=[
|
||||
collection of functions to embed into a statusbar
|
||||
the statusBar need to have a member called 'barTexture' for the texture set on SetStatusBarTexture
|
||||
statusBar:GetTexture()
|
||||
statusBar:SetTexture(texture)
|
||||
statusBar:SetColor (unparsed color)
|
||||
statusBar:GetColor()
|
||||
statusBar:
|
||||
statusBar:
|
||||
--]=]
|
||||
|
||||
detailsFramework.StatusBarFunctions = {
|
||||
SetTexture = function(self, texture, isTemporary)
|
||||
self.barTexture:SetTexture(texture)
|
||||
if (not isTemporary) then
|
||||
self.barTexture.currentTexture = texture
|
||||
end
|
||||
end,
|
||||
|
||||
ResetTexture = function(self)
|
||||
self.barTexture:SetTexture(self.barTexture.currentTexture)
|
||||
end,
|
||||
|
||||
GetTexture = function(self)
|
||||
return self.barTexture:GetTexture()
|
||||
end,
|
||||
|
||||
SetAtlas = function(self, atlasName)
|
||||
self.barTexture:SetAtlas(atlasName)
|
||||
end,
|
||||
|
||||
GetAtlas = function(self)
|
||||
self.barTexture:GetAtlas()
|
||||
end,
|
||||
|
||||
SetTexCoord = function(self, ...)
|
||||
return self.barTexture:SetTexCoord(...)
|
||||
end,
|
||||
|
||||
GetTexCoord = function(self)
|
||||
return self.barTexture:GetTexCoord()
|
||||
end,
|
||||
|
||||
SetColor = function(self, r, g, b, a)
|
||||
r, g, b, a = detailsFramework:ParseColors(r, g, b, a)
|
||||
self:SetStatusBarColor(r, g, b, a)
|
||||
end,
|
||||
|
||||
GetColor = function(self)
|
||||
return self:GetStatusBarColor()
|
||||
end,
|
||||
|
||||
SetMaskTexture = function(self, ...)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:SetTexture(...)
|
||||
end,
|
||||
|
||||
GetMaskTexture = function(self)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:GetTexture()
|
||||
end,
|
||||
|
||||
--SetMaskTexCoord = function(self, ...) --MaskTexture doesn't not support texcoord
|
||||
-- if (not self:HasTextureMask()) then
|
||||
-- return
|
||||
-- end
|
||||
-- self.barTextureMask:SetTexCoord(...)
|
||||
--end,
|
||||
|
||||
--GetMaskTexCoord = function(self, ...)
|
||||
-- if (not self:HasTextureMask()) then
|
||||
-- return
|
||||
-- end
|
||||
-- self.barTextureMask:GetTexCoord()
|
||||
--end,
|
||||
|
||||
SetMaskAtlas = function(self, atlasName)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:SetAtlas(atlasName)
|
||||
end,
|
||||
|
||||
GetMaskAtlas = function(self)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
self.barTextureMask:GetAtlas()
|
||||
end,
|
||||
|
||||
AddMaskTexture = function(self, object)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
if (object.GetObjectType and object:GetObjectType() == "Texture") then
|
||||
object:AddMaskTexture(self.barTextureMask)
|
||||
else
|
||||
detailsFramework:Msg("Invalid 'Texture' to object:AddMaskTexture(Texture)", debugstack())
|
||||
end
|
||||
end,
|
||||
|
||||
CreateTextureMask = function(self)
|
||||
local barTexture = self:GetStatusBarTexture() or self.barTexture
|
||||
if (not barTexture) then
|
||||
detailsFramework:Msg("Object doesn't not have a statubar texture, create one and object:SetStatusBarTexture(textureObject)", debugstack())
|
||||
return
|
||||
end
|
||||
|
||||
if (self.barTextureMask) then
|
||||
return self.barTextureMask
|
||||
end
|
||||
|
||||
--statusbar texture mask
|
||||
self.barTextureMask = self:CreateMaskTexture(nil, "artwork")
|
||||
self.barTextureMask:SetAllPoints()
|
||||
self.barTextureMask:SetTexture([[Interface\CHATFRAME\CHATFRAMEBACKGROUND]])
|
||||
|
||||
--border texture
|
||||
self.barBorderTextureForMask = self:CreateTexture(nil, "overlay", nil, 7)
|
||||
self.barBorderTextureForMask:SetAllPoints()
|
||||
--self.barBorderTextureForMask:SetPoint("topleft", self, "topleft", -1, 1)
|
||||
--self.barBorderTextureForMask:SetPoint("bottomright", self, "bottomright", 1, -1)
|
||||
self.barBorderTextureForMask:Hide()
|
||||
|
||||
barTexture:AddMaskTexture(self.barTextureMask)
|
||||
|
||||
return self.barTextureMask
|
||||
end,
|
||||
|
||||
HasTextureMask = function(self)
|
||||
if (not self.barTextureMask) then
|
||||
detailsFramework:Msg("Object doesn't not have a texture mask, create one using object:CreateTextureMask()", debugstack())
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
||||
SetBorderTexture = function(self, texture)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
|
||||
texture = texture or ""
|
||||
|
||||
self.barBorderTextureForMask:SetTexture(texture)
|
||||
|
||||
if (texture == "") then
|
||||
self.barBorderTextureForMask:Hide()
|
||||
else
|
||||
self.barBorderTextureForMask:Show()
|
||||
end
|
||||
end,
|
||||
|
||||
GetBorderTexture = function(self)
|
||||
if (not self:HasTextureMask()) then
|
||||
return
|
||||
end
|
||||
return self.barBorderTextureForMask:GetTexture()
|
||||
end,
|
||||
|
||||
SetBorderColor = function(self, r, g, b, a)
|
||||
r, g, b, a = detailsFramework:ParseColors(r, g, b, a)
|
||||
|
||||
if (self.barBorderTextureForMask and self.barBorderTextureForMask:IsShown()) then
|
||||
self.barBorderTextureForMask:SetVertexColor(r, g, b, a)
|
||||
|
||||
--if there's a square border on the widget, remove its color
|
||||
if (self.border and self.border.UpdateSizes and self.border.SetVertexColor) then
|
||||
self.border:SetVertexColor(0, 0, 0, 0)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (self.border and self.border.UpdateSizes and self.border.SetVertexColor) then
|
||||
self.border:SetVertexColor(r, g, b, a)
|
||||
|
||||
--adjust the mask border texture ask well in case the user set the mask color texture before setting a texture on it
|
||||
if (self.barBorderTextureForMask) then
|
||||
self.barBorderTextureForMask:SetVertexColor(r, g, b, a)
|
||||
end
|
||||
return
|
||||
end
|
||||
end,
|
||||
|
||||
GetBorderColor = function(self)
|
||||
if (self.barBorderTextureForMask and self.barBorderTextureForMask:IsShown()) then
|
||||
return self.barBorderTextureForMask:GetVertexColor()
|
||||
end
|
||||
|
||||
if (self.border and self.border.UpdateSizes and self.border.GetVertexColor) then
|
||||
return self.border:GetVertexColor()
|
||||
end
|
||||
end,
|
||||
}
|
||||
+2
-2495
File diff suppressed because it is too large
Load Diff
+110
-197
@@ -1,219 +1,132 @@
|
||||
|
||||
--stopped doing the duplicate savedTable
|
||||
|
||||
local DF = _G ["DetailsFramework"]
|
||||
if (not DF or not DetailsFrameworkCanLoad) then
|
||||
local detailsFramework = _G ["DetailsFramework"]
|
||||
if (not detailsFramework or not DetailsFrameworkCanLoad) then
|
||||
return
|
||||
end
|
||||
|
||||
local _
|
||||
local CONST_DEFAULT_PROFILE_NAME = "default"
|
||||
|
||||
local UnitGUID = UnitGUID
|
||||
|
||||
--create namespace
|
||||
DF.SavedVars = {}
|
||||
detailsFramework.SavedVars = {}
|
||||
|
||||
function DF.SavedVars.CreateNewSavedTable(dbTable, savedTableName)
|
||||
local defaultVars = dbTable.defaultSavedVars
|
||||
local newSavedTable = DF.table.deploy({}, defaultVars)
|
||||
---get the saved variables table for the addon
|
||||
---@param addonObject df_addon the addon frame created by detailsFramework:CreateNewAddOn()
|
||||
---@return table
|
||||
function detailsFramework.SavedVars.GetSavedVariables(addonObject)
|
||||
assert(type(addonObject) == "table", "SetProfile: addonObject must be a table.")
|
||||
|
||||
dbTable.profiles[savedTableName] = newSavedTable
|
||||
return newSavedTable
|
||||
end
|
||||
if (addonObject.__savedGlobalVarsName) then
|
||||
local savedVariables = _G[addonObject.__savedGlobalVarsName]
|
||||
|
||||
function DF.SavedVars.GetOrCreateAddonSavedTablesPlayerList(addonFrame)
|
||||
local addonGlobalSavedTable = _G[addonFrame.__savedVarsName]
|
||||
|
||||
--player list
|
||||
local playerList = addonGlobalSavedTable.__savedVarsByGUID
|
||||
if (not playerList) then
|
||||
addonGlobalSavedTable.__savedVarsByGUID = {}
|
||||
end
|
||||
|
||||
--saved variables table
|
||||
if (not addonGlobalSavedTable.__savedVars) then
|
||||
addonGlobalSavedTable.__savedVars = {}
|
||||
end
|
||||
|
||||
return addonGlobalSavedTable.__savedVarsByGUID
|
||||
end
|
||||
|
||||
--addon statup
|
||||
function DF.SavedVars.LoadSavedVarsForPlayer(addonFrame)
|
||||
local playerSerial = UnitGUID("player")
|
||||
|
||||
--savedTableObject is equivalent of "addon.db"
|
||||
local dbTable = DF.SavedVars.CreateSavedVarsTable(addonFrame, addonFrame.__savedVarsDefaultTemplate)
|
||||
addonFrame.__savedVarsDefaultTemplate = nil
|
||||
addonFrame.db = dbTable
|
||||
|
||||
--load players list
|
||||
local savedVarsName = DF.SavedVars.GetOrCreateAddonSavedTablesPlayerList(addonFrame)
|
||||
|
||||
local playerSavedTableName = savedVarsName[playerSerial]
|
||||
if (not playerSavedTableName) then
|
||||
savedVarsName[playerSerial] = "Default"
|
||||
playerSavedTableName = savedVarsName[playerSerial]
|
||||
end
|
||||
|
||||
local savedTable = addonFrame.db:GetSavedTable(playerSavedTableName)
|
||||
if (not savedTable) then
|
||||
--create a new saved table for this character
|
||||
savedTable = addonFrame.db:CreateNewSavedTable(playerSavedTableName)
|
||||
end
|
||||
|
||||
DF.SavedVars.SetSavedTable(dbTable, playerSavedTableName, true, true)
|
||||
return savedTable
|
||||
end
|
||||
|
||||
function DF.SavedVars.TableCleanUpRecursive(t, default)
|
||||
for key, value in pairs(t) do
|
||||
if (type(value) == "table") then
|
||||
DF.SavedVars.TableCleanUpRecursive(value, default[key])
|
||||
else
|
||||
if (value == default[key]) then
|
||||
t[key] = nil
|
||||
--check if the saved variables table is created, if not create one
|
||||
if (not savedVariables) then
|
||||
if (addonObject.__savedVarsDefaultTemplate) then
|
||||
savedVariables = {
|
||||
profiles = {
|
||||
--store profiles created from the 'savedVarsTemplate'
|
||||
[CONST_DEFAULT_PROFILE_NAME] = detailsFramework.table.deploy({}, addonObject.__savedVarsDefaultTemplate)
|
||||
},
|
||||
profile_ids = {} --store the profile id for each character using its GUID
|
||||
}
|
||||
else
|
||||
savedVariables = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function DF.SavedVars.CloseSavedTable(dbTable)
|
||||
local currentSavedTable = dbTable:GetSavedTable(dbTable:GetCurrentSavedTableName())
|
||||
|
||||
local default = dbTable.defaultSavedVars
|
||||
if (type(currentSavedTable) == "table") then
|
||||
DF.SavedVars.TableCleanUpRecursive(currentSavedTable, default)
|
||||
|
||||
--save
|
||||
local addonGlobalSavedTable = _G[dbTable.addonFrame.__savedVarsName]
|
||||
addonGlobalSavedTable.__savedVars[dbTable:GetCurrentSavedTableName()] = currentSavedTable
|
||||
end
|
||||
end
|
||||
|
||||
--base functions
|
||||
function DF.SavedVars.SetSavedTable(dbTable, savedTableName, createIfNonExistant, isFromInit)
|
||||
local savedTableToBeApplied = dbTable:GetSavedTable(savedTableName)
|
||||
|
||||
if (savedTableToBeApplied) then
|
||||
if (not isFromInit) then
|
||||
--callback unload profile table
|
||||
local currentSavedTable = dbTable:GetSavedTable(dbTable:GetCurrentSavedTableName())
|
||||
dbTable:TriggerCallback("OnProfileUnload", currentSavedTable)
|
||||
DF.SavedVars.CloseSavedTable(dbTable, currentSavedTable)
|
||||
--set the table to be global savedVariables
|
||||
_G[addonObject.__savedGlobalVarsName] = savedVariables
|
||||
end
|
||||
|
||||
dbTable.profile = savedTableToBeApplied
|
||||
dbTable.currentSavedTableName = savedTableName
|
||||
|
||||
dbTable:TriggerCallback("OnProfileLoad", savedTableToBeApplied)
|
||||
|
||||
else
|
||||
if (createIfNonExistant) then
|
||||
local newSavedTable = dbTable:CreateNewSavedTable(savedTableName)
|
||||
|
||||
--callback unload profile table
|
||||
local currentSavedTable = dbTable:GetSavedTable(dbTable:GetCurrentSavedTableName())
|
||||
dbTable:TriggerCallback("OnProfileUnload", currentSavedTable)
|
||||
DF.SavedVars.CloseSavedTable(dbTable, currentSavedTable)
|
||||
|
||||
dbTable.profile = newSavedTable
|
||||
dbTable.currentSavedTableName = savedTableName
|
||||
dbTable:TriggerCallback("OnProfileLoad", newSavedTable)
|
||||
else
|
||||
DF:Msg("profile does not exists", savedTableName)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function DF.SavedVars.GetSavedTables(dbTable)
|
||||
return dbTable.profiles
|
||||
end
|
||||
|
||||
function DF.SavedVars.GetSavedTable(dbTable, savedTableName)
|
||||
local profiles = dbTable:GetSavedTables()
|
||||
return profiles[savedTableName]
|
||||
end
|
||||
|
||||
function DF.SavedVars.GetCurrentSavedTableName(dbTable)
|
||||
return dbTable.currentSavedTableName
|
||||
end
|
||||
|
||||
--duplicate savedTable
|
||||
function DF.SavedVars.DuplicateSavedTable(dbTable, savedTableName)
|
||||
local originalSavedTable = dbTable:GetSavedTable(savedTableName)
|
||||
if (originalSavedTable) then
|
||||
local newSavedTable = DF.table.copy({}, originalSavedTable)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--callbacks
|
||||
function DF.SavedVars.TriggerCallback(dbTable, callbackName, savedTable)
|
||||
local registeredCallbacksTable = dbTable.registeredCallbacks[callbackName]
|
||||
for i = 1, #registeredCallbacksTable do
|
||||
local callback = registeredCallbacksTable[i]
|
||||
DF:CoreDispatch(dbTable.addonFrame.__name, callback.func, savedTable, unpack(callback.payload))
|
||||
end
|
||||
end
|
||||
|
||||
function DF.SavedVars.RegisterCallback(dbTable, callbackName, func, ...)
|
||||
local registeredCallbacksTable = dbTable.registeredCallbacks[callbackName]
|
||||
if (registeredCallbacksTable) then
|
||||
--check for duplicates
|
||||
for i = 1, #registeredCallbacksTable do
|
||||
if (registeredCallbacksTable[i].func == func) then
|
||||
return
|
||||
end
|
||||
if (not savedVariables.profiles) then
|
||||
savedVariables.profiles = {
|
||||
profiles = {
|
||||
--store profiles created from the 'savedVarsTemplate'
|
||||
[CONST_DEFAULT_PROFILE_NAME] = detailsFramework.table.deploy({}, addonObject.__savedVarsDefaultTemplate)
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
--register
|
||||
registeredCallbacksTable[#registeredCallbacksTable+1] = {func = func, payload = {...}}
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function DF.SavedVars.UnregisterCallback(dbTable, callbackName, func)
|
||||
local registeredCallbacksTable = dbTable.registeredCallbacks[callbackName]
|
||||
if (registeredCallbacksTable) then
|
||||
for i = 1, #registeredCallbacksTable do
|
||||
if (registeredCallbacksTable[i].func == func) then
|
||||
tremove(registeredCallbacksTable, i)
|
||||
return true
|
||||
end
|
||||
if (not savedVariables.profile_ids) then
|
||||
savedVariables.profile_ids = {}
|
||||
end
|
||||
|
||||
return savedVariables
|
||||
end
|
||||
|
||||
return {}
|
||||
end
|
||||
|
||||
|
||||
---@param addonObject df_addon the addon frame created by detailsFramework:CreateNewAddOn()
|
||||
---@param bCreateIfNotFound boolean|nil if true, create the profile if it doesn't exist
|
||||
---@param profileToCopyFrom profile|nil if bCreateIfNotFound is true, copy the profile from this profile
|
||||
function detailsFramework.SavedVars.GetProfile(addonObject, bCreateIfNotFound, profileToCopyFrom)
|
||||
assert(type(addonObject) == "table", "GetProfile: addonObject must be a table.")
|
||||
|
||||
local savedVariables = detailsFramework.SavedVars.GetSavedVariables(addonObject)
|
||||
local playerProfileName = savedVariables.profile_ids[UnitGUID("player")] --get the profile name from the player guid
|
||||
local profileTable = savedVariables.profiles[playerProfileName]
|
||||
|
||||
if (not profileTable and bCreateIfNotFound) then
|
||||
profileTable = {}
|
||||
|
||||
if (profileToCopyFrom) then
|
||||
--profileToCopyFrom has been cleaned at this point and only have values set by the user
|
||||
profileTable = detailsFramework.table.deploy(profileTable, profileToCopyFrom)
|
||||
end
|
||||
|
||||
--as deploy does not overwrite existing values, it won't overwrite the values set by 'profileToCopyFrom'
|
||||
profileTable = detailsFramework.table.deploy(profileTable, addonObject.__savedVarsDefaultTemplate)
|
||||
savedVariables.profiles[playerProfileName] = profileTable
|
||||
end
|
||||
|
||||
return profileTable
|
||||
end
|
||||
|
||||
---@param addonObject df_addon the addon frame created by detailsFramework:CreateNewAddOn()
|
||||
---@param profileName profilename the name of the profile to set
|
||||
---@param bCopyFromCurrentProfile boolean if true, copy the current profile to the new profile
|
||||
function detailsFramework.SavedVars.SetProfile(addonObject, profileName, bCopyFromCurrentProfile)
|
||||
assert(type(addonObject) == "table", "SetProfile: addonObject must be a table.")
|
||||
assert(type(profileName) == "string", "SetProfile: profileName must be a string.")
|
||||
|
||||
---@type profile
|
||||
local currentProfile = detailsFramework.SavedVars.GetProfile(addonObject)
|
||||
--save the current profile
|
||||
detailsFramework.SavedVars.SaveProfile(addonObject)
|
||||
|
||||
--set the new profile
|
||||
local savedVariables = detailsFramework.SavedVars.GetSavedVariables(addonObject)
|
||||
local playerGUID = UnitGUID("player")
|
||||
savedVariables.profile_ids[playerGUID] = profileName
|
||||
|
||||
local bCreateIfNotFound = true
|
||||
|
||||
--get the new profile creating if doesn't exist
|
||||
---@type profile
|
||||
local profileTable = detailsFramework.SavedVars.GetProfile(addonObject, bCreateIfNotFound, bCopyFromCurrentProfile and currentProfile or nil)
|
||||
|
||||
if (addonObject.OnProfileChanged) then
|
||||
detailsFramework:Dispatch(addonObject.OnProfileChanged, addonObject, profileTable)
|
||||
end
|
||||
end
|
||||
|
||||
function DF.SavedVars.CreateSavedVarsTable(addonFrame, templateTable)
|
||||
local dbTable = {
|
||||
profiles = {},
|
||||
defaultSavedVars = templateTable,
|
||||
currentSavedTableName = "",
|
||||
addonFrame = addonFrame,
|
||||
---@param addonObject df_addon the addon frame created by detailsFramework:CreateNewAddOn()
|
||||
function detailsFramework.SavedVars.SaveProfile(addonObject)
|
||||
assert(type(addonObject) == "table", "SetProfile: addonObject must be a table.")
|
||||
|
||||
--methods
|
||||
GetSavedTable = DF.SavedVars.GetSavedTable,
|
||||
SetSavedTable = DF.SavedVars.SetSavedTable,
|
||||
GetSavedTables = DF.SavedVars.GetSavedTables,
|
||||
GetCurrentSavedTableName = DF.SavedVars.GetCurrentSavedTableName,
|
||||
CreateNewSavedTable = DF.SavedVars.CreateNewSavedTable,
|
||||
TriggerCallback = DF.SavedVars.TriggerCallback,
|
||||
--the current profile in use
|
||||
local profileTable = detailsFramework.SavedVars.GetProfile(addonObject)
|
||||
--profile template or "default profile"
|
||||
local profileTemplate = addonObject.__savedVarsDefaultTemplate
|
||||
|
||||
--back compatibility with ace3DB
|
||||
GetCurrentProfile = DF.SavedVars.GetCurrentSavedTableName,
|
||||
GetProfile = DF.SavedVars.GetSavedTable,
|
||||
GetProfiles = DF.SavedVars.GetSavedTables,
|
||||
SetProfile = DF.SavedVars.SetSavedTable,
|
||||
RegisterCallback = DF.SavedVars.RegisterCallback,
|
||||
|
||||
registeredCallbacks = {
|
||||
["OnProfileLoad"] = {},
|
||||
["OnProfileUnload"] = {},
|
||||
["OnProfileCopied"] = {},
|
||||
["OnProfileReset"] = {},
|
||||
["OnDatabaseLoad"] = {},
|
||||
["OnDatabaseShutdown"] = {},
|
||||
},
|
||||
}
|
||||
|
||||
return dbTable
|
||||
end
|
||||
--if the addon has a default template, remove the keys which are the same as the default template
|
||||
--these keys haven't been changed by the user, hence doesn't need to save them
|
||||
if (profileTemplate) then
|
||||
detailsFramework.table.removeduplicate(profileTable, addonObject.__savedVarsDefaultTemplate)
|
||||
end
|
||||
end
|
||||
+7
-5
@@ -427,11 +427,10 @@ DF:Mixin(DFSliderMetaFunctions, DF.ScriptHookMixin)
|
||||
buttonPlus:SetHighlightTexture([[Interface\Buttons\UI-PlusButton-Hilight]])
|
||||
buttonMinor:SetHighlightTexture([[Interface\Buttons\UI-PlusButton-Hilight]])
|
||||
|
||||
local plusNormalTexture = buttonPlus:GetNormalTexture()
|
||||
plusNormalTexture:SetDesaturated(true)
|
||||
|
||||
local minorNormalTexture = buttonMinor:GetNormalTexture()
|
||||
minorNormalTexture:SetDesaturated(true)
|
||||
C_Timer.After(0, function()
|
||||
DF:SetButtonTexture(buttonPlus, "AlliedRace-UnlockingFrame-ZoomIn")
|
||||
DF:SetButtonTexture(buttonMinor, "AlliedRace-UnlockingFrame-ZoomOut")
|
||||
end)
|
||||
|
||||
buttonMinor:ClearAllPoints()
|
||||
buttonPlus:ClearAllPoints()
|
||||
@@ -441,6 +440,9 @@ DF:Mixin(DFSliderMetaFunctions, DF.ScriptHookMixin)
|
||||
buttonPlus:SetSize(16, 16)
|
||||
buttonMinor:SetSize(16, 16)
|
||||
|
||||
buttonPlus:SetAlpha(0.834)
|
||||
buttonMinor:SetAlpha(0.834)
|
||||
|
||||
--increate the value on pressing the button or holding the button pressed
|
||||
local buttonPlusOnClick = function()
|
||||
local sliderObject = sliderButtonsParentFrame.host
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -221,6 +221,9 @@
|
||||
---@alias coordright number
|
||||
---@alias coordtop number
|
||||
---@alias coordbottom number
|
||||
---@alias addonname string name of an addon, same as the name of the ToC file.
|
||||
---@alias profile table a table containing the settings of an addon, usually saved in the SavedVariables file.
|
||||
---@alias profilename string name of a profile.
|
||||
|
||||
---@class _G
|
||||
---@field RegisterAttributeDriver fun(statedriver: frame, attribute: string, conditional: string)
|
||||
|
||||
@@ -925,5 +925,6 @@ openRaidLib.specAttribute = {
|
||||
["EVOKER"] = {
|
||||
[1467] = 1, --Devastation
|
||||
[1468] = 1, --Preservation
|
||||
[1473] = 1, --Augmentation
|
||||
},
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
|
||||
end
|
||||
|
||||
local major = "LibOpenRaid-1.0"
|
||||
local CONST_LIB_VERSION = 108
|
||||
local CONST_LIB_VERSION = 111
|
||||
|
||||
if (LIB_OPEN_RAID_MAX_VERSION) then
|
||||
if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then
|
||||
@@ -1363,7 +1363,8 @@ end
|
||||
--talent update (when the player changes a talent and the lib needs to notify other players in the group)
|
||||
function openRaidLib.UnitInfoManager.SendTalentUpdate()
|
||||
--talents
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo("player", true)
|
||||
local playerName = UnitName("player")
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo(playerName, true)
|
||||
local talentsToSend = unitInfo.talents
|
||||
local dataToSend = "" .. CONST_COMM_PLAYERINFO_TALENTS_PREFIX .. ","
|
||||
local talentsString = openRaidLib.PackTable(talentsToSend)
|
||||
@@ -1375,16 +1376,25 @@ function openRaidLib.UnitInfoManager.SendTalentUpdate()
|
||||
end
|
||||
|
||||
function openRaidLib.UnitInfoManager.OnPlayerTalentChanged()
|
||||
--update the local player
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo("player", true)
|
||||
local unitName = UnitName("player")
|
||||
openRaidLib.UnitInfoManager.SetUnitInfo(unitName, unitInfo, nil, nil, nil, openRaidLib.UnitInfoManager.GetPlayerTalents())
|
||||
--this talent update could be a specialization change, so we need to pass the specId as well
|
||||
local playerName = UnitName("player")
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo(playerName, true)
|
||||
local specId = 0
|
||||
|
||||
--schedule send to the group
|
||||
openRaidLib.Schedules.NewUniqueTimer(1 + math.random(0, 1), openRaidLib.UnitInfoManager.SendTalentUpdate, "UnitInfoManager", "sendTalent_Schedule")
|
||||
if (getSpecializationVersion() == CONST_SPECIALIZATION_VERSION_MODERN) then
|
||||
local selectedSpecialization = GetSpecialization()
|
||||
if (selectedSpecialization) then
|
||||
specId = GetSpecializationInfo(selectedSpecialization) or 0
|
||||
end
|
||||
end
|
||||
|
||||
openRaidLib.UnitInfoManager.SetUnitInfo(playerName, unitInfo, specId, nil, nil, openRaidLib.UnitInfoManager.GetPlayerTalents())
|
||||
|
||||
--trigger public callback event
|
||||
openRaidLib.publicCallback.TriggerCallback("TalentUpdate", "player", unitInfo.talents, unitInfo, openRaidLib.UnitInfoManager.GetAllUnitsInfo())
|
||||
|
||||
--schedule send to the group
|
||||
openRaidLib.Schedules.NewUniqueTimer(1 + math.random(0, 1), openRaidLib.UnitInfoManager.SendTalentUpdate, "UnitInfoManager", "sendTalent_Schedule")
|
||||
end
|
||||
openRaidLib.internalCallback.RegisterCallback("talentUpdate", openRaidLib.UnitInfoManager.OnPlayerTalentChanged)
|
||||
|
||||
@@ -1403,7 +1413,8 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_PLAYERINFO_TALENTS_PREFIX, openR
|
||||
--pvp talent update (when the player changes a pvp talent and the lib needs to notify other players in the group)
|
||||
function openRaidLib.UnitInfoManager.SendPvPTalentUpdate()
|
||||
--pvp talents
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo("player", true)
|
||||
local playerName = UnitName("player")
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo(playerName, true)
|
||||
local pvpTalentsToSend = unitInfo.pvpTalents
|
||||
local pvpTalentsString = openRaidLib.PackTable(pvpTalentsToSend)
|
||||
|
||||
@@ -1417,9 +1428,9 @@ end
|
||||
|
||||
function openRaidLib.UnitInfoManager.OnPlayerPvPTalentChanged()
|
||||
--update the local player
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo("player", true)
|
||||
local unitName = UnitName("player")
|
||||
openRaidLib.UnitInfoManager.SetUnitInfo(unitName, unitInfo, nil, nil, nil, nil, nil, openRaidLib.UnitInfoManager.GetPlayerPvPTalents())
|
||||
local playerName = UnitName("player")
|
||||
local unitInfo = openRaidLib.UnitInfoManager.GetUnitInfo(playerName, true)
|
||||
openRaidLib.UnitInfoManager.SetUnitInfo(playerName, unitInfo, nil, nil, nil, nil, nil, openRaidLib.UnitInfoManager.GetPlayerPvPTalents())
|
||||
|
||||
--schedule send to the group
|
||||
openRaidLib.Schedules.NewUniqueTimer(1 + math.random(0, 1), openRaidLib.UnitInfoManager.SendPvPTalentUpdate, "UnitInfoManager", "sendPvPTalent_Schedule")
|
||||
@@ -1584,7 +1595,7 @@ openRaidLib.internalCallback.RegisterCallback("onLeaveCombat", openRaidLib.UnitI
|
||||
local itemLevel = openRaidLib.GearManager.GetPlayerItemLevel()
|
||||
|
||||
--repair status
|
||||
local gearDurability = openRaidLib.GearManager.GetPlayerGearDurability()
|
||||
local gearDurability, lowestItemDurability = openRaidLib.GearManager.GetPlayerGearDurability()
|
||||
|
||||
--get weapon enchant
|
||||
local weaponEnchant, mainHandEnchantId, offHandEnchantId = openRaidLib.GearManager.GetPlayerWeaponEnchant()
|
||||
|
||||
@@ -393,6 +393,7 @@ do
|
||||
[213644] = {cooldown = 8, duration = 0, specs = {66,70}, talent = false, charges = 1, class = "PALADIN", type = 7}, --Cleanse Toxins
|
||||
[389539] = {cooldown = 120, duration = 20, specs = {66}, talent = false, charges = 1, class = "PALADIN", type = 2}, --Sentinel
|
||||
[31935] = {cooldown = 13, duration = 0, specs = {66}, talent = false, charges = 1, class = "PALADIN", type = 6}, --Avenger's Shield
|
||||
[387174] = {cooldown = 60, duration = 9, specs = {66}, talent = false, charges = 1, class = "PALADIN", type = 2}, --Eye of Tyr
|
||||
|
||||
--~warrior
|
||||
-- 71 - Arms
|
||||
|
||||
@@ -976,6 +976,7 @@ do
|
||||
SharedMedia:Register("statusbar", "Splitbar", [[Interface\AddOns\Details\images\bar_textures\split_bar]])
|
||||
SharedMedia:Register("statusbar", "Details2020", [[Interface\AddOns\Details\images\bar_textures\texture2020]])
|
||||
SharedMedia:Register("statusbar", "Left White Gradient", [[Interface\AddOns\Details\images\bar_textures\gradient_white_10percent_left]])
|
||||
SharedMedia:Register("statusbar", "Details! Slash", [[Interface\AddOns\Details\images\bar_textures\bar_of_bars.png]])
|
||||
|
||||
--window bg and bar order
|
||||
SharedMedia:Register("background", "Details Ground", [[Interface\AddOns\Details\images\background]])
|
||||
|
||||
+20
-12
@@ -46,7 +46,7 @@
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--constants
|
||||
|
||||
local container_habilidades = Details.container_habilidades
|
||||
local spellContainerClass = Details.container_habilidades
|
||||
local damageClass = Details.atributo_damage
|
||||
local atributo_misc = Details.atributo_misc
|
||||
local container_damage = Details.container_type.CONTAINER_DAMAGE_CLASS
|
||||
@@ -304,23 +304,23 @@ local void_zone_sort = function(t1, t2)
|
||||
end
|
||||
|
||||
|
||||
function Details.Sort1 (table1, table2) --[[exported]]
|
||||
function Details.Sort1(table1, table2) --[[exported]]
|
||||
return table1[1] > table2[1]
|
||||
end
|
||||
|
||||
function Details.Sort2 (table1, table2) --[[exported]]
|
||||
function Details.Sort2(table1, table2) --[[exported]]
|
||||
return table1[2] > table2[2]
|
||||
end
|
||||
|
||||
function Details.Sort3 (table1, table2) --[[exported]]
|
||||
function Details.Sort3(table1, table2) --[[exported]]
|
||||
return table1[3] > table2[3]
|
||||
end
|
||||
|
||||
function Details.Sort4 (table1, table2) --[[exported]]
|
||||
function Details.Sort4(table1, table2) --[[exported]]
|
||||
return table1[4] > table2[4]
|
||||
end
|
||||
|
||||
function Details.Sort4Reverse (table1, table2) --[[exported]]
|
||||
function Details.Sort4Reverse(table1, table2) --[[exported]]
|
||||
if (not table2) then
|
||||
return true
|
||||
end
|
||||
@@ -456,7 +456,7 @@ end
|
||||
--targets: table where key is the target name (actor name) and the value is the amount of damage done to that target
|
||||
targets = {},
|
||||
--spells: spell container
|
||||
spells = container_habilidades:NovoContainer(container_damage)
|
||||
spells = spellContainerClass:NovoContainer(container_damage)
|
||||
}
|
||||
|
||||
setmetatable(newDamageActor, damageClass)
|
||||
@@ -470,9 +470,6 @@ end
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--special cases
|
||||
|
||||
--todo: Details.use_realtimedps "realtimedps_order_bars" need to come from the sorter function.
|
||||
--todo: "realtimedps_always_arena" need to come from the sorter function because it'll have "realtimedps_order_bars" always on.
|
||||
|
||||
---calculate real time dps for each actor within the passed table
|
||||
---@param tableWithActors actor[]
|
||||
---@return number
|
||||
@@ -3411,7 +3408,7 @@ function damageClass.PredictedAugSpellsOnEnter(self)
|
||||
|
||||
table.sort(spellsAugmented, Details.Sort2)
|
||||
|
||||
for i = 1, #spellsAugmented do
|
||||
for i = 1, math.min(#spellsAugmented, 5) do
|
||||
local sourceName, sourceAmount = unpack(spellsAugmented[i])
|
||||
GameCooltip:AddLine(sourceName, Details:Format(sourceAmount), 1, "yellow", "yellow", 10)
|
||||
local actorObject = combatObject:GetActor(1, sourceName)
|
||||
@@ -6706,6 +6703,17 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
if (actorObject.augmentedSpellsContainer) then
|
||||
local overallAugmentedSpellsContainer = overallActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS)
|
||||
for spellId, spellTable in pairs(actorObject.augmentedSpellsContainer._ActorTable) do --same as actorObject.augmentedSpellsContainer:GetRawSpellTable()
|
||||
local overallSpellTable = overallAugmentedSpellsContainer:GetOrCreateSpell(spellId, true)
|
||||
overallSpellTable.total = overallSpellTable.total + spellTable.total
|
||||
for targetName, amount in pairs(spellTable.targets) do
|
||||
overallSpellTable.targets[targetName] = (overallSpellTable.targets[targetName] or 0) + amount
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--copy the friendly fire container
|
||||
for targetName, friendlyFireTable in pairs(actorObject.friendlyfire) do
|
||||
--get or create the friendly fire table in the overall data
|
||||
@@ -6722,7 +6730,7 @@ end
|
||||
end
|
||||
|
||||
--actor 1 is who will receive the sum from actor2
|
||||
function Details.SumDamageActors(actor1, actor2, actorContainer)
|
||||
function Details.SumDamageActors(actor1, actor2, actorContainer) --not called anywhere, can be deprecated
|
||||
--general
|
||||
actor1.total = actor1.total + actor2.total
|
||||
actor1.damage_taken = actor1.damage_taken + actor2.damage_taken
|
||||
|
||||
@@ -2,91 +2,81 @@
|
||||
local _detalhes = _G.Details
|
||||
local _
|
||||
local addonName, Details222 = ...
|
||||
local classUtility = _detalhes.habilidade_misc
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--local pointers
|
||||
|
||||
local setmetatable = setmetatable --lua local
|
||||
local ipairs = ipairs --lua local
|
||||
local _UnitAura = UnitAura --api local
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--constants
|
||||
|
||||
local alvo_da_habilidade = _detalhes.alvo_da_habilidade
|
||||
local habilidade_misc = _detalhes.habilidade_misc
|
||||
local container_combatentes = _detalhes.container_combatentes
|
||||
local container_misc_target = _detalhes.container_type.CONTAINER_MISCTARGET_CLASS
|
||||
local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--internals
|
||||
|
||||
function habilidade_misc:NovaTabela (id, link, token)
|
||||
|
||||
local _newMiscSpell = {
|
||||
function classUtility:NovaTabela(id, link, token)
|
||||
local spellTable = {
|
||||
id = id,
|
||||
counter = 0,
|
||||
targets = {}
|
||||
}
|
||||
|
||||
if (token == "BUFF_UPTIME" or token == "DEBUFF_UPTIME") then
|
||||
_newMiscSpell.uptime = 0
|
||||
_newMiscSpell.actived = false
|
||||
_newMiscSpell.activedamt = 0 --s�o quantos estao ativados no momento
|
||||
_newMiscSpell.refreshamt = 0
|
||||
_newMiscSpell.appliedamt = 0
|
||||
spellTable.uptime = 0
|
||||
spellTable.actived = false
|
||||
spellTable.activedamt = 0 --amount of active auras
|
||||
spellTable.refreshamt = 0
|
||||
spellTable.appliedamt = 0
|
||||
|
||||
elseif (token == "SPELL_INTERRUPT") then
|
||||
_newMiscSpell.interrompeu_oque = {}
|
||||
spellTable.interrompeu_oque = {}
|
||||
|
||||
elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then
|
||||
_newMiscSpell.dispell_oque = {}
|
||||
spellTable.dispell_oque = {}
|
||||
|
||||
elseif (token == "SPELL_AURA_BROKEN" or token == "SPELL_AURA_BROKEN_SPELL") then
|
||||
_newMiscSpell.cc_break_oque = {}
|
||||
|
||||
spellTable.cc_break_oque = {}
|
||||
end
|
||||
|
||||
return _newMiscSpell
|
||||
return spellTable
|
||||
end
|
||||
|
||||
function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spellName)
|
||||
local actorUtilityObject = token
|
||||
|
||||
if (spellID == "BUFF_OR_DEBUFF") then
|
||||
---@param self spelltable
|
||||
---@param targetName string
|
||||
---@param targetFlags number
|
||||
---@param sourceName string
|
||||
---@param token string|actor
|
||||
---@param spellId number
|
||||
---@param spellName string
|
||||
function classUtility:Add(targetSerial, targetName, targetFlags, sourceName, token, spellId, spellName)
|
||||
--as the passed parameters for aura are different from the reset of the abilities, this should be a different function
|
||||
if (spellId == "BUFF_OR_DEBUFF") then
|
||||
local actorUtilityObject = token
|
||||
local parserToken = spellName
|
||||
|
||||
if (parserToken == "COOLDOWN") then
|
||||
self.counter = self.counter + 1
|
||||
--target
|
||||
self.targets [nome] = (self.targets [nome] or 0) + 1
|
||||
self.targets[targetName] = (self.targets[targetName] or 0) + 1
|
||||
|
||||
elseif (parserToken == "BUFF_UPTIME_REFRESH") then
|
||||
if (self.actived_at and self.actived) then
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
self.uptime = self.uptime + (_detalhes._tempo - self.actived_at)
|
||||
self.refreshamt = self.refreshamt + 1
|
||||
actorUtilityObject.buff_uptime = actorUtilityObject.buff_uptime + _detalhes._tempo - self.actived_at
|
||||
actorUtilityObject.buff_uptime = actorUtilityObject.buff_uptime + (_detalhes._tempo - self.actived_at)
|
||||
end
|
||||
|
||||
self.actived_at = _detalhes._tempo
|
||||
self.actived = true
|
||||
|
||||
elseif (parserToken == "BUFF_UPTIME_OUT") then
|
||||
if (self.actived_at and self.actived) then
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
actorUtilityObject.buff_uptime = actorUtilityObject.buff_uptime + _detalhes._tempo - self.actived_at
|
||||
self.uptime = self.uptime + (_detalhes._tempo - self.actived_at)
|
||||
actorUtilityObject.buff_uptime = actorUtilityObject.buff_uptime + (_detalhes._tempo - self.actived_at)
|
||||
end
|
||||
|
||||
self.actived = false
|
||||
self.actived_at = nil
|
||||
|
||||
elseif (parserToken == "BUFF_UPTIME_IN" or parserToken == "DEBUFF_UPTIME_IN") then
|
||||
--aura applied
|
||||
self.actived = true
|
||||
self.activedamt = self.activedamt + 1
|
||||
self.appliedamt = self.appliedamt + 1
|
||||
|
||||
if (self.actived_at and self.actived and parserToken == "DEBUFF_UPTIME_IN") then
|
||||
--ja esta ativo em outro mob e jogou num novo
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + _detalhes._tempo - self.actived_at
|
||||
self.uptime = self.uptime + (_detalhes._tempo - self.actived_at)
|
||||
actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + (_detalhes._tempo - self.actived_at)
|
||||
end
|
||||
|
||||
self.actived_at = _detalhes._tempo
|
||||
@@ -97,17 +87,18 @@
|
||||
|
||||
elseif (parserToken == "DEBUFF_UPTIME_REFRESH") then
|
||||
if (self.actived_at and self.actived) then
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
self.uptime = self.uptime + (_detalhes._tempo - self.actived_at)
|
||||
self.refreshamt = self.refreshamt + 1
|
||||
actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + _detalhes._tempo - self.actived_at
|
||||
actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + (_detalhes._tempo - self.actived_at)
|
||||
end
|
||||
|
||||
self.actived_at = _detalhes._tempo
|
||||
self.actived = true
|
||||
|
||||
elseif (parserToken == "DEBUFF_UPTIME_OUT") then
|
||||
if (self.actived_at and self.actived) then
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + _detalhes._tempo - self.actived_at
|
||||
self.uptime = self.uptime + (_detalhes._tempo - self.actived_at)
|
||||
actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + (_detalhes._tempo - self.actived_at)
|
||||
end
|
||||
|
||||
self.activedamt = self.activedamt - 1
|
||||
@@ -123,42 +114,42 @@
|
||||
elseif (token == "SPELL_INTERRUPT") then
|
||||
self.counter = self.counter + 1
|
||||
|
||||
if (not self.interrompeu_oque [spellID]) then
|
||||
self.interrompeu_oque [spellID] = 1
|
||||
if (not self.interrompeu_oque[spellId]) then
|
||||
self.interrompeu_oque[spellId] = 1
|
||||
else
|
||||
self.interrompeu_oque [spellID] = self.interrompeu_oque [spellID] + 1
|
||||
self.interrompeu_oque[spellId] = self.interrompeu_oque[spellId] + 1
|
||||
end
|
||||
|
||||
--target
|
||||
self.targets [nome] = (self.targets [nome] or 0) + 1
|
||||
self.targets[targetName] = (self.targets[targetName] or 0) + 1
|
||||
|
||||
elseif (token == "SPELL_RESURRECT") then
|
||||
self.ress = (self.ress or 0) + 1
|
||||
--target
|
||||
self.targets [nome] = (self.targets [nome] or 0) + 1
|
||||
self.targets[targetName] = (self.targets[targetName] or 0) + 1
|
||||
|
||||
elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then
|
||||
self.dispell = (self.dispell or 0) + 1
|
||||
|
||||
if (not self.dispell_oque [spellID]) then
|
||||
self.dispell_oque [spellID] = 1
|
||||
if (not self.dispell_oque[spellId]) then
|
||||
self.dispell_oque[spellId] = 1
|
||||
else
|
||||
self.dispell_oque [spellID] = self.dispell_oque [spellID] + 1
|
||||
self.dispell_oque[spellId] = self.dispell_oque[spellId] + 1
|
||||
end
|
||||
|
||||
--target
|
||||
self.targets [nome] = (self.targets [nome] or 0) + 1
|
||||
self.targets[targetName] = (self.targets[targetName] or 0) + 1
|
||||
|
||||
elseif (token == "SPELL_AURA_BROKEN_SPELL" or token == "SPELL_AURA_BROKEN") then
|
||||
self.cc_break = (self.cc_break or 0) + 1
|
||||
|
||||
if (not self.cc_break_oque [spellID]) then
|
||||
self.cc_break_oque [spellID] = 1
|
||||
if (not self.cc_break_oque[spellId]) then
|
||||
self.cc_break_oque[spellId] = 1
|
||||
else
|
||||
self.cc_break_oque [spellID] = self.cc_break_oque [spellID] + 1
|
||||
self.cc_break_oque[spellId] = self.cc_break_oque[spellId] + 1
|
||||
end
|
||||
|
||||
--target
|
||||
self.targets [nome] = (self.targets [nome] or 0) + 1
|
||||
self.targets[targetName] = (self.targets[targetName] or 0) + 1
|
||||
end
|
||||
end
|
||||
+170
-123
@@ -2398,8 +2398,8 @@ function atributo_misc:r_onlyrefresh_shadow (actor)
|
||||
|
||||
--cc done
|
||||
if (actor.cc_done) then
|
||||
refresh_alvos (shadow.cc_done_targets, actor.cc_done_targets)
|
||||
refresh_habilidades (shadow.cc_done_spells, actor.cc_done_spells)
|
||||
refresh_alvos(shadow.cc_done_targets, actor.cc_done_targets)
|
||||
refresh_habilidades(shadow.cc_done_spells, actor.cc_done_spells)
|
||||
end
|
||||
|
||||
--cooldowns
|
||||
@@ -2412,6 +2412,10 @@ function atributo_misc:r_onlyrefresh_shadow (actor)
|
||||
if (actor.buff_uptime) then
|
||||
refresh_alvos (shadow.buff_uptime_targets, actor.buff_uptime_targets)
|
||||
refresh_habilidades (shadow.buff_uptime_spells, actor.buff_uptime_spells)
|
||||
|
||||
if (actor.received_buffs_spells) then
|
||||
refresh_habilidades(shadow.received_buffs_spells, actor.received_buffs_spells)
|
||||
end
|
||||
end
|
||||
|
||||
--debuff uptime
|
||||
@@ -2462,45 +2466,45 @@ function atributo_misc:r_onlyrefresh_shadow (actor)
|
||||
end
|
||||
|
||||
return shadow
|
||||
|
||||
end
|
||||
|
||||
local somar_keys = function(habilidade, habilidade_tabela1)
|
||||
local sumKeyValues = function(habilidade, habilidade_tabela1)
|
||||
for key, value in pairs(habilidade) do
|
||||
if (type(value) == "number") then
|
||||
if (key ~= "id" and key ~= "spellschool") then
|
||||
habilidade_tabela1 [key] = (habilidade_tabela1 [key] or 0) + value
|
||||
habilidade_tabela1[key] = (habilidade_tabela1[key] or 0) + value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local somar_alvos = function(container1, container2)
|
||||
for target_name, amount in pairs(container2) do
|
||||
container1 [target_name] = (container1 [target_name] or 0) + amount
|
||||
end
|
||||
end
|
||||
local somar_habilidades = function(container1, container2)
|
||||
for spellid, habilidade in pairs(container2._ActorTable) do
|
||||
local habilidade_tabela1 = container1:PegaHabilidade (spellid, true, nil, false)
|
||||
somar_alvos (habilidade_tabela1.targets, habilidade.targets)
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
|
||||
local sumTargetValues = function(container1, container2)
|
||||
for targetName, amount in pairs(container2) do
|
||||
container1[targetName] = (container1[targetName] or 0) + amount
|
||||
end
|
||||
end
|
||||
|
||||
function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
local sumSpellTableKeyValues = function(container1, container2)
|
||||
for spellId, spellTable in pairs(container2._ActorTable) do
|
||||
local spellTable1 = container1:PegaHabilidade(spellId, true, nil, false)
|
||||
sumTargetValues(spellTable1.targets, spellTable.targets)
|
||||
sumKeyValues(spellTable, spellTable1)
|
||||
end
|
||||
end
|
||||
|
||||
function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object)
|
||||
local host_combat = combat_object or _detalhes.tabela_overall
|
||||
|
||||
--criar uma shadow desse ator se ainda n�o tiver uma
|
||||
local overall_misc = host_combat [4]
|
||||
local shadow = overall_misc._ActorTable [overall_misc._NameIndexTable [actor.nome]]
|
||||
local overall_misc = host_combat[4]
|
||||
local shadow = overall_misc._ActorTable[overall_misc._NameIndexTable[actor.nome]]
|
||||
|
||||
if (not actor.nome) then
|
||||
actor.nome = "unknown"
|
||||
end
|
||||
|
||||
if (not shadow) then
|
||||
shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
|
||||
shadow = overall_misc:PegarCombatente(actor.serial, actor.nome, actor.flag_original, true)
|
||||
|
||||
shadow.classe = actor.classe
|
||||
shadow:SetSpecId(actor.spec)
|
||||
@@ -2510,30 +2514,29 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
shadow.boss = actor.boss
|
||||
shadow.boss_fight_component = actor.boss_fight_component
|
||||
shadow.fight_component = actor.fight_component
|
||||
|
||||
end
|
||||
|
||||
--aplica a meta e indexes
|
||||
if (not no_refresh) then
|
||||
_detalhes.refresh:r_atributo_misc (actor, shadow)
|
||||
_detalhes.refresh:r_atributo_misc(actor, shadow)
|
||||
end
|
||||
|
||||
--pets (add unique pet names)
|
||||
for _, petName in ipairs(actor.pets) do
|
||||
DetailsFramework.table.addunique (shadow.pets, petName)
|
||||
DetailsFramework.table.addunique(shadow.pets, petName)
|
||||
end
|
||||
|
||||
if (actor.cc_done) then
|
||||
if (not shadow.cc_done_targets) then
|
||||
shadow.cc_done = _detalhes:GetOrderNumber()
|
||||
shadow.cc_done_targets = {}
|
||||
shadow.cc_done_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
shadow.cc_done_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
end
|
||||
|
||||
shadow.cc_done = shadow.cc_done + actor.cc_done
|
||||
|
||||
somar_alvos (shadow.cc_done_targets, actor.cc_done_targets)
|
||||
somar_habilidades (shadow.cc_done_spells, actor.cc_done_spells)
|
||||
sumTargetValues(shadow.cc_done_targets, actor.cc_done_targets)
|
||||
sumSpellTableKeyValues(shadow.cc_done_spells, actor.cc_done_spells)
|
||||
end
|
||||
|
||||
if (actor.cooldowns_defensive) then
|
||||
@@ -2549,8 +2552,8 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
host_combat.totals_grupo[4].cooldowns_defensive = host_combat.totals_grupo[4].cooldowns_defensive + actor.cooldowns_defensive
|
||||
end
|
||||
|
||||
somar_alvos (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets)
|
||||
somar_habilidades (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells)
|
||||
sumTargetValues (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets)
|
||||
sumSpellTableKeyValues (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells)
|
||||
end
|
||||
|
||||
if (actor.buff_uptime) then
|
||||
@@ -2560,9 +2563,16 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
shadow.buff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
end
|
||||
|
||||
if (actor.received_buffs_spells) then
|
||||
if (not shadow.received_buffs_spells) then
|
||||
shadow.received_buffs_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
end
|
||||
sumSpellTableKeyValues(shadow.received_buffs_spells, actor.received_buffs_spells)
|
||||
end
|
||||
|
||||
shadow.buff_uptime = shadow.buff_uptime + actor.buff_uptime
|
||||
somar_alvos (shadow.buff_uptime_targets, actor.buff_uptime_targets)
|
||||
somar_habilidades (shadow.buff_uptime_spells, actor.buff_uptime_spells)
|
||||
sumTargetValues (shadow.buff_uptime_targets, actor.buff_uptime_targets)
|
||||
sumSpellTableKeyValues (shadow.buff_uptime_spells, actor.buff_uptime_spells)
|
||||
end
|
||||
|
||||
|
||||
@@ -2600,7 +2610,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
end
|
||||
end
|
||||
|
||||
somar_habilidades (shadow.debuff_uptime_spells, actor.debuff_uptime_spells)
|
||||
sumSpellTableKeyValues (shadow.debuff_uptime_spells, actor.debuff_uptime_spells)
|
||||
end
|
||||
|
||||
--interrupt
|
||||
@@ -2618,8 +2628,8 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
host_combat.totals_grupo[4].interrupt = host_combat.totals_grupo[4].interrupt + actor.interrupt
|
||||
end
|
||||
|
||||
somar_alvos (shadow.interrupt_targets, actor.interrupt_targets)
|
||||
somar_habilidades (shadow.interrupt_spells, actor.interrupt_spells)
|
||||
sumTargetValues (shadow.interrupt_targets, actor.interrupt_targets)
|
||||
sumSpellTableKeyValues (shadow.interrupt_spells, actor.interrupt_spells)
|
||||
|
||||
for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do
|
||||
local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade (spellid, true, nil, true)
|
||||
@@ -2649,8 +2659,8 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
host_combat.totals_grupo[4].ress = host_combat.totals_grupo[4].ress + actor.ress
|
||||
end
|
||||
|
||||
somar_alvos (shadow.ress_targets, actor.ress_targets)
|
||||
somar_habilidades (shadow.ress_spells, actor.ress_spells)
|
||||
sumTargetValues (shadow.ress_targets, actor.ress_targets)
|
||||
sumSpellTableKeyValues (shadow.ress_spells, actor.ress_spells)
|
||||
end
|
||||
|
||||
--dispell
|
||||
@@ -2668,8 +2678,8 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
host_combat.totals_grupo[4].dispell = host_combat.totals_grupo[4].dispell + actor.dispell
|
||||
end
|
||||
|
||||
somar_alvos (shadow.dispell_targets, actor.dispell_targets)
|
||||
somar_habilidades (shadow.dispell_spells, actor.dispell_spells)
|
||||
sumTargetValues (shadow.dispell_targets, actor.dispell_targets)
|
||||
sumSpellTableKeyValues (shadow.dispell_spells, actor.dispell_spells)
|
||||
|
||||
for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do
|
||||
local habilidade_shadow = shadow.dispell_spells:PegaHabilidade (spellid, true, nil, true)
|
||||
@@ -2698,8 +2708,8 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object)
|
||||
host_combat.totals_grupo[4].cc_break = host_combat.totals_grupo[4].cc_break + actor.cc_break
|
||||
end
|
||||
|
||||
somar_alvos (shadow.cc_break_targets, actor.cc_break_targets)
|
||||
somar_habilidades (shadow.cc_break_spells, actor.cc_break_spells)
|
||||
sumTargetValues (shadow.cc_break_targets, actor.cc_break_targets)
|
||||
sumSpellTableKeyValues (shadow.cc_break_spells, actor.cc_break_spells)
|
||||
|
||||
for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do
|
||||
local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade (spellid, true, nil, true)
|
||||
@@ -2749,9 +2759,18 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow)
|
||||
if (shadow and not shadow.buff_uptime_targets) then
|
||||
shadow.buff_uptime = 0
|
||||
shadow.buff_uptime_targets = {}
|
||||
shadow.buff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
shadow.buff_uptime_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
|
||||
if (thisActor.received_buffs_spells) then
|
||||
shadow.received_buffs_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS)
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.refresh:r_container_habilidades(thisActor.buff_uptime_spells, shadow and shadow.buff_uptime_spells)
|
||||
|
||||
if (thisActor.received_buffs_spells) then
|
||||
_detalhes.refresh:r_container_habilidades(thisActor.received_buffs_spells, shadow and shadow.received_buffs_spells)
|
||||
end
|
||||
_detalhes.refresh:r_container_habilidades (thisActor.buff_uptime_spells, shadow and shadow.buff_uptime_spells)
|
||||
end
|
||||
|
||||
--refresh buff uptime
|
||||
@@ -2834,7 +2853,11 @@ function _detalhes.clear:c_atributo_misc (este_jogador)
|
||||
end
|
||||
|
||||
if (este_jogador.buff_uptime_targets) then
|
||||
_detalhes.clear:c_container_habilidades (este_jogador.buff_uptime_spells)
|
||||
_detalhes.clear:c_container_habilidades(este_jogador.buff_uptime_spells)
|
||||
|
||||
if (este_jogador.received_buffs_spells) then
|
||||
_detalhes.clear:c_container_habilidades(este_jogador.received_buffs_spells)
|
||||
end
|
||||
end
|
||||
|
||||
if (este_jogador.debuff_uptime_targets) then
|
||||
@@ -2859,55 +2882,56 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
if (tabela2.cc_done) then
|
||||
tabela1.cc_done = tabela1.cc_done + tabela2.cc_done
|
||||
|
||||
for target_name, amount in pairs(tabela2.cc_done_targets) do
|
||||
tabela1.cc_done_targets [target_name] = (tabela1.cc_done_targets [target_name] or 0) + amount
|
||||
for targetName, amount in pairs(tabela2.cc_done_targets) do
|
||||
tabela1.cc_done_targets[targetName] = (tabela1.cc_done_targets[targetName] or 0) + amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
for spellId, spellTable in pairs(tabela2.cc_done_spells._ActorTable) do
|
||||
local spellTable1 = tabela1.cc_done_spells:PegaHabilidade(spellId, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
for target_name, amount in pairs(spellTable.targets) do
|
||||
spellTable1.targets[target_name] = (spellTable1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues(spellTable, spellTable1)
|
||||
end
|
||||
end
|
||||
|
||||
if (tabela2.interrupt) then
|
||||
|
||||
if (not tabela1.interrupt) then
|
||||
tabela1.interrupt = 0
|
||||
tabela1.interrupt_targets = {}
|
||||
tabela1.interrupt_spells = container_habilidades:NovoContainer (container_misc)
|
||||
tabela1.interrupt_spells = container_habilidades:NovoContainer(container_misc)
|
||||
tabela1.interrompeu_oque = {}
|
||||
end
|
||||
|
||||
--total de interrupts
|
||||
tabela1.interrupt = tabela1.interrupt + tabela2.interrupt
|
||||
|
||||
--soma o interrompeu o que
|
||||
for spellid, amount in pairs(tabela2.interrompeu_oque) do
|
||||
tabela1.interrompeu_oque [spellid] = (tabela1.interrompeu_oque [spellid] or 0) + amount
|
||||
tabela1.interrompeu_oque[spellid] = (tabela1.interrompeu_oque [spellid] or 0) + amount
|
||||
end
|
||||
|
||||
--soma os containers de alvos
|
||||
for target_name, amount in pairs(tabela2.interrupt_targets) do
|
||||
tabela1.interrupt_targets [target_name] = (tabela1.interrupt_targets [target_name] or 0) + amount
|
||||
tabela1.interrupt_targets[target_name] = (tabela1.interrupt_targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
--soma o container de habilidades
|
||||
for spellid, habilidade in pairs(tabela2.interrupt_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade(spellid, true, nil, false)
|
||||
|
||||
habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {}
|
||||
for _spellid, amount in pairs(habilidade.interrompeu_oque) do
|
||||
habilidade_tabela1.interrompeu_oque [_spellid] = (habilidade_tabela1.interrompeu_oque [_spellid] or 0) + amount
|
||||
habilidade_tabela1.interrompeu_oque[_spellid] = (habilidade_tabela1.interrompeu_oque[_spellid] or 0) + amount
|
||||
end
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues (habilidade, habilidade_tabela1)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2916,23 +2940,39 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
if (not tabela1.buff_uptime) then
|
||||
tabela1.buff_uptime = 0
|
||||
tabela1.buff_uptime_targets = {}
|
||||
tabela1.buff_uptime_spells = container_habilidades:NovoContainer (container_misc)
|
||||
tabela1.buff_uptime_spells = container_habilidades:NovoContainer(container_misc)
|
||||
end
|
||||
|
||||
if (tabela2.received_buffs_spells) then
|
||||
if (not tabela1.received_buffs_spells) then
|
||||
tabela1.received_buffs_spells = container_habilidades:NovoContainer(container_misc)
|
||||
end
|
||||
|
||||
for spellId, spellTable in pairs(tabela2.received_buffs_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.received_buffs_spells:PegaHabilidade(spellId, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(spellTable.targets) do
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
sumKeyValues(spellTable, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
tabela1.buff_uptime = tabela1.buff_uptime + tabela2.buff_uptime
|
||||
|
||||
for target_name, amount in pairs(tabela2.buff_uptime_targets) do
|
||||
tabela1.buff_uptime_targets [target_name] = (tabela1.buff_uptime_targets [target_name] or 0) + amount
|
||||
tabela1.buff_uptime_targets[target_name] = (tabela1.buff_uptime_targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.buff_uptime_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.buff_uptime_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
for spellId, spellTable in pairs(tabela2.buff_uptime_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.buff_uptime_spells:PegaHabilidade(spellId, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
for target_name, amount in pairs(spellTable.targets) do
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues(spellTable, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2956,17 +2996,17 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
|
||||
for target_name, amount in pairs(tabela2.debuff_uptime_targets) do
|
||||
if (type(amount) == "table") then --boss debuff
|
||||
local t = tabela1.debuff_uptime_targets [target_name]
|
||||
local t = tabela1.debuff_uptime_targets[target_name]
|
||||
if (not t) then
|
||||
tabela1.debuff_uptime_targets [target_name] = atributo_misc:CreateBuffTargetObject()
|
||||
t = tabela1.debuff_uptime_targets [target_name]
|
||||
tabela1.debuff_uptime_targets[target_name] = atributo_misc:CreateBuffTargetObject()
|
||||
t = tabela1.debuff_uptime_targets[target_name]
|
||||
end
|
||||
t.uptime = t.uptime + amount.uptime
|
||||
t.activedamt = t.activedamt + amount.activedamt
|
||||
t.refreshamt = t.refreshamt + amount.refreshamt
|
||||
t.appliedamt = t.appliedamt + amount.appliedamt
|
||||
else
|
||||
tabela1.debuff_uptime_targets [target_name] = (tabela1.debuff_uptime_targets [target_name] or 0) + amount
|
||||
tabela1.debuff_uptime_targets[target_name] = (tabela1.debuff_uptime_targets[target_name] or 0) + amount
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2974,10 +3014,10 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues (habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2991,17 +3031,17 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
tabela1.cooldowns_defensive = tabela1.cooldowns_defensive + tabela2.cooldowns_defensive
|
||||
|
||||
for target_name, amount in pairs(tabela2.cooldowns_defensive_targets) do
|
||||
tabela1.cooldowns_defensive_targets [target_name] = (tabela1.cooldowns_defensive_targets [target_name] or 0) + amount
|
||||
tabela1.cooldowns_defensive_targets[target_name] = (tabela1.cooldowns_defensive_targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues (habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3015,17 +3055,17 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
tabela1.ress = tabela1.ress + tabela2.ress
|
||||
|
||||
for target_name, amount in pairs(tabela2.ress_targets) do
|
||||
tabela1.ress_targets [target_name] = (tabela1.ress_targets [target_name] or 0) + amount
|
||||
tabela1.ress_targets[target_name] = (tabela1.ress_targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues (habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3041,7 +3081,7 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
tabela1.dispell = tabela1.dispell + tabela2.dispell
|
||||
|
||||
for target_name, amount in pairs(tabela2.dispell_targets) do
|
||||
tabela1.dispell_targets [target_name] = (tabela1.dispell_targets [target_name] or 0) + amount
|
||||
tabela1.dispell_targets[target_name] = (tabela1.dispell_targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do
|
||||
@@ -3050,24 +3090,23 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {}
|
||||
|
||||
for _spellid, amount in pairs(habilidade.dispell_oque) do
|
||||
habilidade_tabela1.dispell_oque [_spellid] = (habilidade_tabela1.dispell_oque [_spellid] or 0) + amount
|
||||
habilidade_tabela1.dispell_oque[_spellid] = (habilidade_tabela1.dispell_oque[_spellid] or 0) + amount
|
||||
end
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues (habilidade, habilidade_tabela1)
|
||||
end
|
||||
|
||||
for spellid, amount in pairs(tabela2.dispell_oque) do
|
||||
tabela1.dispell_oque [spellid] = (tabela1.dispell_oque [spellid] or 0) + amount
|
||||
tabela1.dispell_oque[spellid] = (tabela1.dispell_oque[spellid] or 0) + amount
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if (tabela2.cc_break) then
|
||||
|
||||
if (not tabela1.cc_break) then
|
||||
tabela1.cc_break = 0
|
||||
tabela1.cc_break_targets = {}
|
||||
@@ -3078,7 +3117,7 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
tabela1.cc_break = tabela1.cc_break + tabela2.cc_break
|
||||
|
||||
for target_name, amount in pairs(tabela2.cc_break_targets) do
|
||||
tabela1.cc_break_targets [target_name] = (tabela1.cc_break_targets [target_name] or 0) + amount
|
||||
tabela1.cc_break_targets[target_name] = (tabela1.cc_break_targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do
|
||||
@@ -3086,29 +3125,29 @@ atributo_misc.__add = function(tabela1, tabela2)
|
||||
|
||||
habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {}
|
||||
for _spellid, amount in pairs(habilidade.cc_break_oque) do
|
||||
habilidade_tabela1.cc_break_oque [_spellid] = (habilidade_tabela1.cc_break_oque [_spellid] or 0) + amount
|
||||
habilidade_tabela1.cc_break_oque[_spellid] = (habilidade_tabela1.cc_break_oque[_spellid] or 0) + amount
|
||||
end
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount
|
||||
end
|
||||
|
||||
somar_keys (habilidade, habilidade_tabela1)
|
||||
sumKeyValues (habilidade, habilidade_tabela1)
|
||||
end
|
||||
|
||||
for spellid, amount in pairs(tabela2.cc_break_oque) do
|
||||
tabela1.cc_break_oque [spellid] = (tabela1.cc_break_oque [spellid] or 0) + amount
|
||||
tabela1.cc_break_oque[spellid] = (tabela1.cc_break_oque[spellid] or 0) + amount
|
||||
end
|
||||
end
|
||||
|
||||
return tabela1
|
||||
end
|
||||
|
||||
local subtrair_keys = function(habilidade, habilidade_tabela1)
|
||||
local subtractKeyValues = function(habilidade, habilidade_tabela1)
|
||||
for key, value in pairs(habilidade) do
|
||||
if (type(value) == "number") then
|
||||
if (key ~= "id" and key ~= "spellschool") then
|
||||
habilidade_tabela1 [key] = (habilidade_tabela1 [key] or 0) - value
|
||||
habilidade_tabela1[key] = (habilidade_tabela1[key] or 0) - value
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3119,30 +3158,32 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
tabela1.cc_done = tabela1.cc_done - tabela2.cc_done
|
||||
|
||||
for target_name, amount in pairs(tabela2.cc_done_targets) do
|
||||
tabela1.cc_done_targets [target_name] = (tabela1.cc_done_targets [target_name] or 0) - amount
|
||||
tabela1.cc_done_targets[target_name] = (tabela1.cc_done_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
if (tabela2.interrupt) then
|
||||
--total de interrupts
|
||||
tabela1.interrupt = tabela1.interrupt - tabela2.interrupt
|
||||
|
||||
--soma o interrompeu o que
|
||||
for spellid, amount in pairs(tabela2.interrompeu_oque) do
|
||||
tabela1.interrompeu_oque [spellid] = (tabela1.interrompeu_oque [spellid] or 0) - amount
|
||||
tabela1.interrompeu_oque[spellid] = (tabela1.interrompeu_oque[spellid] or 0) - amount
|
||||
end
|
||||
|
||||
--soma os containers de alvos
|
||||
for target_name, amount in pairs(tabela2.interrupt_targets) do
|
||||
tabela1.interrupt_targets [target_name] = (tabela1.interrupt_targets [target_name] or 0) - amount
|
||||
tabela1.interrupt_targets[target_name] = (tabela1.interrupt_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
--soma o container de habilidades
|
||||
@@ -3151,14 +3192,14 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
|
||||
habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {}
|
||||
for _spellid, amount in pairs(habilidade.interrompeu_oque) do
|
||||
habilidade_tabela1.interrompeu_oque [_spellid] = (habilidade_tabela1.interrompeu_oque [_spellid] or 0) - amount
|
||||
habilidade_tabela1.interrompeu_oque[_spellid] = (habilidade_tabela1.interrompeu_oque[_spellid] or 0) - amount
|
||||
end
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3166,17 +3207,24 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
tabela1.buff_uptime = tabela1.buff_uptime - tabela2.buff_uptime
|
||||
|
||||
for target_name, amount in pairs(tabela2.buff_uptime_targets) do
|
||||
tabela1.buff_uptime_targets [target_name] = (tabela1.buff_uptime_targets [target_name] or 0) - amount
|
||||
tabela1.buff_uptime_targets[target_name] = (tabela1.buff_uptime_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.buff_uptime_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.buff_uptime_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
local habilidade_tabela1 = tabela1.buff_uptime_spells:PegaHabilidade(spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
|
||||
if (tabela2.received_buffs_spells) then
|
||||
for spellId, spellTable in pairs(tabela2.received_buffs_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.received_buffs_spells:PegaHabilidade(spellId, true, nil, false)
|
||||
subtractKeyValues(spellTable, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3185,17 +3233,17 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
|
||||
for target_name, amount in pairs(tabela2.debuff_uptime_targets) do
|
||||
if (type(amount) == "table") then --boss debuff
|
||||
local t = tabela1.debuff_uptime_targets [target_name]
|
||||
local t = tabela1.debuff_uptime_targets[target_name]
|
||||
if (not t) then
|
||||
tabela1.debuff_uptime_targets [target_name] = atributo_misc:CreateBuffTargetObject()
|
||||
t = tabela1.debuff_uptime_targets [target_name]
|
||||
tabela1.debuff_uptime_targets[target_name] = atributo_misc:CreateBuffTargetObject()
|
||||
t = tabela1.debuff_uptime_targets[target_name]
|
||||
end
|
||||
t.uptime = t.uptime - amount.uptime
|
||||
t.activedamt = t.activedamt - amount.activedamt
|
||||
t.refreshamt = t.refreshamt - amount.refreshamt
|
||||
t.appliedamt = t.appliedamt - amount.appliedamt
|
||||
else
|
||||
tabela2.debuff_uptime_targets [target_name] = (tabela2.debuff_uptime_targets [target_name] or 0) - amount
|
||||
tabela2.debuff_uptime_targets[target_name] = (tabela2.debuff_uptime_targets[target_name] or 0) - amount
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3203,10 +3251,10 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3214,17 +3262,17 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
tabela1.cooldowns_defensive = tabela1.cooldowns_defensive - tabela2.cooldowns_defensive
|
||||
|
||||
for target_name, amount in pairs(tabela2.cooldowns_defensive_targets) do
|
||||
tabela1.cooldowns_defensive_targets [target_name] = (tabela1.cooldowns_defensive_targets [target_name] or 0) - amount
|
||||
tabela1.cooldowns_defensive_targets[target_name] = (tabela1.cooldowns_defensive_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3232,17 +3280,17 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
tabela1.ress = tabela1.ress - tabela2.ress
|
||||
|
||||
for target_name, amount in pairs(tabela2.ress_targets) do
|
||||
tabela1.ress_targets [target_name] = (tabela1.ress_targets [target_name] or 0) - amount
|
||||
tabela1.ress_targets[target_name] = (tabela1.ress_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do
|
||||
local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade (spellid, true, nil, false)
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3250,7 +3298,7 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
tabela1.dispell = tabela1.dispell - tabela2.dispell
|
||||
|
||||
for target_name, amount in pairs(tabela2.dispell_targets) do
|
||||
tabela1.dispell_targets [target_name] = (tabela1.dispell_targets [target_name] or 0) - amount
|
||||
tabela1.dispell_targets[target_name] = (tabela1.dispell_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do
|
||||
@@ -3259,27 +3307,26 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {}
|
||||
|
||||
for _spellid, amount in pairs(habilidade.dispell_oque) do
|
||||
habilidade_tabela1.dispell_oque [_spellid] = (habilidade_tabela1.dispell_oque [_spellid] or 0) - amount
|
||||
habilidade_tabela1.dispell_oque[_spellid] = (habilidade_tabela1.dispell_oque[_spellid] or 0) - amount
|
||||
end
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
|
||||
for spellid, amount in pairs(tabela2.dispell_oque) do
|
||||
tabela1.dispell_oque [spellid] = (tabela1.dispell_oque [spellid] or 0) - amount
|
||||
tabela1.dispell_oque[spellid] = (tabela1.dispell_oque[spellid] or 0) - amount
|
||||
end
|
||||
end
|
||||
|
||||
if (tabela2.cc_break) then
|
||||
|
||||
tabela1.cc_break = tabela1.cc_break - tabela2.cc_break
|
||||
|
||||
for target_name, amount in pairs(tabela2.cc_break_targets) do
|
||||
tabela1.cc_break_targets [target_name] = (tabela1.cc_break_targets [target_name] or 0) - amount
|
||||
tabela1.cc_break_targets[target_name] = (tabela1.cc_break_targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do
|
||||
@@ -3287,18 +3334,18 @@ atributo_misc.__sub = function(tabela1, tabela2)
|
||||
|
||||
habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {}
|
||||
for _spellid, amount in pairs(habilidade.cc_break_oque) do
|
||||
habilidade_tabela1.cc_break_oque [_spellid] = (habilidade_tabela1.cc_break_oque [_spellid] or 0) - amount
|
||||
habilidade_tabela1.cc_break_oque[_spellid] = (habilidade_tabela1.cc_break_oque[_spellid] or 0) - amount
|
||||
end
|
||||
|
||||
for target_name, amount in pairs(habilidade.targets) do
|
||||
habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount
|
||||
end
|
||||
|
||||
subtrair_keys (habilidade, habilidade_tabela1)
|
||||
subtractKeyValues(habilidade, habilidade_tabela1)
|
||||
end
|
||||
|
||||
for spellid, amount in pairs(tabela2.cc_break_oque) do
|
||||
tabela1.cc_break_oque [spellid] = (tabela1.cc_break_oque [spellid] or 0) - amount
|
||||
tabela1.cc_break_oque[spellid] = (tabela1.cc_break_oque[spellid] or 0) - amount
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ local habilidade_misc = _detalhes.habilidade_misc
|
||||
---@return spelltable|nil
|
||||
function spellContainerClass:GetOrCreateSpell(spellId, bCanCreateSpellIfMissing, cleuToken)
|
||||
---@type spelltable
|
||||
local spellTable = self._ActorTable [spellId]
|
||||
local spellTable = self._ActorTable[spellId]
|
||||
|
||||
if (spellTable) then
|
||||
return spellTable
|
||||
|
||||
@@ -1066,6 +1066,13 @@
|
||||
Details.tabela_vigente.is_arena = {name = Details.zone_name, zone = Details.zone_name, mapid = Details.zone_id}
|
||||
|
||||
Details:SendEvent("COMBAT_ARENA_START")
|
||||
|
||||
local bOrderDpsByRealTime = Details.CurrentDps.CanSortByRealTimeDps()
|
||||
if (bOrderDpsByRealTime) then
|
||||
local bNoSave = true
|
||||
local nTimeIntervalBetweenUpdates = 0.1
|
||||
Details:SetWindowUpdateSpeed(nTimeIntervalBetweenUpdates, bNoSave)
|
||||
end
|
||||
end
|
||||
|
||||
--return the GetTime() of the current or latest arena match
|
||||
@@ -1122,6 +1129,9 @@
|
||||
Details:TimeDataUnregister ("Enemy Team Healing")
|
||||
|
||||
Details:SendEvent("COMBAT_ARENA_END")
|
||||
|
||||
--reset the update speed, as it could have changed when the arena started.
|
||||
Details:SetWindowUpdateSpeed(Details.update_speed)
|
||||
end
|
||||
|
||||
local validSpells = {
|
||||
|
||||
+10
-6
@@ -504,20 +504,23 @@ function _detalhes:RefreshUpdater(suggested_interval)
|
||||
_detalhes.atualizador = Details.Schedules.NewTicker(updateInterval, Details.RefreshMainWindow, Details, -1)
|
||||
end
|
||||
|
||||
function _detalhes:SetWindowUpdateSpeed(interval, nosave)
|
||||
---set the amount of time between each update of all windows
|
||||
---@param interval number?
|
||||
---@param bNoSave boolean?
|
||||
function Details:SetWindowUpdateSpeed(interval, bNoSave)
|
||||
if (not interval) then
|
||||
interval = _detalhes.update_speed
|
||||
interval = Details.update_speed
|
||||
end
|
||||
|
||||
if (type(interval) ~= "number") then
|
||||
interval = _detalhes.update_speed or 0.3
|
||||
interval = Details.update_speed or 0.3
|
||||
end
|
||||
|
||||
if (not nosave) then
|
||||
_detalhes.update_speed = interval
|
||||
if (not bNoSave) then
|
||||
Details.update_speed = interval
|
||||
end
|
||||
|
||||
_detalhes:RefreshUpdater(interval)
|
||||
Details:RefreshUpdater(interval)
|
||||
end
|
||||
|
||||
function _detalhes:SetUseAnimations(enabled, nosave)
|
||||
@@ -2464,6 +2467,7 @@ Details.specToRole = {
|
||||
--EVOKER
|
||||
[1467] = "DAMAGER", --Devastation Evoker
|
||||
[1468] = "HEALER", --Preservation Evoker
|
||||
[1473] = "DAMAGER", --Augmentation Evoker
|
||||
}
|
||||
|
||||
--oldschool talent tree
|
||||
|
||||
+211
-176
@@ -164,18 +164,12 @@
|
||||
}
|
||||
|
||||
local buffs_to_other_players = {
|
||||
[10060] = true, --power infusion
|
||||
--[10060] = true, --power infusion
|
||||
[413426] = true, --rippling anthem (trinket 10.1)
|
||||
[405734] = true, --spore tender
|
||||
[406785] = true, --invigorating spore cloud
|
||||
}
|
||||
|
||||
--list of buffs given by another player but should be considered as a self buff
|
||||
local buffs_makeyourown = {
|
||||
[395152] = true, --ebon might (evoker 10.1.5)
|
||||
[410089] = true, --prescience (evoker 10.1.5)
|
||||
}
|
||||
|
||||
---@class evokerinfo : table
|
||||
---@field key1 serial
|
||||
---@field key2 actorname
|
||||
@@ -191,6 +185,23 @@
|
||||
---@field key6 number
|
||||
---@field key7 number
|
||||
|
||||
local augmentation_aura_list = {
|
||||
[395152] = true,
|
||||
[413984] = true,
|
||||
[410089] = true,
|
||||
[409560] = true,
|
||||
[360827] = true,
|
||||
[410263] = true,
|
||||
}
|
||||
|
||||
--list of buffs given by another player but should also be credited to the which received it
|
||||
local buffs_on_target = {
|
||||
--[395152] = true, --ebon might (evoker 10.1.5)
|
||||
[395152] = true, --ebon might (evoker 10.1.5) 395296 = the evoker buff on it self
|
||||
[410089] = true, --prescience (evoker 10.1.5)
|
||||
[10060] = true, --power infusion
|
||||
}
|
||||
|
||||
--store all information about augmentation evokers ~roskash
|
||||
local augmentation_cache = {
|
||||
ebon_might = {},
|
||||
@@ -453,15 +464,6 @@
|
||||
[372824] = true, --Burning Chains
|
||||
}
|
||||
|
||||
local special_buffs_spells = {
|
||||
[395152] = true,
|
||||
[413984] = true,
|
||||
[410089] = true,
|
||||
[409560] = true,
|
||||
[360827] = true,
|
||||
[410263] = true,
|
||||
}
|
||||
|
||||
--damage spells to ignore
|
||||
local damage_spells_to_ignore = {
|
||||
--the damage that the warlock apply to its pet through soullink is ignored
|
||||
@@ -1255,17 +1257,20 @@
|
||||
--amount add
|
||||
|
||||
--~roskash - augmentation evoker damage buff
|
||||
if (augmentation_cache.ebon_might[sourceSerial]) then
|
||||
if (augmentation_cache.ebon_might[sourceSerial] or (ownerActor and augmentation_cache.ebon_might[ownerActor.serial])) then
|
||||
--get the serial number of the player who did the damage, in case of a pet or minion use the owner serial
|
||||
local thisSourceSerial = augmentation_cache.ebon_might[sourceSerial] and sourceSerial or ownerActor.serial
|
||||
|
||||
---actor buffed with ebonmight -> list of evokers whose buffed
|
||||
---@type table<serial, evokerinfo[]>
|
||||
local currentlyBuffedWithEbonMight = augmentation_cache.ebon_might[sourceSerial]
|
||||
local currentlyBuffedWithEbonMight = augmentation_cache.ebon_might[thisSourceSerial]
|
||||
|
||||
for i, evokerInfo in ipairs(currentlyBuffedWithEbonMight) do
|
||||
---@cast evokerInfo evokerinfo
|
||||
---@type serial, actorname, controlflags
|
||||
local evokerSourceSerial, evokerSourceName, evokerSourceFlags, attributedGained = unpack(evokerInfo)
|
||||
|
||||
if (evokerSourceSerial ~= sourceSerial) then
|
||||
if (evokerSourceSerial ~= thisSourceSerial) then
|
||||
---@type actor
|
||||
local evokerActor = damage_cache[evokerSourceSerial]
|
||||
if (not evokerActor) then
|
||||
@@ -1281,7 +1286,7 @@
|
||||
end
|
||||
|
||||
local predictedAmount = 0
|
||||
if (Details.zone_type == "raid") then
|
||||
if (Details.zone_type == "raid") then --0x410b
|
||||
predictedAmount = amount * 0.06947705
|
||||
else
|
||||
predictedAmount = amount * 0.08416225
|
||||
@@ -1295,15 +1300,19 @@
|
||||
end
|
||||
end
|
||||
|
||||
if (augmentation_cache.ss[sourceSerial]) then --actor buffed with ss
|
||||
if (augmentation_cache.ss[sourceSerial] or (ownerActor and augmentation_cache.ss[ownerActor.serial])) then --actor buffed with ss
|
||||
--get the serial number of the player who did the damage, in case of a pet or minion use the owner serial
|
||||
local thisSourceSerial = augmentation_cache.ss[sourceSerial] and sourceSerial or ownerActor.serial
|
||||
|
||||
---@type table<serial, evokerinfo[]>
|
||||
local currentlyBuffedWithSS = augmentation_cache.ss[sourceSerial]
|
||||
local currentlyBuffedWithSS = augmentation_cache.ss[thisSourceSerial]
|
||||
|
||||
for i, evokerInfo in ipairs(currentlyBuffedWithSS) do
|
||||
---@cast evokerInfo evokerinfo
|
||||
---@type serial, actorname, controlflags
|
||||
local evokerSourceSerial, evokerSourceName, evokerSourceFlags, versaBuff = unpack(evokerInfo)
|
||||
|
||||
if (evokerSourceSerial ~= sourceSerial) then
|
||||
if (evokerSourceSerial ~= thisSourceSerial) then
|
||||
---@type actor
|
||||
local evokerActor = damage_cache[evokerSourceSerial]
|
||||
if (not evokerActor) then
|
||||
@@ -1319,7 +1328,7 @@
|
||||
end
|
||||
|
||||
versaBuff = versaBuff / 100
|
||||
local predictedAmount = amount * versaBuff * 0.73548755
|
||||
local predictedAmount = amount * versaBuff * 0.73548755 --0x410f
|
||||
evokerActor.total_extra = evokerActor.total_extra + predictedAmount
|
||||
|
||||
augmentedSpell.total = augmentedSpell.total + predictedAmount
|
||||
@@ -1388,7 +1397,7 @@
|
||||
augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token)
|
||||
end
|
||||
|
||||
local fateMirror_plus_Prescience = amount + amount * 0.56848040
|
||||
local fateMirror_plus_Prescience = amount + amount * 0.58782001
|
||||
|
||||
evokerActor.total_extra = evokerActor.total_extra + fateMirror_plus_Prescience
|
||||
|
||||
@@ -2712,14 +2721,10 @@
|
||||
sourceSerial = ""
|
||||
end
|
||||
|
||||
if (special_buffs_spells[spellId]) then
|
||||
if (augmentation_aura_list[spellId]) then
|
||||
Details222.SpecHelpers[1473].BuffIn(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, auraType, amount)
|
||||
end
|
||||
|
||||
if (buffs_makeyourown[spellId]) then
|
||||
sourceSerial, sourceName, sourceFlags = targetSerial, targetName, targetFlags
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--spell reflection
|
||||
if (reflection_spellid[spellId]) then --~reflect
|
||||
@@ -2826,7 +2831,10 @@
|
||||
end
|
||||
end
|
||||
|
||||
if (sourceName == targetName and raid_members_cache[sourceSerial] and _in_combat) then
|
||||
if (buffs_on_target[spellId]) then
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_IN", true)
|
||||
|
||||
elseif (sourceName == targetName and raid_members_cache[sourceSerial] and _in_combat) then
|
||||
--player itself
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_IN")
|
||||
|
||||
@@ -2899,7 +2907,7 @@
|
||||
end
|
||||
end
|
||||
|
||||
function parser:buff_refresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellschool, tipo, amount)
|
||||
function parser:buff_refresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, tipo, amount)
|
||||
if (not sourceName) then
|
||||
sourceName = names_cache[spellName]
|
||||
if (not sourceName) then
|
||||
@@ -2910,16 +2918,16 @@
|
||||
sourceSerial = ""
|
||||
end
|
||||
|
||||
if (special_buffs_spells[spellid]) then
|
||||
Details222.SpecHelpers[1473].BuffRefresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellschool, tipo, amount)
|
||||
if (augmentation_aura_list[spellId]) then
|
||||
Details222.SpecHelpers[1473].BuffRefresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, tipo, amount)
|
||||
end
|
||||
|
||||
if (tipo == "BUFF") then
|
||||
if (spellid == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid
|
||||
if (spellId == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid
|
||||
local miscActorObject = misc_cache[sourceName]
|
||||
if (miscActorObject) then
|
||||
--fastest way to query utility spell data
|
||||
local spellTable = miscActorObject.buff_uptime_spells and miscActorObject.buff_uptime_spells._ActorTable[spellid]
|
||||
local spellTable = miscActorObject.buff_uptime_spells and miscActorObject.buff_uptime_spells._ActorTable[spellId]
|
||||
if (spellTable) then
|
||||
if (spellTable.actived and pet_frenzy_cache[sourceName]) then
|
||||
if (detailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then
|
||||
@@ -2929,42 +2937,41 @@
|
||||
end
|
||||
end
|
||||
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, sourceSerial, sourceName, sourceFlags, 0x0, spellid, spellName, "BUFF_UPTIME_REFRESH")
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, sourceSerial, sourceName, sourceFlags, 0x0, spellId, spellName, "BUFF_UPTIME_REFRESH")
|
||||
pet_frenzy_cache[sourceName] = time
|
||||
return
|
||||
end
|
||||
|
||||
if (buffs_makeyourown[spellid]) then
|
||||
sourceSerial, sourceName, sourceFlags = targetSerial, targetName, targetFlags
|
||||
end
|
||||
if (buffs_on_target[spellId]) then
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_REFRESH", true)
|
||||
|
||||
if (sourceName == targetName and raid_members_cache [sourceSerial] and _in_combat) then
|
||||
elseif (sourceName == targetName and raid_members_cache [sourceSerial] and _in_combat) then
|
||||
--call record buffs uptime
|
||||
parser:add_buff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "BUFF_UPTIME_REFRESH")
|
||||
parser:add_buff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_REFRESH")
|
||||
|
||||
elseif (container_pets [sourceSerial] and container_pets [sourceSerial][2] == targetSerial) then
|
||||
--um pet colocando uma aura do dono
|
||||
parser:add_buff_uptime (token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "BUFF_UPTIME_REFRESH")
|
||||
parser:add_buff_uptime (token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_REFRESH")
|
||||
|
||||
elseif (buffs_to_other_players[spellid]) then
|
||||
parser:add_buff_uptime(token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "BUFF_UPTIME_REFRESH")
|
||||
elseif (buffs_to_other_players[spellId]) then
|
||||
parser:add_buff_uptime(token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_REFRESH")
|
||||
end
|
||||
|
||||
if (_use_shield_overheal) then
|
||||
if (shield_spellid_cache[spellid] and amount) then
|
||||
if (shield_cache[targetName] and shield_cache[targetName][spellid] and shield_cache[targetName][spellid][sourceName]) then
|
||||
if (ignored_overheal[spellid]) then
|
||||
shield_cache[targetName][spellid][sourceName] = amount --refresh gives the updated amount
|
||||
if (shield_spellid_cache[spellId] and amount) then
|
||||
if (shield_cache[targetName] and shield_cache[targetName][spellId] and shield_cache[targetName][spellId][sourceName]) then
|
||||
if (ignored_overheal[spellId]) then
|
||||
shield_cache[targetName][spellId][sourceName] = amount --refresh gives the updated amount
|
||||
return
|
||||
end
|
||||
|
||||
--get the shield overheal
|
||||
local overhealAmount = shield_cache[targetName][spellid][sourceName]
|
||||
local overhealAmount = shield_cache[targetName][spellId][sourceName]
|
||||
--set the new shield amount
|
||||
shield_cache[targetName][spellid][sourceName] = amount
|
||||
shield_cache[targetName][spellId][sourceName] = amount
|
||||
|
||||
if (overhealAmount > 0) then
|
||||
return parser:heal(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, nil, 0, ceil (overhealAmount), 0, nil, true)
|
||||
return parser:heal(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, nil, 0, ceil (overhealAmount), 0, nil, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2975,7 +2982,7 @@
|
||||
|
||||
elseif (tipo == "DEBUFF") then
|
||||
if (isWOTLK) then --buff refresh
|
||||
if (spellid == 27162 and false) then --Judgement Of Light
|
||||
if (spellId == 27162 and false) then --Judgement Of Light
|
||||
--which player applied the judgement of light on this mob
|
||||
TBC_JudgementOfLightCache[targetName] = {sourceSerial, sourceName, sourceFlags}
|
||||
end
|
||||
@@ -2986,16 +2993,16 @@
|
||||
--buff uptime
|
||||
if (raid_members_cache [sourceSerial]) then
|
||||
--call record debuffs uptime
|
||||
parser:add_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "DEBUFF_UPTIME_REFRESH")
|
||||
parser:add_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "DEBUFF_UPTIME_REFRESH")
|
||||
elseif (raid_members_cache [targetSerial] and not raid_members_cache [sourceSerial]) then --alvo � da raide e o caster � inimigo
|
||||
parser:add_bad_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellschool, "DEBUFF_UPTIME_REFRESH", amount)
|
||||
parser:add_bad_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, "DEBUFF_UPTIME_REFRESH", amount)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ~unbuff
|
||||
function parser:unbuff(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, tipo, amount)
|
||||
function parser:unbuff(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellSchool, tipo, amount)
|
||||
if (not sourceName) then
|
||||
sourceName = names_cache[spellName]
|
||||
if (not sourceName) then
|
||||
@@ -3006,67 +3013,66 @@
|
||||
sourceSerial = ""
|
||||
end
|
||||
|
||||
if (special_buffs_spells[spellid]) then
|
||||
Details222.SpecHelpers[1473].BuffOut(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, tipo, amount)
|
||||
if (augmentation_aura_list[spellId]) then
|
||||
Details222.SpecHelpers[1473].BuffOut(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellSchool, tipo, amount)
|
||||
end
|
||||
|
||||
if (tipo == "BUFF") then
|
||||
if (buffs_makeyourown[spellid]) then
|
||||
sourceSerial, sourceName, sourceFlags = targetSerial, targetName, targetFlags
|
||||
end
|
||||
|
||||
if (spellid == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid
|
||||
if (spellId == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid
|
||||
if (not pet_frenzy_cache[sourceName]) then
|
||||
return
|
||||
end
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, sourceSerial, sourceName, sourceFlags, 0x0, spellid, spellName, "BUFF_UPTIME_OUT")
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, sourceSerial, sourceName, sourceFlags, 0x0, spellId, spellName, "BUFF_UPTIME_OUT")
|
||||
pet_frenzy_cache[sourceName] = nil
|
||||
return
|
||||
end
|
||||
|
||||
if (sourceName == targetName and raid_members_cache [sourceSerial] and _in_combat) then
|
||||
--call record buffs uptime
|
||||
parser:add_buff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "BUFF_UPTIME_OUT")
|
||||
elseif (container_pets [sourceSerial] and container_pets [sourceSerial][2] == targetSerial) then
|
||||
--um pet colocando uma aura do dono
|
||||
parser:add_buff_uptime (token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "BUFF_UPTIME_OUT")
|
||||
if (buffs_on_target[spellId]) then
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_OUT", true)
|
||||
|
||||
elseif (buffs_to_other_players[spellid]) then
|
||||
parser:add_buff_uptime(token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "BUFF_UPTIME_OUT")
|
||||
elseif (sourceName == targetName and raid_members_cache[sourceSerial] and _in_combat) then
|
||||
--call record buffs uptime
|
||||
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_OUT")
|
||||
elseif (container_pets[sourceSerial] and container_pets[sourceSerial][2] == targetSerial) then
|
||||
--um pet colocando uma aura do dono
|
||||
parser:add_buff_uptime(token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_OUT")
|
||||
|
||||
elseif (buffs_to_other_players[spellId]) then
|
||||
parser:add_buff_uptime(token, time, targetSerial, targetName, targetFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_OUT")
|
||||
end
|
||||
|
||||
if (spellid == SPELLID_MONK_GUARD) then
|
||||
if (spellId == SPELLID_MONK_GUARD) then
|
||||
--BfA monk talent
|
||||
if (monk_guard_talent [sourceSerial]) then
|
||||
local damage_prevented = monk_guard_talent [sourceSerial] - (amount or 0)
|
||||
parser:heal(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, damage_prevented, ceil (amount or 0), 0, 0, true)
|
||||
if (monk_guard_talent[sourceSerial]) then
|
||||
local damage_prevented = monk_guard_talent[sourceSerial] - (amount or 0)
|
||||
parser:heal(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellSchool, damage_prevented, ceil (amount or 0), 0, 0, true)
|
||||
end
|
||||
|
||||
elseif (spellid == 388007 or spellid == 388011) then --buff: bleesing of the summer
|
||||
elseif (spellId == 388007 or spellId == 388011) then --buff: bleesing of the summer
|
||||
cacheAnything.paladin_vivaldi_blessings[targetSerial] = nil
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--shield overheal
|
||||
if (_use_shield_overheal) then
|
||||
if (shield_spellid_cache[spellid]) then
|
||||
if (shield_cache [targetName] and shield_cache [targetName][spellid] and shield_cache [targetName][spellid][sourceName]) then
|
||||
if (shield_spellid_cache[spellId]) then
|
||||
if (shield_cache [targetName] and shield_cache [targetName][spellId] and shield_cache [targetName][spellId][sourceName]) then
|
||||
if (amount) then
|
||||
-- o amount � o que sobrou do escudo
|
||||
--local overheal = escudo [alvo_name][spellid][who_name] --usando o 'amount' passado pela função
|
||||
--overheal não esta dando refresh quando um valor é adicionado ao escudo
|
||||
shield_cache [targetName][spellid][sourceName] = 0
|
||||
shield_cache [targetName][spellId][sourceName] = 0
|
||||
|
||||
--can't use monk guard since its overheal is computed inside the unbuff
|
||||
if (amount > 0 and spellid ~= SPELLID_MONK_GUARD) then
|
||||
if (amount > 0 and spellId ~= SPELLID_MONK_GUARD) then
|
||||
--removing the nil at the end before true for is_shield, I have no documentation change about it, not sure the reason why it was addded
|
||||
return parser:heal (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, nil, 0, ceil (amount), 0, 0, true) --0, 0, nil, true
|
||||
return parser:heal (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, nil, 0, ceil (amount), 0, 0, true) --0, 0, nil, true
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
shield_cache [targetName][spellid][sourceName] = 0
|
||||
shield_cache [targetName][spellId][sourceName] = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3075,19 +3081,19 @@
|
||||
--recording debuffs applied by player
|
||||
elseif (tipo == "DEBUFF") then
|
||||
if (isWOTLK) then --buff removed
|
||||
if (spellid == 27162 and false) then --Judgement Of Light
|
||||
if (spellId == 27162 and false) then --Judgement Of Light
|
||||
TBC_JudgementOfLightCache[targetName] = nil
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--spell reflection
|
||||
if (reflection_dispels[targetSerial] and reflection_dispels[targetSerial][spellid]) then
|
||||
if (reflection_dispels[targetSerial] and reflection_dispels[targetSerial][spellId]) then
|
||||
--debuff was dispelled by a reflecting dispel and could've been reflected
|
||||
--save the data about whom dispelled who and the spell that was dispelled
|
||||
local reflection = reflection_dispels[targetSerial][spellid]
|
||||
local reflection = reflection_dispels[targetSerial][spellId]
|
||||
reflection_events[sourceSerial] = reflection_events[sourceSerial] or {}
|
||||
reflection_events[sourceSerial][spellid] = {
|
||||
reflection_events[sourceSerial][spellId] = {
|
||||
who_serial = reflection.who_serial,
|
||||
who_name = reflection.who_name,
|
||||
who_flags = reflection.who_flags,
|
||||
@@ -3096,7 +3102,7 @@
|
||||
spelltype = reflection.spelltype,
|
||||
time = time,
|
||||
}
|
||||
reflection_dispels[targetSerial][spellid] = nil
|
||||
reflection_dispels[targetSerial][spellId] = nil
|
||||
if (next(reflection_dispels[targetSerial]) == nil) then
|
||||
--suggestion on how to make this better?
|
||||
reflection_dispels[targetSerial] = nil
|
||||
@@ -3105,9 +3111,9 @@
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--spell reflection
|
||||
if (reflection_debuffs[sourceSerial] and reflection_debuffs[sourceSerial][spellid]) then
|
||||
if (reflection_debuffs[sourceSerial] and reflection_debuffs[sourceSerial][spellId]) then
|
||||
--self-inflicted debuff was removed, so we just clear this data
|
||||
reflection_debuffs[sourceSerial][spellid] = nil
|
||||
reflection_debuffs[sourceSerial][spellId] = nil
|
||||
if (next(reflection_debuffs[sourceSerial]) == nil) then
|
||||
--better way of doing this? accepting suggestions
|
||||
reflection_debuffs[sourceSerial] = nil
|
||||
@@ -3119,12 +3125,12 @@
|
||||
--buff uptime
|
||||
if (raid_members_cache [sourceSerial]) then
|
||||
--call record debuffs uptime
|
||||
parser:add_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, "DEBUFF_UPTIME_OUT")
|
||||
parser:add_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "DEBUFF_UPTIME_OUT")
|
||||
elseif (raid_members_cache [targetSerial] and not raid_members_cache [sourceSerial]) then --alvo � da raide e o caster � inimigo
|
||||
parser:add_bad_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, "DEBUFF_UPTIME_OUT")
|
||||
parser:add_bad_debuff_uptime (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellSchool, "DEBUFF_UPTIME_OUT")
|
||||
end
|
||||
|
||||
if ((bitfield_debuffs[spellName] or bitfield_debuffs[spellid]) and targetSerial) then
|
||||
if ((bitfield_debuffs[spellName] or bitfield_debuffs[spellId]) and targetSerial) then
|
||||
bitfield_swap_cache[targetSerial] = nil
|
||||
end
|
||||
end
|
||||
@@ -3363,81 +3369,120 @@
|
||||
end
|
||||
|
||||
-- ~debuff
|
||||
function parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, in_out)
|
||||
------------------------------------------------------------------------------------------------
|
||||
--early checks and fixes
|
||||
|
||||
---@param token string
|
||||
---@param time unixtime
|
||||
---@param sourceSerial guid
|
||||
---@param sourceName actorname
|
||||
---@param sourceFlags controlflags
|
||||
---@param targetSerial guid
|
||||
---@param targetName actorname
|
||||
---@param targetFlags controlflags
|
||||
---@param targetFlags2 number
|
||||
---@param spellId spellid
|
||||
---@param spellName spellname
|
||||
---@param sAuraInOrOut string
|
||||
---@param bAddToTarget boolean|nil not in use on debuffs at the moment
|
||||
function parser:add_debuff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, sAuraInOrOut, bAddToTarget)
|
||||
_current_misc_container.need_refresh = true
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--get actors
|
||||
local este_jogador = misc_cache [who_name]
|
||||
if (not este_jogador) then --pode ser um desconhecido ou um pet
|
||||
este_jogador = _current_misc_container:GetOrCreateActor (who_serial, who_name, who_flags, true)
|
||||
misc_cache [who_name] = este_jogador
|
||||
local sourceActor = misc_cache[sourceName]
|
||||
if (not sourceActor) then
|
||||
sourceActor = _current_misc_container:GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
|
||||
misc_cache[sourceName] = sourceActor
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--build containers on the fly
|
||||
|
||||
if (not este_jogador.debuff_uptime) then
|
||||
este_jogador.debuff_uptime = 0
|
||||
este_jogador.debuff_uptime_spells = spellContainerClass:CreateSpellContainer (container_misc)
|
||||
este_jogador.debuff_uptime_targets = {}
|
||||
if (not sourceActor.debuff_uptime) then
|
||||
sourceActor.debuff_uptime = 0
|
||||
sourceActor.debuff_uptime_spells = spellContainerClass:CreateSpellContainer(container_misc)
|
||||
sourceActor.debuff_uptime_targets = {}
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--add amount
|
||||
|
||||
--update last event
|
||||
este_jogador.last_event = _tempo
|
||||
sourceActor.last_event = _tempo
|
||||
|
||||
--actor spells table
|
||||
local spell = este_jogador.debuff_uptime_spells._ActorTable [spellid]
|
||||
if (not spell) then
|
||||
spell = este_jogador.debuff_uptime_spells:GetOrCreateSpell(spellid, true, "DEBUFF_UPTIME")
|
||||
do
|
||||
local spellTable = sourceActor.debuff_uptime_spells._ActorTable[spellId]
|
||||
if (not spellTable) then
|
||||
spellTable = sourceActor.debuff_uptime_spells:GetOrCreateSpell(spellId, true, "DEBUFF_UPTIME")
|
||||
end
|
||||
return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, sourceActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
|
||||
end
|
||||
return _spell_utility_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, este_jogador, "BUFF_OR_DEBUFF", in_out)
|
||||
|
||||
end
|
||||
|
||||
function parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, in_out)
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--early checks and fixes
|
||||
|
||||
--~buff
|
||||
---@param token string
|
||||
---@param time unixtime
|
||||
---@param sourceSerial guid
|
||||
---@param sourceName actorname
|
||||
---@param sourceFlags controlflags
|
||||
---@param targetSerial guid
|
||||
---@param targetName actorname
|
||||
---@param targetFlags controlflags
|
||||
---@param targetFlags2 number
|
||||
---@param spellId spellid
|
||||
---@param spellName spellname
|
||||
---@param sAuraInOrOut string
|
||||
---@param bAddToTarget boolean? --augmentation evoker
|
||||
function parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, sAuraInOrOut, bAddToTarget)
|
||||
_current_misc_container.need_refresh = true
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--get actors
|
||||
local este_jogador = misc_cache [who_name]
|
||||
if (not este_jogador) then --pode ser um desconhecido ou um pet
|
||||
este_jogador = _current_misc_container:GetOrCreateActor(who_serial, who_name, who_flags, true)
|
||||
misc_cache [who_name] = este_jogador
|
||||
local sourceActor = misc_cache[sourceName]
|
||||
if (not sourceActor) then
|
||||
sourceActor = _current_misc_container:GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
|
||||
misc_cache[sourceName] = sourceActor
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--build containers on the fly
|
||||
sourceActor.last_event = _tempo
|
||||
|
||||
if (not este_jogador.buff_uptime) then
|
||||
este_jogador.buff_uptime = 0
|
||||
este_jogador.buff_uptime_spells = spellContainerClass:CreateSpellContainer(container_misc)
|
||||
este_jogador.buff_uptime_targets = {}
|
||||
--build containers on the fly if not exist
|
||||
if (not sourceActor.buff_uptime) then
|
||||
sourceActor.buff_uptime = 0
|
||||
sourceActor.buff_uptime_spells = spellContainerClass:CreateSpellContainer(container_misc)
|
||||
sourceActor.buff_uptime_targets = {}
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--add amount
|
||||
|
||||
--update last event
|
||||
este_jogador.last_event = _tempo
|
||||
|
||||
--actor spells table
|
||||
local spell = este_jogador.buff_uptime_spells._ActorTable [spellid]
|
||||
if (not spell) then
|
||||
spell = este_jogador.buff_uptime_spells:GetOrCreateSpell(spellid, true, "BUFF_UPTIME")
|
||||
do
|
||||
---@type spelltable
|
||||
local spellTable = sourceActor.buff_uptime_spells._ActorTable[spellId]
|
||||
if (not spellTable) then
|
||||
spellTable = sourceActor.buff_uptime_spells:GetOrCreateSpell(spellId, true, "BUFF_UPTIME")
|
||||
end
|
||||
_spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, sourceActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
|
||||
end
|
||||
return _spell_utility_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, este_jogador, "BUFF_OR_DEBUFF", in_out)
|
||||
|
||||
if (bAddToTarget and sourceSerial ~= targetSerial) then
|
||||
local targetActor = misc_cache[targetName]
|
||||
if (not targetActor) then
|
||||
targetActor = _current_misc_container:GetOrCreateActor(targetSerial, targetName, targetFlags, true)
|
||||
misc_cache[targetName] = targetActor
|
||||
end
|
||||
|
||||
targetActor.last_event = _tempo
|
||||
|
||||
--build containers on the fly if not exist
|
||||
if (not targetActor.buff_uptime) then
|
||||
targetActor.buff_uptime = 0
|
||||
targetActor.buff_uptime_spells = spellContainerClass:CreateSpellContainer(container_misc)
|
||||
targetActor.buff_uptime_targets = {}
|
||||
end
|
||||
|
||||
--build containers on the fly if not exist
|
||||
if (not targetActor.received_buffs_spells) then
|
||||
targetActor.received_buffs_spells = spellContainerClass:CreateSpellContainer(container_misc)
|
||||
end
|
||||
|
||||
local nameWithSpellId = sourceName .. "@" .. spellId
|
||||
|
||||
---@type spelltable
|
||||
local spellTable = targetActor.received_buffs_spells._ActorTable[nameWithSpellId]
|
||||
if (not spellTable) then
|
||||
spellTable = targetActor.received_buffs_spells:GetOrCreateSpell(nameWithSpellId, true, "BUFF_UPTIME")
|
||||
spellTable.id = spellId
|
||||
end
|
||||
|
||||
_spell_utility_func(spellTable, sourceSerial, sourceName, sourceFlags, targetName, targetActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -3711,15 +3756,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function parser:add_defensive_cooldown(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName)
|
||||
------------------------------------------------------------------------------------------------
|
||||
--early checks and fixes
|
||||
|
||||
_current_misc_container.need_refresh = true
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--get actors
|
||||
|
||||
--main actor
|
||||
local sourceActor, ownerActor = misc_cache[sourceName], nil
|
||||
if (not sourceActor) then
|
||||
sourceActor, ownerActor, sourceName = _current_misc_container:GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
|
||||
@@ -3728,20 +3766,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--build containers on the fly
|
||||
if (not sourceActor.cooldowns_defensive) then
|
||||
sourceActor.cooldowns_defensive = Details:GetOrderNumber(sourceName)
|
||||
sourceActor.cooldowns_defensive_targets = {}
|
||||
sourceActor.cooldowns_defensive_spells = spellContainerClass:CreateSpellContainer(container_misc)
|
||||
end
|
||||
|
||||
--local targetActor, targetOwner = damage_cache[targetSerial] or damage_cache_pets[targetSerial] or damage_cache[targetName], damage_cache_petsOwners[targetSerial]
|
||||
--sourceActor, ownerActor, sourceName
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--add amount
|
||||
|
||||
--actor cooldowns used
|
||||
sourceActor.cooldowns_defensive = sourceActor.cooldowns_defensive + 1
|
||||
|
||||
@@ -3752,16 +3782,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
_current_gtotal[4].cooldowns_defensive = _current_gtotal[4].cooldowns_defensive + 1
|
||||
|
||||
if (sourceName == targetName) then
|
||||
--[=[
|
||||
local damage_actor = damage_cache[sourceSerial]
|
||||
if (not damage_actor) then
|
||||
damage_actor = _current_damage_container:GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
|
||||
if (sourceFlags) then
|
||||
damage_cache[sourceSerial] = damage_actor
|
||||
end
|
||||
end
|
||||
--]=]
|
||||
|
||||
--last events
|
||||
local t = last_events_cache[sourceName]
|
||||
|
||||
@@ -5082,6 +5102,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
instancia:AdjustAlphaByContext(true)
|
||||
end
|
||||
end
|
||||
|
||||
Details222.Cache.ClearAugmentationCache()
|
||||
end
|
||||
|
||||
Details.time_type = Details.time_type_original
|
||||
@@ -5337,6 +5359,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
return
|
||||
end
|
||||
|
||||
Details222.Cache.ClearAugmentationCache()
|
||||
|
||||
Details.latest_ENCOUNTER_END = Details.latest_ENCOUNTER_END or 0
|
||||
if (Details.latest_ENCOUNTER_END + 15 > GetTime()) then
|
||||
return
|
||||
@@ -6439,6 +6463,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
return Details.cache_healing_group
|
||||
end
|
||||
|
||||
function Details222.Cache.ClearAugmentationCache()
|
||||
Details:Destroy(augmentation_cache.ebon_might) --~roskash
|
||||
Details:Destroy(augmentation_cache.prescience)
|
||||
Details:Destroy(augmentation_cache.shield)
|
||||
Details:Destroy(augmentation_cache.infernobless)
|
||||
Details:Destroy(augmentation_cache.breath_targets)
|
||||
end
|
||||
|
||||
function Details:ClearParserCache(bIsFromCombatStart) --~wipe
|
||||
Details:Destroy(damage_cache)
|
||||
Details:Destroy(damage_cache_pets)
|
||||
@@ -6467,13 +6499,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
Details:Destroy(cacheAnything.rampage_cast_amount)
|
||||
|
||||
if (not bIsFromCombatStart) then
|
||||
Details:Destroy(augmentation_cache.ebon_might) --~roskash
|
||||
Details:Destroy(augmentation_cache.prescience)
|
||||
Details:Destroy(augmentation_cache.shield)
|
||||
--check if the player is in a mythic dungeon run, if so, don't clear the cache
|
||||
if (Details.zone_type ~= "party") then
|
||||
Details:Destroy(augmentation_cache.ebon_might) --~roskash
|
||||
Details:Destroy(augmentation_cache.prescience)
|
||||
Details:Destroy(augmentation_cache.shield)
|
||||
Details:Destroy(augmentation_cache.infernobless)
|
||||
end
|
||||
end
|
||||
|
||||
Details:Destroy(augmentation_cache.breath_targets)
|
||||
Details:Destroy(augmentation_cache.infernobless)
|
||||
|
||||
cacheAnything.track_hunter_frenzy = Details.combat_log.track_hunter_frenzy
|
||||
|
||||
|
||||
@@ -6,6 +6,17 @@ local unpack = unpack
|
||||
local CreateFrame = CreateFrame
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
|
||||
local buffs_to_ignore = {
|
||||
[186401] = true, --Sign of the Skirmisher
|
||||
[366646] = true, --Familiar Skies
|
||||
[403265] = true, --Bronze Attunement
|
||||
[381748] = true, --Blessing of the Bronze
|
||||
[397734] = true, --Word of a Worthy Ally
|
||||
[402221] = true, --Obsidian Resonance
|
||||
--[] = true, --
|
||||
--[] = true, --
|
||||
}
|
||||
|
||||
local createAuraTabOnBreakdownWindow = function(tab, frame)
|
||||
local scroll_line_amount = 25
|
||||
local scroll_width = 410
|
||||
@@ -15,6 +26,8 @@ local createAuraTabOnBreakdownWindow = function(tab, frame)
|
||||
|
||||
local debuffScrollStartX = 445
|
||||
|
||||
local lineBackgroundColor = {{1, 1, 1, .1}, {1, 1, 1, 0}}
|
||||
|
||||
local headerOffsetsBuffs = {
|
||||
--buff label, uptime, applications, refreshes, wa
|
||||
6, 190, 290, 336, 380
|
||||
@@ -51,15 +64,26 @@ local createAuraTabOnBreakdownWindow = function(tab, frame)
|
||||
|
||||
line:SetBackdrop({bgFile =[[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
line:SetBackdropColor(0, 0, 0, 0.2)
|
||||
line.BackgroundColor = lineBackgroundColor[1]
|
||||
|
||||
local iconTexture = line:CreateTexture("$parentIcon", "overlay")
|
||||
iconTexture:SetSize(scroll_line_height -2 , scroll_line_height - 2)
|
||||
iconTexture:SetAlpha(0.834)
|
||||
local nameLabel = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local uptimeLabel = line:CreateFontString("$parentUptime", "overlay", "GameFontNormal")
|
||||
local uptimePercentLabel = line:CreateFontString("$parentPercent", "overlay", "GameFontNormal")
|
||||
local applyLabel = line:CreateFontString("$parentApplyed", "overlay", "GameFontNormal")
|
||||
local refreshLabel = line:CreateFontString("$parentRefreshed", "overlay", "GameFontNormal")
|
||||
|
||||
local receivedTexture = line:CreateTexture("$parentReceived", "artwork")
|
||||
receivedTexture:SetPoint("topright", line, "topright", 0, 0)
|
||||
receivedTexture:SetPoint("bottomright", line, "bottomright", 0, 0)
|
||||
receivedTexture:SetWidth(line:GetWidth())
|
||||
receivedTexture:SetTexture([[Interface\AddOns\Details\images\bar_textures\gradient_white_10percent_left]])
|
||||
receivedTexture:SetTexCoord(0, 1, 0, 1)
|
||||
receivedTexture:SetVertexColor(0, .8, 0, 0.7)
|
||||
receivedTexture:Hide()
|
||||
|
||||
detailsFramework:SetFontSize(nameLabel, text_size)
|
||||
detailsFramework:SetFontSize(uptimeLabel, text_size)
|
||||
detailsFramework:SetFontSize(uptimePercentLabel, text_size)
|
||||
@@ -79,6 +103,7 @@ local createAuraTabOnBreakdownWindow = function(tab, frame)
|
||||
line.UptimePercent = uptimePercentLabel
|
||||
line.Apply = applyLabel
|
||||
line.Refresh = refreshLabel
|
||||
line.ReceivedAura = receivedTexture
|
||||
|
||||
nameLabel:SetJustifyH("left")
|
||||
uptimeLabel:SetJustifyH("left")
|
||||
@@ -92,25 +117,31 @@ local createAuraTabOnBreakdownWindow = function(tab, frame)
|
||||
return line
|
||||
end
|
||||
|
||||
local lineBackgroundColor = {{1, 1, 1, .1}, {1, 1, 1, 0}}
|
||||
|
||||
local scrollRefreshBuffs = function(self, data, offset, total_lines)
|
||||
for i = 1, total_lines do
|
||||
local index = i + offset
|
||||
local aura = data[index]
|
||||
|
||||
if (aura) then
|
||||
local spellIcon, spellName, uptime, applicationsAmount, refreshedAmount, uptimePercent = unpack(aura)
|
||||
local line = self:GetLine(i)
|
||||
|
||||
if (aura.bReceived) then
|
||||
line.ReceivedAura:Show()
|
||||
else
|
||||
line.ReceivedAura:Hide()
|
||||
end
|
||||
|
||||
line.spellID = aura.spellID
|
||||
line.Icon:SetTexture(aura[1])
|
||||
line.Icon:SetTexture(spellIcon)
|
||||
|
||||
line.Icon:SetTexCoord(.1, .9, .1, .9)
|
||||
|
||||
line.Name:SetText(aura[2])
|
||||
line.Uptime:SetText(detailsFramework:IntegerToTimer(aura[3]))
|
||||
line.UptimePercent:SetText("|cFFBBAAAA" .. math.floor(aura[6]) .. "%|r")
|
||||
line.Apply:SetText(aura[4])
|
||||
line.Refresh:SetText(aura[5])
|
||||
line.Name:SetText(spellName)
|
||||
line.Uptime:SetText(detailsFramework:IntegerToTimer(uptime))
|
||||
line.UptimePercent:SetText("|cFFBBAAAA" .. math.floor(uptimePercent) .. "%|r")
|
||||
line.Apply:SetText(applicationsAmount)
|
||||
line.Refresh:SetText(refreshedAmount)
|
||||
|
||||
if (i % 2 == 0) then
|
||||
line:SetBackdropColor(unpack(lineBackgroundColor[1]))
|
||||
@@ -205,9 +236,27 @@ local aurasTabFillCallback = function(tab, player, combat)
|
||||
local spellContainer = miscActor:GetSpellContainer("buff")
|
||||
if (spellContainer) then
|
||||
for spellId, spellTable in spellContainer:ListSpells() do
|
||||
local spellName, _, spellIcon = GetSpellInfo(spellId)
|
||||
local spellName, _, spellIcon = Details.GetSpellInfo(spellId)
|
||||
local uptime = spellTable.uptime or 0
|
||||
table.insert(newAuraTable, {spellIcon, spellName, uptime, spellTable.appliedamt, spellTable.refreshamt, uptime / combatTime * 100, spellID = spellId})
|
||||
if (not buffs_to_ignore[spellId]) then
|
||||
table.insert(newAuraTable, {spellIcon, spellName, uptime, spellTable.appliedamt, spellTable.refreshamt, uptime / combatTime * 100, spellID = spellId})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--check if this player has a augmentation buff container
|
||||
local augmentedBuffContainer = miscActor.received_buffs_spells
|
||||
if (augmentedBuffContainer) then
|
||||
for sourceNameSpellId, spellTable in augmentedBuffContainer:ListSpells() do
|
||||
local sourceName, spellId = strsplit("@", sourceNameSpellId)
|
||||
spellId = tonumber(spellId)
|
||||
local spellName, _, spellIcon = Details.GetSpellInfo(spellId)
|
||||
|
||||
if (spellName) then
|
||||
sourceName = detailsFramework:RemoveRealmName(sourceName)
|
||||
local uptime = spellTable.uptime or 0
|
||||
table.insert(newAuraTable, {spellIcon, spellName .. " [" .. sourceName .. "]", uptime, spellTable.appliedamt, spellTable.refreshamt, uptime / combatTime * 100, spellID = spellId, bReceived = true})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -221,7 +270,7 @@ local aurasTabFillCallback = function(tab, player, combat)
|
||||
local spellContainer = miscActor:GetSpellContainer("debuff")
|
||||
if (spellContainer) then
|
||||
for spellId, spellTable in spellContainer:ListSpells() do
|
||||
local spellName, _, spellIcon = GetSpellInfo(spellId)
|
||||
local spellName, _, spellIcon = Details.GetSpellInfo(spellId)
|
||||
table.insert(newAuraTable, {spellIcon, spellName, spellTable.uptime, spellTable.appliedamt, spellTable.refreshamt, spellTable.uptime / combatTime * 100, spellID = spellId})
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4085,9 +4085,12 @@ function gump:CreateNewLine(instance, index)
|
||||
newLine.extraStatusbar:SetMinMaxValues(0, 100)
|
||||
newLine.extraStatusbar.texture = newLine.extraStatusbar:CreateTexture(nil, "overlay")
|
||||
newLine.extraStatusbar:SetStatusBarTexture(newLine.extraStatusbar.texture)
|
||||
|
||||
--by default painting the extraStatusbar with the evoker color
|
||||
local evokerColor = Details.class_colors["EVOKER"]
|
||||
--newLine.extraStatusbar.texture:SetTexture([[Interface\AddOns\Details\images\bar_textures\bar_of_bars.png]]) --setColorTexture is very expensive, so set the color once and use vertex color to change it
|
||||
newLine.extraStatusbar.texture:SetColorTexture(1, 1, 1, 1) --setColorTexture is very expensive, so set the color once and use vertex color to change it
|
||||
|
||||
newLine.extraStatusbar.texture:SetVertexColor(unpack(evokerColor))
|
||||
newLine.extraStatusbar:SetAlpha(0.7)
|
||||
newLine.extraStatusbar.defaultAlpha = 0.7
|
||||
|
||||
@@ -690,7 +690,7 @@ do
|
||||
|
||||
sectionFrame.sectionOptions = sectionOptions
|
||||
sectionOptions.always_boxfirst = true
|
||||
DF:BuildMenu(sectionFrame, sectionOptions, startX, startY-20, heightSize+20, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
|
||||
DF:BuildMenu(sectionFrame, sectionOptions, startX, startY-20, heightSize+40, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
|
||||
end
|
||||
|
||||
tinsert(Details.optionsSection, buildSection) --optionsSection is declared on boot.lua
|
||||
|
||||
@@ -762,6 +762,8 @@ local createDropdown = function(thisFrame)
|
||||
Details.janela_report = window
|
||||
Details:InstallRPSkin("defaultSkin", defaultSkin)
|
||||
|
||||
DetailsFramework:AddRoundedCornersToFrame(window, Details.PlayerBreakdown.RoundedCornerPreset)
|
||||
|
||||
--recently reported:
|
||||
window.recently_report_buttons = {}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ do
|
||||
[277185] = {name = GetSpellInfo(277185) .. " (Trinket)"}, --[Dread Gladiator's Badge]
|
||||
[278057] = {name = GetSpellInfo(278057) .. " (Trinket)"}, --[Vigilant's Bloodshaper]
|
||||
}
|
||||
else
|
||||
else --retail
|
||||
defaultSpellCustomization = {
|
||||
[1] = {name = Loc ["STRING_MELEE"], icon = [[Interface\ICONS\INV_Sword_04]]},
|
||||
[2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\ICONS\INV_Weapon_Bow_07]]},
|
||||
@@ -217,6 +217,7 @@ do
|
||||
[108271] = {name = GetSpellInfo(108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"},
|
||||
[196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon},
|
||||
[77535] = {name = GetSpellInfo(77535), icon = "Interface\\Addons\\Details\\images\\icon_blood_shield"},
|
||||
[395296] = {name = GetSpellInfo(395296), icon = "Interface\\Addons\\Details\\images\\ebon_might"},
|
||||
}
|
||||
|
||||
customItemList[394453] = {itemId = 195480, isPassive = true} --ring: Seal of Diurna's Chosen
|
||||
|
||||
@@ -1992,6 +1992,7 @@ do
|
||||
|
||||
[1467] = "EVOKER", --Devastation Evoker
|
||||
[1468] = "EVOKER", --Preservation Evoker
|
||||
[1473] = "EVOKER", --Augmentation Evoker
|
||||
}
|
||||
|
||||
_detalhes.ClassSpellList = {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
Reference in New Issue
Block a user