mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Adds attack bonus to cup of tea
Adds ability to remove-legs on swamp toads
This commit is contained in:
parent
9635f05584
commit
050225cc24
4 changed files with 53 additions and 1 deletions
Binary file not shown.
|
|
@ -7,7 +7,9 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/Management-Server/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/Server/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/Client/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/Client" type="java-test-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/Client" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
|
|
|||
|
|
@ -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 for each beer.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
36
Server/src/plugin/skill/herblore/SwampToadPlugin.java
Normal file
36
Server/src/plugin/skill/herblore/SwampToadPlugin.java
Normal file
|
|
@ -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<Object> 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; }
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue