CostyKiller

Drop amount increase modification

May 21st, 2020
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.68 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_Mobius_CT_2.6_HighFive
  3. Index: dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java
  4. ===================================================================
  5. --- dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java  (revision 7212)
  6. +++ dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java  (working copy)
  7. @@ -375,8 +375,15 @@
  8.             sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td>");
  9.             sb.append("<td width=247 align=center>");
  10.            
  11. +           // Drop amount increase
  12. +           long dropMax = dropItem.getMax();
  13. +           if (Config.DROP_AMOUNT_INCREASE && ((dropItem.getChance() * rateChance) > 100))
  14. +           {
  15. +               dropMax += (dropItem.getChance() * rateChance) / 100;
  16. +           }
  17. +          
  18.             final long min = (long) (dropItem.getMin() * rateAmount);
  19. -           final long max = (long) (dropItem.getMax() * rateAmount);
  20. +           final long max = (long) (dropMax * rateAmount);
  21.             if (min == max)
  22.             {
  23.                 sb.append(amountFormat.format(min));
  24. Index: java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java
  25. ===================================================================
  26. --- java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java    (revision 7212)
  27. +++ java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java    (working copy)
  28. @@ -802,7 +802,7 @@
  29.                         rateAmount *= Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * (champion ? Config.CHAMPION_REWARDS_AMOUNT : 1);
  30.                     }
  31.                    
  32. -                   // premium chance
  33. +                   // premium amount
  34.                     if (Config.PREMIUM_SYSTEM_ENABLED && (killer.getActingPlayer() != null) && killer.getActingPlayer().hasPremiumStatus())
  35.                     {
  36.                         if (Config.PREMIUM_RATE_DROP_AMOUNT_BY_ID.get(itemId) != null)
  37. @@ -823,8 +823,15 @@
  38.                         }
  39.                     }
  40.                    
  41. +                   // Drop amount increase
  42. +                   long dropMax = dropItem.getMax();
  43. +                   if (Config.DROP_AMOUNT_INCREASE && ((dropItem.getChance() * rateChance) > 100))
  44. +                   {
  45. +                       dropMax += (dropItem.getChance() * rateChance) / 100;
  46. +                   }
  47. +                  
  48.                     // finally
  49. -                   return new ItemHolder(itemId, (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
  50. +                   return new ItemHolder(itemId, (long) (Rnd.get(dropItem.getMin(), dropMax) * rateAmount));
  51.                 }
  52.                 break;
  53.             }
  54. @@ -849,8 +856,15 @@
  55.                         rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
  56.                     }
  57.                    
  58. +                   // Drop amount increase
  59. +                   long dropMax = dropItem.getMax();
  60. +                   if (Config.DROP_AMOUNT_INCREASE && ((dropItem.getChance() * rateChance) > 100))
  61. +                   {
  62. +                       dropMax += (dropItem.getChance() * rateChance) / 100;
  63. +                   }
  64. +                  
  65.                     // finally
  66. -                   return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
  67. +                   return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropMax) * rateAmount));
  68.                 }
  69.                 break;
  70.             }
  71. ### Eclipse Workspace Patch 1.0
  72. #P L2J_Mobius_CT_2.6_HighFive
  73. Index: dist/game/config/Rates.ini
  74. ===================================================================
  75. --- dist/game/config/Rates.ini  (revision 7212)
  76. +++ dist/game/config/Rates.ini  (working copy)
  77.  
  78. @@ -125,17 +125,51 @@
  79.  # are not counted by this value. They will drop as extra drops.
  80.  DropMaxOccurrencesNormal = 2
  81.  DropMaxOccurrencesRaidboss = 7
  82. +# Increase drop amount if drop chance exceeds 100%
  83. +# Default: False
  84. +DropAmountIncrease = True
  85.  
  86.  
  87.  # ---------------------------------------------------------------------------
  88. ### Eclipse Workspace Patch 1.0
  89. #P L2J_Mobius_CT_2.6_HighFive
  90. Index: java/org/l2jmobius/Config.java
  91. ===================================================================
  92. --- java/org/l2jmobius/Config.java  (revision 7212)
  93. +++ java/org/l2jmobius/Config.java  (working copy)
  94. @@ -806,6 +810,7 @@
  95.     public static Map<Integer, Float> RATE_DROP_CHANCE_BY_ID;
  96.     public static int DROP_MAX_OCCURRENCES_NORMAL;
  97.     public static int DROP_MAX_OCCURRENCES_RAIDBOSS;
  98. +   public static boolean DROP_AMOUNT_INCREASE;
  99.     public static int DROP_ADENA_MIN_LEVEL_DIFFERENCE;
  100.     public static int DROP_ADENA_MAX_LEVEL_DIFFERENCE;
  101.     public static double DROP_ADENA_MIN_LEVEL_GAP_CHANCE;
  102.  
  103.  
  104. @@ -2402,6 +2490,7 @@
  105.            
  106.             DROP_MAX_OCCURRENCES_NORMAL = RatesSettings.getInt("DropMaxOccurrencesNormal", 2);
  107.             DROP_MAX_OCCURRENCES_RAIDBOSS = RatesSettings.getInt("DropMaxOccurrencesRaidboss", 7);
  108. +           DROP_AMOUNT_INCREASE = RatesSettings.getBoolean("DropAmountIncrease", false);
  109.             DROP_ADENA_MIN_LEVEL_DIFFERENCE = RatesSettings.getInt("DropAdenaMinLevelDifference", 8);
  110.             DROP_ADENA_MAX_LEVEL_DIFFERENCE = RatesSettings.getInt("DropAdenaMaxLevelDifference", 15);
  111.             DROP_ADENA_MIN_LEVEL_GAP_CHANCE = RatesSettings.getDouble("DropAdenaMinLevelGapChance", 10);
Add Comment
Please, Sign In to add comment