Hello everyone,
I was wondering if there is a way to return a different item from a drop table every time? I'm trying to make a luck-based weekly prize table, and I want that prize table to be unique every week.
For example; let's say there are 4 items and the drop table is like this:
Item1 1 10.000% Item2 2 20.000% Item3 3 30.000% Item4 4 40.000%
In the first evaluation, Item2 is selected. The result will be saved in Title Data. One week later, I will evaluate the drop table again over a scheduled task. In the 2nd evalutation, I don't want Item2 to be selected again; however, on the next week (3rd evaluation), Item2 can be selected again, because in the 2nd evaluation, something different would be selected.
One solution is: I can create different drop tables depending on the number of the items (in this case, 4 different drop tables). And depending on the last result, I can evaluate the related drop table that doesn't have the same item. The problem about this solution is that if I increase the number of items in the future, I need to create new drop tables as well. Also, this solution didn't look a proper way to me.
Answer by Sarah Zhang · Jan 12 at 09:49 AM
To implement your requirement, you need to remove the item2 in the table manually, then use your custom logic to select a new weighted random number. You can call the GetRandomResultTables to get the list of itemIds and weights firstly, then remove the info of item2 to get the new list. After you get the new list without item2, you can select a weighted random number based on the remaining itemIDs and weights.