void start_tag( void ) { DESCRIPTOR_DATA *d, *d_next; ROOM_INDEX_DATA *loc; char buf[MAX_INPUT_LENGTH]; int count = 0; tag_game.status = TAG_ISPLAY; tag_game.timer = 2 * tag_game.playing; for ( d = first_descriptor; d; d = d_next ) { d_next = d->next; if ( d->connected != CON_PLAYING || !d->character || IS_NPC( d->character ) ) continue; if ( xIS_SET( d->character->act, PLR_WAITING ) ) { count++; loc = get_room_index( number_range( FTAG_MIN_VNUM, FTAG_MAX_VNUM ) ); xREMOVE_BIT( d->character->act, PLR_FROZEN ); xREMOVE_BIT( d->character->act, PLR_WAITING ); xSET_BIT( d->character->act, PLR_PLAYING ); char_from_room( d->character ); char_to_room( d->character, loc ); do_look( d->character, ( char * ) "auto" ); } } sprintf( buf, "&R[&WEvento de congelación&R] &C¡El evento va a comenzar! hay &Y%d&C personas jugando.", count ); tag_channel( NULL, buf ); }
/* * Reset one room. */ void reset_room( ROOM_INDEX_DATA * room ) { RESET_DATA *pReset, *tReset, *gReset; OBJ_DATA *nestmap[MAX_NEST]; CHAR_DATA *mob; OBJ_DATA *obj, *lastobj, *to_obj; ROOM_INDEX_DATA *pRoomIndex = NULL; MOB_INDEX_DATA *pMobIndex = NULL; OBJ_INDEX_DATA *pObjIndex = NULL, *pObjToIndex; EXIT_DATA *pexit; const char *filename = room->area->filename; int level = 0, n, num = 0, lastnest, onreset = 0; mob = NULL; obj = NULL; lastobj = NULL; if ( !room->first_reset ) return; level = 0; for ( pReset = room->first_reset; pReset; pReset = pReset->next ) { ++onreset; switch ( pReset->command ) { default: bug( "%s: %s: bad command %c.", __FUNCTION__, filename, pReset->command ); break; case 'M': if ( !( pMobIndex = get_mob_index( pReset->arg1 ) ) ) { bug( "%s: %s: 'M': bad mob vnum %d.", __FUNCTION__, filename, pReset->arg1 ); continue; } if ( !( pRoomIndex = get_room_index( pReset->arg3 ) ) ) { bug( "%s: %s: 'M': bad room vnum %d.", __FUNCTION__, filename, pReset->arg3 ); continue; } if ( !pReset->sreset ) { mob = NULL; break; } mob = create_mobile( pMobIndex ); { ROOM_INDEX_DATA *pRoomPrev = get_room_index( pReset->arg3 - 1 ); if ( pRoomPrev && xIS_SET( pRoomPrev->room_flags, ROOM_PET_SHOP ) ) xSET_BIT( mob->act, ACT_PET ); } if ( room_is_dark( pRoomIndex ) ) xSET_BIT( mob->affected_by, AFF_INFRARED ); mob->resetvnum = pRoomIndex->vnum; mob->resetnum = onreset; pReset->sreset = false; char_to_room( mob, pRoomIndex ); level = URANGE( 0, mob->level - 2, LEVEL_AVATAR ); if ( pReset->first_reset ) { for ( tReset = pReset->first_reset; tReset; tReset = tReset->next_reset ) { ++onreset; switch ( tReset->command ) { case 'G': case 'E': if ( !( pObjIndex = get_obj_index( tReset->arg1 ) ) ) { bug( "%s: %s: 'E' or 'G': bad obj vnum %d.", __FUNCTION__, filename, tReset->arg1 ); continue; } if ( !mob ) { lastobj = NULL; break; } if ( mob->pIndexData->pShop ) { int olevel = generate_itemlevel( room->area, pObjIndex ); obj = create_object( pObjIndex, olevel ); xSET_BIT( obj->extra_flags, ITEM_INVENTORY ); } else obj = create_object( pObjIndex, number_fuzzy( level ) ); obj->level = URANGE( 0, obj->level, LEVEL_AVATAR ); obj = obj_to_char( obj, mob ); if ( tReset->command == 'E' ) { if ( obj->carried_by != mob ) { bug( "'E' reset: can't give object %d to mob %d.", obj->pIndexData->vnum, mob->pIndexData->vnum ); break; } equip_char( mob, obj, tReset->arg3 ); } for ( n = 0; n < MAX_NEST; n++ ) nestmap[n] = NULL; nestmap[0] = obj; lastobj = nestmap[0]; lastnest = 0; if ( tReset->first_reset ) { for ( gReset = tReset->first_reset; gReset; gReset = gReset->next_reset ) { int iNest; to_obj = lastobj; ++onreset; switch ( gReset->command ) { case 'H': if ( !lastobj ) break; xSET_BIT( lastobj->extra_flags, ITEM_HIDDEN ); break; case 'P': if ( !( pObjIndex = get_obj_index( gReset->arg1 ) ) ) { bug( "%s: %s: 'P': bad obj vnum %d.", __FUNCTION__, filename, gReset->arg1 ); continue; } iNest = gReset->extra; if ( !( pObjToIndex = get_obj_index( gReset->arg3 ) ) ) { bug( "%s: %s: 'P': bad objto vnum %d.", __FUNCTION__, filename, gReset->arg3 ); continue; } if ( iNest >= MAX_NEST ) { bug( "%s: %s: 'P': Exceeded nesting limit of %d", __FUNCTION__, filename, MAX_NEST ); obj = NULL; break; } if ( count_obj_list( pObjIndex, to_obj->first_content ) > 0 ) { obj = NULL; break; } if ( iNest < lastnest ) to_obj = nestmap[iNest]; else if ( iNest == lastnest ) to_obj = nestmap[lastnest]; else to_obj = lastobj; obj = create_object( pObjIndex, number_fuzzy( UMAX( generate_itemlevel( room->area, pObjIndex ), to_obj->level ) ) ); if ( num > 1 ) pObjIndex->count += ( num - 1 ); obj->count = gReset->arg2; obj->level = UMIN( obj->level, LEVEL_AVATAR ); obj->count = gReset->arg2; obj_to_obj( obj, to_obj ); if ( iNest > lastnest ) { nestmap[iNest] = to_obj; lastnest = iNest; } lastobj = obj; /* * Hackish fix for nested puts */ if ( gReset->arg3 == OBJ_VNUM_MONEY_ONE ) gReset->arg3 = to_obj->pIndexData->vnum; break; } } } break; } } } break; case 'O': if ( !( pObjIndex = get_obj_index( pReset->arg1 ) ) ) { bug( "%s: %s: 'O': bad obj vnum %d.", __FUNCTION__, filename, pReset->arg1 ); continue; } if ( !( pRoomIndex = get_room_index( pReset->arg3 ) ) ) { bug( "%s: %s: 'O': bad room vnum %d.", __FUNCTION__, filename, pReset->arg3 ); continue; } if ( count_obj_list( pObjIndex, pRoomIndex->first_content ) < 1 ) { obj = create_object( pObjIndex, number_fuzzy( generate_itemlevel( room->area, pObjIndex ) ) ); if ( num > 1 ) pObjIndex->count += ( num - 1 ); obj->count = pReset->arg2; obj->level = UMIN( obj->level, LEVEL_AVATAR ); obj->cost = 0; obj_to_room( obj, pRoomIndex ); } else { int x; if ( !( obj = get_obj_room( pObjIndex, pRoomIndex ) ) ) { obj = NULL; lastobj = NULL; break; } obj->extra_flags = pObjIndex->extra_flags; for ( x = 0; x < 6; ++x ) obj->value[x] = pObjIndex->value[x]; } for ( n = 0; n < MAX_NEST; n++ ) nestmap[n] = NULL; nestmap[0] = obj; lastobj = nestmap[0]; lastnest = 0; if ( pReset->first_reset ) { for ( tReset = pReset->first_reset; tReset; tReset = tReset->next_reset ) { int iNest; to_obj = lastobj; ++onreset; switch ( tReset->command ) { case 'H': if ( !lastobj ) break; xSET_BIT( lastobj->extra_flags, ITEM_HIDDEN ); break; case 'T': if ( !IS_SET( tReset->extra, TRAP_OBJ ) ) { bug( "%s: Room reset found on object reset list", __FUNCTION__ ); break; } else { /* * We need to preserve obj for future 'T' checks */ OBJ_DATA *pobj; if ( tReset->arg3 > 0 ) { if ( !( pObjToIndex = get_obj_index( tReset->arg3 ) ) ) { bug( "%s: %s: 'T': bad objto vnum %d.", __FUNCTION__, filename, tReset->arg3 ); continue; } if ( room->area->nplayer > 0 || !( to_obj = get_obj_type( pObjToIndex ) ) || ( to_obj->carried_by && !IS_NPC( to_obj->carried_by ) ) || is_trapped( to_obj ) ) break; } else { if ( !lastobj || !obj ) break; to_obj = obj; } pobj = make_trap( tReset->arg2, tReset->arg1, number_fuzzy( to_obj->level ), tReset->extra ); obj_to_obj( pobj, to_obj ); } break; case 'P': if ( !( pObjIndex = get_obj_index( tReset->arg1 ) ) ) { bug( "%s: %s: 'P': bad obj vnum %d.", __FUNCTION__, filename, tReset->arg1 ); continue; } iNest = tReset->extra; if ( !( pObjToIndex = get_obj_index( tReset->arg3 ) ) ) { bug( "%s: %s: 'P': bad objto vnum %d.", __FUNCTION__, filename, tReset->arg3 ); continue; } if ( iNest >= MAX_NEST ) { bug( "%s: %s: 'P': Exceeded nesting limit of %d. Room %d.", __FUNCTION__, filename, MAX_NEST, room->vnum ); obj = NULL; break; } if ( count_obj_list( pObjIndex, to_obj->first_content ) > 0 ) { obj = NULL; break; } if ( iNest < lastnest ) to_obj = nestmap[iNest]; else if ( iNest == lastnest ) to_obj = nestmap[lastnest]; else to_obj = lastobj; obj = create_object( pObjIndex, number_fuzzy( UMAX( generate_itemlevel( room->area, pObjIndex ), to_obj->level ) ) ); if ( num > 1 ) pObjIndex->count += ( num - 1 ); obj->count = tReset->arg2; obj->level = UMIN( obj->level, LEVEL_AVATAR ); obj->count = tReset->arg2; obj_to_obj( obj, to_obj ); if ( iNest > lastnest ) { nestmap[iNest] = to_obj; lastnest = iNest; } lastobj = obj; /* * Hackish fix for nested puts */ if ( tReset->arg3 == OBJ_VNUM_MONEY_ONE ) tReset->arg3 = to_obj->pIndexData->vnum; break; } } } break; case 'T': if ( IS_SET( pReset->extra, TRAP_OBJ ) ) { bug( "%s: Object trap found in room %d reset list", __FUNCTION__, room->vnum ); break; } else { if ( !( pRoomIndex = get_room_index( pReset->arg3 ) ) ) { bug( "%s: %s: 'T': bad room %d.", __FUNCTION__, filename, pReset->arg3 ); continue; } if ( room->area->nplayer > 0 || count_obj_list( get_obj_index( OBJ_VNUM_TRAP ), pRoomIndex->first_content ) > 0 ) break; to_obj = make_trap( pReset->arg1, pReset->arg1, 10, pReset->extra ); obj_to_room( to_obj, pRoomIndex ); } break; case 'D': if ( !( pRoomIndex = get_room_index( pReset->arg1 ) ) ) { bug( "%s: %s: 'D': bad room vnum %d.", __FUNCTION__, filename, pReset->arg1 ); continue; } if ( !( pexit = get_exit( pRoomIndex, pReset->arg2 ) ) ) break; switch ( pReset->arg3 ) { case 0: REMOVE_BIT( pexit->exit_info, EX_CLOSED ); REMOVE_BIT( pexit->exit_info, EX_LOCKED ); break; case 1: SET_BIT( pexit->exit_info, EX_CLOSED ); REMOVE_BIT( pexit->exit_info, EX_LOCKED ); if ( IS_SET( pexit->exit_info, EX_xSEARCHABLE ) ) SET_BIT( pexit->exit_info, EX_SECRET ); break; case 2: SET_BIT( pexit->exit_info, EX_CLOSED ); SET_BIT( pexit->exit_info, EX_LOCKED ); if ( IS_SET( pexit->exit_info, EX_xSEARCHABLE ) ) SET_BIT( pexit->exit_info, EX_SECRET ); break; } break; case 'R': if ( !( pRoomIndex = get_room_index( pReset->arg1 ) ) ) { bug( "%s: %s: 'R': bad room vnum %d.", __FUNCTION__, filename, pReset->arg1 ); continue; } randomize_exits( pRoomIndex, pReset->arg2 - 1 ); break; } } }
int add_new_room_to_map( CHAR_DATA * ch, char code ) { int i; ROOM_INDEX_DATA *location; /* * Get an unused room to copy to */ for( i = ch->pcdata->area->low_r_vnum; i <= ch->pcdata->area->hi_r_vnum; i++ ) { if( get_room_index( i ) == NULL ) { if( !( location = make_room( i, ch->pcdata->area ) ) ) { bug( "%s: make_room failed", __FUNCTION__ ); return -1; } /* * Clones current room (quietly) */ location->area = ch->pcdata->area; location->name = STRALLOC( "Newly Created Room" ); location->description = STRALLOC( "Newly Created Room\r\n" ); xSET_BIT( location->room_flags, ROOM_PROTOTYPE ); location->light = 0; if( code == 'I' ) location->sector_type = SECT_INSIDE; else if( code == 'C' ) location->sector_type = SECT_CITY; else if( code == 'f' ) location->sector_type = SECT_FIELD; else if( code == 'F' ) location->sector_type = SECT_FOREST; else if( code == 'H' ) location->sector_type = SECT_HILLS; else if( code == 'M' ) location->sector_type = SECT_MOUNTAIN; else if( code == 's' ) location->sector_type = SECT_WATER_SWIM; else if( code == 'S' ) location->sector_type = SECT_WATER_NOSWIM; else if( code == 'A' ) location->sector_type = SECT_AIR; else if( code == 'D' ) location->sector_type = SECT_DESERT; else if( code == 'U' ) location->sector_type = SECT_DUNNO; else if( code == 'O' ) location->sector_type = SECT_OCEANFLOOR; else if( code == 'u' ) location->sector_type = SECT_UNDERGROUND; else if( code == 'U' ) location->sector_type = SECT_UNDERWATER; else if( code == 'L' ) location->sector_type = SECT_LAVA; else if( code == 'W' ) location->sector_type = SECT_SWAMP; else location->sector_type = SECT_DUNNO; return i; } } send_to_char( "No available room in your vnums!", ch ); return -1; }
void do_tag( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; DESCRIPTOR_DATA *d; char buf[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH]; if ( IS_NPC( ch ) || ch->fighting != NULL ) { send_to_char( "Deja de pelear primero.\r\n", ch ); return; } if ( tag_game.status == TAG_OFF ) { send_to_char( "No hay evento de congelación activo.\r\n", ch ); return; } argument = one_argument( argument, arg ); if ( !xIS_SET( ch->act, PLR_PLAYING ) ) { send_to_char( "No estás jugando ningún evento de congelación.\r\n", ch ); return; } if ( !arg || arg[0] == '\0' ) { send_to_char( "¡congelar a quién?\r\n", ch ); return; } if ( !( victim = get_char_room( ch, arg ) ) ) { send_to_char( "No está aquí.\r\n", ch ); return; } if ( victim == ch ) { send_to_char( "Claro, claaaro...\r\n", ch ); return; } if ( IS_NPC( victim ) ) { send_to_char( "Eso es un bicho.\r\n", ch ); return; } if ( !xIS_SET( victim->act, PLR_PLAYING ) ) { send_to_char( "No está jugando el evento de congelación.\r\n", ch ); return; } if ( xIS_SET( ch->act, PLR_FROZEN ) ) { send_to_char( "¡No puedes tocar, necesitas descongelarte!\r\n", ch ); return; } act( AT_GREEN, "$n te toca.", ch, NULL, victim, TO_VICT ); act( AT_GREEN, "$n toca a $N.", ch, NULL, victim, TO_NOTVICT ); act( AT_GREEN, "Tocas a $N.", ch, NULL, victim, TO_CHAR ); if ( ( xIS_SET( ch->act, PLR_RED ) && xIS_SET( victim->act, PLR_RED ) ) || ( xIS_SET( ch->act, PLR_BLUE ) && xIS_SET( victim->act, PLR_BLUE ) ) ) { if ( xIS_SET( victim->act, PLR_FROZEN ) ) { xREMOVE_BIT( victim->act, PLR_FROZEN ); act( AT_YELLOW, "¡Te descongelas!", ch, NULL, victim, TO_VICT ); act( AT_YELLOW, "¡$N se descongela!", ch, NULL, victim, TO_ROOM ); act( AT_YELLOW, "¡$N se descongela!", ch, NULL, victim, TO_CHAR ); snprintf( buf, MIL, "[&WEvento&R] %s &Cacaba de &Ydescongelar &Ra %s&C!!!\r\n", ch->name, victim->name ); arena_chan( buf ); } else act( AT_YELLOW, "¡$N se congela!", ch, NULL, victim, TO_CHAR ); } else { if ( xIS_SET( victim->act, PLR_FROZEN ) ) act( AT_YELLOW, "¡$N ya está!", ch, NULL, victim, TO_CHAR ); else { xSET_BIT( victim->act, PLR_FROZEN ); act( AT_YELLOW, "¡Te han congelado!", ch, NULL, victim, TO_VICT ); act( AT_YELLOW, "¡$N se congela!", ch, NULL, victim, TO_NOTVICT ); act( AT_YELLOW, "¡$N ha sido congelado!", ch, NULL, victim, TO_CHAR ); snprintf( buf, MIL, "[&WEvento&R] %s &Cacaba de &Ccongelar &Ra %s&C!!!\r\n", ch->name, victim->name ); arena_chan( buf ); check_team_frozen( victim ); } } }
void do_ftag( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; ROOM_INDEX_DATA *loc; char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; if ( IS_NPC( ch ) ) return; argument = one_argument( argument, arg1 ); if ( !arg1 || arg1[0] == '\0' ) { send_to_char( "sintaxis: congelacion entrar\r\n", ch ); send_to_char( "para comunicarte usa los canales rojo o azul.\r\n", ch ); send_to_char( "para congelar o descongelar a alguien una vez haya empezado el evento usa el comando tocar.\r\n", ch ); if ( IS_IMMORTAL( ch ) ) { send_to_char( "\r\nSintaxis: congelacion reset\r\n", ch ); send_to_char( " congelacion next\r\n", ch ); send_to_char( " congelacion start\r\n", ch ); send_to_char( " congelacion rojo <player>\r\n", ch ); send_to_char( " congelacion azul <player>\r\n", ch ); } return; } if ( arena_prep || challenge || arena_underway ) { send_to_char( "Espera a que termine el evento actual de arena.\r\n", ch ); return; } if ( !str_cmp( arg1, "entrar" ) ) { if ( tag_game.status != TAG_ISWAIT ) { send_to_char( "no hay ningún evento de congelación activo.\r\n", ch ); return; } if ( xIS_SET( ch->act, PLR_PLAYING ) || xIS_SET( ch->act, PLR_WAITING ) ) { send_to_char( "ya estás jugando.\r\n", ch ); return; } if ( !( loc = get_room_index( FTAG_WAIT_ROOM ) ) ) { send_to_char( "Espera a que termine el que ya hay empezado.\r\n", ch ); return; } send_to_char( "Entras al evento de congelación.\r\n", ch ); char_from_room( ch ); char_to_room( ch, loc ); tag_game.playing += 1; do_look( ch, ( char * ) "auto" ); xSET_BIT( ch->act, PLR_WAITING ); xREMOVE_BIT( ch->act, PLR_FROZEN ); xSET_BIT( ch->act, PLR_PKSAFE ); ch->quest_curr += 5; ch->quest_accum += 5; ch_printf( ch, "¡Ganas 5 puntos de gloria por participar en el evento!\r\n" ); if ( ( fRed = !fRed ) ) { xSET_BIT( ch->act, PLR_RED ); xREMOVE_BIT( ch->act, PLR_BLUE ); send_to_char( "&W¡formas parte del equipo &RROJO&W!\r\n", ch ); tag_channel( ch, "&R[&WEvento de congelación&R] &W¡$n forma parte del equipo &RROJO&W!" ); } else { xSET_BIT( ch->act, PLR_BLUE ); xREMOVE_BIT( ch->act, PLR_RED ); send_to_char( "&W¡formas parte del equipo &CAZUL&W!\r\n", ch ); tag_channel( ch, "&R[&WEvento de congelación&R] &W¡$n forma parte del equipo &CAZUL&W!" ); } return; } if ( !str_cmp( arg1, "start" ) ) { if ( GET_MONEY( ch, CURR_SILVER ) < 10 ) { send_to_char ( "necesitas 10 monedas de plata para comenzar el evento.\r\n", ch ); return; } if ( tag_game.status != TAG_OFF ) { send_to_char( "ya hay un juego en progreso.\r\n", ch ); return; } GET_MONEY( ch, CURR_SILVER ) -= 10; tag_channel( NULL, "&R[&WEvento&R] &C¡Ha comenzado un evento de congelación! ¡Teclea '&Wcongelacion entrar&C' para unirte!" ); tag_game.status = TAG_ISWAIT; tag_game.timer = 3; tag_game.playing = 0; tag_game.next = -1; if ( !IS_IMMORTAL( ch ) ) { GET_MONEY( ch, CURR_SILVER ) -= 10; return; } return; } if ( !IS_IMMORTAL( ch ) ) { do_ftag( ch, ( char * ) "" ); return; } if ( !str_cmp( arg1, "next" ) ) { tag_game.next = atoi( argument ); ch_printf( ch, "El próximo juego comenzará en %d ticks.\r\n", tag_game.next ); return; } if ( !str_cmp( arg1, "reset" ) ) { end_tag( ); send_to_char( "Jugadores reseteados.\r\n", ch ); return; } argument = one_argument( argument, arg2 ); if ( arg2[0] == '\0' || ( str_cmp( arg1, "rojo" ) && str_cmp( arg1, "azul" ) ) ) { send_to_char( "sintaxis: congelacion rojo <player>\r\n", ch ); send_to_char( " Congelacion azul <player>\r\n", ch ); return; } if ( tag_game.status == TAG_ISPLAY ) { send_to_char( "El juego ya ha comenzado.\r\n", ch ); return; } if ( !( victim = get_char_world( ch, arg2 ) ) ) { send_to_char( "No está aquí.\r\n", ch ); return; } if ( IS_NPC( victim ) ) { send_to_char( "No puede jugar.\r\n", ch ); return; } if ( !( loc = get_room_index( FTAG_WAIT_ROOM ) ) ) { send_to_char( "El evento de congelación todavía no ha finalizado.\r\n", ch ); return; } send_to_char( "Alguien te une al evento de congelación.\r\n", victim ); char_from_room( victim ); char_to_room( victim, loc ); tag_game.playing += 1; do_look( victim, ( char * ) "auto" ); xSET_BIT( victim->act, PLR_WAITING ); xREMOVE_BIT( victim->act, PLR_FROZEN ); xSET_BIT( victim->act, PLR_PKSAFE ); if ( !str_cmp( arg1, "rojo" ) ) { xSET_BIT( victim->act, PLR_RED ); xREMOVE_BIT( victim->act, PLR_BLUE ); act( AT_WHITE, "¡Formas parte del equipo &RROJO&W!", ch, NULL, victim, TO_VICT ); act( AT_WHITE, "¡$N forma parte del equipo &RROJO&W!", ch, NULL, victim, TO_NOTVICT ); act( AT_WHITE, "¡$N forma parte del equipo &RROJO&W!", ch, NULL, victim, TO_CHAR ); } else if ( !str_cmp( arg1, "blue" ) ) { xSET_BIT( victim->act, PLR_BLUE ); xREMOVE_BIT( victim->act, PLR_RED ); act( AT_WHITE, "¡Formas parte del equipo &Cazul&W!", ch, NULL, victim, TO_VICT ); act( AT_WHITE, "¡$N forma parte del equipo &CAZUL&W!", ch, NULL, victim, TO_NOTVICT ); act( AT_WHITE, "¡$N forma parte del equipo &CAZUL&W!", ch, NULL, victim, TO_CHAR ); } }
/* * Make a corpse out of a character. */ OBJ_DATA *make_corpse( CHAR_DATA * ch, CHAR_DATA * killer ) { char buf[MAX_STRING_LENGTH]; OBJ_DATA *corpse; OBJ_DATA *obj; OBJ_DATA *obj_next; const char *name; if( IS_NPC( ch ) ) { name = ch->short_descr; corpse = create_object( get_obj_index( OBJ_VNUM_CORPSE_NPC ), 0 ); corpse->timer = 6; if( ch->gold > 0 ) { if( ch->in_room ) { ch->in_room->area->gold_looted += ch->gold; sysdata.global_looted += ch->gold / 100; } obj_to_obj( create_money( ch->gold ), corpse ); ch->gold = 0; } /* Cannot use these! They are used. corpse->value[0] = (int)ch->pIndexData->vnum; corpse->value[1] = (int)ch->max_hit; */ /* Using corpse cost to cheat, since corpses not sellable */ corpse->cost = ( -( int )ch->pIndexData->vnum ); corpse->value[2] = corpse->timer; } else { name = ch->name; corpse = create_object( get_obj_index( OBJ_VNUM_CORPSE_PC ), 0 ); if( in_arena( ch ) ) corpse->timer = 0; else corpse->timer = 40; corpse->value[2] = ( int )( corpse->timer / 8 ); corpse->value[4] = ch->level; if( CAN_PKILL( ch ) && sysdata.pk_loot ) xSET_BIT( corpse->extra_flags, ITEM_CLANCORPSE ); /* * Pkill corpses get save timers, in ticks (approx 70 seconds) * This should be anough for the killer to type 'get all corpse'. */ if( !IS_NPC( ch ) && !IS_NPC( killer ) ) corpse->value[3] = 1; else corpse->value[3] = 0; } if( CAN_PKILL( ch ) && CAN_PKILL( killer ) && ch != killer ) { snprintf( buf, MAX_STRING_LENGTH, "%s", killer->name ); STRFREE( corpse->action_desc ); corpse->action_desc = STRALLOC( buf ); } /* * Added corpse name - make locate easier , other skills */ snprintf( buf, MAX_STRING_LENGTH, "corpse %s", name ); STRFREE( corpse->name ); corpse->name = STRALLOC( buf ); snprintf( buf, MAX_STRING_LENGTH, corpse->short_descr, name ); STRFREE( corpse->short_descr ); corpse->short_descr = STRALLOC( buf ); snprintf( buf, MAX_STRING_LENGTH, corpse->description, name ); STRFREE( corpse->description ); corpse->description = STRALLOC( buf ); for( obj = ch->first_carrying; obj; obj = obj_next ) { obj_next = obj->next_content; obj_from_char( obj ); if( IS_OBJ_STAT( obj, ITEM_INVENTORY ) || IS_OBJ_STAT( obj, ITEM_DEATHROT ) ) extract_obj( obj ); else obj_to_obj( obj, corpse ); } return obj_to_room( corpse, ch->in_room ); }