Thread Tools Display Modes
09/17/21, 06:49 PM   #1
lt_columbo
Join Date: Aug 2020
Posts: 1
STAT_CRITICAL_DAMAGE - Does this exist yet?

Looking to pull the critical damage value (the value displayed on the advanced character stat page in base game) into an addon but cannot seem to find the variable to do this. Does anyone know if this exists yet?
  Reply With Quote
09/19/21, 07:44 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
No idea sorry but you can do the same as at the advanced stat fragment and collect the data yourself via
function
GetAdvancedStatInfo(categoryId, statIndex)

Description how to get the categoryId, statIndex:

The advanced stats are defined via the class "ZO_AdvancedStats_Keyboard" and assigned to the object "ZO_ADVANCED_STATS_WINDOW" here:
https://github.com/esoui/esoui/blob/...oard.lua#L1080

The object contains a list where all the adv. stats are added to.
The list can have 4 different types of stats using 4 different setup functions to build the rows:
https://github.com/esoui/esoui/blob/...board.lua#L920
Code:
DATA_ENTRY_TYPE_STAT
DATA_ENTRY_TYPE_DIVIDER
DATA_ENTRY_TYPE_HEADER
DATA_ENTRY_TYPE_MULTI_STAT
where most probably divider and header do not count as they are headlines or a divider line.
So stats and multi stats count here, showing the stats values.

Here the function SetupAdvancedStats() will loop over all given advanced stats data, get cateories and build the list entries of the 4 different types shown above:
https://github.com/esoui/esoui/blob/...board.lua#L932


Lua Code:
  1. --Get num of catgeories
  2. local numCategories = GetNumAdvancedStatCategories()
  3. --For each category:
  4.     for categoryIndex = 1, numCategories do
  5. --get num of stats in category
  6. local categoryId = GetAdvancedStatsCategoryId(categoryIndex)
  7.         local displayName, numStats = GetAdvancedStatCategoryInfo(categoryId)
  8. --get stats info for each stat in the category
  9. for statIndex = 1, numStats do
  10.             local statType, statDisplayName, description, flatValueDescription, percentValueDescription = GetAdvancedStatInfo(categoryId, statIndex)


And here the list is setup then based on the data collected above:
https://github.com/esoui/esoui/blob/...board.lua#L966

ZO_ScrollList_CreateDataEntry creates the list entry with the list type like divider, header and the actual stats values e.g. DATA_ENTRY_TYPE_STAT or DATA_ENTRY_TYPE_MULTI_STAT

You would need to check at the data collection, by e..g using the same code in your own example function, which category and stat type etc. are used there for the critical value output and then you should be able to calculate/use it on your own by directly reading the data via
Code:
local statType, statDisplayName, description, flatValueDescription, percentValueDescription = GetAdvancedStatInfo(categoryId, statIndex)
Hope this helps
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » STAT_CRITICAL_DAMAGE - Does this exist yet?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off