mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Vampirism for hardcore mode, needs testing.
This commit is contained in:
@ -24,4 +24,18 @@ public class Hardcore {
|
||||
|
||||
player.sendMessage(ChatColor.GOLD+"[mcMMO] "+ChatColor.DARK_RED+"You've suffered a penalty to skills from death.");
|
||||
}
|
||||
|
||||
public static void invokeVampirism(Player killer, Player defender) {
|
||||
PlayerProfile PPk = Users.getProfile(killer);
|
||||
PlayerProfile PPd = Users.getProfile(defender);
|
||||
|
||||
for(SkillType st : SkillType.values()) {
|
||||
if(st.equals(SkillType.ALL))
|
||||
continue;
|
||||
int newValue = (int) (PPd.getSkillLevel(st) - (PPd.getSkillLevel(st) * (Config.getInstance().getHardcoreVampirismStatLeechPercentage() * 0.01D)));
|
||||
PPk.modifySkill(st, newValue+PPk.getSkillLevel(st));
|
||||
}
|
||||
|
||||
killer.sendMessage(ChatColor.GOLD+"[mcMMO] "+ChatColor.DARK_AQUA+"You've stolen knowledge from that player.");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user