else if (event.startsWith("recHp"))
{
if (restoreCheck(player) && isValidTalker(player,isFromBBS) && player.destroyItemByItemId("GM Buffer", Config.GMSHOP_BUFF_ITEM, Config.GMSHOP_BUFF_HP, player, true))
{
target.getStatus().setCurrentHp(target.getMaxHp());
}
}
else if (event.startsWith("recCp"))
{
if (restoreCheck(player) && isValidTalker(player,isFromBBS) && player.destroyItemByItemId("GM Buffer", Config.GMSHOP_BUFF_ITEM, Config.GMSHOP_BUFF_CP, player, true))
{
target.getStatus().setCurrentCp(target.getMaxCp());
}
}
else if (event.startsWith("recMp"))
{
if (restoreCheck(player) && isValidTalker(player,isFromBBS) && player.destroyItemByItemId("GM Buffer", Config.GMSHOP_BUFF_ITEM, Config.GMSHOP_BUFF_MP, player, true))
{
target.getStatus().setCurrentMp(target.getMaxMp());
}
}
Есть 3 функции рестор хп, мп и цп. Хочу объеденить в одну, но никак не получается.