Skip to content
Ciprian edited this page Aug 7, 2020 · 5 revisions
  • Incrememnt NUMITEMS in items.hpp and add your items to the end of the ItemType list.

  • Add item to the end of items.txt and give it appropriate settings:

<index -- i.e. 3D model ID> 
<fpindex -- i.e. first person 3D model ID>
<number of variations -- should equal the number of models it can alternate between as well as the number of images you specify>
<item category>
<weight>
<value>
<image 1>
<image 2>
...
<image n where n = number of variations>
  • Add the item usage func in item_usage_funcs.cpp if applicable (e.g. potions, scrolls), and declare these functions in items.hpp.

  • If it's a thrown item, add it to actthrown.cpp in actThrown(), search for POTION_ACID and that's the code block you'll want to modify.

  • Add the item's names to lang/en.txt...the first line of every pair is the identified name, the second line is the unidentified name. Update init.cpp as wlel and add a new block in loadLanguageChar() if your new entries don't fit into one of the old item name sections:


	// update item internal language entries.
	for ( int c = 0; c < NUMITEMS; ++c )
	{
		if ( c > SPELLBOOK_DETECT_FOOD )
		{
			int newItems = c - SPELLBOOK_DETECT_FOOD - 1;
			items[c].name_identified = language[3500 + newItems * 2];
			items[c].name_unidentified = language[3501 + newItems * 2];
		}
		else if ( c > ARTIFACT_BOW )
		{
			int newItems = c - ARTIFACT_BOW - 1;
			items[c].name_identified = language[2200 + newItems * 2];
			items[c].name_unidentified = language[2201 + newItems * 2];
		}
		else
		{
			items[c].name_identified = language[1545 + c * 2];
			items[c].name_unidentified = language[1546 + c * 2];
		}
	}
Clone this wiki locally