public boolean checkIfOkToCastSealOfRule(Castle castle, boolean isCheckOnly, L2Skill skill)
{
SystemMessage sm;
if (castle == null || castle.getCastleId() <= 0)
{
sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
sm.addSkillName(skill);
}
else if (!castle.getArtifacts().contains(getTarget()))
{
sm = new SystemMessage(SystemMessageId.INCORRECT_TARGET);
}
else if (!castle.getSiege().getIsInProgress())
{
sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
sm.addSkillName(skill);
}
else if (!Util.checkIfInRange(200, this, getTarget(), true))
{
sm = new SystemMessage(SystemMessageId.DIST_TOO_FAR_CASTING_STOPPED);
}
else if (castle.getSiege().getAttackerClan(getClan()) == null)
{
sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
sm.addSkillName(skill);
}
else
{
if (!isCheckOnly)
{
sm = new SystemMessage(SystemMessageId.OPPONENT_STARTED_ENGRAVING);
castle.getSiege().announceToPlayer(sm, false);
}
return true;
}
sendPacket(sm);
return false;
}
I believe these files have errors. When players start switching subclasses, the server freezes and closes on its own. I was told it's a problem with the skills. Perhaps this error still exists. no?
Question
GameBlonD
Hi, anyone can help me add a check on seal of rule (pray) so players can casted only from the Platform?
Tried something like this:
but it doesn't work
Full code:
public boolean checkIfOkToCastSealOfRule(Castle castle, boolean isCheckOnly, L2Skill skill) { SystemMessage sm; if (castle == null || castle.getCastleId() <= 0) { sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED); sm.addSkillName(skill); } else if (!castle.getArtifacts().contains(getTarget())) { sm = new SystemMessage(SystemMessageId.INCORRECT_TARGET); } else if (!castle.getSiege().getIsInProgress()) { sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED); sm.addSkillName(skill); } else if (!Util.checkIfInRange(200, this, getTarget(), true)) { sm = new SystemMessage(SystemMessageId.DIST_TOO_FAR_CASTING_STOPPED); } else if (castle.getSiege().getAttackerClan(getClan()) == null) { sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED); sm.addSkillName(skill); } else { if (!isCheckOnly) { sm = new SystemMessage(SystemMessageId.OPPONENT_STARTED_ENGRAVING); castle.getSiege().announceToPlayer(sm, false); } return true; } sendPacket(sm); return false; }3 answers to this question
Recommended Posts