summaryrefslogtreecommitdiff
path: root/npc/craft/smith.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-28 22:44:11 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-28 22:44:11 -0300
commit8c99adcb54d0a13f63a6f93d771ca15f211fb4e3 (patch)
tree5c3a4960a2548edff526896a694426dff5f126a8 /npc/craft/smith.txt
parenteccac500742929097d1724d38a866c1bb0b3a120 (diff)
downloadserverdata-8c99adcb54d0a13f63a6f93d771ca15f211fb4e3.tar.gz
serverdata-8c99adcb54d0a13f63a6f93d771ca15f211fb4e3.tar.bz2
serverdata-8c99adcb54d0a13f63a6f93d771ca15f211fb4e3.tar.xz
serverdata-8c99adcb54d0a13f63a6f93d771ca15f211fb4e3.zip
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) :>
Diffstat (limited to 'npc/craft/smith.txt')
-rw-r--r--npc/craft/smith.txt18
1 files changed, 17 insertions, 1 deletions
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;