From e45f8fa81bafd99055fe2ec4a8bdfa945c1df57d Mon Sep 17 00:00:00 2001 From: randy Date: Tue, 12 Nov 2024 16:00:02 -0700 Subject: [PATCH] Implemented rune multipliers on combination runes The altar you are at will now give its multiplier to the combination runes crafted. This only saves essence, the opposing rune cost is multiplied as well. (If you get 10 air runes per essence, then making mist runes at the air altar will cost 10 water runes and 1 essence to give you 10 mist runes). --- .../skill/runecrafting/RuneCraftPulse.java | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java b/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java index 77e21b7f2..5006b52be 100644 --- a/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java +++ b/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java @@ -239,9 +239,39 @@ public final class RuneCraftPulse extends SkillPulse { } } - /** - * Method used to combine runes. - */ + /** + * Method used to combine runes. Snowscape custom: you get multiple combination runes per essence (the opposite rune cost scales to match the multiplier) + */ + private final void combine() { + final Item remove = node.getName().contains("talisman") ? node : talisman != null ? talisman.getTalisman() : Talisman.forName(Rune.forItem(node).name()).getTalisman(); + boolean imbued = hasSpellImbue(); + if (!imbued ? player.getInventory().remove(remove) : imbued) { + int essenceAmt = player.getInventory().getAmount(PURE_ESSENCE); + int multiplier = getMultiplier(altar.getRune()); + final Item rune = node.getName().contains("rune") ? Rune.forItem(node).getRune() : Rune.forName(Talisman.forItem(node).name()).getRune(); + for (int i = 0; i < essenceAmt; i++) { + int runeAmt = player.getInventory().getAmount(rune); + if (runeAmt > 0 && player.getInventory().remove(new Item(PURE_ESSENCE.getId(),1))) { + if (runeAmt < multiplier) { + multiplier = runeAmt; + } + player.getInventory().remove(new Item(rune.getId(), multiplier)); + if (RandomFunction.random(2) == 1 || hasBindingNecklace()) { + player.getInventory().add(new Item(combo.getRune().getId(), multiplier)); + player.getSkills().addExperience(Skills.RUNECRAFTING, combo.getExperience(), true); + } + } + } + if (hasBindingNecklace()) { + player.getEquipment().get(EquipmentContainer.SLOT_AMULET).setCharge(player.getEquipment().get(EquipmentContainer.SLOT_AMULET).getCharge() - 1); + if (1000 - player.getEquipment().get(EquipmentContainer.SLOT_AMULET).getCharge() > 14) { + player.getEquipment().remove(BINDING_NECKLACE, true); + player.getPacketDispatch().sendMessage("Your binding necklace crumbles into dust."); + } + } + } + } + /* Original function, replaced by snowscape custom above private final void combine() { final Item remove = node.getName().contains("talisman") ? node : talisman != null ? talisman.getTalisman() : Talisman.forName(Rune.forItem(node).name()).getTalisman(); boolean imbued = hasSpellImbue(); @@ -272,7 +302,7 @@ public final class RuneCraftPulse extends SkillPulse { } } } - +*/ /** * Method used to craft tablets. Custom for Snowscape */