From 218fc4352fd1c0af67d52a3264632f0617179aa8 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sun, 15 Oct 2023 16:00:43 +0200 Subject: Added Enrichment to Estimated Item Value (#566) Added Enrichment to Estimated Item Value. #566 --- .../skyhanni/features/misc/items/EstimatedItemValue.kt | 14 ++++++++++++++ .../hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index dcc2574d9..277c84735 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -50,6 +50,7 @@ import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPowerScroll import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRune import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getSilexCount +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnrichment import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getTransmissionTunerCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.hasArtOfPeace import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.hasArtOfWar @@ -203,6 +204,7 @@ object EstimatedItemValue { totalPrice += addWoodSingularity(stack, list) totalPrice += addJalapenoBook(stack, list) totalPrice += addStatsBook(stack, list) + totalPrice += addEnrichment(stack, list) // counted totalPrice += addMasterStars(stack, list) @@ -567,6 +569,18 @@ object EstimatedItemValue { return price } + private fun addEnrichment(stack: ItemStack, list: MutableList): Double { + + val enrichmentName = stack.getEnrichment() ?: return 0.0 + val internalName = "TALISMAN_ENRICHMENT_$enrichmentName".asInternalName() + + + val price = internalName.getPrice() + val name = internalName.getItemName() + list.add("§7Enrichment: $name §7(§6" + NumberUtil.format(price) + "§7)") + return price + } + private fun addRune(stack: ItemStack, list: MutableList): Double { val internalName = stack.getRune() ?: return 0.0 diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 4cc248ba3..d5a957160 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -109,6 +109,8 @@ object SkyBlockItemModifierUtils { fun ItemStack.getPowerScroll() = getAttributeString("power_ability_scroll")?.asInternalName() + fun ItemStack.getEnrichment() = getAttributeString("talisman_enrichment") + fun ItemStack.getHelmetSkin() = getAttributeString("skin")?.asInternalName() fun ItemStack.getArmorDye() = getAttributeString("dye_item")?.asInternalName() -- cgit