Jump to content
  • 0

Nobless Status After Killing Barakiel For All Party Members


Question

Posted (edited)

Hi all, I added this code to my project and even if player is lvl 1 and without sub he is getting nobless status. Could anyone help me? I want to give nobless status only for players who have active subclass and is level 75+ and send a message to let them know if they are under lvl 75 and dont have sub. Any help is welcome.

 

Edit: this code is inside l2raidbossinstance

if (player.isInParty())
				{
					if (getNpcId() == 25325) // barakielId = 25325;
											{
												
											for(L2PcInstance newNoble : player.getParty().getPartyMembers())
											{
												if (!player.isSubClassActive() || player.getLevel() >= 75 || player.isNoble())																									
												 {
													 newNoble.setNoble(true, true);
													 newNoble.sendMessage("You Are Now a Noble, You Are Granted With Noblesse Status, And Noblesse Skills.");
													 
													 
														
													 	                } 
													 					}
											}
																		
					else 
					{
						if (!player.isSubClassActive() || player.getLevel() < 75);
						player.sendMessage("You don't have subclass level 75 or you are already nobless");	
					}
Edited by ton3

Recommended Posts

  • 0
Posted

Sorry sdw and sweets, no offense but i made it , so you dont need script or it isnt a fault of the loop, your code obviously hadnt the logic as you guys said.

 

 

 

int _barakielId = 25325;
if (getNpcId() == _barakielId  && player.getParty() != null) //check for party 
{
for (final L2PcInstance member : player.getParty().getPartyMembers())
{
if (member.isSubClassActive() && member.getLevel() >= 75 && !member.isNoble()) //replaced player with the new method 
  {
   member.setNoble(true);
member.broadcastPacket(new SocialAction( player.getObjectId(), 15));
member.sendMessage("You have received nobless status by killing Barakiel!");
  }
else 
if (!member.isSubClassActive() && member.getLevel() <= 75) //the message will appear to ppl that arent subclassed and also they are low leveled, only 
   {
member.sendMessage("You don't meet the required criteria. Your level is too low, you aren't on an active subclass."); 
}
}
}
  • 0
Posted (edited)

Theres no sub check , you gotta make a boolean for sub check registering it on pcinstance and then add the check , also you can make a restriction at least for level 

 

if(player.getLevel>=76 

 

also i guess if (!player.isSubClassActive() it should be if(player.isSubClassActive if this works at least  

Edited by Kelrzher
  • 0
Posted

It's because your for loop internal checks should aim "newNoble", not "player". You currently only check a single player, probably the one who requested the ask.

if (!player.isSubClassActive() || player.getLevel() >= 75 || player.isNoble())

-> player != newNoble

  • 0
Posted (edited)
if (getNpcId() == _barakielId && !player.isNoble())
{
for(L2PcInstance newNoble : player.getParty().getPartyMembers())
{
   if (player != newNoble || player.isSubClassActive() || player.getLevel() >= 75()) 
   {
   player.setNoble(true);
player.broadcastPacket(new SocialAction( player.getObjectId(), 15));
player.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
}     
}
}
else 
{
if (!player.isSubClassActive() || player.getLevel() < 75);
player.sendMessage("You don't have subclass level 75 or you are already nobless"); 
}

correct me if i am wrong 

Edited by Kelrzher
  • 0
Posted
if (getNpcId() == _barakielId && !player.isNoble())
{
for(L2PcInstance newNoble : player.getParty().getPartyMembers())
{
   if (player != newNoble || player.isSubClassActive() || player.getLevel() >= 75()) 
   {
   player.setNoble(true);
player.broadcastPacket(new SocialAction( player.getObjectId(), 15));
player.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
}     
}
}
else 
{
if (!player.isSubClassActive() || player.getLevel() < 75);
player.sendMessage("You don't have subclass level 75 or you are already nobless"); 
}

correct me if i am wrong 

 

 

this one worked but didnt send any message to player who was lvl 1 =(

  • 0
Posted

if (!player.isSubClassActive() && player.getLevel() < 75);
player.sendMessage("You don't have subclass level 75 or you are already nobless");

  • 0
Posted (edited)

It's plain wrong, the WHOLE code and it's logic. Still, your for loop doesn't consider party members. You create for loop for party members and you still focus on the player, in short, your actual for loop is useless, has no use.

 

Here you go the proper code.. Change the msg

       if (getNpcId() == _barakielId)
        {
            for (L2PcInstance newNoble : player.getParty().getPartyMembers())
            {
                if ((newNoble.isSubClassActive() || player.getLevel() >= 75) && !newNoble.isNoble())
                {
                    newNoble.setNoble(true, true);
                    newNoble.broadcastPacket(new SocialAction(player.getObjectId(), 15));
                    newNoble.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
                }
                else
                    newNoble.sendMessage("What a shame. You don't meet the required criteria (subclass is not active or lvl is not greater or equal 75 or you are simply already a noble.)");
            }
        }
Edited by SweeTs
  • 0
Posted (edited)

thanks sweets  :D i am in the first year doing the steps right now :D

if (getNpcId() == _barakielId)
        {
            for (L2PcInstance newNoble : player.getParty().getPartyMembers())
            {
                if ((newNoble.isSubClassActive() || player.getLevel() >= 75) && !newNoble.isNoble())
                {
-                   newNoble.setNoble(true, true);
+                  newNoble.setNoble(true);
                    newNoble.broadcastPacket(new SocialAction(player.getObjectId(), 15));
                    newNoble.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
                }
                else
                    newNoble.sendMessage("What a shame. You don't meet the required criteria (subclass is not active or lvl is not greater or equal 75 or you are simply already a noble.)");
            }
        }

 

and a small correction

Edited by Kelrzher
  • 0
Posted

 

It's plain wrong, the WHOLE code and it's logic. Still, your for loop doesn't consider party members. You create for loop for party members and you still focus on the player, in short, your actual for loop is useless, has no use.

 

Here you go the proper code.. Change the msg

       if (getNpcId() == _barakielId)
        {
            for (L2PcInstance newNoble : player.getParty().getPartyMembers())
            {
                if ((newNoble.isSubClassActive() || player.getLevel() >= 75) && !newNoble.isNoble())
                {
                    newNoble.setNoble(true, true);
                    newNoble.broadcastPacket(new SocialAction(player.getObjectId(), 15));
                    newNoble.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
                }
                else
                    newNoble.sendMessage("What a shame. You don't meet the required criteria (subclass is not active or lvl is not greater or equal 75 or you are simply already a noble.)");
            }
        }

 

ur code gave nobless to level 1 char =(

  • 0
Posted

Bcs you have subclass active? Or in short, you are not replacing the file / not restarting the server.. Ppl always claims that my code doesn't work while I have proofs it is working, anyway :D

  • 0
Posted

Don't put that there, make something in the quest right away or a new scripts or whatever.

  • 0
Posted (edited)

You dont need a party check, this will work

int _barakielId = 25325;
if (getNpcId() == _barakielId && !player.isNoble())
{
  if (player.isSubClassActive() || player.getLevel() >= 75) 
  {
player.setNoble(true);
player.broadcastPacket(new SocialAction( player.getObjectId(), 15));
player.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
  }
else 
if (!player.isSubClassActive() || player.getLevel() <= 75)
   {
player.sendMessage("You don't have subclass level 75 or you are already nobless"); 
}
}
Edited by Kelrzher
  • 0
Posted

 

You dont need a party check, this will work

int _barakielId = 25325;
if (getNpcId() == _barakielId && !player.isNoble())
{
  if (player.isSubClassActive() || player.getLevel() >= 75) 
  {
player.setNoble(true);
player.broadcastPacket(new SocialAction( player.getObjectId(), 15));
player.sendMessage("You have received nobless status by killing Raid Boss Barakiel!");
  }
else 
if (!player.isSubClassActive() || player.getLevel() <= 75)
   {
player.sendMessage("You don't have subclass level 75 or you are already nobless"); 
}
}

but this will give only to one player right? what if they make party with 9 players and only 1 of them last hit barakiel?

Guest
This topic is now closed to further replies.


  • Posts

    • Hi everyone, A while ago, I needed to extract some L2 textures and found that acmi's L2Tool was a good way to do it. There might be other methods out there but I'm not aware of them, so I decided to fork this project and improve it to suit my needs. I built this using BellSoft Liberica JDK 17. Since modern Java versions no longer include JavaFX by default, I've made the app handle it automatically. You don't need any manual setup—just use the  run.bat  and it will automatically extract the required JavaFX modules on the first run. Key features of this fork: UI Overhaul: I've tweaked the interface to give it a cleaner look with Dark Mode and more detailed metadata for each texture. Export Formats: You can now extract textures in WEBP, PNG, and DDS. Individual or Batch Export: Flexible options to export a single selected texture or the entire package at once.     I'm leaving the link here in case it's useful to anyone!   Installation and Execution:     Clone the repository:   https://github.com/Ak4n1/l2tool cd l2tool          2.Build the project:   ./gradlew build              3. Run the application:         ./run.bat      Or simply double-click on run.bat.    
    • Wtb full account or items on l2 warland 
    • https://discord.gg/k53SZ4DM5z   Interlude Client L2Old Pride is a L2 Pride Interlude Based All functional skills (Not archer/mage server)   L2Old Pride Helper (Works like Woundrous Cubic) https://imgur.com/iYqmHQY Farm Zones: Cave of Trials and Elven Ruins (Chaotic) Olympiads: Every 15 days Various Cosmetic Items https://imgur.com/uoeU6Jw https://imgur.com/oCS2Zed PvP Zone: Gludin Village (No-Parties, Disguised) More than 100 new Skills https://imgur.com/6RaPsQV Max Level: 90 https://imgur.com/z4QVJKZ Gaining Xp by PVP https://imgur.com/LRqI31T Purchasable S-grade items +10 or +20 with random chance to enchant +5 Purchasable Custom Items Depends on Tier Mysterious Merchants https://imgur.com/2ZwWyPH Auto Enchant Via PvPing (with low chance) Custom Raid Bosses Siege Every Weekend (Aden, Rune, Giran) Autofarm / Drop Tracker https://imgur.com/Vz3rha6   RATES: • Start Level 80 • Max level 90  • EXP: 5000x • SP: 5000x • ADENA 6000x   ENCHANT: • Maximum enchant S Grade Items: +35. • Maximum enchant Unique/Epic Items: +25. • Maximum enchant Legendary Items: +18. • Maximum enchant Relic Items: +14. •Descriptions for rate at scrolls!   EVENTS: • TEAMS vs TEAMS • CAPTURE THE FLAG • DOMINATION • DEATH MATCH • DICE OF DEATH • CHAOTIC ZONE   OTHERS: Assistance system in pvps. Where support classes are enabled to receive pvp with a low chance, for supporting a party member during pvp. •  /sit to regen HP/MP/CP • Custom Shots Glows https://imgur.com/FLK0DmR • Achievements System • Daily Tasks System • Monthly Tasks System   CUSTOM ARMORS SETS Dread Armor/Titanium Armor Pride Armor Rykros Armor https://imgur.com/SPxoQp1   CUSTOM WEAPONS SETS Unique Weapons Pride Weapons Legendary Weapons Relic Weapons https://imgur.com/kOHNXhS   CUSTOM ACCESSORIES Standard Superior Legendary https://imgur.com/zPqNiiX   CUSTOM JEWELS/TATTOO Legendary Nightmarish https://imgur.com/gcqS28P There are many more features that you will only understand by playing and following. Beta testing server is currently open. Follow us on our discord and join our server to test it.
    • You shouldn't use rev 382, not sure why everyone keep using that.   I don't make changesets for fun, I don't make new revisions for nothing.   Follow the revisions.
  • 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