SHOW:
|
|
- or go back to the newest paste.
1 | ================================================================= | |
2 | X.properties | |
3 | ================================================================= | |
4 | # Maximum character running speed. | |
5 | # Default: 250 | |
6 | MaxRunSpeed = 250 | |
7 | ||
8 | # Run speed modifier. Example: Setting this to 5 will | |
9 | # give players +5 to their running speed. | |
10 | # Default: 0 | |
11 | RunSpeedBoost = 25 | |
12 | ||
13 | ||
14 | ||
15 | ||
16 | ================================================================= | |
17 | Config.java | |
18 | ================================================================= | |
19 | ||
20 | + public static int RUN_SPD_BOOST; | |
21 | + public static int MAX_RUN_SPEED; | |
22 | ||
23 | + MAX_RUN_SPEED = protections.getProperty("MaxRunSpeed", 250); | |
24 | + RUN_SPD_BOOST = protections.getProperty("RunSpeedBoost", 0); | |
25 | ||
26 | ================================================================= | |
27 | net.sf.l2j.gameserver.model.actor.status.PlayerStatus.java | |
28 | ================================================================= | |
29 | ||
30 | ||
31 | @Override | |
32 | public float getMoveSpeed() | |
33 | { | |
34 | // Get base value, use swimming speed in water. | |
35 | float baseValue = (_actor.isInWater()) ? getBaseSwimSpeed() : getBaseMoveSpeed(); | |
36 | ||
37 | // Calculate swamp area malus. | |
38 | if (_actor.isInsideZone(ZoneId.SWAMP)) | |
39 | { | |
40 | final SwampZone zone = ZoneManager.getInstance().getZone(_actor, SwampZone.class); | |
41 | if (zone != null) | |
42 | baseValue *= (100 + zone.getMoveBonus()) / 100.0; | |
43 | } | |
44 | + baseValue += Config.RUN_SPD_BOOST;if (baseValue > Config.MAX_RUN_SPEED && !_actor.isGM())return Config.MAX_RUN_SPEED; | |
45 | // Calculate weight penalty malus. | |
46 | final WeightPenalty wp = _actor.getWeightPenalty(); | |
47 | if (wp != WeightPenalty.NONE) | |
48 | baseValue *= wp.getSpeedMultiplier(); | |
49 | ||
50 | // Calculate armor grade penalty malus. | |
51 | final int agp = _actor.getArmorGradePenalty(); | |
52 | if (agp > 0) | |
53 | baseValue *= Math.pow(0.84, agp); | |
54 | ||
55 | return (float) calcStat(Stats.RUN_SPEED, baseValue, null, null); | |
56 | } |