Need script line for base ability decrease for on_death or on_respawn
ESX
Member Posts: 23
I have modded the respawn script to start me back at the starting location of the mod. The last thing I need to do is add a line that will PERMANENTLY take away 1 base constitution point FOREVER. Not an effect that a character can sleep of or get healed by magic. But make it so every time the character dies they lose 1 con point, forever.
1
Comments
I was able to do this a few years ago successfully, and now forgot what I did. There must be a way to script a line to do this and make it permanent. Maybe supernatural debuff with a permanent script line? Looking for a professional solution, not a gimik. Thanks
Perfect, now this is the line I found:
effect eBad=EffectAbilityDecrease(ABILITY_STRENGTH, 1);
eBad=SupernaturalEffect(eBad);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBad, oPC);
The last line gets an error, I am trying to put this in the standard nw_o0_respawn script.
That should compile. The only thing I can think of is to change oPC to oRespawner.
DJ-WoW
Would you be willing to share that script once it's finalized? Please and thank you!
Yes, I will test it first in a few days and post it here. I am only an amateur, so you may want to test it yourself also.
I'm not sure about that... This is part of the code I currently use for my players:
The effect is removable by scripting or by use of a Greater Restoration or Remove Curse spell. EffectAbilityDecrease() is removable with a Greater Restoration spell, even if made a supernatural effect. I think the only true permanent ability decrease would be to apply a curse as DURATION_TYPE_INSTANT, instead of DURATION_TYPE_PERMANENT. Then only special scripting would remove it. This is just based off my own observations though, so I could be wrong.
From the code pasted above, you're missing a closing curly brace for your ghApplyDeathPenalty function. Also, if ghApplyDeathPenaly is only being called from the respawn script (i.e. you're not going to use this file as an include to get to the function from other scripts), GetLastRespawnButtonPresser in your main function only returns PC objects (monsters won't be clicking a respawn button), so the check for GetIsPC is unnecessary.
EffectCurse can indeed be applied as instant, however it's not recommended for the reasons mentioned above.
My apologies if this was interpreted as being intended to be used as a stand-alone script, or that it was in need of debugging...