if (!Server.isMembers()) {
player.getActionSender().sendMessage(
"This feature is only avaliable on a members server");
return;
}
ItemUnIdentHerbDef herb = ItemAttributes.getUnIdentHerbDef(item.id);
if (herb == null) {
return;
}
if (player.getMaxStat(15) < herb.getLevelRequired()) {
player.getActionSender()
.sendMessage(
"Your herblaw ability is not high enough to clean this herb.");
return;
}
player.setBusy(true);
Instance.getDelayedEventHandler().add(new MiniEvent(player) {
public void action() {
ItemUnIdentHerbDef herb = ItemAttributes
.getUnIdentHerbDef(item.id);
InvItem newItem = new InvItem(herb.getNewId());
owner.getInventory().remove(item.id, item.amount, false);
owner.getInventory().add(newItem.id, newItem.amount, false);
owner.getActionSender().sendMessage(
"You clean the mud off the "
+ newItem.getDef().getName() + ".");
owner.incExp(15, herb.getExp(), true);
owner.getActionSender().sendStat(15);
owner.getActionSender().sendInventory();
owner.setBusy(false);
return;
}