[STICKY] Adding new Craft Item to the New Craft Gumps

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Adding new Craft Item to the New Craft Gumps

Post by dragon slayer »

We will use Fletching as example.

First you need to open dictionary. Eng or what ever language your server supports.
Find this line
// 11201 - 11400 Bowcraft Fletching Crafting Skill
Now scroll down and find this entry
11220=Heavy Crossbow
That should be the last entry for fletching.

Add in you custom item to look like this
11221=MycustomBow
Save and close your dictionary.

Second step is to open bowcraft.dfn

find the last line in that file that should look like this.
[ITEM 208]
{
NAME=yumi
id=0x27f0
RESOURCE=WOOD 10
SKILL=8 900 1000
ADDITEM=0x27f0
MINRANK=1
MAXRANK=10
SOUND=0x55
}
Right after that add you custom bow
[ITEM 209]
{
NAME=MyCustomBow
id=0x27f0
RESOURCE=WOOD 10
SKILL=8 900 1000
ADDITEM=0x27f0
MINRANK=1
MAXRANK=10
SOUND=0x55
}
don't forget to change all the settings on it to your settings.
and save and close bowcraft.dfn

Third Step Open fletching.js

Find this line first.
    // Page 3 - Weapons
    [ 11218, 11219, 11220 ]
Now add your new dictionary entry in that line.
    // Page 3 - Weapons
    [ 11218, 11219, 11220, 11221 ]
Now go down to this line
        case 302: // Heavy Crossbow
            makeID = 193; timerID = 3; break;
add this line after
        case 303: // MyCustomBow
            makeID = 209; timerID = 3; break;
makeID is the item number of the item in bowcraft.dfn. that would be [ITEM 209]

Case 303 is the button the craft gump calls

now go down to next line
        case 2302: // Heavy Crossbow
            itemDetailsID = 193; break;
add this line after that
        case 2303: // MyCustomBow
            itemDetailsID = 209; break;
itemDetailsID 209 is the item number from the bowcraft but also the button that is called in the next js. when we get there ill show you.

Now Go back up to this line
if(( pButton >= 100 && pButton <= 302 ) || pButton == 5000 )
change pButton <= 302

to this

pButton <= 303

Now save and close the fletching.js

Now fourth and finale step.
Open itemdetailgump.js

find this code
case 205: // Fifty Bolts
            createEntry = CreateEntries[205];
            HARVEST = [10029, 10028]; // Shaft, Feather
            mainSkill = parseInt( pUser.skills.bowcraft );
            break;
add in you custom after that
case 209: // MyCustomBow
            createEntry = CreateEntries[209];
            HARVEST = [10014]; // Boards or Logs
            mainSkill = parseInt( pUser.skills.bowcraft );
            break;
Case needs to match the ITEM number from your bowcraft.dfn.
createEntry = CreateEntries[209]; this calling the ITEM 209 in Bowcraft.dfn as well so this number needs to match it is pulling in all the details from the script.

Now Save and close.
Go in game and your new item is in the menu.

Same steps can be applied to add items to any crafting menu.
Post Reply