here a unrestore for anyone that would like to know how i finally got a idea to work just a revamped restore could doing the backward affect which would be a unrestore. :) i also added in my code for you have unrestoretime for a timer system if you evil like some imms i know.
/*Unrestore by Lex*/
void do_unrestore( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
bool unboost=FALSE;
set_char_color( AT_IMMORT, ch );
argument = one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Unrestore whom?\n\r", ch );
return;
}
argument = one_argument( argument, arg2 );
if ( !str_cmp( arg2, "unboost" ) && get_trust( ch ) >= LEVEL_SUB_IMPLEM )
{
send_to_char( "Unboosting!\n\r", ch );
unboost = TRUE;
}
if ( !str_cmp( arg, "all" ) )
{
CHAR_DATA *vch;
CHAR_DATA *vch_next;
if ( !ch->pcdata )
return;
if ( get_trust( ch ) < LEVEL_SUB_IMPLEM )
{
if ( IS_NPC( ch ) )
{
send_to_char( "You can't do that.\n\r", ch );
return;
}
else
{
/* Check if the player did a unrestore all within the last 18 hours. */
if ( current_time - last_unrestore_all_time < UNRESTORE_INTERVAL )
{
send_to_char( "Sorry, you can't do a unrestore all yet.\n\r", ch );
do_unrestoretime( ch, "" );
return;
}
}
}
last_unrestore_all_time = current_time;
ch->pcdata->unrestore_time = current_time;
save_char_obj( ch );
send_to_char( "Beginning 'unrestore all' ...\n\r", ch);
for ( vch = first_char; vch; vch = vch_next )
{
vch_next = vch->next;
if ( !IS_NPC( vch ) && !IS_IMMORTAL( vch )
&& !CAN_PKILL( vch ) && !in_arena( vch ) )
{
if ( unboost )
vch->hit = 1;
else
vch->hit = 1;
vch->mana = 1;
vch->move = 1;
update_pos (vch);
act( AT_IMMORT, "$n has unrestored you.", ch, NULL, vch, TO_VICT);
}
}
send_to_char( "Unrestored.\n\r", ch );
}
else
{
CHAR_DATA *victim;
if ( ( victim = get_char_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( get_trust( ch ) < LEVEL_LESSER
&& victim != ch
&& !( IS_NPC( victim ) && xIS_SET(victim->act, ACT_PROTOTYPE ) ) )
{
send_to_char( "You can't do that.\n\r", ch );
return;
}
if ( unboost )
victim->hit = 1;
else
victim->hit= 1;
victim->mana = 1;
victim->move = 1;
update_pos( victim );
if ( ch != victim )
act( AT_IMMORT, "$n has unrestored you.", ch, NULL, victim, TO_VICT );
send_to_char( "Unrestored.\n\r", ch );
return;
}
}
|