Thread: defence Level requirements for gear [Help]

Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1 defence Level requirements for gear [Help] 
    Banned
    Join Date
    Apr 2013
    Age
    28
    Posts
    578
    Thanks given
    25
    Thanks received
    42
    Rep Power
    0
    Well i'm trying to make runecrafting robes 1 defence req to wear but i'm not sure where to do that, already tried the obvious places but can't seem to figure it out.

    If anyone knows how to fix this explain
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    May 2014
    Age
    29
    Posts
    78
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    You probably have your "Rune" requirements checking for "itemName.toLowerCase().contains("rune")" Just make it
    Code:
    itemName.toLowerCase().contains("rune") && !itemName.toLowerCase().endsWith("robe")
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Apr 2013
    Age
    28
    Posts
    578
    Thanks given
    25
    Thanks received
    42
    Rep Power
    0
    Quote Originally Posted by Geni View Post
    You probably have your "Rune" requirements checking for "itemName.toLowerCase().contains("rune")" Just make it
    Code:
    itemName.toLowerCase().contains("rune") && !itemName.toLowerCase().endsWith("robe")
    Where do i put that?
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    May 2014
    Age
    29
    Posts
    78
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    Quote Originally Posted by s0ul bender View Post
    Where do i put that?
    It really comes down to which source you're using. Wherever you're handling your item requirements.
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Apr 2013
    Age
    28
    Posts
    578
    Thanks given
    25
    Thanks received
    42
    Rep Power
    0
    Quote Originally Posted by Geni View Post
    It really comes down to which source you're using. Wherever you're handling your item requirements.
    Wanna help me through skype, because the base i'm using has different code then most pi servers
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    May 2014
    Age
    29
    Posts
    78
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    The code for where you're handling your item requirements should not be too different from any other source, in itemAssistant look for getRequirements. Just an example. If yours is much different i suggest either changing source or trying to learn the packaging. This is a really simple modification.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    May 2013
    Posts
    1,169
    Thanks given
    28
    Thanks received
    133
    Rep Power
    53
    What are the current def requirements for em? 40? Go to the itemassistants class and look for the wearItem method, there should be something like he said there. Just search ("rune"), once you find it, add something like && !itemId.equalsIgnoreCase("runecrafting") or whatever there
    If only I hadn't given you up, my life could've been different.
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Apr 2013
    Age
    28
    Posts
    578
    Thanks given
    25
    Thanks received
    42
    Rep Power
    0
    Quote Originally Posted by Geni View Post
    The code for where you're handling your item requirements should not be too different from any other source, in itemAssistant look for getRequirements. Just an example. If yours is much different i suggest either changing source or trying to learn the packaging. This is a really simple modification.


    public boolean wearItem(int wearID, int slot) {
    int targetSlot = 0;
    boolean canWearItem = true;

    if (c.inventory[slot].getId() == wearID) {
    getRequirements(getItemName(wearID).toLowerCase(), wearID);
    targetSlot = ItemDefinition.getItem(wearID).getSlot();






    That's what i got^
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    May 2014
    Age
    29
    Posts
    78
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    Code:
    getRequirements(getItemName(wearID).toLowerCase(), wearID);
    And thats the method thats being called for giving different items different stats. Which is a horrible way to do it, but is just the way every PI server has by default.

    search for "getRequirements(String"
    Quote Originally Posted by s0ul bender View Post
    That's what i got^
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    Apr 2013
    Age
    28
    Posts
    578
    Thanks given
    25
    Thanks received
    42
    Rep Power
    0
    Quote Originally Posted by Geni View Post
    Code:
    getRequirements(getItemName(wearID).toLowerCase(), wearID);
    And thats the method thats being called for giving different items different stats. Which is a horrible way to do it, but is just the way every PI server has by default.

    search for "getRequirements(String"


    public void getRequirements(String itemName, int itemId) {
    c.attackLevelReq = c.defenceLevelReq = c.strengthLevelReq = c.rangeLevelReq = c.magicLevelReq = c.prayerLevelReq = c.hitpointsLevelReq = 0;
    if (itemName.contains("mystic") || itemName.contains("nchanted")) {
    if (itemName.contains("staff")) {
    c.magicLevelReq = 20;
    c.attackLevelReq = 40;
    } else {
    c.magicLevelReq = 20;
    c.defenceLevelReq = 20;
    }
    }
    Reply With Quote  
     

Page 1 of 3 123 LastLast

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. example: Level Requirements for attacking npc
    By Linus in forum Configuration
    Replies: 2
    Last Post: 05-23-2010, 12:59 AM
  2. Replies: 4
    Last Post: 02-13-2010, 04:40 PM
  3. Adding Level Requirements for mining
    By gooseyg in forum Tutorials
    Replies: 3
    Last Post: 06-23-2008, 03:37 PM
  4. Replies: 21
    Last Post: 08-18-2007, 11:24 PM
  5. How to change the levels required for armour
    By domo9122 in forum Tutorials
    Replies: 10
    Last Post: 08-18-2007, 08:14 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
  •