Pages:<< prev 1 next >>


Apprentice

GroupMembers
Posts86
JoinedAug 25, 2003
In mprog_bribe_trigger there is:
I don't know but, is possible declare another mprg and make:
/* 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;
}



Geomancer

GroupAdministrators
Posts1,992
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
Pages:<< prev 1 next >>