Difficulty: Easy
Description: Making a NPC drop random stuff
Files To Be Edited: item2.java and NPChandler.java
Instructions:
1. Open item2.java
2. Search for :
Under it add this :
Code:
public static int whatever[] = {4151,4151,2623,2625,2627,2629,4131,4587,6570,1580,6570,995,6739,7158,6568,6916,6918,6920,6922,6924,7462,2661,2528,2663,2665,2667};
public static int randomwhatever()
{
return whatever[(int)(Math.random()*whatever.length)];
}
The 4151,4151 are the Item Ids that will be droped, change it if you want.
Save and close.
3. Open NPCHandler.java
4. Search for :
Code:
if(npcs[NPCID].npcType == 1625
Under the last } add
Code:
if(npcs[NPCID].npcType == 2027) // change the 2027 in a npc ID.
{
ItemHandler.addItem(Item2.randomwhatever(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
Save, Close and compile!
Enjoy.