LibCurrencyInfo

About

This is a library mainly for addon developer to get currencies' related information.

 

API

lib:GetCurrencyByID(currencyID, lang)

Arguments

  • currencyID: Integer - ID of the currency to retrieve
  • lang (optional): String - language code which the language you would like to retrieve. If nil, then player's game client language will be used.
    The valid input is specified below:
    • enUS
    • deDE
    • esES
    • esMX
    • frFR
    • itIT
    • koKR
    • ptBR
    • ruRU
    • zhCN
    • zhTW

Returns

  1. name: String - the name of the currency, localized to the language
  2. amount : Number - Current amount of the currency at index
  3. texture: Number - The textureID of the currency's icon.
  4. earnedThisWeek: Number - The amount of the currency earned this week
  5. weeklyMax: Number - Maximum amount of currency possible to be earned this week
  6. totalMax: Number - Total maximum currency possible to stockpile
  7. isDiscovered: Boolean - Whether the character has ever got some of this currency
  8. rarity: Integer - Rarity indicator for this currency
  9. categoryID: Number - The currency's corresponding categoryID
  10. categoryName: String - The currency's corresponding category name
  11. currencyDesc: String - The currency's description

The 1st to 8th return values will be retrieved by calling GetCurrencyInfo() within this function. If you don't need the 9th ~ 11th values, then it's up to you to use either GetCurrencyInfo() or lib:GetCurrencyByID().

 

lib:GetCurrencyByCategoryID(categoryID)

Arguments

  • categoryID: Integer - ID of currency's category

Returns

  • currencyArray: Table - returns the table array for the specified currency category. The array contains the currency IDs belong to this category.

 

lib:GetCurrencyTokenStrings(currencyID, lang)

Arguments

  • currencyID: Integer - ID of the currency to retrieve
  • lang (optional): String - language code which the language you would like to retrieve. If nil, then player's game client language will be used.
    The valid input is specified below:
    • enUS
    • deDE
    • esES
    • esMX
    • frFR
    • itIT
    • koKR
    • ptBR
    • ruRU
    • zhCN
    • zhTW

Returns

  • tooltipText: String - this will return a string with combination of currency name, currency description, and the gained amount of this currency.
    This is mainly to be used in GameToolTip. The format will be something like below:
    Legionfall War Supplies
    Use to further the construction of valuable structures on the Broken Shore.

    Total Cap: 100/1,000

Data

The currency data is set to global so if you would need some further specific need, then you can create your customized codes by accessing the library data.

lib.data.CurrencyByCategory

Array key is categoryID, array value is the currency IDs belong to this category.

For example:

	[1] = { -- Miscellaneous
		81, -- Epicurean's Award
		402, -- Ironpaw Token
		515, -- Darkmoon Prize Ticket
		1379, -- Trial of Style Token
	},

 

lib.data.CurrencyCategories

Stores the currency category's display names, in all languages. For example:

[1] = { <br />&nbsp; enUS="Miscellaneous",<br />&nbsp; deDE="Verschiedenes",<br />&nbsp; esES="Miscel&aacute;nea",<br />&nbsp; esMX="Miscel&aacute;nea",<br />&nbsp; frFR="Divers",<br />&nbsp; itIT="Varie",<br />&nbsp; koKR="기타",<br />&nbsp; ptBR="Diversos",<br />&nbsp; ruRU="Разное",<br />&nbsp; zhCN="其它",<br />&nbsp; zhTW="雜項" <br />},

 

lib.data.Currencies

Stores all the currencies' ID, categoryID, and a flag of hide set to true if this specific currency is inactive or not to be displayed in player's game client.

Some examples:

[1] = { id=1, category=1, hide=true }, -- Currency Token Test Token 4, Miscellaneous
[2] = { id=2, category=1, hide=true }, -- Currency Token Test Token 2, Miscellaneous
[4] = { id=4, category=1, hide=true }, -- Currency Token Test Token 5, Miscellaneous
[22] = { id=22, category=41, hide=true }, -- Birmingham Test Item 3, Test
[42] = { id=42, category=1, hide=true }, -- Badge of Justice, Miscellaneous
[61] = { id=61, category=21 }, -- Dalaran Jewelcrafter's Token, Wrath of the Lich King
[81] = { id=81, category=1 }, -- Epicurean's Award, Miscellaneous

 

lib.data.CurrencyDesc

This is where we stored the currencies' description. This is useful when we want to retrieve this information unless WoW release any API to fulfill this need.

Table example:

[61] = { <br />&nbsp; enUS="Tiffany Cartier's shop in Dalaran will gladly accept these tokens for unique jewelcrafting recipes.", <br />&nbsp; deDE="Tiffany Cartiers Gesch&auml;ft in Dalaran wird diese Symbole im Tausch gegen einzigartige Juweliersrezepte dankend annehmen.", <br />&nbsp; esES="La tienda de Tiffany Cartier en Dalaran cambiar&aacute; gustosamente estos talismanes por recetas de joyer&iacute;a.", <br />&nbsp; esMX="La tienda de Tiffany Cartier en Dalaran cambiar&aacute; gustosamente estos talismanes por recetas de joyer&iacute;a.", <br />&nbsp; frFR="La boutique de Tiffany Kartier, &agrave; Dalaran, accepte avec joie ces marques contre des dessins de joaillerie uniques.", <br />&nbsp; itIT="Il negozio di Tiffany Cartier a Dalaran accetter&agrave; volentieri questi emblemi in cambio di esclusivi modelli da orefice.", <br />&nbsp; koKR="달라란에 있는 티파니 까르티엘의 가게에서 보석세공 디자인으로 교환하는 데 사용합니다.", <br />&nbsp; ptBR="A loja Sojoia Kara em Dalaran aceita de bom grado essas fichas por instru&ccedil;&otilde;es de joalheria raras.", <br />&nbsp; ruRU="В магазине Тиффани Картье, что в Даларане, вам с радостью обменяют эти знаки на уникальные ювелирные эскизы.", <br />&nbsp; zhCN="达拉然的蒂凡妮&middot;卡蒂亚会欣然接受这些代币,并用稀有的珠宝加工图鉴来交换。", <br />&nbsp; zhTW="蒂芬妮&middot;卡地亞位於達拉然的商店相當願意用獨特的珠寶設計圖來交換這些徽章。" <br />},

 


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    272977
  • Created
    Jul 25, 2017
  • Last Released File
    Jan 21, 2024
  • Total Downloads
    29,433
  • License

Categories

Members

Recent Files

WoW Retail

WoW Wrath of the Lich King Classic

WoW Classic