Function to get next bag upgrade cost?
Been trawling the wiki and source and i'm still stumped as to how to fetch the cost of the next upgrade for the bag/inventory.
The bank upgrade has a convenient "GetNextBankUpgradePrice()" function, but i can't find an equivalent for the inventory. Any suggestions chaps? |
I don't think there is something because such functions are hardcoded in the speech of a npc (for bag, it's a chat with a npc which upgrade the bag).
But you can build a table and deduct it with the bag size and upgrade of the mount. |
If that's the case and there's no way to do a lookup with an ingame constant, function or both i'll probably just hard code in the upgrade costs, and work it out that way, cheaper and easier, until such time the API provides a means.
Aside: The game has to read the max bag size and cost from somewhere though, i feel i'm missing something. Though i guess certain data is outside the scope of the API and thus unavailable. Thanks.. :) |
When you try to buy bag space, game fires event where the only argument is upgrade cost:
* EVENT_INVENTORY_BUY_BAG_SPACE (*integer* _cost_) I didn't find any other place where is mentioned upgrade price in EsoUI source code. |
Numbers can be logged into a table and function can be made based on available item space. Other than that I am not aware of any other way.
|
That's pretty much all i could find to Garkin, i wasn't sure if i was looking hard and deep enough or whether i was simply missing something totally obvious to someone more familiar with the code base.
Thank you both for having a dig around for me, unfortunately it only confirms my own conclusions but it's nice to have some confirmation all the same. I'll stick to pulling the values from the wiki and hard-coding them in for now, it'll mean adding or tweaking items in an array any time these change in-game, but i think i can live with that. |
Could we have an add-on with such additions ? Like an extended ESO API ? That'd be great, I also have some functions I'd like to include.
|
I've added a GetNextBackpackUpgradePrice to the API. It'll go out with the next major version.
|
Quote:
|
Quote:
For any other potential addon authors/tweakers who may be wondering how i'm currently getting the next upgrade price, see below. Store the bag sizes and costs in an object. Code:
myObj.bagSizes = { Code:
local inventoryBonus, maxInventoryBonus, staminaBonus, maxStaminaBonus, speedBonus, maxSpeedBonus = GetRidingStats() Code:
if( myObj.bagSizes[myObj.inventorySize+10] ~= nil ) then |
All times are GMT -6. The time now is 01:58 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI