Ok, first off, I'm really new to programming. I'm learning RoR because I just don't feel like learning PHP. Anyway. My question would actually work for either, but here goes:
I am trying to figure out how to handle having NPCs that give players unique items. Example: Roger Dodger gives Player1 the Sword of Destruction. Roger Dodger is now -1 Sword of Destruction and Player1 is now + 1 Sword of Destruction (inventory). Obviously, in Player1's game world, you want it so that he can't just go off and sell the item and come back to the same NPC and get another one. So our NPC, Roger Dodger only has 1 Sword of Destruction to give to Player1. The problem is he also needs to be able to give that same item to any other player who encounters him.
My newb brain can't figure out how to do the database to account for this, because just having a NPC table with the items in a column would make it so that only one player could obtain that item. How do you make it so the NPCs have items for all the players and then have it so the NPC always registers that they no longer have the item once a player obtains it without affecting other players?
Does that even make sense?