Second part... sorry if its too long...
IN do_whois, you need to find this code
set_pager_color( AT_GREY, ch );
pager_printf(ch, "\n\r'%s%s.\n\r",
victim->name, victim->pcdata->title);
AND change it to look like this
set_pager_color( AT_GREY, ch );
pager_printf(ch, "\n\r'%s&c&w%s%s.\n\r",
victim->pcdata->pretit, victim->name, victim->pcdata->title);
(NOTE ON ABOVE: My mud has a fun time with the &w color, so I use
&c&w for the &w code. Again, this is hard coded, and if you want
to remove the color, remove that one also)
FINALLY, in show_char_to_char_0 Find this Code
if ( victim->morph != NULL && victim->morph->morph != NULL &&
!IS_IMMORTAL( ch ) )
strcat( buf, MORPHPERS( victim, ch ) );
else
strcat( buf, PERS( victim, ch ) );
}
if ( !IS_NPC(victim) && !xIS_SET(ch->act, PLR_BRIEF) )
strcat( buf, victim->pcdata->title );
And change it to look like this
if ( victim->morph != NULL && victim->morph->morph != NULL &&
!IS_IMMORTAL( ch ) )
strcat( buf, MORPHPERS( victim, ch ) );
else
if (!IS_NPC(victim) && victim->pcdata->pretit != NULL)
{
strcat (buf, victim->pcdata->pretit );
strcat (buf, "&P");
}
strcat( buf, PERS( victim, ch ) );
}
if ( !IS_NPC(victim) && !xIS_SET(ch->act, PLR_BRIEF) )
strcat( buf, victim->pcdata->title );
2. MUD.H
In the declare_do_fun section, you need to add pretitle to it.
In the pc_data structure, you need to add this to it
char * pretit;
(I added this after the pointer for title)
3. TABLES.C
You need to add the pretitle commands into the tables. Remember, there
are two spots which it needs to be added!
4. Save.c
IN fwrite_char, you need to add this
fprintf( fp, "Pretit %s~\n", ch->pcdata->pretit ); /* Xerves 8-2-99 */
You will most likely want to put it after the one for title
In load_char_obj you need to put it in two spots, first...
Right below
ch->pcdata->bestowments = str_dup( "" );
ch->pcdata->title = STRALLOC( "" );
Add This Line
ch->pcdata->pretit = str_dup( "" ); /* Xerves 8-2-99 */
Next, down about 20 lines or so, find this
if ( !ch->pcdata->deity_name )
{
ch->pcdata->deity_name = STRALLOC( "" );
ch->pcdata->deity = NULL;
}
if ( !ch->pcdata->bio )
ch->pcdata->bio = STRALLOC( "" );
Right below it add this...
if ( !ch->pcdata->pretit )
ch->pcdata->pretit = str_dup( "" ); /* Xerves 8-2-99 */
IN fread_char, there are once again two spots...First
Right below this line..
KEY( "Practice", ch->practice, fread_number( fp ) );
Add all of this
if ( !str_cmp( word, "Ptit" ) || !str_cmp( word, "pretit"))
{
ch->pcdata->pretit = fread_string( fp );
if (ch->pcdata->pretit[0] != '.' && ch->pcdata->pretit[0] != ','
&& ch->pcdata->pretit[0] != '!' && ch->pcdata->pretit[0] != '?')
{
sprintf( buf, "%s", ch->pcdata->pretit );
STRFREE( ch->pcdata->pretit );
ch->pcdata->pretit = str_dup( buf );
}
fMatch = TRUE;
break;
}
(NOTE: The above will check to see if there is an . , ! ? in the pretitle, if
one is found, it will not save the pretitle, remove this if you want, or
feel free to add on to it )
Lastly, down about a few pages, there should be a bunch of checks to see if
titles/bios/etc exsist, it looks like this
if (!ch->pcdata->bestowments)
ch->pcdata->bestowments = str_dup( "" );
if (!ch->pcdata->title)
ch->pcdata->title = STRALLOC( "" );
You need to add right after that
if (!ch->pcdata->pretit)
ch->pcdata->pretit = str_dup( "" );
5. (Optional, if you have finger.c (the finger command) in your code)
If you still have the finger function in finger.c, you will probably want
to add pretitle support there also, if you moved the finger code, or have
your own, you might want to find it again, and add this to it.
ch_printf(ch, "&c&wSex : &G%-20s &w Race: &G%s\n\r",
victim->sex == SEX_MALE ? "Male" :
victim->sex == SEX_FEMALE ? "Female" : "Neutral",
capitalize( npc_race[victim->race] ) );
ch_printf(ch, "&c&wTitle: &G%s\n\r", victim->pcdata->title );
This is what the code I have looks like, again the &c&w is used to for &w in
my code. Anyway, you will probably want to add the Pretitle right below that
ch_printf(ch, "&c&wPreTitle: &G%s\n\r", victim->pcdata->pretit ); |