I've recently been looking into adding effects to PC's for reaching specific milestones:
e.g. 20th level Fighter gets +1 Attack Bonus
The method I've looked into doing this with is using an ApplyEffectToObject function on login to apply the attack increase so long as they have the proper levels (check for levels, apply bonus). So far that seems to work good, however I've realized there's a few snags.
If I set any kind of bonus as an instant increase, it's permanent, but can never be removed (known bug with this function) - which means I'd have to not allow any kind of releveling should a player mess up their build. For obvious reasons this isn't a wise course of action, so I won't be doing it.
If I set the bonus as permanent, it seems to last indefinitely - however it is removed on death. I haven't done enough testing to find out if there's other ways to remove this besides death/it being removed by a script. The death is what's providing the issue however:
Are there any functions by which to reapply this variable after a player is brought back to life?
It can be added to the OnPlayerRespawn, but from what the lexicon says this only fires when they press the respawn button - not when they're brought back by an effect such as raise dead or ressurection, or even dm heal.
Any help in how to keep these effects applied would be welcome. I've debated adding it's application to a heartbeat script, but that seems like it'd cause lag? (I've been warned that heartbeats can cause issues with lag because of how frequently they fire)
If anyone knows any other methods by which this might be removed that I haven't seen yet, I'd appreciate knowing that as well. Thanks for any help provided.