mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Take stack sizes into account, deobfuscate anIntArray422 -> objectStackSizes
This commit is contained in:
parent
3087845f1e
commit
53dd5b1d92
2 changed files with 17 additions and 14 deletions
|
|
@ -18,10 +18,13 @@ class plugin : Plugin() {
|
|||
"::valuadd" -> {
|
||||
var value = 0
|
||||
val inventory = Inv.objectContainerCache.get(93) as Inv
|
||||
for(i in inventory.objectIds) {
|
||||
if(i != -1) {
|
||||
val obj = ObjTypeList.get(i)
|
||||
value += round(obj.cost * 0.6).toInt()
|
||||
for(i in 0 until inventory.objectIds.size) {
|
||||
if(inventory.objectIds[i] != -1) {
|
||||
val obj = ObjTypeList.get(inventory.objectIds[i])
|
||||
val stackSize = inventory.objectStackSizes[i]
|
||||
val itemBaseCost = round(obj.cost * 0.6).toInt()
|
||||
val itemStackCost = itemBaseCost * stackSize
|
||||
value += itemStackCost
|
||||
}
|
||||
}
|
||||
SendMessage("Total HA value of inventory: $value GP")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue