forked from 2009Scape/Server
Satchel changes. Rune satchel allows all runes in Boosted mode. Red satchel allows clue scrolls.
This commit is contained in:
parent
b109b98247
commit
6458a6ef95
2 changed files with 5 additions and 5 deletions
|
|
@ -44,7 +44,7 @@ class SnowscapeSatchelListener : InteractionListener {
|
|||
|
||||
|
||||
private fun transferItem(player: Player, satchelId: Int, item: Item, amount: Int, withdraw: Boolean, asNote: Boolean = false) {
|
||||
if (withdraw == false && !isAllowed(satchelId, unnote(item).getId())) {
|
||||
if (withdraw == false && !isAllowed(player, satchelId, unnote(item).getId())) {
|
||||
player.sendMessage(item.getName() + " cannot be stored in the " + Item(satchelId).getName() + ".")
|
||||
return
|
||||
}
|
||||
|
|
@ -134,14 +134,14 @@ class SnowscapeSatchelListener : InteractionListener {
|
|||
}
|
||||
|
||||
// Checks if the item is allowed in the satchel. The NPCDropTables.java function calls this on the Red Satchel if the player has one
|
||||
fun isAllowed(satchelId: Int, itemId: Int): Boolean {
|
||||
fun isAllowed(player: Player, satchelId: Int, itemId: Int): Boolean {
|
||||
when (satchelId) {
|
||||
plainSatchelId -> return itemId !in satchelIds
|
||||
greenSatchelId -> return (Item(itemId).getName().contains(" seed") || Item(itemId).getName().contains("Grimy") || Item(itemId).getName().contains("Clean "))
|
||||
redSatchelId -> return itemId in intArrayOf(12158,12159,12160,12161,12162,12163,12164,12165,12166,12167,12168)
|
||||
redSatchelId -> return itemId in intArrayOf(12158,12159,12160,12161,12162,12163,12164,12165,12166,12167,12168) || Item(itemId).getName().equals("Clue scroll")
|
||||
blackSatchelId -> return itemId in intArrayOf(995)
|
||||
goldSatchelId -> return itemId in intArrayOf(436,438,440,442,444,446,447,449,451,453,668,2892)
|
||||
runeSatchelId -> return itemId in intArrayOf(558,559,564,562,9075,561,563,560,565,566)
|
||||
runeSatchelId -> return itemId in intArrayOf(558,559,564,562,9075,561,563,560,565,566) || (getAttribute(player,"snowscape:boostedmode",false) && itemId in intArrayOf(556,555,557,554,4694,4695,4696,4697,4698,4699))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ public final class NPCDropTables {
|
|||
//Snowscape modification: loot certain items into the red satchel if carried
|
||||
private boolean handleSatchel(Player player, Item item) {
|
||||
if (inEquipmentOrInventory(player,10879,1)){
|
||||
if (SnowscapeSatchelListener.Companion.isAllowed(10879,item.getId()) && player.redSatchel.add(item)) {
|
||||
if (SnowscapeSatchelListener.Companion.isAllowed(player,10879,item.getId()) && player.redSatchel.add(item)) {
|
||||
player.sendMessage("Your red satchel stashed <col=ffa07a>" + item.getAmount() + " " + item.getName() + ".</col>");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue