From f3c9dd2d9c50a6389bc84d8cfba7b987fdf80a35 Mon Sep 17 00:00:00 2001 From: randy Date: Sun, 24 Nov 2024 21:07:42 -0700 Subject: [PATCH] Changed Low Alch spell into Note Spell Casting on an item will note all of the matching items in your inventory. 10% of the items (rounded down) are charged as a "tax" so that other remote deposit options are still competitive. --- .../skill/magic/modern/ModernListeners.kt | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt b/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt index d56b8230b..6d356e205 100644 --- a/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt +++ b/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt @@ -102,7 +102,7 @@ class ModernListeners : SpellListener("modern"){ onCast(Modern.LOW_ALCHEMY, ITEM){ player, node -> val item = node?.asItem() ?: return@onCast requires(player,21, arrayOf(Item(Items.FIRE_RUNE_554,3),Item(Items.NATURE_RUNE_561))) - alchemize(player,item,high = false) + notespell(player,item) } onCast(Modern.HIGH_ALCHEMY, ITEM){ player, node -> @@ -214,7 +214,52 @@ class ModernListeners : SpellListener("modern"){ player.pulseManager.run(SmeltingPulse(player, item, bar, 1, true)) setDelay(player,false) } + + //Snowscape custom: Low Alch spell replaced with Note spell. This spell charges 10% of the items converted to notes as a tax. + public fun notespell(player: Player, item: Item) : Boolean { + if (item.definition.isUnnoted) { + if (item.definition.noteId < 0) { + player.sendMessage("This item cannot be noted.") + return false + } + val amount = player.inventory.getAmount(item.id) + player.inventory.remove(Item(item.id, amount)) + player.inventory.add(note(Item(item.id, kotlin.math.ceil(amount*0.9).toInt()))) + player.sendMessage("The Bank of Gielinor appreciates your business.") + } else { + player.sendMessage("This item is already noted!") + return false + /* Unnoting is too strong, allowing runecrafting to happen at breakneck speeds and allowing infinite food to be brought along. Leaving the code here in case we want to enable it again someday. + val startingamount = player.inventory.getAmount(item.id) + val freespace = player.inventory.freeSlots() + var amount = minOf(startingamount, freespace) + if (startingamount - amount == 1) amount++ + if (amount == 0) { + player.sendMessage("You do not have enough inventory space to unnote this item.") + return false + } + player.inventory.remove(Item(item.id, amount)) + player.inventory.add(unnote(Item(item.id, amount))) + */ + } + + val weapon = player.equipment.getItem(getItemFromEquipment(player, EquipmentSlot.WEAPON)) + if (weapon != null && !weapon.equals(MagicStaff.FIRE_RUNE)) { + player.animate(Animation(9625)) + player.graphics(Graphics(1692)) + } else { + player.animate(Animation(712)) + player.graphics(Graphics(112)) + } + playAudio(player,Sounds.LOW_ALCHEMY_98) + + removeRunes(player) + addXP(player, 31.0) + showMagicTab(player) + setDelay(player, 5) + return true + } fun alchemize(player: Player, item: Item, high: Boolean, explorersRing: Boolean = false): Boolean { if(item.name == "Coins") player.sendMessage("You can't alchemize something that's already gold!").also { return false } if((!item.definition.isTradeable) && (!item.definition.isAlchemizable)) player.sendMessage("You can't cast this spell on something like that.").also { return false }