Thread: How to make npcs drop items

Results 1 to 6 of 6
  1. #1 How to make npcs drop items 
    Registered Member
    wowfreakjoking's Avatar
    Join Date
    Sep 2007
    Posts
    319
    Thanks given
    0
    Thanks received
    0
    Rep Power
    226
    I don't like making tut's but, I saw a guy requested it so here
    CREDS:everyone
    open item2.java

    find
    Code:
    public class Item2
    (beginning of the java file )
    and paste this under it
    Code:
    public static int Mithdrag[] = {4151,1053};//change these drops!
    
    public static int randomMithdrag()//change the name to whatever
        {
        	return mithdrag[(int)(Math.random()*Mithdrag.length)];
        }
    (this says that when called upon drop either a whip(4151) or green mask(1053)
    To edit this simply change the item numbers to what you want, seperated by comma's
    Save and open Npchander.java
    next find
    Code:
    if(npcs[NPCID] != null && server.playerHandler.players[Play] != null && server.playerHandler.players[GetNpcKiller(NPCID)] != null) {
    paste under that
    Code:
    if(npcs[NPCID].npcType == 3000) {// change me to your npc id
    ItemHandler.addItem(Item2.randomMithdrag(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    }
    (this just makes it so when the npc that is 3000 is killed

    now save compile, kill your npc and see if it drops. Have a good day
    Did you know?
    - I hate trivia.
     

  2. #2  
    Registered Member
    laetye's Avatar
    Join Date
    Dec 2007
    Age
    26
    Posts
    350
    Thanks given
    0
    Thanks received
    0
    Rep Power
    245
    hmmm.... then how do you make an npc drop like 500k gold each time?


     

  3. #3  
    Registered Member
    wowfreakjoking's Avatar
    Join Date
    Sep 2007
    Posts
    319
    Thanks given
    0
    Thanks received
    0
    Rep Power
    226
    There is a way, but I never cared much to find out ask someone who knows.. sorry
    Did you know?
    - I hate trivia.
     

  4. #4  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    heres the real way =.=
    [Only registered and activated users can see links. ]
     

  5. #5  
    Jordzeh
    Guest
    alot of server coder's know this but its very helpfull for noobs also i already knew how to do this but when i first started i used a tutorial like this to help me learn how to make monsters drop things so nice tutorials for the noobies

    Whitezy
     

  6. #6  
    Registered Member
    Join Date
    Feb 2008
    Age
    27
    Posts
    159
    Thanks given
    0
    Thanks received
    0
    Rep Power
    23
    i would also like to know how to make it drop in bulk say coins or runes..
    Did you know?
    - The "Did you know?" facts at the top corner of the page are rather interesting.
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •