Thread: 667 & 718 & RS3 [Loading Bonuses From Cache]

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 667 & 718 & RS3 [Loading Bonuses From Cache] 
    Server Programmer
    Adrian Aries's Avatar
    Join Date
    Jul 2015
    Age
    26
    Posts
    138
    Thanks given
    7
    Thanks received
    21
    Rep Power
    11
    So basically since people have been having trouble loading there bonuses from cache and if your running a 718 Loading Rs3 and been wanting to get the correct hits and stats and everything for you're bosses, well here's the solution it's quite simple so first of all this is how we are gonna start with this process but before we start that do this go to the data folder on your source and then go to the sub-folder called "items" and delete bonuses.ib.

    Spoiler for Launcher:
    Code:
    remove the import for ItemBonuses (com/rs/utils). Also in that same class, remove the call to load item bonuses through that class

    Now add this method to CombatDefinitions
    Spoiler for CombatDefinitions:
    Code:
    public int[] getBonuses(int id) {
            if (ItemDefinitions.getItemDefinitions(id).getStabAttack() != -1) {
                bonuses[STAB_ATTACK] += ItemDefinitions.getItemDefinitions(id).getStabAttack();
            }
            if (ItemDefinitions.getItemDefinitions(id).getSlashAttack() != -1) {
                bonuses[SLASH_ATTACK] += ItemDefinitions.getItemDefinitions(id).getSlashAttack();
            }
            if (ItemDefinitions.getItemDefinitions(id).getCrushAttack() != -1) {
                bonuses[CRUSH_ATTACK] += ItemDefinitions.getItemDefinitions(id).getCrushAttack();
            }
            if (ItemDefinitions.getItemDefinitions(id).getMagicAttack() != -1) {
                bonuses[MAGIC_ATTACK] += ItemDefinitions.getItemDefinitions(id).getMagicAttack();
            }
            if (ItemDefinitions.getItemDefinitions(id).getRangeAttack() != -1) {
                bonuses[RANGE_ATTACK] += ItemDefinitions.getItemDefinitions(id).getRangeAttack();
            }
            if (ItemDefinitions.getItemDefinitions(id).getStabDef() != -1) {
                bonuses[STAB_DEF] += ItemDefinitions.getItemDefinitions(id).getStabDef();
            }
            if (ItemDefinitions.getItemDefinitions(id).getSlashDef() != -1) {
                bonuses[SLASH_DEF] += ItemDefinitions.getItemDefinitions(id).getSlashDef();
            }
            if (ItemDefinitions.getItemDefinitions(id).getCrushDef() != -1) {
                bonuses[CRUSH_DEF] += ItemDefinitions.getItemDefinitions(id).getCrushDef();
            }
            if (ItemDefinitions.getItemDefinitions(id).getMagicDef() != -1) {
                bonuses[MAGIC_DEF] += ItemDefinitions.getItemDefinitions(id).getMagicDef();
            }
            if (ItemDefinitions.getItemDefinitions(id).getRangeDef() != -1) {
                bonuses[RANGE_DEF] += ItemDefinitions.getItemDefinitions(id).getRangeDef();
            }
            if (ItemDefinitions.getItemDefinitions(id).getSummoningDef() != -1) {
                bonuses[SUMMONING_DEF] += ItemDefinitions.getItemDefinitions(id).getSummoningDef();
            }
            if (ItemDefinitions.getItemDefinitions(id).getAbsorveMeleeBonus() != -1) {
                bonuses[ABSORVE_MELEE_BONUS] += ItemDefinitions.getItemDefinitions(id).getAbsorveMeleeBonus();
            }
            if (ItemDefinitions.getItemDefinitions(id).getAbsorveMageBonus() != -1) {
                bonuses[ABSORVE_MAGE_BONUS] += ItemDefinitions.getItemDefinitions(id).getAbsorveMageBonus();
            }
            if (ItemDefinitions.getItemDefinitions(id).getAbsorveRangeBonus() != -1) {
                bonuses[ABSORVE_RANGE_BONUS] += ItemDefinitions.getItemDefinitions(id).getAbsorveRangeBonus();
            }
            if (ItemDefinitions.getItemDefinitions(id).getStrengthBonus() != -1) {
                bonuses[STRENGTH_BONUS] += ItemDefinitions.getItemDefinitions(id).getStrengthBonus();
            }
            if (ItemDefinitions.getItemDefinitions(id).getRangedStrBonus() != -1) {
                bonuses[RANGED_STR_BONUS] += ItemDefinitions.getItemDefinitions(id).getRangedStrBonus();
            }
            if (ItemDefinitions.getItemDefinitions(id).getMagicDamage() != -1) {
                bonuses[MAGIC_DAMAGE] += ItemDefinitions.getItemDefinitions(id).getMagicDamage();
            }
            if (ItemDefinitions.getItemDefinitions(id).getPrayerBonus() != -1) {
                bonuses[PRAYER_BONUS] += ItemDefinitions.getItemDefinitions(id).getPrayerBonus();
            }
            return bonuses;
        }

    Now replace you're refreshBonuses() method with this one.
    Spoiler for RefreshBonuses() Method:
    Code:
    public void refreshBonuses() {
            bonuses = new int[18];
            for (Item item : player.getEquipment().getItems().getItems()) {
                if (item == null)
                    continue;
                int[] bonuses = getBonuses(item.getId());
                if (bonuses == null)
                    continue;
                for (int id = 0; id < bonuses.length; id++) {
                    if (id == RANGED_STR_BONUS && this.bonuses[RANGED_STR_BONUS] != 0)
                        continue;
                    this.bonuses[id] = bonuses[id];
                }
            }
        }

    Now wasn't that simple wasn't it? I hope it helped out ya'll out there in the rune-server community, this thread might be a bit sloppy but hey the code works, and if this might be released somewhere else, my bad for posting this, i just haven't seen one in a long time, but hey thanks to everyone that needed this my pleasure of helping you're server or whatever your gonna use this code for.
    Coming Soon!
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.
    Life is one big road with lots of signs. So when you riding through the ruts, don't complicate your mind. Flee from hate, mischief and jealousy
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    732
    Thanks given
    219
    Thanks received
    203
    Rep Power
    286
    Okay but...
    You gonna give people any of the methods...?

    This also, would only affect item's bonuses, all npcs also have bonuses.
    Reply With Quote  
     

  4. #3  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Expected this to be NPC bonuses. (They probably don't even exist in the cache but still, the hope is there)
    I guess this could be useful to some people..
    Attached image
    Reply With Quote  
     

  5. #4  
    Server Programmer
    Adrian Aries's Avatar
    Join Date
    Jul 2015
    Age
    26
    Posts
    138
    Thanks given
    7
    Thanks received
    21
    Rep Power
    11
    Quote Originally Posted by Kris View Post
    Expected this to be NPC bonuses. (They probably don't even exist in the cache but still, the hope is there)
    I guess this could be useful to some people..
    This is for loading npc's bonuses, and stats, and hits. my bad for not adding that in. - Loads basically everything from a cache point in view.

    Quote Originally Posted by Hellman2741 View Post
    Okay but...
    You gonna give people any of the methods...?

    This also, would only affect item's bonuses, all npcs also have bonuses.
    Doesn't require methods to be added, since your removing itembonuses. like i said people needing help if they load higher revisions ext.
    Coming Soon!
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.
    Life is one big road with lots of signs. So when you riding through the ruts, don't complicate your mind. Flee from hate, mischief and jealousy
    Reply With Quote  
     

  6. #5  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Artful Arrow View Post
    This is for loading npc's bonuses, and stats, and hits. my bad for not adding that in. - Loads basically everything from a cache point in view.
    What? This is only for loading item bonuses, not NPC.
    Attached image
    Reply With Quote  
     

  7. #6  
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    732
    Thanks given
    219
    Thanks received
    203
    Rep Power
    286
    Quote Originally Posted by Artful Arrow View Post
    This is for loading npc's bonuses, and stats, and hits. my bad for not adding that in. - Loads basically everything from a cache point in view.



    Doesn't require methods to be added, since your removing itembonuses. like i said people needing help if they load higher revisions ext.
    That's awesome, doesn't require methods?

    So this weird error I'm getting because I don't have this getStabAttack method is just crazy.

    Code:
    if (ItemDefinitions.getItemDefinitions(id).getStabAttack() != -1) {
                bonuses[STAB_ATTACK] += ItemDefinitions.getItemDefinitions(id).getStabAttack();
            }
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    What if you add your own items/npcs how would you edit their stats? I've never seen an option to edit them
    Attached image
    Reply With Quote  
     

  10. #8  
    Donator


    Join Date
    May 2012
    Posts
    252
    Thanks given
    95
    Thanks received
    97
    Rep Power
    78
    Quote Originally Posted by BoomScape View Post
    What if you add your own items/npcs how would you edit their stats? I've never seen an option to edit them
    you can edit them in item data using the correct keys
    .
    Reply With Quote  
     

  11. #9  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Quote Originally Posted by ARMAR X K1NG View Post
    you can edit them in item data using the correct keys
    Hmm not 100% on cache editing at all though :/
    Attached image
    Reply With Quote  
     

  12. #10  
    Registered Member
    Join Date
    Jul 2016
    Posts
    70
    Thanks given
    36
    Thanks received
    0
    Rep Power
    11
    not sure what exactly what this is, but when i figure it out, I know it will be useful
    Reply With Quote  
     

Page 1 of 2 12 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. Replies: 3
    Last Post: 08-07-2011, 11:11 AM
  2. Replies: 2
    Last Post: 04-02-2011, 06:14 AM
  3. Loading models from cache
    By Nighel in forum Help
    Replies: 0
    Last Post: 03-05-2010, 07:44 PM
  4. Error in Loading Sprites From Cache
    By Mister Maggot in forum Help
    Replies: 3
    Last Post: 10-25-2009, 04:03 AM
  5. loading icons from cache
    By harmy in forum Help
    Replies: 0
    Last Post: 03-22-2009, 02:18 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
  •