Jump to content

Question

Posted

Hi all, i have just a question. It is possible to restrict all items (armor,weapons,etc etc) and leave just 1 type or armor to access in zone? I mean for VoiceCommand teleport?

 

Recommended Posts

  • 0
Posted (edited)
3 minutes ago, InFocus said:

i didnt give you this line...

 

check again

return Arrays.asList(getInventory().getItems()).stream().filter(i -> i.isEquipped() && i.getItem().getCrystalType() == type).findAny().isPresent();

 

Edited by melron
  • 0
Posted
3 minutes ago, melron said:

What about a small refactored code?

 

https://imgur.com/a/WlU1ThX

 

@InFocus

use this

 

 

The millisecond is because of the printLn. If you remove printLn you will see that there is no difference. And even if there is a 30 millisecond difference do you know what 30 millisecond mean?  It's the 0.03 of a second. Your neurotransmitters pass a signal though in 0.6 millisecond. The code is execute faster than this. 

 

  • 0
Posted
1 minute ago, Kara` said:

 

The millisecond is because of the printLn. If you remove printLn you will see that there is no difference. And even if there is a 30 millisecond difference do you know what 30 millisecond mean?  It's the 0.03 of a second. Your neurotransmitters pass a signal though in 0.6 millisecond. The code is execute faster than this. 

 

thats why i didnt even touch the code because the difference for what he needs is absolutely 0. but lets get real, the correct syntax is not the one you posted

  • 0
Posted
1 minute ago, melron said:

thats why i didnt even touch the code because the difference for what he needs is absolutely 0. but lets get real, the correct syntax is not the one you posted

 

It's corrent no matter what. If you dig so far then the syntax of java as a language is not correct and we should wait for jdk 12 update. Now if you want dig so far for 30 millisecond go ahead i dont care Melronious Melroni.

  • 0
Posted
2 minutes ago, Kara` said:

 

It's corrent no matter what. If you dig so far then the syntax of java as a language is not correct and we should wait for jdk 12 update. Now if you want dig so far for 30 millisecond go ahead i dont care Melronious Melroni.

Did you change your try() style or... ?

  • 0
Posted
Just now, melron said:

Did you change your try() style or... ?

 

Depends if i wake up, drink my tea, sit on PC, open maxcheaters and the first thing i see is a post of yours then nop. 

But most of the times. I had even difficult time moving from normal for to lambda even tho lambda is slower for 1 millisecond :'(

 

  • 0
Posted
else if (activeChar.hasGradeEquipped(CrystalType.S))
			{
				activeChar.sendMessage("You don't have equiped with S grade");
				return false;
			}
+

public boolean hasGradeEquipped(CrystalType s)
	{
		return Arrays.asList(getInventory().getItems()).stream().filter(i -> i.isEquipped() && (i.getItem().getCrystalType() == s)).findAny().isPresent();
	}

I no have any items S in inventory and i can teleport. Why?

  • 0
Posted (edited)
1 minute ago, InFocus said:

What's wrong :))))))))))))))) except my english

The only wrong here, is your english mate...

 

the code is working like this:

 

if the player have ATLEAST 1 item S grade equiped he CANT teleport

 

What you mean you havent items in your inventory?

Edited by melron
  • 0
Posted

Melron , Melron :) I want to say IF player have the LAST item S grade in inventory CAN teleport in that zone!!!

With 0 items s grade, i want player can't enter ! :) 

  • 0
Posted (edited)

For exemple, if player have full Draconic armor (Doesn't metter if it's light or heavy)  and no have weapon (S grade:) ) he can not enter

Edited by InFocus
Guest
This topic is now closed to further replies.



  • Posts

    • L2 PVPTOP - HTML DESIGN    
    • Do not trust this guy, he will scam you. I have sent proof to the mods, I have posted proof on another thread and I can send proof to anyone who DMs me. Avoid this guy. So not only did he scam me out of $51 USDTthen delete his messages and blocked me (I have proof) . You can see his Facebook group is constantly changing names depending on his most current scam. If you see this message and you still decide to go forward with sending your money to him, that’s on you. I can’t stress this enough. This guy is a scammer. 
    • So Goldbar thinks that deleted his side of the conversation makes it easier to claim he didn’t scam me. But I sent him $51 USDT to his ERC-20 account it was verified, he acted like it was fine but then deleted his messages and blocked me. Seriously do not trust this guy. 
    • Hi everyone, let me introduce myself—I'm Martin, a junior developer. I'm diving into the world of L2 servers, and honestly, I'm super overwhelmed about where to start learning the right way to set up, configure, and run a server. There are so many datapacks—free, private—but it's so much that my head feels like it's going to explode. I'm currently looking for someone or an active project willing to take me on as an intern. I'm not looking to make money—I'm just here to learn and grow out of pure passion for L2. I've already been working with L2jMobius H5. I managed to edit the Community Board, add a buffer, GM Shop, and teleports. I've also created custom NPCs for the GM Shop, and imported new custom weapons and armors—complete with original glow effects, like the Valakas and Antharas weapons. But there's still a lot I don't know, and it can get overwhelming. That’s why I’m looking for someone—or an active non-profit project—willing to take me on as an intern. I’m not looking to make money; I just want to learn, contribute, and grow out of pure passion for L2. If you’re working on a project and could use a motivated learner who’s eager to help, I’d love to connect!
    • Our next easy-botting project, Kain, is right around the corner! Launching tomorrow, Saturday, April 26th at 9:00 ET (UTC -4)! If you haven’t, check out the features and join our Discord to catch up on the latest drama. See you very soon! Read more about L2Toggle and Kain on our site and forum!  
  • Topics

×
×
  • Create New...