Jump to content
  • 0

PvP Flag When leaving a chaotic zone


Question

Posted (edited)

Hello once again dear users.

 

In every chaotic Zone (auto flag) out there, the target instantly loses the pvp flag when it leaves the pvp zone, instead of losing it the normal way, some 15 seconds afters (blinking purple/white). 

In my experience, that is not a good thing cause people will simply run out the zone to run from pvp.

I tried to fix that by using a few things, but none worked correctly. In my attempts so far, the target takes flag when runing out, but it will never go away. To make it disapear I need to relog.

Most of the times, that is what happens.

I looked in the SiegeZone.java to check how it worked there, and tried that as well, but in that case the Flag stays just for 1 second and disapear (But it works corrrectly when in siege).

In the shared MultiFunctionZone.java, it is set like this: 

 

            if(pvp_enabled)
                activeChar.stopPvPFlag();  (instantly removes the flag)

 

So I tried to use the same method used for siege zone:

 

            if (character instanceof L2PcInstance)
            {
                ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE));
                
                // Set pvp flag
                if (((L2PcInstance) character).getPvpFlag() == 0)
                {
                    ((L2PcInstance) character).startPvPFlag();
                }
            }
        }

 

But it doesnt work like in a siege zone.

 

I Also tried something like this:

 

                if (activeChar.getPvpFlag() != 0)
                    activeChar.setPvpFlag(0);
                activeChar.updatePvPFlag(1); 

With this, the target will get pvp flag when it run out the flag zone, but the flag will never go aways like it was intented.

 

Any help pls?

Im using l2jfrozen 1118

 

 

Edited by tiguz

Recommended Posts

  • 0
Posted

pvp.properties you can change time flag

# How much time one stays in PvP mode after hitting an innocent (in ms)
# Default: 120000
PvPVsNormalTime = 40000
# Length one stays in PvP mode after hitting a purple player (in ms)
# Default: 60000
PvPVsPvPTime = 20000

  • 0
Posted

Solution was given your doing something wrong. Else try to use while method updatePvpFlag or whatever it is on frozen. 

  • 0
Posted
1 hour ago, SweeTs said:

Solution was given your doing something wrong. Else try to use while method updatePvpFlag or whatever it is on frozen. 

I tested with the codes everybody gave me, but with those methods the flag will never go away. it stays forever.

I tested too with updatePvpFlag, same outcome.

 

I tested with it like this:

L2PcInstance player = character.getActingPlayer();
            player.setPvpFlagLasts(System.currentTimeMillis() + 3000);
            player.sendMessage("You Have Left The Chaotic Zone."); 
 

Also like this:

      L2PcInstance player = character.getActingPlayer();
            player.updatePvPFlag(0);
            player.sendMessage("You Have Left The Chaotic Zone.");

And also like this: 

@Override
    protected void onExit(L2Character character)
    {
        character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
        character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, false);
        
        if (character instanceof L2PcInstance)
        {
            L2PcInstance player = character.getActingPlayer();
            player.setPvpFlagLasts(System.currentTimeMillis() + 3000);
            player.sendMessage("You Have Left The Chaotic Zone.");
        }
    }
     if (activeChar.getPvpFlag() != 0)
                    activeChar.setPvpFlag(0);
                activeChar.updatePvPFlag(1); 

 

           if (character instanceof L2PcInstance)
            {
                ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE));
                
                // Set pvp flag
                if (((L2PcInstance) character).getPvpFlag() == 0)
                {
                    ((L2PcInstance) character).startPvPFlag();
                }
            }
        }

I tested all these ways, none works =/

  • 0
Posted

If you check Wyatt topic, we were discussing about zone issues. Most likely you even find an answer for your question. :D

  • 0
Posted
27 minutes ago, SweeTs said:

If you check Wyatt topic, we were discussing about zone issues. Most likely you even find an answer for your question. :D

Searching there was my first option =p, found nothing

  • 0
Posted

So i tested something new:

 

I created a startPvPFlag2 on l2character.java with 5seconds flag time after leaving pvp zone:

 /**
	  * Start pvp flag.
	  */
	 public void startPvPFlag2()
	 {
	   updatePvPFlag(1);
	  
	 _PvPRegTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PvPFlag(), 5000, 5000);
	 }
	 

Then I added startPvPFlag2() on onExit

 

It works and gives me 5 seconds of flag time, but then it simply disapear alltogether instead of going to the phase of blinking purple/white like the standard pvp system. How can I add the blinking phase?

  • 0
Posted (edited)
26 minutes ago, Tryskell said:

Setting


updatePvPFlag

to 2.

That worked! But then instead of staying 5 seconds in flag mode, the target goes to blinking phase straight away after leaving zone.

So we have 2 scenarios, with updatepvpflag(1) the blinking phase doesnt happen...With updatepvpflag(2) the blinking phase happens straight away, instead of hapenning after 5 seconds of perm flag!

Thank you @Tryskell so far!

Edited by tiguz
  • 0
Posted (edited)

Normal behavior is to updatePvpFlag to 1 for the first 10 seconds, then for the next 5 seconds you set it to 2. Once 15sec are passed, you set it back to 0.

 

L2J (and probably Frozen ?) handles it using a task, one per player. aCis got a unique task for all players, it runs forever every second, and ppl are set and removed following their own timestamp.

 

In both cases, the flag doesn't need to be refreshed every second. You only need to update it to 1, then 10 seconds later to 2, then 5 seconds later to 0.

 

aCis scenario :

https://xp-dev.com/trac/aCis_public/browser/acis_public/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java

 

PS : the times are even different : 15sec for regular scenario, and 30sec on pvp scenario. In both cases, the blink effect happens during the last 5sec.

 

PS2 : you should check castle/siege zone, it does exactly what you want during sieges (pvp flag on zone leave).

 

https://xp-dev.com/trac/aCis_public/browser/acis_public/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2SiegeZone.java

Edited by Tryskell
  • 0
Posted (edited)
1 hour ago, Tryskell said:

 

PS2 : you should check castle/siege zone, it does exactly what you want during sieges (pvp flag on zone leave).

 

https://xp-dev.com/trac/aCis_public/browser/acis_public/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/L2SiegeZone.java

Im using frozen. I tried using the same methods in siege zone, but then the flag will never go away and to remove it the char must relog.

The siege onExit is like this:

protected void onExit(final L2Character character)
	{
		if (_castle.getSiege().getIsInProgress())
		{
			character.setInsideZone(L2Character.ZONE_PVP, false);
			character.setInsideZone(L2Character.ZONE_SIEGE, false);
			
			if (character instanceof L2PcInstance)
			{
				((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE));
				
				// Set pvp flag
				if (((L2PcInstance) character).getPvpFlag() == 0)
				{
					((L2PcInstance) character).startPvPFlag();
				}
			}
		}

For some reason the method "startPvPFlag(); or updatePvPFlag(1) makes the flag status stays forever =/

Edited by tiguz
  • 0
Posted

I took the time to download aCis and adapt a flag zone to it just to test, and the outcome is the same as in l2jfrozen: the flags stays forever, no matter what code I try lol. I ran out of ideas to fix it.

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

    • Wts adena 1kk = 10$  LU4 1kk = 1.6$ discord - GODDARDSHOP 
    • Dear partners! At the moment, we are in great need of the following items: TikTok Ads and Google Ads advertising accounts with an ad limit starting from $100. Countries: Europe, USA, Asia Contact us via the contacts in the thread or in this post. We look forward to cooperating! Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! 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 & 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 items: TikTok Ads and Google Ads advertising accounts with an ad limit starting from $100. Countries: Europe, USA, Asia Contact us via the contacts in the thread or in this post. We look forward to cooperating! Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! 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 & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Hey everyone, I’m thrilled to introduce our upcoming server, Dragon‑Network, built on the powerful Interlude+ chronicle and crafted for serious PvP, balanced progression and community fun. Below you’ll find all the key details — rates, features, event structure, and why this will be your next home for Lineage 2. 📅 Grand Opening November 21, 2025 — mark the date, rally your friends, prepare your gear. The realm opens, and the wars begin. ⚙️ Rates & Server Setup XP: 10× Chronicle: Interlude+ (expanded from our previous server) PvP-focused content, daily events, and reward-rich systems These core settings ensure you’ll feel progress and power, without losing the depth of classic Interlude. 🎯 Features & Highlights Based on our features page: Alternative class change quests: skip the lengthy standard quests by collecting tradable items dropped by monsters. Dragon-Network Full Interlude+ content: Kamaloka, Labyrinth, Pailaka quests, Hellbound Island, S80 items, Attribute system, Isle of Prayer hunting zone, siegeable fortresses and more. Dragon-Network Daily Team vs Team (TvT) events: prove your worth, climb the ranks and earn valuable rewards. Dragon-Network Balanced PvP mechanics: custom sub-stack features, armor mastery rules, optimized skill effects — all to keep the fight fair and skill-based. Dragon-Network Other extras: Raid Bosses with defined respawn times, rich loot systems, improved QOL features like improved buffs, combo songs/dances, tattoo system, etc. Dragon-Network 🎮 Why This Server Matters You’re playing Interlude+, but with modern enhancements — classic content with new mechanics, not a simple resurrect of the old. PvP and events are daily and structured, so you don’t wait weeks to engage. We’ve designed progression to be meaningful: rewards, class changes, content unlocks all move you forward without feeling pay-to-win. Community-first: Whether you enter solo or with friends, you’ll find team action, clans forming, and events where everyone has a chance to shine. 🗺 What to Do Next Visit our website: dragon-network.eu (check out the “Features” tab for full details) Prepare your Master Account, get your clan or buddies ready. On launch day (Nov 21), log in early, grab your spot, participate in the first TvT, and start building your legacy. Get ready — the gates open soon. The grind begins. The battles await. Will you rise to become legend on Dragon-Network? 🐉 Feel free to ask any questions below or share this post with your friends. Let’s make this launch one to remember.
  • 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