summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-06 18:00:49 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-06 18:00:49 -0300
commit223fd9299d3adeae9bb64c565cc604ac7deb9b00 (patch)
treee45de83955bdede6d461ce41a3d317b0f89906a7
parent17b0b7a0cc127af981f40f0d9067927a7443dce9 (diff)
downloadserverdata-223fd9299d3adeae9bb64c565cc604ac7deb9b00.tar.gz
serverdata-223fd9299d3adeae9bb64c565cc604ac7deb9b00.tar.bz2
serverdata-223fd9299d3adeae9bb64c565cc604ac7deb9b00.tar.xz
serverdata-223fd9299d3adeae9bb64c565cc604ac7deb9b00.zip
Fix compile bugs, sketch
-rw-r--r--db/constants.conf7
-rw-r--r--npc/functions/crafting.txt2
-rw-r--r--npc/items/recipes.txt50
3 files changed, 56 insertions, 3 deletions
diff --git a/db/constants.conf b/db/constants.conf
index cbbb5615..2c0fb424 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -4193,6 +4193,13 @@ constants_db: {
CRAFT_TAILORING: 32
CRAFT_JEWELERY: 64
+ comment__: "CRAFT Rarity enum"
+ CRAFT_BASIC: 1
+ CRAFT_INTERMEDIARY: 2
+ CRAFT_ADVANCED: 4
+ CRAFT_EXPERT: 8
+ CRAFT_MASTER: 16
+
comment__: "Being actions"
ACTION_STAND: 0
ACTION_MOVE: 1
diff --git a/npc/functions/crafting.txt b/npc/functions/crafting.txt
index 78fac20a..ba032f41 100644
--- a/npc/functions/crafting.txt
+++ b/npc/functions/crafting.txt
@@ -25,7 +25,7 @@ function script SmithSystem {
if (.@entry < 0) {
.success=false;
} else {
- if (!getarg(1, true) || if (RECIPES[.@entry]) {
+ if (!getarg(1, true) || RECIPES[.@entry]) {
// Player craft item and setup base variables
usecraft .@craft;
.@it=getcraftcode(.@entry);
diff --git a/npc/items/recipes.txt b/npc/items/recipes.txt
index c1032182..ea90990e 100644
--- a/npc/items/recipes.txt
+++ b/npc/items/recipes.txt
@@ -6,11 +6,11 @@
// Contains recipe books for Evol Online
// showRecipe( Craft, Bonus, {amount 1, item 1}, {amount 2, item 2}... )
-function showRecipe {
+function script showRecipe {
if (getargcount() < 3 || getargcount() % 2 != 0)
return false;//Exception("Faulty recipe skill command invoked - error");
- if (RECIPES[getarg(0)])) {
+ if (RECIPES[getarg(0)]) {
if (getarg(1)) {
mes l(".:: %s Recipe ::.", getitemlink(getarg(1)));
@@ -26,6 +26,9 @@ function showRecipe {
}
- script #RecipeBook NPC_HIDDEN,{
+ function read_book;
+ function read_cooking;
+ function read_smithery;
end;
function read_book {
@@ -42,6 +45,8 @@ function read_book {
switch (@menuret) {
case CRAFT_COOKING:
read_cooking(); break;
+ case CRAFT_SMITHERY:
+ read_smithery(); break;
default:
mesc l("Unfortunately, there is nothing on this bookmark.");
mesc l("Perhaps, in future, someone adds it to this world.");
@@ -117,3 +122,44 @@ OnInit:
.distance = 1;
end;
}
+
+//////////////////////////////////////////////////////
+// Below this line are utils for Gacha. We use callfunc() on itemDB.
+// Types: see constants.db - everything is a bitwise here
+// Rarity: 1 - basic, 2 - intermediary, 4 - advanced, 8 - expert, 16 - master
+// Rarity: 1 - training, 2 - basic, 4 - advanced, 8 - expert, 16 - legendary
+// Keep in mind! Expert and Master blueprints must be restricted!
+// MakeBlueprint(type, rarity)
+function script MakeBlueprint {
+ .@type=getarg(0, -1);
+ .@rarity=getarg(1, 1);
+
+ if (.@type & CRAFT_COOKING) {
+
+ // ----------------------------------
+ if (.@rarity & CRAFT_BASIC) {
+ array_push(.@recipes, CraftInfantryHelmet); // Cannot be empty
+ }
+ // ----------------------------------
+ if (.@rarity & CRAFT_INTERMEDIARY) {
+ array_push(.@recipes, CraftInfantryHelmet);
+ }
+ // ----------------------------------
+ if (.@rarity & CRAFT_ADVANCED) {
+ }
+ // ----------------------------------
+ if (.@rarity & CRAFT_EXPERT) {
+ }
+ // ----------------------------------
+ if (.@rarity & CRAFT_MASTER) {
+ }
+ // ----------------------------------
+
+ }
+ else if (.@type & CRAFT_SMITHERY) {
+
+ }
+ return;
+}
+
+