Moving Fishing and Arcance Forging settings to advanced.yml

This commit is contained in:
TfT_02 2013-01-11 00:21:18 +01:00
parent 2205ad0772
commit 6cdb27aef0
9 changed files with 96 additions and 107 deletions

View File

@ -166,11 +166,11 @@ public class RepairCommand extends SkillCommand {
if (canArcaneForge) {
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Rank", new Object[] { arcaneForgingRank }));
if (Config.getInstance().getArcaneForgingEnchantLossEnabled()) {
if (advancedConfig.getArcaneForgingEnchantLossEnabled()) {
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Success", new Object[] { (arcaneBypass ? 100 : Repair.getEnchantChance(arcaneForgingRank)) }));
}
if (Config.getInstance().getArcaneForgingDowngradeEnabled()) {
if (advancedConfig.getArcaneForgingDowngradeEnabled()) {
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Downgrade", new Object[] { (arcaneBypass ? 0 : Repair.getDowngradeChance(arcaneForgingRank)) }));
}
}

View File

@ -67,7 +67,20 @@ public class AdvancedConfig extends ConfigLoader {
//Nothing to configure, everything is already configurable in config.yml
/* FISHING */
public int getFishingTierLevelsTier1() { return config.getInt("Skills.Fishing.Tier_Levels.Tier1", 0); }
public int getFishingTierLevelsTier2() { return config.getInt("Skills.Fishing.Tier_Levels.Tier2", 200); }
public int getFishingTierLevelsTier3() { return config.getInt("Skills.Fishing.Tier_Levels.Tier3", 400); }
public int getFishingTierLevelsTier4() { return config.getInt("Skills.Fishing.Tier_Levels.Tier4", 600); }
public int getFishingTierLevelsTier5() { return config.getInt("Skills.Fishing.Tier_Levels.Tier5", 800); }
/* Shake */
public int getShakeUnlockLevel() { return config.getInt("Skills.Fishing.Shake_UnlockLevel", 150); }
public int getShakeChanceRank1() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_1", 25); }
public int getShakeChanceRank2() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_2", 40); }
public int getShakeChanceRank3() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_3", 55); }
public int getShakeChanceRank4() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_4", 60); }
public int getShakeChanceRank5() { return config.getInt("Skills.Fishing.Shake_Chance.Rank_5", 75); }
public int getFishingMagicMultiplier() { return config.getInt("Skills.Fishing.MagicHunter_Multiplier", 5); }
/* HERBALISM */
@ -98,6 +111,22 @@ public class AdvancedConfig extends ConfigLoader {
public int getSuperRepairChanceMax() { return config.getInt("Skills.Repair.SuperRepair_ChanceMax", 100); }
public int getSuperRepairMaxLevel() { return config.getInt("Skills.Repair.SuperRepair_MaxBonusLevel", 1000); }
/* Arcane Forging */
public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Skills.Repair.Arcane_Forging.Downgrades.Enabled", true); }
public int getArcaneForgingDowngradeChanceRank1() { return config.getInt("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_1", 75); }
public int getArcaneForgingDowngradeChanceRank2() { return config.getInt("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_2", 50); }
public int getArcaneForgingDowngradeChanceRank3() { return config.getInt("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_3", 25); }
public int getArcaneForgingDowngradeChanceRank4() { return config.getInt("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_4", 15); }
public boolean getArcaneForgingEnchantLossEnabled() { return config.getBoolean("Skills.Repair.Arcane_Forging.May_Lose_Enchants", true); }
public int getArcaneForgingKeepEnchantsChanceRank1() { return config.getInt("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_1", 10); }
public int getArcaneForgingKeepEnchantsChanceRank2() { return config.getInt("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_2", 20); }
public int getArcaneForgingKeepEnchantsChanceRank3() { return config.getInt("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_3", 30); }
public int getArcaneForgingKeepEnchantsChanceRank4() { return config.getInt("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_4", 40); }
public int getArcaneForgingRankLevels1() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_1", 100); }
public int getArcaneForgingRankLevels2() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_2", 250); }
public int getArcaneForgingRankLevels3() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_3", 500); }
public int getArcaneForgingRankLevels4() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_4", 750); }
/* SWORDS */
public int getBleedChanceMax() { return config.getInt("Skills.Swords.Bleed_ChanceMax", 75); }
public int getBleedMaxBonusLevel() { return config.getInt("Skills.Swords.Bleed_MaxBonusLevel", 750); }

View File

@ -153,19 +153,7 @@ public class Config extends ConfigLoader {
/* Fishing */
public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
public boolean getFishingDropsEnabled() { return config.getBoolean("Fishing.Drops_Enabled", true); }
public int getFishingTierLevelsTier1() { return config.getInt("Fishing.Tier_Levels.Tier1", 0); }
public int getFishingTierLevelsTier2() { return config.getInt("Fishing.Tier_Levels.Tier2", 200); }
public int getFishingTierLevelsTier3() { return config.getInt("Fishing.Tier_Levels.Tier3", 400); }
public int getFishingTierLevelsTier4() { return config.getInt("Fishing.Tier_Levels.Tier4", 600); }
public int getFishingTierLevelsTier5() { return config.getInt("Fishing.Tier_Levels.Tier5", 800); }
/* Shake */
public int getShakeChanceRank1() { return config.getInt("Shake.Chance.Rank_1", 25); }
public int getShakeChanceRank2() { return config.getInt("Shake.Chance.Rank_2", 40); }
public int getShakeChanceRank3() { return config.getInt("Shake.Chance.Rank_3", 55); }
public int getShakeChanceRank4() { return config.getInt("Shake.Chance.Rank_4", 60); }
public int getShakeChanceRank5() { return config.getInt("Shake.Chance.Rank_5", 75); }
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
/* Herbalism */
public int getHerbalismXPSugarCane() { return config.getInt("Experience.Herbalism.Sugar_Cane", 30); }
@ -278,22 +266,6 @@ public class Config extends ConfigLoader {
public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
/* Arcane Forging */
public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Arcane_Forging.Downgrades.Enabled", true); }
public int getArcaneForgingDowngradeChanceRank1() { return config.getInt("Arcane_Forging.Downgrades.Chance.Rank_1", 75); }
public int getArcaneForgingDowngradeChanceRank2() { return config.getInt("Arcane_Forging.Downgrades.Chance.Rank_2", 50); }
public int getArcaneForgingDowngradeChanceRank3() { return config.getInt("Arcane_Forging.Downgrades.Chance.Rank_3", 25); }
public int getArcaneForgingDowngradeChanceRank4() { return config.getInt("Arcane_Forging.Downgrades.Chance.Rank_4", 15); }
public boolean getArcaneForgingEnchantLossEnabled() { return config.getBoolean("Arcane_Forging.May_Lose_Enchants", true); }
public int getArcaneForgingKeepEnchantsChanceRank1() { return config.getInt("Arcane_Forging.Keep_Enchants.Chance.Rank_1", 10); }
public int getArcaneForgingKeepEnchantsChanceRank2() { return config.getInt("Arcane_Forging.Keep_Enchants.Chance.Rank_2", 20); }
public int getArcaneForgingKeepEnchantsChanceRank3() { return config.getInt("Arcane_Forging.Keep_Enchants.Chance.Rank_3", 30); }
public int getArcaneForgingKeepEnchantsChanceRank4() { return config.getInt("Arcane_Forging.Keep_Enchants.Chance.Rank_4", 40); }
public int getArcaneForgingRankLevels1() { return config.getInt("Arcane_Forging.Rank_Levels.Rank_1", 100); }
public int getArcaneForgingRankLevels2() { return config.getInt("Arcane_Forging.Rank_Levels.Rank_2", 250); }
public int getArcaneForgingRankLevels3() { return config.getInt("Arcane_Forging.Rank_Levels.Rank_3", 500); }
public int getArcaneForgingRankLevels4() { return config.getInt("Arcane_Forging.Rank_Levels.Rank_4", 750); }
/* Level Caps */
public int getLevelCapAcrobatics() {
return getLevelCap("Skills.Acrobatics.Level_Cap");

View File

@ -202,23 +202,23 @@ public class TreasuresConfig extends ConfigLoader{
int dropLevel = fTreasure.getDropLevel();
int maxLevel = fTreasure.getMaxLevel();
if (dropLevel <= Config.getInstance().getFishingTierLevelsTier1() && maxLevel >= Config.getInstance().getFishingTierLevelsTier1()) {
if (dropLevel <= AdvancedConfig.getInstance().getFishingTierLevelsTier1() && maxLevel >= AdvancedConfig.getInstance().getFishingTierLevelsTier1()) {
fishingRewardsTier1.add(fTreasure);
}
if (dropLevel <= Config.getInstance().getFishingTierLevelsTier2() && maxLevel >= Config.getInstance().getFishingTierLevelsTier2()) {
if (dropLevel <= AdvancedConfig.getInstance().getFishingTierLevelsTier2() && maxLevel >= AdvancedConfig.getInstance().getFishingTierLevelsTier2()) {
fishingRewardsTier2.add(fTreasure);
}
if (dropLevel <= Config.getInstance().getFishingTierLevelsTier3() && maxLevel >= Config.getInstance().getFishingTierLevelsTier3()) {
if (dropLevel <= AdvancedConfig.getInstance().getFishingTierLevelsTier3() && maxLevel >= AdvancedConfig.getInstance().getFishingTierLevelsTier3()) {
fishingRewardsTier3.add(fTreasure);
}
if (dropLevel <= Config.getInstance().getFishingTierLevelsTier4() && maxLevel >= Config.getInstance().getFishingTierLevelsTier4()) {
if (dropLevel <= AdvancedConfig.getInstance().getFishingTierLevelsTier4() && maxLevel >= AdvancedConfig.getInstance().getFishingTierLevelsTier4()) {
fishingRewardsTier4.add(fTreasure);
}
if (dropLevel <= Config.getInstance().getFishingTierLevelsTier5() && maxLevel >= Config.getInstance().getFishingTierLevelsTier5()) {
if (dropLevel <= AdvancedConfig.getInstance().getFishingTierLevelsTier5() && maxLevel >= AdvancedConfig.getInstance().getFishingTierLevelsTier5()) {
fishingRewardsTier5.add(fTreasure);
}

View File

@ -49,13 +49,13 @@ public class Fishing {
int level = profile.getSkillLevel(SkillType.FISHING);
int fishingTier;
if (level >= Config.getInstance().getFishingTierLevelsTier5()) {
if (level >= advancedConfig.getFishingTierLevelsTier5()) {
fishingTier = 5;
} else if (level >= Config.getInstance().getFishingTierLevelsTier4()) {
} else if (level >= advancedConfig.getFishingTierLevelsTier4()) {
fishingTier = 4;
} else if (level >= Config.getInstance().getFishingTierLevelsTier3()) {
} else if (level >= advancedConfig.getFishingTierLevelsTier3()) {
fishingTier = 3;
} else if (level >= Config.getInstance().getFishingTierLevelsTier2()) {
} else if (level >= advancedConfig.getFishingTierLevelsTier2()) {
fishingTier = 2;
} else {
fishingTier = 1;
@ -469,19 +469,19 @@ public class Fishing {
public static int getShakeChance(int lootTier) {
switch (lootTier) {
case 1:
return Config.getInstance().getShakeChanceRank1();
return advancedConfig.getShakeChanceRank1();
case 2:
return Config.getInstance().getShakeChanceRank2();
return advancedConfig.getShakeChanceRank2();
case 3:
return Config.getInstance().getShakeChanceRank3();
return advancedConfig.getShakeChanceRank3();
case 4:
return Config.getInstance().getShakeChanceRank4();
return advancedConfig.getShakeChanceRank4();
case 5:
return Config.getInstance().getShakeChanceRank5();
return advancedConfig.getShakeChanceRank5();
default:
return 10;

View File

@ -12,7 +12,6 @@ import org.getspout.spoutapi.player.SpoutPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
@ -23,8 +22,6 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users;
public class Repair {
private static Config configInstance = Config.getInstance();
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
public static final int REPAIR_MASTERY_CHANCE_MAX = advancedConfig.getRepairMasteryMaxBonus();
@ -64,16 +61,16 @@ public class Repair {
public static int getArcaneForgingRank(PlayerProfile profile) {
int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
if (skillLevel >= configInstance.getArcaneForgingRankLevels4()) {
if (skillLevel >= advancedConfig.getArcaneForgingRankLevels4()) {
return 4;
}
else if (skillLevel >= configInstance.getArcaneForgingRankLevels3()) {
else if (skillLevel >= advancedConfig.getArcaneForgingRankLevels3()) {
return 3;
}
else if (skillLevel >= configInstance.getArcaneForgingRankLevels2()) {
else if (skillLevel >= advancedConfig.getArcaneForgingRankLevels2()) {
return 2;
}
else if (skillLevel >= configInstance.getArcaneForgingRankLevels1()) {
else if (skillLevel >= advancedConfig.getArcaneForgingRankLevels1()) {
return 1;
}
else {
@ -122,7 +119,7 @@ public class Repair {
if (Misc.getRandom().nextInt(randomChance) <= getEnchantChance(rank)) {
int enchantLevel = enchant.getValue();
if (configInstance.getArcaneForgingDowngradeEnabled() && enchantLevel > 1) {
if (advancedConfig.getArcaneForgingDowngradeEnabled() && enchantLevel > 1) {
if (Misc.getRandom().nextInt(randomChance) < getDowngradeChance(rank)) {
is.addEnchantment(enchantment, --enchantLevel);
downgraded = true;
@ -156,16 +153,16 @@ public class Repair {
public static int getEnchantChance(int rank) {
switch (rank) {
case 4:
return configInstance.getArcaneForgingKeepEnchantsChanceRank4();
return advancedConfig.getArcaneForgingKeepEnchantsChanceRank4();
case 3:
return configInstance.getArcaneForgingKeepEnchantsChanceRank3();
return advancedConfig.getArcaneForgingKeepEnchantsChanceRank3();
case 2:
return configInstance.getArcaneForgingKeepEnchantsChanceRank2();
return advancedConfig.getArcaneForgingKeepEnchantsChanceRank2();
case 1:
return configInstance.getArcaneForgingKeepEnchantsChanceRank1();
return advancedConfig.getArcaneForgingKeepEnchantsChanceRank1();
default:
return 0;
@ -181,16 +178,16 @@ public class Repair {
public static int getDowngradeChance(int rank) {
switch (rank) {
case 4:
return configInstance.getArcaneForgingDowngradeChanceRank4();
return advancedConfig.getArcaneForgingDowngradeChanceRank4();
case 3:
return configInstance.getArcaneForgingDowngradeChanceRank3();
return advancedConfig.getArcaneForgingDowngradeChanceRank3();
case 2:
return configInstance.getArcaneForgingDowngradeChanceRank2();
return advancedConfig.getArcaneForgingDowngradeChanceRank2();
case 1:
return configInstance.getArcaneForgingDowngradeChanceRank1();
return advancedConfig.getArcaneForgingDowngradeChanceRank1();
default:
return 100;

View File

@ -10,7 +10,6 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerRepairCheckEvent;
@ -139,7 +138,7 @@ public class SimpleRepairManager implements RepairManager {
}
// Handle the enchants
if (Config.getInstance().getArcaneForgingEnchantLossEnabled() && !Permissions.arcaneBypass(player)) {
if (Repair.advancedConfig.getArcaneForgingEnchantLossEnabled() && !Permissions.arcaneBypass(player)) {
// Generalize away enchantment work
Repair.addEnchants(player, item);
}

View File

@ -96,6 +96,20 @@ Skills:
Fishing:
# Shake_UnlockLevel: Fishing level when the Shake ability unlocks
Shake_UnlockLevel: 150
Shake_Chance:
Rank_1: 25
Rank_2: 40
Rank_3: 55
Rank_4: 60
Rank_5: 75
# Tiers
Tier_Levels:
Tier1: 0
Tier2: 200
Tier3: 400
Tier4: 600
Tier5: 800
# MagicHunter_Multiplier: Determines the chance of fishing enchanted items. The chance is calculated by getting the fishing TreasureHunt tier and multiplying it with MagicHunter_Multiplier
MagicHunter_Multiplier: 5
@ -148,6 +162,27 @@ Skills:
# SuperRepair_MaxBonusLevel: On this level, Super Repair chance will be SuperRepair_ChanceMax
SuperRepair_ChanceMax: 100
SuperRepair_MaxBonusLevel: 1000
Arcane_Forging:
May_Lose_Enchants: true
Rank_Levels:
Rank_1: 100
Rank_2: 250
Rank_3: 500
Rank_4: 750
Keep_Enchants:
Chance:
Rank_4: 40
Rank_3: 30
Rank_2: 20
Rank_1: 10
Downgrades:
Enabled: true
Chance:
Rank_4: 15
Rank_3: 25
Rank_2: 50
Rank_1: 75
#
# Settings for Swords
###

View File

@ -57,50 +57,6 @@ Items:
Feather_Cost: 10
Item_ID: 288
#
# Settings for Arcane Forging
###
Arcane_Forging:
May_Lose_Enchants: true
Rank_Levels:
Rank_1: 100
Rank_2: 250
Rank_3: 500
Rank_4: 750
Keep_Enchants:
Chance:
Rank_4: 40
Rank_3: 30
Rank_2: 20
Rank_1: 10
Downgrades:
Enabled: true
Chance:
Rank_4: 15
Rank_3: 25
Rank_2: 50
Rank_1: 75
#
# Settings for Fishing
###
Fishing:
Drops_Enabled: true
Tier_Levels:
Tier1: 0
Tier2: 200
Tier3: 400
Tier4: 600
Tier5: 800
Shake:
Chance:
Rank_1: 25
Rank_2: 40
Rank_3: 55
Rank_4: 60
Rank_5: 75
#
# Settings for Abilities
###
@ -155,6 +111,7 @@ Skills:
Level_Cap: 0
Requires_Shovel: true
Fishing:
Drops_Enabled: true
Level_Cap: 0
Herbalism:
Level_Cap: 0