i apologize for size of this note
heres snippet i wrote for yeh.. might not work, havent tested it but if look at it should see how to add things to clans, this makes so can use 'donate (ammount)' and can see total when do clans ___ there is no way for imms to edit other then going into the clans file but i assume u can add something in setclan or so that will make it so u can have leader buy stuff with clan valor for the clan
starters.. open mud.h
-in clan_data after
int class; /* For guilds */
-add
int vbalance;
-in the declare_do_fun stuff add before do_down add
DECLARE_DO_FUN( do_donate );
-open tables.c
-add
if ( skill == do_donate ) return "do_donate";
-and
if ( !str_cmp( name, "do_donate" )) return do_donate;
-in respective positions
-open clans.c
-after
KEY( "Badge", clan->badge, fread_string( fp ) );
-add
KEY( "BalanceV", clan->vbalance, fread_number( fp ) );
-before
void do_induct( CHAR_DATA *ch, char *argument )
-add
void do_donate( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
int amount = 0;
argument = one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Usage: donate <amount>\n\r", ch);
return;
}
amount = atoi(arg);
if ( amount < 0 )
{
send_to_char( "Let me see... when dwarfs fly.\n\r", ch );
return;
}
if( amount > ch->pcdata->quest_curr)
{
send_to_char("You do not have that much glory", ch);
return;
} else
{
sprintf( buf, "You donate %d valor to the cause!\n\r", amount);
send_to_char( buf, ch );
ch->pcdata->quest_curr -= amount;
ch->pcdata->clan->vbalance += amount;
save_clan( ch->pcdata->clan );
}
return;
}
-in do_clans Before
ch_printf( ch, "\n\rDescription: %s\n\r", clan->description );
-add
ch_printf( ch, "\n\rValor: %d\n\r", clan->vbalance );
theres prob some pharse/spelling errors i always get 1 or 2 of them but.. u get idea, just once get compiled and running start mud and with ur imm do
cedit donate create do_donate
cedit donate level 5
cedit save cmdtable
-and set, any probs email me or post a note |