Clan Wages v1.0 What this does: Usually when a person joins an organization in real life, they are paid for their services. In stock SWR that feature is not available, but this snippet will allow all of your clan members to be paid equally. This can easily be modified to set wages according to position(would involve a clan rank system) or set wages individually. But for now, this will equally pay all clan members. What you will need to change: clans.c mud.h tables.c update.c *Always remember to backup the files you will change incase of an error with installation, or an error with the code. cp .bak What you will need to add: Nothing. ------------------------------------------------------------------------------------------------- clans.c Find, fprintf( fp, "Jail %d\n", clan->jail ); Below it add, fprintf( fp, "Wage %d\n", clan->wage ); Find, if (!clan->number2) clan->number2 = STRALLOC( "" ); Below it add, if (!clan->wage) clan->wage = 1000; /* Default wage is 1000 credits */ Find, KEY( "TrooperTwo", clan->trooper2, fread_number( fp ) ); break; Below it add, case 'W': KEY( "Wage", clan->wage, fread_number( fp ) ); break; Find, void do_showclan( CHAR_DATA *ch, char *argument ) Then find, ch_printf( ch, "Funds: %ld\n\r", clan->funds ); Below that add, ch_printf( ch, "Wages: %ld\n\r", clan->wage ); Find, void do_empower ( CHAR_DATA *ch , char *argument ) Below or above this function add this one, void do_setwage( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; CLAN_DATA *clan; int value; if ( IS_NPC( ch ) || !ch->pcdata->clan ) { send_to_char( "Huh?\n\r", ch ); return; } clan = ch->pcdata->clan; if ( !str_cmp( ch->name, clan->leader ) || !str_cmp( ch->name, clan->number1 ) ); else { send_to_char( "Huh?\n\r", ch ); return; } argument = one_argument( argument, arg ); value = is_number( arg ) ? atoi( arg ) : -1; if ( value > 50000 ) { ch_printf(ch, "Sorry, you cannot set your wages over 50000. Wage is still %d!\n\r", ch->pcdata->clan->wage ); return; } if ( value < 0 ) { ch_printf(ch, "Unable to lower wage below 0. Wage is still %d!\n\r", ch->pcdata->clan->wage); return; } ch->pcdata->clan->wage = value; ch_printf(ch, "Base Wage is now %d!\n\r", ch->pcdata->clan->wage); return; } ------------------------------------------------------------------------------------------------- mud.h In the clan_data part, find, char * number2; /* Second officer */ Below it add, int wage; Find, DECLARE_DO_FUN( do_setship ); Below it add, DECLARE_DO_FUN( do_setwage ); ------------------------------------------------------------------------------------------------- tables.c Find, if ( !str_cmp( name, "do_setship" )) return do_setship; Below it add, if ( !str_cmp( name, "do_setwage" )) return do_setwage; Find, if ( skill == do_setship ) return "do_setship"; Below it add, if ( skill == do_setwage ) return "do_setwage"; ------------------------------------------------------------------------------------------------- update.c Find, void char_update( void ) Then find, /* * See if player should be auto-saved. */ if ( !IS_NPC(ch) && !NOT_AUTHED(ch) && current_time - ch->save_time > (sysdata.save_frequency*60) ) ch_save = ch; else ch_save = NULL; Below it add, if (!IS_NPC(ch) && !IS_IMMORTAL(ch)) { if (ch->pcdata->clan->funds < ch->pcdata->clan->wage ) { send_to_char( "&RYour clan does not have the funds to pay you!\n\r", ch ); } else { ch_printf(ch, "&CYour paycheck of &Y%d &Ccredits is deposited in your bank account.&w\n\r", ch->pcdata->clan->wage ); ch->pcdata->clan->funds -= ch->pcdata->clan->wage; ch->pcdata->bank += ch->pcdata->clan->wage; } } ------------------------------------------------------------------------------------------------- make clean make copyover/reboot mud cedit setwage create cedit setwage level 100 cedit save Any problems please contact me at the provided email address, -,,,.,,,,- _'Diablo'_ Star Wars Development '''''' [*]------------------------------------------------[*] ||| If you have any problems please contact me at: ||| ||| crazy_mike_316@hotmail.com ||| [*]------------------------------------------------[*]