diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index ecfb519bb..4247abd76 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -30667,6 +30667,7 @@ "id": "2874" }, { + "bankable": "false", "examine": "An inflated toad.", "durability": null, "name": "Bloated toad", diff --git a/Server/src/main/kotlin/api/ContentAPI.kt b/Server/src/main/kotlin/api/ContentAPI.kt index 66d5cd8d1..5928bdce1 100644 --- a/Server/src/main/kotlin/api/ContentAPI.kt +++ b/Server/src/main/kotlin/api/ContentAPI.kt @@ -1122,14 +1122,15 @@ fun adjustLevel(entity: Entity, skill: Int, amount: Int) { * @param item the item to remove. Can be an Item object or an ID. * @param container the Container to remove the item from. An enum exists for this called Container. Ex: Container.BANK */ -fun removeAll(player: Player, item: T, container: Container) { +fun removeAll(player: Player, item: T, container: Container = Container.INVENTORY): Boolean { + item ?: return false val it = when (item) { is Item -> item.id is Int -> item else -> throw IllegalStateException("Invalid value passed as item") } - when (container) { + return when (container) { Container.EQUIPMENT -> player.equipment.remove(Item(it, amountInEquipment(player, it))) Container.BANK -> { val amountInPrimary = amountInBank(player, it, false) diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/BloatedToadNPC.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/BloatedToadNPC.kt index 59cf35968..d84cb54ec 100644 --- a/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/BloatedToadNPC.kt +++ b/Server/src/main/kotlin/rs09/game/content/quest/members/chompybird/BloatedToadNPC.kt @@ -150,5 +150,17 @@ class BloatedToadListeners : InteractionListener, StartupListener, Commands { } return@on true } + + on(Items.BLOATED_TOAD_2875, ITEM, "release") { player, used -> + removeItem(player, used.asItem()) + sendPlayerDialogue(player, "Free the fat toadsies!") + return@on true + } + + on(Items.BLOATED_TOAD_2875, ITEM, "release all") { player, used -> + removeAll(player, used.asItem()) + sendPlayerDialogue(player, "Free the fat toadsies!") + return@on true + } } }