Summary: Spelltongue gives permanent duration bonuses to many abilities if they are active when the Spelltongue effect is resolved. Can be fixed by setting the SkipOverride flag to true on the call to AdjustStatusEffectDuration from SpreadBeneficialEffectTime.
As brought up by Asdu in another thread (http://forums.obsidian.net/topic/83388-class-build-the-leech-barbarian-time-bandit-tank/?p=1839742), when using Spelltongue the duration of many (Frenzy, Unbending, Vigorous Defense, Disciplined Barrage, ...) though not all (Savage Defiance, Veteran's Recovery, non-ability effects) abilities is permanently increased. Some further testing shows that this happens in particular when those abilities are active at the time Spelltongue hits.
The issue can easily be reproduced by using an ally as a target. Have character A wield Spelltongue, and character B serve as target. Have B consume some food and/or drugs to have beneficial effect time to steal, and have a third character attack some NPCs to enter combat mode so you can activate abilities. Have A activate an ability like Disciplined Barrage, and start attacking B. After a couple of hits, right-click on the ability's icon to see its description, and note the duration having (significantly) increased. This increase carries over to subsequent combats, though it does seem to disappear when reloading (I cannot be sure that always happens, however).
The Spelltongue effect is processed by the StatusEffect.ApplyEffectHelper (ModifiedStat.TransferBeneficialTime). This first calls CharacterStats.AdjustBeneficialEffectTime to reduce the duration of beneficial effects on the target, then calls CharacterStats.SpreadBeneficialEffectTime to add the stolen duration to the wielder's beneficial effects. Both these functions end up calling the CharacterStats.AdjustStatusEffectDuration function, but a key difference is that for this function SkipOverride is set to true when reducing on the target but set to false when adding to the wielder. This coincides with the fact that the reduction on the target is not permanent, the issue manifests due to SkipOverride being set to false.
When SkipOverride is true, only the Duration parameter on the StatusEffect is modified. If it is set to false, the DurationOverride is modified as well (unless it was zero to begin with), which is what causes the problem. For GenericAbility's, the StatusEffect objects are created when the ability is first initialized (when gaining it, when loading the game). At this point the DurationOverride of the StatusEffect is set to the DurationOverride value of the GenericAbility. When the ability is activated the StatusEffect is applied, and its Duration is computed from either its DurationOverride (if it is non-zero, eg. Frenzy, Disciplined Barrage) or otherwise its StatusEffectParams.Duration value (eg. Savage Defiance, which has a DurationOverride of zero). When the StatusEffect ends it is removed, but is not destroyed; a second activation of the same ability uses the same StatusEffect object. The DurationOverride value is never reset in between, which means that changes to it are permanent and stick around until the StatusEffect is destroyed (on reload, respec, console-removing the ability).
In summary, therefore, the DurationOverride on ability StatusEffects should never be modified; the SkipOverride=false setting on the AdjustStatusEffectDuration is only intended for StatusEffects that are destroyed after a single use, such as for afflictions (other than the SpreadBeneficialEffectTime function, that's what it is used for). The solution would therefore be to simply change
Question
Loren Tyr
Summary: Spelltongue gives permanent duration bonuses to many abilities if they are active when the Spelltongue effect is resolved. Can be fixed by setting the SkipOverride flag to true on the call to AdjustStatusEffectDuration from SpreadBeneficialEffectTime.
As brought up by Asdu in another thread (http://forums.obsidian.net/topic/83388-class-build-the-leech-barbarian-time-bandit-tank/?p=1839742), when using Spelltongue the duration of many (Frenzy, Unbending, Vigorous Defense, Disciplined Barrage, ...) though not all (Savage Defiance, Veteran's Recovery, non-ability effects) abilities is permanently increased. Some further testing shows that this happens in particular when those abilities are active at the time Spelltongue hits.
The issue can easily be reproduced by using an ally as a target. Have character A wield Spelltongue, and character B serve as target. Have B consume some food and/or drugs to have beneficial effect time to steal, and have a third character attack some NPCs to enter combat mode so you can activate abilities. Have A activate an ability like Disciplined Barrage, and start attacking B. After a couple of hits, right-click on the ability's icon to see its description, and note the duration having (significantly) increased. This increase carries over to subsequent combats, though it does seem to disappear when reloading (I cannot be sure that always happens, however).
The Spelltongue effect is processed by the StatusEffect.ApplyEffectHelper (ModifiedStat.TransferBeneficialTime). This first calls CharacterStats.AdjustBeneficialEffectTime to reduce the duration of beneficial effects on the target, then calls CharacterStats.SpreadBeneficialEffectTime to add the stolen duration to the wielder's beneficial effects. Both these functions end up calling the CharacterStats.AdjustStatusEffectDuration function, but a key difference is that for this function SkipOverride is set to true when reducing on the target but set to false when adding to the wielder. This coincides with the fact that the reduction on the target is not permanent, the issue manifests due to SkipOverride being set to false.
When SkipOverride is true, only the Duration parameter on the StatusEffect is modified. If it is set to false, the DurationOverride is modified as well (unless it was zero to begin with), which is what causes the problem. For GenericAbility's, the StatusEffect objects are created when the ability is first initialized (when gaining it, when loading the game). At this point the DurationOverride of the StatusEffect is set to the DurationOverride value of the GenericAbility. When the ability is activated the StatusEffect is applied, and its Duration is computed from either its DurationOverride (if it is non-zero, eg. Frenzy, Disciplined Barrage) or otherwise its StatusEffectParams.Duration value (eg. Savage Defiance, which has a DurationOverride of zero). When the StatusEffect ends it is removed, but is not destroyed; a second activation of the same ability uses the same StatusEffect object. The DurationOverride value is never reset in between, which means that changes to it are permanent and stick around until the StatusEffect is destroyed (on reload, respec, console-removing the ability).
In summary, therefore, the DurationOverride on ability StatusEffects should never be modified; the SkipOverride=false setting on the AdjustStatusEffectDuration is only intended for StatusEffects that are destroyed after a single use, such as for afflictions (other than the SpreadBeneficialEffectTime function, that's what it is used for). The solution would therefore be to simply change
in the CharacterStats.SpreadBeneficialEffectTime function to
as is also used when first reducing the durations on the Spelltongue victim.
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now