Jump to content
  • 0

[Drop System] Item Selection


Question

Posted

Hello, guys.

It might be a stupid question but I didn't find antyhing useful in the web. I have one unclear point about l2 drop system.
As I undestand there are categories. Each category has chance to be selected randomly. And each category has one or more items within. But only one item could drop from the category. And that's what confuses me. For example, category has 4 items: item1 with 5% chance, item2 with 10% chance, item 3 with 25% chance and item4, item5 both with 30%.
And the random number is 15. Which item should be selected and how??? For me it looks logically if every item with chance > random chance should be selected but as I unsdenstood correcly this is not the case: only one item from category goes to the ground. But what kind of calculations can handle that? :poker face: 

 

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

Content within group is 100% and chance is cumulative.

 

double totalChance = 0;

final double random = (Rnd.nextDouble() * 100);

for (Item item : getItemOfGroup())

{

totalChance += item.getChance();

if (totalChance > random)

{

drop(item);

break;

}

}

Edited by Sdw
  • 0
Posted

Content within group is 100% and chance is cumulative.

 

double totalChance = 0;

final double random = (Rnd.nextDouble() * 100);

for (Item item : getItemOfGroup())

{

totalChance += item.getChance();

if (totalChance > random)

{

drop(item);

}

}

Oh I see. At the first glance it looked weird for me but now I see how the items with the same chance could be dropped  ^-^ 

Thank you)

  • 0
Posted (edited)

Forgot to break the loop !

Yes, I noticed it but it's still clear how to selecte the item (even if in the code above it'll drop multiple of them) ).

Edited by newrostman
Guest
This topic is now closed to further replies.


  • Posts

    • https://web.archive.org/web/20260306183214/https://maxcheaters.com/topic/241828-l2j-l2damage/page/3/ https://l2topzone.com/forum/l2-server-support-problems/9/l2damage-stopped/30514 Also we will try to push longer seasons ever ! (1135-100)/9 = 115 online
    • ONE SIDE – AND EVERYTHING BREAKS ▪ Looks like a simple case: Florida DL, back side, barcode – “clean and minimal”. ▪ In reality, these are exactly the tasks that fail most often. – data provided as plain text – request only for the back side – focus on the barcode (PDF417) ▪ And here’s the key point: ▪ A barcode is not just a “picture on the back”. It’s compressed logic of the entire document. ▪ If it doesn’t match the front, format, and data structure – the system flags it instantly. ▪ Many create a “similar-looking” code. But systems don’t read “similar” – they read by specification. ▪ In cases like this, it’s not about design. It’s about correct data assembly and how it behaves inside the format. ▪ Today only – 15% off for verification cases. ▪ Want it to pass, not just look right? Describe your case – we’ll show where even clean files break. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #editing #photoshop #documents #verification #case
    • Your anonymity is a corpse. Blockchain forgets nothing. Your transactions are direct footprints in the hands of anyone who takes an interest. [✘] Still believe in "mixing"? Forget it. Classic Bitcoin mixers are an illusion of security. For Chainalysis and Elliptic algorithms, any attempt to hide tracks in the ledger is transparent. Your "mixing" is an artifact that gets filtered out in seconds. Every transaction leaves a trail that leads to frozen assets or unwanted questions from exchanges.  We don't mix. We break the link. [-] Input: Your "dirty" coins (Dirty BTC/ETH) with all their history and digital markers stay with us. [+] Output: You receive absolutely clean assets (Clean Crypto) from our reserves, which have never intersected with your past. This isn't a game of hide and seek. This is the surgical removal of your financial history from the system.   ------------------------------------------------------------------- Technical indexing: Bitcoin Mixer, Crypto Mixer, Clean BTC, Clean ETH, Anti-Chainalysis, Best Bitcoin Mixer, Anonymous Crypto Exchange, NoLog Mixing Service.
    • Here you are: https://l2crypt.com/l2-tools/l2editor-source/
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..