01 Jul, 2011, arholly wrote in the 1st comment:
Votes: 0
Hello:
I want to modify the create_mobile command and make it so that certain races get additional stat bumps. Now, I know that you can do it because it has things like this in there.
if (IS_SET(mob->act,ACT_WARRIOR))
{
mob->perm_stat[STAT_STR] += 3;
mob->perm_stat[STAT_INT] -= 1;
mob->perm_stat[STAT_CON] += 2;
}


But how would I do it for a race? I'm sure it's something like mob->race,"dwarf", but is that correct?

Best Regards,
Arholly
01 Jul, 2011, Rarva.Riendf wrote in the 2nd comment:
Votes: 0
You don't need/want to do that, edit the race table instead.
01 Jul, 2011, arholly wrote in the 3rd comment:
Votes: 0
That works for players. But for Mobs, you cannot do that I though.
02 Jul, 2011, Rarva.Riendf wrote in the 4th comment:
Votes: 0
arholly said:
That works for players. But for Mobs, you cannot do that I though.

As a matter that is up to the freedom you give to your builders, and if you enforce it or not.
What I did is when you set a race the stats is based on mob level, and is always in btween the min and amx for its race.
While loading areas I also have lots of code to check for basic boundaries, as I do not trust anyone ;p

if you really want to alter stats after areas are loaded, and I think it is a problem as it means builders will see their mobs/etc modified after creation without knowing how you do that easily though:
if (mob->race == RACE_DWARF) {do whatever}
(provided you have a constant for this race or otherwise just look what the value is in your race table, but I suggest creating constant for every player pickable race, as you will probably do something special in the engine for them in the future)
02 Jul, 2011, arholly wrote in the 5th comment:
Votes: 0
I'm all for enforcing it via the code and leaving the builders to be descriptive. Thanks for the help.
0.0/5