Thread: Specific Drops From an Npc (.cgf drops)

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Specific Drops From an Npc (.cfg drops) 
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Post Or I'll remove!

    Hey Guys, I had this question for a while. How can I make a certain Npc drop a certain item and another item from the npcdrops file?
    So i made this. This will make the npc always drop the item in the code along with another item from the Cfg.

    *Note* This is an edit to the .cfg Version of drops made my Rhys/Runescapemad.

    In npc.java find this
    Code:
    if (ifDrop <= chance && npccanloot == true) {
    you Will see something like this
    Code:
    if (ifDrop <= chance && npccanloot == true) {
                                                    Engine.items.createGroundItem(item, amount, abSX, abSY, heightLevel, p.username);
                                                    npccanloot = false;
                                                }
    Replace that with.
    Code:
    if (ifDrop <= chance && npccanloot == true) {
                                            Engine.items.createGroundItem(item, amount, abSX, abSY, heightLevel, p.username);
                                            npccanloot = false;
                                            switch (npcID) {
                                            case 103:
                                            Engine.items.createGroundItem(6812, 1, abSX, abSY, heightLevel, p.username);
                                            npccanloot = false;
                                            break;
                                            
                                                }
                                        }
                                        }
                                }
    it should look like this.

    Code:
    if (ifDrop <= chance && npccanloot == true) {
                                            Engine.items.createGroundItem(item, amount, abSX, abSY, heightLevel, p.username);
                                            npccanloot = false;
                                            switch (npcID) {
                                            case 103:
                                            Engine.items.createGroundItem(6812, 1, abSX, abSY, heightLevel, p.username);
                                            npccanloot = false;
                                            break;
                                            
                                                }
                                        }
                                        }
                                }
                         } catch (Exception e) {                            
                               //System.out.println("Exception dropping item:\n"+e);
                         }
    How to use this.
    Under the switch add the case for the npc. (the case would be the npcid)
    Then you would add
    Code:
    Engine.items.createGroundItem("itemID"," Ammount", abSX, abSY, heightLevel, p.username);
    Change the itemID to the id of the item, and the ammount to the ammount.

    Example
    Code:
    case 50:
    Engine.items.createGroundItem(536, 1, abSX, abSY, heightLevel, p.username);
    npccanloot = false;
    break;
    This will make Kbd Drop Dragon bones and an item from the Cfg.


    Hope this helped. If you have any questions post.

    Credits: Goodoo Dolls 100%

    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,156
    Thanks given
    3
    Thanks received
    2
    Rep Power
    182
    for making an item drop wasnt it like this

    Code:
    item   percentage random items
    995, 100, 20-21
    but your way seems a lil easier. ill look at yours.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Quote Originally Posted by Gods army View Post
    for making an item drop wasnt it like this

    Code:
    item   percentage random items
    995, 100, 20-21
    but your way seems a lil easier. ill look at yours.

    With mine its always going to drop that item then picks another item from npcsdrops.cfg according to the percentage of the drop, like before I added this.

    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,156
    Thanks given
    3
    Thanks received
    2
    Rep Power
    182
    OH OK! i didn't see what you were doin i guess, good job have you figured out how to add double drops? like for arma boss drop 10k and arma godsword or something? or does this already have that.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Rawr.


    Join Date
    Oct 2008
    Age
    25
    Posts
    2,166
    Thanks given
    10
    Thanks received
    51
    Rep Power
    1326
    o umm.... butterscape source has double drops like abby deamons drop 8k with whip and ahes. check the source out.



    Was good while it lasted

    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,156
    Thanks given
    3
    Thanks received
    2
    Rep Power
    182
    butterscapes antileech is so large.... its not even funny, thats probably part of it
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Quote Originally Posted by Gods army View Post
    butterscapes antileech is so large.... its not even funny, thats probably part of it

    Its very simple to add double drops.

    Code:
    case npcid:
    Engine.items.createGroundItem(bonesid, 1, abSX, abSY, heightLevel, p.username);
    Engine.items.createGroundItem(995, 10000, abSX, abSY, heightLevel, p.username);
    npccanloot = false;
    break;
    All you need to do is add another createGroundItem.

    But if you do this is will drop 3 items. Money, bones and an item from npcdrops.cfg

    Reply With Quote  
     

  8. #8  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    29
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    Looks nice but I think you can do it in a better way. But nice... Won't use but rep++!
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  9. #9  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Quote Originally Posted by laxika View Post
    Looks nice but I think you can do it in a better way. But nice... Won't use but rep++!

    Thanks . How would I do this in a better way?

    I'm just ballpark guessing but would I use arrays or something similar?

    Reply With Quote  
     

  10. #10  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    29
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    Quote Originally Posted by Goodoo Dolls View Post
    Thanks . How would I do this in a better way?

    I'm just ballpark guessing but would I use arrays or something similar?
    If you add a way to the cfg to an item dropped 100%. So not need to edit the java file.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •