Jump to content
  • 0

Someone who can adapt that mod for L2Jfrozen?


Question

Posted (edited)

I found this mod in a forum, but I could not adapt to L2JFrozen. Someone who can do this?

 

Spoiler
  1. # net.sf.l2j.Config.java
  2.  
  3.  
  4.     /** Party Drop Config */
  5.     public static String NPC_LIST;
  6.     public static int[] NPC_LIST_SET;
  7.     public static Map<Integer, Integer> PARTY_DROP_REWARDS = new HashMap<>();
  8.  
  9.     NPC_LIST = customs.getProperty("NpcListPartyDrop", "10506,10507");
  10.    
  11.     String[] NpcList = NPC_LIST.split(",");
  12.     NPC_LIST_SET = new int[NpcList.length];
  13.     for (int i = 0; i < NpcList.length; i++)
  14.         NPC_LIST_SET[i] = Integer.parseInt(NpcList[i]);
  15.    
  16.     String PARTY_DROP_REWARD_VALUE = customs.getProperty("PartyDropReward", "57,100000000;");
  17.     String[] party_drop_reward_splitted_1 = PARTY_DROP_REWARD_VALUE.split(";");
  18.     for (String i : party_drop_reward_splitted_1)
  19.     {
  20.         String[] party_drop_reward_splitted_2 = i.split(",");
  21.         PARTY_DROP_REWARDS.put(Integer.parseInt(party_drop_reward_splitted_2[1]), Integer.parseInt(party_drop_reward_splitted_2[0]));
  22.     }
  23.  
  24.  
  25. # net.sf.l2j.gameserver.scripting.scripts.custom.PartyDrop.java
  26.  
  27.  
  28. /*
  29.  * This program is free software: you can redistribute it and/or modify it under
  30.  * the terms of the GNU General Public License as published by the Free Software
  31.  * Foundation, either version 3 of the License, or (at your option) any later
  32.  * version.
  33.  *
  34.  * This program is distributed in the hope that it will be useful, but WITHOUT
  35.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  36.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  37.  * details.
  38.  *
  39.  * You should have received a copy of the GNU General Public License along with
  40.  * this program. If not, see <http://www.gnu.org/licenses/>.
  41.  */
  42. package net.sf.l2j.gameserver.scripting.scripts.custom;
  43.  
  44. import java.util.HashMap;
  45. import java.util.List;
  46. import java.util.Set;
  47.  
  48. import net.sf.l2j.Config;
  49. import net.sf.l2j.gameserver.model.actor.Npc;
  50. import net.sf.l2j.gameserver.model.actor.instance.Player;
  51. import net.sf.l2j.gameserver.scripting.Quest;
  52. import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
  53.  
  54. public class PartyDrop extends Quest
  55. {
  56.     boolean _canReward = false;
  57.     static HashMap<String, Integer> playerIps = new HashMap<>();
  58.  
  59.     public PartyDrop()
  60.     {
  61.         super(-1, "custom");
  62.  
  63.         addKillId(Config.NPC_LIST_SET);
  64.     }
  65.  
  66.     @Override
  67.     public String onKill(Npc npc, Player player, boolean isPet)
  68.     {
  69.         if (player.isInParty())
  70.         {
  71.             List<Player> party = player.getParty().getMembers();
  72.  
  73.             for (Player member : party)
  74.             {
  75.                 String pIp = member.getClient().getConnection().getInetAddress().getHostAddress();
  76.                    
  77.                 if (!playerIps.containsKey(pIp))
  78.                 {
  79.                     playerIps.put(pIp, 1);
  80.                     _canReward = true;
  81.                 }
  82.                 else
  83.                 {
  84.                     int count = playerIps.get(pIp);
  85.                
  86.                     if (count < 1)
  87.                     {
  88.                         playerIps.remove(pIp);
  89.                         playerIps.put(pIp, count + 1);
  90.                         _canReward = true;
  91.                     }
  92.                     else
  93.                     {
  94.                         member.sendMessage("Already 1 member of your ip have been rewarded, so this character won't be rewarded.");
  95.                         _canReward = false;
  96.                     }
  97.                 }
  98.                 if (_canReward)
  99.                 {
  100.                     if (member.isInsideRadius(npc, 1000, false, false))
  101.                     {
  102.                         Set<Integer> rewards = Config.PARTY_DROP_REWARDS.keySet();
  103.                         for (Integer i : rewards)
  104.                         {
  105.                              member.addItem("Party Drop Rewards.", Config.PARTY_DROP_REWARDS.get(i), i, member, true);
  106.                              member.broadcastPacket(new PlaySound("ItemSound.quest_finish"));
  107.                         }
  108.                     }
  109.                     else
  110.                     {
  111.                         member.sendMessage("You are too far to be rewarded.");
  112.                     }
  113.                 }
  114.             }
  115.             playerIps.clear();  
  116.         }
  117.         else
  118.         {
  119.             Set<Integer> rewards = Config.PARTY_DROP_REWARDS.keySet();
  120.             for (Integer i : rewards)
  121.             {
  122.                  player.addItem("Party Drop Rewards.", Config.PARTY_DROP_REWARDS.get(i), i, player, true);
  123.                  player.broadcastPacket(new PlaySound("ItemSound.quest_finish"));
  124.             }
  125.         }
  126.  
  127.         return null;
  128.     }
  129.  
  130.     public static void main(String[] args)
  131.     {
  132.         new PartyDrop();
  133.     }
  134. }
  135.  
  136.  
  137. # customs.properties
  138.  
  139. # Set mobs list ID's for drop items in Party Drop
  140. NpcListPartyDrop = 10506,10507
  141.  
  142. # Set rewards for drop in monsters of Party Drop
  143. PartyDropReward = 57,50;

 

https://pastebin.com/uevvmJ90

Edited by Lowerz

Recommended Posts

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