}
try{
StatusUpdate su = new StatusUpdate(getObjectId());
boolean isSendStatus = false;
// Consume MP of the L2Character and Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
double mpConsume = getStat().getMpConsume(skill);
if(mpConsume > 0)
{
if(skill.isDance())
{
getStatus().reduceMp(calcStat(Stats.DANCE_MP_CONSUME_RATE, mpConsume, null, null));
}
else if(skill.isMagic())
{
getStatus().reduceMp(calcStat(Stats.MAGICAL_MP_CONSUME_RATE, mpConsume, null, null));
}
else
{
getStatus().reduceMp(calcStat(Stats.PHYSICAL_MP_CONSUME_RATE, mpConsume, null, null));
}
su.addAttribute(StatusUpdate.CUR_MP, (int) getCurrentMp());
isSendStatus = true;
}
// Consume HP if necessary and Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
if(skill.getHpConsume() > 0)
{
double consumeHp;
consumeHp = calcStat(Stats.HP_CONSUME_RATE, skill.getHpConsume(), null, null);
if(consumeHp + 1 >= getCurrentHp())
{
consumeHp = getCurrentHp() - 1.0;
}
getStatus().reduceHp(consumeHp, this);
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
isSendStatus = true;
}
// Send a Server->Client packet StatusUpdate with MP modification to the L2PcInstance
if(isSendStatus)