mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 16:29:39 +00:00
Attribute Configs
This commit is contained in:
1 parent
78c4aed595
commit
20e3cdd1f0
2 files changed
+12
-1
No files matched your search
@@ -164,7 +164,7 @@ public class AttributeAttackUtil {
|
||||
float critChance = tracker.getAttributeValue(CustomAttributes.CRITICAL_CHANCE);
|
||||
float critBonus = tracker.getAttributeValue(CustomAttributes.CRITICAL_DAMAGE);
|
||||
if (random.nextFloat() < (critChance / 100))
|
||||
damage = (damage * 2) + critBonus;
|
||||
damage = (damage * (1 + (float) ConfigMain.AttributesCriticalBoost / 100)) + critBonus;
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigMain
|
||||
@@ -87,6 +88,7 @@ public class ConfigMain
|
||||
* Attribute Properties
|
||||
**/
|
||||
public static boolean AttributesEnabled = true;
|
||||
public static int AttributesCriticalBoost = 100;
|
||||
|
||||
/**
|
||||
* Profile Properties
|
||||
@@ -101,6 +103,7 @@ public class ConfigMain
|
||||
public static Property RestrictedProfileRegionsProperty;
|
||||
public static List<List<Integer>> RestrictedProfileRegions = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
* General NPC Properties
|
||||
**/
|
||||
@@ -261,6 +264,14 @@ public class ConfigMain
|
||||
RestrictedProfileRegions.add(regionList);
|
||||
}
|
||||
|
||||
config.setCategoryPropertyOrder(ATTRIBUTES, new ArrayList<>(Arrays.asList(new String[]{
|
||||
"Enable Attributes",
|
||||
"Critical Amount"
|
||||
})));
|
||||
// Attributes
|
||||
AttributesEnabled = config.get(ATTRIBUTES, "Enable Attributes", true, "Allows Attributes to be applied to Items and Armors").getBoolean(true);
|
||||
AttributesCriticalBoost = config.get(ATTRIBUTES, "Critical Amount", 100, "The boost in damage received by achieving a critical hit. Takes an number so 100 is 100% extra damage").getInt(100);
|
||||
|
||||
// Convert to Legacy
|
||||
if(CustomNpcs.legacyExist){
|
||||
EnableUpdateChecker = LegacyConfig.EnableUpdateChecker;
|
||||
|
||||
Reference in new issue
Block a user