Jump to content

Recommended Posts

Posted (edited)

Hello forum, i was searching around and i saw on many forum's peoples selling this code for gold. (30-40 euro) rolf...
That's who we are, sad...

So this is one "Gift" from me for the new year.

On this code you have the listed options:

  • You can add as many zones you want.
  • You can setup for each zone the running time.
  • (On the current diff i have use Giran Arena and Gludin Arena).
  • Gatekeeper command : <a action="bypass -h npc_%objectId%_pvp">Random Zone</a>
  • The codes required more then 1 zone.


Ofc you can add your own configs like "Auto Flag" "Auto Nobles" and whatever you want.. take this share like platform and work on it.
DIFF is coded on aCis 381 revision - Feel free to adapt it in whatever revision or project you need.

Credits : StinkyMadness
Code r381: Here

Edited by StinkyMadness
  • Like 7
  • Thanks 3
  • Upvote 1
Posted
6 hours ago, N0K3 said:

Hi stinky, I really liked this change, however, by adding I'm getting this nullpointer.
Could you give me some help on?

https://imgur.com/FSe7h5y

Give a close view on your RandomZone.xml you did something wrong there.

Posted

Change this code.

 

 public void selectNextZone()
+   {
+       int nextZoneId = Rnd.get(1, getTotalZones());
+       while (getZoneId() == nextZoneId)
+           nextZoneId = Rnd.get(1, getTotalZones());
+       _zoneId = nextZoneId;
+      
+       _timer = getCurrentZone().getTime() + 10;
+   }

You can do better

Posted (edited)
1 hour ago, StinkyMadness said:

Give a close view on your RandomZone.xml you did something wrong there.

What's puzzling me is that things seem to be all right there.
RandomZone.xml in the zone folder and inside it contains this, just like your example.

<?xml version="1.0" encoding="UTF-8"?>
<list>
   <zone shape="Cuboid" minZ="-3752" maxZ="-352"><!-- gludin_pvp -->
       <stat name="id" val="1" />
       <stat name="name" val="Gludin Arena" />
       <stat name="time" val="30" /><!-- time in seconds -->
       <stat name="locs" val="-88339,141802,-3649;-87894,142231,-3649" />
       <node X="-88411" Y="141732" />
       <node X="-87429" Y="142708" />
   </zone>
   <zone shape="Cuboid" minZ="-3850" maxZ="-350"><!-- giran_pvp_battle -->
       <stat name="id" val="2" />
       <stat name="name" val="Giran Arena" />
      <stat name="time" val="30" /><!-- time in seconds -->
       <stat name="locs" val="73306,142440,-3775;72646,142403,-3775" />
       <node X="72493" Y="142263" />
       <node X="73493" Y="143261" />
   </zone>
</list>

 

Edited by N0K3
I was able to identify it was something with the type, because my zones had L2 prefix at the beginning and I needed to adapt RandomZone to my source, thanks for the support.
Posted
1 hour ago, Kara` said:

You can do better

indeed. something like that would be more clean

 

private static void selectNextZone()
{
	final int maxSize = getTotalZones();
	_zoneId = _zoneId >= maxSize ? 1 : _zoneId++;
	_timer = getCurrentZone().getTime() + 10;
}

public static int getTotalZones()
{
	return ZoneManager.getInstance().getAllZones(RandomZone.class).stream().filter(zone -> zone != null).collect(Collectors.toList()).size();
}

 

Posted
20 minutes ago, melron said:

something like that would be more clean

I believe it's supposed to be truly random, not seemingly. But yeah, one after another is also a way.

 

Zones count, simply: ZoneManager.getInstance().getAllZones(RandomZone.class).size();

Posted
4 minutes ago, Kara` said:

RandomZone selectedZone = ZoneManager.getInstance().getAllZones(RandomZone.class).stream().findAny();

1 line code instead of 8

With that line, I believe you can pick the same zone, right? So, it's not what you really want. You must be sute the next zone is different :thinking:

Posted
3 minutes ago, SweeTs said:

With that line, I believe you can pick the same zone, right? So, it's not what you really want. You must be sute the next zone is different :thinking:

Didn't know we need also that check.

 

RandomZone selectedZone = ZoneManager.getInstance().getAllZones(RandomZone.class).stream().filter(s -> s.getId() != getCurrentZone().getId()).findAny().orElse(null);

In null you can add to return the same zone if no other exist. I write it in notepad++ so i cannot know if syntax is ok

 

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
Reply to this topic...

×   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

    • A New Chapter Begins We're Rebuilding – Join Our Staff Team After many years of activity, growth, and challenges, it’s finally time for our community to restructure and move forward. We’re ready to turn a new page and evolve into something greater — but we can’t do it without the help of passionate and committed people. That’s why we’re now opening up staff applications for those who want to actively shape the future of our community. If you have the motivation, time, and patience to contribute to something meaningful, this is your chance to step in and make a real impact. What We're Looking For We’re building a fresh and dedicated team of individuals who are ready to support and grow this project. Open roles include: Moderators – to keep the forum clean, safe, and organized Gaming Moderators – to help manage gaming boards (e.g., Lineage, GTA FiveM) Content Creators – to post updates, guides, and articles Community Managers – to engage users and drive activity Technical Staff – for development, backend, and server work We’re not focusing only on Lineage anymore. Our vision is expanding to new areas — including GTA FiveM and other multiplayer games you might have expertise in. If you have a good idea, a server plan, or something new to suggest — we’re open to it. Now’s the time to bring it forward. Requirements We’re looking for individuals who have: A history of activity on the forum (preferred) Available time to contribute consistently A sense of teamwork and responsibility A genuine interest in gaming and community building If you're interested, just send a private message to me or Celestine. (or just reply here) Tell us a few things about yourself and how you’d like to contribute. Let’s bring this community back to life. Let’s rebuild something great — together.   M M G A 
    • Lineage2Network - Interlude Reimagined   Embark on a revitalized journey through the classic Interlude era with Lineage2.Network. Our server is meticulously crafted by veteran players to deliver a seamless and engaging experience, blending the nostalgia of the Chaotic Chronicle with modern enhancements.     Server details   Chronicle: Interlude + Classic Rates: EXP x30 | Adena x10 | Drop x10 | Spoil x10     Server features   Daily Missions - complete special tasks for daily rewards Attendance Rewards - get rewards for online time Custom Events - TVT, DM, CTF NPC buffer duration - 2 hours   Mana Potions - restores 1000 MP, 10s cooldown Ring of Core additional stats: +1 STR Earring of Orfen additional stats: +1 INT Shadow Earring of Zaken - 7 days Shadow Ring of Queen Ant - 7 days   Max buff count - 24 (20 + 4 with Divine Inspiration) Noblesse, Heroic Valor, Flames of Invincibility and Celestial Shield don't take buff slot Reworked Cancel, Mage and Warrior Banes – removed buffs reappear after 30s Block Buffs - block all incoming buffs except from self/party Sweeper Festival added to Spoiler class   Subclass – retail or purchasable Noblesse – retail or purchasable up to Barakiel; collect 8 fragments for full staff 1st & 2nd class free, 3rd needs 700 Halisha Marks or is purchasable New Olympiad System: new stadiums with NPC buffer,  1 week period.     Key dates     Beta Launch: April 14, 2025 Official Launch: May 9, 2025     Check out full server details in our website And visit our discord   Join us and be part of community where classic gameplay meets innovative updates. Whether you're a solo adventurer or part of a formidable clan, Lineage2.Network offers a dynamic and balanced environment for all.  
    • Good day. Our game currency store is looking for suppliers of adena and items on a project such as L2REBORN x10. We also sell Epic jewelry and various items on this project L2REBORN x10. There are items and adena on L2REBORN x1. For all questions, write to us in discord - goddardshop
  • Topics

×
×
  • Create New...