The Witcher 3

/!\ The same manual can be found in mod folder: modPotatoItemCheats/manual.html. And it looks better. But it may be not updated, because I won't reupload file if there is some minor edit. But this manual here may not be updated too, because nexus article rich text editor sucks.

Installation
Copy "modPotatoItemCheats" folder into "The Witcher 3/mods/".
For instance, if game is installed in "D:\Games\SteamLibrary\steamapps\common\The Witcher 3\", then mod folder should be copied to this location: "D:\Games\SteamLibrary\steamapps\common\The Witcher 3\mods\modPotatoItemCheats"
Installation video: https://youtu.be/jxPYSUNUTdE
If you have any other mods, make sure they don't change the same files (conflict). If they do, resolve conflicts by merging mods using Script Merger from https://www.nexusmods.com/witcher3/mods/484

How to turn on console
Find "The Witcher 3\bin\config\base\general.ini" file. Just in case, make a backup copy of it. Open it as text file, in Notepad or Notepad++ or something like that. Add new line at the end and paste DBGConsoleOn=true into it. Save file. To access the console menu press the tilde "~" button in game. More details at https://steamcommunity.com/sharedfiles/filedetails/?id=816897535 .

Abilities
Item stats are defined by abilities. Here are some abilities, you might see on common "Novigrad longsword":
- 'Default weapon _Stats'
- 'Novigraadan sword 1 _Stats'
- 'autogen_steel_base'
- 'autogen_steel_dmg' x5 (few abilities with the same name on one item)
Stats of each ability can be found in XML files, extracted (uncooked) from "The Witcher 3\content\content0\bundles\xml.bundle" and other bundles located in "The Witcher 3\DLC".
<!-- Uncooked\gameplay\items\def_item_weapons.xml
This base ability is added to every weapon -->

<ability name="Default weapon _Stats"></ability>

<!-- Uncooked\gameplay\items\def_item_weapons.xml
Main base ability of this specific sword type -->

<ability name="Novigraadan sword 1 _Stats">
    <weight type="base" min="4.7"/>
    <quality type="add" min="1" max="3"/>
    <SilverDamage type="base" min="1"/>
</ability>

<!-- Uncooked\gameplay\items\def_item_weapons_relic_autogen.xml
Crafted ability, which is added once to every sword which can be generated with any level -->

<ability name="autogen_steel_base">
    <SlashingDamage min="20" max="25"/>
</ability>

<!-- Uncooked\gameplay\items\def_item_weapons_relic_autogen.xml
Crafted ability, which is added multiple times to every sword which can be generated with any level. -->

<ability name="autogen_steel_dmg">
    <SlashingDamage min="7" max="8"/>
</ability>


'autogen_steel_dmg' is added to steel weapons multiple times to increase their damage, and level. There are "base" and "crafted" abilities. The only difference I noticed, "base" abilities are listed before "crafted". And you have to use different commands to add/remove "base" and "crafted" abilities. Current witcher scripts do not provide a way to know, if ability on item is "base" or "crafted". If you want to delete some ability, first try "crafted", then "base" command.

Whatever you see inside <ability>: "weight", "quality", "SilverDamage" - these are attributes. Each attribute has value "type", "min" value and "max" value. There are 3 types of attribute "type": "base", "mult" and "add". If not specified, attribute is considered "base" by default. Final attribute value is calculated like this: result = base * mult + add. Example:
Player has "400-base" damage from sword, some buffs give him "1.5-mult" (+50%) attack power, and Geralt's hidden stats add "80-add" attack power.
Final average damage is going to be 400 * 1.5 + 80 = 680.
But it is up to code, how to use these attributes. Some code does not take "base" and "add" into account, and uses only "mult" - spell_power, for instance.

Attributes of each type, and of each ability are combined individually. Example:
<ability name="whatever1">
    <attack_power type="base" min="10" max="20.0"/>
    <attack_power type="mult" min="0.5" max="1.5"/>
    <attack_power type="add" min="15" max="30"/>
</ability>
<ability name="whatever2">
    <attack_power type="base" min="5" max="14"/>
    <attack_power type="mult" min="0.25" max="1.75"/>
    <attack_power type="add" min="9" max="21"/>
</ability>
<!-- Both these abilities combined will look like this: -->
<attack_power type="base"
    min="15"
<!-- 10 (whatever1 base min) + 5 (whatever2 base min) -->
    max="34"
<!-- 20 (whatever1 base max) + 14 (whatever2 base max) -->
/>
<attack_power type="mult"
    min="0.75"
<!-- 0.5 (whatever1 mult min) + 0.25 (whatever2 mult min) -->
    max="3.25"
<!-- 1.5 (whatever1 mult max) + 1.75 (whatever2 mult max) -->
/>
<attack_power type="add"
    min="24"
<!-- 15 (whatever1 add min) + 9 (whatever2 add min) -->
    max="51"
<!-- 30 (whatever1 add max) + 21 (whatever2 add max) -->
/>


Random Stats Quality (RSQ)
Each item has this property. There is no known official name for this thing, witcher scripts (*.ws) do not have any functions which could allow to modify or read this property, it is not even mentioned in scripts. RSQ is a floating point value, ranging from 0 to 1. RSQ is used to calculate actual attribute value, between "min" and "max". RSQ affects all item attributes at once. If RSQ is 0, then all random item stats are going to be minimum. If RSQ is 1, then all random item stats
are going to be maximum. If RSQ is 0.5, then all random item stats are going to be average. Potato Item Cheats calculates RSQ by combining all attributes of all abilities, and then comparing result of GetItemAttributeValue function with possible minimum and maximum attribute values.
Example. Let's say, your sword has only 'autogen_steel_dmg' abilities (<SlashingDamage min="7" max="8"/>). 10 of them. Combined, these 10 abilities would look like <SlashingDamage min="70" max="80"/>.
If RSQ of a sword is 0, then average sword damage is going to be 70.
If RSQ is 1, then damage is going to be 80.
If RSQ is 0.671925, then damage is going to be MIN + (MAX - MIN) * RSQ = 70 + 10 * 0.671925 = 76.71925 which is going to be displayed as 77 in tooltips. Because tooltips display rounded values, but W3DamageManagerProcessor, which calculates damage during fights, will be using 76.71925.

Command PIC_ShowItemNames( show : bool )
Turns on/off item names display in inventory tooltips. It does the same thing as original game command ShowItemNames( show : bool ), but only in inventory tooltips, instead of multiple places. You can turn on/off item names with this command like this:
PIC_ShowItemNames(true)
PIC_ShowItemNames(false)
PIC_ShowItemNames(1)
PIC_ShowItemNames(0)


Command PIC_ShowAbilities( show : bool )
Turns on/off item abilities display in inventory tooltips. Use like this:
PIC_ShowAbilities(1)
PIC_ShowAbilities(0)


Command PIC_ShowRandomStats( show : bool )
Turns on/off display of ability attributes with random values (where "min" is not equal to "max") in inventory tooltips. Use like this:
PIC_ShowRandomStats(1)
PIC_ShowRandomStats(0)

Works only for weapons, armor parts and crossbows. Ability attributes, which are not random, are not displayed, most of the time you can literally see their values in original user interface (UI). Once you have seen enough 'autogen_...' abilities, you can remove them from tooltips, by going to "modPotatoItemCheats\content\scripts\mods\potatoItemCheats.ws" → find function GetRandomItemStatsStr and there...
// Change this
if ( printedAbilities.Contains(abs[i])
/*|| StrStartsWith( abilityNameStr, "autogen" ) || StrStartsWith( abilityNameStr, "Default" )*/)
    continue;
// to this
if ( printedAbilities.Contains(abs[i]) || StrStartsWith( abilityNameStr, "autogen" )
/*|| StrStartsWith( abilityNameStr, "Default" )*/)
    continue;


For editing witcher scripts, I recommend to use Notepad++ with selected C# language (Menu → Language → C → C#). Witcher Script Studio would have been perfect, because it shows hints, but it takes some effort to install and make it work (I'm not going into these details in this manual).

Command PIC_ShowRSQ( show : bool )
Turns on/off display of item's random stats quality (RSQ). Works only for weapons, armor parts and crossbows. Does not show RSQ, if item currently has no abilities with random stats. Use like this:
PIC_ShowRSQ(1)
PIC_ShowRSQ(0)


Command PIC_ShowTags( show : bool )
Turns on/off display of item's tags. Use like this:
PIC_ShowTags(1)
PIC_ShowTags(0)


Command PIC_ShowAll( show : bool )
Turns on/off PIC_ShowItemNames, PIC_ShowAbilities, PIC_ShowRandomStats, PIC_ShowRSQ, PIC_ShowTags all at once. Use like this:
PIC_ShowAll(1)
PIC_ShowAll(0)

You can also go to "modPotatoItemCheats\content\scripts\mods\potatoItemCheats.ws", open it as text file in Notepad++ (or whatever) and change what function does by commenting lines with // single line comments or /* multiple line comments */
exec function PIC_ShowAll( show : bool )
{
    
/* PIC().ShowItemNames( show );
    PIC().ShowRandomStats( show ); */

    PIC().ShowRSQ( show );
    PIC().ShowAbilities( show );
    
// PIC().ShowTags( show );
}


In the same potatoItemCheats.ws you can also change default values, so the things you want to see right after the start of the game, will be
displayed:
public var showRandomStats : bool;
default showRandomStats = false;
public var showRSQ : bool;
default showRSQ = true;
public var showAbilities : bool;
default showAbilities = false;
public var showItemNames : bool;
default showItemNames = true;
public var showTags : bool;
default showTags = false;
public var showAvgDmg : bool;
default showAvgDmg = true;

If you want to reorder PIC sections in tooltips, you can do that in "modPotatoItemCheats\content\scripts\game\gui\_old\components\guiTooltipComponent.ws" → find:
if ( PIC().showTags )
    uniqueDescription = PIC().GetTagsStr(itemInvComponent, item) + "<br>" + uniqueDescription;
if ( PIC().showAbilities )
    uniqueDescription = PIC().GetItemAbilitiesStr(itemInvComponent, item) + "<br>" + uniqueDescription;
if ( PIC().showRandomStats && isArmorOrWeapon && categoryName != 'bolt' )
    uniqueDescription = PIC().GetRandomItemStatsStr(itemInvComponent, item) + "<br>" + uniqueDescription;
if ( PIC().showRSQ && isArmorOrWeapon && categoryName != 'bolt' )
    uniqueDescription = PIC().GetRandomItemStatsQualityStr(itemInvComponent, item) + "<br>" + uniqueDescription;
if ( PIC().showItemNames || theGame.GetGuiManager().GetShowItemNames() )
    uniqueDescription = "<font color=\"#FFDB00\">Item name: '" + itemName + "'</font><br>" + uniqueDescription;


Command PIC_ShowAvgDmg( show : bool )
Changes how weapon damage is displayed in tooltips. If turned on, instead of "90-110 damage" range, it will display average "100 damage" as regular (not main) stat. Use like this:
PIC_ShowAvgDmg(1)
PIC_ShowAvgDmg(0)

Also changes how armor stat is displayed, and removes damage range for crossbows, but I decided to not bother. It's more compact like that.

Command PIC_AddCraftedAbl( ability : name, optional count : int )
Adds crafted ability to item selected in inventory. Can add few same abilities at once. Before using this command, I recommend to turn on PIC_ShowAbilities(1). Select any sword you like, and try this:
PIC_AddCraftedAbl('MA_FreezingChance')
// or this
PIC_AddCraftedAbl('MA_FreezingChance', 2)

You should be able to see changes immediately after moving mouse cursor away from item, then back onto it.
Abilities work as long as they have their definitions in XML files. If you load a save, where item has some abilities, which do not have definitions anymore, then this ability won't work, until you restore its definition. Let's say, if you added to item ability 'PIC_Precision_1' from this mod, and then uninstalled Potato Item Cheats, then 'PIC_Precision_1' (+1% chance for instant kill) won't work. All abilities, which are available without mods, will continue to work as usual even in unmodded game.
Try to not add tens of thousands of abilities to single item. You can, but game will start lagging. PIC_AddCraftedAbl('PIC_AttackPowerMult_10000', 10)is good. PIC_AddCraftedAbl('PIC_AttackPowerMult_100', 1000) is not good.
This mod fixes unused 'MA_Precision' ability (+1..+2% chance for instant kill), so it actually works, instead of just being displayed in tooltip. And adds a lot of other abilities, so you can create item with almost any stats. You can see them in "modPotatoItemCheats/extras/abilities/def_item_upgrades.xml". These
additional abilities all start with "PIC_". This is not an actual config used by the game, this is file I have extracted from "modPotatoItemCheats\content\blob0.bundle", so you don't have to extract it yourself. Make sure to take a look into other files in "extras/abilities", to see what else you can use.

Command PIC_RemoveCraftedAbl( ability : name, optional count : int )
Removes crafted ability from item selected in inventory. Can remove few same abilities at once. Turn on PIC_ShowAbilities(1), pick any ability from list and try something like this:
PIC_RemoveCraftedAbl('autogen_steel_dmg')
PIC_RemoveCraftedAbl('autogen_steel_dmg', 2)

If this command does not work, then ability is "base" and you need command PIC_RemoveBaseAbl

Command PIC_AddBaseAbl( ability : name )
Adds 1 base ability to item selected in inventory.

Command PIC_RemoveBaseAbl( ability : name )
Removes 1 base ability from item selected in inventory.

Command PIC_AddItem( itemName : name, optional count : int )
This is the same console command, as original additem(itemName : name, optional count : int, optional equip : bool), except it immediately updates inventory, so you don't have to reopen inventory. Examples:
PIC_AddItem('EP1 Standalone Starting Armor')
PIC_AddItem('Poison Apple', 20)


Command PIC_AddSelectedItem( optional count : int )
Same console command and PIC_AddItem but lets you copy name from currently selected item. Select any item in inventory and use:
PIC_AddSelectedItem()
PIC_AddSelectedItem(20)

It may happen that after some operation, inventory may not update properly. If that happens - just reopen it.

Command PIC_AddItemQ(itemName : name, quality : float, attempts : int, maxDiff : float, silent : bool )
This command allows to add item with specific random stats quality (RSQ). Parameters:
- itemName - same thing you would use with additem or PIC_AddItem.
- quality - number from 0.0 to 1.0; this is desired item's RSQ.
- attempts - because RSQ cannot be set upon creation of item, or modified later, this mod takes this number of attempts, to generate item with desired RSQ.
- maxDiff - if during some attempt, latest item's RSQ differs from desired RSQ less than by maxDiff, then this command stops trying to generate new items and gives this latest item to player.
- silent - if set false (0), then command will display ok-dialog with info about how did item addition go; you may want to know if there were errors; if set true (1), dialog is not displayed.
Before using this command, I recommend to turn on PIC_ShowRSQ(1) and PIC_ShowRandomStats(1). Few examples:
/* "Nilfgaardian sword 3". This steel sword has random "quality 1-3" and thus can be common-grey, master-blue or magic-yellow.
These commands generate 3 swords with 3 different qualities: */

PIC_AddItemQ('Nilfgaardian sword 3', 0, 100, 0.01, 0)
PIC_AddItemQ('Nilfgaardian sword 3', 0.5, 100, 0.01, 0)
PIC_AddItemQ('Nilfgaardian sword 3', 1, 100, 0.01, 0)

/* "Zerrikanterment". This item's main ability has such definition: */
<ability name="Zerrikanterment_Stats">
    <weight                            type="base"    min="3.4"                />
    <quality                        type="add"    min="4"        max="4"        />
    <SlashingDamage                 type="base"    min="1"                    />
    <spell_power_aard                type="mult"    min="0.05"    max="0.15"    />
    <spell_power_axii                type="mult"    min="0.05"    max="0.15"    />
    <spell_power_quen                type="mult"    min="0.05"    max="0.15"    />
    <desc_bleedingchance_mult        type="add"    min="0.1"                />
    <buff_apply_chance                type="add"    min="0.1"                />
    <BleedingEffect                    is_ability="true"                    />
</ability>

/* You can use original game command "additem" few times and see that every time Aard, Axii and Quen Sign intensities are always the same: */
additem('Zerrikanterment')
// or this command:
PIC_AddItem('Zerrikanterment')

// Then, try these commands with RSQ:
PIC_AddItemQ('Zerrikanterment', 0, 100, 0.01, 1)
PIC_AddItemQ('Zerrikanterment', 0.5, 100, 0.01, 1)
PIC_AddItemQ('Zerrikanterment', 1, 100, 0.01, 1)


If you want to get item with more precise RSQ, then you can increase attempts to 1000 and set maxDiff to 0.001 or even 0.

Command PIC_AddSelectedItemQ( quality : float, attempts : int, maxDiff : float, silent : bool )
Same as PIC_AddItemQ but copies item name from currently selected item in inventory. Select any weapon/armor with random stats in inventory and try it like this:
PIC_AddSelectedItemQ(0, 100, 0.01, 1)
PIC_AddSelectedItemQ(1, 100, 0.01, 1)


Command PIC_RemoveSelectedItem( optional quantity : int )
Removes selected item from inventory. If item is stackable, can remove many at once. Use like this:
PIC_RemoveSelectedItem
PIC_RemoveSelectedItem(10)

Before removing equipped items, unequip them first. It is possible to implement "if equipped, then unequip and remove" logic, but I did not figure out easy way to do that. Also needed to take into account, that items are not allowed to be unequipped during combat. So decided to not bother, because too much effort for now.

Command PIC_SetDurability( durability : float )
Sets durability of currently selected item in inventory. 0 is 0%, broken. Needed to quickly break many items, that's why this command exists. 1 is 100%, fully repaired. 0.5 is 50%. You can also set -1 or 3, but that does not make much sense. Examples:
PIC_SetDurability(0)
PIC_SetDurability(1)


Command PIC_SetAmmo( ammo : int )
Sets ammo of currently selected item in inventory. Use can use this with potions/bombs like this:
PIC_SetAmmo(20)

Command PIC_AddTag( tag : name )
Adds tag to selected item. Turn on PIC_ShowTags(1) first. Then try this on any potion or bomb:
PIC_AddTag('InfiniteAmmo')
Note: modified tags reset to their default values after save reload. This is how original game works, and I think it can't be changed.
This command has special logic for tag 'InfiniteAmmo' - when tag is added, it sets item's ammo to -1, so it is easier to distinguish from other non-infinite items.

Command PIC_RemoveTag( tag : name )
Removes tag from selected item. Turn on PIC_ShowTags(1). Pick any item with tags and then try something like his:
PIC_RemoveTag('Edibles')
This command has special logic for tag 'InfiniteAmmo' - when tag is removed, it sets maximum item's ammo.

Command PIC_Enchant( chant : name )
Enchants selected weapon or armor. Even boots. Also, allows to add few enchantments at once to the same item. It is possible to have few enchantments on the same item in original game with the use of PIC_AddBaseAbl. But original game displays only one enchantment in item's tooltip. So PotatoItemCheats also modifies item tooltips, so they can show all enchantments. Use like this:
PIC_Enchant('Runeword 1') /* Replenishment: After you cast a Sign, an Adrenaline Point is consumed
 and your next sword attack is charged with the power of that Sign. */

PIC_Enchant('Runeword 2')
/* Severance: Increases the range of Whirl by 1.1 yards and Rend by 1.9 yards. */
/* Enchantment 'Runeword 3' does not do anything and has no description.
 There are other enchantments like this too. So you will see "missing" numbers later in the list - it's OK. */

PIC_Enchant('Runeword 4')
/* Invigoration: When at maximum vitality,
 any Vitality regeneration turns into added damage (up to +50%) on your next strike. */

PIC_Enchant('Runeword 5')
/* Preservation: Armorer's Table and Grindstone bonuses never expire. */
PIC_Enchant('Runeword 6')
/* Dumplings: Any food consumed regenerates 400% more vitality, but everything tastes like pierogis. */
PIC_Enchant('Runeword 8')
/* Placation: Once they reach their maximum level, Adrenaline Points steadily decline until they reach 0.
 During this time Vitality and Stamina regeneration are accelerated and Toxicity declines more quickly. */

PIC_Enchant('Runeword 10')
/* Rejuvenation: Each fatal blow dealt restores 100% of your stamina. */
PIC_Enchant('Runeword 11')
/* Prolongation: Each unblocked blow increases potion duration time by 1s. */
PIC_Enchant('Runeword 12')
/* Elation: Fatal blows dealt with your sword generate 1 Adrenaline Point. */
PIC_Enchant('Glyphword 1')
/* Deflection: Armor deflects all arrows. */
PIC_Enchant('Glyphword 2')
/* Levity: All equipped armor items are treated as Light Armor. */
PIC_Enchant('Glyphword 3')
/* Balance: All equipped armor items are treated as Medium Armor. */
PIC_Enchant('Glyphword 4')
/* Heft: All equipped armor items are treated as Heavy Armor. */
PIC_Enchant('Glyphword 5')
/* Retribution. 30% chance to return damage back to attacker. */
PIC_Enchant('Glyphword 6')
/* Depletion: Hitting enemies with Aard reduces their Stamina by 100%. */
PIC_Enchant('Glyphword 7')
/* Rotation: Igni's basic attack strikes all enemies in 360-degree radius. */
PIC_Enchant('Glyphword 10')
/* Usurpation: When an enemy affected by Axii dies, the effect transfers to the nearest target. */
PIC_Enchant('Glyphword 12')
/* Ignition: Enemies set alight with Igni have a 100% chance to ignite other enemies within a 2 yard radius. */
PIC_Enchant('Glyphword 14')
/* Beguilement: Enemies affected by Axii will be affected for 2s longer for each blow they land. */
PIC_Enchant('Glyphword 15')
/* Entanglement: When a trap set by Yrden hits an enemy, an Yrden glyph is placed at that position. */
PIC_Enchant('Glyphword 17')
/* Protection: When you enter combat, there's a 100% chance
 you will automatically get a quen shield without using any Stamina. */

PIC_Enchant('Glyphword 18')
/* Possession: When an opponent influenced by Axii dies, the effect transfers to a nearby target.
 The effect's duration increases by 2 seconds for each blow the affected target lands. */

PIC_Enchant('Glyphword 20')
/* Eruption: Foes set alight by Igni explode when they die and ignite nearby foes. */

PotatoItemCheats uses "whitelist" of supported enchantments. So if you have some mod, which adds new enchantments, you may want to support these new enchantments by adding them to function AbilityToEnchantment.

Command PIC_Unenchant( optional ec : name )
Removes all enchantments from selected item. If name of enchantment is specified - removes only that one enchantment. Use like this:
PIC_Unenchant
PIC_Unenchant('Glyphword 6')


Command PIC_AddSlot()
Adds upgrade slot to selected weapon or armor. Adds slots as long as unmodifiable game code allows to. Use like this:
PIC_AddSlot

Command PIC_SetItemModifierInt( n : name, v : int )
Sets int modifier of selected item. Currently, only mutagenerator ('q705_tissue_extractor') uses the only int modifier 'charges'. Use like this:
PIC_SetItemModifierInt('charges', 50)

Command PIC_SetItemModifierFloat( n : name, v : float )
Sets float modifier of selected item. Currently, only Aerondight ('Aerondight EP2') uses the only float modifier 'PermDamageBoost'. Use like this:
PIC_SetItemModifierFloat('PermDamageBoost', 99.9)

Command PIC_AddMoney( v : int )
Adds money to the inventory of currently selected item. Meaning, if item in your inventory is selected - adds money to you. If item in shop is selected - adds money to shop. Use like this:
PIC_AddMoney(100)

Command PIC_RemoveMoney( v : int )
Removes money from the inventory of currently selected item.
PIC_RemoveMoney(100)

Command PIC_ExtractUpgrades()
Extracts upgrades from selected item, while keeping both item and upgrades intact. Use like this:
PIC_ExtractUpgrades

Command PIC_RemoveOil()
Removes oil from selected sword. Use like this:
PIC_RemoveOil

Command PIC_DeleteLoot( range : float )
Deletes bags and guts, dropped from enemies in specified range (meters) around player. Command does not touch loot with quest items. Use like this:
PIC_DeleteLoot(1)
PIC_DeleteLoot(5)

I recommend to use short ranges so you can immediately see that only loot you wanted to disappear disappears.
Made this command because I did not want to bother picking up and dragging around all those random common swords, axes and clubs. But can't just leave all these things lying around.

Command PIC_EmptyLoot( range : float )
Same as PIC_DeleteLoot but empties every container in range. Does touch loot with quest items, but can delete witcher gear diagrams from containers. Because witcher gear diagrams are not tagged as "quest" items. Use carefully. Examples:
PIC_EmptyLoot(1)
PIC_EmptyLoot(5)


Command PIC_ShowPlayerAbls( optional onlyInteresting : bool )
Displays "book" popup with player ability names. This is useful, when you are using original game commands addabl and rmvabl. Also lets you know if you ate a 'mq7023_cake' or not. Or maybe you can notice, that your abilities currently are not what they are supposed to be, and fix it. If "onlyInteresting" is set to true, does not list abilities from levels, oils, and mutagens. Use like this:
PIC_ShowPlayerAbls(0)
PIC_ShowPlayerAbls(1)

You can change what is "interesting" in potatoItemCheats.ws function IsInterestingPlayerAbility.

Command PIC_AddCustomBuiltSword()
Purpose of this command is to show how to make a command (function, macro, whatever) which executes multiple commands at once and adds customized Witcher's Steel Sword (from Hearts of Stone) to player's inventory with the following stats:
Steel damage: depending on player's level
+5% freezing chance
+5% stun chance
+5% burning chance
+5% stagger chance
+2% chance for instant kill
Quality: witcher gear
Runewords: replenishment, rejuvenation, prolongation.

See its code in "modPotatoItemCheats/content/scripts/mods/potatoItemCheats.ws":
exec function PIC_AddCustomBuiltSword()
{
    var item : SItemUniqueId;
    var pic : CModPotatoItemCheats = PIC();
    var inv : CInventoryComponent = thePlayer.inv;
    
    item = pic.AddItemQ('EP1 Standalone Starting Steel Sword', 1.0, 100, 0.01, 1);
    inv.RemoveItemBaseAbility( item, 'EP1 Standalone Starting Steel Sword _Stats' );
    pic.AddItemCraftedAbility( inv, item, 'autogen_fixed_steel_base' );
    pic.AddItemCraftedAbility( inv, item, 'autogen_fixed_steel_dmg', GetWitcherPlayer().GetLevel() );
    pic.AddItemCraftedAbility( inv, item, 'MA_FreezingChance' );
    pic.AddItemCraftedAbility( inv, item, 'MA_ConfusionChance' );
    pic.AddItemCraftedAbility( inv, item, 'MA_BurningChance' );
    pic.AddItemCraftedAbility( inv, item, 'MA_StaggerChance' );
    pic.AddItemCraftedAbility( inv, item, 'MA_Precision' );
    pic.AddItemCraftedAbility( inv, item, 'SetItem _Stats' );
    inv.EnchantItem( item, 'Runeword 1', getEnchamtmentStatName( 'Runeword 1' ) );
    inv.EnchantItem( item, 'Runeword 10', getEnchamtmentStatName( 'Runeword 10' ) );
    inv.EnchantItem( item, 'Runeword 12', getEnchamtmentStatName( 'Runeword 12' ) );
    if (pic.m_invMenuRef)
    {
        pic.m_invMenuRef.InventoryUpdateItem( item );
        pic.m_invMenuRef.UpdateEncumbranceInfo();
    }
}


Canon item quality enhancements
Items with blue/master and yellow/magic quality, upon creation receive 1-2 random enhancements. In code it can be found in "The Witcher
3\content\content0\scripts\game\components\inventoryComponent.ws":
event OnItemAdded(data : SItemChangedData)
{
    // ...
    AddRandomEnhancementToItem(data.ids[i]);
    // ...
}

public function AddRandomEnhancementToItem(item : SItemUniqueId)


https://witcher.fandom.com/wiki/Terms_and_definitions#Effect_of_tier_on_items
https://witcher.fandom.com/wiki/Item_effect

Steel and silver weapons receive the same enhancements:
Master (blue):
- 'MA_ArmorPenetration' - armor piercing 10-40
- 'MA_CriticalChance' - critical hit chance 1-4%
- 'MA_CriticalDamage' - critical hit damage 1-10%
- 'MA_BleedingChance' - chance to cause bleeding 1-5%
Magic (yellow):
("Magic" item can be enhanced with any "Master" enhancement, this is true for armor pieces too)
- 'MA_AdrenalineGain' - adrenaline point gain 1-5%
- 'MA_AardIntensity' - aard sign intensity 1-5%
- 'MA_IgniIntensity' - igni sign intensity 1-5%
- 'MA_QuenIntensity' - quen sign intensity 1-5%
- 'MA_YrdenIntensity' - yrden sign intensity 1-5%
- 'MA_AxiiIntensity' - axii sign intensity 1-5%
- 'MA_PoisonChance' - chance to poison 1-5%

For armor pieces it's like this:


(nexus does not support tables)
There is an exception for DLC items with 'EP1' tag. These magic-quality items use the same theGame.params.GetRandomMagicalArmorAbility() (everything from armor column), even if item is boots or a sword. I think this is copypaste mistake. Also, these items receive only 1 enhancement instead of 2.

Unusual damage types
"PIC_" abilities allow you to add unusual damage types to your weapons. Like ShockDamage and FrostDamage. Most of these damage types, when on swords, won't work in original game. But it can be fixed by copying "The Witcher 3\content\content0\scripts\game\player\playerWitcher.ws" to modPotatoItemCheats folder and modifying function GetTotalWeaponDamage:
var damage, durRatio, durMod, itemMod : float;
var repairObjectBonus, min, max : SAbilityAttributeValue;

durMod = 0;
// Change 0 to 1
damage = super.GetTotalWeaponDamage(weaponId, damageTypeName, crossbowId);


Curse of 65536 items
If, from the very start of the game, Geralt pick up 65536 different items, which don't stack with each other - your inventory becomes cursed and starts working funny and improperly. This happens because item IDs are saved as 16-bit unsigned integers and are not "reordered" on overflow. Once "new item IDs" stop fitting into 16 bits, these IDs are being truncated to 16-bits and they start "colliding" with already existing items. Unfortunately, I do not know any way to lift this curse.You can read a bit more about the curse there.
The workaround for PIC_AddItemQ is to create a temporary bag, the same which drops from enemies, and generate hundreds of items inside of it. Adding new items to bag does not increase item IDs in main Geralt's inventory. So after item with desired RSQ is generated, bag can "give" item to Geralt and then bag is deleted.
Unfortunately, the only way to know how far your savegame is from becoming permanently cursed is to look at new item IDs in Witcher Script Studio's debug, in "scripts/game/components/inventoryComponent.ws" in event OnItemAdded. Because scripts do not provide any option to print variables of type "Uint32" or even to convert them to something printable.
For most players, the curse does not happen before they have finished all quests. But here are few tips, how item IDs work in OG v4.04, so you can avoid the curse:
- taking any item which appears as distinct new item in your inventory increases "new item ID"
- dropping same sword/armor on ground or into stash, and then taking it back increases "new item ID"
- all those common swords, clubs and axes from enemy loot increase "new item ID"
- taking item (let's say, potatoes), which stacks with the item in your inventory, without creating new stack, does not increase "new item ID". Avoid depleting stacks, avoid creation of new stacks.
- unequipping and equipping crossbow generates new "default bolts" each time, and increases "new item ID"

Article information

Added on

Edited on

Written by

iCat42

0 comments