Thread: [562][RS2HD] Require certain rights to equip items

Results 1 to 9 of 9
  1. #1 [562][RS2HD] Require certain rights to equip items 
    Banned
    Join Date
    Apr 2009
    Posts
    106
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    How do you make an item require certain rights to equip it?
    Reply With Quote  
     

  2. #2  
    Registered Member lildude783's Avatar
    Join Date
    Jan 2010
    Age
    25
    Posts
    379
    Thanks given
    13
    Thanks received
    7
    Rep Power
    3
    in the equip method set limitations on it..

    itempackethandler.java in the packethandlers and in the model folder something like equipment.java


    Edit;

    goto
    com >> rs2hd >> packethandler >> ItemPacketHandler.java

    find
    Code:
    	private void equip(Player player, IoSession session, Packet packet) {
    and then go find like this GIANT list of shit..
    Code:
                int cLHunt = Equipment.getCLHunt(item.getDefinition());
                int cLPray = Equipment.getCLPray(item.getDefinition());
                int cLHp = Equipment.getCLHp(item.getDefinition());
                int cLAttack = Equipment.getCLAttack(item.getDefinition());
                int cLDefence = Equipment.getCLDefence(item.getDefinition());
                int cLStrength = Equipment.getCLStrength(item.getDefinition());
                int cLMagic = Equipment.getCLMagic(item.getDefinition());
                int cLRanged = Equipment.getCLRanged(item.getDefinition());
                int cLTheft = Equipment.getCLTheft(item.getDefinition());
               int cLCraft = Equipment.getCLCrafting(item.getDefinition());
               int cLFletch = Equipment.getCLFletching(item.getDefinition());
               int cLSlay = Equipment.getCLSlayer(item.getDefinition());
               int cLfm = Equipment.getCLFiremaking(item.getDefinition());
               int cLfarm = Equipment.getCLFarming(item.getDefinition());
               int cLsmth = Equipment.getCLSmithing(item.getDefinition());
               int cLmine = Equipment.getCLMining(item.getDefinition());
               int cLsum = Equipment.getCLSumm(item.getDefinition());
               int cLcook = Equipment.getCLCooking(item.getDefinition());
               int cLherb = Equipment.getCLHerblore(item.getDefinition());
               int cLfish = Equipment.getCLFishing(item.getDefinition());
               int cLwc = Equipment.getCLWoodcutting(item.getDefinition());
               int cLag = Equipment.getCLAgility(item.getDefinition());
               int cLrc = Equipment.getCLRunecraft(item.getDefinition());
    under there put an if statment stopping it... like for example.. you have to be an administrator to wear the armadyl godsword..

    put this under all those intcL's
    Code:
    if(player.getRights() < 2 && item.getDefinition() == 11694) {
    player.getActionSender().sendMessage("You must be an Administrator to wield the Armadyl GodSword");
    return;
    }
    the return; part restricts the method from going through and ACTUALLY wielding it..
    Quote Originally Posted by Hunter
    Here in America, we dont use the metric system, we use freedom units!
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Apr 2009
    Posts
    106
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Error on compile:

    Code:
    src\com\rs2hd\packethandler\ItemPacketHandler.java:615: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.sanity() == 1 && item.getDefinition() == 4514)
     {
                                                                            ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:619: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.toriq() == 1 && item.getDefinition() == 4516)
    {
                                                                           ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:623: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.sanity() == 1 && item.getDefinition() == 4513)
     {
                                                                            ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:627: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.toriq() == 1 && item.getDefinition() == 4515)
    {
                                                                           ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:631: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.sanityleader() == 1 && item.getDefinition() ==
     4508) {
                                                                                  ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:635: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.sanityleader() == 1 && item.getDefinition() ==
     4507) {
                                                                                  ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:639: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.toriqleader() == 1 && item.getDefinition() ==
    4068) {
                                                                                 ^
    src\com\rs2hd\packethandler\ItemPacketHandler.java:643: incomparable types: com.
    rs2hd.model.ItemDefinition and int
                            if(player.toriqleader() == 1 && item.getDefinition() ==
    4072) {
                                                                                 ^
    8 errors
    Reply With Quote  
     

  4. #4  
    Registered Member lildude783's Avatar
    Join Date
    Jan 2010
    Age
    25
    Posts
    379
    Thanks given
    13
    Thanks received
    7
    Rep Power
    3
    didnt test it myself, soz. you cant use a int check with itemDefinition. dont know why.

    i'll look into it tomoz. im gettin lazier :/ plus im working on my 562 rite now, adding tzhaar shops with tokkull + fight cave and fight pits..
    Quote Originally Posted by Hunter
    Here in America, we dont use the metric system, we use freedom units!
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Apr 2009
    Posts
    106
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Ughh lol I really need this to continue what I was doing.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Apr 2010
    Posts
    392
    Thanks given
    24
    Thanks received
    26
    Rep Power
    16
    why not just make the item not able to get/spawn? >.>...
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Apr 2009
    Posts
    106
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Because people will eventually get it some how.
    Reply With Quote  
     

  8. #8  
    Registered Member Brony's Avatar
    Join Date
    May 2010
    Age
    12
    Posts
    477
    Thanks given
    17
    Thanks received
    23
    Rep Power
    19
    lol that wont happen if you look @ npc drops..

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

  9. #9  
    Registered Member
    Join Date
    Jan 2010
    Age
    28
    Posts
    129
    Thanks given
    12
    Thanks received
    8
    Rep Power
    0
    Change the ablility's to spawn it. Because the definitions packets are weird and I couldn't get passed it either. Just make sure that you take it out of drops too. So example say you wanted an Armadyl Godsword to be Admin+ then you take shards and the hilt out of drops and spawnable points. Good Luck if you do it the items.definitions way.
    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

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