babaissarkar / WISh

War of Legends Inventory System addon (WISh)
Other
1 stars 0 forks source link

Feature: Allow assignment of a GOLD_VALUE= Parameter to assess item value #16

Closed knyghtmare closed 3 days ago

knyghtmare commented 2 weeks ago

Would be necessary if we add a thing in future of "transmute artifact to gold" for unwanted items. So if GOLD_VALUE=50 for an item, transmuting it will give 50 gold to that side.

knyghtmare commented 2 weeks ago

The gold value will also give an indication of the item's rank (common/uncommon/rare/pristine)

babaissarkar commented 2 weeks ago

ATM you can put a gold_value key inside the [object] and it will always stay with that with that particular item. You can get the item from an equipped unit using https://github.com/babaissarkar/WISh/blob/9d5c9ff167705e56e19b6a99ee6c046acb31747a/lua/items.lua#L75-L83

and for storage items there's https://github.com/babaissarkar/WISh/blob/9d5c9ff167705e56e19b6a99ee6c046acb31747a/lua/items.lua#L60-L67

After that, it's just a matter of using item.gold_value.

Possible improvements: The get_item_from_storage takes an item_number, it should take an item id instead. A for loop search around the storage items should be able to do that.

babaissarkar commented 2 weeks ago

@knyghtmare does the above presented solution work?

knyghtmare commented 2 weeks ago

Yeah, it does sound like it would work.

babaissarkar commented 2 weeks ago

Yeah, it does sound like it would work.

Okay, please give it try and close this if it works. Otherwise let me know here what went wrong.

knyghtmare commented 2 weeks ago

I kind of realized that the "Transmute to Gold" option for the item needs to be implemented before I can try this out.

babaissarkar commented 3 days ago

Superseded by #20.