View Single Post
  #4  
Old 08-10-2009, 10:18 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default

Quote:
Originally Posted by trevius View Post
Do you have any specific examples of it not working? Giving the level, maxlevel, maxhp, actual hps (as seen in #showstats or #npcstats), and scalerate as examples?

Note that I added some extra code for NPCs that are level 25 or lower for their base level setting. This was added to help prevent stats (other than HPs) from scaling at insane rates, and can be adjusted with the scalerate setting still if needed.

Here is the full method for LevelScale as it is set now. Note the section in green for the part where I adjusted for lower levels to scale their stats a bit better:

Code:
void NPC::LevelScale() {

        int8 random_level = (MakeRandomInt(level, maxlevel));

        float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
        
        // Compensate for scale rates at low levels so they don't add too much
        int8 scale_adjust = 1;
        if(level > 0 && level <= 5)
                scale_adjust = 10;
        if(level > 5 && level <= 10)
                scale_adjust = 5;
        if(level > 10 && level <= 15)
                scale_adjust = 3;
        if(level > 15 && level <= 25)
                scale_adjust = 2;

        max_hp += (max_hp * scaling);
        cur_hp = max_hp;
        STR += (int)(STR * scaling / scale_adjust);
        STA += (int)(STA * scaling / scale_adjust);
        AGI += (int)(AGI * scaling / scale_adjust);
        DEX += (int)(DEX * scaling / scale_adjust);
        INT += (int)(INT * scaling / scale_adjust);
        WIS += (int)(WIS * scaling / scale_adjust);
        CHA += (int)(CHA * scaling / scale_adjust);
        if (MR)
                MR += (int)(MR * scaling / scale_adjust); 
        if (CR)
                CR += (int)(CR * scaling / scale_adjust);
        if (DR)
                DR += (int)(DR * scaling / scale_adjust);
        if (FR)
                FR += (int)(FR * scaling / scale_adjust);
        if (PR)
                PR += (int)(PR * scaling / scale_adjust);

        if (max_dmg)
        {
                max_dmg += (int)(max_dmg * scaling / scale_adjust);
                min_dmg += (int)(min_dmg * scaling / scale_adjust);
        }

        level = random_level;

        return;
}
Yeah, I am looking at a level 16 NPC with base HP (which is 100) from the database (the hp field) and 187 stats (all stats are 75 in the database and scalerate is set to 100%.)

Something also to note is the NPC is wielding a statless 2Hander. It is also a warrior. It also happens to the same NPCs each time.
Reply With Quote