Not so hard, really.
To trigger a happy hour, you just need to set the HAPPY_TIME to the number of ticks it should last.
github.com/tbamud/tbamud/blob/master/src/act.other.c#L926
So, in the game loop, add a function call to something that does this (browser code):
Code:
void should_we_start_happy_hour() {
if (HAPPY_TIME) {
return; // already in a happy hour.
}
if (rand_number(1, 10000) < 5) { // adjust numbers to vary chance of starting a happy hour this tick
// also adjust these if you wish
HAPPY_EXP = 100;
HAPPY_GOLD = 50;
HAPPY_QP = 50;
HAPPY_TIME = rand_number(30, 70);
game_info("A Happyhour has started!");
}
}