Rpg quest / inventory question

i need an example of code. basically im trying to get a quest system working where the hero visits a npc which gives him a quest to return with a head as the quest item. when the hero kills the desired monster it places the head in the inventory, and when you return to the quest npc a check is made to see if the quest item is in your inventory. if it is then you get the reward, if you dont he tells you he is still waiting for the head.

//monster temp
_root.mName = “Orc”
_root.mLoot = “Orc Head”

//quest npc
_root.nName = “King”
_root.qItem = “Orc Head”

//i dont need help with the _root.txt’s just giving u example of what i want
_root.txt = “Bring me the head of the Orc that is attacking our town.”
//insert check inventory code here, and if true:
_root.txt = “Well done” + _root.name + “, you recieve” + _root.qGP + “gold”
//if it is false:
_root.txt = “Im still waiting on that head” + _root.name + “!”

could someone give me an example of a little inventory system and how to check if qItem is in the inventory? Im also open to suggestions on better ways to code this.