Jump to content
  • 0

With Check If Player Already Have Clan Skills.


Question

Posted

Hello Maxcheaters I'm using this code on my Service Npc and it is working just fine but I have one problem, it have no check for skills, so if you keep clicking on it it will keep taking the coins from you and telling you no skills added. I need it to check if the clan already have the skills and if yes return a html saying that the clan have the skills alredy.

 

Can anyone help?

 

Btw I'm using a L2j H5 server>

 

Thank you.

else if (event.startsWith("clanSkills"))
		{
			final L2Clan clan = player.getClan();
			if (clan == null)
			{
				player.sendPacket(SystemMessageId.TARGET_MUST_BE_IN_CLAN);
				return "ClanSkills-NoClan.htm";
			}
			
			if (!player.isClanLeader())
			{
				final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.TARGET_MUST_BE_IN_CLAN);
				sm.addPcName(player);
				player.sendPacket(sm);
				return "ClanSkills-NoLeader.htm";
			}
			if (st.getQuestItemsCount(ClanSkillsItemId) >= ClanSkillsItemCount)
			{
				final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailablePledgeSkills(clan);
				SkillTable st1 = SkillTable.getInstance();
				for (L2SkillLearn s : skills)
				{
					clan.addNewSkill(st1.getInfo(s.getSkillId(), s.getSkillLevel()));
				}
				st.takeItems(ClanSkillsItemId, ClanSkillsItemCount);
				// Notify target and active char
				clan.broadcastToOnlineMembers(new PledgeSkillList(clan));
				for (L2PcInstance member : clan.getOnlineMembers(0))
				{
					member.sendSkillList();
				}
				
				player.sendMessage("You gave " + skills.size() + " skills to " + player.getName() + "'s clan " + clan.getName() + ".");
				player.sendMessage("Your clan received " + skills.size() + " skills.");
				return "ClanSkills-Success.htm";
			}
			return "ClanSkills-NoItems.htm";
		}
		return htmlText;
	}

4 answers to this question

Recommended Posts

  • 0
Posted

If skills returns 0 once you already awarded, then like Versus says :

final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailablePledgeSkills(clan);
if (skills.isEmpty())
    return "ClanSkills-AlreadyDone.htm";

PS : this got no use to be setted.

SkillTable st1 = SkillTable.getInstance();
  • 0
Posted (edited)

 

 

if (skills.isEmpty())

return "FILE.htm";

 

 

 

 

If skills returns 0 once you already awarded, then like Versus says :

final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailablePledgeSkills(clan);

if (skills.isEmpty())

    return "ClanSkills-AlreadyDone.htm";

PS : this got no use to be setted.

SkillTable st1 = SkillTable.getInstance();

 

 

Thank you guys I got it now.

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


  • Posts

    • L2Elixir – Patch 4 Is Live!   We’re working non-stop, day and night, to deliver the best possible quality and bring back what made L2Elixir special. This project is built with passion, not shortcuts — for the old-school players who remember, and the new ones who want to experience it properly. Thank you for being part of the journey. Together, we’re making L2Elixir great again ❤️ The legends never fade.    ⚙️ General Enabled Class Change service (same class type only) ALT + B → Services → Character Development Enabled Shift + Click on Treasure Chests Players can now identify real chests (Adena, scroll drops) and use Key / Unlock Event deaths now cancel only debuffs, All self buffs are preserved, fixes issues with Root and similar effects Bladedancer class can now log in even when Max Clients (2) is reached. Since an active Bladedancer is not available for every damage dealer and some players tried to abuse this via VPN or a second PC, this feature was added to keep things fair. protections applies, requires testing!    🎒 Items Crystallizing enchanted items now gives the correct increased crystal amount (retail-like behavior) Removed Agathion Seal Bracelet: Rudolph from Santa rewards (Gracia Final item) Added Dualsword Craft Stamp into Milestone Exchange list    🧙 Skills Fixed Banish Undead lethal chance Hot Springs Malaria and similar effects now level up faster while being attacked
    • thats new SEO level tricks you know nothing of noob - bottom line: exposed.
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away!   @Atom @Celestine
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away! @Celestine @Atom
  • 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