}
}
private void handleSmithing(int barID, int toMake) {
ItemSmithingDef def = EntityHandler
.getSmithingDef((Formulae.getBarType(barID) * 21)
+ toMake);
if (def == null) {
owner.getActionSender().sendMessage(
"Nothing interesting happens.");
return;
}
if (owner.getCurStat(13) < def.getRequiredLevel()) {
owner.getActionSender().sendMessage(
"You need at smithing level of "
+ def.getRequiredLevel()
+ " to make this");
return;
}
if (owner.getInventory().countId(barID) < def
.getRequiredBars()) {
owner.getActionSender().sendMessage(
"You don't have enough bars to make this.");
return;
}
owner.getActionSender().sendSound("anvil");
for (int x = 0; x < def.getRequiredBars(); x++) {
owner.getInventory().remove(barID, 1, false);
}
Bubble bubble = new Bubble(owner, item.id);
for (Player p : owner.getViewArea().getPlayersInView()) {
p.informOfBubble(bubble);
}
if (EntityHandler.getItemDef(def.getItemID())
.isStackable()) {
owner.getActionSender().sendMessage(
"You hammer the metal into some "
+ EntityHandler.getItemDef(
def.getItemID()).getName());
owner.getInventory().add(def.getItemID(),
def.getAmount(), false);
} else {
owner.getActionSender().sendMessage(
"You hammer the metal into a "
+ EntityHandler.getItemDef(
def.getItemID()).getName());
for (int x = 0; x < def.getAmount(); x++) {
owner.getInventory().add(def.getItemID(), 1,
false);
}
}
owner.incExp(
13,
Formulae.getSmithingExp(barID,
def.getRequiredBars()), true, true);
owner.getActionSender().sendStat(13);
owner.getActionSender().sendInventory();
}
private boolean itemId(int[] ids) {