Adding Your Items To The PCONTENT Pool (Random Drops/Sellings at Vendors)

Adding Your Items To The PCONTENT Pool (Random Drops/Sellings at Vendors)

We will use the Simple Sword template, from the Creating A Simple Item - Sword tutorial, and modify it here. All items are added to pcontent the same way:

1. First we need to specify an optional type of pcontent drop under the [common] block. If you do not include this line, it defaults to dropping only "normal". It is in the form of pcontent_special_type = TYPE(S);. You can replace types with rare, unique, and/or normal. Each one seperated by a comma if you include more than one type.

2. Next we have the introduction of the new block [pcontent]. It is here you will define the randomization levels of your item.

3. Inside of the pcontent block you will need to create a [base] block.

4. Now we must specify f modifier_max = #; and f modifier_min = #;. It's hard to give a good rule of thumb for this, but do not confuse these values with the other power modifiers we used earlier in the blacksmith editing. These define more of where things drop in the game and how good of modifiers can go onto that item. You obviously replace # with two numbers, making sure min is less than or equal to max or the game will crash.

5. Your item is now in the pcontent pool once you save and recompile your mod. It will show up randomly on the types you specified at the vendors/smiths and off monsters.

6. To not leave you hanging on defining a good min/max, I have some examples.
max = 0, min = 0 will make the item drop anywhere in the game pretty much with terrible modifiers.
max = 87, min = 63 will make your item drop mainly in elite skill near the end of it in grescal or chicken level but not before that.
Anything with a min above 30 will likely not show up in regular skill at all.
Anything with a min above 50 will likely not show up in veteran skill at all.
max = 81, min = 47 is the ever famous dragon wing sword's pcontent levels.
max = 270, min = 11 is from the Noble Vesture, 113 Armor cloth body piece.
max = 9, min = 4 is from the Black Widow Helmet
max = 33, min = 9 is from serpentine scale, which drops unique only.

[t:template,n:nivisec_simple_sword]
{
	doc = "Dragon Lords Sword";
	specializes = base_sword;
	[aspect]
	{
		model = m_w_swd_055;
	}
	[attack]
	{
		f damage_max = 407;
		f damage_min = 307;
	}
	[common]
	{
		pcontent_special_type = rare, unique, normal;
		screen_name = "Steel of the Dragon Lords";
	}
	[gui]
	{
		active_icon = b_gui_ig_i_ic_swd_005;
		equip_requirements = strength:30, dexterity:45;
		inventory_height = 4;
		inventory_width = 1;
		inventory_icon = b_gui_ig_i_w_swd_088;
	}
	[pcontent]
	{
		[base]
		{
		  f modifier_max = 14.000000;
		  f modifier_min = 7.000000;
		}
	}
}
The Completed Sword Template
template 1



(the original text for this tutorial was written by Nivisec, and is published here with permission)

tutorials: