Yeah it's me again ( =D )....I know I know. Anyways, because of the large
amount of file altering I'm doing I can't allways check my work (e.g.,
compile) as often as I would like so I bring my dilema's to the list to make
sure I'm not making some idiotic error that I would inexplicably repeat and
eventually kill us all......I think we would all agree that that would be
bad. And I'm not looking for anyone to do my coding for me, I'm just trying
to make sure I'm not straying from my intended path.
Anyways, sorry this is so long, but I figured that this would be the best
way to explain this problem, without just explaining some code you havn't
seen and reading my mind....hell I can barely read my mind half the time,
can't expect you guys to.
Well, this is the code, oh, if this isn't kosher for the list let me know so
I know not to do it again. I tried to make the code as readable as possible
(took out some spaces)
/* merc.h */
struct class_type
{
char * name;/* the full name of the Occupation */
char who_name [4];/* Three-letter name for 'who'*/
sh_int attr_prime;/* Prime attribute */
sh_int weapon;/* First weapon */
sh_int opcost;/* Occupational Cost of the Occupation */
/* sh_int guild[MAX_GUILD];/* Not using this ATM */ */
sh_int skill_adept;/* Maximum skill level */
sh_int combat_level;/* Combat level everyone starts with 11 */
sh_int resistance_r;/* Resistance reaction based on Occupation */
sh_int opcost_r;/* OP Cost of above resistance */
sh_int resistance_i;/* Resistance immunities based on Occupation */
sh_int opcost_i;/* OP Cost of above resistance */
sh_int resistance_c;/* Resistance corporeality based on Occupation
*/
sh_int opcost_c;/* OP Cost of above resistance */
sh_int resistance_p;/* Resistance psyche based on Occupation*/
sh_int opcost_p;/* OP Cost of above resistance */
sh_int resistance_l;/* Resistance luck based on Occupation */
sh_int opcost_l;/* OP Cost of above resistance */
/* sh_int thac0_32;/* We don't use Thac0 (Combat Level)*/ */
sh_int minlaw_str;/* Minimax law for Min str*/
sh_int minlaw_end;/* Minimax law for Min end*/
sh_int minlaw_agi;/* Minimax law for Min agi*/
sh_int minlaw_con;/* Minimax law for Min con*/
sh_int minlaw_int;/* Minimax law for Min int*/
sh_int minlaw_wis;/* Minimax law for Min wis*/
sh_int minlaw_for;/* Minimax law for Min for*/
sh_int minlaw_cha;/* Minimax law for Min cha*/
sh_int minlaw_per;/* Minimax law for Min per*/
sh_int maxlaw_str;/* Minimax law for Max str*/
sh_int maxlaw_end;/* Minimax law for Max end*/
sh_int maxlaw_agi;/* Minimax law for Max agi*/
sh_int maxlaw_con;/* Minimax law for Max con*/
sh_int maxlaw_int;/* Minimax law for Max int*/
sh_int maxlaw_wis;/* Minimax law for Max wis*/
sh_int maxlaw_for;/* Minimax law for Max for*/
sh_int maxlaw_cha;/* Minimax law for Max cha*/
sh_int maxlaw_per;/* Minimax law for Max per*/
sh_int d_str;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_str;/* Dice Pool for str (all dice are d(x))*/
sh_int d_end;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_end;/* Dice Pool for end (all dice are d(x))*/
sh_int d_agi;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_agi;/* Dice Pool for agi (all dice are d(x))*/
sh_int d_con;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_con;/* Dice Pool for con (all dice are d(x))*/
sh_int d_int;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_int;/* Dice Pool for int (all dice are d(x))*/
sh_int d_wis;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_wis;/* Dice Pool for wis (all dice are d(x))*/
sh_int d_for;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_for;/* Dice Pool for for (all dice are d(x))*/
sh_int d_cha;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_cha;/* Dice Pool for cha (all dice are d(x))*/
sh_int d_per;/* Number of (d) to roll (i.e., 2d20) */
sh_int dice_per;/* Dice Pool for per (all dice are d(x))*/
sh_int hp_min;/* Min hp gained on leveling */
sh_int hp_max;/* Max hp gained on leveling */
bool fMana;/* Mana Points */
bool fSPoint;/* Spell Points */
bool fSFPoint;/* Spell Factor Points */
sh_int opcost_sfpf;/* SFP OP Cost for Forestry (character creation
only) 0 = No spells */
sh_int opcost_sfph;/* SFP OP Cost for Healing (character creation
only) 0 = No spells */
sh_int opcost_sfpi;/* SFP OP Cost for Illusion (character creation
only) 0 = No spells */
sh_int opcost_sfpw;/* SFP OP Cost for Wizardry (character creation
only) 0 = No spells */
sh_int opcost_spf;/* SP OP Cost for Forestry (character creation
only) 0 = No spells */
sh_int opcost_sph;/* SP OP Cost for Healing (character creation
only) 0 = No spells */
sh_int opcost_spi;/* SP OP Cost for Illusion (character creation
only) 0 = No spells */
sh_int opcost_spw;/* SP OP Cost for Wizardry (character creation
only) 0 = No spells */
char * race_group;/* Races allowed by Occupation */
char * spell_group;/* Group of Spells based on Occupation */
char * school_group;/* School of Spells based on Occupation */
char * restricted_group;/* Restricted skills based on Occupation*/
char * base_group;/* Occupational specific skills */
char * discount_group;/* Occ skills based on occ at a discount*/
char * default_group;/* All available skills available to purchase
*/
char * subocc_group;/* Sub Occupations based on Occupation */
};
struct subclass_type
{
char * name; /* the full name of the sub
occupation */
char who_name [4]; /* Three letter name for who
*/
char * base_group; /* base skills available by sub
occupation */
};
/* const.c */
const struct class_type class_table [MAX_CLASS] =
{
{
"Adventurer", "Adv", STAT_STR, OBJ_VNUM_SCHOOL_SWORD,
250, 35, 11, 30, 23, 24, 25, 26, 21, 21, 28, 24, 21,
1, 1, 1, 1, 1, 1, 1, 1, 7,
20, 20, 20, 20, 20, 20, 20, 20, 24,
1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 8,
3, 6,
FALSE, TRUE, TRUE,
150, 150, 150, 150,
0, 0, 0, 0,
"adventurer race",
"adventurer spell group", "adventurer spell schools",
"adventurer restricted",
"adventurer only", "adventurer discount", "adventurer default",
"adventurer sub occupations"
},
/* comm.c */
<SNIP> (In function 'nanny')
ch->pcdata->oppoints = 2000;
int col;
col = 0;
sprintf(buf, "%-18s %-5s\n\r",
"Occupation", "Occupation Cost");
send_to_char(buf,ch);
for ( iClass = 0; iClass < MAX_CLASS; iClass++ )
{
sprintf( buf, "%-18s %-5d ",
class_table[iClass].name, class_table[iOpcost].opcost);
send_to_char(buf,ch);
if (++col % 3 == 0)
send_to_char("\n\r", ch);
}
if (col % 3 != 0)
send_to_char("\n\r", ch);
send_to_char("\n\r",ch);
sprintf(buf, "Occupation Points: %d \n\r ", ch->pcdata->oppoints );
send_to_char(buf, ch);
strcat (buf, "Please choose your Occupation: " );
write_to_buffer( d, buf, 0 );
d->connected = CON_GET_NEW_CLASS;
break;
case CON_GET_NEW_CLASS:
iClass = class_lookup(argument);
if ( iClass == -1 )
{
write_to_buffer( d,
"That's not an Occupation.\n\rPlease choose your Occupation: ", 0);
return;
}
ch->class = iClass;
sprintf( buf, "\n\rAre you sure you want, %s, as your Occupation (Y/N)? ",
ch->class );
write_to_buffer( d, buf, 0 );
switch ( *argument )
{
case 'y' : case 'Y':
sprintf( buf, "Alright, as a %s you may choose from the following
Races to pursue your Occupation.\n\r",
ch->class );
write_to_buffer( d, buf, 0 );
d->connected = CON_GET_NEW_RACE;
break;
case 'n' : case 'N':
write_to_buffer( d, "Ok, please rechoose: ", 0 );
d->connected = CON_GET_NEW_CLASS;
break;
default:
write_to_bufer( d, "Please type Yes or No. ", 0 );
break;
}
break;
Now that's what I have currently, so you see why I can't compile, but I want
to make sure I'm not screwing this up. Anyways as you also might be able to
see Character Creation (custamization) starts after you pick your name with
your Occupation. This is what I was thinking of for the race part.
/* merc.h */
struct race_group_type
{
char * name;/*Occupation name of the race list*/
char * races[8];/*The actuall races allowed*/
int opracecost;/* -1 can't be that race 0 no cost, any other number is
the cost*/
};
/* const.c */
const struct race_group_type race_group_table [] =
{
{ "adventurer race", {"human", "half-elf"}, {0, -1, -1, 35, -1, -1, -1, -1}
}
};
/* comm.c */
(Inserting from above snippet of comm.c)
case 'y' : case 'Y':
sprintf( buf, "Alright, as a %s you may choose from the following
Races to pursue your Occupation.\n\r",
ch->class );
write_to_buffer( d, buf, 0 );
/* Welcome to my confusion, well, this is my idea, not sure if all of it's
correct
but I think it will work. */
for ( race = 1; class_table[race].race_group; race++ )
{
if (!race_table[race].pc_race)
break;
write_to_buffer(d, race_group_table[race].races, 0);
write_to_buffer(d, "\n\r", 1);
d->connected = CON_GET_NEW_RACE;
break;
Now I think what I added there _should_ list the available races for your
occupation..but I'm still trying to think of a way to include the OP Cost of
the race in there. Um,let me explain that part a bit for you, not all of the
races cost OP Points, depending on your occupation some races can be leery
of it, so this is reflected in the OP cost associated with the races to show
how uncommon this occupation is for their race.
I really am trying to understand the code here, and I think I'm getting
better at it,thanks to you guys for putting up with me as I struggle my way
through it.
And I don't know if it's above there but you only have 2000 OP points to
spend making your character. But your character creation determines a lot of
stuff about your char (Duh =D) but you still have to save for
Restrictions/Limitations/Spells/Skills/SFP/SP/Mana/Aptitudes/Extra Resis
points/etc., etc.
All of which is determined during character creation (You can still get it
in game but at inflated prices)
So basically I guess what I'm asking here, if it's still unclear to you,
is...is what I've put in so far correct? I don't want to keep going only to
find out I would have to change 90% of what I've done.
Anywho thanks to those that provide some assistance and if you need any more
explanation on some of what the code means let me know =P
Thanks,
John
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp