This guide goes through creating your very own custom item and blueprint crafting flow.
ALCS comes stock ready with three Raw Materials for you to use.
Now this is enough to set up some basic crafting recipes if you want to create more advanced and specific recipes you'll need to create your own.
To do this you'll first want to navigate towos/advswl/crafting/items/raw_materials.lua
Once in here, you'll want to add another raw material let's add this one.
wOS:RegisterItem( {
Name = "Kyber Crystal Fragment",
Description = "A crystal fragment seeming with energy from the force",
Type = WOSTYPE.RAWMATERIAL,
Rarity = 5,
Model = "models/white/white.mdl",
} )
Now let's explain each property here.
Now that we have our Raw Materials setup let's create our blueprint.
wos/advswl/crafting/items
folder, you'll want to create a .lua file for your blueprint.
Let us create a blueprint_crystal.lua
file.
In this file, we're gonna place the following code.
local ITEM = {}
ITEM.Rarity = 10
ITEM.Name = "Kyber Crystal"
ITEM.Description = "The force within can be refined into something powerful."
ITEM.Type = WOSTYPE.BLUEPRINT
ITEM.UserGroups = false
ITEM.BurnOnUse = true
ITEM.Model = "models/gangwars/crafting/blup.mdl"
ITEM.RarityName = "Epic"
ITEM.RarityColor = Color( 175, 175, 0 )
ITEM.Ingredients = {
[ "Kyber Crystal Fragment" ] = 10,
}
ITEM.Result = "Kyber Crystal"
ITEM.OnCrafted = function( ply )
ply:AddSkillXP( 100 )
end
wOS:RegisterItem( ITEM )
Now lets again explain each property here: Let's start with the ones that are the same as before
Now that we have our blueprint set up it's time to set up our item.
This starts the same as the last section by creating another item file.
We'll call this one crystal_kyber.lua
and we'll place the following code inside.
local ITEM = {}
ITEM.Rarity = 100
--The name of the item ( is also an identifier for spawning the item )
ITEM.Name = "Kyber Crystal"
--The description that appears with the item name
ITEM.Description = "A crystal seeming with energy from the force"
--The category it belongs to
ITEM.Type = WOSTYPE.CRYSTAL
--Add user groups that are allowed to use this tree. If anyone is allowed, set this to FALSE ( TREE.UserGroups = false )
ITEM.UserGroups = false
--Does this item disappear from the inventory after it's been applied?
ITEM.BurnOnUse = false
--The model of the item on the floor / inventory
ITEM.Model = "models/white/white.mdl"
--The chance for the item to appear randomly. 0 = will not spawn, 100 = incredibly high chance
ITEM.Rarity = 20
ITEM.DismantleParts = {
[ "Kyber Crystal Fragment" ] = 8,
}
ITEM.OnEquip = function( wep )
wep.UseColor = Color( 255, 255, 255 )
wep.SaberDamage = wep.SaberDamage + 10
end
wOS:RegisterItem( ITEM )
Now let's go through the new properties in this file.
Now that the items are all setup they will appear in your normal spawn pools and you can craft them via the crafting machine.