receive_mission_items - ryzom/ryzomcore GitHub Wiki


title: Receive Mission Items description: published: true date: 2023-03-13T15:24:34.125Z tags: editor: markdown dateCreated: 2023-03-13T13:59:13.872Z

receiveMissionItems

The receiveMissionItems native AI script function allows a targeted NPC to ask for mission items from the targeting player in Ryzom Ring.

This function can only be called after the event "player_target_npc". It only works on an R2 shard for R2 plot items. {.is-warning}

Syntax

receiveMissionItems(missionItems: s, missionText: s, groupToNotify: c)

Arguments

  • missionItems (string): The list of mission items to be requested, in the format "item1:qty1;item2:qty2;...".
  • missionText (string): The text that will appear in the NPC's contextual menu.
  • groupToNotify (context): The NPC group that will receive the user events triggered after the player has given the mission items to the NPC.

Example

(@groupToNotify)group_name.context();
receiveMissionItems("toto.sitem:2;tata.sitem:1;titi.sitem:3", "Mission text", @groupToNotify);

This example code asks for three different mission items ("toto.sitem", "tata.sitem", and "titi.sitem") from the targeting player. The text "Mission text" will appear in the NPC's contextual menu. The NPC group named "group_name" will receive user events after the player has given the mission items to the NPC.

Notes

After the player has been asked for the mission items, a new entry will be added to the NPC's contextual menu to allow the player to give the mission items to the NPC if they have them. User events are triggered on the group to inform it about what happens:

  • user_event_1: Triggered if the player has the requested mission items.
  • user_event_2: Triggered if the player does not have the requested mission items.
  • user_event_3: Triggered after the player has given the mission items to the NPC.
⚠️ **GitHub.com Fallback** ⚠️