Jump to content
  • 0

Question

Posted

Hello Mxc..

 

 

I am Using l2j Freya compiled pack and want to add 1 java code...

 

I had seen this java code on l2sexi and dont know if any other server have it..

 

I did not saw it here shared at all...So i want from some1 help me on how to create it or if it is shared just to post here the link ...

 

 

The Java code i want takes place on an PvP Area,where in that area when a player got killed and press to village doesnt go to nearest vilage but spawns again to that pvp  area  but in different location each time(to avoid farming pvp/pk)

 

For Example There are 2 players in PvP Area ( pvp area lets say it is priv isle warf) and the player 1 kills the player 2,(player 2 got killed on [px 24596 -24657 08956 loc]) then player 2 press To Village and it spawn again on "priv isle warf" but in different locations each time player 2 got killed...

 

On l2sexi i think there was about 4 or 5 differnet locations where this system spawns you after death...

 

 

 

 

Dont know if any1 understand what i am looking for..

 

If no i will try to explain it better..

 

Thanks in advance...

11 answers to this question

Recommended Posts

  • 0
Posted

you cant add java codes on a Compiled pack ;).

 

if you got Sources open L2JailZone you will find the Answer there

 

OnExit and BackToJail.

  • 0
Posted

You could even create your own zone type and add what you need there. But you need to create the vertices too...

 

he should create a new Zone.

 

here is the basic strukture of a new Zone

/*
* 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.model.zone.type;

import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.zone.L2ZoneType;

/**
* @author eKo
*/
public class L2CustomZone extends L2ZoneType
{
  public L2PvpZone(int id)
  {
      super(id);
  }
  
  @Override
  protected void onEnter(L2Character character)
  {
      if (character instanceof L2PcInstance)
      {
          ((L2PcInstance) character).sendMessage("Entered Custom Zone XY.");
      }
  }
  
  @Override
  protected void onExit(L2Character character)
  {
      if (character instanceof L2PcInstance)
      {
          ((L2PcInstance) character).sendMessage("Left Custom Zone XY.");
      }
  }
  
  @Override
  public void onDieInside(L2Character character)
  {
      onExit(character);
  }
  
  @Override
  public void onReviveInside(L2Character character)
  {
      onEnter(character);
  }
}

 

now if you want your char to go back to a spawn after Dead and not to town do this for example

 

add :

static class BackToPvp implements Runnable
{
	private L2PcInstance _activeChar;

	BackToPvp(L2Character character)
	{
		_activeChar = (L2PcInstance) character;
	}

	@Override
	public void run()
	{
		_activeChar.teleToLocation(24596 , -24657, 8956); // Random Locs
	}
}

 

So now we Created a"Option" to Teleport the Player back to a Certain place. But to run this Task we have to add the "Trigger" to start this class

 

ThreadPoolManager.getInstance().scheduleGeneral(new BackToPvp(character), 2000);

 

 

add it OnExit

 

like this :

 

   @Override
  protected void onExit(L2Character character)
  {
      if (character instanceof L2PcInstance)
      {
          ((L2PcInstance) character).sendMessage("Left Custom Zone XY.");
          ThreadPoolManager.getInstance().scheduleGeneral(new BackToPvp(character), 2000);
      }
  }

now players will get Ported back to the Set Spawn Location.

 

its just a Simple Example, maybe it helps you understand it a bit more

 

 

 

 

 

  • 0
Posted

Thanks For answers ...!

 

eKo you help me a lot i understand what i must do...

 

i had create new zone name PvpZone

 

/*
* 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 com.l2jserver.gameserver.model.zone.type;

import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.ThreadPoolManager;

/**
* @author eKo
*/
public class L2PvpZone extends L2ZoneType
{

   public L2PvpZone(int id)
   {
       super(id);
   }
static class BackToPvp implements Runnable
{
	private L2PcInstance _activeChar;

	BackToPvp(L2Character character)
	{
		_activeChar = (L2PcInstance) character;
	}

	@Override
	public void run()
	{
		_activeChar.teleToLocation(10197 , -23396, -3673); // Random Locs
	}
}
   @Override
   protected void onEnter(L2Character character)
   {
       if (character instanceof L2PcInstance)
       {
           ((L2PcInstance) character).sendMessage("Entered Custom PvP Zone.");
       }
   }
   
   @Override
   protected void onExit(L2Character character)
   {
       if (character instanceof L2PcInstance)
       {
           ((L2PcInstance) character).sendMessage("Left Custom PvP Zone.");

       }
   }
   
   @Override
   public void onDieInside(L2Character character)
   {
       ThreadPoolManager.getInstance().scheduleGeneral(new BackToPvp(character), 2000);

   }
   
   @Override
   public void onReviveInside(L2Character character)
   {
       onEnter(character);
   }
}

 

The problem is that with this code when some1 kills a player the killed player teleported to that location without to put "To Village" + it is dead...

 

For example you kill me and my body is steal down ... then the system without to put "To Village" teleports my dead body to that location... :S ...

 

 

 

any idea??? ? ...  I Just want to press to village and then teleports me to that location :s ...!

 

 

 

Thanks again

Guest
This topic is now closed to further replies.


  • Posts

    • LIVE VERIFICATION? SUMSUB? “IMPOSSIBLE”? ▪ Spoiler: it is possible — if you know who to work with. A client came in with a task to pass **live verification** on **WantToPay**, a Telegram virtual card service. On the platform side — **Sumsub**: liveness check, SMS, manual review. “Fast” and “by eye” simply don’t work here. › What was done: → analyzed the verification scenario and Sumsub requirements → built the correct flow: phone number, email, timing → **completed live verification remotely, without account handover** → handled SMS and confirmation codes → brought the process to final approval ▪ Result: → verification passed → access granted → no flags or repeat requests ▪ Live verification is not luck. It’s scenario-based preparation — not hope. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +6RAKokIn5ItmYjEx ) *All data is published with the client’s consent.* #verification #sumsub #livecheck #kyc #case
    • IMPORTANT INFO: In a few days, I will switch to completely new code, written from scratch with a new download system, patch building and management system. The Updater will become true 2026 code with "foolproof systems". I'm going to create a Discord server for customers to request new ideas and features. FIRST CUSTOMERS ARE ALREADY USING THE NEW UPDATER ON LIVE SERVERS! Watch this topic for upcoming info because the new updater is around the corner! Yes, you can still use self-update on the previous updater! No, the new updater won't be compatible with the old patch system! A new build is required, but players who already have game files won't have to download the entire patch again! New templates and updates to existing templates are coming soon! Sneak peek:  
    • i used guytis IL project and source. i found in his project there are 3 Client version source... 1,CliExt_H5   --->this one cant be compiled in VS2005,i did know why..is it for H5 client? 2,CliExtNew  --->this one is IL version ,but when i compiled it and use it.player cant login game,MD5Checksum wrong.i check the source code,but not found any hints. 3,L2Server    --->this one for HB client?im not sure...   so my question is what are the differences between these three versions of cliext.dll?how can i fix the issue of the MD5Checksum not matching problem?   01/29/2026 21:04:11.366, [CCliExt::HandleCheckSum] Invalid Checksum[1130415144] vs [-721420287] packet[dd] len[29] sum[2698] key[30] HWID[] Account[]! 01/29/2026 21:04:11.366, SocketLimiter::UserSocketBadunknownprotocol 11111111111 01/29/2026 21:04:11.366, [usersocket]unknown protocol from ip[113.137.149.115]!      
    • ## [1.4.1] - 2026-01-29   ### ✨ New Features - **Short Description**: Server owners can add a short tagline (up to 240 characters) on the server info page, under the "Online" status. It appears in the server list (By Votes) for VIP, Gold VIP, and Pinned servers so players see a brief summary at a glance.   ### 🔄 Improvements - **Server Info Page**: Description field is limited to 3000 characters with a character counter; the textarea is vertically resizable. A second **Save Changes** button was added at the bottom (after the description) for easier saving. - **Server Name**: In My Servers → Edit, the server name is read-only and can no longer be changed (avoids accidental changes and naming conflicts). - **Server Rows (By Votes)**: Short descriptions wrap correctly and no longer affect row height; long text is clipped to two lines so the list stays tidy and consistent.   ---
  • 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..