Here's parts of the baru tailor quest from the main clone server that uses both features:
Main
{
questname "Baru Supplies (daily)"
version 1
}
state Begin
{
desc "Talk baru Shepherd, Limbo Desert."
action Roll(5)
rule DoneDaily( 1 ) goto EndWithoutReset // once a day ( 1 )
rule Rolled(1) goto Ing1
rule Rolled(2) goto Ing2
rule Rolled(3) goto Ing3
rule Rolled(4) goto Ing4
rule Rolled(5) goto Ing5
}
// ...
state GetReward
{
action ShowHint("You gained 1500 EXP and a Baru flock! (DAILY)");
action PlaySound(17);
action GiveItem( 492, 1 )
action GiveExp(1500)
action ResetDaily();
}
state EndWithoutReset
{
desc "Talk baru Shepherd, Limbo Desert."
action ShowHint("You can only complete this quest once a day.");
action AddNpcText( 57 , "[ you cannot complete this quest today , please come back tomorrow ]" );
rule TalkedToNpc( 57 ) goto Reset // requires to talk
}
state Reset
{
action ShowHint("Baru Supplies quest aborted..")
action Reset(); // reset and abort quest
}
TL;DR:
The Roll action generates a random number from 1 to n, then the Rolled rule lets you select an action based on the outcome of that roll.
ResetDaily is similar to Reset but it also saves a persistent counter for the quest that increases by 1 each time it's called (and is reset back to 0 at midnight UTC). You can test that value at the start of the quest with DoneDaily(n), where n is the number of times you want the quest to be
completable every day (usually once daily).