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) :> --- npc/craft/smith.txt | 18 +++++++++++++++++- npc/craft/tweak.txt | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'npc/craft') 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; } -- cgit v1.2.3-70-g09d2