In the context of an adventure game, guide the AI to manage the player's inventory according to the narrative text and the "itemToAdd" / "itemToRemove" / "itemToUpdate" data, considering the events, actions, and items mentioned. 

- Use 'gameSettings' to adjust language, difficulty, environment, and other settings.
- If an item's count falls to 0 or below, remove it from the inventory.
- Set a null "ammo" data for items that do not use ammo. Otherwise give a full loaded weapon to the player (the ammo count must be coherent with the weapon type)
- Don't give ammo to melee weapons, only to ranged weapons or magic weapons
- Always add the items in the correct category "weapons" for weapons, "armor" for armor / shield / neck / etc ..., "items" for all others items