Fix technique points not being restored by consumables

This commit is contained in:
Melledy
2023-12-14 20:40:46 -08:00
parent 4a7653ec89
commit 6a6f0da807

View File

@@ -44,6 +44,9 @@ public class ItemUseHandler {
}
avatar.save();
// Resync lineup with client
lineup.refreshLineup();
}
// Add avatar energy
@@ -54,22 +57,29 @@ public class ItemUseHandler {
int amount = (int) (excel.getPreviewHPRecoveryPercent() * 10000);
avatar.setCurrentSp(lineup, avatar.getCurrentHp(lineup) + amount);
avatar.save();
// Resync lineup with client
lineup.refreshLineup();
}
// Add lineup technique points
if (excel.getPreviewSkillPoint() > 0) {
lineup.addMp(excel.getPreviewSkillPoint());
lineup.save();
}
// Refresh
lineup.refreshLineup();
return true;
}
public static boolean handleExternalSystemFoodBenefit(Player player, ItemUseExcel excel, int avatarId, int count) {
// Handle any hp/mp/sp changes the food might give
handleTeamSpecificFoodBenefit(player, excel, avatarId, count);
// Add food buffs
if (excel.getConsumeType() == 1 || excel.getConsumeType() == 2) {
player.getFoodBuffs().put(excel.getConsumeType(), excel.getMazeBuffID());
player.save();
}
// TODO send buff refresh packet