Managing Granted Rewards

When a reward is granted outside of quests, the reward key is stored into the database. This is because if certain dialogue is supposed to grant a reward (such as talking to a random NPC), we wouldn't want the player to get the same reward every time they talk to them. The game needs a way to remember if the reward has been granted already.

Received quest rewards are not saved in the database because in the case where quests are repeatable, we would want the player to receive the rewards again. Also, if a quest is not repeatable, the player would not be able to get the rewards anyway.

In dialogue, the reward key can be used to divert dialogue in a completely different path. See Boolean (If) Node.

Checking if a Reward Was Granted

if (QT.HasReward("MyRewardKey"))
{
    // Do something...
}

Getting Rewards

The database does not store which specific items were granted. It simply stores the reward key.

Adding Rewards

var reward = new QTRewardItem(quest.ID, "MyRewardKey", "MyItemObject", 1);
QT.AddReward(reward);

Alternative Method

Rewards are saved in the database as a RewardEntry. You can use this class to save rewards instead.

var reward = new RewardEntry("MyRewardKey");
QT.AddReward(reward);

Removing Rewards

QT.DeleteReward("MyRewardKey");

Last updated