Jump to content

Recommended Posts

Posted

Hallo I found this code in another site

Drop item like adena 50-50

 

    Index: java/com/l2jserver/gameserver/model/L2Party.java
    ===================================================================
    --- java/com/l2jserver/gameserver/model/L2Party.java   (revision 3803)
    +++ java/com/l2jserver/gameserver/model/L2Party.java   (working copy)
    @@ -488,9 +488,12 @@
        */
       public void distributeItem(L2PcInstance player, L2ItemInstance item)
       {
    -      if (item.getItemId() == 57)
    +      if (item == null)
    +         return;
    +
    +      if (item.getItemId() == 57 || item.getItemId() == 5575)
          {
    -         distributeAdena(player, item.getCount(), player);
    +         distributeAdena(player, item.getItemId(), item.getCount(), player);
             ItemTable.getInstance().destroyItem("Party", item, player, null);
             return;
          }
    @@ -523,11 +526,12 @@
        */
       public void distributeItem(L2PcInstance player, L2Attackable.RewardItem item, boolean spoil, L2Attackable target)
       {
    -      if (item == null) return;
    +      if (item == null)
    +         return;
     
    -      if (item.getItemId() == 57)
    +      if (item.getItemId() == 57 || item.getItemId() == 5575)
          {
    -         distributeAdena(player, item.getCount(), target);
    +         distributeAdena(player, item.getItemId(), item.getCount(), target);
             return;
          }
     
    @@ -557,9 +561,9 @@
     
       /**
        * distribute adena to party members
    -    * @param adena
    +    * @param itemCount
        */
    -   public void distributeAdena(L2PcInstance player, long adena, L2Character target)
    +   public void distributeAdena(L2PcInstance player, int itemId, long itemCount, L2Character target)
       {
             // Get all the party members
             List<L2PcInstance> membersList = getPartyMembers();
    @@ -578,9 +582,9 @@
     
             // Now we can actually distribute the adena reward
             // (Total adena splitted by the number of party members that are in range and must be rewarded)
    -        long count = adena / ToReward.size();
    +        long count = itemCount / ToReward.size();
             for (L2PcInstance member : ToReward)
    -            member.addAdena("Party", count, player, true);
    +            member.addItem("Party", itemId, count, player, true);
       }
     
       /**

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..