What is formula to get rare items diablo 2 style?

0 favourites
  • 6 posts
From the Asset Store
Slot Machine Games. suitable for workers who work from home because it has player names that must be played alternately
  • I'm looking for a formula to get rare items each enemy destroyed and leaves a rare item by 20% chance. Not be in frequency.

    Could you help me?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm not really sure what you mean but I believe a Diablo style loot system involves a sizable array with different prefix and suffix values that get attached to each object based on chance, and each of those values do something different to the loot.

    But if you simply want an enemy to drop a weapon on death based on chance, do the event "compare two values" and use something like "round(random(0,100))" and for percentage, make the second value "is less than or equal to 20" and that will commit the action in a 20% chance.

  • Sushin I will try it this method, maybe it seems 50% chance for some reason because it's using random.

    If you played some RPG game, when you face against, the hit chance is 20% is likely you get "miss" if you attack him. Otherwise if hit chance is 90% is almost impossible to get "miss".

    Isn't another serious method like Fire Emblem game?

  • If you choose a random value between numbers 0 and 100, and then choose any value lower than 50, that is effectively a 50% chance that the number is anywhere between 0 and 50 (almost, depending on how rounding works). If you go higher or lower than 50 than it should be a higher or lower chance. It's not a coin flip.

    What you can do is create a variable called "hit chance" and it can change to any number you want. If it is accuracy, and you put it at 70 accuracy, you can use this accuracy variable to check against the random variable, so the code would look like this: "If round(random(0,100)) is less than accuracy" and that will give you a 70% chance to hit, and you can change accuracy whenever you want for a player or whatever.

  • Sushin thanks for clearing! I believe it would work.

  • Well I can't say the exact random values. The behaviour seems to indicate a result mechanism similar too this layout. Also keep in mind that diablo2 uses a layered percentage. So rolling could actually result in 2 drops. on the base kill rolling 10% would drop gold AND an item.

    50% to drop gold

    10% to drop item

    on item

    90% for potion(random 50/50)

    10% for gear

    on gear

    90% vender stuff

    10% magical

    on magical(sorry, i don't recall the colour scheme)

    60% green(common)

    30% blue(rare)

    10% super(very rare)

    this results in an increase decelinitino of odds. Also in Diablo 2, items were unknown. The reason was that then they can spawn the stats when a "Identify" was used. The item had a base level(based on creature) ans the stats were pulled on the level scale.

    obviously set pieces were a little different :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)