mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-16 15:24:44 +01:00
Fix technique points not being restored by consumables
This commit is contained in:
@@ -44,6 +44,9 @@ public class ItemUseHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
avatar.save();
|
avatar.save();
|
||||||
|
|
||||||
|
// Resync lineup with client
|
||||||
|
lineup.refreshLineup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add avatar energy
|
// Add avatar energy
|
||||||
@@ -54,22 +57,29 @@ public class ItemUseHandler {
|
|||||||
int amount = (int) (excel.getPreviewHPRecoveryPercent() * 10000);
|
int amount = (int) (excel.getPreviewHPRecoveryPercent() * 10000);
|
||||||
avatar.setCurrentSp(lineup, avatar.getCurrentHp(lineup) + amount);
|
avatar.setCurrentSp(lineup, avatar.getCurrentHp(lineup) + amount);
|
||||||
avatar.save();
|
avatar.save();
|
||||||
|
|
||||||
|
// Resync lineup with client
|
||||||
|
lineup.refreshLineup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add lineup technique points
|
// Add lineup technique points
|
||||||
if (excel.getPreviewSkillPoint() > 0) {
|
if (excel.getPreviewSkillPoint() > 0) {
|
||||||
lineup.addMp(excel.getPreviewSkillPoint());
|
lineup.addMp(excel.getPreviewSkillPoint());
|
||||||
|
lineup.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh
|
|
||||||
lineup.refreshLineup();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean handleExternalSystemFoodBenefit(Player player, ItemUseExcel excel, int avatarId, int count) {
|
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
|
// Add food buffs
|
||||||
|
if (excel.getConsumeType() == 1 || excel.getConsumeType() == 2) {
|
||||||
player.getFoodBuffs().put(excel.getConsumeType(), excel.getMazeBuffID());
|
player.getFoodBuffs().put(excel.getConsumeType(), excel.getMazeBuffID());
|
||||||
player.save();
|
player.save();
|
||||||
|
}
|
||||||
|
|
||||||
// TODO send buff refresh packet
|
// TODO send buff refresh packet
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user