- Posts: 452
- Thank you received: 79
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
thomas wrote: Something like this?
Code:int it_is_christmas() { time_t t = time(NULL); struct tm tm = *localtime(&t); if (tm.tm_mon == 11 && tm.tm_mday == 25) { return TRUE; } return FALSE; }
Now you can check in gain_exp() ( github.com/tbamud/tbamud/blob/master/src/limits.c#L235 ) whether it is happy hour:
Code:if (gain > 0) { if ((IS_HAPPYHOUR) && (IS_HAPPYEXP)) gain += (int)((float)gain * ((float)HAPPY_EXP / (float)(100))); gain = MIN(CONFIG_MAX_EXP_GAIN, gain); /* put a cap on the max gain per kill */ + if (it_is_christmas()) { + gain *= 2; + }
Please Log in or Create an account to join the conversation.
tbaMUD © 2024