diff --git a/CompiledServer/production/RS-2009/plugin/consumable/CupofTeaPlugin.class b/CompiledServer/production/RS-2009/plugin/consumable/CupofTeaPlugin.class index 87060dc60..cab20e2ce 100644 Binary files a/CompiledServer/production/RS-2009/plugin/consumable/CupofTeaPlugin.class and b/CompiledServer/production/RS-2009/plugin/consumable/CupofTeaPlugin.class differ diff --git a/Server/src/plugin/consumable/CupofTeaPlugin.java b/Server/src/plugin/consumable/CupofTeaPlugin.java index 845a70680..237f0a9c0 100644 --- a/Server/src/plugin/consumable/CupofTeaPlugin.java +++ b/Server/src/plugin/consumable/CupofTeaPlugin.java @@ -3,6 +3,8 @@ package plugin.consumable; import org.crandor.game.content.global.consumable.ConsumableProperties; import org.crandor.game.content.global.consumable.Consumables; import org.crandor.game.content.global.consumable.Drink; +import org.crandor.game.content.skill.SkillBonus; +import org.crandor.game.content.skill.Skills; import org.crandor.game.node.entity.player.Player; import org.crandor.plugin.InitializablePlugin; import org.crandor.game.node.item.Item; @@ -15,6 +17,11 @@ import org.crandor.game.node.item.Item; @InitializablePlugin public final class CupofTeaPlugin extends Drink { + /** + * Represents the skill bonuses. + */ + private SkillBonus[] bonuses; + /** * Represents the force chat to use. */ @@ -30,12 +37,19 @@ public final class CupofTeaPlugin extends Drink { * Constructs a new {@code CupofTeaPlugin} {@code Object}. */ public CupofTeaPlugin() { - super(712, new ConsumableProperties(2, 1980)); + super(712, new ConsumableProperties(3, 1980)); + this.bonuses = new SkillBonus[1]; + this.bonuses[0] = new SkillBonus(Skills.ATTACK, 0, 3); } @Override public void consume(final Item item, final Player player) { player.sendChat(CHAT); + if (this.bonuses != null) { + for (SkillBonus b : bonuses) { + addBonus(player, b); + } + } super.remove(player, item); } diff --git a/Server/src/plugin/skill/herblore/SwampToadPlugin.java b/Server/src/plugin/skill/herblore/SwampToadPlugin.java new file mode 100644 index 000000000..56c9443e9 --- /dev/null +++ b/Server/src/plugin/skill/herblore/SwampToadPlugin.java @@ -0,0 +1,36 @@ +package plugin.skill.herblore; + + +import org.crandor.cache.def.impl.ItemDefinition; +import org.crandor.game.interaction.OptionHandler; +import org.crandor.game.node.Node; +import org.crandor.game.node.entity.player.Player; +import org.crandor.game.node.item.Item; +import org.crandor.plugin.InitializablePlugin; +import org.crandor.plugin.Plugin; + +/** + * Represents the swamp toad plugin. + * @author Zombiemode + * @version 1.0 + */ +@InitializablePlugin +public final class SwampToadPlugin extends OptionHandler { + @Override + public Plugin newInstance(Object arg) throws Throwable { + ItemDefinition.setOptionHandler("remove-legs", this); + return this; + } + + @Override + public boolean handle(Player player, Node node, String option) { + if (player.getInventory().replace(new Item(2152), ((Item) node).getSlot()) != null) { + player.getPacketDispatch().sendMessage("You pull the legs off the toad. Poor toad. At least they'll grow back."); + } + return true; + } + + @Override + public boolean isWalk() { return false; } +} +