//Here is the basic nobility code and then some extra stuff i did with the code at the end,
//Tie this into act_wiz.c or something...
/*Code by Colton Fisher (with help) August 3, 2005*/
void do_grant( CHAR_DATA *ch, char *argument )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' || arg2[0] == '\0' || atoi(arg2) < 1 || atoi(arg2) > 20 )
{
send_to_char( "Syntax: grant <chararacter> <rank number (1-20)>\n\r",ch);
send_to_char( "&W Male Nobility Female Nobility\n\r", ch);
send_to_char( "&W __[Basic Citizen Ranks]__|__[Basic Citizen Ranks]__\n\r", ch);
send_to_char( "|1 :Serf |1 :Serf |\n\r", ch);
send_to_char( "|2 :Peasent |2 :Peasent |\n\r", ch);
send_to_char( "|3 :Worker |3 :Worker |\n\r", ch);
send_to_char( "|4 :Freeman |4 :Freewoman |\n\r", ch);
send_to_char( "|5 :Squire |5 :Squire |\n\r", ch);
send_to_char( "||_[Upper Citizen Ranks]_|||_[Upper Citizen Ranks]_||\n\r", ch);
send_to_char( "|6 :Horseman |6 :Horsewomen |\n\r", ch);
send_to_char( "|7 :Knight |7 :Knight |\n\r", ch);
send_to_char( "|8 :Adept |8 :Adept |\n\r", ch);
send_to_char( "|9 :Militia |9 :Militia |\n\r", ch);
send_to_char( "|10 :Legend |10 :Legend |\n\r", ch);
send_to_char( "||____[Lesser Rulers]____|||____[Lesser Rulers]____||\n\r", ch);
send_to_char( "|11 :Lord |11 :Lady |\n\r", ch);
send_to_char( "|12 :Viscount |12 :Lady to the Viscount|\n\r", ch);
send_to_char( "|13 :Baronet |13 :Lady to the Baronet |\n\r", ch);
send_to_char( "|14 :Count |14 :Countess |\n\r", ch);
send_to_char( "|15 :Baron |15 :Baroness |\n\r", ch);
send_to_char( "||____[Upper Rulers]_____|||____[Upper Rulers]_____||\n\r", ch);
send_to_char( "|16 :Margrave |16 :Marchioness |\n\r", ch);
send_to_char( "|17 :Duke |17 :Duchess |\n\r", ch);
send_to_char( "|18 :Arch Duke |18 :Arch Duchess |\n\r", ch);
send_to_char( "|19 :Prince |19 :Princess |\n\r", ch);
send_to_char( "|20 :King |20 :Queen |\n\r", ch);
send_to_char( "|_________________________|_________________________|\n\r", ch);
send_to_char( "Note: Neutral takes the male nobility form. Thank You.\n\r", ch);
return;
}
if ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
{
send_to_char( "They must be present to be granted nobility.\n\r", ch );
return;
}
if ( IS_NPC(victim) )
{
send_to_char("&WMobs can't have player nobility rankings.\n\r",ch);
return;
}
victim->pcdata->noble = atoi(arg2);
pager_printf( ch, "You adjust %s's rank in sociaty to the nobility level of %s!\n\r",victim->name, noble_rank_table[ch->pcdata->noble].title_of_rank[ch->sex]);
pager_printf( victim, "%s sets your nobility level to %s!\n\r", ch->name, noble_rank_table[victim->pcdata->noble].title_of_rank[ch->sex]);
return;
}
//The long run on of send_to_char can be replaced and redirected to a helpfile but i used it //this way for a reason
//In act_info.c above char_name, wch->pcdata->title ); add,
noble_rank_table[wch->pcdata->noble].title_of_rank[wch->sex],
and add another %s in sprintf( buf
//In mud.h in struct pc_data add
int noble;
//with the other global variables add
extern const struct noble_type _noble_table[MAX_NOBLE];
extern struct noble_type *noble_table[MAX_NOBLE];
extern const struct noble_titles noble_rank_table[];
struct noble_titles
{
char *title_of_rank[3];
};
//then define MAX_NOBLE with the other defines
//in player.c in function do_newscore (score, or oldscore.. which ever you are using) replace
pager_printf_color( ch, "\n\r&C%s%s\n\r", ch->name, ch->pcdata->title );
//or something of the nature with
pager_printf_color( ch, "\n\r&C%s%s%s\n\r", noble_rank_table[ch->pcdata->noble].title_of_rank[ch->sex], ch->name, ch->pcdata->title );
//also add this under pager_printf( ch, "You are trusted at level %d.\n\r", get_trust( ch ) );
pager_printf_color( ch, "&C[&WNobility&C:&W %d &C]", ch->pcdata->noble );
//in save.c in void fwrite_char( CHAR_DATA * ch, FILE * fp ) add
fprintf( fp, "Noble %d\n", ch->pcdata->noble );
// and in fread_char in case n add
KEY( "noble", ch->pcdata->noble, fread_number( fp ) );
//at the bottom of tables.c add
const struct noble_titles noble_rank_table[] =
{
{
{"Serf ", "Serf ", "Serf " }
},
{
{"Serf ", "Serf ", "Serf " }
},
{
{"Peasent " ,"Peasent " ,"Peasent " }
},
{
{"Worker " ,"Worker " ,"Worker " }
},
{
{"Freeman " ,"Freeman " ,"Freewomen " }
},
{
{"Squire " ,"Squire " ,"Squire " }
},
{
{"Horseman " ,"Horseman " ,"Horsewomen " }
},
{
{"Knight " ,"Knight " ,"Knight "}
},
{
{"Adept " ,"Adept " ,"Adept " }
},
{
{"Militia " ,"Milita " ,"Militia " }
},
{
{"Legend " ,"Legend " ,"Legend " }
},
{
{"Lord " ,"Lord " , "Lady " }
},
{
{ "Viscount " ,"Viscount " ,"Lady " }
},
{
{ "Baronet " ,"Baronet " ,"Lady " }
},
{
{ "Count " ,"Count " ,"Countess " }
},
{
{ "Baron " ,"Baron " ,"Baroness " }
},
{
{ "Margrave " ,"Margrave " ,"Marchioness " }
},
{
{ "Duke " ,"Duke " ,"Duchess " }
},
{
{ "Arch Duke " ,"Arch Duke " ,"Duchess " }
},
{
{ "Prince " ,"Prince " ,"Princess " }
},
{
{ "King " ,"King " ,"Queen " }
},
};
//replace the ranks with whatever.. the first = null and so i made 1 be the same as null so they
//could be reset to that rank if need be
//i also added some stuff to do_whois to show this as well as giving kings and some the ability
//to empower some people to certian ranks but that should be easy enough to find out on your own