diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java index 08a93fdeb1062375d554e72db3f72a9525dd87e6..e664338ade1df8ba7dfc1aaf0fe1359f437ed2b1 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java @@ -38,7 +38,7 @@ public class AttackTrait extends L2Effect { private static final Logger _log = Logger.getLogger(AttackTrait.class.getName()); - private final Map<TraitType, Integer> _attackTraits = new HashMap<>(); + private final Map<TraitType, Float> _attackTraits = new HashMap<>(); /** * @param env @@ -54,12 +54,12 @@ public class AttackTrait extends L2Effect try { final TraitType traitType = TraitType.valueOf(param.getKey()); - final int value = Integer.parseInt((String) param.getValue()); + final float value = (Float.parseFloat((String) param.getValue()) + 100) / 100; _attackTraits.put(traitType, value); } catch (NumberFormatException e) { - _log.warning(getClass().getSimpleName() + ": value of " + param.getKey() + " enum must be int value " + param.getValue() + " found."); + _log.warning(getClass().getSimpleName() + ": value of " + param.getKey() + " must be float value " + param.getValue() + " found."); } catch (Exception e) { @@ -85,14 +85,9 @@ public class AttackTrait extends L2Effect final CharStat charStat = getEffected().getStat(); synchronized (charStat.getAttackTraits()) { - for (Entry<TraitType, Integer> trait : _attackTraits.entrySet()) + for (Entry<TraitType, Float> trait : _attackTraits.entrySet()) { - if (trait.getValue() == 0) - { - continue; - } - - charStat.getAttackTraits()[trait.getKey().getId()] *= (trait.getValue() + 100) / 100f; + charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue(); charStat.getAttackTraitsCount()[trait.getKey().getId()]++; } } @@ -105,14 +100,9 @@ public class AttackTrait extends L2Effect final CharStat charStat = getEffected().getStat(); synchronized (charStat.getAttackTraits()) { - for (Entry<TraitType, Integer> trait : _attackTraits.entrySet()) + for (Entry<TraitType, Float> trait : _attackTraits.entrySet()) { - if (trait.getValue() == 0) - { - continue; - } - - charStat.getAttackTraits()[trait.getKey().getId()] /= (trait.getValue() + 100) / 100f; + charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue(); charStat.getAttackTraitsCount()[trait.getKey().getId()]--; } } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java index 190a6bd663bb589afd9f19400f1f66875d99e4e2..3dc49459c6ec1b2bd6487b0a31a502e902610b36 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java @@ -38,7 +38,7 @@ public class DefenceTrait extends L2Effect { private static final Logger _log = Logger.getLogger(DefenceTrait.class.getName()); - private final Map<TraitType, Integer> _defenceTraits = new HashMap<>(); + private final Map<TraitType, Float> _defenceTraits = new HashMap<>(); /** * @param env @@ -54,12 +54,16 @@ public class DefenceTrait extends L2Effect try { final TraitType traitType = TraitType.valueOf(param.getKey()); - final int value = Integer.parseInt((String) param.getValue()); - _defenceTraits.put(traitType, value); + final float value = Float.parseFloat((String) param.getValue()); + if (value == 0) + { + continue; + } + _defenceTraits.put(traitType, (value + 100) / 100); } catch (NumberFormatException e) { - _log.warning(getClass().getSimpleName() + ": value of " + param.getKey() + " enum must be int value " + param.getValue() + " found."); + _log.warning(getClass().getSimpleName() + ": value of " + param.getKey() + " must be float value " + param.getValue() + " found."); } catch (Exception e) { @@ -85,15 +89,11 @@ public class DefenceTrait extends L2Effect final CharStat charStat = getEffected().getStat(); synchronized (charStat.getDefenceTraits()) { - for (Entry<TraitType, Integer> trait : _defenceTraits.entrySet()) + for (Entry<TraitType, Float> trait : _defenceTraits.entrySet()) { - if (trait.getValue() == 0) + if (trait.getValue() < 2.0f) { - continue; - } - else if (trait.getValue() < 100) - { - charStat.getDefenceTraits()[trait.getKey().getId()] *= (trait.getValue() + 100) / 100f; + charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue(); charStat.getDefenceTraitsCount()[trait.getKey().getId()]++; } else @@ -111,15 +111,11 @@ public class DefenceTrait extends L2Effect final CharStat charStat = getEffected().getStat(); synchronized (charStat.getDefenceTraits()) { - for (Entry<TraitType, Integer> trait : _defenceTraits.entrySet()) + for (Entry<TraitType, Float> trait : _defenceTraits.entrySet()) { - if (trait.getValue() == 0) - { - continue; - } - else if (trait.getValue() < 100) + if (trait.getValue() < 2.0f) { - charStat.getDefenceTraits()[trait.getKey().getId()] /= (trait.getValue() + 100) / 100f; + charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue(); charStat.getDefenceTraitsCount()[trait.getKey().getId()]--; } else