Page 1 of 1

creating a specific potion item and ingredients

Posted: Sat Feb 08, 2020 10:23 am
by haloterm
Time for another stupid question:

How do I create a specific type of potion, for example a potion of levitation?

Which class and subclass would that be?

I can't find any reference to potions in the item class/subclass table linked at viewtopic.php?f=25&t=606.

If that's not possible, I can instead create items for the ingredients the players would need to brew that potion, but giving the potion itself would be easier.

Re: creating a specific potion item and ingredients

Posted: Sun Feb 09, 2020 8:16 am
by haloterm
Hm, seems I can't create ingredients either.

When I use the following commands

Item _BHCIngred1_ item class 18 subclass 47
Item _BHCIngred2_ item class 20 subclass 58
Item _BHCIngred3_ item class 20 subclass 64
Item _BHCIngred4_ item class 22 subclass 77

in my quest, it _should_ create the ingredients needed for crafting a Potion of Cure Poison. But the quest fails to run when I include these lines.

I got the class and subclass id's from the spreadsheet here: viewtopic.php?f=25&t=606

Re: creating a specific potion item and ingredients

Posted: Sun Feb 09, 2020 3:07 pm
by Hazelnut
You can't create potions, they're glass bottles with some extra metadata applied which is not supported.

You're on the right track with the potion ingredients but you have the wrong subclass values. The first one the 47 should be 1, because this is the enum index of ItemEnums.CreatureIngredients2 and it's the second element of that enum. (first is 0)

The value you are using is the DF item template id. See https://github.com/Interkarma/daggerfal ... emEnums.cs

Re: creating a specific potion item and ingredients

Posted: Sun Feb 09, 2020 3:20 pm
by haloterm
Hazelnut wrote:
Sun Feb 09, 2020 3:07 pm
You can't create potions, they're glass bottles with some extra metadata applied which is not supported.

You're on the right track with the potion ingredients but you have the wrong subclass values. The first one the 47 should be 1, because this is the enum index of ItemEnums.CreatureIngredients2 and it's the second element of that enum. (first is 0)

The value you are using is the DF item template id. See https://github.com/Interkarma/daggerfal ... emEnums.cs
Thank you, I will try that!

Edit: Worked fine! :)

Re: creating a specific potion item and ingredients

Posted: Fri Feb 21, 2020 6:08 pm
by Hazelnut
Okay have submitted PR#1715 with this feature in addition to books, since it was easy enough to do at teh same time. Hopefully it will get into the next release of DFU. So you can now add potions as well as ingredients. You get a random potion unless you specify a key, like p2 below. If you specify a key, this is the recipe key, p1 below is a potion of stamina (heal fatigue). They can be used without being made permanent if you just want them availiable for the length of the quest, otherwise make the permanant so player can keep em.

Code: Select all

Item _p1_ potion key 221871
Item _p2_ potion

    get item _p1_
    get item _p2_
To get the recipe key values look at the log when DFU starts up, it prints out the recipes it finds and their keys. The name is the effect key that the potion recipe uses. For example the stamina potion:

Code: Select all

'Heal-Fatigue' recipe 0 [key=221871] ingredients: Ginkgo Leaves, Aloe, Pure Water.
Running with mods that contribute potions will allow you to see their keys too, although it will be shown later in the log during the mods initialisation. The Teleport potion from my guild mod:

Code: Select all

'Teleport-Potion' recipe 0 [key=4997782] ingredients: Clover, Wraith Essence, Medium Tooth, Tin.

Re: creating a specific potion item and ingredients

Posted: Fri Feb 21, 2020 6:41 pm
by haloterm
Hazelnut wrote:
Fri Feb 21, 2020 6:08 pm
Okay have submitted PR#1715 with this feature in addition to books
Thank you so much!! :D

Re: creating a specific potion item and ingredients

Posted: Sat Mar 14, 2020 6:02 pm
by Hazelnut
You're welcome, hope that progress is good now you have what you needed.