forked from 2009Scape/Server
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).
This commit is contained in:
parent
3035aaa7e6
commit
e45f8fa81b
1 changed files with 34 additions and 4 deletions
|
|
@ -239,9 +239,39 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<Item> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* Method used to craft tablets. Custom for Snowscape
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue