After seeing this asked about over and over on the POLServer.com forums, I have decided to make a guide based on the Distro scripts about customizing Tailoring.
In this guide I hope to explain how to add new custom hides to the carving of NPCs, add their objtypes to the file /scripts/includes/objtypes.inc, add the hides to Tailoring's itemdesc.cfg file, make hides cuttable to the lighter "cut hides" style, and finally make them useable with the Tailoring. After this tutorial you will have 4 hides you can use. Plain Leather, Spined Leather, Horned Leather, and Barbed Leather. Each hide will give the items it's own color, it's own AR differences, and it's own durability rating. Hopefully this guide will solve some of the problems people are having with this specific issue.
Adding hides to itemdesc.cfg
First, let's find the file "/pkg/skills/tailoring/itemdesc.cfg". Open it with whatever editor you prefer, such as notebook, scripter, textpad, or whatever. Go to the very end of the file. Add the following items to the end of the file:
Code: Select all
Item 0x107A
{
Name spinedhides
desc spined hide%s%
Graphic 0x1078
VendorSellsFor 7
VendorBuysFor 3
}
Item 0x1068
{
Name cutspinedhides
desc piece%s% of cut spined leather
Graphic 0x1067
weight 1
movable 1
VendorSellsFor 7
VendorBuysFor 3
}
Item 0x107B
{
Name barbedhides
desc barbed hide%s%
Graphic 0x1078
VendorSellsFor 8
VendorBuysFor 4
}
Item 0x1069
{
Name cutbarbedhides
desc piece%s% of cut barbed leather
Graphic 0x1067
weight 1
movable 1
VendorSellsFor 8
VendorBuysFor 4
}
Item 0x107C
{
Name hornedhides
desc horned hide%s%
Graphic 0x1078
VendorSellsFor 10
VendorBuysFor 6
}
Item 0x106A
{
Name cuthornedhides
desc piece%s% of cut horned leather
Graphic 0x1067
weight 1
movable 1
VendorSellsFor 10
VendorBuysFor 6
}
Code: Select all
Item 0x1078
{
Name hides
desc hide%s%
VendorSellsFor 4
VendorBuysFor 2
}
Item 0x1079
{
Name hides2
desc hide%s%
VendorSellsFor 4
VendorBuysFor 2
}
Item 0x1067
{
Name cutleather
desc piece%s% of cut leather
VendorSellsFor 4
VendorBuysFor 2
weight 1
movable 1
}
In this part we will add the hides for future referencing to the file "/scripts/include/objtype.inc". Open the file with whatever editor you prefer, such as notebook, scripter, textpad, or whatever. Go to the very end of the file. Add the following items to the end of the file:
Code: Select all
//////////////////////////////////////////
// Tailoring Related - Hides & cut leather
//////////////////////////////////////////
CONST HIDE_START := 0x1078;
CONST HIDE_STOP := 0x107C;
CONST LEATHER_START := 0x1067;
CONST LEATHER_STOP := 0x106A;
CONST UOBJ_LEATHER := 0x1067;
CONST UOBJ_SPINED_LEATHER := 0x1068;
CONST UOBJ_BARBED_LEATHER := 0x1069;
CONST UOBJ_HORNED_LEATHER := 0x106A;
CONST UOBJ_HIDES_1 := 0x1078;
CONST UOBJ_HIDES_2 := 0x1079;
CONST UOBJ_SPINED_HIDES := 0x107A;
CONST UOBJ_BARBED_HIDES := 0x107B;
CONST UOBJ_HORNED_HIDES := 0x107C;
Normally I would not have different cut leather types, if you are familiar with my style of crafting, but this is a beginner's guide after all. So we will keep this simple, and fully functional for the beginners out there.
Making hides cuttable
Now we will add the new hides to the scissors.cfg file in "/pkg/skills/tailoring/scissors.cfg". This will be very simple. Just need to add each item, with the "newitem" entry being the "cut hide" version we made in the itemdesc.cfg of the tailoring package.
Below is the list you will be making to the scissors.cfg file:
Code: Select all
scissors 0x107A
{
Name spined hide
material 1
newitem 0x1068
}
Item 0x107B
{
Name barbed hide
material 1
newitem 0x1069
}
scissors 0x107C
{
Name horned hide
material 1
newitem 0x106A
}
Making Hides And Leather Obtainable
In this chapter we will see how to add our new hides and leathers to the actual npcs! So get your favorite script editor and find the "/config/npcdesc.cfg" file. Cuz there be lizardmen needin killed!
Allrighty then! Now, let's use the lizardmen as our example on how to add our new hides to npcs. Remember, this is based off the 095 Distro, which is different for carving corpses than previous versions. So, on to the npc template!
Code: Select all
NpcTemplate lizardman1
{
Name
script killPCs
ObjType 0x21
Color 0
TrueColor 0
Gender 0
STR 120
INT 60
DEX 105
HITS 450
MANA 60
STAM 95
Tactics 80
Wrestling 70
MagicResistance 60
AttackSpeed 30
AttackDamage 4d4
AttackAttribute Wrestling
AttackHitSound 0x1A4
AttackMissSound 0x239
deathsound 0x1a6
damagedsound 0x1a5
idlesound1 0x1a2
idlesound2 0x1a3
AR 14
lootgroup 3
alignment neutral
provoke 50
dstart 10
corpseitm rawribs hides eyeofnewt
corpseamt 1 12 1
CProp Karma i-7
CProp Fame i7
CProp Equipt sbackpack
AttackHitScript :combat:wrestlingHitScript
OpensDoors 1
}
Once you have made your adjustments, the 2 lines should look like this:
Code: Select all
corpseitm rawribs spinedhides eyeofnewt
corpseamt 1 12 1
Making Hides And Leather Useable
In this chapter we will do what it is you are reading this for. Next we will change our Tailoring package to be able to use these new hides! Since different shards want different things, we will only concentrate on a couple things in this chapter. We will see how make them targetable for tailoring and how to make them require different skill levels for each hide type. We will wait till the next chapter to discuss color changes, name changes, and armor rating changes.
First thing's first. This will require editing only 1 file at this point. Let's open "/pkg/skills/tailoring/makeClothItems.src" in our script editor. Now let's go to about line 68. The code you are looking for is below:
Code: Select all
elseif((obj_type == 0x1078) || (obj_type == 0x1079) || (obj_type == 0x1067))
MakeLeatherItems(who, use_on, sewing_kit);
Code: Select all
elseif(((obj_type >= HIDE_START) && (obj_type <= HIDE_STOP)) || ((obj_type >= LEATHER_START) && (obj_type <= LEATHER_STOP)))
MakeLeatherItems(who, use_on, sewing_kit);
Now, let's get down to the business of making them require some skill to be useable. This is just as easy, even for a beginner. First we will make a new function just for this. Inside this function, we will use a case() on the objtype of the leathers. Each objtype listed in the case will set a variable. This variable, will be what the minimum required skill to use the hide is. Then we can just check the player's skill against that variable, to decide if they can use it. Let's return 0 for not able to use it, and 1, if they are able. That way we can do a simple check in the main leather crafting function. Once you are done with the new function, it should look something like this:
Code: Select all
function CheckSkillForLeather(who, objtype)
var reqSkill := 0;
var mySkill := GetAttribute(who, ATTRIBUTEID_TAILORING);
print("My Skill: "+mySkill);
case(objtype)
UOBJ_LEATHER: mySkill := 0;
UOBJ_SPINED_LEATHER: mySkill := 30;
UOBJ_HORNED_LEATHER: mySkill := 60;
UOBJ_BARBED_LEATHER: mySkill := 90;
UOBJ_HIDES_1: mySkill := 0;
UOBJ_HIDES_2: mySkill := 0;
UOBJ_SPINED_HIDES: mySkill := 30;
UOBJ_HORNED_HIDES: mySkill := 60;
UOBJ_BARBED_HIDES: mySkill := 90;
default: return 0;
endcase
if(mySkill >= reqSkill)
return 1;
else
return 0;
endif
endfunction
Code: Select all
SetObjProperty(who, "LastTailorItem", objtype);Code: Select all
if(!CheckSkillForLeather(who, cloth.objtype))
SendSysMessage(who, "You are not skilled enough to use that kind of leather!");
return;
endif
We will do the nitty gritty in this chapter. Giving your new items the same color as your hides, the name as part of their own, and even custom AR rating based on the hide they used to make it!
Ok, here we go again. Open up your makeClothItems.src file again in your editor. This part will be fun, becuase it makes your new stuff so much more appealing to the players. The first thing we will do, is create a Case() to handle the hides. In it, we will set certain things, like color, a name string, and ar rating, based on the hides. The case will look similar to your one to check the skills. Each type will be listed. Ok, go back to your leather function, like in the last chapter. Once you get to it, find the line "var itemname := leather_cfg[objtype]."name";". After that, add the following code:
Code: Select all
var hideColor := cloth.color;
var hideARMod := 0;
case(cloth.objtype)
UOBJ_LEATHER: itemname := itemname; hideARMod := 0;
UOBJ_HIDES_1: itemname := itemname; hideARMod := 0;
UOBJ_HIDES_2: itemname := itemname; hideARMod := 0;
UOBJ_SPINED_LEATHER: itemname := "spined " + itemname; hideARMod := 2;
UOBJ_SPINED_HIDES: itemname := "spined " + itemname; hideARMod := 2;
UOBJ_HORNED_LEATHER: itemname := "horned " + itemname; hideARMod := 3;
UOBJ_HORNED_HIDES: itemname := "horned " + itemname; hideARMod := 3;
UOBJ_BARBED_LEATHER: itemname := "barbed " + itemname; hideARMod := 5;
UOBJ_BARBED_HIDES: itemname := "barbed " + itemname; hideARMod := 5;
endcase
Next, find the 2 lines below.
Code: Select all
rint := RandomInt(100);
if(modpts >= rint)
Code: Select all
theitem.color := hideColor;
Code: Select all
theitem.ar_mod := CInt((hideARMod)+(RandomInt(4)));
I suggest playing around with the hideARMod settings, till you find values you like. Hopefully this helps you in adding even more hides to your system. Good luck, and have fun!