Added custom XP boost perk

This commit is contained in:
TfT_02 2014-01-18 23:27:18 +01:00
parent c27d79cf25
commit 82509fb476
6 changed files with 85 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Version 1.4.08-dev
+ Added level threshold settings to hardcore modes. When a players skill level is below this threshold, they will not lose any stats
+ Added party alliances, two parties can now team up. Allies share party chat and cannot harm each other.
+ Added new experience bonus perk 'mcmmo.perks.xp.10percentboost.<skillname>', gives +10% experience
+ Added new experience bonus perk 'mcmmo.perks.xp.customboost.<skillname>' multiplies incoming XP by the boost amount defined in the experience config
= Fixed bug where LeafBlower permissions were ignored
= Fixed bug with toggle commands not properly displaying the success message.
= Fixed IllegalArgumentException caused by an empty Fishing treasure category

View File

@ -179,6 +179,9 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Skill modifiers */
public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); }
/* Custom XP perk */
public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); }
/* Conversion */
public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); }

View File

@ -109,6 +109,7 @@ public final class Permissions {
public static boolean doubleXp(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); }
public static boolean oneAndOneHalfXp(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); }
public static boolean oneAndOneTenthXp(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); }
public static boolean customXpBoost(Permissible permissible, SkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); }
/* ACTIVATION PERKS */
public static boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); }

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.util.skills;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.Permissions;
@ -62,6 +63,9 @@ public final class PerksUtils {
else if (Permissions.oneAndOneTenthXp(player, skill)) {
xp *= 1.1;
}
else if (Permissions.customXpBoost(player, skill)) {
xp *= ExperienceConfig.getInstance().getCustomXpPerkBoost();
}
return xp;
}

View File

@ -54,6 +54,11 @@ Experience_Formula:
Fishing: 1.0
Alchemy: 1.0
# XP earned by players with the permission mcmmo.perks.xp.customboost.<skillname> will get multiplied
# with 1.25 by default, resulting in a 25% XP boost
Custom_XP_Perk:
Boost: 1.25
#
# Settings for XP conversion with '/mcconvert experience'
###

View File

@ -1345,6 +1345,7 @@ permissions:
mcmmo.perks.xp.150percentboost.all: true
mcmmo.perks.xp.50percentboost.all: true
mcmmo.perks.xp.10percentboost.all: true
mcmmo.perks.xp.customboost.all: true
mcmmo.perks.xp.double.all: true
mcmmo.perks.xp.quadruple.all: true
mcmmo.perks.xp.triple.all: true
@ -1558,6 +1559,76 @@ permissions:
mcmmo.perks.xp.10percentboost.woodcutting:
default: false
description: Multiplies incoming Woodcutting XP by 1.1
mcmmo.perks.xp.customboost.*:
default: false
description: Mulitplies incoming XP by the boost amount defined in the experience config
children:
mcmmo.perks.xp.customboost.all: true
mcmmo.perks.xp.customboost:
default: false
description: Mulitplies incoming XP by the boost amount defined in the experience config
children:
mcmmo.perks.xp.customboost.all: true
mcmmo.perks.xp.customboost.all:
default: false
description: Mulitplies incoming XP by the boost amount defined in the experience config
children:
mcmmo.perks.xp.customboost.acrobatics: true
mcmmo.perks.xp.customboost.alchemy: true
mcmmo.perks.xp.customboost.archery: true
mcmmo.perks.xp.customboost.axes: true
mcmmo.perks.xp.customboost.excavation: true
mcmmo.perks.xp.customboost.fishing: true
mcmmo.perks.xp.customboost.herbalism: true
mcmmo.perks.xp.customboost.mining: true
mcmmo.perks.xp.customboost.repair: true
mcmmo.perks.xp.customboost.smelting: true
mcmmo.perks.xp.customboost.swords: true
mcmmo.perks.xp.customboost.taming: true
mcmmo.perks.xp.customboost.unarmed: true
mcmmo.perks.xp.customboost.woodcutting: true
mcmmo.perks.xp.customboost.acrobatics:
default: false
description: Multiplies incoming Acrobatics XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.alchemy:
default: false
description: Multiplies incoming Acrobatics XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.archery:
default: false
description: Multiplies incoming Archery XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.axes:
default: false
description: Multiplies incoming Axes XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.excavation:
default: false
description: Multiplies incoming Excavation XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.fishing:
default: false
description: Multiplies incoming Fishing XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.herbalism:
default: false
description: Multiplies incoming Herbalism XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.mining:
default: false
description: Multiplies incoming Mining XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.repair:
default: false
description: Multiplies incoming Repair XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.smelting:
default: false
description: Multiplies incoming Smelting XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.swords:
default: false
description: Multiplies incoming Swords XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.taming:
default: false
description: Multiplies incoming Taming XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.unarmed:
default: false
description: Multiplies incoming Unarmed XP by the boost amount defined in the experience config
mcmmo.perks.xp.customboost.woodcutting:
default: false
description: Multiplies incoming Woodcutting XP by the boost amount defined in the experience config
mcmmo.perks.xp.double.*:
default: false
description: Doubles incoming XP