summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf7
-rw-r--r--db/re/item_db.conf105
-rw-r--r--npc/craft/recipes.txt51
3 files changed, 163 insertions, 0 deletions
diff --git a/db/constants.conf b/db/constants.conf
index c988fa40a..00bf0248d 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -4245,6 +4245,13 @@ constants_db: {
CRAFT_PLAYER: 8
CRAFT_GUILD: 16
+ comment__: "CRAFT Rarity enum"
+ CRAFT_BASIC: 1
+ CRAFT_INTERMEDIARY: 2
+ CRAFT_ADVANCED: 4
+ CRAFT_EXPERT: 8
+ CRAFT_MASTER: 16
+
comment__: "Easter eggs enum"
EE_NONE: 0
EE_SAXSO: 1
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index deadde7c3..db6d53496 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -12228,6 +12228,111 @@ item_db: (
}
">
},
+// Other Gacha
+{
+ Id: 7450
+ AegisName: "AlchemyBlueprintA"
+ Name: "Alchemy Blueprint A"
+ Type: "IT_USABLE"
+ Buy: 0
+ Sell: 0
+ Weight: 40
+ Script: <"
+ .@seed=rand(0, 10000)-BaseLevel-readparam(bLuk);
+
+ if (.@seed < 100)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_INTERMEDIARY);
+ else if (.@seed < 2000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_BASIC | CRAFT_INTERMEDIARY);
+ else
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_BASIC);
+ ">
+},
+{
+ Id: 7451
+ AegisName: "AlchemyBlueprintB"
+ Name: "Alchemy Blueprint B"
+ Type: "IT_USABLE"
+ Buy: 0
+ Sell: 0
+ Weight: 40
+ Script: <"
+ .@seed=rand(0, 10000)-BaseLevel-readparam(bLuk);
+
+ // 1% to above, 19% to above + current, 10% to below + current.
+ if (.@seed < 100)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_ADVANCED);
+ else if (.@seed < 2000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_INTERMEDIARY | CRAFT_ADVANCED);
+ else if (.@seed < 3000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_BASIC | CRAFT_INTERMEDIARY);
+ else
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_INTERMEDIARY);
+ ">
+},
+{
+ Id: 7452
+ AegisName: "AlchemyBlueprintC"
+ Name: "Alchemy Blueprint C"
+ Type: "IT_USABLE"
+ Buy: 0
+ Sell: 0
+ Weight: 40
+ Script: <"
+ .@seed=rand(0, 10000)-BaseLevel-readparam(bLuk);
+
+ // 1% to above, 19% to above + current, 10% to below + current.
+ if (.@seed < 100)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_EXPERT);
+ else if (.@seed < 2000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_ADVANCED | CRAFT_EXPERT);
+ else if (.@seed < 3000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_INTERMEDIARY | CRAFT_ADVANCED);
+ else
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_ADVANCED);
+ ">
+},
+{
+ Id: 7453
+ AegisName: "AlchemyBlueprintD"
+ Name: "Alchemy Blueprint D"
+ Type: "IT_USABLE"
+ Buy: 0
+ Sell: 0
+ Weight: 40
+ Script: <"
+ .@seed=rand(0, 10000)-BaseLevel-readparam(bLuk);
+
+ // 1% to above, 19% to above + current, 10% to below + current.
+ if (.@seed < 100)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_MASTER);
+ else if (.@seed < 2000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_EXPERT | CRAFT_MASTER);
+ else if (.@seed < 3000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_ADVANCED | CRAFT_EXPERT);
+ else
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_EXPERT);
+ ">
+},
+{
+ Id: 7454
+ AegisName: "AlchemyBlueprintE"
+ Name: "Alchemy Blueprint E"
+ Type: "IT_USABLE"
+ Buy: 0
+ Sell: 0
+ Weight: 40
+ Script: <"
+ .@seed=rand(0, 10000)-BaseLevel-readparam(bLuk);
+
+ // 30% to below + current.
+ if (.@seed < 3000)
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_MASTER | CRAFT_EXPERT);
+ else
+ callfunc("MakeBlueprint", CRAFT_ALCHEMY, CRAFT_MASTER);
+ ">
+},
+
// Mercenary boxsets and cards
{
diff --git a/npc/craft/recipes.txt b/npc/craft/recipes.txt
index c3afa572d..e388c794f 100644
--- a/npc/craft/recipes.txt
+++ b/npc/craft/recipes.txt
@@ -167,3 +167,54 @@ OnInit:
.sex = G_OTHER;
.distance = 1;
end;
+}
+
+// Below this line are utils for Gacha. We use callfunc() on itemDB.
+// Types: CRAFT_COOKING, CRAFT_ALCHEMY, CRAFT_EQUIPMENT
+// Rarity: 1 - basic, 2 - intermediary, 4 - advanced, 8 - expert, 16 - master
+// Level equivalents: 1: (1~20) 2: (21~44), 3: (45~75), 4: (76~99), 5: 100+
+function script MakeBlueprint {
+ .@type=getarg(0, -1);
+ .@rarity=getarg(1, 1);
+
+ switch (.@type) {
+ case CRAFT_ALCHEMY:
+ if (.@rarity & CRAFT_BASIC) {
+ array_push(.@recipes, CraftPiberriesInfusion);
+ array_push(.@recipes, CraftHastePotion);
+ array_push(.@recipes, CraftStrengthPotion);
+ }
+ if (.@rarity & CRAFT_INTERMEDIARY) {
+ array_push(.@recipes, CraftLukPotionA);
+ array_push(.@recipes, CraftDexPotionA);
+ array_push(.@recipes, CraftIntPotionA);
+ array_push(.@recipes, CraftAgiPotionA);
+ array_push(.@recipes, CraftVitPotionA);
+ array_push(.@recipes, CraftSpeedPotion);
+ }
+ if (.@rarity & CRAFT_ADVANCED) {
+ array_push(.@recipes, CraftResetPotion);
+ array_push(.@recipes, CraftPrecisionPotion);
+ array_push(.@recipes, CraftDodgePotion);
+ }
+ if (.@rarity & CRAFT_EXPERT) {
+ array_push(.@recipes, CraftLukPotionB);
+ array_push(.@recipes, CraftDexPotionB);
+ array_push(.@recipes, CraftIntPotionB);
+ array_push(.@recipes, CraftAgiPotionB);
+ array_push(.@recipes, CraftVitPotionB);
+ }
+ if (.@rarity & CRAFT_MASTER) {
+ array_push(.@recipes, CraftLukPotionC);
+ array_push(.@recipes, CraftDexPotionC);
+ array_push(.@recipes, CraftIntPotionC);
+ array_push(.@recipes, CraftAgiPotionC);
+ array_push(.@recipes, CraftVitPotionC);
+ }
+ break;
+ default:
+ return Exception("Invalid blueprint type "+.@type+" - item was lost.");
+ }
+ return;
+}
+