Thread: [Shard] Alternative NPC Drop System

Results 1 to 7 of 7
  1. #1 [Shard] Alternative NPC Drop System 
    Registered Member
    Chachi's Avatar
    Join Date
    Sep 2008
    Posts
    1,536
    Thanks given
    49
    Thanks received
    103
    Rep Power
    602
    Purpose: Alternative NPC drops
    Difficulty: 1
    Tested On: Shard

    Ok so I used emulous since it was released and finally got fed up with it and changed to Shard. I had so many NPC drops for that and I didn't want to rewrite it. And I am posting this in hopes more people will change to Shard. Please no flames about how this is stupid.

    first make a new file called Config.java in com/rs/worldserver

    add this

    Code:
    	/**
    	* NPC DROPS
    	**/
    	//{npc Type, item id , amount, chance}
    
    	public static int[][] NPC_DROPS = {
    
    	// if you want the a npc to always drop an item make the chance 0
    	{1,1038,1,10}, {1,526,1,0}, {1,995,120,2}, // man
    	****,526,1,0}, // knight
            };
    save and close plus modify to your drops

    Open NPC.Java

    import this

    Code:
    import com.rs.worldserver.Config;
    change your processdrops to this.

    Code:
    	public void processDrops() {
    		Client highestHitter = null;
    		int highestHit = -1;
    		for (Map.Entry<Client, Integer> entry : previousAttackers.entrySet()) {
    			if (entry.getValue() > highestHit) {
    				highestHit = entry.getValue();
    				highestHitter = entry.getKey();
    			}
    		}
    		if (highestHitter == null) {
    			return; // don't worry about it
    		} else {
    		int npc = 0;
    		for(npc = 0; npc < Config.NPC_DROPS.length; npc++){
    			if(definition.type == Config.NPC_DROPS[npc][0]) {
    				if(Misc.random(Config.NPC_DROPS[npc][3]) == 0) {
    					FloorItem item = new FloorItem(Config.NPC_DROPS[npc][1], Config.NPC_DROPS[npc][2], highestHitter, getAbsX(), getAbsY(), getHeightLevel());
    					Server.getItemManager().newDropFromNPC(item, highestHitter);
    				}	
    			}
    		}
    		previousAttackers = null;
    	}
    	
    	}

    Edit: Forgot 1 thing open NPCDefinition.java

    few lines down youwill see private int type; make it public
    save and compile.
    [/CENTER]
    Reply With Quote  
     

  2. #2  
    Уважение и любовь Market Banned Market Banned

    R0cky 0wnz's Avatar
    Join Date
    Mar 2008
    Age
    28
    Posts
    2,569
    Thanks given
    642
    Thanks received
    511
    Rep Power
    1716
    Thanks, will be used for sure
    SELLING CREATIVESCAPE 2012 SOURCE

    [Only registered and activated users can see links. ]

    Snippets
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    SERGEANT OF THE MASTER SERGEANTS MOST IMPORTANT PERSON OF EXTREME SERGEANTS TO THE MAX!

    cube's Avatar
    Join Date
    Jun 2007
    Posts
    8,881
    Thanks given
    1,854
    Thanks received
    4,741
    Rep Power
    5000
    Eww...



    Reply With Quote  
     

  4. #4  
    Registered Member
    Chachi's Avatar
    Join Date
    Sep 2008
    Posts
    1,536
    Thanks given
    49
    Thanks received
    103
    Rep Power
    602
    Quote Originally Posted by S Quare Quxx View Post
    Eww...
    not really ew it saved me time of redoing 152 lines of drops with 5 drops per line.
    [/CENTER]
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Dec 2006
    Age
    25
    Posts
    2,196
    Thanks given
    5
    Thanks received
    23
    Rep Power
    0
    convert to devo/winterloves and pm lol
    Reply With Quote  
     

  6. #6  
    Registered Member
    Chachi's Avatar
    Join Date
    Sep 2008
    Posts
    1,536
    Thanks given
    49
    Thanks received
    103
    Rep Power
    602
    Quote Originally Posted by Shocker View Post
    convert to devo/winterloves and pm lol
    um download emulous its wL.
    [/CENTER]
    Reply With Quote  
     

  7. #7  
    Уважение и любовь Market Banned Market Banned

    R0cky 0wnz's Avatar
    Join Date
    Mar 2008
    Age
    28
    Posts
    2,569
    Thanks given
    642
    Thanks received
    511
    Rep Power
    1716
    bump lel
    SELLING CREATIVESCAPE 2012 SOURCE

    [Only registered and activated users can see links. ]

    Snippets
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Tags for this Thread

View Tag Cloud

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