Poisoning items without free inventory space should no longer nuke the product from existence
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package core.game.interaction.item.withitem;
|
||||
|
||||
import api.ContentAPI;
|
||||
import core.game.interaction.NodeUsageEvent;
|
||||
import core.game.interaction.UseWithHandler;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -7,6 +8,7 @@ import core.game.node.item.Item;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import org.rs09.consts.Items;
|
||||
|
||||
/**
|
||||
* Handles weapon poisiong.
|
||||
@@ -297,8 +299,8 @@ public class PoisonWeaponPlugin extends UseWithHandler {
|
||||
}
|
||||
int amt = Math.min(weaponItem.getAmount(), 5);
|
||||
player.getInventory().remove(new Item(weaponItem.getId(), amt));
|
||||
player.getInventory().add(new Item(229, 1));
|
||||
player.getInventory().add(new Item(product, amt));
|
||||
ContentAPI.addItemOrDrop(player, product, amt);
|
||||
ContentAPI.addItemOrDrop(player, Items.VIAL_229, 1);
|
||||
player.getPacketDispatch().sendMessage("You poison the " + weaponItem.getName().toLowerCase() + ".");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user