I will answer just the first part of your question:
Originally Posted by Dero
what does
Code:
GetChampionPointAttributeForRank()
exactly do?
Atm it returns 0
Does it returns an integer, that describes, what the next CP will be?
Like
0 = Blue
1 = Red
2 = Green
?
|
Return values are:
ATTRIBUTE_NONE = 0
ATTRIBUTE_HEALTH = 1
ATTRIBUTE_MAGICKA = 2
ATTRIBUTE_STAMINA = 3
So it is more like:
0 = None
1 = Red
2 = Blue
3 = Green
Here is a small piece of code from UI (center screen anounnce handler) which shows how to use this function:
Lua Code:
--EsoUI\Ingame\CenterScreenAnnounce\CenterScreenAnnounceHandlers.lua, lines 735-742
CSH[EVENT_CHAMPION_POINT_GAINED] = function()
local rankGained = GetPlayerChampionPointsEarned()
local pointType = GetChampionPointAttributeForRank(rankGained)
local icon = GetChampionPointAttributeIcon(pointType)
local constellationGroupName = ZO_Champion_GetConstellationGroupNameFromAttribute(pointType)
local secondLine = zo_strformat(SI_CHAMPION_POINT_TYPE, constellationGroupName)
return CSA_EVENT_COMBINED_TEXT, SOUNDS.CHAMPION_POINT_GAINED, GetString(SI_CHAMPION_POINT_EARNED), secondLine, icon, nil, nil, nil, nil, CSA_OPTION_SUPPRESS_ICON_FRAME
end
--EsoUI\Ingame\ChampionPerks\ChampionPerks.lua, lines 20-29
local ATTRIBUTE_TO_CONSTELLATION_GROUP_NAME =
{
[ATTRIBUTE_HEALTH] = GetString(SI_CHAMPION_CONSTELLATION_GROUP_HEALTH_NAME),
[ATTRIBUTE_MAGICKA] = GetString(SI_CHAMPION_CONSTELLATION_GROUP_MAGICKA_NAME),
[ATTRIBUTE_STAMINA] = GetString(SI_CHAMPION_CONSTELLATION_GROUP_STAMINA_NAME),
}
function ZO_Champion_GetConstellationGroupNameFromAttribute(attribute)
return ATTRIBUTE_TO_CONSTELLATION_GROUP_NAME[attribute]
end