Jump to content
  • 0

[Help]Restrict Castle Cloaks to be used only by castle owners


Question

Posted

As the title says, on my server I have the custom cloaks (Aden Cloak, Dion Cloak, etc...) and I want only the members that own that castle to equip them. And if they loose the castle, they loose the cloak.

Kinda like the "The Lord's Crown".

I have been editing some java code inside the chamberlain configuration but it hasn't worked.

Here is the code i came up with:

 

else if (actualCommand.equals("give_cloak"))

{

if (siegeBlocksFunction(player))

return;

 

NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());

 

if (player.isClanLeader() && _castleId==5) <-I made that custom, so that the castle was Aden

{

if (player.getInventory().getItemByItemId(64000) == null)<-Aden Cloak ID

{

L2ItemInstance crown = player.getInventory().addItem("Aden Cloak", 64000, 1, player, this);

SystemMessage ms = new SystemMessage(SystemMessageId.EARNED_ITEM);

ms.addItemName(crown);

player.sendPacket(ms);

 

html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-gavecrown.htm");

html.replace("%CharName%", String.valueOf(player.getName()));

html.replace("%FeudName%", String.valueOf(getCastle().getName()));

}

else

html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-hascrown.htm");

}

else

html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-noprivs.htm");

 

player.sendPacket(html);

return;

}

 

 

 

Ofcourse after that i edited the chamberlain html and added this line:

<a action="bypass -h npc_%objectId%_give_cloak">Aden Cloak</a><br>

7 answers to this question

Recommended Posts

  • 0
Posted

i wont code it for you, but ima give you some tips.

 

In l2j every npc can get the current castle his in("this.getCastle()" - the chamberline in this instance or w/e the name), so you gotta do a simple switch case with castles then you can use your method to give the lord the cloak. And for the losing part, check CrownManager, you'll see there the methods when the crown gets destroyed.

 

The npc instance should look like this:


 int cloakId = 0;
 switch(this.getCastle().getCastleId())
 {
    case 1: cloakId = 12345; break;
    case 2: cloakId = 12345; break;
    case 3: cloakId = 12345; break;
    case 4: cloakId = 12345; break;
    case 5: cloakId = 12345; break;
    case 6: cloakId = 12345; break;
    case 7: cloakId = 12345; break;
    case 8: cloakId = 12345; break;
    case 9: cloakId = 12345; break;
 }

 if(cloakId > 0)
 {
    // Do stuff
 }

 

hope it helped, cheers

  • 0
Posted

Well, i custom coded it, i got it to work to GIVE the cloaks per castle, but now i want to know how to implement item restriction, like giran cloak can only be used by people that own the giran castle.

mmm, i have to do smth similar to that too for one of my projects, tho im new to gracia and up, ill have your answer after i dig up more info today :P

 

Later edit: My lil research leaded me to this, the cloaks being equipped and so on is handled client side, so in order to get them working to your method is to crack the system folder, requires client mod. (Witch i kinda lack info)

 

But i think i came up with a cheat, you can lie to the client about wearing a cloak xD

You can do it like so:

      - Set a new item with is the cloak item as 'back' bodypart

      - Edit the userinfo packet and charinfo packet to broadcast the user using a cloak.

  • 0
Posted

Well, you guys both wrong:P

After a couple of hours of searching and some help from my friends at L2J, i figured it out. Its not client side, its not core side. Its server side. All inside the xml. Must add a new condition like this:

 

<cond msgId="1518">

<and>

<player castle="5" /> <-Castle id

<player pledgeClass="2" /> <- Player rank. In this case: Heir(clan members).

</and>

</cond>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • MoMoProxy has updated more static residential proxies for USA location, anyone interested in can view: https://momoproxy.com/static-residential-proxies
    • This post originally appeared on MmoGah.   Dear Exiles, here's a detailed guide for Path of Exile 3.26 Gauntlet, tailored for beginners and focused on the top 5 builds that balance survivability, damage, and ease of gearing in the Hardcore Solo Self-Found (HCSSF) environment. This guide goes deep into mechanics, gear, leveling, and strategy—no fluff, just actionable insights.       What Is the Gauntlet in PoE 3.26? The Gauntlet is a community-run event, often organized by Zizaran, which pushes players into a brutal version of the game:   ● Hardcore Solo Self-Found (HCSSF): No trading, no partying, no outside help. ● Global Modifiers: Increased monster damage, life, elemental penetration, extra projectiles, and more. ● Limited Portals: Only 3 portals per boss kill count toward points. ● Custom Ascendancies: In 3.26, the Fishia League introduces new ascendancy classes like Ancestral Commander and Servant of Arakali.   The goal? Survive, level up, kill bosses, and earn points for prizes. But first, you need a build that won't crumble under pressure.   Top 5 Builds for Gauntlet Beginners These builds are chosen for their tankiness, simplicity, and ability to progress through the campaign and early maps with minimal gear.   1. Raise Zombie Puppeteer (Necromancer) Why It Works: Minions absorb damage, keeping you safe. Scales well with minimal gear. Strong bossing potential with high zombie levels.   Core Mechanics: Uses Raise Zombie as the main damage source. Strength stacking boosts zombie power. Animate Guardian adds utility and buffs.   Defensive Layers: Minions tank hits. Block chance from gear and passive tree. Energy shield and life stacking.   Leveling Tips: Use Summon Skeletons and Raise Zombie early. Prioritize +minion gem levels and strength gear. Transition to spectres and Animate Guardian by Act 5.   Pros: Safe, ranged playstyle. Easy to gear in SSF. Strong boss damage.   Cons: Minion AI can be clunky. Damage may taper off in the late game without investment.   2. Power Siphon Mines (Scavenger Saboteur) Why It Works: Ranged mine playstyle avoids direct damage. One-button mechanics for comfort. Fast leveling and strong suppression.   Core Mechanics: Power Siphon linked to mines for remote detonation. Uses High-Impact Mine Support and Minefield Support. Cloak of Flames for early damage scaling.   Defensive Layers: High evasion and suppression. Life stacking and stun immunity. Arctic Armor and Flesh and Stone for mitigation.   Leveling Tips: Start with Stormblast Mine or Explosive Trap. Switch to Power Siphon at level 28. Use Smoke Mine and Flame Dash for mobility.   Pros: Safe ranged playstyle. Low gear dependency. Comfortable mechanics.   Cons: Mines require setup. It can feel clunky without proper gem links.   3. Ice Nova Archmage (Hierophant) Why It Works: Combines Mind Over Matter (MoM) with mana stacking. Strong AoE and single-target damage. Good defenses and smooth leveling.   Core Mechanics: Ice Nova cast on Frostbolt for double damage. Archmage Support scales damage with mana. Hierophant ascendancy boosts mana and endurance charges.   Defensive Layers: MoM absorbs damage via mana. High armor and resistances. Chill and freeze for crowd control.   Leveling Tips: Start with Holy Flame Totem or Rolling Magma. Switch to Ice Nova after Act 3. Stack mana and use Clarity early.   Pros: Strong defenses and damage. Scales well into the endgame. Beginner-friendly caster setup.   Cons: Requires mana management. Squishy if not geared properly.   4. Explosive Arrow Ballista (Ancestral Commander) Why It Works: Totems do the work while you stay safe. Easy to gear and scale. Great for campaign progression.   Core Mechanics: Explosive Arrow linked to Ballista Totem Support. Totems stack arrows for massive explosions. Ancestral Commander ascendancy grants endurance charges and slam synergy.   Defensive Layers: Totems absorb aggro. High life and resistances. Fortify from gear or ascendancy.   Leveling Tips: Use Caustic Arrow or Split Arrow early. Switch to Explosive Arrow at level 28. Prioritize attack speed and totem placement.   Pros: Safe, passive playstyle. Strong single-target damage. Easy to respec and adapt.   Cons: Totem AI can be slow. Requires positioning for optimal damage.   5. Lightning Strike Daughter of Oshabi Why It Works: High energy shield and shrine buffs. Converts physical damage to chaos. Fast, clear, and strong bossing.   Core Mechanics: Lightning Strike with pure energy shield gear. Oath of the Magi node doubles armor defenses. Ghost Dance for ES sustain.   Defensive Layers: 10,000+ energy shield. Suppression and resist caps. Stun immunity and chaos conversion.   Leveling Tips: Use Smite or Molten Strike early. Transition to Lightning Strike with ES gear. Stack shrine buffs and movement speed.   Pros: Tanky and fast. Handles tier 17 maps. Good for face-tanking bosses.   Cons: Requires ES gear early. Shrine RNG can affect consistency.   Beginner Tips for Gauntlet Success Campaign Strategy: Overlevel before boss fights. Cap resistances ASAP. Use movement skills to dodge mechanics. Practice Acts 1, 4, and 9—they're deadly.   Gear Prioritization: Life and resistances > damage. Movement speed on boots. Vendor recipes for gear upgrades.   Flask Setup: 1 Instant Life Flask 1 Granite Flask 1 Jade Flask 1 Quicksilver Flask 1 Utility Flask (e.g., Sulphur or Basalt)   Passive Tree Tips: Prioritize life nodes early. Take suppression and block nodes. Avoid complex mechanics—simplicity wins.   Mapping and Bossing Strategy Mapping: Use fast-clearing skills. Avoid risky map mods. Keep portals in reserve.   Bossing: Learn boss mechanics. Use Sniper's Mark or Assassin's Mark. Position mercenaries or totems strategically.   Final Thoughts The Gauntlet is unforgiving, but with the right build and mindset, you can push deep into the event—even as a beginner. Focus on survivability, learn from each death, and don't be afraid to restart. Every run teaches you something new.
  • 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