question

bunzaga@gmail.com avatar image
bunzaga@gmail.com asked

Table with chance of 'no' item?

I wanted to put a chance that 'no' item would be dropped from a drop table, for example:

50% chance no item is dropped.

33% chance common item is dropped.

15% chance rare item is dropped.

2% chance epic item is dropped.

For now I put a 'null_item' in my item catalog, is this the best way to do it, or is there a better way?

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

·
brendan avatar image
brendan answered

Right now, all "slots" in  the random drop table must be associated with an item in the game catalog. So one way you could do this would be to add an item called something like "nullItem" (making sure it's a stackable), and then not show the item to the player (and consume it from the user's inventory).

Alternately, you could do a call to get a random number which tells you whether or not to give the player a reward. So, for example, you could have three bundles, which give the player 1, 2, and 3 items from a drop table, respectively. You could then generate a 0-4 number, and choose to give them bundle 1, 2, 3, or no bundle at all.

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.