Potions and recipes

Greetings!
In this tutorial I will teach you to add new potions and recipes to the game. Mostly we will work in text editor, so don't open REDkit until I say.

Open Witcher 2\data\items and find there def_item_potion.xml. Open the file. Here you can find all the potions from the original game. Lets create one more potion. Your item has to be described after opening <items> tag. Here is what I've done:

<item name="Fake Death" category="elixir" ability_slots="0" stackable = "true"  template="alch_pot_07" equip_slot="" hold_slot="">
<tags>SortTypePotion,TypeMagic,Elixir</tags>
<base_abilities>
<a>Fake Death _Stats</a>
<a>Price_10</a>
<a>Weight_02</a>
</base_abilities>
</item>


item name - the name of string variable that will contain the name of our potion. Whatever you type here, you won't see this in game, you will only use this identifier in the REDkit.

category - a category of the inventory, where the item will be placed in.

ability_slots - ???

stackable - if true - all potions will be placed in one slot of your inventory, if false - each potion will have its own slot.

template - used template (???)

equip_slot - is used for items that can be equipped.

hold_slot - ???

tags - tags for your item, that will be seen under its name (Elixir, Quest item, etc.)

base_abilities - properties of your item.

There are three packs of properties. The first one is standart. The second and the third one, I believe, are available after learning some skills from the alchemy tree. I think so because they have prerequisites="alchemy_s7" and prerequisites="alchemy_s7_2". As long as I'm not sure, we will use only the first pack. So write "Fake Death _Stats" there.

Price_10 - a variable that contain the value of an item (10 orens in our case)
Weight_02 - a variable that contain the weight of an item (0.2 in our case)

Now lets describe what how our potion will actually affect the player character. Open def_stats_item_potion.xml.

Here is what I have there:

<ability name="Fake Death _Stats">
<res_bleed display_perc="true" mult="false" always_random="false" min="0.3" max="0.3" type="bonus"/>
<res_burn display_perc="true" mult="false" always_random="false" min="0.3" max="0.3" type="bonus"/>
<res_poison display_perc="true" mult="false" always_random="false" min="0.3" max="0.3" type="bonus"/>
<tox_level mult="false" always_random="false" min="25" max="25" type="bonus"/>
<durration mult="false" always_random="false" min="600" max="600" type="bonus"/>
</ability>


res_bleed - bleeding resistance.
res_burn - burning resistance.
res_poison - poisoning resistance.

display_perc - is this displayed (true) or not (false).

tox_level - toxicity level.
durration - self-explanatory.

always random - if true, the bonus to resistance will be chosen randomly from the interval from min to max each time you drink the potion. If false - the bonus will be chosen only one time. Our interval equalls number 0.3, so bonus will be static during the entire game.

There are a lot of different bonuses given by potion. You can look for them in the def_stats_item_potion.xml file. Here are some of them:

endurance_combat_regen - regeneration of healthpoints during combat.
damage_min - minimal damage, caused by player character.
damage_max - maximal damage, caused by player character.
damage_reduction - reduction of damage to the plater character.
signs_power - power of witcher Signs.
crt_poison - chance of poisoning critical effect.
crt_bleed - chance of bleeding critical effect.
crt_burn - chance of burning critical effect.

Now it's time to create a recipe for our potion.
Open def_item_recipes.xml. You'll see all the original recipes there.
Lets create a new one. Here is what I got:

<item name="Recipe Fake Death" category="schematic" ability_slots="0" stackable = "true" template="" equip_slot="" hold_slot="">

    <tags>SortTypeRecipe,SortTypeSchematic,Recipe,TypeMagic</tags>

    <base_abilities>

    <a>Price_50</a>

    <a>Weight_01</a>

    </base_abilities>

    <ingredients_list crafted_item="Fake Death">

    <ingredient quantity="1">Vitriol</ingredient>

    <ingredient quantity="1">Aether</ingredient>

    <ingredient quantity="1">Vermilion</ingredient>

    <ingredient quantity="1">Fulgur</ingredient>

    </ingredients_list>

    </item>


First two strings do the same that in the case of potion.

Price_50 - a variable that contain the value of an item (50 orens in our case)
Weight_01 - a variable that contain the weight of an item (0.1 in our case)

<ingredients_list crafted_item="Fake Death"> - write the name of producted item (potion) inside the quotation marks.

Next thing we see is a list of ingredients player will need to make a potion.

<ingredient quantity="1">...</ingredient> - write the number of selected ingredient inside the quotation marks; the name of ingredient goes instead of ellipsis.

All existing alchemy ingredients are listed at the beginning of this file:

  1. Vitriol (V)
  2. Rebis (R)
  3. Caelum (C)
  4. Aether (A)
  5. Quebrith (Q)
  6. Sol (S)
  7. Vermilion (E)
  8. Hydragenum (H)
  9. Fulgur (F)

Now we have the recipe.
Open the REDkit. Open Strings DB Editor.

Image

Go to Find\Modify String tab.
Now we will wrire a name and description if potion and recipe, that player will see in the game.

1 - write the name of your potion (the same we wrote in item_name) - Fake Death
2 - choose the category of string - String key

Press Find button.
At the bottom of Strings Editor window you'll see a red text: String key: 'Fake Death' doesn't exist, New string will be created.

Image

Now in the String Value field write the name of your potion that will be displayed in the game. Press Add string.

Do the same operation to make a description:

1 - write the name of your potion with "Tooltip" prefix - TooltipFake_Death
2 - choose the category of string - String key

Проделываем те же операции, добавляя строку с такими параметрами:

1 - пишем название нашего предмета и префиксом "Tooltip" - TooltipFake_Death
2 - выбираем тип строки - String key

In the String Value field write the description of your potion.

Potion is described. Now you can describe the recipe by yourself. Do exactly the same things: Recipe Fake Death (name of recipe) and TooltipRecipe Fake Death (description).

The end.