Thread: Making all NPC's drop Clue Scrolls?

Results 1 to 10 of 10
  1. #1 Making all NPC's drop Clue Scrolls? 
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Hey, I am trying to make it so all the NPC's drop Clue Scrolls, Instead of adding 20 different Clue Scroll ID's to each NPC individually, I'm not sure what code I should be using but I'm pretty sure the code will be going in NPC.java, If anyone knows what I should do please post back to this thread to help me out, thanks.
    Reply With Quote  
     

  2. #2  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    in the npc dieing method

    just put (psuedocode)

    if (random(w/e) == 0)
    dropClue
    Reply With Quote  
     

  3. #3  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Hmm I don't get it
    Reply With Quote  
     

  4. #4  
    Registered Member Unicode's Avatar
    Join Date
    May 2013
    Age
    30
    Posts
    296
    Thanks given
    18
    Thanks received
    6
    Rep Power
    16
    If you are using a PI source, just go into NPChandler.java and take a look at where it creates Summoning Charms drops. I'm sure if you take a look at it you'll start to understand.

    Reply With Quote  
     

  5. #5  
    ಠ_ಠ

    Joshua's Avatar
    Join Date
    May 2010
    Posts
    1,903
    Thanks given
    397
    Thanks received
    708
    Rep Power
    803
    Quote Originally Posted by BoomScape View Post
    Hmm I don't get it
    Player dies -> Death method called -> use Math.random() and test to see if the result is 0 -> drop clue scroll.

    Just as Harlan suggested.
    Reply With Quote  
     

  6. #6  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    I'm using Matrix 718 Base
    Reply With Quote  
     

  7. #7  
    ಠ_ಠ

    Joshua's Avatar
    Join Date
    May 2010
    Posts
    1,903
    Thanks given
    397
    Thanks received
    708
    Rep Power
    803
    Quote Originally Posted by BoomScape View Post
    I'm using Matrix 718 Base
    Doesn't matter what your base is, it's the same concept. But just so you know this is the < revision 503 section.
    Reply With Quote  
     

  8. #8  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Yer this isn't really help it's describing what the method type is, I'm having troubles on where to put it etc...
    Reply With Quote  
     

  9. #9  
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    Code:
    if(clueScrollDrop(c)) {
    								Server.itemHandler.createGroundItem(c, getClueLevel(i), npcs[i].absX, npcs[i].absY,c.heightLevel, 1, c.playerId);
    }

    Code:
    	public boolean clueScrollDrop(Client c) {
    		int[] clues = {
    			2714, 2717, 2720, 2677, 2678, 2679, 2795, 3576, 3565
    		};
    		int count = 0;
    		for(int clue : clues) {
    			if(!c.getItems().playerHasItem(clue, 1) && !c.getItems().itemInBank(clue)) {
    				count++;
    			}
    		}
    		if(count == clues.length) {
    			if (Misc.random(50) >= 47) {
    			return true;
    			} else {
    			return false;
    			}
    		}
    		return false;
    	}
    	public int getClueLevel(int i) {
    		int npcCombatLevel = getNpcCombat(i);
    		if(npcCombatLevel > 10 && npcCombatLevel < 45) {
    			if(Misc.random(100) >= 93)
    				return 2677;
    		} else if(npcCombatLevel > 44 && npcCombatLevel < 90) {
    			if(Misc.random(100) >= 95) 
    				return 2678;
    		} else if(npcCombatLevel > 89) {
    			if(Misc.random(100) >= 97)
    				return 2679;
    		}
    		return -1;
    	}
    Reply With Quote  
     

  10. #10  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Looks good but where abouts shall I add this which file?
    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

Similar Threads

  1. Replies: 8
    Last Post: 01-05-2012, 10:45 AM
  2. Replies: 12
    Last Post: 10-10-2010, 01:15 AM
  3. Make a npc drop 2 items...
    By Red1 in forum Tutorials
    Replies: 3
    Last Post: 05-11-2008, 12:36 AM
  4. My 1st Tut. Making 100% npc drops.
    By Meka in forum Tutorials
    Replies: 12
    Last Post: 04-29-2008, 02:01 PM
  5. Making a NPC drop random items.
    By Mafia in forum Tutorials
    Replies: 4
    Last Post: 12-04-2007, 05:56 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •