if(isPet() || isSummon())
{
L2Player player = getPlayer();
if(player != null && isSkillDisabled(skill.getId()))
{
player.sendPacket(new SystemMessage(SystemMessage.THAT_PET_SERVITOR_SKILL_CANNOT_BE_USED_BECAUSE_IT_IS_RECHARGING));
}
return;
}
if(!isPlayer() || isCastingNow())
{
return;
}
SkillTimeStamp sts = ((L2Player) this).getSkillReuseTimeStamps().get(skill.getId());
if(sts == null || !sts.hasNotPassed())
{
return;
}
long timeleft = sts.getReuseCurrent();
if(!Config.ALT_SHOW_REUSE_MSG && timeleft < 10000 || timeleft < 500)
{
return;
}
long hours = timeleft / 3600000;
long minutes = (timeleft - hours * 3600000) / 60000;
long seconds = (long) Math.ceil((timeleft - hours * 3600000 - minutes * 60000) / 1000.);
if(hours > 0)
{
sendPacket(new SystemMessage(SystemMessage.THERE_ARE_S2_HOURS_S3_MINUTES_AND_S4_SECONDS_REMAINING_IN_S1S_REUSE_TIME).addSkillName(skill.getId(), skill.getDisplayLevel()).addNumber(hours).addNumber(minutes).addNumber(seconds));
}
else if(minutes > 0)
{
sendPacket(new SystemMessage(SystemMessage.THERE_ARE_S2_MINUTES_S3_SECONDS_REMAINING_IN_S1S_REUSE_TIME).addSkillName(skill.getId(), skill.getDisplayLevel()).addNumber(minutes).addNumber(seconds));
}
else
{
sendPacket(new SystemMessage(SystemMessage.THERE_ARE_S2_SECONDS_REMAINING_IN_S1S_REUSE_TIME).addSkillName(skill.getId(), skill.getDisplayLevel()).addNumber(seconds));
}
}