diff options
Diffstat (limited to 'npc/items/recipes.txt')
-rw-r--r-- | npc/items/recipes.txt | 210 |
1 files changed, 38 insertions, 172 deletions
diff --git a/npc/items/recipes.txt b/npc/items/recipes.txt index 5ffaab41..c7e4b2a7 100644 --- a/npc/items/recipes.txt +++ b/npc/items/recipes.txt @@ -5,72 +5,30 @@ // Description: // Contains recipe books for Evol Online -// showRecipe( recipe{, recipe...} ) +// showRecipe( Craft, Bonus, {amount 1, item 1}, {amount 2, item 2}... ) function script showRecipe { - freeloop(true); - for (.@a = 0; .@a < getargcount(); ++.@a) { - .@const$ = data_to_string(getarg(.@a)); + if (getargcount() < 3 || getargcount() % 2 != 0) + return false;//Exception("Faulty recipe skill command invoked - error"); - if (startswith(.@const$, "Craft")) { - // infer the item constant from the craft constant - .@recipe = getarg(.@a); + if (RECIPES[getarg(0)]) { + if (getarg(1)) { + mes l(".:: %s Recipe ::.", getitemlink(getarg(1))); - .@item = string_to_data(substr(.@const$, 5, getstrlen(.@const$) - 1)); - } else { - // infer the craft constant from the item constant - .@recipe = string_to_data(sprintf("Craft%s", .@const$)); - .@item = getarg(.@a); - } - - if (.@item <= 0) { - // target item not found - continue; - } - - if (!RECIPES[.@recipe] && !debug) { - // does not have the recipe - continue; - } - - for (.@inv = 0; .@inv < 9; ++.@inv) { - .@size = getcraftrecipe(.@recipe, .@inv, .@qty[0], .@item_id[0]); - - if (.@size < 0) { - if (.@size == -1) { - // recipe does not exist - break; - } - // inventory does not exist - break; - } - - mes(l(".:: %s Recipe ::.", getitemlink(.@item))); - - for (.@it = 0; .@it < .@size; ++.@it) { - .@recipe_item = .@item_id[.@it]; - .@recipe_qty = .@qty[.@it]; - - if (.@recipe_item <= 0) { - break; - } - - mesc(sprintf("%d/%d %s", countitem(.@recipe_item), .@recipe_qty, getitemlink(.@recipe_item))); + for (.@i=2;.@i < getargcount(); .@i++) { + mesc l("%d/%d %s", countitem(getarg(.@i+1)), getarg(.@i), getitemlink(getarg(.@i+1))); + .@i++; } - - mes(""); - .@count++; + mes ""; } + return true; } - freeloop(false); - - return .@count > 0; + return false; } - script #RecipeBook NPC_HIDDEN,{ function read_book; function read_cooking; function read_smithery; - function read_tailoring; end; function read_book { @@ -89,14 +47,12 @@ function read_book { read_cooking(); break; case CRAFT_SMITHERY: read_smithery(); break; - case CRAFT_TAILORING: - read_tailoring(); break; default: mesc l("Unfortunately, there is nothing on this bookmark."); mesc l("Perhaps, in future, someone adds it to this world."); break; } - close2(); + next; return; } @@ -112,10 +68,21 @@ function read_cooking { mes ""; mes ".:: " + l("Sandwiches") + " ::."; mes ""; - - showRecipe(CarpSandwich, - PioulegSandwich, - MananaSandwich); + showRecipe(CraftCarpSandwich, CarpSandwich, + 1, Bread, + 3, LettuceLeaf, + 2, Cheese, + 1, CommonCarp); + showRecipe(CraftPioulegSandwich, PioulegSandwich, + 1, Bread, + 3, LettuceLeaf, + 2, Cheese, + 1, PiouLegs); + showRecipe(CraftMananaSandwich, MananaSandwich, + 1, Bread, + 3, LettuceLeaf, + 2, Cheese, + 1, Manana); return; } @@ -130,117 +97,14 @@ function read_smithery { next; mesc l("List of known smithery recipes:"); - mes(); - mesf(".:: %s ::.", l("Chest Armor")); - mes(); - - showRecipe(LegionTrainingShirt, - LegionCopperArmor, - Chainmail, - Snakeplate, - LightPlatemail, - JustifierChest, - LegionIronArmor, - WarlordPlate, - TerraniteArmor, - AssassinChest, - BlackArmor, - GoldenWarlordPlate); - - next(); - mes(); - mesf(".:: %s ::.", l("Leg Armor")); - mes(); - - showRecipe(ChainmailSkirt, - TerranitePants, - AssassinPants); - - next(); - mes(); - mesf(".:: %s ::.", l("Gloves")); - mes(); - - showRecipe(CopperArmbands, - BromenalGloves, - IronArmbands); - - next(); - mes(); - mesf(".:: %s ::.", l("Boots")); - mes(); - - showRecipe(BromenalBoots, - WarlordBoots); - - return; -} - -function read_tailoring { - setnpcdialogtitle(l("Tailoring Recipes")); - - mesc(l("(All items must be placed exactly in this order.)")); - next(); - mesc(l("List of known tailoring recipes:")); - - mes(); - mesf(".:: %s ::.", l("Chest Armor")); - mes(); - - showRecipe(CreasedShirt, - ArtisTankTop, - VneckJumper, - SailorShirt, - FineDress, - SilkRobe, - ForestArmor, - ApprenticeRobe, - PeltJacket, - SorcererRobe, - WizardRobe, - EvocatorRobe); - - next(); - mes(); - mesf(".:: %s ::.", l("Leg Armor")); - mes(); - - showRecipe(CreasedShorts, - CottonSkirt, - PirateShorts, - SilkPants, - BrownTrousers, - BanditTrousers, - JeansChaps, - LeatherTrousers); - - next(); - mes(); - mesf(".:: %s ::.", l("Gloves")); - mes(); - - showRecipe(ShortGloves, - Armbands, - CottonGloves, - BanditGloves, - SilkGloves, - LeatherGloves, - AssassinGloves); - - next(); - mes(); - mesf(".:: %s ::.", l("Boots")); - mes(); - - showRecipe(LousyMoccasins, - Slippers, - CottonBoots, - BanditBoots, - ManaSlippers, - SquirrelBoots, - LeatherBoots, - RidingBoots, - AssassinBoots); + mes ""; + mes ".:: " + l("Helmets") + " ::."; + mes ""; + showRecipe(CraftInfantryHelmet, InfantryHelmet, + 12, IronOre, + 3, Coal, + 2, Moss, + 1, Dagger); return; } @@ -328,3 +192,5 @@ function script MakeBlueprint { } return; } + + |