public static void invokeVampirism(Player killer, Player victim) {
double vampirismStatLeechPercentage = Config.getInstance().getHardcoreVampirismStatLeechPercentage();
int levelThreshold = Config.getInstance().getHardcoreVampirismLevelThreshold();
PlayerProfile killerProfile = UserManager.getPlayer(killer).getProfile();
PlayerProfile victimProfile = UserManager.getPlayer(victim).getProfile();
int totalLevelsStolen = 0;
HashMap<String, Integer> levelChanged = new HashMap<String, Integer>();
HashMap<String, Float> experienceChanged = new HashMap<String, Float>();
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
if (!skillType.getHardcoreVampirismEnabled()) {
levelChanged.put(skillType.toString(), 0);
experienceChanged.put(skillType.toString(), 0F);
continue;
}
int killerSkillLevel = killerProfile.getSkillLevel(skillType);
int victimSkillLevel = victimProfile.getSkillLevel(skillType);
if (victimSkillLevel <= 0 || victimSkillLevel < killerSkillLevel / 2 || victimSkillLevel <= levelThreshold) {
levelChanged.put(skillType.toString(), 0);
experienceChanged.put(skillType.toString(), 0F);
continue;
}
int victimSkillXpLevel = victimProfile.getSkillXpLevel(skillType);
double statsStolen = victimSkillLevel * (vampirismStatLeechPercentage * 0.01D);
int levelsStolen = (int) statsStolen;
int xpStolen = (int) Math.floor(victimSkillXpLevel * (statsStolen - levelsStolen));
levelChanged.put(skillType.toString(), levelsStolen);