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.
receiveMissionItems(missionItems: s, missionText: s, groupToNotify: c)
(@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.
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.