Code for Rom2.4b4: wearon code v1.0 by Kracus Thanks to the people below for making muds possible! :) Based on ROM Version 2.4 beta (c)1993-96 Russ Taylor Based on Merc 2.1 code by Hatchet, Furey, and Kahn Original DikiMud by: Hans Staerfeldt, Katja Nyboe, Tom Madsen, Micheal Seifert, Sebastian Hammer ...please keep the credit headers in the code itself. Note(1): in merc.h we adjusted args( ) to be just ( ) so just add in the regular Rom2.4, "args" before the ( ) if they are needed in your code. char *affect_bit_wearon( int vector ); char *affect2_bit_wearon( int vector ); Note(2): take out the wear_secondary and wear_face positions for wearing eq if you don't have those in your mud, since stock Rom2.4b4 does not have those wear_positions. Note(3): replace the eq wear-restrictions in the first if-statement to match those found on your mud. Note(4): this code is very large, and repetitive. You could add the code to do_wear and code it also taking into account eq wear restrictions, since a player can still do_wear on a piece of eq that is out of level, even though it will just do a return; and he won't be able to wear the eq. Note(5): in handler.c change the affects to fit your mud. Also note that you can make any kind of message for wearing eq with affects, immunities, resistances, and vulnerabilities. Also note that I use AFF2 Bit-Code by Rage, thanks Rage. So, if you don't have aff2 bit-code, leave that part out in handler.c and merc.h. Note(6) I did Not include the aff2 bit-code in wear_obj so, you will have to add that in yourself, I don't use the affect2_bit_wearon, at least not yet on eq, so no need to add TO_AFFECTS2 case statement into wear_obj if you want to use wearon2 messages. *wear_obj This code will show affected eq when wearing the eq no matter if doing a "wear all" or just a singular "wear" and the code is adjustable for each wear_position. So, replace the wear_obj with the one provided below. File: merc.h ---------------------------------------------------------------- // Kracus- WearOn affects char *affect_bit_wearon( int vector ); char *affect2_bit_wearon( int vector ); File: act_obj.c ---------------------------------------------------------------- // Kracus- WearOn Code additions to new wear_obj // modified for aff,imm,res,vuln eq. void wear_obj( CHAR_DATA *ch, OBJ_DATA *obj, bool fReplace ) { char buf[MAX_STRING_LENGTH]; AFFECT_DATA *paf; // Kracus- added for wearon if (( ch->level <= 5 && ch->level < obj->level ) || (ch->level < 50 && obj->level >= 50) || (ch->level < 100 && obj->level >= 100) || (ch->level < 150 && obj->level >= 150) || (ch->level < 251 && obj->level >= 251)) { sprintf( buf, "You must be a higher level to use this object.\n\r"); send_to_char( buf, ch ); act( "$n tries to use $p, but is too inexperienced.", ch, obj, NULL, TO_ROOM ); return; } if ( obj->item_type == ITEM_LIGHT ) { if ( !remove_obj( ch, WEAR_LIGHT, fReplace ) ) return; act( "$n lights $p and holds it.", ch, obj, NULL, TO_ROOM ); act( "You light $p and hold it.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_LIGHT ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_FINGER ) ) { if ( get_eq_char( ch, WEAR_FINGER_L ) != NULL && get_eq_char( ch, WEAR_FINGER_R ) != NULL && !remove_obj( ch, WEAR_FINGER_L, fReplace ) && !remove_obj( ch, WEAR_FINGER_R, fReplace ) ) return; if ( get_eq_char( ch, WEAR_FINGER_L ) == NULL ) { act( "$n wears $p on $s left finger.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your left finger.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_FINGER_L ); return; } if ( get_eq_char( ch, WEAR_FINGER_R ) == NULL ) { act( "$n wears $p on $s right finger.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your right finger.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_FINGER_R ); return; } bug( "Wear_obj: no free finger.", 0 ); send_to_char( "You already wear two rings.\n\r", ch ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_NECK ) ) { if ( get_eq_char( ch, WEAR_NECK_1 ) != NULL && get_eq_char( ch, WEAR_NECK_2 ) != NULL && !remove_obj( ch, WEAR_NECK_1, fReplace ) && !remove_obj( ch, WEAR_NECK_2, fReplace ) ) return; if ( get_eq_char( ch, WEAR_NECK_1 ) == NULL ) { act( "$n wears $p around $s neck.", ch, obj, NULL, TO_ROOM ); act( "You wear $p around your neck.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_NECK_1 ); return; } if ( get_eq_char( ch, WEAR_NECK_2 ) == NULL ) { act( "$n wears $p around $s neck.", ch, obj, NULL, TO_ROOM ); act( "You wear $p around your neck.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_NECK_2 ); return; } bug( "Wear_obj: no free neck.", 0 ); send_to_char( "You already wear two neck items.\n\r", ch ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_BODY ) ) { if ( !remove_obj( ch, WEAR_BODY, fReplace ) ) return; act( "$n wears $p on $s body.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your body.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_BODY ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_HEAD ) ) { if ( !remove_obj( ch, WEAR_HEAD, fReplace ) ) return; act( "$n wears $p on $s head.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your head.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_HEAD ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_LEGS ) ) { if ( !remove_obj( ch, WEAR_LEGS, fReplace ) ) return; act( "$n wears $p on $s legs.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your legs.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_LEGS ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_FEET ) ) { if ( !remove_obj( ch, WEAR_FEET, fReplace ) ) return; act( "$n wears $p on $s feet.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your feet.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_FEET ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_HANDS ) ) { if ( !remove_obj( ch, WEAR_HANDS, fReplace ) ) return; act( "$n wears $p on $s hands.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your hands.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_HANDS ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_ARMS ) ) { if ( !remove_obj( ch, WEAR_ARMS, fReplace ) ) return; act( "$n wears $p on $s arms.", ch, obj, NULL, TO_ROOM ); act( "You wear $p on your arms.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_ARMS ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_ABOUT ) ) { if ( !remove_obj( ch, WEAR_ABOUT, fReplace ) ) return; act( "$n wears $p about $s body.", ch, obj, NULL, TO_ROOM ); act( "You wear $p about your body.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_ABOUT ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_WAIST ) ) { if ( !remove_obj( ch, WEAR_WAIST, fReplace ) ) return; act( "$n wears $p about $s waist.", ch, obj, NULL, TO_ROOM ); act( "You wear $p about your waist.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_WAIST ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_WRIST ) ) { if ( get_eq_char( ch, WEAR_WRIST_L ) != NULL && get_eq_char( ch, WEAR_WRIST_R ) != NULL && !remove_obj( ch, WEAR_WRIST_L, fReplace ) && !remove_obj( ch, WEAR_WRIST_R, fReplace ) ) return; if ( get_eq_char( ch, WEAR_WRIST_L ) == NULL ) { act( "$n wears $p around $s left wrist.", ch, obj, NULL, TO_ROOM ); act( "You wear $p around your left wrist.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_WRIST_L ); return; } if ( get_eq_char( ch, WEAR_WRIST_R ) == NULL ) { act( "$n wears $p around $s right wrist.", ch, obj, NULL, TO_ROOM ); act( "You wear $p around your right wrist.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_WRIST_R ); return; } bug( "Wear_obj: no free wrist.", 0 ); send_to_char( "You already wear two wrist items.\n\r", ch ); return; } if ( CAN_WEAR( obj, ITEM_WEAR_SHIELD ) ) { OBJ_DATA *weapon; if ( !remove_obj( ch, WEAR_SHIELD, fReplace ) ) return; weapon = get_eq_char(ch,WEAR_WIELD); if (weapon != NULL && ch->size < SIZE_LARGE && IS_WEAPON_STAT(weapon,WEAPON_TWO_HANDS)) { send_to_char("Your hands are tied up with your weapon!\n\r",ch); return; } if(get_eq_char(ch, WEAR_SECONDARY) !=NULL) { send_to_char("You cannot use a shield while using 2 weapons.\n\r",ch); return; } act( "$n wears $p as a shield.", ch, obj, NULL, TO_ROOM ); act( "You wear $p as a shield.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_SHIELD ); return; } if ( CAN_WEAR( obj, ITEM_WIELD ) ) { int sn,skill; if ( !remove_obj( ch, WEAR_WIELD, fReplace ) ) return; if ( !IS_NPC(ch) && get_obj_weight(obj) > (str_app[get_curr_stat(ch,STAT_STR)].wield * 10)) { send_to_char( "It is too heavy for you to wield.\n\r", ch ); return; } /*Kracus-added to fix wielding str bug*/ if((get_eq_char(ch, WEAR_SECONDARY)) !=NULL) { send_to_char("Remove your secondary weapon first.\n\r",ch); return; } if (!IS_NPC(ch) && ch->size < SIZE_LARGE && IS_WEAPON_STAT(obj,WEAPON_TWO_HANDS) && get_eq_char(ch,WEAR_SHIELD) != NULL) { send_to_char("You need two hands free for that weapon.\n\r",ch); return; } act( "$n wields $p.", ch, obj, NULL, TO_ROOM ); act( "You wield $p.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_WIELD ); sn = get_weapon_sn(ch); if (sn == gsn_hand_to_hand) return; skill = get_weapon_skill(ch,sn); if (skill >= 100) act("$p feels like a part of you!",ch,obj,NULL,TO_CHAR); else if (skill > 85) act("You feel quite confident with $p.",ch,obj,NULL,TO_CHAR); else if (skill > 70) act("You are skilled with $p.",ch,obj,NULL,TO_CHAR); else if (skill > 50) act("Your skill with $p is adequate.",ch,obj,NULL,TO_CHAR); else if (skill > 25) act("$p feels a little clumsy in your hands.",ch,obj,NULL,TO_CHAR); else if (skill > 1) act("You fumble and almost drop $p.",ch,obj,NULL,TO_CHAR); else act("You don't even know which end is up on $p.", ch,obj,NULL,TO_CHAR); return; } if ( CAN_WEAR( obj, ITEM_HOLD ) ) { if ( !remove_obj( ch, WEAR_HOLD, fReplace ) ) return; if(get_eq_char(ch, WEAR_SECONDARY) !=NULL) { send_to_char("You cannot hold an item while using two weapons.\n\r",ch); return; } act( "$n holds $p in $s hand.", ch, obj, NULL, TO_ROOM ); act( "You hold $p in your hand.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_HOLD ); return; } if ( CAN_WEAR(obj,ITEM_WEAR_FLOAT) ) { if (!remove_obj(ch,WEAR_FLOAT, fReplace) ) return; act("$n releases $p to float next to $m.",ch,obj,NULL,TO_ROOM); act("You release $p and it floats next to you.",ch,obj,NULL,TO_CHAR); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char(ch,obj,WEAR_FLOAT); return; } if ( CAN_WEAR( obj, ITEM_WEAR_FACE ) ) { if ( !remove_obj( ch, WEAR_FACE, fReplace ) ) return; act( "$n wears $p over $s face.", ch, obj, NULL, TO_ROOM ); act( "You wear $p over your face.", ch, obj, NULL, TO_CHAR ); // Kracus- WearOn Code for( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) { if(paf->bitvector) { switch(paf->where) { case TO_AFFECTS: sprintf(buf,"%s\n\r", affect_bit_wearon(paf->bitvector)); break; case TO_IMMUNE: sprintf(buf,"You have become immune to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_RESIST: sprintf(buf,"You have become resistant to %s.\n\r", imm_bit_name(paf->bitvector)); break; case TO_VULN: sprintf(buf,"You feel vulnerable to %s.\n\r", imm_bit_name(paf->bitvector)); break; default: sprintf(buf,"BUG in EQ: %d: %d. Notify Admin Staff.\n\r", paf->where,paf->bitvector); break; } send_to_char( buf, ch ); } } // end WearOn Code equip_char( ch, obj, WEAR_FACE ); return; } if ( fReplace ) send_to_char( "You can't wear, wield, or hold that.\n\r", ch ); return; } File: handler.c ---------------------------------------------------------------- // WearOn Code by Kracus char *affect_bit_wearon( int vector ) { static char buf[512]; buf[0] = '\0'; if ( vector & AFF_BLIND ) strcat( buf, "\n\rYou have been blinded." ); if ( vector & AFF_INVISIBLE ) strcat( buf, "\n\rYou become invisible." ); if ( vector & AFF_DETECT_EVIL ) strcat( buf, "\n\rYou can now detect evil." ); if ( vector & AFF_DETECT_GOOD ) strcat( buf, "\n\rYou can now detect good." ); if ( vector & AFF_DETECT_INVIS ) strcat( buf, "\n\rYou can now detect invis." ); if ( vector & AFF_DETECT_MAGIC ) strcat( buf, "\n\rYou can now detect magic." ); if ( vector & AFF_DETECT_HIDDEN ) strcat( buf, "\n\rYou can now detect hidden things." ); if ( vector & AFF_SANCTUARY ) strcat( buf, "\n\rYou are surrounded in a white aura." ); if ( vector & AFF_FAERIE_FIRE ) strcat( buf, "\n\rYou are surrounded in faerie fire." ); if ( vector & AFF_INFRARED ) strcat( buf, "\n\rYou can now see in the infrared spectrum." ); if ( vector & AFF_CURSE ) strcat( buf, "\n\rYou are cursed." ); if ( vector & AFF_POISON ) strcat( buf, "\n\rYou feel sick." ); if ( vector & AFF_PROTECT_EVIL ) strcat( buf, "\n\rYou feel the prescence of evil." ); if ( vector & AFF_PROTECT_GOOD ) strcat( buf, "\n\rYou feel the prescence of good." ); if ( vector & AFF_SLEEP ) strcat( buf, "\n\rYou become very tired..." ); if ( vector & AFF_SNEAK ) strcat( buf, "\n\rYou hide your movements in the shadows." ); if ( vector & AFF_HIDE ) strcat( buf, "\n\rYou hide yourself in the shadows." ); if ( vector & AFF_CHARM ) strcat( buf, "\n\rYou lose control of your physical abilities." ); if ( vector & AFF_FLYING ) strcat( buf, "\n\rYou rise up into the air." ); if ( vector & AFF_PASS_DOOR ) strcat( buf, "\n\rYou turn translucent." ); if ( vector & AFF_BERSERK ) strcat( buf, "\n\rYou feel yourself in a rage." ); if ( vector & AFF_CALM ) strcat( buf, "\n\rYou feel calmer." ); if ( vector & AFF_HASTE ) strcat( buf, "\n\rYou feel yourself moving more quickly." ); if ( vector & AFF_SLOW ) strcat( buf, "\n\rYou feel like you are in slow motion." ); if ( vector & AFF_PLAGUE ) strcat( buf, "\n\rYou are plagued with an unknown disease." ); if ( vector & AFF_DARK_VISION ) strcat( buf, "\n\rYou can now see with dark vision." ); return ( buf[0] != '\0' ) ? buf+1 : ""; } // WearOn Code by Kracus char *affect2_bit_wearon( int vector ) { static char buf[512]; buf[0] = '\0'; if ( vector & AFF2_SUPER_SANCTUARY ) strcat( buf, "\n\rYou are surrounded in an amber aura." ); return ( buf[0] != '\0' ) ? buf+1 : ""; }