@Override
  public void execute(WorldObject performer, WorldObject target, int[] args, World world) {
    WorldObjectContainer inventory = performer.getProperty(Constants.INVENTORY);

    double skillBonus =
        SkillUtils.useSkill(
            performer, Constants.SMITHING_SKILL, world.getWorldStateChangedListeners());
    int quantity = SmithPropertyUtils.calculateSmithingQuantity(performer, target);
    inventory.addQuantity(Item.IRON_HELMET.generate(skillBonus), quantity);

    inventory.removeQuantity(Constants.WOOD, WOOD_REQUIRED);
    inventory.removeQuantity(Constants.ORE, ORE_REQUIRED);
  }
예제 #2
0
  @Override
  public void execute(WorldObject performer, WorldObject target, int[] args, World world) {
    WorldObjectContainer inventory = performer.getProperty(Constants.INVENTORY);

    double skillBonus =
        SkillUtils.useSkill(
            performer, Constants.ALCHEMY_SKILL, world.getWorldStateChangedListeners());
    int quantity = target.getProperty(Constants.APOTHECARY_QUALITY);
    inventory.addQuantity(Item.POISON.generate(skillBonus), quantity);

    inventory.removeQuantity(Constants.NIGHT_SHADE, NIGHT_SHADE_REQUIRED);
  }