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

    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...