This is my frist tut so please reply and tell me if its detailed enough.
Please note I am also daniel89 from silab forums im not a leacher.
Title: Making npcs drop stacks of coins Instead of 1 coin drops.
Purpose: This will teach you how to edit your npchandler.java so it will drop stacks of coins.
Difficulty: 0-1
Files changed: npchandler.java
Okay first thing open up your npchandler.java and search for this or something close to its nature.
Code:
public void MonsterDropItem(int NPCID)
Okay below that you should see some coden that looks simlar to this.
Code:
if (npcs[NPCID].npcType == 275) {
ItemHandler.addItem(4273, npcs[NPCID].absX,
npcs[NPCID].absY, 1, GetNpcKiller(NPCID),
false);
}
if (npcs[NPCID].npcType == 18) {
ItemHandler.addItem(Item3.randomguard(),
npcs[NPCID].absX, npcs[NPCID].absY, 1,
GetNpcKiller(NPCID), false);
}
Now look at the this part of the coden.
Code:
npcs[NPCID].absY, 1, GetNpcKiller(NPCID),
Each npc that has a random drop from a item3.java or item4.java will load the drops and determine if stackable How many of that item to drop. Now we are gona make a simple change so it will drop a stack of coins Or noted items to the number you set.
This is definded by the "1" in that code. We are gona simply change the 1 to "1000".
So it looks like this in the coden.
Code:
npcs[NPCID].absY, 1000, GetNpcKiller(NPCID),
Now what we have just done is changed stackable drop amount from 1 to 1000.
Your complete code will look like this
Code:
if (npcs[NPCID].npcType == 275) {
ItemHandler.addItem(4273, npcs[NPCID].absX,
npcs[NPCID].absY, 1000, GetNpcKiller(NPCID),
false);
}
Compile then run
There you go That npc will now drop 1000 coins, runes, etc. depending on what item is stackable in its npc drop list in item3-item4.java.
Hope this tutorial helped.