creating a specific potion item and ingredients

For all talk about quest development - creation, testing, and quest system bug diagnosis.
Post Reply
haloterm
Posts: 104
Joined: Sat Feb 16, 2019 5:21 am

creating a specific potion item and ingredients

Post by haloterm » Sat Feb 08, 2020 10:23 am

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.
Last edited by haloterm on Sun Feb 09, 2020 8:16 am, edited 1 time in total.

haloterm
Posts: 104
Joined: Sat Feb 16, 2019 5:21 am

Re: creating a specific potion item and ingredients

Post by haloterm » Sun Feb 09, 2020 8:16 am

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

User avatar
Hazelnut
Posts: 2214
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: creating a specific potion item and ingredients

Post by Hazelnut » 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
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

haloterm
Posts: 104
Joined: Sat Feb 16, 2019 5:21 am

Re: creating a specific potion item and ingredients

Post by haloterm » Sun Feb 09, 2020 3:20 pm

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! :)

User avatar
Hazelnut
Posts: 2214
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: creating a specific potion item and ingredients

Post by Hazelnut » Fri Feb 21, 2020 6:08 pm

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.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

haloterm
Posts: 104
Joined: Sat Feb 16, 2019 5:21 am

Re: creating a specific potion item and ingredients

Post by haloterm » Fri Feb 21, 2020 6:41 pm

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

User avatar
Hazelnut
Posts: 2214
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: creating a specific potion item and ingredients

Post by Hazelnut » Sat Mar 14, 2020 6:02 pm

You're welcome, hope that progress is good now you have what you needed.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply