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

    • ## [1.5.1] - 2026-01-30   ### 🐛 Bug Fixes - **Top Voters**: Top voters list now loads correctly for inactive servers (previously showed "Server not found"). - **View Counter**: Server info page view count now records correctly for inactive servers.   ### 🔄 Improvements - **My Servers – Hide/Active**: The hide/active toggle now works correctly and is only shown when the server is approved (active) by an admin. Owner hide/show is separate from admin status. Toggling no longer causes a full page refresh. - **Accessibility**: Form fields across the site now have proper labels and IDs for screen readers and autofill — server info edit form, add server form, My Servers edit, Admin Panel (Email, Vote System, pricing, filters, logs), and related inputs.
    • LIVE VERIFICATION? SUMSUB? “IMPOSSIBLE”? ▪ Spoiler: it is possible — if you know who to work with. A client came in with a task to pass **live verification** on **WantToPay**, a Telegram virtual card service. On the platform side — **Sumsub**: liveness check, SMS, manual review. “Fast” and “by eye” simply don’t work here. › What was done: → analyzed the verification scenario and Sumsub requirements → built the correct flow: phone number, email, timing → **completed live verification remotely, without account handover** → handled SMS and confirmation codes → brought the process to final approval ▪ Result: → verification passed → access granted → no flags or repeat requests ▪ Live verification is not luck. It’s scenario-based preparation — not hope. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +6RAKokIn5ItmYjEx ) *All data is published with the client’s consent.* #verification #sumsub #livecheck #kyc #case
    • IMPORTANT INFO: In a few days, I will switch to completely new code, written from scratch with a new download system, patch building and management system. The Updater will become true 2026 code with "foolproof systems". I'm going to create a Discord server for customers to request new ideas and features. FIRST CUSTOMERS ARE ALREADY USING THE NEW UPDATER ON LIVE SERVERS! Watch this topic for upcoming info because the new updater is around the corner! Yes, you can still use self-update on the previous updater! No, the new updater won't be compatible with the old patch system! A new build is required, but players who already have game files won't have to download the entire patch again! New templates and updates to existing templates are coming soon! Sneak peek:  
  • 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..