You should check if the NPC even has a drop first before trying to call the method that says he does.
I believe thats why you're getting that error.
|
I get a weird error when i kill an NPC and then it's trying to generate the drop
I'm adding barrows from old Rsps back in the days, just added drops and i get this, any ideas?
Drop code:
Error:{ //Ahrims
"npcIds": [
1672
], "uncommonDrops": [
{
"itemId": 4708,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4710,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4712,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4714,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Dharoks
"npcIds": [
1673
],
"uncommonDrops": [
{
"itemId": 4716,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4718,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4720,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4722,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Guthans
"npcIds": [
1674
], "uncommonDrops": [
{
"itemId": 4724,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4726,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4728,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4730,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Karils
"npcIds": [
1675
], "uncommonDrops": [
{
"itemId": 4732,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4734,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4736,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4738,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Torag
"npcIds": [
1676
], "uncommonDrops": [
{
"itemId": 4745,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4747,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4749,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4751,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Verac
"npcIds": [
1677
], "uncommonDrops": [
{
"itemId": 4753,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4755,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4757,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4759,
"minAmount": 1,
"maxAmount": 1
}
]
},
https://gyazo.com/6debf5b328814d23b77af023446431c9
You should check if the NPC even has a drop first before trying to call the method that says he does.
I believe thats why you're getting that error.
Try this mate, hope this helps.
Code:{ //Ahrims "npcIds": [ 1672 ], "alwaysDrops": [ ], "commonDrops": [ ], "uncommonDrops": [ { "itemId": 4708, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4710, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4712, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4714, "minAmount": 1, "maxAmount": 1 } ] }, { //Dharoks "npcIds": [ 1673 ],"alwaysDrops": [ ], "commonDrops": [ ], "uncommonDrops": [ { "itemId": 4716, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4718, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4720, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4722, "minAmount": 1, "maxAmount": 1 } ] }, { //Guthans "npcIds": [ 1674 ], "alwaysDrops": [ ], "commonDrops": [ ], "uncommonDrops": [ { "itemId": 4724, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4726, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4728, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4730, "minAmount": 1, "maxAmount": 1 } ] }, { //Karils "npcIds": [ 1675 ],"alwaysDrops": [ ], "commonDrops": [ ], "uncommonDrops": [ { "itemId": 4732, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4734, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4736, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4738, "minAmount": 1, "maxAmount": 1 } ] }, { //Torag "npcIds": [ 1676 ],"alwaysDrops": [ ], "commonDrops": [ ], "uncommonDrops": [ { "itemId": 4745, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4747, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4749, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4751, "minAmount": 1, "maxAmount": 1 } ] }, { //Verac "npcIds": [ 1677 ],"alwaysDrops": [ ], "commonDrops": [ ], "uncommonDrops": [ { "itemId": 4753, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4755, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4757, "minAmount": 1, "maxAmount": 1 }, { "itemId": 4759, "minAmount": 1, "maxAmount": 1 } ] },
Code:"rdtChance": 64, "commonDrops": [
You're missing special drops
Post line 130
NPCDropGenerator.java on line 103 and 30 is where your issue starts. Have a look at what they are about.
Changed my code, getting a new error.. Checked in npcdropgenerator and the error was about special drops now I get this?
https://gyazo.com/71f70b89495974838e8c83be8e55d827
{ //Ahrims
"npcIds": [
1672
], "alwaysDrops": [
],
"rdtChance": 64,
"specialDrops": [],
"commonDrops": [
],
"uncommonDrops": [
{
"itemId": 4708,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4710,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4712,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4714,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Dharoks
"npcIds": [
1673
],"alwaysDrops": [
],
"rdtChance": 64,
"specialDrops": [],
"commonDrops": [
],
"uncommonDrops": [
{
"itemId": 4716,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4718,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4720,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4722,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Guthans
"npcIds": [
1674
], "alwaysDrops": [
],
"rdtChance": 64,
"specialDrops": [],
"commonDrops": [
],
"uncommonDrops": [
{
"itemId": 4724,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4726,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4728,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4730,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Karils
"npcIds": [
1675
],"alwaysDrops": [
],
"rdtChance": 64,
"specialDrops": [],
"commonDrops": [
],
"uncommonDrops": [
{
"itemId": 4732,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4734,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4736,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4738,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Torag
"npcIds": [
1676
],"alwaysDrops": [
],
"specialDrops": [],
"rdtChance": 64,
"commonDrops": [
],
"uncommonDrops": [
{
"itemId": 4745,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4747,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4749,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4751,
"minAmount": 1,
"maxAmount": 1
}
]
},
{ //Verac
"npcIds": [
1677
],"alwaysDrops": [
],
"rdtChance": 64,
"specialDrops": [],
"commonDrops": [],
"uncommonDrops": [
{
"itemId": 4753,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4755,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4757,
"minAmount": 1,
"maxAmount": 1
},
{
"itemId": 4759,
"minAmount": 1,
"maxAmount": 1
}
]
},
The problem is that some drops have special/rare drops and some don't. There are no proper checks for it in the NPCDropGenerator class. Replace it with this one https://pastebin.com/raw/NteXdt8f and it should fix the errors.
edit: browsed through the class and the code is pretty bad, i'd suggest redoing that
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |