If you add a keyword and select "Dispel effects with these keywords", the new one will dispel the old one (like a refresh)
Is there a way, when re-apply the same effect, to add "Duration" to the old effect, intead of adding an instance of that?
scriptname XsProlongableDisease extends ActiveMagicEffect;////////////////////////////////////////////////////////////////////////////// Imports/////////////////////////////////////////////////////////////////////////////;import Utility;////////////////////////////////////////////////////////////////////////////// Properties/////////////////////////////////////////////////////////////////////////////;XsProlongableDiseaseHistory property History autofloat property Duration autofloat property ExpiresAt auto hidden;////////////////////////////////////////////////////////////////////////////// Events/////////////////////////////////////////////////////////////////////////////;event OnEffectStart(Actor target, Actor caster) float actualDuration = Duration XsProlongableDisease prev = History.Register(self) if (prev) actualDuration += prev.GetRemainingDuration() prev.Dispel() endif ExpiresAt = GetCurrentRealTime() + actualDuration RegisterForSingleUpdate(actualDuration)endeventevent OnUpdate() Dispel()endevent;////////////////////////////////////////////////////////////////////////////// Functions/////////////////////////////////////////////////////////////////////////////;float function GetRemainingDuration() float remaining = ExpiresAt - GetCurrentRealTime() if (remaining > 0.0) return remaining endif return 0.0endfunction
scriptname XsProlongableDiseaseHistory extends Quest;////////////////////////////////////////////////////////////////////////////// Properties/////////////////////////////////////////////////////////////////////////////;XsProlongableDisease property LastDisease auto;////////////////////////////////////////////////////////////////////////////// Functions/////////////////////////////////////////////////////////////////////////////;XsProlongableDisease function Register(XsProlongableDisease disease) XsProlongableDisease prev = LastDisease LastDisease = disease return prevendfunction