Thread: Testing

Results 1 to 9 of 9
  1. #1 Testing 
    Registered Member

    Join Date
    Nov 2014
    Posts
    337
    Thanks given
    47
    Thanks received
    12
    Rep Power
    187
    how can i test this code to see if its working?

    Code:
     public boolean rareDrops(Client c, int i) {
           int rarity = 0;
           int ringOfWealth = 0;
           int npcDropRate = ((Integer)NPCDrops.dropRarity.get(Integer.valueOf(npcs[i].npcType))).intValue();
           if(c.playerEquipment[c.playerRing] == 2572 && npcDropRate-3 > 0) {
               ringOfWealth = 1+Misc.random(2);
               c.sendMessage("Your ring of wealth helped your drop rate by @red@"+ringOfWealth+"@bla@%");
           }
          rarity = Misc.random(npcDropRate-ringOfWealth);
           
          return rarity == 0;
       }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Oct 2015
    Posts
    9
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Compile The Source And See If It Has Errors? ?
    Reply With Quote  
     

  3. #3  
    Registered Member Text's Avatar
    Join Date
    Nov 2012
    Posts
    302
    Thanks given
    61
    Thanks received
    27
    Rep Power
    21
    Quote Originally Posted by scoping king View Post
    how can i test this code to see if its working?

    Code:
     public boolean rareDrops(Client c, int i) {
           int rarity = 0;
           int ringOfWealth = 0;
           int npcDropRate = ((Integer)NPCDrops.dropRarity.get(Integer.valueOf(npcs[i].npcType))).intValue();
           if(c.playerEquipment[c.playerRing] == 2572 && npcDropRate-3 > 0) {
               ringOfWealth = 1+Misc.random(2);
               c.sendMessage("Your ring of wealth helped your drop rate by @red@"+ringOfWealth+"@bla@%");
           }
          rarity = Misc.random(npcDropRate-ringOfWealth);
           
          return rarity == 0;
       }
    Make a project in eclipse and change the npc values to other variables. I can tell you right now, rarity will always return 0, which you probably don't want... return rarity == 0; should probably just be return rarity;, shouldn't it?
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Nov 2014
    Posts
    337
    Thanks given
    47
    Thanks received
    12
    Rep Power
    187
    Quote Originally Posted by Jakesnuw View Post
    Compile The Source And See If It Has Errors? ?
    No, not what i meant sorry. I mean how can I test this ingame? Like make a rare drop everytime so that I know it's working correctly.
    Reply With Quote  
     

  5. #5  
    Registered Member Text's Avatar
    Join Date
    Nov 2012
    Posts
    302
    Thanks given
    61
    Thanks received
    27
    Rep Power
    21
    You should just System.out.println npcDropRate and ringOfWealth to debug the output, yeah?
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Nov 2014
    Posts
    337
    Thanks given
    47
    Thanks received
    12
    Rep Power
    187
    Quote Originally Posted by Text View Post
    You should just System.out.println npcDropRate and ringOfWealth to debug the output, yeah?
    I mean actual code i can use in game to test come'on...
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2015
    Posts
    409
    Thanks given
    122
    Thanks received
    41
    Rep Power
    17
    Quote Originally Posted by scoping king View Post
    No, not what i meant sorry. I mean how can I test this ingame? Like make a rare drop everytime so that I know it's working correctly.
    just set the npc's drop rate to 1, to do that it depends on your server if its a normal pi then it will be in your config class.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Sep 2011
    Posts
    327
    Thanks given
    130
    Thanks received
    17
    Rep Power
    6
    Quote Originally Posted by scoping king View Post
    No, not what i meant sorry. I mean how can I test this ingame? Like make a rare drop everytime so that I know it's working correctly.
    Looks like ruse, you can always go to a npc's drop table and change the chance to 0 which is the Always drop.
    Or 1 which is almost always.
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Nov 2014
    Posts
    337
    Thanks given
    47
    Thanks received
    12
    Rep Power
    187
    Quote Originally Posted by High105 View Post
    Looks like ruse, you can always go to a npc's drop table and change the chance to 0 which is the Always drop.
    Or 1 which is almost always.
    no its not ruse and yes i know what you mean but im trying to see if the ring of wealth gives better chance of rare drops, and how can i actual make it send a message like "your ring of wealth glows brighter" for when you get the rare item and not send the message every time you get a normal drop, basically if you get a specific rare item like ags it'll send message saying "ring of wealth glows brighter" understand
    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. Beta Testing Time!
    By Palidino in forum RS2 Server
    Replies: 48
    Last Post: 10-02-2007, 04:44 PM
  2. HardScape Test
    By rotterdam_dj in forum RS2 Server
    Replies: 5
    Last Post: 09-26-2007, 06:03 PM
  3. Project-Paradox Beta Testing
    By Impulse-X in forum RS2 Server
    Replies: 28
    Last Post: 09-20-2007, 06:53 PM
  4. GFX Testing
    By °•Bunny•° in forum Tutorials
    Replies: 2
    Last Post: 08-14-2007, 08:09 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
  •