Jump to content

Recommended Posts

Posted

High Five - Master: Last Rev

 

Hello i have a big problem adding this mod https://gist.github.com/VlLight/7777405 , i can't add drop/spoil for premiums because L2Attackable.java doesn't have anymore drop/spoil configs :( if anyone can help me please 

Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Attackable.java   (revision 6303)
+++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java   (working copy)
@@ -41,6 +41,7 @@
 import com.l2jserver.gameserver.datatables.ManorData;
 import com.l2jserver.gameserver.enums.InstanceType;
 import com.l2jserver.gameserver.enums.QuestEventType;
+import com.l2jserver.gameserver.enums.Rates;
 import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
 import com.l2jserver.gameserver.instancemanager.WalkingManager;
 import com.l2jserver.gameserver.model.AbsorberInfo;
@@ -1014,7 +1015,7 @@
             deepBlueDrop = 3;
             if (drop.getItemId() == PcInventory.ADENA_ID)
             {
-               deepBlueDrop *= isRaid() && !isRaidMinion() ? (int) Config.RATE_DROP_ITEMS_BY_RAID : (int) Config.RATE_DROP_ITEMS;
+               deepBlueDrop *= (int) lastAttacker.getRate(Rates.DROP_ITEM, PcInventory.ADENA_ID, (isRaid() && !isRaidMinion()));
             }
          }
       }
@@ -1032,18 +1033,7 @@
       }
       
       // Applies Drop rates
-      if (Config.RATE_DROP_ITEMS_ID.containsKey(drop.getItemId()))
-      {
-         dropChance *= Config.RATE_DROP_ITEMS_ID.get(drop.getItemId());
-      }
-      else if (isSweep)
-      {
-         dropChance *= Config.RATE_DROP_SPOIL;
-      }
-      else
-      {
-         dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
-      }
+      dropChance *= lastAttacker.getRate(isSweep ? Rates.SPOIL : Rates.DROP_ITEM, drop.getItemId(), (isRaid() && !isRaidMinion()));
       
       if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
       {
@@ -1161,7 +1151,7 @@
       }
       
       // Applies Drop rates
-      categoryDropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
+      categoryDropChance *= lastAttacker.getRate(Rates.DROP_ITEM, -1, (isRaid() && !isRaidMinion()));
       
       if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
       {
@@ -1195,18 +1185,8 @@
          // chance to give a 4th time.
          // At least 1 item will be dropped for sure. So the chance will be adjusted to 100%
          // if smaller.
+         double dropChance = drop.getChance() * lastAttacker.getRate(Rates.DROP_ITEM, drop.getItemId(), (isRaid() && !isRaidMinion()));
          
-         double dropChance = drop.getChance();
-         
-         if (Config.RATE_DROP_ITEMS_ID.containsKey(drop.getItemId()))
-         {
-            dropChance *= Config.RATE_DROP_ITEMS_ID.get(drop.getItemId());
-         }
-         else
-         {
-            dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
-         }
-         
          if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
          {
             dropChance *= Config.L2JMOD_CHAMPION_REWARDS; 

Credits: VlLight

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..