From 8c99adcb54d0a13f63a6f93d771ca15f211fb4e3 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 28 May 2019 22:44:11 -0300 Subject: Item crafting (Bugslayer and Wooden Sword) will now output named items (crafter name). And these named items will have the crafter's skills on them =D Great, now we need recipes and learning (both of these) :> --- db/craft_db.conf | 14 ++++++++++---- db/re/skill_tree.conf | 1 + npc/craft/smith.txt | 18 +++++++++++++++++- npc/craft/tweak.txt | 2 +- npc/functions/main.txt | 19 +++++++++++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) diff --git a/db/craft_db.conf b/db/craft_db.conf index 2e736e41b..02b56a23d 100644 --- a/db/craft_db.conf +++ b/db/craft_db.conf @@ -647,10 +647,13 @@ craft_db: ( // Output PileOfAsh // Require 1x EverburnPowder to lit (maybe Sulphur?) // Require BentNeddle to costure (leather) +// We rely on hardcoded values here, BEWARE { Id: 51 Name: "CraftWoodenSword" Flag: 16 + ReturnCode: 3503 + //WoodenSword SourceItems: ( { @@ -664,11 +667,10 @@ craft_db: ( CreateItems: ( { - WoodenSword: 1 + RawLog: 1 }, { - WoodenSword: 1 - RawLog: 1 + RawLog: 2 }, ) Priority: 10 @@ -678,6 +680,8 @@ craft_db: ( Id: 52 Name: "CraftBugSlayer" Flag: 16 + ReturnCode: 3501 + //BugSlayer SourceItems: ( { @@ -692,9 +696,11 @@ craft_db: ( CreateItems: ( { - BugSlayer: 1 PileOfAsh: 1 }, + { + PileOfAsh: 2 + }, ) Priority: 10 }, diff --git a/db/re/skill_tree.conf b/db/re/skill_tree.conf index 2f592afbf..6d6bb9616 100644 --- a/db/re/skill_tree.conf +++ b/db/re/skill_tree.conf @@ -31,6 +31,7 @@ Human: { NV_BASIC: 0 TMW2_FAKESKILL: 0 TMW2_FAKESKILL2: 0 + TMW2_CRAFT: 0 WE_MALE: 0 WE_FEMALE: 0 SN_SHARPSHOOTING: 0 diff --git a/npc/craft/smith.txt b/npc/craft/smith.txt index ba2155210..7753daeaf 100644 --- a/npc/craft/smith.txt +++ b/npc/craft/smith.txt @@ -37,8 +37,24 @@ function script SmithSystem { if (.@entry < 0) { .success=false; } else { - if (.scope == CRAFT_NPC || .knowledge[.@entry]) { + if (.scope == CRAFT_NPC) { usecraft .@craft; + .@it=getcraftcode(.@craft); + getitem(.@it, 1); + .success=true; + } else if (.knowledge[.@entry] || $@GM_OVERRIDE) { + // Player craft item + usecraft .@craft; + .@it=getcraftcode(.@entry); + getnameditem(.@it, strcharinfo(0)); + if (getskilllv(TMW2_CRAFT)) { + delinventorylist(); // Needed, because we'll rely on rfind() + getinventorylist(); + .@index=array_rfind(@inventorylist_id, .@it); + if (csys_Check(.@index)) { + csys_Apply(.@index); + } + } .success=true; } else { .success=false; diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt index ba5a4b2bb..9bc786d33 100644 --- a/npc/craft/tweak.txt +++ b/npc/craft/tweak.txt @@ -21,7 +21,7 @@ function script SmithTweakReset { if (!csys_Confirm(.@id)) return; - csys_Check(); + csys_Check(.@id); return; } diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 807ac6a44..075142e12 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -291,6 +291,25 @@ function script isin { return false; } +// Clear output of getinventorylist() +// delinventorylist() +function script delinventorylist { + deletearray @inventorylist_id; + deletearray @inventorylist_amount; + deletearray @inventorylist_equip; + deletearray @inventorylist_refine; + deletearray @inventorylist_identify; + deletearray @inventorylist_attribute; + deletearray @inventorylist_card1; + deletearray @inventorylist_card2; + deletearray @inventorylist_card3; + deletearray @inventorylist_card4; + deletearray @inventorylist_expire; + deletearray @inventorylist_bound; + @inventorylist_count=0; + return; +} + // Get some acc id, even if offline // ( Name ) function script gf_accid { -- cgit v1.2.3-60-g2f50