Cybernetic Implanets Module v2.0 What this does: This is a diffent Version of Cybernetic Implanets then the one you see by Yoda. This allows players to get cybernetics that add different effects What you will need to change: act_comm.c build.c handler.c misc.c mud.h player.c save.c update.c Note: This was done in FotE, has not tested it in 1.0 someone let me know if there are any changes that need to be made, if there are any problems, or not :) Note: This has a CYBER_STERILE but it in not complete, because of the lack of muds with xsocials, and stds. If you would like it added please email me at novotellus@hotmail.com. Also, I did this for 2 reason, the first is because 1.0 lacks the cyber reactor and it wasnt saving the cybernetics when a player loged out. If there are any questions, or suggestions feel free to email me at novotellus@hotmail.com ********************************************************************************************************** /* act_comm.c */ ********************************************************************************************************** In talk_channel find: OBJ_DATA *obj; if( IS_IMMORTAL( ch ) ) ch_comlink = TRUE; under it add: if ( ch->pcdata->cyber & CYBER_COMM ) ch_comlink = TRUE; ********************************************************************************************************** /* build.c */ ********************************************************************************************************** find: char *const pc_flags[] = { after it add: char * const cyber_flags [] = { "comm", "eyes", "leg", "chest", "reflexes", "mind", "strength", "reactor","sterial" }; find: char *const act_flags[] = { somewhere there add: "surgeon" find: int get_plrflag( char *flag ) afer it add: int get_cyberflag( char *flag ) { int x; for ( x = 0; x < 32; x++ ) if ( !str_cmp( flag, cyber_flags[x] ) ) return x; return -1; } in do_mset find: send_to_char( "deadly, mountable, guardian, nokill, scholar, noassist, droid, nocorpse, noflee\n\r", ch ); under it add: send_to_char( "surgeon", ch ); ********************************************************************************************************** /* handler.c */ ********************************************************************************************************** find: get_curr_str function, replace it with: /* * Retrieve character's current strength. */ sh_int get_curr_str( CHAR_DATA * ch ) { sh_int max; if ( !IS_NPC(ch) ) { max = 20 + race_table[ch->race].str_plus; max = UMIN(max,25); if ( IS_SET(ch->pcdata->cyber, CYBER_STRENGTH) ) { /*ch->mod_str += 1;*/ max += 1; } } else max = 20; return URANGE( 3, ch->perm_str + ch->mod_str, max ); } get_curr_int function, replace it with: /* * Retrieve character's current intelligence. */ sh_int get_curr_int( CHAR_DATA * ch ) { sh_int max; if ( !IS_NPC(ch) ) { max = 20 + race_table[ch->race].int_plus; max = UMIN(max,25); if ( IS_SET(ch->pcdata->cyber, CYBER_MIND) ) /* ch->mod_int += 1;*/ max += 1; } else max = 20; return URANGE( 3, ch->perm_int + ch->mod_int, max ); } get_curr_wis function, replace it with: /* * Retrieve character's current wisdom. */ sh_int get_curr_wis( CHAR_DATA * ch ) { sh_int max; if ( !IS_NPC(ch) ) { max = 20 + race_table[ch->race].wis_plus; max = UMIN(max,25); } else max = 20; return URANGE( 3, ch->perm_wis + ch->mod_wis, max ); } get_curr_dex function, replace it with: /* * Retrieve character's current dexterity. */ sh_int get_curr_dex( CHAR_DATA * ch ) { sh_int max; if ( !IS_NPC(ch) ) { max = 20 + race_table[ch->race].dex_plus; max = UMIN(max,25); if ( IS_SET(ch->pcdata->cyber, CYBER_REFLEXES) ) /*ch->mod_dex += 1;*/ max += 1; } else max = 20; return URANGE( 3, ch->perm_dex + ch->mod_dex, max ); } get_curr_con function, replace it with: /* * Retrieve character's current constitution. */ sh_int get_curr_con( CHAR_DATA * ch ) { sh_int max; if ( !IS_NPC(ch) ) { max = 20 + race_table[ch->race].con_plus; max = UMIN(max,25); } else max = 20; return URANGE( 3, ch->perm_con + ch->mod_con, max ); } get_curr_cha function, replace it with: /* * Retrieve character's current charisma. */ sh_int get_curr_cha( CHAR_DATA * ch ) { sh_int max; if ( !IS_NPC( ch) ) { max = 20 + race_table[ch->race].cha_plus; max = UMIN(max,25); } else max = 20; return URANGE( 3, ch->perm_cha + ch->mod_cha, 25 ); } Find: char *magic_bit_name( int magic_flags ) after it add: char *cyber_bit_name(int cyber_flags) { static char buf[512]; buf[0] = '\0'; if (cyber_flags & CYBER_COMM ) strcat(buf, " internal comm unit\n\r"); if (cyber_flags & CYBER_EYES ) strcat(buf, " infrared eyes\n\r"); if (cyber_flags & CYBER_LEGS ) strcat(buf, " leg enhancements\n\r"); if (cyber_flags & CYBER_CHEST ) strcat(buf, " chest plating\n\r"); if (cyber_flags & CYBER_REFLEXES ) strcat(buf, " augmented reflexes\n\r"); if (cyber_flags & CYBER_MIND ) strcat(buf, " internal computer\n\r"); if (cyber_flags & CYBER_STRENGTH ) strcat(buf, " augmented muscles\n\r"); if (cyber_flags & CYBER_REACTOR ) strcat(buf, " Internal Reactor\n\r"); if (cyber_flags & CYBER_STERILE ) strcat(buf, " Cyber Sterialation\n\r"); return ( buf[0] != '\0' ) ? buf+1 : "none"; } ********************************************************************************************************** /* misc.c */ ********************************************************************************************************** in function do_eat: find: case ITEM_PILL: change: else if ( ch->pcdata->condition[COND_FULL] > 40 ) to: else if ( ch->pcdata->condition[COND_FULL] > 40 && !IS_SET( ch->pcdata->cyber , CYBER_REACTOR) ) find: * Fullness checking -Thoric change: if( !IS_NPC( ch ) && ( ch->pcdata->condition[COND_FULL] >= 48 || ch->pcdata->condition[COND_THIRST] >= 48 ) ) to: if ( !IS_NPC(ch) && !IS_SET( ch->pcdata->cyber, CYBER_REACTOR) && ( ch->pcdata->condition[COND_FULL] >= 48 || ch->pcdata->condition[COND_THIRST] >= 48 ) ) at the end of the file add: void do_cyber(CHAR_DATA *ch, char *argument) { CHAR_DATA *mob; char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; int cost; if ( IS_NPC(ch) ) return; /* check for surgeon */ for ( mob = ch->in_room->first_person; mob; mob = mob->next_in_room ) { if ( IS_NPC(mob) && IS_SET(mob->act, ACT_IS_SURGEON) ) break; } /* if there are no surgeon, display the characters enhancements*/ if ( mob == NULL ) { sprintf(buf, "Cyber Parts:\n\r %s\n\r", cyber_bit_name(ch->pcdata->cyber)); send_to_char(buf,ch); return; } one_argument(argument,arg); /* if there are a surgeon, give a list*/ if (arg[0] == '\0') { /* display price list */ do_say( mob, "&RI have these parts in stock&r:&G&C" ); do_say( mob,"&C&W comm&R :&G Internal Comm Unit&Y 7500&C Credits&"); do_say( mob,"&W eyes&R :&G Infrared Eyes&Y 10000&C Credits"); do_say( mob,"&W legs&R :&G Cyber Replacements&Y 12500&C Credits"); do_say( mob,"&W reflex&R :&G Augmented Reflexes&Y 15000&C Credits"); do_say( mob,"&W mind&R :&G Internal Computer&Y 16000&C Credits"); do_say( mob,"&W muscle&R :&G Augmented Muscles&Y 16000&C Credits"); do_say( mob,"&W chest&R :&G External Chest Plating&Y 17500&C Credits"); do_say( mob,"&W reactor&R :&G Internal Reactor&Y 20000&C Credits"); // do_say( mob," sterile&R :&G cybernetic sterliation&Y 11500&C Credits"); do_say( mob,"&R Type cyber&C &R to buy one, or help cyber to get more info.&G&C"); return; } /* Lets see what the character wants to have */ if (!str_prefix(arg,"comm")) { cost = 7500; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_COMM)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_COMM ); } else if (!str_prefix(arg,"eyes")) { cost = 10000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_EYES)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_EYES ); ch->affected_by = AFF_INFRARED; } else if (!str_prefix(arg,"legs")) { cost = 12500; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_LEGS)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_LEGS ); ch->max_move += number_range ( 200 , 500 ); } else if (!str_prefix(arg,"chest")) { cost = 17500; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_CHEST)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_CHEST ); } else if (!str_prefix(arg,"reflex")) { cost = 15000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_REFLEXES)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_REFLEXES ); } else if (!str_prefix(arg,"reactor")) { cost = 20000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber, CYBER_REACTOR)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_REACTOR ); ch->max_move += number_range ( 200 , 500 ); } else if (!str_prefix(arg,"chest")) { cost = 17500; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_CHEST)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_CHEST ); } else if (!str_prefix(arg,"reflex")) { cost = 15000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_REFLEXES)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_REFLEXES ); } else if (!str_prefix(arg,"reactor")) { cost = 20000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_REACTOR)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_REACTOR ); } else if (!str_prefix(arg,"mind")) { cost = 450000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_MIND)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_MIND ); } else if (!str_prefix(arg,"muscle")) { cost = 16000; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services." ); return; } if (IS_SET(ch->pcdata->cyber,CYBER_STRENGTH)) { do_say(mob,"You already got that part." ); return; } SET_BIT (ch->pcdata->cyber, CYBER_STRENGTH ); } else if (!str_prefix(arg,"sterile")) { cost = 11500; if (cost > (ch->gold)) { do_say( mob, "You do not have enough credits for my services."); return; } if (IS_SET(ch->pcdata->cyber,CYBER_STERILE)) { do_say(mob,"You already have had that operation"); return; } SET_BIT(ch->pcdata->cyber,CYBER_STERILE); } else { do_say( mob, "Type 'cyber' for a list of cybernetics." ); return; } WAIT_STATE(ch,PULSE_VIOLENCE); ch->gold -= cost; do_say( mob,"There we go, better then then the original." ); } ********************************************************************************************************** /* mud.h */ ********************************************************************************************************** after: #define DFND_GRIP BV21 /* 21 def's */ add: /* defines the cybernetic parts */ #define CYBER_COMM BV01 #define CYBER_EYES BV02 #define CYBER_LEGS BV03 #define CYBER_CHEST BV04 #define CYBER_REFLEXES BV05 #define CYBER_MIND BV06 #define CYBER_STRENGTH BV07 #define CYBER_REACTOR BV08 #define CYBER_STERILE BV09 in struct pc_Data add: int cyber; under: /* * Character macros. */ add: #define GET_MAX_STR(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->str_plus + \ ( IS_SET((ch)->pcdata->cyber, CYBER_STRENGTH) ? 1 : 0 ) ) ) #define GET_MAX_DEX(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->dex_plus + \ ( IS_SET((ch)->pcdata->cyber, CYBER_REFLEXES) ? 1 : 0 ) ) ) #define GET_MAX_INT(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->int_plus + \ ( IS_SET((ch)->pcdata->cyber, CYBER_MIND) ? 1 : 0 ) ) ) #define GET_MAX_WIS(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->wis_plus ) ) #define GET_MAX_CON(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->con_plus ) ) #define GET_MAX_CHA(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->cha_plus ) ) #define GET_MAX_LCK(CH) ( IS_NPC((ch)) ? 20 : ( 20 + race_table[(ch)->race]->lck_plus ) ) find: DECLARE_DO_FUN( do_cset ); under add: DECLARE_DO_FUN( do_cyber ); find: char *magic_bit_name args( ( int magic_flags ) ); under add: char *cyber_bit_name args( ( int cyber_flags ) ); find your ACT BITS add: #define ACT_IS_SURGEON BVXX /* A surgeon mob */ NOTE: replace XX with the next BV number ********************************************************************************************************** /* player.c */ ********************************************************************************************************** in do_score find: if (!IS_NPC(ch) && ch->pcdata->condition[COND_THIRST] == 0) replace with: if (!IS_NPC(ch) && ch->pcdata->condition[COND_THIRST] == 0 && !IS_SET(ch->pcdata->cyber, CYBER_REACTOR)) find: if (!IS_NPC(ch) && ch->pcdata->condition[COND_FULL] == 0) replace with: if (!IS_NPC(ch) && ch->pcdata->condition[COND_FULL] == 0 && !IS_SET(ch->pcdata->cyber, CYBER_REACTOR)) ********************************************************************************************************** /* save.c */ ********************************************************************************************************** in fwrite_char find: fprintf( fp, "Gold %d\n", ch->gold ); under it add: if ( ch->pcdata->cyber ) fprintf( fp, "Cyber %d\n", ch->pcdata->cyber ); { int ability; for ( ability = 0 ; ability < MAX_ABILITY ; ability++ ) fprintf( fp, "Ability %d %d %ld\n", ability , ch->skill_level[ability] , ch->experience[ability] ); } in fread_char find: case 'C': under it add: KEY( "Cyber", ch->pcdata->cyber, fread_number( fp ) ); ********************************************************************************************************** /* update.c */ ********************************************************************************************************** in hit_gain find: if( ch->pcdata->condition[COND_FULL] == 0 ) gain /= 2; if( ch->pcdata->condition[COND_THIRST] == 0 ) gain /= 2; replace with: if ( ch->pcdata->condition[COND_FULL] == 0 && !IS_SET(ch->pcdata->cyber, CYBER_REACTOR) ) gain /= 2; if ( ch->pcdata->condition[COND_THIRST] == 0 && !IS_SET(ch->pcdata->cyber, CYBER_REACTOR) ) gain /= 2; in gain_condition find: if( value == 0 || IS_NPC( ch ) || get_trust( ch ) >= LEVEL_IMMORTAL || NOT_AUTHED( ch ) || IS_DROID( ch ) ) return; under it add: if ( ( ( iCond == COND_FULL ) || ( iCond == COND_THIRST ) ) && (ch->pcdata->cyber & CYBER_REACTOR ) ) return; find: case COND_FULL: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_FULL: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) ) find: case COND_THIRST: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_THIRST: if ( ch->top_level <= LEVEL_AVATAR && !( ch->pcdata->cyber & CYBER_REACTOR) ) find: if( ch->pcdata->condition[iCond] == 1 ) under find: case COND_FULL: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_FULL: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) ) find: case COND_THIRST: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_THIRST: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) ) find: if( ch->pcdata->condition[iCond] == 2 ) under it find: case COND_FULL: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_FULL: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) ) find: case COND_THIRST: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_THIRST: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) ) find: if( ch->pcdata->condition[iCond] == 3 ) under it find: case COND_FULL: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_FULL: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) ) find: case COND_THIRST: if( ch->top_level <= LEVEL_AVATAR ) replace with: case COND_THIRST: if ( ch->top_level <= LEVEL_AVATAR && !(ch->pcdata->cyber & CYBER_REACTOR) )