From 9de1fddc8efa3e0f81dfd0cb28404e8f1eaac2d7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 4 Mar 2019 09:59:18 -0300 Subject: Crafting System base code used for Evol - this is for reference purposes, DO NOT MERGE --- db/craft_db.conf | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++- db/re/item_db.conf | 1 - npc/001-1/_import.txt | 1 + npc/001-1/test.txt | 67 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 npc/001-1/test.txt diff --git a/db/craft_db.conf b/db/craft_db.conf index 6a015fb65..071180566 100644 --- a/db/craft_db.conf +++ b/db/craft_db.conf @@ -54,7 +54,7 @@ craft_db: ( }, ******************************************************************************/ -// Evol Recipes +// Pet Egg Recipes { Id: 0 Name: "CraftEgg" @@ -108,6 +108,8 @@ craft_db: ( Priority: 10 Price: 100 }, + +// Generic Item Recipes { Id: 1 Name: "CraftPiouFeathers" @@ -214,6 +216,8 @@ craft_db: ( Price: 0 ReturnCode: 123 }, + +// Dye Recipes { Id: 2 Name: "CraftOrangeDye" @@ -257,6 +261,8 @@ craft_db: ( } Priority: 10 }, + +// Equipment recipes { Id: 3 Name: "CraftItemWithDye" @@ -305,4 +311,78 @@ craft_db: ( Priority: 10 }, +// Help +{ + Id: 5 + Name: "CraftCarpCocktail" + Flag: 4 + SourceItems: + ( + { + Bread: 1 + LettuceLeaf: 1 + Cheese: 1 + CommonCarp: 1 + }, + ) + CreateItems: + ( + { + CactusCocktail: 1 + }, + ) + RequiredItems: { + ThetaBook: 1 + } + Priority: 10 +}, +{ + Id: 6 + Name: "CraftMananaCocktail" + Flag: 4 + SourceItems: + ( + { + Bread: 1 + LettuceLeaf: 1 + Cheese: 1 + Manana: 1 + }, + ) + CreateItems: + ( + { + AppleCocktail: 1 + }, + ) + RequiredItems: { + ThetaBook: 1 + } + Priority: 10 +}, +{ + Id: 7 + Name: "CraftLegsCocktail" + Flag: 4 + SourceItems: + ( + { + Bread: 1 + LettuceLeaf: 1 + Cheese: 1 + PiouLegs: 1 + }, + ) + CreateItems: + ( + { + CherryCocktail: 1 + }, + ) + RequiredItems: { + ThetaBook: 1 + } + Priority: 10 +}, + ) diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 09d4a6bf2..41ace1397 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -5975,7 +5975,6 @@ item_db: ( id5018: 1 id5019: 1 id5020: 1 - id5030: 2 } }, { diff --git a/npc/001-1/_import.txt b/npc/001-1/_import.txt index 71cb54d67..ee5703330 100644 --- a/npc/001-1/_import.txt +++ b/npc/001-1/_import.txt @@ -6,4 +6,5 @@ "npc/001-1/mapflags.txt", "npc/001-1/portal.txt", "npc/001-1/rewards.txt", +"npc/001-1/test.txt", "npc/001-1/wateranimation.txt", diff --git a/npc/001-1/test.txt b/npc/001-1/test.txt new file mode 100644 index 000000000..be87d206a --- /dev/null +++ b/npc/001-1/test.txt @@ -0,0 +1,67 @@ +// Evol scripts. +// Author: +// 4144 +// Description: +// if COOKING_RECIPES[id] is set to true, you know how to make it + +boss,29,27,0 script micksha NPC_FEMALE,{ + if (!is_admin()) { + mesc "Error 13: Permission Denied", 1; + close; + } + + do { + mesn; + mesc l("You know recipes @@", COOKING_RECIPES); + mesc l("You need Recipe Book @@", getitemlink(ThetaBook)); + mes l("Code: @@", CraftCarpCocktail); + + select + ("Let's craft"), + ("Toggle recipe 1 - Carp"), + ("Toggle recipe 2 - Manana"), + ("Toggle recipe 4 - Piou Leg"), + ("Leave"); + mes ""; + + switch (@menu) { + case 1: + setskin "craft4"; + .@var$ = requestcraft(4); + .@craft = initcraft(.@var$); + .@entry = findcraftentry(.@craft, 4); + mes "found craft entry: " + .@entry; + if (.@entry < 0) { + mes "This didn't work!"; + } else { + // Check against COOKING_RECIPES + // using CraftCarpCocktail for example (Craft ID) + // Checking somehow if you know it (array_find?) + if (COOKING_RECIPES[.@entry]) { + usecraft .@craft; + mes "done!"; + } else { + mes "This didn't work!"; + } + } + deletecraft .@craft; + setskin ""; + break; + case 2: + COOKING_RECIPES[CraftCarpCocktail]=!COOKING_RECIPES[CraftCarpCocktail]; break; + case 3: + COOKING_RECIPES[CraftMananaCocktail]=!COOKING_RECIPES[CraftMananaCocktail]; break; + case 4: + COOKING_RECIPES[CraftLegsCocktail]=!COOKING_RECIPES[CraftLegsCocktail]; break; + } + } while (@menu != 5); + + close; + + +OnInit: + .sex = G_MALE; + .distance = 5; + end; + +} -- cgit v1.2.3-60-g2f50