Thread Tools Display Modes
06/02/24, 01:47 PM   #1
Toirealach
AddOn Author - Click to view addons
Join Date: Sep 2020
Posts: 33
Get currency type inside container?

Code:
local itemType, specializedItemType = GetItemLinkItemType(itemLink)
I know I can call GetItemLinkItemType() to determine that an item is a container and that its specialized type is a currency container, but is there any way for me to know which CurrencyType that the currency container actually contains?
  Reply With Quote
06/02/24, 01:54 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,068
Not that I know off.

In the past I added a maximum Tel'Var check into an addon and I had searched (years ago though) for the same and ended in a list of Tel'Var containing container's itemIds so I could get the itemId from the itemlink and see if the item is such a Tel'Var container.
  Reply With Quote
06/02/24, 01:58 PM   #3
Lykeion
 
Lykeion's Avatar
AddOn Author - Click to view addons
Join Date: May 2022
Posts: 26
Example

Code:
local curtType = {
    CURT_MONEY,
    CURT_TELVAR_STONES,
    CURT_ALLIANCE_POINTS,
    CURT_UNDAUNTED_KEYS,
    CURT_WRIT_VOUCHERS,
    CURT_EVENT_TICKETS,
    CURT_ARCHIVAL_FORTUNES
}

for _, curt in ipairs(curtType) do
    local unowned, _ = GetLootCurrency(curt)
    if (unowned > 0) then
            d(GetString(GetCurrencyName(curt, false, true) .. ": " .. unowned)
    end
end
You may only be able to do the corresponding check after opening the container. Add any currency type you need to the curtType
  Reply With Quote
06/02/24, 02:16 PM   #4
Toirealach
AddOn Author - Click to view addons
Join Date: Sep 2020
Posts: 33
Thanks, I guess I'll add to the wishlist then...

If GetItemLinkItemType() returns an ItemType of ITEMTYPE_CONTAINER_CURRENCY then the SpecializedItemType which the function returns should tell us which currency is in the container, e.g.:

SPECIALIZED_ITEMTYPE_CONTAINER_CURRENCY_MONEY
SPECIALIZED_ITEMTYPE_CONTAINER_CURRENCY_CHAOTIC_CREATIA
SPECIALIZED_ITEMTYPE_CONTAINER_CURRENCY_TELVAR_STONES

etc. for any all types of currency containers that exist in game.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Get currency type inside container?


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