}
// add recipe to recipebook
player.registerRecipe(rp, true);
player.sendPacket(new SystemMessage(SystemMessage.S1_HAS_BEEN_ADDED).addString(item.getName()));
player.getInventory().destroyItem(item, 1, true);
RecipeBookItemList response = new RecipeBookItemList(true, (int) player.getCurrentMp());
response.setRecipes(player.getDwarvenRecipeBook());
player.sendPacket(response);
}
else
{
player.sendPacket(Msg.YOU_ARE_NOT_AUTHORIZED_TO_REGISTER_A_RECIPE);
}
}
else if(player.getCommonRecipeLimit() > 0)
{
if(player.getCommonRecipeBook().size() >= player.getCommonRecipeLimit())
{
player.sendPacket(Msg.NO_FURTHER_RECIPES_MAY_BE_REGISTERED);
return;
}
if(player.hasRecipe(rp))
{
player.sendPacket(Msg.THAT_RECIPE_IS_ALREADY_REGISTERED);
return;
}
player.registerRecipe(rp, true);
player.sendPacket(new SystemMessage(SystemMessage.S1_HAS_BEEN_ADDED).addString(item.getName()));
player.getInventory().destroyItem(item, 1, true);
RecipeBookItemList response = new RecipeBookItemList(false, (int) player.getCurrentMp());
response.setRecipes(player.getCommonRecipeBook());
player.sendPacket(response);
}
else
{
player.sendPacket(Msg.YOU_ARE_NOT_AUTHORIZED_TO_REGISTER_A_RECIPE);