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

    • [New Server] L2Aquila — Gracia Final x9300 No Wipe | Custom Farming Zones Hi all, Rolling a fresh Gracia Final x9300 server — stable core, dedicated box, no wipe, no close, 24/7. WHAT TO EXPECT • 9300x EXP / 3000x SP / 5500x Adena / Safe +3 / Max +25 • Custom Shop + Custom Farming Zones • Free Starter Pack with 20 Custom Coins • Accounts auto-created on first login — no registration • Olympiads, TvT, CTF, offline trading, buff shop LINKS • Website & downloads: https://l2aquila.com/downloads/ • Forum: https://l2aquila.com/forum/ • Discord: https://discord.gg/5ZyBRvG4k • Gameplay tour: https://youtu.be/5QS8qpDG_wc • Install guide: https://youtu.be/F_BfBeiof-s Happy to answer any questions here. Feedback welcome!
    • [New Server] L2Aquila — Gracia Final x9300 No Wipe | Custom Farming Zones Hi all, Rolling a fresh Gracia Final x9300 server — stable core, dedicated box, no wipe, no close, 24/7. WHAT TO EXPECT • 9300x EXP / 3000x SP / 5500x Adena / Safe +3 / Max +25 • Custom Shop + Custom Farming Zones • Free Starter Pack with 20 Custom Coins • Accounts auto-created on first login — no registration • Olympiads, TvT, CTF, offline trading, buff shop LINKS • Website & downloads: https://l2aquila.com/downloads/ • Forum: https://l2aquila.com/forum/ • Discord: https://discord.gg/5ZyBRvG4k • Gameplay tour: https://youtu.be/5QS8qpDG_wc • Install guide: https://youtu.be/F_BfBeiof-s Happy to answer any questions here. Feedback welcome!
    • Hey everyone! A few of us are currently brainstorming and designing a new Lineage 2 private server. Our goal is to capture that classic L2 atmosphere we all fell in love with back in the day, but with a modern, refined feel. We’re aiming for a community-driven, dynamic server where good PvP, meaningful progression, clan life, and that nostalgic L2 vibe take center stage—a place where it just feels good to log in and play. Instead of deciding everything on our own behind closed doors, we want to build something the community actually wants to play on. We’ve put together a short survey to gather your thoughts: What did you love most about older/classic servers? What burnout factors or mechanics are you tired of? What systems or QoL (quality of life) features would you like to see? What red flags make you avoid a server entirely? It only takes a few minutes to fill out, and every single response helps us shape the vision for this project. We can't promise every single idea will be implemented, but we promise to read and consider all of your feedback.   https://docs.google.com/forms/d/e/1FAIpQLScKXptLs9ci_y8PfSmfy9dr2iSvZ9KI9dF3qDaKeFgg9RAaMQ/viewform?pli=1   Thanks a lot for your time and help in bringing this project to life! Let us know your thoughts in the comments as well.
    • Standard Google accounts added in login:password format; aged 7–14 days on average after registration; high quality, manually registered!
  • 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..