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 (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

    • Vouch for @Ave i can say im very statisfied with the order I've made he was fast and reliable i totally recommend him to anyone who wants a decent updater with high quality design.
    • What can I say other than that I’m satisfied with the order I made. The guy is reliable and very good at what he does. I recommend him 100%.
    • Lineage2 Freya High Five @ Reshade with fog and rain etc @ Gracia final epilogue atmosphere   this reshade will eat lots of GPU power 50% or more of an RTX 3060 so be carefull depending on what effects are activated and their settings will eat even more GPU recomended 60hz monitor settings and via nvidia panel in Lineage2 game profile vsync settings to on effects are set up till film deck and the rest are not used but still working again this can eat alot of GPU Don't overheat GPU this is for freya high five but might work on others too copy in the  System  folder the folder  reshade-shaders  and the files  d3d9.dll  ReShade.ini  ReShadePreset.ini  ReShade.log  CccDddCcc.ini insert opens the menu and delete is on and of some settings need  ctrl + left click  to be changed   making another profile will reset the not activated effects to their default values so just copy the profile  CccDddCcc  and rename if needed also something needs to be closed from settings in game menu, the blur at distance and advanced shaders but keeping the advanced water effects all reflections   for those that don't like the h5 look of the sky and the red fog and rain and ambien red at night on all maps well if we want the cool gracia final epilogue back then we need to do this rename the  Maps  folder to Mapsretail or whatever copy the  Maps  folder from gracia final epilogue to h5 also we need the  L2_Skies.utx  from gracia final epilogue  Textures  folder to be replaced and also we need to do the same to the files  timeenv0.int  timeenv1.int  timeenv2.int  timeenv3.int  found in  system  folder   another setting that will probably be needed but not really tested out is to open file  option.ini  from  system  folder and add cachesize like this   [FirstRun] FirstRun=2   [Engine.GameEngine] CacheSizeMegs=512   also maybe is good to change those to 4.000000   [ClippingRange] Terrain=4.000000 Actor=4.000000 StaticMesh=4.000000 StaticMeshLod=4.000000 Pawn=4.000000       sorry bad english   https://mega.nz/file/aRNXxDrQ#mbxrNERBtW0XEEezK6w8-86oZWuX1k6NgtR6RZWKRVM   the compression on the video is kinda bad but meh    
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..