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.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Affect Timer
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Dace K
Canada (169 posts) Bio
|
Date
| Sat 10 May 2003 04:40 AM (UTC) |
Message
| Hey. Does anybody know where the updating for affects
is located? I need to change the time for spell/skill affects from rounds (seconds) to beats. I can't find it, and it's rather annoying me. If anyone could post, I'd appreciate. Thanks. |
ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com
Drop by the area archives and find something for your mud. http://areaarchives.servegame.com | Top |
|
Posted by
| Boborak
USA (228 posts) Bio
|
Date
| Reply #1 on Sat 10 May 2003 09:47 PM (UTC) |
Message
| As per our MSN conversation:
First comment out the old timer stuff in violence_update() in fight.c:
/*
for ( timer = ch->first_timer; timer; timer = timer_next )
{
timer_next = timer->next;
if ( --timer->count <= 0 )
{
if ( timer->type == TIMER_DO_FUN )
{
int tempsub;
DO_FUN *current = timer->do_fun;
tempsub = ch->substate;
ch->substate = timer->value;
extract_timer( ch, timer );
(current)( ch, "" );
if ( char_died(ch) )
break;
ch->substate = tempsub;
}
else
extract_timer( ch, timer );
}
}
*/
Add this to update.c somewhere:
void update_timers( void )
{
DESCRIPTOR_DATA *d;
CHAR_DATA *ch;
for ( d = first_descriptor; d; d = d->next )
{
if ( d->connected == CON_PLAYING )
ch = d->character;
else
continue;
for ( timer = ch->first_timer; timer; timer = timer_next )
{
timer_next = timer->next;
if ( --timer->count <= 0 )
{
if ( timer->type == TIMER_DO_FUN )
{
int tempsub;
DO_FUN *current = timer->do_fun;
tempsub = ch->substate;
ch->substate = timer->value;
extract_timer( ch, timer );
(current)( ch, "" );
if ( char_died(ch) )
break;
ch->substate = tempsub;
}
else
extract_timer( ch, timer );
}
}
}
return;
}
then in update_handler add:
static int pulse_timercheck;
if ( --pulse_timercheck <= 0 )
{
pulse_check = PULSE_TIMERCHECK;
update_timers ( );
}
add the PULSE_TIMERCHECK to mud.h
I whipped this up real quick, hopefully you can fill in the blanks. But this should give you control over the timers as you want. | Top |
|
Posted by
| Dace K
Canada (169 posts) Bio
|
Date
| Reply #2 on Sat 10 May 2003 10:52 PM (UTC) |
Message
| Boborak 0wns. Just thought you all should know that =D. |
ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com
Drop by the area archives and find something for your mud. http://areaarchives.servegame.com | 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.
12,317 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top