EOSERV Forum > EOSERV > New Quest Actions/Rules
Page: << 1 >>
New Quest Actions/Rules
Author Message
Post #198471 New Quest Actions/Rules

Can someone explain how to use ResetDaily, DoneDaily, Roll and Rolled? 

8 years, 28 weeks ago
Post #198479 Re: New Quest Actions/Rules

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).

8 years, 28 weeks ago
Post #198480 Re: New Quest Actions/Rules

It might be of importance to note that quests triggering ResetDaily() will store the quest state in the database as statename "done". For this reason it may be a good idea to never name a state "done" as the results would most likely result into an undesired loop.

8 years, 28 weeks ago
Page: << 1 >>

EOSERV Forum > EOSERV > New Quest Actions/Rules