Enemy randomly drop items

charliehgreencharliehgreen ArizonaMember Posts: 233
Hello,

Can anyone tell me how to create this?
Once an enemy has been defeated, there's a random chance he will drop the item I've created.

kind of like how on other games when you hunt enemies for let's say a "potion" and after killing that enemy like 5-10 times then he drops it.

Thanks,

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    when an enemy is killed, generate a random number between 1 and 10. then have a behavior that say if that random number equals 1 drop the item. so there is a 1 in 10 chance the enemy will drop an item.
  • TheGabfatherTheGabfather Member Posts: 633
    edited April 2013
    Create a Table with X number of Rows/Columns, then populate each Cell with either an Item Name/Indicator or leave it blank. The more blanks you have, obviously the more chances of the monster not dropping anything.

    And then as suggested above, use the Random Function with a minimum of 1 and maximum of X, and pick the corresponding Cell from the Table.

    OR

    You can create a Table with just enough Cells to fit in all your possible item drops (no more empty cells).

    Then randomize from 1 to 10, and if say 1 is picked then randomize within the Table to choose an item to drop.

    Both should work :)
Sign In or Register to comment.