Possible difference from classic for magic item prices

Moderators will move topics here from Help & Support once an issue has been confirmed and enough information provided to reproduce.
Post Reply
User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Possible difference from classic for magic item prices

Post by Hazelnut »

I've had a report that some armor was selling for a very low price and after investigating there may be an issue with DFU's implementation of magic item costs. Unfortunately I've not been able to confirm it with some testing in classic. It definitely looks like something is not quite right though.

The report I got was of some ebony greaves of shocking that has a value of 380 gold in DFU. Seems quite low considering non-magic that armor is worth 25k+ gold. Found an Amber of shocking for sale at a MG and that was also worth 380 gold. Looked at the cost calculation code that Allofich wrote from reverse engineering classic and it sets value of the item to just the value of the spells on it, completely ignoring the item value as it sets value to 0, add's each spell value and then overwrites the original item value. I wonder if that setting value to zero could be a mistake or hangover from testing.

Code: Select all

            // Set the value of the item. This is determined by the enchantment point cost/spell-casting cost
            // of the enchantments on the item.
            int value = 0;
            for (int i = 0; i < magicItem.enchantments.Length; ++i)
            {
                if (magicItem.enchantments[i].type != EnchantmentTypes.None
                    && magicItem.enchantments[i].type < EnchantmentTypes.ItemDeteriorates)
                {
                    switch (magicItem.enchantments[i].type)
                    {
                        case EnchantmentTypes.CastWhenUsed:
                        case EnchantmentTypes.CastWhenHeld:
                        case EnchantmentTypes.CastWhenStrikes:
                            // Enchantments that cast a spell. The parameter is the spell index in SPELLS.STD.
                            value += Formulas.FormulaHelper.GetSpellEnchantPtCost(magicItem.enchantments[i].param);
                            break;
                        case EnchantmentTypes.RepairsObjects:
                        ...etc..
                    }
                }
            }

            newItem.value = value;
As you can see only enchantments are part of the value. Tried testing this in classic and found two armor pieces with same enchantments and they appear to be different costs but this could be for some other reason as you can see here:
MIselling.JPG
MIselling.JPG (141.73 KiB) Viewed 4280 times

Unfortunately I didn't get lucky enough to get any high level materials that would have been more helpful. Maybe Daggerfall always had bargain high level armor sold by MG with some low level enchantments? I don't know, but I wanted to raise it because 380 gold just seemed so low for a high level armor piece that this player though it was bugged, and it does seem incorrect to me but then I didn't play classic beyond the beginning so I would not know. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Possible difference from classic for magic item prices

Post by chtujo »

I'm not able to help much, but if you're in need of some characters with high level items the UESP has some good vanilla saves on the Daggerfall:Files page.

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Possible difference from classic for magic item prices

Post by chtujo »

OK, I went ahead and tested with one of the saves on the UESP and it does seem to match classic behaviour. Armor also sells for less when echanted.
deadric 1.png
deadric 1.png (75.53 KiB) Viewed 3870 times
daedric 2.png
daedric 2.png (63.29 KiB) Viewed 3870 times

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Possible difference from classic for magic item prices

Post by chtujo »

Hazelnut wrote: Sun Jan 16, 2022 11:33 pm
Although this is classic behaviour, IMHO increasing prices could be considered a bug fix, and I think it would be a good idea to do so.

Post Reply