The giveMissionItems native AI script function adds a contextual menu entry to an NPC that allows a player to receive mission items from the NPC. When the player clicks the entry, the items are placed in their inventory and a user event is triggered on the callback group.
This function can only be called from a
player_target_npcevent handler. It only works on R2 shards for R2 plot items.
()giveMissionItems(missionItems: s, missionText: s, groupToNotify: c)
"sheet_id:quantity;sheet_id:quantity;...". Example: "reward_item.sitem:1"Same format as receiveMissionItems: semicolon-separated entries of sheet_id:quantity.
sheet_id_1:quantity_1;sheet_id_2:quantity_2
| Event | When |
|---|---|
user_event_1 |
The player has received the items from the NPC |
Unlike receiveMissionItems, there is no check for inventory space or item availability — the menu entry is always shown. If the items cannot be given (invalid sheet IDs, etc.), a warning is logged.
CReceiveItemRequestMsg is sent to EGS with the item listuser_event_1 is triggered on the callback group// In a player_target_npc event handler:
(@myGroup)context();
()giveMissionItems("quest_reward.sitem:1;bonus_item.sitem:2", "Receive your reward", @myGroup);
Handle the completion:
// user_event_1: player received the items
()npcSay(0, "say", "Here you go! Use them wisely.");
Source: ryzom/server/src/ai_service/nf_grp_npc.cpp (giveMissionItems_ssc_)