forked from 2009Scape/Server
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.
This commit is contained in:
parent
f258632fb5
commit
f3c9dd2d9c
1 changed files with 46 additions and 1 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue