Jump to content

Drop Like Adena


AlexHack

Recommended Posts

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);
       }
     
       /**

Link to comment
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.
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...