mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Fire appropriate level change events for Hardcore mode.
This commit is contained in:
parent
e904e34556
commit
fdaa42edd3
@ -35,8 +35,11 @@ public final class HardcoreManager {
|
|||||||
|
|
||||||
totalLevelsLost += levelsLost;
|
totalLevelsLost += levelsLost;
|
||||||
|
|
||||||
|
float xpRemoved = playerProfile.getSkillXpLevelRaw(skillType);
|
||||||
playerProfile.modifySkill(skillType, playerSkillLevel - levelsLost);
|
playerProfile.modifySkill(skillType, playerSkillLevel - levelsLost);
|
||||||
playerProfile.removeXp(skillType, xpLost);
|
playerProfile.removeXp(skillType, xpLost);
|
||||||
|
|
||||||
|
EventUtils.handleLevelChangeEvent(player, skillType, levelsLost, xpLost + xpRemoved, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PlayerDeath", totalLevelsLost));
|
player.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PlayerDeath", totalLevelsLost));
|
||||||
@ -69,11 +72,18 @@ public final class HardcoreManager {
|
|||||||
|
|
||||||
totalLevelsStolen += levelsStolen;
|
totalLevelsStolen += levelsStolen;
|
||||||
|
|
||||||
|
float killerXpRemoved = killerProfile.getSkillXpLevelRaw(skillType);
|
||||||
killerProfile.modifySkill(skillType, killerSkillLevel + levelsStolen);
|
killerProfile.modifySkill(skillType, killerSkillLevel + levelsStolen);
|
||||||
killerProfile.addXp(skillType, xpStolen);
|
EventUtils.handleLevelChangeEvent(killer, skillType, levelsStolen, killerXpRemoved, true);
|
||||||
|
|
||||||
|
killerProfile.addXp(skillType, xpStolen);
|
||||||
|
EventUtils.handleXpGainEvent(killer, skillType, xpStolen);
|
||||||
|
|
||||||
|
float victimXpRemoved = killerProfile.getSkillXpLevelRaw(skillType);
|
||||||
victimProfile.modifySkill(skillType, victimSkillLevel - levelsStolen);
|
victimProfile.modifySkill(skillType, victimSkillLevel - levelsStolen);
|
||||||
victimProfile.removeXp(skillType, xpStolen);
|
victimProfile.removeXp(skillType, xpStolen);
|
||||||
|
|
||||||
|
EventUtils.handleLevelChangeEvent(victim, skillType, levelsStolen, victimXpRemoved + xpStolen, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totalLevelsStolen > 0) {
|
if (totalLevelsStolen > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user