New direction with it, what we are leaning towards now, is that at the moment of death, your new body is transferred to an infirmary, at a cost in exp (same as death) and gold.
Rather than creating a Character Corpse, you will simply be knocked out, and awaken in the sick house with all of your gear.
New death message indicating what happened to you, and re-equiping the new body with current EQ. Here are the lines of code that concern me, with some questions following, for anyone who wants to step up and reply.
Thanks!
Gregar
Current code:
void make_corpse( CHAR_DATA *ch, CHAR_DATA *killer )
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *corpse;
OBJ_DATA *obj;
OBJ_DATA *obj_next;
ROOM_INDEX_DATA *location;
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;
}
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;
location = get_room_index ( ROOM_VNUM_MORGUE );
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 )
{
sprintf( buf, "%s", killer->name );
STRFREE( corpse->action_desc );
corpse->action_desc = STRALLOC( buf );
}
/* Added corpse name - make locate easier , other skills */
sprintf( buf, "corpse %s", name );
STRFREE( corpse->name );
corpse->name = STRALLOC( buf );
sprintf( buf, corpse->short_descr, name );
STRFREE( corpse->short_descr );
corpse->short_descr = STRALLOC( buf );
sprintf( buf, 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 );
}
if (IS_NPC(ch))
obj_to_room( corpse, ch->in_room );
else
obj_to_room (corpse,location );
return;
}
Proposed butchered code :
void make_corpse( CHAR_DATA *ch, CHAR_DATA *killer )
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *corpse;
OBJ_DATA *obj;
OBJ_DATA *obj_next;
ROOM_INDEX_DATA *location;
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;
}
corpse->cost = (-(int)ch->pIndexData->vnum);
corpse->value[2] = corpse->timer;
}
/* Added corpse name - make locate easier , other skills */
sprintf( buf, "corpse %s", name );
STRFREE( corpse->name );
corpse->name = STRALLOC( buf );
sprintf( buf, corpse->short_descr, name );
STRFREE( corpse->short_descr );
corpse->short_descr = STRALLOC( buf );
sprintf( buf, 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, location );
}
if (IS_NPC(ch))
obj_to_room( corpse, ch->in_room );
else
obj_to_room (obj, location );
return;
}
So, will this work?
Thank ya. |