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

  • 0
Posted
4 hours ago, AlmostGood said:

I guess you do it maybe?

  • 0
Posted (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 by wongerlt
  • 0
Posted
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

  • 0
Posted (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 by Lowerz
  • Haha 3
  • 0
Posted

just create file in data/scripts/quests/PartyDrop/PartyDrop. java

and add “data/scripts/quests/PartyDrop/PartyDrop. java“ to data/scripts.cfg

thats all.. 

  • 0
Posted
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.

  • 0
Posted
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???

  • 0
Posted
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.

  • 0
Posted
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? 

 

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


  • Posts

    • ## [1.4.0] - 2026-01-28   ### ✨ New Features - **Vote System**: Lineage 2 servers can now use our vote–reward system. Players vote on the website and claim rewards in-game (1 vote = 1 claim) - **Vote Page**: On each server’s page (`/servers/<server>`), a **“Vote for Server”** button opens a dedicated vote page with cooldown info and optional Turnstile verification - **By Votes View**: The **“By Votes”** tab on the main page shows **actual vote counts** per server - **API Documentation**: New **API Docs** page at `/docs` (and footer link) with HMAC auth, endpoints, and examples for game server integration - **Vote API (My Servers)**: Server owners can open **“Vote API”** in My Servers to manage credentials, cooldown, allowed IPs, and open the docs   ### 🔄 Improvements - **Server Pages**: Single-server data is cached and loads faster; server pages can be opened by ID or by name (e.g. `/servers/my-server-name`) - **API Root**: Visiting the API root redirects to the docs URL configured in admin (default: site docs page) - **Admin Panel**: New **“Vote System”** tab for global settings (Turnstile, API security, default cooldown, docs URL)   ### 🔐 Security & Reliability - Turnstile (CAPTCHA) support for vote submissions to reduce abuse - HMAC-protected game server API for secure vote check/claim and stats
    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
  • Topics

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