Skip to content

class CombatStatsObject

_CombatStatsObject which can be used by other addons to get data or register callbacks for events - it acts as a communication gateway between addons & the lib


methods


CombatStatsObject.New


function CombatStatsObject.New() -> A CombatStatsObject {
    __index = CombatStatsObject,
    New = function,
    GetStatsShared = function,
    Iterate = function,
    __pairs = function,
    GetGroupSize = function,
    __len = function,
    GetGroupStats = function,
    GetUnitStats = function,
    GetUnitDPS = function,
    GetUnitHPS = function,
    GetUnitULT = function,
    ...(+5)
}

@return A - new instance of _CombatStatsObject

Constructor for the _CombatStatsObject

CombatStatsObject.GetStatsShared


function CombatStatsObject.GetStatsShared() ->  string

Returns a list of functionalities currently enabled in the library

CombatStatsObject.Iterate


function CombatStatsObject.Iterate() ->  string

Returns key, value of groupStats

CombatStatsObject.__pairs


function CombatStatsObject.__pairs() ->  string

metatable version of _CombatStatsObject:Iterate()

CombatStatsObject.GetGroupSize


function CombatStatsObject.GetGroupSize() ->  number

@return - : the number of units in the group

Returns the number of group members in "groupStats"

CombatStatsObject.__len


function CombatStatsObject.__len() ->  number

@return - : the number of units in the group

metatable version of _CombatStatsObject:GetGroupSize()

CombatStatsObject.GetGroupStats


function CombatStatsObject.GetGroupStats() -> A table

@return A - table containing group statistics (cloned from the internal state)

Retrieves a copy of the current group statistics

CombatStatsObject.GetUnitStats


function CombatStatsObject.GetUnitStats(unitTag: string) -> A table

@param unitTag - The unitTag of the group member (e.g., "group1")

@return A - table containing the unit's statistics, or nil if the unit is not found

Retrieves statistics for a specific unit in the group

CombatStatsObject.GetUnitDPS


function CombatStatsObject.GetUnitDPS(unitTag: string) -> DPSTable dps {
    dmgType = number,
    dps = number,
    dmg = number,
    _lastUpdated = number,
    _lastChanged = number,
}

@param unitTag - The unitTag of the group member

@return DPSTable - The type of damage, total damage, DPS value, and the timestamp of the last update and last value update

Retrieves DPS information for a specific unit in the group

CombatStatsObject.GetUnitHPS


function CombatStatsObject.GetUnitHPS(unitTag: string) -> HPSTable hps {
    hps = number,
    overheal = number,
    _lastUpdated = number,
    _lastChanged = number,
}

@param unitTag - The unitTag of the group member

@return HPSTable - The overhealing value, HPS value, and the timestamp of the last update and last value update

Retrieves HPS information for a specific unit in the group

CombatStatsObject.GetUnitULT


function CombatStatsObject.GetUnitULT(unitTag: string) -> ultTable ult {
    ultValue = number,
    ult1ID = number,
    ult2ID = number,
    ult1Cost = number,
    ult2Cost = number,
    ultActivatedSetID = number,
    _lastUpdated = number,
    _lastChanged = number,
}

@param unitTag - The unitTag of the group member

@return ultTable - The current ultimate value, ultimate 1 ID, ultimate 1 cost, ultimate 2 ID, ultimate 2 cost, and the ID for an ultActivated set, and the timestamp of the last update and last value update

TODO: hasUnitULTAbilityID Retrieves ultimate information for a specific unit in the group

CombatStatsObject.GetUnitSkillLines


function CombatStatsObject.GetUnitSkillLines(unitTag: string) -> skillLinesTable skillLines {
    first = number,
    second = number,
    third = number,
    _lastUpdated = number,
    _lastChanged = number,
}

@param unitTag - The unitTag of the group member

@return skillLinesTable - The currently equipped skillLines of the unit (first, second, third) and the timestamp of the last update and last value update

Retrieves skillLine information for a specific unit in the group

CombatStatsObject.HasUnitUltimatesSlotted


function CombatStatsObject.HasUnitUltimatesSlotted(
  unitTag: string,
  listOfAbilityIDs: number[]
) -> hasEquipped boolean

@param unitTag - The unitTag of the group member

@param listOfAbilityIDs - The abilityIDs that need to be checked for ( {id1, id2, id3} )

@return hasEquipped - group member has ultimate ability equipped

Checks if the group member has specific ultimates slotted

CombatStatsObject.HasUnitUltActivatedSetSlotted


function CombatStatsObject.HasUnitUltActivatedSetSlotted(
  unitTag: string,
  ultActivatedSetID: number
) -> hasEquipped boolean

@param unitTag - The unitTag of the group member

@param ultActivatedSetID - The ultActivatedSetID that needs to be checked for

@return hasEquipped - group member has ultActivatedSet equipped

WARNING: This will soon be changed! Thats why this function is not documented in the API - use the new LibSetDetection v4 by @ExoY94 for that when it's ready Checks if the group member has a specific ultimate activated set slotted

CombatStatsObject.RegisterForEvent


function CombatStatsObject.RegisterForEvent(
  eventName: string,
  callback: function
) ->  nil

@param eventName - The name of the event to register for

@param callback - The function to be called when the event is triggered

Registers a callback function for a specified event

CombatStatsObject.UnregisterForEvent


function CombatStatsObject.UnregisterForEvent(
  eventName: string,
  callback: function
) ->  nil

@param eventName - The name of the event to unregister from

@param callback - The callback function to unregister

Unregisters a callback function for a specified event

fields


CombatStatsObject.__index


CombatStatsObject.__index : CombatStatsObject {
    __index: CombatStatsObject,
    New: function,
    GetStatsShared: function,
    Iterate: function,
    __pairs: function,
    GetGroupSize: function,
    __len: function,
    GetGroupStats: function,
    GetUnitStats: function,
    GetUnitDPS: function,
    GetUnitHPS: function,
    GetUnitULT: function,
    ...(+5)
}