Added ability to craft altar teleport tablets by bringing soft clay to the respective altar.

This commit is contained in:
randy 2024-11-03 18:40:32 -07:00
parent 020c10d961
commit 540db8e15a

View file

@ -40,6 +40,7 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
* Represents the pure essence item.
*/
private static final Item PURE_ESSENCE = new Item(7936);
private static final Item SOFT_CLAY = new Item(1761);
/**
* Represents the binding necklace item.
@ -119,12 +120,12 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
player.getPacketDispatch().sendMessage("You need pure essence to craft this rune.");
return false;
}
if (!altar.isOurania() && !rune.isNormal() && !player.getInventory().containsItem(PURE_ESSENCE)) {
player.getPacketDispatch().sendMessage("You need pure essence to craft this rune.");
if (!altar.isOurania() && !rune.isNormal() && !player.getInventory().containsItem(PURE_ESSENCE) && !player.getInventory().containsItem(SOFT_CLAY)) {
player.getPacketDispatch().sendMessage("You need pure essence to craft this rune, or soft clay to craft teleport tablets.");
return false;
}
if (!altar.isOurania() && rune.isNormal() && !player.getInventory().containsItem(PURE_ESSENCE) && !player.getInventory().containsItem(RUNE_ESSENCE)) {
player.getPacketDispatch().sendMessage("You need rune essence or pure essence in order to craft this rune.");
if (!altar.isOurania() && rune.isNormal() && !player.getInventory().containsItem(PURE_ESSENCE) && !player.getInventory().containsItem(RUNE_ESSENCE) && !player.getInventory().containsItem(SOFT_CLAY)) {
player.getPacketDispatch().sendMessage("You need rune essence or pure essence in order to craft this rune, or soft clay to craft teleport tablets.");
return false;
}
if (altar.isOurania() && !player.getInventory().containsItem(PURE_ESSENCE)) {
@ -160,6 +161,7 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
@Override
public boolean reward() {
if (!combination) {
craftTablet();
craft();
} else {
combine();
@ -268,6 +270,33 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
}
}
/**
* Method used to craft tablets. Custom for Snowscape
*/
private final void craftTablet() {
int amount = player.getInventory().getAmount(new Item(1761));
Item clay = new Item(1761, amount);
Item tablet = null;
if (altar == Altar.AIR) { tablet = new Item(13599, amount); }
if (altar == Altar.MIND) { tablet = new Item(13600, amount); }
if (altar == Altar.WATER) { tablet = new Item(13601, amount); }
if (altar == Altar.EARTH) { tablet = new Item(13602, amount); }
if (altar == Altar.FIRE) { tablet = new Item(13603, amount); }
if (altar == Altar.BODY) { tablet = new Item(13604, amount); }
if (altar == Altar.COSMIC) { tablet = new Item(13605, amount); }
if (altar == Altar.CHAOS) { tablet = new Item(13606, amount); }
if (altar == Altar.ASTRAL) { tablet = new Item(13611, amount); }
if (altar == Altar.NATURE) { tablet = new Item(13607, amount); }
if (altar == Altar.LAW) { tablet = new Item(13608, amount); }
if (altar == Altar.DEATH) { tablet = new Item(13609, amount); }
if (altar == Altar.BLOOD) { tablet = new Item(13610, amount); }
if (altar == Altar.SOUL) { tablet = new Item(13598, amount); }
if (tablet != null && player.getInventory().remove(clay)) {
player.getInventory().add(tablet);
player.getPacketDispatch().sendMessage("You bind the temple's power into teleport tablets.");
}
}
/**
* Checks if the player has the spell imbue.
*