Thread: Making stackable items drop in stacks from npcs

Results 1 to 7 of 7
  1. #1 Making stackable items drop in stacks from npcs 
    daniel89
    Guest
    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.
     

  2. #2  
    Donator

    Evan's Avatar
    Join Date
    Aug 2007
    Age
    25
    Posts
    1,028
    Thanks given
    1
    Thanks received
    3
    Rep Power
    134
    Good i guess...For some erm, New people Rep for you.
    Gone...
     

  3. #3  
    daniel89
    Guest
    Thanks and some new poeple and a few poeple who own some good servers dont know this ethier
     

  4. #4  
    Registered Member Epic ƒail's Avatar
    Join Date
    Nov 2007
    Posts
    279
    Thanks given
    8
    Thanks received
    0
    Rep Power
    45
    GJ, I kinda needed this.

    WTF NOOB!
     

  5. #5  
    daniel89
    Guest
    your welcome
     

  6. #6  
    Evil
    Guest
    Yeah I guess it's cool if your dropping a single item.. but most people have there drops from Item2.java, and unless you like something dropping about 1,000 dragon chains, this doesnt exactly help you out here.. Its OK for beginners though.
     

  7. #7  
    Registered Member
    Join Date
    Oct 2008
    Posts
    413
    Thanks given
    5
    Thanks received
    13
    Rep Power
    33
    finally sum1 posted this goodjob
     


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
  •