Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =================================================================
- X.properties
- =================================================================
- # Maximum character running speed.
- # Default: 250
- MaxRunSpeed = 250
- # Run speed modifier. Example: Setting this to 5 will
- # give players +5 to their running speed.
- # Default: 0
- RunSpeedBoost = 25
- =================================================================
- Config.java
- =================================================================
- + public static int RUN_SPD_BOOST;
- + public static int MAX_RUN_SPEED;
- + MAX_RUN_SPEED = protections.getProperty("MaxRunSpeed", 250);
- + RUN_SPD_BOOST = protections.getProperty("RunSpeedBoost", 0);
- =================================================================
- net.sf.l2j.gameserver.model.actor.status.PlayerStatus.java
- =================================================================
- @Override
- public float getMoveSpeed()
- {
- // Get base value, use swimming speed in water.
- float baseValue = (_actor.isInWater()) ? getBaseSwimSpeed() : getBaseMoveSpeed();
- // Calculate swamp area malus.
- if (_actor.isInsideZone(ZoneId.SWAMP))
- {
- final SwampZone zone = ZoneManager.getInstance().getZone(_actor, SwampZone.class);
- if (zone != null)
- baseValue *= (100 + zone.getMoveBonus()) / 100.0;
- }
- + baseValue += Config.RUN_SPD_BOOST;if (baseValue > Config.MAX_RUN_SPEED && !_actor.isGM())return Config.MAX_RUN_SPEED;
- // Calculate weight penalty malus.
- final WeightPenalty wp = _actor.getWeightPenalty();
- if (wp != WeightPenalty.NONE)
- baseValue *= wp.getSpeedMultiplier();
- // Calculate armor grade penalty malus.
- final int agp = _actor.getArmorGradePenalty();
- if (agp > 0)
- baseValue *= Math.pow(0.84, agp);
- return (float) calcStat(Stats.RUN_SPEED, baseValue, null, null);
- }
Add Comment
Please, Sign In to add comment