Modifications2- Kracus ---------------------------------------------------------------- /* Pit must be in ROOM_VNUM_ALTAR which is defined in merc.h */ void do_donate( CHAR_DATA *ch, char *argument, int amount ) { OBJ_DATA *pit; OBJ_DATA *obj; ROOM_INDEX_DATA *original, *donateroom; char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; argument = one_argument(argument, arg); if (arg[0] == '\0' ) { send_to_char("What item do you wish to donate?\n\r",ch); return; } if (ch->position == POS_FIGHTING) { send_to_char(" You cannot donate while fighting!\n\r",ch); return; } if ( (obj = get_obj_carry (ch, arg, ch)) == NULL) { send_to_char("You do not have that item in your inventory!\n\r",ch); return; } else { if (!can_drop_obj(ch, obj) && ch->level < 61) { send_to_char("You cannot donate this item.\n\r",ch); return; } if ((obj->item_type == ITEM_CORPSE_NPC) || (obj->item_type == ITEM_CORPSE_PC)) { send_to_char("You cannot donate that item!\n\r",ch); return; } if (obj->level > 52) { send_to_char("You cannot donate that item!\n\r",ch); return; } if (obj->timer > 0) { send_to_char("You cannot donate that item!\n\r",ch); return; } if((donateroom = get_room_index(ROOM_VNUM_ALTAR)) == NULL) { send_to_char("There is no donate room available at this time.\n\r",ch); return; } if(ch->in_room == donateroom) { send_to_char("You are in the donate room, just put the item in the donation chest.\n\r",ch); return; } original = ch->in_room; char_from_room(ch); char_to_room(ch,donateroom); if((pit = get_obj_list(ch, "pit", ch->in_room->contents)) == NULL) { send_to_char("There is no donation chest available at this time.\n\r",ch); char_from_room(ch); char_to_room(ch,original); return; } if(ch->in_room != get_room_index(ROOM_VNUM_ALTAR)) act("$n graciously donates $p.",ch,obj,NULL,TO_ROOM); act("You graciously donate $p.",ch,obj,NULL,TO_CHAR); obj_from_char(obj); obj_to_obj(obj, pit); char_from_room(ch); char_to_room(ch,original); return; } } -------------------------------------------------------------- /* Kracus(Ishamael)- bug fix for characters with same name */ /* logging in at same time.."+" means add line in */ /* Deal with sockets that haven't logged in yet. */ void nanny( DESCRIPTOR_DATA *d, char *argument ) { DESCRIPTOR_DATA *d_old, *d_next; char buf[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH]; CHAR_DATA *ch; char *pwdnew; char *p; int iClass,race,i,weapon, l; bool fOld; /* Delete leading spaces UNLESS character is writing a note */ if (d->connected != CON_NOTE_TEXT) { while ( isspace(*argument) ) argument++; } ch = d->character; switch ( d->connected ) { default: bug( "Nanny: bad d->connected %d.", d->connected ); close_socket( d ); return; case CON_ANSI: if (argument[0] == '\0' || UPPER(argument[0]) == 'Y') { d->ansi = TRUE; d->connected = CON_GET_NAME; { extern char * help_greeting; if ( help_greeting[0] == '.') send_to_desc( help_greeting+1, d ); else send_to_desc( help_greeting , d ); } break; } if (UPPER(argument[0]) == 'N') { d->ansi = FALSE; d->connected = CON_GET_NAME; { extern char * help_greeting; if ( help_greeting[0] == '.') send_to_desc ( help_greeting+1, d ); else send_to_desc( help_greeting , d ); } break; } else { send_to_desc("Do you want color in Legends Forgotten: (Y)es or (N)o. ", d ); return; } case CON_GET_NAME: if ( argument[0] == '\0' ) { close_socket( d ); return; } argument[0] = UPPER(argument[0]); if ( !check_parse_name( argument ) ) { write_to_buffer( d, "Illegal name, try another.\n\rName: ", 0 ); return; } + /* Bug Fix for char creation of same name at same time */ + { + DESCRIPTOR_DATA *wd; + char *name = argument; + + for( wd = descriptor_list; wd; wd = wd->next ) + { + if( wd->character == NULL + || wd->character->name == NULL + || wd->character->name[0] == '\0') + continue; + if( wd->character->level > 1 ) + continue; + if( is_full_name(name, wd->character->name)) + { + write_to_buffer( d,"\n\rThere is another player creating a character with this name.\n\rWhat is your name: ",0); + return; + } + } + } + /* end bug fix */ fOld = load_char_obj( d, argument ); ch = d->character; --------------------------------------------------------- /* Kracus(Ishamael)- bug fix for stealing nodrop objects */ if ( ( obj = get_obj_carry( victim, arg1, ch ) ) == NULL ) { send_to_char( "You can't find it.\n\r", ch ); return; } if ( !can_drop_obj( ch, obj ) || IS_SET(obj->extra_flags, ITEM_INVENTORY) + || IS_SET(obj->extra_flags, ITEM_NODROP) || (ch->level <= 5 && ch->level < obj->level) || (ch->level < 100 && obj->level >= 100) || (ch->level < 150 && obj->level >= 150) || (ch->level < 192 && obj->level >= 192)) { send_to_char( "You can't pry it away.\n\r", ch ); return; } ------------------------------------------------------------------------ /* Kracus(Ishamael)- code for showing linkdead players via look */ void show_char_to_char_0( CHAR_DATA *victim, CHAR_DATA *ch ) { char buf[MAX_STRING_LENGTH],message[MAX_STRING_LENGTH]; buf[0] = '\0'; + if ( victim->desc == NULL && !IS_NPC(victim)) strcat( buf, "{r(LinkDead){x " ); if ( IS_SET(victim->comm,COMM_AFK ) ) strcat( buf, "{r[AFK]{x " ); if ( IS_AFFECTED(victim, AFF_INVISIBLE) ) strcat( buf, "{C(Invis){x " ); ------------------------------------------------------------------------- /* Krondor- disarms secondary first if wielding...if no secondary */ /* then it will disarm the primary weapon. */ /* Disarm a creature. Caller must check for successful attack. */ void disarm( CHAR_DATA *ch, CHAR_DATA *victim ) { OBJ_DATA *obj; + /* ***Krondor*** */ + if ( ( obj = get_eq_char( victim, WEAR_SECONDARY ) ) == NULL ) + if ( ( obj = get_eq_char( victim, WEAR_WIELD ) ) == NULL ) + return; + /* ***Krondor*** */ if ( IS_OBJ_STAT(obj,ITEM_NOREMOVE)) { act("$S weapon won't budge!",ch,NULL,victim,TO_CHAR); act("$n tries to disarm you, but your weapon won't budge!", ch,NULL,victim,TO_VICT); act("$n tries to disarm $N, but fails.",ch,NULL,victim,TO_NOTVICT); return; } act( "$n {rDISARMS{x you and sends your weapon flying!", ch, NULL, victim, TO_VICT ); act( "You disarm $N!", ch, NULL, victim, TO_CHAR ); act( "$n disarms $N!", ch, NULL, victim, TO_NOTVICT ); obj_from_char( obj ); if ( IS_OBJ_STAT(obj,ITEM_NODROP) || IS_OBJ_STAT(obj,ITEM_INVENTORY) ) obj_to_char( obj, victim ); else { obj_to_room( obj, victim->in_room ); if (IS_NPC(victim) && victim->wait == 0 && can_see_obj(victim,obj)) get_obj(victim,obj,NULL); } return; } ----------------------------------------------------------------------- /* Kracus(Ishamael)- bug fix for shopkeepers not seeing Imms */ /* replace the existing line with the + line */ /* Shopping commands. */ CHAR_DATA *find_keeper( CHAR_DATA *ch ) { /*char buf[MAX_STRING_LENGTH];*/ CHAR_DATA *keeper; SHOP_DATA *pShop; pShop = NULL; for ( keeper = ch->in_room->people; keeper; keeper = keeper->next_in_room ) { if ( IS_NPC(keeper) && (pShop = keeper->pIndexData->pShop) != NULL ) break; } if ( pShop == NULL ) { send_to_char( "You can't do that here.\n\r", ch ); return NULL; } /* * Undesirables. * if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_KILLER) ) { do_say( keeper, "Killers are not welcome!" ); sprintf( buf, "%s the KILLER is over here!\n\r", ch->name ); do_yell( keeper, buf ); return NULL; } if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_THIEF) ) { do_say( keeper, "Thieves are not welcome!" ); sprintf( buf, "%s the THIEF is over here!\n\r", ch->name ); do_yell( keeper, buf ); return NULL; } */ /* Shop hours. */ if ( time_info.hour < pShop->open_hour ) { do_say( keeper, "Sorry, I am closed. Come back later." ); return NULL; } if ( time_info.hour > pShop->close_hour ) { do_say( keeper, "Sorry, I am closed. Come back tomorrow." ); return NULL; } /* Invisible or hidden people. */ + if ( !can_see( keeper, ch ) && !IS_IMMORTAL( ch ) ) { do_say( keeper, "I don't trade with folks I can't see." ); return NULL; } return keeper; }