Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ unrestore
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Lex_Luther
Canada (4 posts) Bio
|
Date
| Sun 11 Apr 2004 02:17 AM (UTC) |
Message
| I'm wondering if anyone has a snippet or could tell me how to do a unrestore affect on players. Thanks :) for all your help if you help me | Top |
|
Posted by
| Lex_Luther
Canada (4 posts) Bio
|
Date
| Reply #1 on Sun 11 Apr 2004 09:33 PM (UTC) Amended on Sun 11 Apr 2004 09:43 PM (UTC) by Lex_Luther
|
Message
| 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;
}
}
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
8,780 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top