Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Google, DotBot

Members: 0
Guests: 20
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] Bestow command is pure ...
Forum Rules | Mark all | Recent Posts

[Bug] Bestow command is pure evil
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 5, 2005, 3:54 pm   Last edited May 11, 2005, 6:31 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Bestow is pure evil.
Danger: MAXIMUM
Found by: Orion Elder
Fixed by: Orion Elder, Remcon
-----
(act_wiz.c)
Find the do_bestow function, and replace it with:

void do_bestow( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], arg_buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    CMDTYPE *cmd;
    bool fComm = FALSE;

    set_char_color( AT_IMMORT, ch );

    argument = one_argument( argument, arg );
    if ( arg[0] == '\0' )
    {
        send_to_char( "Bestow whom with what?\n\r", ch );
        return;
    }
    if ( ( victim = get_char_world( ch, arg ) ) == NULL )
    {
        send_to_char( "They aren't here.\n\r", ch );
        return;
    }
    if ( IS_NPC( victim ) )
    {
        send_to_char( "You can't give special abilities to a mob!\n\r", ch );
        return;
    }
    if ( victim == ch || get_trust( victim ) >= get_trust( ch ) )
    {
        send_to_char( "You aren't powerful enough...\n\r", ch );
        return;
    }

    if (!victim->pcdata->bestowments)
        victim->pcdata->bestowments = str_dup("";);

    if ( argument[0] == '\0' || !str_cmp( argument, "show list" ) )
    {
        ch_printf( ch, "Current bestowed commands on %s: %s.\n\r",
                victim->name, victim->pcdata->bestowments );
        return;
    }

    if ( !str_cmp( argument, "none" ) )
    {
        DISPOSE( victim->pcdata->bestowments );
        victim->pcdata->bestowments = str_dup("";);
        ch_printf( ch, "Bestowments removed from %s.\n\r", victim->name );
        ch_printf( victim, "%s has removed your bestowed commands.\n\r", ch->name );
        return;
    }

    arg_buf[0] = '\0';

    argument = one_argument( argument, arg );

    while ( arg && arg[0] != '\0' )
    {
        char *cmd_buf, cmd_tmp[MAX_INPUT_LENGTH];
        bool cFound = FALSE;

        if ( !(cmd = find_command( arg )) )
        {
            ch_printf( ch, "No such command as %s!\n\r", arg );
            argument = one_argument( argument, arg );
            continue;
        }
        else if ( cmd->level > get_trust( ch ) )
        {
            ch_printf( ch, "You can't bestow the %s command!\n\r", arg );
            argument = one_argument( argument, arg );
            continue;
        }

        cmd_buf = victim->pcdata->bestowments;
        cmd_buf = one_argument( cmd_buf, cmd_tmp );
        while ( cmd_tmp && cmd_tmp[0] != '\0' )
        {
            if ( !str_cmp( cmd_tmp, arg ) )
            {
                cFound = TRUE;
                break;
            }

            cmd_buf = one_argument( cmd_buf, cmd_tmp );
        }

        if ( cFound == TRUE )
        {
            argument = one_argument( argument, arg );
            continue;
        }

        sprintf( arg, "%s ", arg );
        strcat( arg_buf, arg );
        argument = one_argument( argument, arg );
        fComm = TRUE;
    }
    if ( !fComm )
    {
        send_to_char( "Good job, knucklehead... you just bestowed them with that master command called 'NOTHING!'\n\r", ch );
        return;
    }

    if ( arg_buf[strlen( arg_buf ) - 1] == ' ' )
        arg_buf[strlen( arg_buf ) - 1] = '\0';

    sprintf( buf, "%s %s", victim->pcdata->bestowments, arg_buf );
    DISPOSE( victim->pcdata->bestowments );
    smash_tilde( buf );
    victim->pcdata->bestowments = str_dup( buf );
    set_char_color( AT_IMMORT, victim );
    ch_printf( victim, "%s has bestowed on you the command(s): %s\n\r", ch->name, arg_buf );
    send_to_char( "Done.\n\r", ch );
}
       
Pages:<< prev 1 next >>