Jump to content

Question

2 answers to this question

Recommended Posts

  • 0
Posted
3 minutes ago, maxicroma said:

Hi im using L2Mythras files h5,i want to make a custom instant flag zone (you will be flagged all the time inside that zone).

Its possible to made it ?

In L2PcInstance there is a PvPFlag Runnable. Search it and modify it in case of inside that zone never stopPvPFlag();

  • 0
Posted

i found some crap inside the sources this thing called pvpzone.java 

package zones;

import java.util.concurrent.ScheduledFuture;

import l2f.commons.threading.RunnableImpl;
import l2f.gameserver.ThreadPoolManager;
import l2f.gameserver.listener.zone.OnZoneEnterLeaveListener;
import l2f.gameserver.model.Creature;
import l2f.gameserver.model.Player;
import l2f.gameserver.model.Zone;
import l2f.gameserver.scripts.ScriptFile;
import l2f.gameserver.utils.ReflectionUtils;

/**
 * @author L2Mythras
 */

public class PvPZone implements ScriptFile
{
	private static ZoneListener _zoneListener;

	@Override
	public void onLoad()
	{
		_zoneListener = new ZoneListener();
		Zone zone = ReflectionUtils.getZone("[pvp_zone_toi]");
		zone.addListener(_zoneListener);
	}

	@Override
	public void onReload()
	{
		 on reload
	}

	@Override
	public void onShutdown()
	{
		 on shutdown
	}

	public class ZoneListener implements OnZoneEnterLeaveListener
	{
		@Override
		public void onZoneEnter(Zone zone, Creature cha)
		{
			ScheduledFuture<?> _checkTask = null;
			if (zone.getParams() == null || !cha.isPlayable()) 
				return;
			
			if (!cha.isPlayer()) 
				return;

			cha.getPlayer().sendMessage("You have entered in a PvP Zone!");
			cha.startPvPFlag(null);
			cha.getPlayer().sendMessage("You are now flagged!");

			_checkTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new checkZone((Player)cha, zone, _checkTask), 60000, 60000);
		}

		
		public class checkZone extends RunnableImpl
		{
			Player _cha;
			Zone _zone;
			ScheduledFuture<?> _checkTask;
			
			public checkZone(Player cha, Zone zone, ScheduledFuture<?> checkTask)
			{
				_cha = cha;
				_zone = zone;
				_checkTask = checkTask;
			}

			@Override
			public void runImpl() throws Exception
			{
				if(_cha.isInZone(_zone))
				{
					_cha.startPvPFlag(null);
				}
				else
				{
					_checkTask.cancel(true);
					_checkTask = null;
				}
			}
			
		}
		
		@Override
		public void onZoneLeave(Zone zone, Creature cha)
		{
			if (cha == null) 
				return;
			cha.getPlayer().sendMessage("You have left the PvP Zone !");
			cha.getPlayer().stopPvPFlag();
		}

	}
}

 

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Hi people, someone has to sharing a client for Lineage 2 Shinemaker?. I found a few but are not working very well. Thanks
    • Grab a proper launcher for Your server - update files whenever You need
    • Dear players, 19.04 at 06:00 server time, the Airin server will be updated to Chronicle 2. - The x2 updater will be disabled on April 18, 2025, at 23:59 and will become available again during the update. - Server rates will be increased to x2.25; - The siege of Innadril will take place on April 27 at 16:00 server time; - Bonus Start will begin after the restart! Characters created after April 16, 00:00 will receive rewards.   You can download the full client for Airin C2 from the following link.  Do not run the updater until tomorrow's update. 
  • Topics

×
×
  • Create New...