if (player.getClan() == null)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
return false;
}
FortressSiegeEvent siegeEvent = player.getEvent(FortressSiegeEvent.class);
if (siegeEvent == null)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
return false;
}
if (player.isMounted())
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
return false;
}
ItemAttachment attach = player.getActiveWeaponFlagAttachment();
if (!(attach instanceof FortressCombatFlagObject) || (((FortressCombatFlagObject) attach).getEvent() != siegeEvent))
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
return false;
}
if (!player.isInRangeZ(target, getCastRange()))
{
player.sendPacket(SystemMsg.YOUR_TARGET_IS_OUT_OF_RANGE);
return false;
}
if (first)
{
siegeEvent.broadcastTo(new SystemMessage2(SystemMsg.S1_CLAN_IS_TRYING_TO_DISPLAY_A_FLAG).addString(player.getClan().getName()), SiegeEvent.DEFENDERS);
}
return true;
}