- Joined
- Apr 3, 2013
- Messages
- 476
- Reaction score
- 204
Due i Worte it here http://forum.ragezone.com/f792/help-request-adding-attachments-guns-1111783/ and Didnt Found Any Tuto For this Im Writing now a Quick One : )
Find in WarZ.sln or WarZ_Server.sln
This is the Fully Code
At the End add ur New Recipe NOTE : Always add the New Recipe at the End Of the Code
Now it Should looks like this
After this Build ur WarZ.sln and WarZ_server.sln
Then Go in ur ItemsDB.xml
and Search for Item itemID="301397"
There u Should see
After this Code add Ur Recipe
The Fully Line for all Craftings
then u need to Add them in ur Lang Pack
Simple Search for
There u Should see
After this add ur Recipe
Then Do RsBuild and Restart ur Server and use Ingame /gi 309901 Then u get ur Recipe
No need to add them in SQL
To make it Buyable in ur Marked
Go in Ur SQL an Open Items_Generic Create a New Line and make Sure It Looks like This
Find in WarZ.sln or WarZ_Server.sln
Code:
[COLOR=#666666]bool CraftRecipeConfig::loadBaseFromXml(pugi::xml_node& xmlItem){[/COLOR]
This is the Fully Code
Code:
bool CraftRecipeConfig::loadBaseFromXml(pugi::xml_node& xmlItem){
ModelItemConfig::loadBaseFromXml(xmlItem);
// hard coded for now
switch(m_itemID)
{
case 301340: // bandage
{
components[numComponents++] = CraftComponent(301331, 1); // rag
components[numComponents++] = CraftComponent(301366, 1); // ointment
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101405;
}
break;
case 301341: // silencer
{
components[numComponents++] = CraftComponent(301320, 1); // empty plastic bottle
components[numComponents++] = CraftComponent(301331, 3); // rag
components[numComponents++] = CraftComponent(301319, 2); // duct tape
craftedItemID = 400159;
}
break;
case 301342: // canoe paddle
{
components[numComponents++] = CraftComponent(101344, 1); // canoe paddle
components[numComponents++] = CraftComponent(101267, 5); // knife
components[numComponents++] = CraftComponent(301319, 5); // duct tape
craftedItemID = 101401; // canoe paddle with knife
}
break;
case 301343: // police baton
{
components[numComponents++] = CraftComponent(101389, 1); // police baton
components[numComponents++] = CraftComponent(301332, 1); // razer wire
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101406;
}
break;
case 301344: // gas mask
{
components[numComponents++] = CraftComponent(301331, 1); // rag
components[numComponents++] = CraftComponent(101299, 1); // water
components[numComponents++] = CraftComponent(301357, 1); // charcoal
components[numComponents++] = CraftComponent(301370, 2); // rope
craftedItemID = 20206;
}
break;
case 301345: // shiv
{
components[numComponents++] = CraftComponent(301335, 1); // scissors
components[numComponents++] = CraftComponent(301331, 1); // rag
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101402;
}
break;
case 301346: // spear
{
components[numComponents++] = CraftComponent(301355, 1); // broom
components[numComponents++] = CraftComponent(101267, 1); // knife
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101407;
}
break;
case 301347: // shrapnel bomb
{
components[numComponents++] = CraftComponent(301318, 1); // empty can
components[numComponents++] = CraftComponent(301327, 3); // metal scrap
components[numComponents++] = CraftComponent(301324, 2); // gunpowder
craftedItemID = 101403;
}
break;
case 301348: // trip wire shrapnel bomb
{
components[numComponents++] = CraftComponent(301318, 1); // empty can
components[numComponents++] = CraftComponent(301327, 3); // metal scrap
components[numComponents++] = CraftComponent(301324, 2); // gunpowder
components[numComponents++] = CraftComponent(301370, 1); // rope
components[numComponents++] = CraftComponent(301328, 1); // nails
craftedItemID = 101404;
}
break;
case 301389: // wooden door block
{
components[numComponents++] = CraftComponent(301388, 50); // wood
craftedItemID = 101352;
}
break;
case 301390: // metal wall
{
components[numComponents++] = CraftComponent(301386, 50); // metal
craftedItemID = 101353;
}
break;
case 301391: // brick wall
{
components[numComponents++] = CraftComponent(301387, 50); // stone
craftedItemID = 101354;
}
break;
case 301392: // wood wall
{
components[numComponents++] = CraftComponent(301388, 25); // wood
craftedItemID = 101355;
}
break;
case 301393: // short brick wall
{
components[numComponents++] = CraftComponent(301387, 25); // stone
craftedItemID = 101356;
}
break;
case 301394: // farm
{
components[numComponents++] = CraftComponent(301387, 100); // stone
components[numComponents++] = CraftComponent(301386, 50); // metal
components[numComponents++] = CraftComponent(301388, 100); // wood
craftedItemID = 101357;
}
break;
case 301395: // solar water
{
components[numComponents++] = CraftComponent(301387, 100); // stone
components[numComponents++] = CraftComponent(301386, 100); // metal
components[numComponents++] = CraftComponent(301388, 100); // wood
craftedItemID = 101360;
}
break;
case 301396: // light
{
components[numComponents++] = CraftComponent(301387, 50); // stone
components[numComponents++] = CraftComponent(301386, 50); // metal
components[numComponents++] = CraftComponent(301388, 25); // wood
craftedItemID = 101361;
}
break;
case 301397: // small power
{
components[numComponents++] = CraftComponent(301387, 75); // stone
components[numComponents++] = CraftComponent(301386, 50); // metal
components[numComponents++] = CraftComponent(301388, 75); // wood
craftedItemID = 101359;
}
break;
case 301398: // big power
{
components[numComponents++] = CraftComponent(301387, 150); // stone
components[numComponents++] = CraftComponent(301386, 100); // metal
components[numComponents++] = CraftComponent(301388, 150); // wood
craftedItemID = 101358;
}
break;
default:
r3d_assert(false && "Unsupported craft recipe!!!");
break;
}
At the End add ur New Recipe NOTE : Always add the New Recipe at the End Of the Code
Code:
[COLOR=#ff0000] case 309901: // M4 To M4Semi // NEW RECIPE[/COLOR]
[COLOR=#ff0000] { [/COLOR]
[COLOR=#ff0000] components[numComponents++] = CraftComponent(101055, 1); [/COLOR][COLOR=#FF0000] //101055=ID of the Needed item 1=How Much u need for it[/COLOR]
[COLOR=#ff0000] craftedItemID = 101040; // 101040 Item U get[/COLOR]
[COLOR=#ff0000] }[/COLOR]
[COLOR=#ff0000] break;
[/COLOR]
Now it Should looks like this
Code:
bool CraftRecipeConfig::loadBaseFromXml(pugi::xml_node& xmlItem){
ModelItemConfig::loadBaseFromXml(xmlItem);
// hard coded for now
switch(m_itemID)
{
case 301340: // bandage
{
components[numComponents++] = CraftComponent(301331, 1); // rag
components[numComponents++] = CraftComponent(301366, 1); // ointment
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101405;
}
break;
case 301341: // silencer
{
components[numComponents++] = CraftComponent(301320, 1); // empty plastic bottle
components[numComponents++] = CraftComponent(301331, 3); // rag
components[numComponents++] = CraftComponent(301319, 2); // duct tape
craftedItemID = 400159;
}
break;
case 301342: // canoe paddle
{
components[numComponents++] = CraftComponent(101344, 1); // canoe paddle
components[numComponents++] = CraftComponent(101267, 5); // knife
components[numComponents++] = CraftComponent(301319, 5); // duct tape
craftedItemID = 101401; // canoe paddle with knife
}
break;
case 301343: // police baton
{
components[numComponents++] = CraftComponent(101389, 1); // police baton
components[numComponents++] = CraftComponent(301332, 1); // razer wire
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101406;
}
break;
case 301344: // gas mask
{
components[numComponents++] = CraftComponent(301331, 1); // rag
components[numComponents++] = CraftComponent(101299, 1); // water
components[numComponents++] = CraftComponent(301357, 1); // charcoal
components[numComponents++] = CraftComponent(301370, 2); // rope
craftedItemID = 20206;
}
break;
case 301345: // shiv
{
components[numComponents++] = CraftComponent(301335, 1); // scissors
components[numComponents++] = CraftComponent(301331, 1); // rag
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101402;
}
break;
case 301346: // spear
{
components[numComponents++] = CraftComponent(301355, 1); // broom
components[numComponents++] = CraftComponent(101267, 1); // knife
components[numComponents++] = CraftComponent(301319, 1); // duct tape
craftedItemID = 101407;
}
break;
case 301347: // shrapnel bomb
{
components[numComponents++] = CraftComponent(301318, 1); // empty can
components[numComponents++] = CraftComponent(301327, 3); // metal scrap
components[numComponents++] = CraftComponent(301324, 2); // gunpowder
craftedItemID = 101403;
}
break;
case 301348: // trip wire shrapnel bomb
{
components[numComponents++] = CraftComponent(301318, 1); // empty can
components[numComponents++] = CraftComponent(301327, 3); // metal scrap
components[numComponents++] = CraftComponent(301324, 2); // gunpowder
components[numComponents++] = CraftComponent(301370, 1); // rope
components[numComponents++] = CraftComponent(301328, 1); // nails
craftedItemID = 101404;
}
break;
case 301389: // wooden door block
{
components[numComponents++] = CraftComponent(301388, 50); // wood
craftedItemID = 101352;
}
break;
case 301390: // metal wall
{
components[numComponents++] = CraftComponent(301386, 50); // metal
craftedItemID = 101353;
}
break;
case 301391: // brick wall
{
components[numComponents++] = CraftComponent(301387, 50); // stone
craftedItemID = 101354;
}
break;
case 301392: // wood wall
{
components[numComponents++] = CraftComponent(301388, 25); // wood
craftedItemID = 101355;
}
break;
case 301393: // short brick wall
{
components[numComponents++] = CraftComponent(301387, 25); // stone
craftedItemID = 101356;
}
break;
case 301394: // farm
{
components[numComponents++] = CraftComponent(301387, 100); // stone
components[numComponents++] = CraftComponent(301386, 50); // metal
components[numComponents++] = CraftComponent(301388, 100); // wood
craftedItemID = 101357;
}
break;
case 301395: // solar water
{
components[numComponents++] = CraftComponent(301387, 100); // stone
components[numComponents++] = CraftComponent(301386, 100); // metal
components[numComponents++] = CraftComponent(301388, 100); // wood
craftedItemID = 101360;
}
break;
case 301396: // light
{
components[numComponents++] = CraftComponent(301387, 50); // stone
components[numComponents++] = CraftComponent(301386, 50); // metal
components[numComponents++] = CraftComponent(301388, 25); // wood
craftedItemID = 101361;
}
break;
case 301397: // small power
{
components[numComponents++] = CraftComponent(301387, 75); // stone
components[numComponents++] = CraftComponent(301386, 50); // metal
components[numComponents++] = CraftComponent(301388, 75); // wood
craftedItemID = 101359;
}
break;
case 301398: // big power
{
components[numComponents++] = CraftComponent(301387, 150); // stone
components[numComponents++] = CraftComponent(301386, 100); // metal
components[numComponents++] = CraftComponent(301388, 150); // wood
craftedItemID = 101358;
}
break;
[COLOR=#ff0000] case 309901: // M4 To M4Semi // NEW RECIPE[/COLOR]
[COLOR=#ff0000] {[/COLOR]
[COLOR=#ff0000] components[numComponents++] = CraftComponent(101055, 1); // M4[/COLOR]
[COLOR=#ff0000] craftedItemID = 101040;[/COLOR]
[COLOR=#ff0000] }[/COLOR]
[COLOR=#ff0000] break;[/COLOR]
default:
r3d_assert(false && "Unsupported craft recipe!!!");
break;
}
After this Build ur WarZ.sln and WarZ_server.sln
Then Go in ur ItemsDB.xml
and Search for Item itemID="301397"
There u Should see
Code:
<Item itemID="301397" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Small Power Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301398" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Big power recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
After this Code add Ur Recipe
Code:
[COLOR=#FF0000]<Item itemID="309901" category="51" Weight="0">[/COLOR]
[COLOR=#FF0000] <Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />[/COLOR]
[COLOR=#FF0000] <Store name="M4 To M4Semi" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />[/COLOR]
[COLOR=#FF0000] </Item>[/COLOR]
The Fully Line for all Craftings
Code:
<CraftRecipeArmory>
<Item itemID="301340" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Bandage Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301341" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Silencer Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301342" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Canoe Paddle with Knives recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301343" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Police Baton w barbed wire recip" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301344" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Gas Mask Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301345" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Shiv Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301346" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Spear Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301347" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Shrapnel Bomb Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301348" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="TripWire Shrapnel Bomb recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301389" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Wooden Door Block Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301390" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Metal Wall Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301391" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Brick Wall Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301392" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Wood Wall Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301393" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Short Brick Wall Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301394" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Farm Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301395" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Solar Water Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301396" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Light Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301397" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Small Power Recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
<Item itemID="301398" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="Big power recipe" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>
[COLOR=#ff0000] <Item itemID="309901" category="51" Weight="0">
<Model file="Data/ObjectsDepot/Weapons/Craft_Recipe_01.sco" />
<Store name="M4 To M4Semi" icon="$Data/Weapons/StoreIcons/Craft_Recipe_01.dds" desc="" LevelRequired="0" />
</Item>[/COLOR]
</CraftRecipeArmory>
then u need to Add them in ur Lang Pack
Simple Search for
Code:
301398
There u Should see
Code:
301398_Name
301398_Desc
After this add ur Recipe
Code:
309901_name=Recipe To Change ur M4 to a M4 Semi
309901_desc=Recipe To Change ur M4 to a M4 Semi
Then Do RsBuild and Restart ur Server and use Ingame /gi 309901 Then u get ur Recipe
No need to add them in SQL
To make it Buyable in ur Marked
Go in Ur SQL an Open Items_Generic Create a New Line and make Sure It Looks like This
Last edited: