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, Yandex, Bing, Yahoo!, DotBot, Sogou

Members: 0
Guests: 4
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 » Codebases » LoP Codebase » bribe_trigger
Forum Rules | Mark all | Recent Posts

bribe_trigger
< Newer Topic :: Older Topic > question

Pages:<< prev 1 next >>
Post is unread #1 Oct 12, 2011, 12:46 am   Last edited Oct 12, 2011, 12:47 am by Matteo2303
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

In mprog_bribe_trigger there is:

      /* Go through once to see which we should use */
      onprog = 0;
      for( mprg = mob->pIndexData->mudprogs; mprg; mprg = mprg->next )
      {
         ++onprog;
         if( ( mprg->type == BRIBE_PROG ) && ( uamount >= atoi( mprg->arglist ) ) && ( amdiff == 0 || ( uamount - atoi( mprg->arglist ) ) < amdiff ) )
         {
            amdiff = ( uamount - atoi( mprg->arglist ) );
            useprog = onprog;
         }
      }

      /* Go through it again and use the closest bribe program to the amount */
      onprog = 0;
      for( mprg = mob->pIndexData->mudprogs; mprg; mprg = mprg->next )
      {
         if( ++onprog != useprog )
            continue;

         if( ( mprg->type == BRIBE_PROG ) && ( uamount >= atoi( mprg->arglist ) ) )
         {
            increase_gold( mob, uamount );
            mprog_driver( mprg->comlist, mob, ch, obj, NULL, false );
            if( obj )
               extract_obj( obj );
            break;
         }
      }


I don't know but, is possible declare another mprg and make:

MPROG_DATA *sprg = NULL; 
      /* Go through once to see which we should use */
      for( mprg = mob->pIndexData->mudprogs; mprg; mprg = mprg->next )
       if( ( mprg->type == BRIBE_PROG ) && ( uamount >= atoi( mprg->arglist ) ) && ( amdiff == 0 || ( uamount - atoi( mprg->arglist ) ) < amdiff ) )
         {
            amdiff = ( uamount - atoi( mprg->arglist ) );
            sprg = mprg;         
         }

if ( sprg )
{
       increase_gold( mob, uamount );
       mprog_driver( sprg->comlist, mob, ch, obj, NULL, false );
       if( obj )
       extract_obj( obj );
       break;
}
       
Post is unread #2 Oct 26, 2011, 6:33 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Haven't tried, but should be able to. Minus the break in the part your adding since it isnt in a for loop
       
Post is unread #3 Oct 31, 2011, 1:04 am   Last edited Oct 31, 2011, 1:08 am by Matteo2303
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Yeah, minus "break".
My bad.

Bye
mat
       
Pages:<< prev 1 next >>