FANDOM


Pseudo-Normally Distributed Ability Scores Edit

What it does Edit

I was implementing the script Rolled Attributes for Creatures by The Great Slayer of Gelatinous Cubes and cleaned it up for my world. Here is the cleaned up version, which is placed in nw_c2_default9 (the default spawn script). It generates pseudo-normally distributed ability scores ranging from 50% to 150% of the base ability score. I may add a wrapper around this code to check the tag of the spawned creature for a specific switch to bypass rolling random ability scores.

The Script Edit

/*  based on Rolled Attributes for Creatures by The Great Slayer of Gelatinous Cubes
    ::generates pseudo-normally distributed ability scores ranging from 50% to
    150% of the base ability score.
*/
    int iAbility, iAbilityScore, iModifier; effect eModifier;
    for (iAbility=0; iAbility<6; iAbility++) {
        iAbilityScore = GetAbilityScore(OBJECT_SELF, iAbility);
        if (iAbilityScore > 3) {
            iModifier = FloatToInt(IntToFloat(iAbilityScore) * IntToFloat(d20(5) + 45) / 100.0f) + 1 - iAbilityScore; // normal bell curve from 50%-145%
            if (iModifier >= 0) { eModifier = EffectAbilityIncrease(iAbility, iModifier); }
            else { eModifier = EffectAbilityDecrease(iAbility, abs(iModifier)); }
            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eModifier, OBJECT_SELF);
        }
    }

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.