Lowerz Posted June 22, 2019 Posted June 22, 2019 (edited) I found this mod in a forum, but I could not adapt to L2JFrozen. Someone who can do this? Spoiler # net.sf.l2j.Config.java /** Party Drop Config */ public static String NPC_LIST; public static int[] NPC_LIST_SET; public static Map<Integer, Integer> PARTY_DROP_REWARDS = new HashMap<>(); NPC_LIST = customs.getProperty("NpcListPartyDrop", "10506,10507"); String[] NpcList = NPC_LIST.split(","); NPC_LIST_SET = new int[NpcList.length]; for (int i = 0; i < NpcList.length; i++) NPC_LIST_SET[i] = Integer.parseInt(NpcList[i]); String PARTY_DROP_REWARD_VALUE = customs.getProperty("PartyDropReward", "57,100000000;"); String[] party_drop_reward_splitted_1 = PARTY_DROP_REWARD_VALUE.split(";"); for (String i : party_drop_reward_splitted_1) { String[] party_drop_reward_splitted_2 = i.split(","); PARTY_DROP_REWARDS.put(Integer.parseInt(party_drop_reward_splitted_2[1]), Integer.parseInt(party_drop_reward_splitted_2[0])); } # net.sf.l2j.gameserver.scripting.scripts.custom.PartyDrop.java /* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.l2j.gameserver.scripting.scripts.custom; import java.util.HashMap; import java.util.List; import java.util.Set; import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.actor.Npc; import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.scripting.Quest; import net.sf.l2j.gameserver.network.serverpackets.PlaySound; public class PartyDrop extends Quest { boolean _canReward = false; static HashMap<String, Integer> playerIps = new HashMap<>(); public PartyDrop() { super(-1, "custom"); addKillId(Config.NPC_LIST_SET); } @Override public String onKill(Npc npc, Player player, boolean isPet) { if (player.isInParty()) { List<Player> party = player.getParty().getMembers(); for (Player member : party) { String pIp = member.getClient().getConnection().getInetAddress().getHostAddress(); if (!playerIps.containsKey(pIp)) { playerIps.put(pIp, 1); _canReward = true; } else { int count = playerIps.get(pIp); if (count < 1) { playerIps.remove(pIp); playerIps.put(pIp, count + 1); _canReward = true; } else { member.sendMessage("Already 1 member of your ip have been rewarded, so this character won't be rewarded."); _canReward = false; } } if (_canReward) { if (member.isInsideRadius(npc, 1000, false, false)) { Set<Integer> rewards = Config.PARTY_DROP_REWARDS.keySet(); for (Integer i : rewards) { member.addItem("Party Drop Rewards.", Config.PARTY_DROP_REWARDS.get(i), i, member, true); member.broadcastPacket(new PlaySound("ItemSound.quest_finish")); } } else { member.sendMessage("You are too far to be rewarded."); } } } playerIps.clear(); } else { Set<Integer> rewards = Config.PARTY_DROP_REWARDS.keySet(); for (Integer i : rewards) { player.addItem("Party Drop Rewards.", Config.PARTY_DROP_REWARDS.get(i), i, player, true); player.broadcastPacket(new PlaySound("ItemSound.quest_finish")); } } return null; } public static void main(String[] args) { new PartyDrop(); } } # customs.properties # Set mobs list ID's for drop items in Party Drop NpcListPartyDrop = 10506,10507 # Set rewards for drop in monsters of Party Drop PartyDropReward = 57,50; https://pastebin.com/uevvmJ90 Edited June 22, 2019 by Lowerz Quote
0 AlmostGood Posted June 22, 2019 Posted June 22, 2019 imagine recommending known scammer lmao https://maxcheaters.com/topic/227914-kara-scammed-me-with-50-euros/page/4/?tab=comments#comment-2723675 2 Quote
0 Nightw0lf Posted June 22, 2019 Posted June 22, 2019 4 hours ago, AlmostGood said: imagine recommending known scammer lmao https://maxcheaters.com/topic/227914-kara-scammed-me-with-50-euros/page/4/?tab=comments#comment-2723675 I guess you do it maybe? Quote
0 wongerlt Posted June 22, 2019 Posted June 22, 2019 (edited) package quests.PartyDrop; import java.util.List; import java.util.ArrayList; import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.quest.Quest; import com.l2jfrozen.gameserver.network.serverpackets.PlaySound; public class PartyDrop extends Quest { boolean _canReward = false; private static ArrayList<String> playerIps = new ArrayList<String>(); private static final int[] MOB_LIST = {10506,10507}; private static final int[][] DROP_LIST = {{57,50},{57,80}}; public PartyDrop() { super(-1, "PartyDrop", "quests"); for (int mob : MOB_LIST) addKillId(mob); } @Override public String onKill(L2NpcInstance npc, L2PcInstance player, boolean isPet) { if (player.isInParty()) { List<L2PcInstance> party = player.getParty().getPartyMembers(); for (L2PcInstance member : party) { String pIp = member.getClient().getConnection().getInetAddress().getHostAddress(); if (!playerIps.contains(pIp)) { playerIps.add(pIp); if (member.isInsideRadius(npc, 1000, false, false)) { for (int[] i : DROP_LIST) { member.addItem("Party Drop Rewards.", i[0], i[1], member, true); member.broadcastPacket(new PlaySound("ItemSound.quest_finish")); } } else { member.sendMessage("You are too far to be rewarded."); } } else { member.sendMessage("Already 1 member of your ip have been rewarded, so this character won't be rewarded."); } } playerIps.clear(); } else { for (int[] i : DROP_LIST) { player.addItem("Party Drop Rewards.", i[0], i[1], player, true); player.broadcastPacket(new PlaySound("ItemSound.quest_finish")); } } return null; } public static void main(String[] args) { new PartyDrop(); } } script for frozen. just put to data/scripts/quests/PartyDrop and add script path to scripts.cfg p.s its without any config file, so just edit in script file what mobs u want and what drop u want.. Edited June 22, 2019 by wongerlt Quote
0 Lowerz Posted June 22, 2019 Author Posted June 22, 2019 54 minutes ago, wongerlt said: package quests.PartyDrop; import java.util.List; import java.util.ArrayList; import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.quest.Quest; import com.l2jfrozen.gameserver.network.serverpackets.PlaySound; public class PartyDrop extends Quest { boolean _canReward = false; private static ArrayList<String> playerIps = new ArrayList<String>(); private static final int[] MOB_LIST = {10506,10507}; private static final int[][] DROP_LIST = {{57,50},{57,80}}; public PartyDrop() { super(-1, "PartyDrop", "quests"); for (int mob : MOB_LIST) addKillId(mob); } @Override public String onKill(L2NpcInstance npc, L2PcInstance player, boolean isPet) { if (player.isInParty()) { List<L2PcInstance> party = player.getParty().getPartyMembers(); for (L2PcInstance member : party) { String pIp = member.getClient().getConnection().getInetAddress().getHostAddress(); if (!playerIps.contains(pIp)) { playerIps.add(pIp); if (member.isInsideRadius(npc, 1000, false, false)) { for (int[] i : DROP_LIST) { member.addItem("Party Drop Rewards.", i[0], i[1], member, true); member.broadcastPacket(new PlaySound("ItemSound.quest_finish")); } } else { member.sendMessage("You are too far to be rewarded."); } } else { member.sendMessage("Already 1 member of your ip have been rewarded, so this character won't be rewarded."); } } playerIps.clear(); } else { for (int[] i : DROP_LIST) { player.addItem("Party Drop Rewards.", i[0], i[1], player, true); player.broadcastPacket(new PlaySound("ItemSound.quest_finish")); } } return null; } public static void main(String[] args) { new PartyDrop(); } } script for frozen. just put to data/scripts/quests/PartyDrop and add script path to scripts.cfg p.s its without any config file, so just edit in script file what mobs u want and what drop u want.. Thanks, but it still did not work on my project. Follow the mod link, if you can take a look please, thank you very much! https://pastebin.com/uevvmJ90 Quote
0 wongerlt Posted June 22, 2019 Posted June 22, 2019 Whaaaaaat??? i just adapted it to for frozen. so what wrong with me code? Quote
0 Lowerz Posted June 22, 2019 Author Posted June 22, 2019 (edited) 25 minutes ago, wongerlt said: Whaaaaaat??? i just adapted it to for frozen. so what wrong with me code? Error: Spoiler Error on: C:\L2JFrozen\gameserver\data\scripts\quests\PartyDrop\__init__.py.error.LOGGER Line: -1 - Column: -1 Traceback (innermost last): (no code object) at line 0 SyntaxError: ('invalid syntax', ('__init__.py', 13, 13, ' boolean _canReward = false;')) Edited June 22, 2019 by Lowerz 3 Quote
0 DenArt Designs Posted June 23, 2019 Posted June 23, 2019 i think you need to start from the basics the code goes on eclipse then you need to build the project Quote
0 wongerlt Posted June 23, 2019 Posted June 23, 2019 just create file in data/scripts/quests/PartyDrop/PartyDrop. java and add “data/scripts/quests/PartyDrop/PartyDrop. java“ to data/scripts.cfg thats all.. Quote
0 Lowerz Posted June 23, 2019 Author Posted June 23, 2019 5 hours ago, wongerlt said: just create file in data/scripts/quests/PartyDrop/PartyDrop. java and add “data/scripts/quests/PartyDrop/PartyDrop. java“ to data/scripts.cfg thats all.. JFrozen doesn't use .java extension for this mod that goes in the scripts folder. If you use the old method, which is in .py, so it does not work. Quote
0 wongerlt Posted June 23, 2019 Posted June 23, 2019 4 hours ago, Lowerz said: JFrozen doesn't use .java extension for this mod that goes in the scripts folder. If you use the old method, which is in .py, so it does not work. what version frozen u use? im using 1118 and it support both. python and java. or have you tried??? Quote
0 Rootware Posted June 23, 2019 Posted June 23, 2019 1 hour ago, wongerlt said: what version frozen u use? im using 1118 and it support both. python and java. or have you tried??? You could make a diff patch and post here. L2JFrozen have publuc SVN and make diff not a problem. But you skilled troll and shares script for newbie. Quote
0 wongerlt Posted June 23, 2019 Posted June 23, 2019 1 hour ago, Rootware said: You could make a diff patch and post here. L2JFrozen have publuc SVN and make diff not a problem. But you skilled troll and shares script for newbie. so copy paste is hard for newbie? Quote
0 DenArt Designs Posted June 24, 2019 Posted June 24, 2019 8 hours ago, wongerlt said: so copy paste is hard for newbie? for free sometimes yes Quote
Question
Lowerz
I found this mod in a forum, but I could not adapt to L2JFrozen. Someone who can do this?
https://pastebin.com/uevvmJ90
Edited by Lowerz16 answers to this question
Recommended Posts
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.