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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...