Post Or I'll remove!
Hey Guys, I had this question for a while. How can I make a certain Npc drop a certain item and another item from the npcdrops file?
So i made this. This will make the npc always drop the item in the code along with another item from the Cfg.
*Note* This is an edit to the .cfg Version of drops made my Rhys/Runescapemad.
In npc.java find this
Code:
if (ifDrop <= chance && npccanloot == true) {
you Will see something like this
Code:
if (ifDrop <= chance && npccanloot == true) {
Engine.items.createGroundItem(item, amount, abSX, abSY, heightLevel, p.username);
npccanloot = false;
}
Replace that with.
Code:
if (ifDrop <= chance && npccanloot == true) {
Engine.items.createGroundItem(item, amount, abSX, abSY, heightLevel, p.username);
npccanloot = false;
switch (npcID) {
case 103:
Engine.items.createGroundItem(6812, 1, abSX, abSY, heightLevel, p.username);
npccanloot = false;
break;
}
}
}
}
it should look like this.
Code:
if (ifDrop <= chance && npccanloot == true) {
Engine.items.createGroundItem(item, amount, abSX, abSY, heightLevel, p.username);
npccanloot = false;
switch (npcID) {
case 103:
Engine.items.createGroundItem(6812, 1, abSX, abSY, heightLevel, p.username);
npccanloot = false;
break;
}
}
}
}
} catch (Exception e) {
//System.out.println("Exception dropping item:\n"+e);
}
How to use this.
Under the switch add the case for the npc. (the case would be the npcid)
Then you would add
Code:
Engine.items.createGroundItem("itemID"," Ammount", abSX, abSY, heightLevel, p.username);
Change the itemID to the id of the item, and the ammount to the ammount.
Example
Code:
case 50:
Engine.items.createGroundItem(536, 1, abSX, abSY, heightLevel, p.username);
npccanloot = false;
break;
This will make Kbd Drop Dragon bones and an item from the Cfg.
Hope this helped. If you have any questions post.
Credits: Goodoo Dolls 100%