[Tut] Making NPC drops random items

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Account Upgraded | Title Enabled! LittleMaffia is offline
    MemberRank
    Jan 2007 Join Date
    259Posts

    [Tut] Making NPC drops random items

    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 :

    Code:
    public class item2
    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.


  2. #2
    Account Upgraded | Title Enabled! Mayflair is offline
    MemberRank
    Jul 2007 Join Date
    Tilburg - HollandLocation
    206Posts

    Re: [TUT] Making NPC drops random items

    Thanks :D
    I made all my mobs dropping random stuff XD

  3. #3
    Account Upgraded | Title Enabled! LittleMaffia is offline
    MemberRank
    Jan 2007 Join Date
    259Posts

    Re: [TUT] Making NPC drops random items

    Np :)

  4. #4
    Apprentice Wexie. is offline
    MemberRank
    Jun 2007 Join Date
    18Posts

    Re: [TUT] Making NPC drops random items

    Lekker rico!!

  5. #5
    Apprentice Danyolle is offline
    MemberRank
    Aug 2007 Join Date
    19Posts

    Re: [TUT] Making NPC drops random items

    Nice. Good Job :}

  6. #6
    Novice cheesette is offline
    MemberRank
    Sep 2007 Join Date
    4Posts

    Re: [TUT] Making NPC drops random items

    yeah for that

  7. #7
    Enthusiast deadstoner is offline
    MemberRank
    Apr 2007 Join Date
    28Posts

    Re: [TUT] Making NPC drops random items

    nice i put the random drops on my server :P

  8. #8
    Account Upgraded | Title Enabled! lord-retro is offline
    MemberRank
    May 2007 Join Date
    In your kitchen cupboard; eating your cookies =) Go Check. Bet you can't find me =PLocation
    502Posts

    Re: [TUT] Making NPC drops random items

    i think i did it wrong

  9. #9
    Account Upgraded | Title Enabled! yoni2 is offline
    MemberRank
    Nov 2006 Join Date
    Krommenie, NethLocation
    254Posts

    Re: [TUT] Making NPC drops random items

    Nice man!
    And if your name was rly rico,
    LKKR RICO!

  10. #10
    Account Upgraded | Title Enabled! :.:.:JaMeS:.:.: is offline
    MemberRank
    Jul 2007 Join Date
    Watching you...Location
    252Posts

    Re: [TUT] Making NPC drops random items

    thankz nice tut :)

  11. #11
    The light can't stop me. Steven is offline
    MemberRank
    May 2007 Join Date
    United KingdomLocation
    1,531Posts

    Re: [TUT] Making NPC drops random items

    Wicked tut cheers!

  12. #12
    Evil Scottish Overlord Junkers is offline
    LegendRank
    May 2007 Join Date
    United KingdomLocation
    8,216Posts

    Re: [TUT] Making NPC drops random items

    Good TuT. This could help alot of noobs. If I ever make an RS server, I'll definetly use this tut :P

  13. #13
    Novice epome is offline
    MemberRank
    Jan 2005 Join Date
    3Posts

    Re: [TUT] Making NPC drops random items

    why do you dont put the files with the changes i can't find some code lines

  14. #14
    Novice ryand is offline
    MemberRank
    Oct 2007 Join Date
    1Posts

    Re: [TUT] Making NPC drops random items

    Quote Originally Posted by epome View Post
    why do you dont put the files with the changes i can't find some code lines
    "why do you don't"? and in english

    oh and great tut =p

  15. #15
    Infraction Banned OMG.Matt is offline
    MemberRank
    Jul 2007 Join Date
    108Posts

    Re: [TUT] Making NPC drops random items

    wow nice!



Page 1 of 2 12 LastLast

Advertisement