mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Merge branch 'jsonify-empty-charms' into 'master'
Move the global 1/15 chance to not drop charms from code to data. See merge request 2009scape/2009scape!242
This commit is contained in:
commit
4ae2d74b79
2 changed files with 905 additions and 4 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -19,9 +19,10 @@ class NPCDropTable : WeightBasedTable() {
|
|||
val items= ArrayList<Item>(3)
|
||||
items.addAll(guaranteedItems.map { it.getItem() }.toList())
|
||||
|
||||
if(RandomFunction.random(1,15) == 5){
|
||||
items.addAll(charmDrops.roll(null))
|
||||
}
|
||||
// Charms table is always rolled, and should contain explicit "Nothing"
|
||||
// entries at the data level to account for the chance to not drop a charm.
|
||||
items.addAll(charmDrops.roll(null))
|
||||
|
||||
if(size == 1){
|
||||
items.add(get(0).getItem())
|
||||
return items
|
||||
|
|
@ -45,4 +46,4 @@ class NPCDropTable : WeightBasedTable() {
|
|||
return items
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue