Purpose: To help people understand drops fully.
Difficulty: 1/10
Assumed Knowledge: Not hard, just.. Sense?
Server Base: My new server ( In progress ).
Classes Modified: Hmm.. Item.java, Item2.java, Item3.java, Autospawn ( Depends ) Npchandler.java.
Procedure
Step 1: Firstly, I'll take you through making a npc drop a item 100% of the time.
Code:
if(npcs[NPCID].npcType == 2745)
{
ItemHandler.addItem(Item2.randomJad(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
Ok.. Lets start.. You see
,That means that the item what Jad is going to drop is in Item2.randomJad. So if you wish to change, go into Item2.java and search Item2.Randomjad and change the object.
Ok you can see
Code:
if(npcs[NPCID].npcType == 2745)
2745 = TzTok-jad Npcid. So that means that you want that npc id to drop out of Item2.randomjad.
Ok in my Item2.java in randomjad it says
Code:
{1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,1052,6585,1409,4131,4151,1377,6082,6570,1149};
There is around 50? Idk item ids there, so that means 6570 (Fire cape) Would have 1/50 chance to drop.
Say you changed half of them to 6570, that means Fire cape would have 50% chance to drop or 25/50
If you wanted it to drop 6570 100/100 or 100% ( Whichever way you prefer ) you would add only 1 item id and it would be 6570.
Step 2: Ok, now we will get to grips with Random drops.
Lets take this for example.
Code:
if(npcs[NPCID].npcType == 2029)
{
ItemHandler.addItem(Item2.randomTorag(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
This means, once again.. In Item2.randomTorag you will see what torag drops.
This is mine
Code:
public static int Torag[] = {4745,4747,4749,4751};
public static int randomTorag()
{Ok.. It has 1/4 chance to drop a piece of Torags. Or 25%. Now say you wanted it to drop 4745 ( Hammer I tink. ) 4/10. You would add 3 more 4745's to the list then 1 more of each of the other Ids. Now you have 2/10 for the other pieces and 4/10 for the hammers.
Say you wanted abby demons to drop a whip 1/300 you would add 1 4151 ( Whip id ) and 299 other things ( anything ). Now you would get 1 whip per 300 kills ( early if your lucky xD )
Step 3: Working with Npchandler. Ok, you still dont understand? I'll break it down for you.
Code:
if(npcs[NPCID].npcType == 50) {
ItemHandler.addItem(Item2.randomKBD(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
Ok, 50 = King black dragon, that is it's npc id. Item2.randomKbd is were the drops come from, so if you open up item2.java and search kbd, you would see all the objects. Were is says "Random" it means a random item of that.
I found this helpful to me when I didnt even know how to spawn a npc 
creds -kurt