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

  • 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

    • 🔥 L2NeverPain – Opening this Friday! 🔥 The gates open 12 December 2025 – 20:00 (GMT+2). Prepare your squads, set your macros, and get ready for true StuckSub PvP.   Main +2 Sub. Balanced fights. Fresh start. Be there from the first minute.   🛡️Clan Leaders: You can register your clan on discord clan-register channel   🌐https://l2neverpain.com/ 🌐https://discord.gg/kNP3UXgkmN
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • why is he still not banned? scammer
    • Complete verification on the services you need and unlock new earning opportunities. Use our newest service in the store: Learn more Active links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock