Trouble with drained attributes after disease

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Trouble with drained attributes after disease

Post by Hazelnut »

Interkarma wrote: Sat Dec 07, 2019 12:39 am Just hit me up on git or dev forums if there's anything I can do to help.
Thanks for the classic save. Is there an easy way to apply a drain effect on the player in DFU, or could you provide me a save for that. I've not used magic much.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Trouble with drained attributes after disease

Post by Interkarma »

Create an area at range drain spell and blast it at the ground or a wall in front of you so that you're caught in the AOE radius. That classic save has one in the spellbook if you import character.

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

Re: Trouble with drained attributes after disease

Post by Hazelnut »

Thanks. Currently checking for drain incumbents like this:

Code: Select all

            // Check for free stat restoration (Temple members)
            if (guild.FreeHealing())
            {
                EntityEffectManager playerEffects = playerEntity.EntityBehaviour.GetComponent<EntityEffectManager>();
                if (playerEffects != null)
                {
                    IEntityEffect drainEffect = playerEffects.FindIncumbentEffect<DrainEffect>();
                    if (drainEffect != null)
                    {
                        DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, DaggerfallMessageBox.CommonMessageBoxButtons.YesNo, 403, uiManager.TopWindow);
                        messageBox.OnButtonClick += ConfirmStatReset_OnButtonClick;
                        messageBox.Show();
                    }
                }
            }
is that the best way?

Then planning to do this to reset the stats:

Code: Select all

            if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes)
            {
                EntityEffectManager playerEffects = playerEntity.EntityBehaviour.GetComponent<EntityEffectManager>();
                playerEffects.EndIncumbentEffect<DrainEffect>();
            }
Again, please shout if I am doing this wrong.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Trouble with drained attributes after disease

Post by Interkarma »

That's good! Should just mention that player will have one drain effect per attribute drained, so there might be several active.

I'd create a helper similar to CureAllDiseases() in EnityEffectManager that can end all drain incumbents in a single call.

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

Re: Trouble with drained attributes after disease

Post by Hazelnut »

Okay will do that then.

I tried importing the save from classic. Breaks. Maybe cos this character is a hacked one. Not sure.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Trouble with drained attributes after disease

Post by Interkarma »

Odd, that save imports just fine for me. Not sure either.

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

Re: Trouble with drained attributes after disease

Post by Hazelnut »

Well it was easy enough to create a save to test in DFU once you told me what the spell was and how to self harm with it. :)

Unfortunately removing the incumbent drain effects doesn't restore the stats, or the removal is not working. Sorry to do this, but have submitted a PR for you to check/fix because I don't know where to go from here and I need to go rest my arm now. I've at least done the bit that I consider my area of expertise - guild services.

https://github.com/Interkarma/daggerfal ... /pull/1637
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Trouble with drained attributes after disease

Post by Interkarma »

I can see where I've lead you astray here, my apologies. I'll send a fix to that PR when I can. We can continue discussion there.

fuzzydodge
Posts: 6
Joined: Wed Dec 04, 2019 9:09 am
Location: Germany

Re: Trouble with drained attributes after disease

Post by fuzzydodge »

hello again
my character is now curate rep:89 with Tempel of Kynareth , but there is no offer of everyone in the temple to restore
attributes, but at this time my char has no drained attributes, do they only offer repair if my attributes are damaged?
iam still watching from time to time NOT to get a desease ..but thats pretty shity... :) and kill gameflow and fun.
If there is realy no chance to repiar damaged attributes Daggerfall coud get bad frustating. I will go testing on
and if so .. hope for a fix :) .
Perhaps someone else could go on testing this attribute thing.
..and thank you all :) :)

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Trouble with drained attributes after disease

Post by Interkarma »

Attribute recovery is available from 0.10.14, provided character is of rank to qualify and has current attribute damage. This is accessed through the "cure disease" service as normal, but won't trigger offer unless attributes are damaged.

If you still have troubles under those conditions, please post a save. This is a recent addition and bugs are always possible.

Outside of temples, you can also use the spellmaker to create spells which recover attribute damage.

Post Reply