question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Return different item every time from Drop Table?

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.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

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.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.