Jump to content

Recommended Posts

Posted (edited)

findAny() can't be used as a counterpart of Rnd. It only means it doesn't guarantee any order based on your Stream. You can - or can't - retrieve exactly the same order. But most likely, it will produce exactly the same content. Meaning you will never see some of your maps.

 

In a non-parallel operation, it will most likely return the first element in the Stream but there is no guarantee for this.

You have to Rnd.get(list).

Edited by Tryskell
Posted
34 minutes ago, SweeTs said:

Yep, just did some tests and it's returning first element. Yet, it can do the trick, BUT first you have to use shuffle.

 

Less costy to pick a random element than to shuffle a whole container. And your point is to pick a single element, not the whole list, so shuffling the whole list is pointless.

 

:goodsir:

Posted
2 hours ago, Kara` said:

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

 

 

did you just imply that you wrote this code right out of your mind in a simple text editor?

 

What kind of psychotic autistic lair attention whore bitch can someone be, really 

Posted (edited)

for randomness I would go with a jackpot-like random generator pool, feel free to use my code

 

https://pastebin.com/SZq07PZy

 

your jackpot weight should be an inversion of current zone hits

Edited by xdem
  • 2 months later...
Posted (edited)

Hello MXC members, maybe anyone try this zone changer? I try but I can't change zones from ZoneManager.xml 

If I change loc's not move me to other zone or maybe only can use arena type? anyone know how to fix?

Also only Cuboid can use? Because i try make NPoly and get error to console. Help to me pls.

Edited by Gezis
Posted
5 hours ago, Gezis said:

...

Code is working fine and with zone type RandomZone not with Arena
Also ofc you can use NPoly, the diff is coded on aCis 377 if you have older version or newest you have to adapt parts of code.

Posted (edited)
50 minutes ago, Gezis said:

Yes code working to me, but I say about random zone with other locs :) maybe my fault with xml idk. But I chancge only from "CuboId" to "NPoly" 


Cuboid required : 2 node locations.
NPoly required : 3+ node locations.

//Edit
Here is one good tutorial from @SweeTs Tutorial Link

Edited by StinkyMadness
Posted

Yes my bad, working with NPoly, but not move to next zone, with default zones (Arena) move.

My zones:

<?xml version="1.0" encoding="UTF-8"?>
<list>
	<!-- Random Zones -->
	<zone type="RandomZone" shape="NPoly" minZ="9080" maxZ="11080"><!-- gludin_pvp -->
		<stat name="id" val="1"/>
		<stat name="name" val="Gludin Arena"/>
		<stat name="time" val="120"/><!-- time in seconds -->
		<stat name="locs" val="114264,16280,10080;115009,15114,10080"/>
	        <node X="115736" Y="16152" />
	        <node X="116056" Y="16872" />
	        <node X="114856" Y="17768" />
	        <node X="114083" Y="17376" />
	        <node X="113140" Y="14874" />
	        <node X="114264" Y="15650" />
		<spawn X="114264" Y="16280" Z="10080" />
	</zone>
		<zone type="RandomZone" shape="NPoly" minZ="9080" maxZ="11080"><!-- gludin_pvp -->
		<stat name="id" val="2"/>
		<stat name="name" val="Arena"/>
		<stat name="time" val="120"/><!-- time in seconds -->
		<stat name="locs" val="114264,16280,10080;115009,15114,10080"/>
	        <node X="115736" Y="16152" />
	        <node X="116056" Y="16872" />
	        <node X="114856" Y="17768" />
	        <node X="114083" Y="17376" />
	        <node X="113140" Y="14874" />
	        <node X="114264" Y="15650" />
		<spawn X="114264" Y="16280" Z="10080" />
	</zone>
</list>

 

Posted (edited)
43 minutes ago, Gezis said:

....


Nice zone... its around the TOP of the Sky take a look on you minZ maxZ.... also aCis have //check_zone if there not appear "random zone" then your nodes are wrong... but on current XML the minZ maxZ looks TOTAL to much... If you are not inside zone how you will be teleport ?

Edited by StinkyMadness

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

    • ➡ 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 
    • I talk with him everyday how is that possible? xD
    • Okay, I understand. First, to get started by contributing to open projects and learning along the way. Then, when you mention starting my own project privately, do you mean taking a free datapack like L2jMobius and trying to make it functional for an online server? Great, thank you very much — all this information is really helpful. I’ve been reaching out to several server admins here in Argentina, but it seems like none of them have the time or interest to take on an intern or assistant. xd   P.S.: Are you the creator of Hopzone? Brings back memories of when I was a kid, downloading servers at the cyber café. For two dollars, I could spend the whole day playing and eating candy like crazy.   Another question: between L2jMobius, L2jServer, and aCis, which one has ALL of its code free? As you probably noticed, I'm using ChatGPT to help me translate things, lol, and it suggested the following: Project Status Open Source Accepts Juniors? Difficulty L2JMobius Very active Semi-closed Partially (with patches) Medium-High L2JServer Active Fully open Yes (directly on GitHub) Medium aCis Semi-active Unofficial Not very clear Low
    • @Logan22 Are you logan from mmo-dev forum?
  • Topics

×
×
  • Create New...