Witcher Wiki

This user "Pangaearocks" prefers to use the enhanced profile.

To do?[ | ]

  • Update crafting details for items (monster drop, disassembled from, needed for)
  • Double-check and update item stats where needed (damage, effects, item ID) -> In progress
  • Look over Witcher Wiki:Manual of style for improvements and missing details
  • Try to figure out how stats on weapons truly work. Queried here -> DONE
    • In the XMLs, pretty much no items (except Witcher gear) has data on damage/armor and required levels.
    • Effects, however, is listed, so they are stable and independent of item level (but often with some random spread)
  • Update item pages -> In progress
  • Monsters: Is it feasible (or possible even) to include more data on them, such as:
    • damage
    • health (essence)
    • resistances
  • Complete item name --> item ID mapping -> DONE
  • Minor stuff
    • Check Manticore gear later. Lacking effects probably (spell power, etc.)
    • Arbitrator? Crafted? Items maybe switched around name-wise
    • Blade from the Bits Hattori version (quest)
    • Normal crossbows
    • Hatchet
    • Iron poker
    • Wild Hunt warrior sword - enhanced etc.

Useful links[ | ]

Sandboxes[ | ]


  • DPL: Trophies test
  • DPL2: Witcher gear, more advanced syntax test
  • Ranged weapons: Test out table format for tricky multi-infobox pages
  • Bulk DPL sandbox: List some plain fields for overview purposes

Notes for item updates[ | ]

  • Weight formula for regular items: return 0.01 + GetItemWeight( item ) * GetItemQuantity( item ) * 0.5;
  • inventoryComponent.ws: function GetItemEncumbrance (...)
  • inventoryComponent.ws: function GenerateItemLevel (...)
  • inventoryComponent.ws: event OnItemAdded (...)
  • inventoryComponent.ws: public function AddRandomEnhancementToItem (...)
  • gameParams.ws: public function GetItemLevel (...)
    • //modSigns: notes
    • //weapon level is determined by BASE damage value and armor level is determined by BASE armor reduction value
    • //bonuses with type="add" don't affect weapon level
    • Thread with hopefully correct information: CDPR Forum: the math behind combat
  • gameParams.ws: private function InitArmorAbilities (...) and similarly named functions
  • inventoryComponent.ws: public function GetMerchantPriceModifier (...) - Price info, maybe useful to check out
    • finalPriceMult = areaPriceMult*itemPriceMult*importPriceMult*priceMult;

Item data calculation[ | ]

  • Probably the 7 stats in function GetItemLevel: SlashingDamage, BludgeoningDamage, RendingDamage, ElementalDamage, FireDamage, SilverDamage, PiercingDamage
  • Armor: stat_min = 25, stat_add = 5
  • Boots: stat_min = 5, stat_add = 2
  • Gloves: stat_min = 1, stat_add = 2
  • Pants: stat_min = 5, stat_add = 2
  • Silver sword: stat_min = 90, stat_add = 10
  • Steel sword: stat_min = 25, stat_add = 8

This whole puzzle is very confusing when looking at the code, but some things seem clear:

  • Items have a base + increase/per level up. But both have random spread.
    • Steel swords: 20-25 base + 7-8/level
    • Silver swords: 80-90 base + 8-10/level
  • That is for equipment with various Autogen tags, which are roughly autogenerated at the player's level.
  • Crafted equipment is different. They have a set level (as per the recipe in-game), and have more defined properties in XML
  • Apparently the level is set based on the item's damage/armor value -- which sounds totally backwards, but okay.
→ It's a start, albeit confusing, and makes it hard to put this info in a sensible fashion into the wiki, given all the fluid factors and random spread.
  • Looks like relic gear get a "free" level, while witcher gear gets two. It's messy code in similar functions in different files, however, so hard to get a good grip on all the permutations. But this fits better with what I'm seeing on items in-game, such as "Short sword 1" and "Angivare" (which have Autogen tag).
if ( quality == 5 ) lvl += 2; 
if ( quality == 4 ) lvl += 1;
if ( (quality == 5 || quality == 4) && ItemHasTag(item, 'EP1') ) lvl += 1;

My intention with trying to understand how this is done in the code was to get a table or examples on each item page, with for example that item's stats at level 1, 10, 20, 30. However, that is not that straightforward due to all the uncertain stats. Could perhaps calculate e.g. damage values based on an average, and/or have a min + max value with extremes. Not ideal, but it may be better than currently. If nothing else, it would give us a bit more content on the item pages.

In any case, the item data should be updated to try to get to the bottom of all this. Think it would make sense to add the item tags to the infobox. They may come in handy later, especially the various autogen tags.

function GetItemEncumbrance[ | ]

var itemCategory : name;
if ( IsItemEncumbranceItem( item ) )
{
	itemCategory = GetItemCategory( item );
	if ( itemCategory == 'quest' || itemCategory == 'key' )
	{
		return 0.01 * GetItemQuantity( item );
	}
	else if ( itemCategory == 'usable' || itemCategory == 'upgrade' || itemCategory == 'junk' )
	{
		return 0.01 + GetItemWeight( item ) * GetItemQuantity( item ) * 0.2;
	}
	else if ( IsItemAlchemyItem( item ) || IsItemIngredient( item ) || IsItemFood( item ) || IsItemReadable( item ) )
	{
		return 0.0;
	}
	else
	{
		return 0.01 + GetItemWeight( item ) * GetItemQuantity( item ) * 0.5;
	}
}
return 0;


function AddRandomEnhancementToItem[ | ]

This is part of the function, so check the whole thing.

if ( itemCategory == 'armor' )
{
	switch ( itemQuality )
	{
		case 2 : 
			ability = 'quality_masterwork_armor'; 			
			AddItemCraftedAbility(item, theGame.params.GetRandomMasterworkArmorAbility(), true);
			break;
		case 3 : 
			ability = 'quality_magical_armor'; 	
			if ( ItemHasTag(item, 'EP1') )
			{
				AddItemCraftedAbility(item, theGame.params.GetRandomMagicalArmorAbility(), true);
				break;
			}
			
			if ( RandF() > 0.5 )
				AddItemCraftedAbility(item, theGame.params.GetRandomMagicalArmorAbility(), true);
			else
				AddItemCraftedAbility(item, theGame.params.GetRandomMasterworkArmorAbility(), true);
			
			if ( RandF() > 0.5 )
				AddItemCraftedAbility(item, theGame.params.GetRandomMagicalArmorAbility(), true);
			else
				AddItemCraftedAbility(item, theGame.params.GetRandomMasterworkArmorAbility(), true);
			break;
		default : break;
	}
}

I think this means that:

  • Masterwork items get 1 random masterwork ability
  • Magical EP1 items get 1 random magical ability
  • All Magical items (including EP1) get two abilities
    • minimum 2 masterwork abilities, or
    • maximum 2 magical abilities, or
    • one of each

→→ How to put this into the wiki in a sensible fashion?

Bugs[ | ]

  • dismember_chance: This does nothing, and is on a handful of items. It's supposed to be dismember_chance_mult