title: Generating random numbers in a list of probabilities, and failing the roll if the line is taged with "false"
body: <p>I've seen some answers similar to mine but here is my problem:</p>
  
  <p>It's a game.</p>
  
  <p>I have a list of quests:</p>
  
  <p><a href="https://i.stack.imgur.com/FIlPk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FIlPk.png" alt="Quests"></a></p>
  
  <p>The sum of chances (col J) is 90% cause i want to fail in 10% of times.</p>
  
  <p>I'm trying to build a dynamic code that check all these quests (that can be added more in time), <strong>AND</strong> check the column "ON_PROGRESS".</p>
  
  <p>If column "on progress" is tagged with 1 (0 or 1), the quest cannot be rolled and it will add it % to the 10% failure that I already have.</p>
  
  <p>Another point is, the list will not be arranged like that (the higher prob to lower). Because I will add more at the end of the list (higher or lower prob)</p>
  
  <p>(tried my best at the explanation)</p>
  
  <p>Edit:</p>
  
  <p>I want the code to return me which quest I rolled (QUEST_ID in this case)</p>
  
  <p>RandomQuest()</p>
  
  <p>result = 2</p>
  
  <p>But with the conditions above.</p>