Fixed low monster accuracy.

Contributed by jivec.
This commit is contained in:
MobiusDev
2015-12-21 11:24:27 +00:00
parent 4bfbad7c46
commit 09b6a845a2
2 changed files with 14 additions and 4 deletions

View File

@@ -138,19 +138,19 @@ public class CharStat
} }
/** /**
* @return the Accuracy (base+modifier) of the L2Character in function of the Weapon Expertise Penalty. * @return the Accuracy of the L2Character in function of the Weapon Expertise Penalty.
*/ */
public int getAccuracy() public int getAccuracy()
{ {
return (int) Math.round(calcStat(Stats.ACCURACY_COMBAT, 0, null, null)); return (int) Math.round(calcStat(Stats.ACCURACY_COMBAT, _activeChar.getTemplate().getBaseAccuracy(), _activeChar, null));
} }
/** /**
* @return the Magic Accuracy (base+modifier) of the L2Character * @return the Magic Accuracy of the L2Character
*/ */
public int getMagicAccuracy() public int getMagicAccuracy()
{ {
return (int) Math.round(calcStat(Stats.ACCURACY_MAGIC, 0, null, null)); return (int) Math.round(calcStat(Stats.ACCURACY_MAGIC, _activeChar.getTemplate().getBaseAccuracy(), _activeChar, null));
} }
public L2Character getActiveChar() public L2Character getActiveChar()

View File

@@ -53,6 +53,7 @@ public class L2CharTemplate extends ListenersContainer
private int _baseMAtk; private int _baseMAtk;
private int _basePDef; private int _basePDef;
private int _baseMDef; private int _baseMDef;
private double _basePAcc;
private int _basePAtkSpd; private int _basePAtkSpd;
private int _baseMAtkSpd; private int _baseMAtkSpd;
private int _baseAttackRange; private int _baseAttackRange;
@@ -117,6 +118,7 @@ public class L2CharTemplate extends ListenersContainer
_basePAtkSpd = set.getInt("basePAtkSpd", 300); _basePAtkSpd = set.getInt("basePAtkSpd", 300);
_baseMAtkSpd = set.getInt("baseMAtkSpd", 333); _baseMAtkSpd = set.getInt("baseMAtkSpd", 333);
_baseShldDef = set.getInt("baseShldDef", 0); _baseShldDef = set.getInt("baseShldDef", 0);
_basePAcc = set.getDouble("accuracy", 0);
_baseAttackRange = set.getInt("baseAtkRange", 40); _baseAttackRange = set.getInt("baseAtkRange", 40);
_randomDamage = set.getInt("baseRndDam", 0); _randomDamage = set.getInt("baseRndDam", 0);
_baseAttackType = set.getEnum("baseAtkType", WeaponType.class, WeaponType.FIST); _baseAttackType = set.getEnum("baseAtkType", WeaponType.class, WeaponType.FIST);
@@ -156,6 +158,14 @@ public class L2CharTemplate extends ListenersContainer
setBaseMoveSpeed(MoveType.SLOW_FLY, set.getDouble("baseFlyWalkSpd", getBaseMoveSpeed(MoveType.WALK))); setBaseMoveSpeed(MoveType.SLOW_FLY, set.getDouble("baseFlyWalkSpd", getBaseMoveSpeed(MoveType.WALK)));
} }
/**
* @return proper accuracy
*/
public double getBaseAccuracy()
{
return _basePAcc;
}
/** /**
* @return the baseHpMax * @return the baseHpMax
*/ */