What I do:
- Check if there is an effect with AbilityID = 1234
- use GetEffectsByAbilityId to create an array of all the effects with that same AbilityID and place them in eEffects
- use GetArraySize to get the last value nCount of the array
- in a for loop apply new effects to the array using eEffects[nCount + i]
- use RemoveStackingEffects to remove all effects with AbilityID = 1234
- Use a custom script ApplyEffectsOnObject (which works correctly) to apply an array of effects to the player
- Apply AbilityID + 1 (f.e. 1235) to these new effects
When I count the number of effects at the start of the script for the first time it counts the correct number, and at the end 3 new effects are applied (nCount has increased by 3)
However, after the script is called again, nCount again returns 2 effects instead of the new 5 and the script basically goes from 2 to 5 again every time the script is called.
I've rechecked everything 5 times already, used a lot of Floaty's and Logwrites to see where things go bad but I can't seem to find anything that can cause this...
At the end of the script it returns the correct amount of effects, yet when calling the script again it returns the wrong amount, but my script can't have anything to do with that as it doesn't do anything before the start Floaty and after the end Floaty?
I'm at a total loss here
effect[] eEffects = GetEffectsByAbilityId(stEvent.oCaster, abilityID); int nCount = GetArraySize(eEffects); for(i=0;i lt nMax;i++) eEffects[nCount+i] = EffectModifyProperty(PROPERTY_ATTRIBUTE_DAMAGE_RESISTANCE_COLD, -(RandomRange(0.1f, 5.0f) * iMultiply)); RemoveStackingEffects(stEvent.oCaster, stEvent.oCaster, abilityID); ApplyEffectsOnObject(EFFECT_DURATION_TYPE_PERMANENT, eEffects, stEvent.oCaster, 0.0f, stEvent.oCaster, abilityID+1);
Modifié par Joshua Raven, 05 décembre 2009 - 02:52 .





Retour en haut






