Replaced Trait id with ordinal.
This commit is contained in:
@@ -57,8 +57,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]++;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -76,12 +76,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]--;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,12 +97,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]++;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]++;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -585,7 +585,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getAttackTrait(TraitType traitType)
|
public float getAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraits[traitType.getId()];
|
return _attackTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getAttackTraits()
|
public float[] getAttackTraits()
|
||||||
@@ -595,7 +595,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasAttackTrait(TraitType traitType)
|
public boolean hasAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraitsCount[traitType.getId()] > 0;
|
return _attackTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getAttackTraitsCount()
|
public int[] getAttackTraitsCount()
|
||||||
@@ -605,7 +605,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getDefenceTrait(TraitType traitType)
|
public float getDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraits[traitType.getId()];
|
return _defenceTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getDefenceTraits()
|
public float[] getDefenceTraits()
|
||||||
@@ -615,7 +615,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasDefenceTrait(TraitType traitType)
|
public boolean hasDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraitsCount[traitType.getId()] > 0;
|
return _defenceTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getDefenceTraitsCount()
|
public int[] getDefenceTraitsCount()
|
||||||
@@ -625,7 +625,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean isTraitInvul(TraitType traitType)
|
public boolean isTraitInvul(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _traitsInvul[traitType.getId()] > 0;
|
return _traitsInvul[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTraitsInvul()
|
public int[] getTraitsInvul()
|
||||||
|
@@ -21,76 +21,69 @@ package com.l2jmobius.gameserver.model.stats;
|
|||||||
*/
|
*/
|
||||||
public enum TraitType
|
public enum TraitType
|
||||||
{
|
{
|
||||||
NONE(0, 0),
|
NONE(0),
|
||||||
SWORD(1, 1),
|
SWORD(1),
|
||||||
BLUNT(2, 1),
|
BLUNT(1),
|
||||||
DAGGER(3, 1),
|
DAGGER(1),
|
||||||
POLE(4, 1),
|
POLE(1),
|
||||||
FIST(5, 1),
|
FIST(1),
|
||||||
BOW(6, 1),
|
BOW(1),
|
||||||
ETC(7, 1),
|
ETC(1),
|
||||||
UNK_8(8, 0),
|
UNK_8(0),
|
||||||
POISON(9, 3),
|
POISON(3),
|
||||||
HOLD(10, 3),
|
HOLD(3),
|
||||||
BLEED(11, 3),
|
BLEED(3),
|
||||||
SLEEP(12, 3),
|
SLEEP(3),
|
||||||
SHOCK(13, 3),
|
SHOCK(3),
|
||||||
DERANGEMENT(14, 3),
|
DERANGEMENT(3),
|
||||||
BUG_WEAKNESS(15, 2),
|
BUG_WEAKNESS(2),
|
||||||
ANIMAL_WEAKNESS(16, 2),
|
ANIMAL_WEAKNESS(2),
|
||||||
PLANT_WEAKNESS(17, 2),
|
PLANT_WEAKNESS(2),
|
||||||
BEAST_WEAKNESS(18, 2),
|
BEAST_WEAKNESS(2),
|
||||||
DRAGON_WEAKNESS(19, 2),
|
DRAGON_WEAKNESS(2),
|
||||||
PARALYZE(20, 3),
|
PARALYZE(3),
|
||||||
DUAL(21, 1),
|
DUAL(1),
|
||||||
DUALFIST(22, 1),
|
DUALFIST(1),
|
||||||
BOSS(23, 3),
|
BOSS(3),
|
||||||
GIANT_WEAKNESS(24, 2),
|
GIANT_WEAKNESS(2),
|
||||||
CONSTRUCT_WEAKNESS(25, 2),
|
CONSTRUCT_WEAKNESS(2),
|
||||||
DEATH(26, 3),
|
DEATH(3),
|
||||||
VALAKAS(27, 2),
|
VALAKAS(2),
|
||||||
ANESTHESIA(28, 2),
|
ANESTHESIA(2),
|
||||||
CRITICAL_POISON(29, 3),
|
CRITICAL_POISON(3),
|
||||||
ROOT_PHYSICALLY(30, 3),
|
ROOT_PHYSICALLY(3),
|
||||||
ROOT_MAGICALLY(31, 3),
|
ROOT_MAGICALLY(3),
|
||||||
RAPIER(32, 1),
|
RAPIER(1),
|
||||||
CROSSBOW(33, 1),
|
CROSSBOW(1),
|
||||||
ANCIENTSWORD(34, 1),
|
ANCIENTSWORD(1),
|
||||||
TURN_STONE(35, 3),
|
TURN_STONE(3),
|
||||||
GUST(36, 3),
|
GUST(3),
|
||||||
PHYSICAL_BLOCKADE(37, 3),
|
PHYSICAL_BLOCKADE(3),
|
||||||
TARGET(38, 3),
|
TARGET(3),
|
||||||
PHYSICAL_WEAKNESS(39, 3),
|
PHYSICAL_WEAKNESS(3),
|
||||||
MAGICAL_WEAKNESS(40, 3),
|
MAGICAL_WEAKNESS(3),
|
||||||
DUALDAGGER(41, 1),
|
DUALDAGGER(1),
|
||||||
DUALBLUNT(42, 1),
|
DUALBLUNT(1),
|
||||||
KNOCKBACK(43, 3),
|
KNOCKBACK(3),
|
||||||
KNOCKDOWN(44, 3),
|
KNOCKDOWN(3),
|
||||||
PULL(45, 3),
|
PULL(3),
|
||||||
HATE(46, 3),
|
HATE(3),
|
||||||
AGGRESSION(47, 3),
|
AGGRESSION(3),
|
||||||
AIRBIND(48, 3),
|
AIRBIND(3),
|
||||||
DISARM(49, 3),
|
DISARM(3),
|
||||||
DEPORT(50, 3),
|
DEPORT(3),
|
||||||
CHANGEBODY(51, 3),
|
CHANGEBODY(3),
|
||||||
TWOHANDCROSSBOW(52, 1),
|
TWOHANDCROSSBOW(1),
|
||||||
ZONE(53, 3),
|
ZONE(3),
|
||||||
PSYCHIC(54, 3);
|
PSYCHIC(3);
|
||||||
|
|
||||||
private final int _id;
|
|
||||||
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
||||||
|
|
||||||
TraitType(int id, int type)
|
TraitType(int type)
|
||||||
{
|
{
|
||||||
_id = id;
|
|
||||||
_type = type;
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return _id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
{
|
{
|
||||||
return _type;
|
return _type;
|
||||||
|
@@ -57,8 +57,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]++;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -76,12 +76,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]--;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,12 +97,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]++;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]++;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -585,7 +585,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getAttackTrait(TraitType traitType)
|
public float getAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraits[traitType.getId()];
|
return _attackTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getAttackTraits()
|
public float[] getAttackTraits()
|
||||||
@@ -595,7 +595,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasAttackTrait(TraitType traitType)
|
public boolean hasAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraitsCount[traitType.getId()] > 0;
|
return _attackTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getAttackTraitsCount()
|
public int[] getAttackTraitsCount()
|
||||||
@@ -605,7 +605,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getDefenceTrait(TraitType traitType)
|
public float getDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraits[traitType.getId()];
|
return _defenceTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getDefenceTraits()
|
public float[] getDefenceTraits()
|
||||||
@@ -615,7 +615,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasDefenceTrait(TraitType traitType)
|
public boolean hasDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraitsCount[traitType.getId()] > 0;
|
return _defenceTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getDefenceTraitsCount()
|
public int[] getDefenceTraitsCount()
|
||||||
@@ -625,7 +625,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean isTraitInvul(TraitType traitType)
|
public boolean isTraitInvul(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _traitsInvul[traitType.getId()] > 0;
|
return _traitsInvul[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTraitsInvul()
|
public int[] getTraitsInvul()
|
||||||
|
@@ -21,76 +21,69 @@ package com.l2jmobius.gameserver.model.stats;
|
|||||||
*/
|
*/
|
||||||
public enum TraitType
|
public enum TraitType
|
||||||
{
|
{
|
||||||
NONE(0, 0),
|
NONE(0),
|
||||||
SWORD(1, 1),
|
SWORD(1),
|
||||||
BLUNT(2, 1),
|
BLUNT(1),
|
||||||
DAGGER(3, 1),
|
DAGGER(1),
|
||||||
POLE(4, 1),
|
POLE(1),
|
||||||
FIST(5, 1),
|
FIST(1),
|
||||||
BOW(6, 1),
|
BOW(1),
|
||||||
ETC(7, 1),
|
ETC(1),
|
||||||
UNK_8(8, 0),
|
UNK_8(0),
|
||||||
POISON(9, 3),
|
POISON(3),
|
||||||
HOLD(10, 3),
|
HOLD(3),
|
||||||
BLEED(11, 3),
|
BLEED(3),
|
||||||
SLEEP(12, 3),
|
SLEEP(3),
|
||||||
SHOCK(13, 3),
|
SHOCK(3),
|
||||||
DERANGEMENT(14, 3),
|
DERANGEMENT(3),
|
||||||
BUG_WEAKNESS(15, 2),
|
BUG_WEAKNESS(2),
|
||||||
ANIMAL_WEAKNESS(16, 2),
|
ANIMAL_WEAKNESS(2),
|
||||||
PLANT_WEAKNESS(17, 2),
|
PLANT_WEAKNESS(2),
|
||||||
BEAST_WEAKNESS(18, 2),
|
BEAST_WEAKNESS(2),
|
||||||
DRAGON_WEAKNESS(19, 2),
|
DRAGON_WEAKNESS(2),
|
||||||
PARALYZE(20, 3),
|
PARALYZE(3),
|
||||||
DUAL(21, 1),
|
DUAL(1),
|
||||||
DUALFIST(22, 1),
|
DUALFIST(1),
|
||||||
BOSS(23, 3),
|
BOSS(3),
|
||||||
GIANT_WEAKNESS(24, 2),
|
GIANT_WEAKNESS(2),
|
||||||
CONSTRUCT_WEAKNESS(25, 2),
|
CONSTRUCT_WEAKNESS(2),
|
||||||
DEATH(26, 3),
|
DEATH(3),
|
||||||
VALAKAS(27, 2),
|
VALAKAS(2),
|
||||||
ANESTHESIA(28, 2),
|
ANESTHESIA(2),
|
||||||
CRITICAL_POISON(29, 3),
|
CRITICAL_POISON(3),
|
||||||
ROOT_PHYSICALLY(30, 3),
|
ROOT_PHYSICALLY(3),
|
||||||
ROOT_MAGICALLY(31, 3),
|
ROOT_MAGICALLY(3),
|
||||||
RAPIER(32, 1),
|
RAPIER(1),
|
||||||
CROSSBOW(33, 1),
|
CROSSBOW(1),
|
||||||
ANCIENTSWORD(34, 1),
|
ANCIENTSWORD(1),
|
||||||
TURN_STONE(35, 3),
|
TURN_STONE(3),
|
||||||
GUST(36, 3),
|
GUST(3),
|
||||||
PHYSICAL_BLOCKADE(37, 3),
|
PHYSICAL_BLOCKADE(3),
|
||||||
TARGET(38, 3),
|
TARGET(3),
|
||||||
PHYSICAL_WEAKNESS(39, 3),
|
PHYSICAL_WEAKNESS(3),
|
||||||
MAGICAL_WEAKNESS(40, 3),
|
MAGICAL_WEAKNESS(3),
|
||||||
DUALDAGGER(41, 1),
|
DUALDAGGER(1),
|
||||||
DUALBLUNT(42, 1),
|
DUALBLUNT(1),
|
||||||
KNOCKBACK(43, 3),
|
KNOCKBACK(3),
|
||||||
KNOCKDOWN(44, 3),
|
KNOCKDOWN(3),
|
||||||
PULL(45, 3),
|
PULL(3),
|
||||||
HATE(46, 3),
|
HATE(3),
|
||||||
AGGRESSION(47, 3),
|
AGGRESSION(3),
|
||||||
AIRBIND(48, 3),
|
AIRBIND(3),
|
||||||
DISARM(49, 3),
|
DISARM(3),
|
||||||
DEPORT(50, 3),
|
DEPORT(3),
|
||||||
CHANGEBODY(51, 3),
|
CHANGEBODY(3),
|
||||||
TWOHANDCROSSBOW(52, 1),
|
TWOHANDCROSSBOW(1),
|
||||||
ZONE(53, 3),
|
ZONE(3),
|
||||||
PSYCHIC(54, 3);
|
PSYCHIC(3);
|
||||||
|
|
||||||
private final int _id;
|
|
||||||
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
||||||
|
|
||||||
TraitType(int id, int type)
|
TraitType(int type)
|
||||||
{
|
{
|
||||||
_id = id;
|
|
||||||
_type = type;
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return _id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
{
|
{
|
||||||
return _type;
|
return _type;
|
||||||
|
@@ -57,8 +57,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]++;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -76,12 +76,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]--;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,12 +97,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]++;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]++;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -585,7 +585,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getAttackTrait(TraitType traitType)
|
public float getAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraits[traitType.getId()];
|
return _attackTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getAttackTraits()
|
public float[] getAttackTraits()
|
||||||
@@ -595,7 +595,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasAttackTrait(TraitType traitType)
|
public boolean hasAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraitsCount[traitType.getId()] > 0;
|
return _attackTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getAttackTraitsCount()
|
public int[] getAttackTraitsCount()
|
||||||
@@ -605,7 +605,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getDefenceTrait(TraitType traitType)
|
public float getDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraits[traitType.getId()];
|
return _defenceTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getDefenceTraits()
|
public float[] getDefenceTraits()
|
||||||
@@ -615,7 +615,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasDefenceTrait(TraitType traitType)
|
public boolean hasDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraitsCount[traitType.getId()] > 0;
|
return _defenceTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getDefenceTraitsCount()
|
public int[] getDefenceTraitsCount()
|
||||||
@@ -625,7 +625,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean isTraitInvul(TraitType traitType)
|
public boolean isTraitInvul(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _traitsInvul[traitType.getId()] > 0;
|
return _traitsInvul[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTraitsInvul()
|
public int[] getTraitsInvul()
|
||||||
|
@@ -21,76 +21,69 @@ package com.l2jmobius.gameserver.model.stats;
|
|||||||
*/
|
*/
|
||||||
public enum TraitType
|
public enum TraitType
|
||||||
{
|
{
|
||||||
NONE(0, 0),
|
NONE(0),
|
||||||
SWORD(1, 1),
|
SWORD(1),
|
||||||
BLUNT(2, 1),
|
BLUNT(1),
|
||||||
DAGGER(3, 1),
|
DAGGER(1),
|
||||||
POLE(4, 1),
|
POLE(1),
|
||||||
FIST(5, 1),
|
FIST(1),
|
||||||
BOW(6, 1),
|
BOW(1),
|
||||||
ETC(7, 1),
|
ETC(1),
|
||||||
UNK_8(8, 0),
|
UNK_8(0),
|
||||||
POISON(9, 3),
|
POISON(3),
|
||||||
HOLD(10, 3),
|
HOLD(3),
|
||||||
BLEED(11, 3),
|
BLEED(3),
|
||||||
SLEEP(12, 3),
|
SLEEP(3),
|
||||||
SHOCK(13, 3),
|
SHOCK(3),
|
||||||
DERANGEMENT(14, 3),
|
DERANGEMENT(3),
|
||||||
BUG_WEAKNESS(15, 2),
|
BUG_WEAKNESS(2),
|
||||||
ANIMAL_WEAKNESS(16, 2),
|
ANIMAL_WEAKNESS(2),
|
||||||
PLANT_WEAKNESS(17, 2),
|
PLANT_WEAKNESS(2),
|
||||||
BEAST_WEAKNESS(18, 2),
|
BEAST_WEAKNESS(2),
|
||||||
DRAGON_WEAKNESS(19, 2),
|
DRAGON_WEAKNESS(2),
|
||||||
PARALYZE(20, 3),
|
PARALYZE(3),
|
||||||
DUAL(21, 1),
|
DUAL(1),
|
||||||
DUALFIST(22, 1),
|
DUALFIST(1),
|
||||||
BOSS(23, 3),
|
BOSS(3),
|
||||||
GIANT_WEAKNESS(24, 2),
|
GIANT_WEAKNESS(2),
|
||||||
CONSTRUCT_WEAKNESS(25, 2),
|
CONSTRUCT_WEAKNESS(2),
|
||||||
DEATH(26, 3),
|
DEATH(3),
|
||||||
VALAKAS(27, 2),
|
VALAKAS(2),
|
||||||
ANESTHESIA(28, 2),
|
ANESTHESIA(2),
|
||||||
CRITICAL_POISON(29, 3),
|
CRITICAL_POISON(3),
|
||||||
ROOT_PHYSICALLY(30, 3),
|
ROOT_PHYSICALLY(3),
|
||||||
ROOT_MAGICALLY(31, 3),
|
ROOT_MAGICALLY(3),
|
||||||
RAPIER(32, 1),
|
RAPIER(1),
|
||||||
CROSSBOW(33, 1),
|
CROSSBOW(1),
|
||||||
ANCIENTSWORD(34, 1),
|
ANCIENTSWORD(1),
|
||||||
TURN_STONE(35, 3),
|
TURN_STONE(3),
|
||||||
GUST(36, 3),
|
GUST(3),
|
||||||
PHYSICAL_BLOCKADE(37, 3),
|
PHYSICAL_BLOCKADE(3),
|
||||||
TARGET(38, 3),
|
TARGET(3),
|
||||||
PHYSICAL_WEAKNESS(39, 3),
|
PHYSICAL_WEAKNESS(3),
|
||||||
MAGICAL_WEAKNESS(40, 3),
|
MAGICAL_WEAKNESS(3),
|
||||||
DUALDAGGER(41, 1),
|
DUALDAGGER(1),
|
||||||
DUALBLUNT(42, 1),
|
DUALBLUNT(1),
|
||||||
KNOCKBACK(43, 3),
|
KNOCKBACK(3),
|
||||||
KNOCKDOWN(44, 3),
|
KNOCKDOWN(3),
|
||||||
PULL(45, 3),
|
PULL(3),
|
||||||
HATE(46, 3),
|
HATE(3),
|
||||||
AGGRESSION(47, 3),
|
AGGRESSION(3),
|
||||||
AIRBIND(48, 3),
|
AIRBIND(3),
|
||||||
DISARM(49, 3),
|
DISARM(3),
|
||||||
DEPORT(50, 3),
|
DEPORT(3),
|
||||||
CHANGEBODY(51, 3),
|
CHANGEBODY(3),
|
||||||
TWOHANDCROSSBOW(52, 1),
|
TWOHANDCROSSBOW(1),
|
||||||
ZONE(53, 3),
|
ZONE(3),
|
||||||
PSYCHIC(54, 3);
|
PSYCHIC(3);
|
||||||
|
|
||||||
private final int _id;
|
|
||||||
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
||||||
|
|
||||||
TraitType(int id, int type)
|
TraitType(int type)
|
||||||
{
|
{
|
||||||
_id = id;
|
|
||||||
_type = type;
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return _id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
{
|
{
|
||||||
return _type;
|
return _type;
|
||||||
|
@@ -57,8 +57,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]++;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -76,12 +76,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]--;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,12 +97,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]++;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]++;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -585,7 +585,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getAttackTrait(TraitType traitType)
|
public float getAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraits[traitType.getId()];
|
return _attackTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getAttackTraits()
|
public float[] getAttackTraits()
|
||||||
@@ -595,7 +595,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasAttackTrait(TraitType traitType)
|
public boolean hasAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraitsCount[traitType.getId()] > 0;
|
return _attackTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getAttackTraitsCount()
|
public int[] getAttackTraitsCount()
|
||||||
@@ -605,7 +605,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getDefenceTrait(TraitType traitType)
|
public float getDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraits[traitType.getId()];
|
return _defenceTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getDefenceTraits()
|
public float[] getDefenceTraits()
|
||||||
@@ -615,7 +615,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasDefenceTrait(TraitType traitType)
|
public boolean hasDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraitsCount[traitType.getId()] > 0;
|
return _defenceTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getDefenceTraitsCount()
|
public int[] getDefenceTraitsCount()
|
||||||
@@ -625,7 +625,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean isTraitInvul(TraitType traitType)
|
public boolean isTraitInvul(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _traitsInvul[traitType.getId()] > 0;
|
return _traitsInvul[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTraitsInvul()
|
public int[] getTraitsInvul()
|
||||||
|
@@ -21,76 +21,69 @@ package com.l2jmobius.gameserver.model.stats;
|
|||||||
*/
|
*/
|
||||||
public enum TraitType
|
public enum TraitType
|
||||||
{
|
{
|
||||||
NONE(0, 0),
|
NONE(0),
|
||||||
SWORD(1, 1),
|
SWORD(1),
|
||||||
BLUNT(2, 1),
|
BLUNT(1),
|
||||||
DAGGER(3, 1),
|
DAGGER(1),
|
||||||
POLE(4, 1),
|
POLE(1),
|
||||||
FIST(5, 1),
|
FIST(1),
|
||||||
BOW(6, 1),
|
BOW(1),
|
||||||
ETC(7, 1),
|
ETC(1),
|
||||||
UNK_8(8, 0),
|
UNK_8(0),
|
||||||
POISON(9, 3),
|
POISON(3),
|
||||||
HOLD(10, 3),
|
HOLD(3),
|
||||||
BLEED(11, 3),
|
BLEED(3),
|
||||||
SLEEP(12, 3),
|
SLEEP(3),
|
||||||
SHOCK(13, 3),
|
SHOCK(3),
|
||||||
DERANGEMENT(14, 3),
|
DERANGEMENT(3),
|
||||||
BUG_WEAKNESS(15, 2),
|
BUG_WEAKNESS(2),
|
||||||
ANIMAL_WEAKNESS(16, 2),
|
ANIMAL_WEAKNESS(2),
|
||||||
PLANT_WEAKNESS(17, 2),
|
PLANT_WEAKNESS(2),
|
||||||
BEAST_WEAKNESS(18, 2),
|
BEAST_WEAKNESS(2),
|
||||||
DRAGON_WEAKNESS(19, 2),
|
DRAGON_WEAKNESS(2),
|
||||||
PARALYZE(20, 3),
|
PARALYZE(3),
|
||||||
DUAL(21, 1),
|
DUAL(1),
|
||||||
DUALFIST(22, 1),
|
DUALFIST(1),
|
||||||
BOSS(23, 3),
|
BOSS(3),
|
||||||
GIANT_WEAKNESS(24, 2),
|
GIANT_WEAKNESS(2),
|
||||||
CONSTRUCT_WEAKNESS(25, 2),
|
CONSTRUCT_WEAKNESS(2),
|
||||||
DEATH(26, 3),
|
DEATH(3),
|
||||||
VALAKAS(27, 2),
|
VALAKAS(2),
|
||||||
ANESTHESIA(28, 2),
|
ANESTHESIA(2),
|
||||||
CRITICAL_POISON(29, 3),
|
CRITICAL_POISON(3),
|
||||||
ROOT_PHYSICALLY(30, 3),
|
ROOT_PHYSICALLY(3),
|
||||||
ROOT_MAGICALLY(31, 3),
|
ROOT_MAGICALLY(3),
|
||||||
RAPIER(32, 1),
|
RAPIER(1),
|
||||||
CROSSBOW(33, 1),
|
CROSSBOW(1),
|
||||||
ANCIENTSWORD(34, 1),
|
ANCIENTSWORD(1),
|
||||||
TURN_STONE(35, 3),
|
TURN_STONE(3),
|
||||||
GUST(36, 3),
|
GUST(3),
|
||||||
PHYSICAL_BLOCKADE(37, 3),
|
PHYSICAL_BLOCKADE(3),
|
||||||
TARGET(38, 3),
|
TARGET(3),
|
||||||
PHYSICAL_WEAKNESS(39, 3),
|
PHYSICAL_WEAKNESS(3),
|
||||||
MAGICAL_WEAKNESS(40, 3),
|
MAGICAL_WEAKNESS(3),
|
||||||
DUALDAGGER(41, 1),
|
DUALDAGGER(1),
|
||||||
DUALBLUNT(42, 1),
|
DUALBLUNT(1),
|
||||||
KNOCKBACK(43, 3),
|
KNOCKBACK(3),
|
||||||
KNOCKDOWN(44, 3),
|
KNOCKDOWN(3),
|
||||||
PULL(45, 3),
|
PULL(3),
|
||||||
HATE(46, 3),
|
HATE(3),
|
||||||
AGGRESSION(47, 3),
|
AGGRESSION(3),
|
||||||
AIRBIND(48, 3),
|
AIRBIND(3),
|
||||||
DISARM(49, 3),
|
DISARM(3),
|
||||||
DEPORT(50, 3),
|
DEPORT(3),
|
||||||
CHANGEBODY(51, 3),
|
CHANGEBODY(3),
|
||||||
TWOHANDCROSSBOW(52, 1),
|
TWOHANDCROSSBOW(1),
|
||||||
ZONE(53, 3),
|
ZONE(3),
|
||||||
PSYCHIC(54, 3);
|
PSYCHIC(3);
|
||||||
|
|
||||||
private final int _id;
|
|
||||||
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
||||||
|
|
||||||
TraitType(int id, int type)
|
TraitType(int type)
|
||||||
{
|
{
|
||||||
_id = id;
|
|
||||||
_type = type;
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return _id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
{
|
{
|
||||||
return _type;
|
return _type;
|
||||||
|
@@ -59,8 +59,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,8 +73,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]++;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -78,12 +78,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]--;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,12 +99,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]++;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]++;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -759,7 +759,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getAttackTrait(TraitType traitType)
|
public float getAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraits[traitType.getId()];
|
return _attackTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getAttackTraits()
|
public float[] getAttackTraits()
|
||||||
@@ -769,7 +769,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasAttackTrait(TraitType traitType)
|
public boolean hasAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraitsCount[traitType.getId()] > 0;
|
return _attackTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getAttackTraitsCount()
|
public int[] getAttackTraitsCount()
|
||||||
@@ -779,7 +779,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getDefenceTrait(TraitType traitType)
|
public float getDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraits[traitType.getId()];
|
return _defenceTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getDefenceTraits()
|
public float[] getDefenceTraits()
|
||||||
@@ -789,7 +789,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasDefenceTrait(TraitType traitType)
|
public boolean hasDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraitsCount[traitType.getId()] > 0;
|
return _defenceTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getDefenceTraitsCount()
|
public int[] getDefenceTraitsCount()
|
||||||
@@ -799,7 +799,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean isTraitInvul(TraitType traitType)
|
public boolean isTraitInvul(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _traitsInvul[traitType.getId()] > 0;
|
return _traitsInvul[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTraitsInvul()
|
public int[] getTraitsInvul()
|
||||||
|
@@ -2107,7 +2107,7 @@ public final class Formulas
|
|||||||
public static double calcWeaponTraitBonus(L2Character attacker, L2Character target)
|
public static double calcWeaponTraitBonus(L2Character attacker, L2Character target)
|
||||||
{
|
{
|
||||||
final TraitType type = attacker.getAttackType().getTraitType();
|
final TraitType type = attacker.getAttackType().getTraitType();
|
||||||
final double result = target.getStat().getDefenceTraits()[type.getId()] - 1.0;
|
final double result = target.getStat().getDefenceTraits()[type.ordinal()] - 1.0;
|
||||||
return 1.0 - result;
|
return 1.0 - result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,63 +21,56 @@ package com.l2jmobius.gameserver.model.stats;
|
|||||||
*/
|
*/
|
||||||
public enum TraitType
|
public enum TraitType
|
||||||
{
|
{
|
||||||
NONE(0, 0),
|
NONE(0),
|
||||||
SWORD(1, 1),
|
SWORD(1),
|
||||||
BLUNT(2, 1),
|
BLUNT(1),
|
||||||
DAGGER(3, 1),
|
DAGGER(1),
|
||||||
POLE(4, 1),
|
POLE(1),
|
||||||
FIST(5, 1),
|
FIST(1),
|
||||||
BOW(6, 1),
|
BOW(1),
|
||||||
ETC(7, 1),
|
ETC(1),
|
||||||
UNK_8(8, 0),
|
UNK_8(0),
|
||||||
POISON(9, 3),
|
POISON(3),
|
||||||
HOLD(10, 3),
|
HOLD(3),
|
||||||
BLEED(11, 3),
|
BLEED(3),
|
||||||
SLEEP(12, 3),
|
SLEEP(3),
|
||||||
SHOCK(13, 3),
|
SHOCK(3),
|
||||||
DERANGEMENT(14, 3),
|
DERANGEMENT(3),
|
||||||
BUG_WEAKNESS(15, 2),
|
BUG_WEAKNESS(2),
|
||||||
ANIMAL_WEAKNESS(16, 2),
|
ANIMAL_WEAKNESS(2),
|
||||||
PLANT_WEAKNESS(17, 2),
|
PLANT_WEAKNESS(2),
|
||||||
BEAST_WEAKNESS(18, 2),
|
BEAST_WEAKNESS(2),
|
||||||
DRAGON_WEAKNESS(19, 2),
|
DRAGON_WEAKNESS(2),
|
||||||
PARALYZE(20, 3),
|
PARALYZE(3),
|
||||||
DUAL(21, 1),
|
DUAL(1),
|
||||||
DUALFIST(22, 1),
|
DUALFIST(1),
|
||||||
BOSS(23, 3),
|
BOSS(3),
|
||||||
GIANT_WEAKNESS(24, 2),
|
GIANT_WEAKNESS(2),
|
||||||
CONSTRUCT_WEAKNESS(25, 2),
|
CONSTRUCT_WEAKNESS(2),
|
||||||
DEATH(26, 3),
|
DEATH(3),
|
||||||
VALAKAS(27, 2),
|
VALAKAS(2),
|
||||||
ANESTHESIA(28, 2),
|
ANESTHESIA(2),
|
||||||
CRITICAL_POISON(29, 3),
|
CRITICAL_POISON(3),
|
||||||
ROOT_PHYSICALLY(30, 3),
|
ROOT_PHYSICALLY(3),
|
||||||
ROOT_MAGICALLY(31, 3),
|
ROOT_MAGICALLY(3),
|
||||||
RAPIER(32, 1),
|
RAPIER(1),
|
||||||
CROSSBOW(33, 1),
|
CROSSBOW(1),
|
||||||
ANCIENTSWORD(34, 1),
|
ANCIENTSWORD(1),
|
||||||
TURN_STONE(35, 3),
|
TURN_STONE(3),
|
||||||
GUST(36, 3),
|
GUST(3),
|
||||||
PHYSICAL_BLOCKADE(37, 3),
|
PHYSICAL_BLOCKADE(3),
|
||||||
TARGET(38, 3),
|
TARGET(3),
|
||||||
PHYSICAL_WEAKNESS(39, 3),
|
PHYSICAL_WEAKNESS(3),
|
||||||
MAGICAL_WEAKNESS(40, 3),
|
MAGICAL_WEAKNESS(3),
|
||||||
DUALDAGGER(41, 1);
|
DUALDAGGER(1);
|
||||||
|
|
||||||
private final int _id;
|
|
||||||
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
||||||
|
|
||||||
TraitType(int id, int type)
|
TraitType(int type)
|
||||||
{
|
{
|
||||||
_id = id;
|
|
||||||
_type = type;
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return _id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
{
|
{
|
||||||
return _type;
|
return _type;
|
||||||
|
@@ -57,8 +57,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public final class AttackTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||||
{
|
{
|
||||||
charStat.getAttackTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getAttackTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getAttackTraitsCount()[trait.getKey().getId()]++;
|
charStat.getAttackTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -76,12 +76,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] /= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]--;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,12 +97,12 @@ public final class DefenceTrait extends AbstractEffect
|
|||||||
{
|
{
|
||||||
if (trait.getValue() < 2.0f)
|
if (trait.getValue() < 2.0f)
|
||||||
{
|
{
|
||||||
charStat.getDefenceTraits()[trait.getKey().getId()] *= trait.getValue();
|
charStat.getDefenceTraits()[trait.getKey().ordinal()] *= trait.getValue();
|
||||||
charStat.getDefenceTraitsCount()[trait.getKey().getId()]++;
|
charStat.getDefenceTraitsCount()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
charStat.getTraitsInvul()[trait.getKey().getId()]++;
|
charStat.getTraitsInvul()[trait.getKey().ordinal()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -585,7 +585,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getAttackTrait(TraitType traitType)
|
public float getAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraits[traitType.getId()];
|
return _attackTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getAttackTraits()
|
public float[] getAttackTraits()
|
||||||
@@ -595,7 +595,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasAttackTrait(TraitType traitType)
|
public boolean hasAttackTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _attackTraitsCount[traitType.getId()] > 0;
|
return _attackTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getAttackTraitsCount()
|
public int[] getAttackTraitsCount()
|
||||||
@@ -605,7 +605,7 @@ public class CharStat
|
|||||||
|
|
||||||
public float getDefenceTrait(TraitType traitType)
|
public float getDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraits[traitType.getId()];
|
return _defenceTraits[traitType.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[] getDefenceTraits()
|
public float[] getDefenceTraits()
|
||||||
@@ -615,7 +615,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean hasDefenceTrait(TraitType traitType)
|
public boolean hasDefenceTrait(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _defenceTraitsCount[traitType.getId()] > 0;
|
return _defenceTraitsCount[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getDefenceTraitsCount()
|
public int[] getDefenceTraitsCount()
|
||||||
@@ -625,7 +625,7 @@ public class CharStat
|
|||||||
|
|
||||||
public boolean isTraitInvul(TraitType traitType)
|
public boolean isTraitInvul(TraitType traitType)
|
||||||
{
|
{
|
||||||
return _traitsInvul[traitType.getId()] > 0;
|
return _traitsInvul[traitType.ordinal()] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTraitsInvul()
|
public int[] getTraitsInvul()
|
||||||
|
@@ -21,76 +21,69 @@ package com.l2jmobius.gameserver.model.stats;
|
|||||||
*/
|
*/
|
||||||
public enum TraitType
|
public enum TraitType
|
||||||
{
|
{
|
||||||
NONE(0, 0),
|
NONE(0),
|
||||||
SWORD(1, 1),
|
SWORD(1),
|
||||||
BLUNT(2, 1),
|
BLUNT(1),
|
||||||
DAGGER(3, 1),
|
DAGGER(1),
|
||||||
POLE(4, 1),
|
POLE(1),
|
||||||
FIST(5, 1),
|
FIST(1),
|
||||||
BOW(6, 1),
|
BOW(1),
|
||||||
ETC(7, 1),
|
ETC(1),
|
||||||
UNK_8(8, 0),
|
UNK_8(0),
|
||||||
POISON(9, 3),
|
POISON(3),
|
||||||
HOLD(10, 3),
|
HOLD(3),
|
||||||
BLEED(11, 3),
|
BLEED(3),
|
||||||
SLEEP(12, 3),
|
SLEEP(3),
|
||||||
SHOCK(13, 3),
|
SHOCK(3),
|
||||||
DERANGEMENT(14, 3),
|
DERANGEMENT(3),
|
||||||
BUG_WEAKNESS(15, 2),
|
BUG_WEAKNESS(2),
|
||||||
ANIMAL_WEAKNESS(16, 2),
|
ANIMAL_WEAKNESS(2),
|
||||||
PLANT_WEAKNESS(17, 2),
|
PLANT_WEAKNESS(2),
|
||||||
BEAST_WEAKNESS(18, 2),
|
BEAST_WEAKNESS(2),
|
||||||
DRAGON_WEAKNESS(19, 2),
|
DRAGON_WEAKNESS(2),
|
||||||
PARALYZE(20, 3),
|
PARALYZE(3),
|
||||||
DUAL(21, 1),
|
DUAL(1),
|
||||||
DUALFIST(22, 1),
|
DUALFIST(1),
|
||||||
BOSS(23, 3),
|
BOSS(3),
|
||||||
GIANT_WEAKNESS(24, 2),
|
GIANT_WEAKNESS(2),
|
||||||
CONSTRUCT_WEAKNESS(25, 2),
|
CONSTRUCT_WEAKNESS(2),
|
||||||
DEATH(26, 3),
|
DEATH(3),
|
||||||
VALAKAS(27, 2),
|
VALAKAS(2),
|
||||||
ANESTHESIA(28, 2),
|
ANESTHESIA(2),
|
||||||
CRITICAL_POISON(29, 3),
|
CRITICAL_POISON(3),
|
||||||
ROOT_PHYSICALLY(30, 3),
|
ROOT_PHYSICALLY(3),
|
||||||
ROOT_MAGICALLY(31, 3),
|
ROOT_MAGICALLY(3),
|
||||||
RAPIER(32, 1),
|
RAPIER(1),
|
||||||
CROSSBOW(33, 1),
|
CROSSBOW(1),
|
||||||
ANCIENTSWORD(34, 1),
|
ANCIENTSWORD(1),
|
||||||
TURN_STONE(35, 3),
|
TURN_STONE(3),
|
||||||
GUST(36, 3),
|
GUST(3),
|
||||||
PHYSICAL_BLOCKADE(37, 3),
|
PHYSICAL_BLOCKADE(3),
|
||||||
TARGET(38, 3),
|
TARGET(3),
|
||||||
PHYSICAL_WEAKNESS(39, 3),
|
PHYSICAL_WEAKNESS(3),
|
||||||
MAGICAL_WEAKNESS(40, 3),
|
MAGICAL_WEAKNESS(3),
|
||||||
DUALDAGGER(41, 1),
|
DUALDAGGER(1),
|
||||||
DUALBLUNT(42, 1),
|
DUALBLUNT(1),
|
||||||
KNOCKBACK(43, 3),
|
KNOCKBACK(3),
|
||||||
KNOCKDOWN(44, 3),
|
KNOCKDOWN(3),
|
||||||
PULL(45, 3),
|
PULL(3),
|
||||||
HATE(46, 3),
|
HATE(3),
|
||||||
AGGRESSION(47, 3),
|
AGGRESSION(3),
|
||||||
AIRBIND(48, 3),
|
AIRBIND(3),
|
||||||
DISARM(49, 3),
|
DISARM(3),
|
||||||
DEPORT(50, 3),
|
DEPORT(3),
|
||||||
CHANGEBODY(51, 3),
|
CHANGEBODY(3),
|
||||||
TWOHANDCROSSBOW(52, 1),
|
TWOHANDCROSSBOW(1),
|
||||||
ZONE(53, 3),
|
ZONE(3),
|
||||||
PSYCHIC(54, 3);
|
PSYCHIC(3);
|
||||||
|
|
||||||
private final int _id;
|
|
||||||
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance
|
||||||
|
|
||||||
TraitType(int id, int type)
|
TraitType(int type)
|
||||||
{
|
{
|
||||||
_id = id;
|
|
||||||
_type = type;
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return _id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType()
|
public int getType()
|
||||||
{
|
{
|
||||||
return _type;
|
return _type;
|
||||||
|
Reference in New Issue
Block a user