public boolean isAllowedToEnchantSkills()
{
if (isLocked())
return false;
if (isTransformed())
return false;
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(this))
return false;
if (isCastingNow() || isCastingSimultaneouslyNow() || isInCombat())
return false;
if (isInBoat() || isInAirShip())
return false;
return true;
}
If the skill has cooldown to return false?
// Check if this skill is enabled (ex : reuse time)
if (isSkillDisabled(skill))
{
SystemMessage sm = null;
if (_reuseTimeStamps.containsKey(Integer.valueOf(skill.getReuseHashCode())))
{
int remainingTime = (int)(_reuseTimeStamps.get(Integer.valueOf(skill.getReuseHashCode())).getRemaining()/1000);
int hours = remainingTime / 3600;
int minutes = (remainingTime % 3600) / 60;
int seconds = (remainingTime % 60);
if (hours > 0)
{
sm = new SystemMessage(SystemMessageId.S2_HOURS_S3_MINUTES_S4_SECONDS_REMAINING_FOR_REUSE_S1);
sm.addSkillName(skill);
sm.addNumber(hours);
sm.addNumber(minutes);
}
else if (minutes > 0)
{
sm = new SystemMessage(SystemMessageId.S2_MINUTES_S3_SECONDS_REMAINING_FOR_REUSE_S1);
sm.addSkillName(skill);
sm.addNumber(minutes);
}
else
{
sm = new SystemMessage(SystemMessageId.S2_SECONDS_REMAINING_FOR_REUSE_S1);
sm.addSkillName(skill);
}
sm.addNumber(seconds);
}
else
{
sm = new SystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE);
sm.addSkillName(skill);
}
sendPacket(sm);
return false;
}
⏳ L2Elixir Open Beta goes live in less than 4 hours!
This Saturday, November 15th at 21:00 (UTC +2), the gates open for our biggest testing phase!
🔥 Don’t miss the first 30 minutes — exclusive rewards await!
A special NPC, “The Judge”, will appear in Giran, offering unique bonuses to early participants:
🏅 Open Beta Rewards:
- The first 2 players who talk to The Judge → Premium Account for Launch
- Another 2 random players who interact → Premium Account
- Everyone who speaks to the NPC within the first 30 minutes → Legendary Starter Pack for all characters on launch day (Nov 28th, 2025)
📌 The NPC will spawn exactly at 21:00 (UTC+2).
⏱️ Follow the countdown on our website — the hype is real!
Create your account & download the Updater to be ready!
🔗 https://l2elixir.org/connect/
💬 Discord: https://discord.gg/5ydPHvhbxs
Question
GameBlonD
Hello,
How can i add here:
public boolean isAllowedToEnchantSkills() { if (isLocked()) return false; if (isTransformed()) return false; if (AttackStanceTaskManager.getInstance().getAttackStanceTask(this)) return false; if (isCastingNow() || isCastingSimultaneouslyNow() || isInCombat()) return false; if (isInBoat() || isInAirShip()) return false; return true; }If the skill has cooldown to return false?
// Check if this skill is enabled (ex : reuse time) if (isSkillDisabled(skill)) { SystemMessage sm = null; if (_reuseTimeStamps.containsKey(Integer.valueOf(skill.getReuseHashCode()))) { int remainingTime = (int)(_reuseTimeStamps.get(Integer.valueOf(skill.getReuseHashCode())).getRemaining()/1000); int hours = remainingTime / 3600; int minutes = (remainingTime % 3600) / 60; int seconds = (remainingTime % 60); if (hours > 0) { sm = new SystemMessage(SystemMessageId.S2_HOURS_S3_MINUTES_S4_SECONDS_REMAINING_FOR_REUSE_S1); sm.addSkillName(skill); sm.addNumber(hours); sm.addNumber(minutes); } else if (minutes > 0) { sm = new SystemMessage(SystemMessageId.S2_MINUTES_S3_SECONDS_REMAINING_FOR_REUSE_S1); sm.addSkillName(skill); sm.addNumber(minutes); } else { sm = new SystemMessage(SystemMessageId.S2_SECONDS_REMAINING_FOR_REUSE_S1); sm.addSkillName(skill); } sm.addNumber(seconds); } else { sm = new SystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE); sm.addSkillName(skill); } sendPacket(sm); return false; }26 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now