give_reward - ryzom/ryzomcore GitHub Wiki


title: Give Reward description: published: true date: 2023-03-12T22:42:39.160Z tags: editor: markdown dateCreated: 2023-03-12T22:10:41.257Z

giveReward

The giveReward native AI script function sends a message to the EGS server to reward a player and notifies a specified NPC group of the reward.

TODO: This function causes one or more undocumented user event IDs to be triggered on the NPC group that is to be notified. The list of notifications needs to be documented here. {.is-danger}

TODO: This document is autogenerated and has not yet been reviewed. {.is-danger}

Syntax

()giveReward(rewardText: s, rareRewardText: s, inventoryFullText: s, notEnoughPointsText: s, groupToNotify: c)

Arguments

  • rewardText (string): The text to display when the player receives a regular reward.
  • rareRewardText (string): The text to display when the player receives a rare reward.
  • inventoryFullText (string): The text to display when the player's inventory is full.
  • notEnoughPointsText (string): The text to display when the player does not have enough points.
  • groupToNotify (context): The NPC group that will receive user events to notify of the reward.

Notes

This function sends a message to the EGS server to reward the player and notify the NPC group of the reward.

Example

(@groupToNotify)group_name.context();
()giveReward("You got a reward!", "You got a rare reward!", "Your inventory is full.", "You don't have enough points.", @groupToNotify);

This example code sends a reward message to the EGS server with the specified texts and sends user events to the group_name group to notify of the reward.

⚠️ **GitHub.com Fallback** ⚠️