Here you go - I have coded up a procedure to add to mud_event.c (with the corresponding prototype in mud_event.h) that will let you change the duration of an event by id. This only works on character events.
Please let me know if you find problems with this code or find a better way.
Thanks!
Code:
void change_event_duration(struct char_data * ch, event_id iId, long time) {
struct event * pEvent;
struct mud_event_data * pMudEvent;
bool found = FALSE;
if (ch->events->iSize == 0)
return;
simple_list(NULL);
while ((pEvent = (struct event *) simple_list(ch->events)) != NULL) {
if (!pEvent->isMudEvent)
continue;
pMudEvent = (struct mud_event_data * ) pEvent->event_obj;
if (pMudEvent->iId == iId) {
found = TRUE;
break;
}
}
simple_list(NULL);
if (found) {
/* So we found the offending event, now build a new one, with the new time */
attach_mud_event(new_mud_event(iId, pMudEvent->pStruct, pMudEvent->sVariables), time);
event_cancel(pEvent);
}
}