Is it possible to use advanced scripting to build drop tables that avoid rolling repeats / re-roll when they land on an entry that has been rolled before?
E.g.
If 1d3 = 1 "Helmet", = 2 "Spear" = 3 "Sword". Say you've already rolled a 3 last time and got a sword and you want the system to no longer consider Swords as a drop item (so the next one has to be a Helmet or a Spear, how would that be coded?
Three ways that come to mind are to somehow replace the entry linked to rolling a 3 (Sword) from the consideration list (either replace it with another item from a larger item list that say also includes hammers. When a 3 "Sword" is rolled, the variable Itemon3 is changed to "Hammer", so rolling a 3 now gives a "Hammer". (Though how to prevent an item from being double injected from the master list becomes the next problem, don't want rolling a 1, 2, and 3 to all give hammers accidentally)
Second way is to add a manual if/else, if 3 has been rolled before, 'Hammer' would be hardcoded as the outcome, Else Sword, but this is laborious and fairly restrictive in scope.
Third way is a counter Times3roll = 0, if 3 rolled Times3roll = 1. Based on the value of that counter, I'd set a lookup via if else to pull back a value (e.g. 3roll at 0 gives Sword, at 1 gives Hammer, >1 gives Warhammer, so I'm covered if 3 is rolled >2 times).
How would you recommend as the best way to do this. 3 items are indicative, I'll probably be running drop tables of 1d100, wherein rare drops would be on a 99 or 100, and more common ones would have more slots
Trying to bake this into my game mechanics,
Thanks in advance,
StrykerL