From 0ab5e1d6e6a3523b27c74f1c3ce7fbd889dcf4d8 Mon Sep 17 00:00:00 2001 From: ceikry Date: Wed, 9 Mar 2022 19:47:10 -0600 Subject: [PATCH] Quick maintenance --- .../command/rottenpotato/RottenPotatoOptionHandler.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt b/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt index cf30b98c1..777ec29fa 100644 --- a/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt +++ b/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt @@ -1,12 +1,15 @@ package rs09.game.system.command.rottenpotato +import api.removeItem import core.cache.def.impl.ItemDefinition import core.game.interaction.OptionHandler import core.game.node.Node import core.game.node.entity.player.Player +import core.game.node.entity.player.info.Rights import core.plugin.Initializable import core.plugin.Plugin import org.rs09.consts.Items +import rs09.game.system.SystemLogger import rs09.game.system.command.CommandSystem import rs09.tools.stringtools.colorize @@ -29,6 +32,14 @@ class RottenPotatoOptionHandler : OptionHandler() { node ?: return false option ?: return false + // re-add the fucking check because some fucking moron removed it at some point + if(player.rights != Rights.ADMINISTRATOR) + { + removeItem(player, Items.ROTTEN_POTATO_5733) + SystemLogger.logAlert("Player ${player.username} had a rotten potato. It has been removed.") + return false + } + when(option){ "rs hd" -> player.dialogueInterpreter.open(RottenPotatoRSHDDialogue().ID) "heal" -> player.fullRestore().also { player.sendMessage(colorize("%RAll healed!")) }