Since I'm using AreaEditor, I need to know some things about defaults in the code. If, for instance, I create a MOB, and only fill in some of it's attributes, what do the other values reset to? e.g., MOB1, I set level to 10, but don't fill in AC, HP's, Damage, etc. Will it's values default to something based on its Class and Race?
And, if I leave strength, dexterity, etc. at 13, do they get adjusted according to Race and Class?
I assume some of these things adjust according to level as well.
Thanks.
I think that all of this is in db.c. There's a function init_char (or something like that -- but this might not be in db.c) that sets all the defaults for all characters. Then you should go look at fread_mobs in db.c -- that reads mobs from files, and takes crae of defaults and all that.
However it's possible that the area editor itself sets some default values if you don't specify them all. The area files don't allow for very many 'optional' entries. I think you specify "simple" or "complex" mob, and that's about the only option you have -- from that point on, you have to specify everything.
Sorry to not be more precise. I don't have convenient access to the source code from here.
The function you need to look at is create_mobile and it is in db.c
Here is a little part of what happens in there, when an instance mobile is created.
if ( pMobIndex->ac )
mob->armor = pMobIndex->ac;
else
mob->armor = interpolate( mob->level, 100, -100 );
if ( !pMobIndex->hitnodice )
mob->max_hit = mob->level * 8 + number_range(mob->level * mob->level / 4,
mob->level * mob->level );
In both these instances, if the index data for the mobile is 0, the code will determine values for you, for AC interpolate does this 100 + moblevel * (-100 - 100) / 32
Hit dice are given as numdie = moblevel * 8 sizedie + a number between 0 and moblevel*moblevel/4
Hope thats helpfull
Yes it is helpful, but it wasn't necesary to copy any code in. I just needed to know if SMAUG auto assigns certain values or not. I see it does.
What about Class skills? I read somewhere (I think Hernes) that if a MOB has the Warrior class, it will be capable of warrior skills, whether given them or not.
As an aside note; why have so many NPC monster types? i.e., I looked up a Thule, it's a prehistoric man-type. Why not just create a human?
Anyways, thanks for the help. Seeing the code gives something to go by.
In answer to your original question, it only makes the adjustments automatically to the stats he cited the code for, the other stats you asked about do not get adjusted and mobs have access to all skills/spells regardless of how you set their race/class, the reason for all the various monster races is so that builders can set their mobs appropriately so that when players cast identify on a mob, they see something reasonable compared to the description of the mob rather than just human warrior every time.