Thread: I can't add level requirements.

Results 1 to 9 of 9
  1. #1 I can't add level requirements. 
    Extreme Donator

    Joy.'s Avatar
    Join Date
    Jul 2011
    Posts
    842
    Thanks given
    149
    Thanks received
    115
    Rep Power
    124
    I'm trying to add level requirements to certain items. Some items work, and some don't. For example, I can't add requirements to barrows gloves.
    I've tried adding it by name as well, it doesn't work.

    ItemDefinitions
    Code:
    case 7461:
    itemRequiriments.put(Skills.DEFENCE, 40);
    break;
    case 7462:
    itemRequiriments.put(Skills.DEFENCE, 40);
    break;
    ItemConstants
    Code:
    if (item.getId() == 7462 || item.getId() == 7461 ) {
    if (player.getSkills().getLevel(Skills.DEFENCE) < 40) {
    player.getPackets().sendGameMessage("You need a Defence level of 40 to wear this.");
    return false;
    }
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    BIG OOF
    Awakening's Avatar
    Join Date
    May 2016
    Posts
    34
    Thanks given
    16
    Thanks received
    7
    Rep Power
    11
    Can you show the itemRequiriments.put() method, and also show an example that works?

    Edit: What base are you using?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2017
    Posts
    50
    Thanks given
    1
    Thanks received
    14
    Rep Power
    18
    Add me on discord; aNamedSoul#5110
    Reply With Quote  
     

  4. #4  
    محمد

    Jamili's Avatar
    Join Date
    Jun 2010
    Posts
    408
    Thanks given
    93
    Thanks received
    246
    Rep Power
    307
    The one's that work, are they also a Defence requirement?
    [Only registered and activated users can see links. ]
    Spoiler for Honorable mentions:

    Quote Originally Posted by JRFisher View Post
    Dude, learn yourself, it took me 17 months of continuous research to learn how to import a project.
    Quote Originally Posted by Pollution View Post
    When? And Idiot, I'm using a oldschool, it's not easy to get the command for an oldschool, retard c u.
    Quote Originally Posted by Waj_Assif View Post
    I sayin u dont contribute never aall u do is finna tryin attack ppl and always finna start fights .......
    Quote Originally Posted by Kris View Post
    You must be one of those slower breeds.
    Quote Originally Posted by Gandalf View Post
    Just piss off ploter hacker fella dumb fuck. Your a donor to a rsps community, I'm a Mainowner to a Private Server thats 7+ Years old. Lmfao kid, get a life. Don't let my name come out of your mouth again. Or it wont end nicely for you. Understand me big boy?
    Quote Originally Posted by Tojad View Post
    What do you know about Public Void and int without this [] is only 1 integer, why?
    Reply With Quote  
     

  5. #5  
    Extreme Donator

    Joy.'s Avatar
    Join Date
    Jul 2011
    Posts
    842
    Thanks given
    149
    Thanks received
    115
    Rep Power
    124
    Quote Originally Posted by Awakening View Post
    Can you show the itemRequiriments.put() method, and also show an example that works?

    Edit: What base are you using?
    Using Rune-Factory source. Res 667

    Code:
    public HashMap<Integer, Integer> getWearingSkillRequiriments() {
    		if (clientScriptData == null)
    			return null;
    		if (itemRequiriments == null) {
    			HashMap<Integer, Integer> skills = new HashMap<Integer, Integer>();
    			for (int i = 0; i < 10; i++) {
    				Integer skill = (Integer) clientScriptData.get(749 + (i * 2));
    				if (skill != null) {
    					Integer level = (Integer) clientScriptData.get(750 + (i * 2));
    					if (level != null)
    						skills.put(skill, level);
    				}
    			}
    			Integer maxedSkill = (Integer) clientScriptData.get(277);
    			if (maxedSkill != null)
    				skills.put(maxedSkill, id == 19709 ? 120 : 99);
    			itemRequiriments = skills;
    			
    			if (name.toLowerCase().contains("berserker helm"))
    				itemRequiriments.put(Skills.DEFENCE, 45);
    			else if (name.toLowerCase().contains("helm of neitiznot"))
    				itemRequiriments.put(Skills.DEFENCE, 55);
    			else if(getId() == 19784)
    				itemRequiriments.put(Skills.ATTACK, 78);
    			else if(getId() == 10499)
    				itemRequiriments.put(Skills.RANGE, 50);
    			else if(getId() == 13661)
    				itemRequiriments.put(Skills.FIREMAKING, 92);
    			else if (name.equals("Dragon defender")) {
    				itemRequiriments.put(Skills.ATTACK, 60);
    				itemRequiriments.put(Skills.DEFENCE, 60);
    			}
    			else if (name.equals("Void")) {
    				itemRequiriments.put(0, 42);
    				itemRequiriments.put(1, 42);
    				itemRequiriments.put(2, 42);
    				itemRequiriments.put(3, 42);
    				itemRequiriments.put(4, 42);
    				itemRequiriments.put(5, 22);
    				itemRequiriments.put(6, 42);
    			}
    			else if(name.startsWith("Ghostly"))
    				itemRequiriments.put(Skills.MAGIC, 50);
    			switch (getId()) {
    			case 21371:
    			case 21372:
    			case 21373:
    			case 21374:
    			case 21375:
    				itemRequiriments.put(Skills.ATTACK, 75);
    				break;
    			case 10887:
    				itemRequiriments.put(Skills.PRAYER, 51);
    				break;
    			case 7461:
    				itemRequiriments.put(Skills.DEFENCE, 40);
    				break;
    			case 7462:
    				itemRequiriments.put(Skills.DEFENCE, 40);
    				break;
    			case 2412:
    			case 2413:
    			case 2414:
    				itemRequiriments.put(Skills.MAGIC, 60);
    				break;
    			case 20822:
    			case 20823:
    			case 20824:
    			case 20825:
    			case 20826:
    				itemRequiriments.put(Skills.DEFENCE, 99);
    				break;
    			case 8846:
    				itemRequiriments.put(0, 5);
    				itemRequiriments.put(1, 5);
    				break;
    			case 8847:
    				itemRequiriments.put(Skills.ATTACK, 10);
    				itemRequiriments.put(Skills.DEFENCE, 10);
    				break;
    			case 8848:
    				itemRequiriments.put(Skills.ATTACK, 20);
    				itemRequiriments.put(Skills.DEFENCE, 20);
    				break;
    			case 8849:
    				itemRequiriments.put(Skills.ATTACK, 30);
    				itemRequiriments.put(Skills.DEFENCE, 30);
    				break;
    			case 8850:
    				itemRequiriments.put(Skills.ATTACK, 40);
    				itemRequiriments.put(Skills.DEFENCE, 40);
    				break;
    			case 20072:
    				itemRequiriments.put(Skills.ATTACK, 60);
    				itemRequiriments.put(Skills.DEFENCE, 60);
    				break;
    			}
    		}
    		return itemRequiriments;
    	}
    Quote Originally Posted by Jamili View Post
    The one's that work, are they also a Defence requirement?
    No, it just seems to be specific items. For example

    Code:
    else if (name.toLowerCase().contains("helm of neitiznot"))
    itemRequiriments.put(Skills.DEFENCE, 55);
    Works as it should.

    ON THE OTHER HAND

    Code:
    else if(name.startsWith("Ghostly"))
    itemRequiriments.put(Skills.MAGIC, 50);
    Does not work.
    Reply With Quote  
     

  6. #6  
    محمد

    Jamili's Avatar
    Join Date
    Jun 2010
    Posts
    408
    Thanks given
    93
    Thanks received
    246
    Rep Power
    307
    else if(name.toLowerCase().contains("ghostly"))
    itemRequiriments.put(Skills.MAGIC, 50);

    Try this
    [Only registered and activated users can see links. ]
    Spoiler for Honorable mentions:

    Quote Originally Posted by JRFisher View Post
    Dude, learn yourself, it took me 17 months of continuous research to learn how to import a project.
    Quote Originally Posted by Pollution View Post
    When? And Idiot, I'm using a oldschool, it's not easy to get the command for an oldschool, retard c u.
    Quote Originally Posted by Waj_Assif View Post
    I sayin u dont contribute never aall u do is finna tryin attack ppl and always finna start fights .......
    Quote Originally Posted by Kris View Post
    You must be one of those slower breeds.
    Quote Originally Posted by Gandalf View Post
    Just piss off ploter hacker fella dumb fuck. Your a donor to a rsps community, I'm a Mainowner to a Private Server thats 7+ Years old. Lmfao kid, get a life. Don't let my name come out of your mouth again. Or it wont end nicely for you. Understand me big boy?
    Quote Originally Posted by Tojad View Post
    What do you know about Public Void and int without this [] is only 1 integer, why?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Sep 2017
    Posts
    50
    Thanks given
    1
    Thanks received
    14
    Rep Power
    18
    Quote Originally Posted by Riddle Me That View Post
    Code:
    startsWith("Ghostly")
    I think that is the problem

    Try use,
    Code:
     contains("Ghostly")
    Reply With Quote  
     

  8. #8  
    Extreme Donator

    Joy.'s Avatar
    Join Date
    Jul 2011
    Posts
    842
    Thanks given
    149
    Thanks received
    115
    Rep Power
    124
    Quote Originally Posted by Jamili View Post
    else if(name.toLowerCase().contains("ghostly"))
    itemRequiriments.put(Skills.MAGIC, 50);

    Try this
    Code:
    http://prntscr.com/nuip8v
    Quote Originally Posted by aNamedSoul View Post
    I think that is the problem

    Try use,
    Code:
     contains("Ghostly")
    Check out the picture I posted above. I don't know what the heck is wrong.

    Is it possibly something to do with my "Wear" method in ButtonHandler?
    Reply With Quote  
     

  9. #9  
    محمد

    Jamili's Avatar
    Join Date
    Jun 2010
    Posts
    408
    Thanks given
    93
    Thanks received
    246
    Rep Power
    307
    Do you have teamviewer?
    PM me your details

    Edit: Have you checked if the items' requirements are already being defined somewhere else?
    [Only registered and activated users can see links. ]
    Spoiler for Honorable mentions:

    Quote Originally Posted by JRFisher View Post
    Dude, learn yourself, it took me 17 months of continuous research to learn how to import a project.
    Quote Originally Posted by Pollution View Post
    When? And Idiot, I'm using a oldschool, it's not easy to get the command for an oldschool, retard c u.
    Quote Originally Posted by Waj_Assif View Post
    I sayin u dont contribute never aall u do is finna tryin attack ppl and always finna start fights .......
    Quote Originally Posted by Kris View Post
    You must be one of those slower breeds.
    Quote Originally Posted by Gandalf View Post
    Just piss off ploter hacker fella dumb fuck. Your a donor to a rsps community, I'm a Mainowner to a Private Server thats 7+ Years old. Lmfao kid, get a life. Don't let my name come out of your mouth again. Or it wont end nicely for you. Understand me big boy?
    Quote Originally Posted by Tojad View Post
    What do you know about Public Void and int without this [] is only 1 integer, why?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Level 90 Armours - How can I add them to my 667.
    By 13lack drag in forum Models
    Replies: 4
    Last Post: 01-05-2015, 07:14 PM
  2. Replies: 3
    Last Post: 08-17-2013, 01:49 PM
  3. Replies: 13
    Last Post: 03-03-2013, 01:04 AM
  4. how can i add these requirements?
    By startcode in forum Help
    Replies: 6
    Last Post: 09-04-2010, 01:01 PM
  5. Replies: 2
    Last Post: 07-26-2010, 10:35 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
  •