Jump to content
Sign in to follow this  
four

Coding fixes

Recommended Posts

I worked on the same base server for a few years, logged in here and in 2 minutes already saw 2 easy fixes.

I noticed there was a bunch of junk loot coming up in the loot announcements, and also if someone got multiple items in 1 drop, it would say "received 29x" instead of 29x *item name*

To fix both of the issues go to    srs\ethos\model\npcs\drops\TableGroup.java

find:         if (chance <= 1.5) {

replace method with 

 

Quote

                        if (chance <= 1.5) {
                            if (policy.equals(TablePolicy.VERY_RARE) || policy.equals(TablePolicy.RARE)) {
                                if (Item.getItemName(item.getId()).toLowerCase().contains("cowhide")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("feather")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("arrow")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("sq shield")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("rune warhammer")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("rune battleaxe")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("casket")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("seed")                                        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("uncut")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("dragon plate")    
                                        || Item.getItemName(item.getId()).toLowerCase().contains("dragon bat")        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("grimy")                                        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("desert")                                        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("dragon spear")                                        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("rune")                                        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("silver ore")
                                        || Item.getItemName(item.getId()).toLowerCase().contains("dragon longsword")                                        
                                        || Item.getItemName(item.getId()).toLowerCase().contains("rune spear")
                                        || item.getId() >= 554 && item.getId() <= 566) {
                                        
                                    
                                } else {
                                    PlayerHandler.executeGlobalMessage(
                                            "<img=18>@red@News: @bla@" + Misc.capitalize(player.playerName) + " @red@has received a @pur@rare@red@ drop: <col=effefe>"
                                                    + (item.getAmount() > 1 ? (item.getAmount() + "x ") : ItemAssistant.getItemName(item.getId()) + "@bla@."));
                                }
                            }
                        }

 

you can add more items (or items containing a name, like the group of "grimy" for all grimy herbs) to the list of items in the code, and every item added will be removed from the drop announcement. And the global message is fixed to add the name of the item if multiple are dropped.

If you are unaware it announces drops based off of the 4 loot tables, and if you have junk items in the rare/very rare drop tables it will announce them whens someone receives it as a drop. 

 

If you want some more fixes on known bugs/issues let me know as I have worked out almost every single one of them on my own server.

Thank you I'll take my developer rank now 🤣

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...