Reverted recent break speed limit changes.
This commit is contained in:
@ -200,7 +200,6 @@ public class Config
|
||||
public static double MAX_BONUS_EXP;
|
||||
public static double MAX_BONUS_SP;
|
||||
public static int MAX_RUN_SPEED;
|
||||
public static int MAX_RUN_SPEED_SUMMON;
|
||||
public static int MAX_PATK;
|
||||
public static int MAX_MATK;
|
||||
public static int MAX_PCRIT_RATE;
|
||||
@ -1766,7 +1765,6 @@ public class Config
|
||||
MAX_BONUS_EXP = characterConfig.getDouble("MaxExpBonus", 0);
|
||||
MAX_BONUS_SP = characterConfig.getDouble("MaxSpBonus", 0);
|
||||
MAX_RUN_SPEED = characterConfig.getInt("MaxRunSpeed", 300);
|
||||
MAX_RUN_SPEED_SUMMON = characterConfig.getInt("MaxRunSpeedSummon", 350);
|
||||
MAX_PATK = characterConfig.getInt("MaxPAtk", 999999);
|
||||
MAX_MATK = characterConfig.getInt("MaxMAtk", 999999);
|
||||
MAX_PCRIT_RATE = characterConfig.getInt("MaxPCritRate", 500);
|
||||
|
@ -327,17 +327,7 @@ public class CreatureStat
|
||||
{
|
||||
baseSpeed = _creature.getTemplate().getBaseValue(_creature.isRunning() ? Stat.RUN_SPEED : Stat.WALK_SPEED, 0);
|
||||
}
|
||||
return getMoveSpeed() * (1 / baseSpeed);
|
||||
}
|
||||
|
||||
protected double maxSpeed()
|
||||
{
|
||||
return 99999999;
|
||||
}
|
||||
|
||||
private double calcValidSpeed(final double val)
|
||||
{
|
||||
return Math.max(Math.min(val, maxSpeed() + getValue(Stat.SPEED_LIMIT)), 0);
|
||||
return getMoveSpeed() * (1. / baseSpeed);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -345,7 +335,7 @@ public class CreatureStat
|
||||
*/
|
||||
public double getRunSpeed()
|
||||
{
|
||||
return calcValidSpeed(getValue(_creature.isInsideZone(ZoneId.WATER) ? Stat.SWIM_RUN_SPEED : Stat.RUN_SPEED));
|
||||
return getValue(_creature.isInsideZone(ZoneId.WATER) ? Stat.SWIM_RUN_SPEED : Stat.RUN_SPEED);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -353,7 +343,7 @@ public class CreatureStat
|
||||
*/
|
||||
public double getWalkSpeed()
|
||||
{
|
||||
return calcValidSpeed(getValue(_creature.isInsideZone(ZoneId.WATER) ? Stat.SWIM_WALK_SPEED : Stat.WALK_SPEED));
|
||||
return getValue(_creature.isInsideZone(ZoneId.WATER) ? Stat.SWIM_WALK_SPEED : Stat.WALK_SPEED);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -361,7 +351,7 @@ public class CreatureStat
|
||||
*/
|
||||
public double getSwimRunSpeed()
|
||||
{
|
||||
return calcValidSpeed(getValue(Stat.SWIM_RUN_SPEED));
|
||||
return getValue(Stat.SWIM_RUN_SPEED);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -369,7 +359,7 @@ public class CreatureStat
|
||||
*/
|
||||
public double getSwimWalkSpeed()
|
||||
{
|
||||
return calcValidSpeed(getValue(Stat.SWIM_WALK_SPEED));
|
||||
return getValue(Stat.SWIM_WALK_SPEED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.returns.TerminateReturn;
|
||||
import org.l2jmobius.gameserver.model.item.Weapon;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExNewSkillToLearnByLevelUp;
|
||||
|
||||
public class PlayableStat extends CreatureStat
|
||||
@ -255,10 +254,4 @@ public class PlayableStat extends CreatureStat
|
||||
final Weapon weapon = getActiveChar().getActiveWeaponItem();
|
||||
return weapon != null ? weapon.getBaseAttackAngle() : super.getPhysicalAttackAngle();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double maxSpeed()
|
||||
{
|
||||
return Config.MAX_RUN_SPEED + getValue(Stat.SPEED_LIMIT);
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,28 @@ public class SummonStat extends PlayableStat
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double maxSpeed()
|
||||
public double getRunSpeed()
|
||||
{
|
||||
return Config.MAX_RUN_SPEED_SUMMON;
|
||||
final double val = super.getRunSpeed() + Config.RUN_SPD_BOOST;
|
||||
|
||||
// Apply max run speed cap.
|
||||
if (val > (Config.MAX_RUN_SPEED + 50)) // In retail maximum run speed is 350 for summons and 300 for players
|
||||
{
|
||||
return Config.MAX_RUN_SPEED + 50;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getWalkSpeed()
|
||||
{
|
||||
final double val = super.getWalkSpeed() + Config.RUN_SPD_BOOST;
|
||||
|
||||
// Apply max run speed cap.
|
||||
if (val > (Config.MAX_RUN_SPEED + 50)) // In retail maximum run speed is 350 for summons and 300 for players
|
||||
{
|
||||
return Config.MAX_RUN_SPEED + 50;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,6 @@ public enum Stat
|
||||
|
||||
// Run speed, walk & escape speed are calculated proportionally, magic speed is a buff
|
||||
MOVE_SPEED("moveSpeed"),
|
||||
SPEED_LIMIT("speedLimit"),
|
||||
RUN_SPEED("runSpd", new SpeedFinalizer()),
|
||||
WALK_SPEED("walkSpd", new SpeedFinalizer()),
|
||||
SWIM_RUN_SPEED("fastSwimSpd", new SpeedFinalizer()),
|
||||
|
@ -42,7 +42,7 @@ public class SpeedFinalizer implements IStatFunction
|
||||
throwIfPresent(base);
|
||||
|
||||
double baseValue = getBaseSpeed(creature, stat);
|
||||
if (creature.isPlayable())
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
// Enchanted feet bonus
|
||||
baseValue += calcEnchantBodyPart(creature, ItemTemplate.SLOT_FEET);
|
||||
@ -56,21 +56,7 @@ public class SpeedFinalizer implements IStatFunction
|
||||
baseValue += bonusDex;
|
||||
}
|
||||
|
||||
final double maxSpeed;
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
maxSpeed = Config.MAX_RUN_SPEED + creature.getStat().getValue(Stat.SPEED_LIMIT, 0);
|
||||
}
|
||||
else if (creature.isSummon())
|
||||
{
|
||||
maxSpeed = Config.MAX_RUN_SPEED_SUMMON + creature.getStat().getValue(Stat.SPEED_LIMIT, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
maxSpeed = Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
return validateValue(creature, Stat.defaultValue(creature, stat, baseValue), 0, maxSpeed);
|
||||
return validateValue(creature, Stat.defaultValue(creature, stat, baseValue), 1, creature.isPlayable() ? Config.MAX_RUN_SPEED : Double.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -78,7 +64,7 @@ public class SpeedFinalizer implements IStatFunction
|
||||
{
|
||||
if (isBlessed)
|
||||
{
|
||||
return Math.max(enchantLevel - 3, 0) + Math.max(enchantLevel - 6, 0);
|
||||
return (1 * Math.max(enchantLevel - 3, 0)) + (1 * Math.max(enchantLevel - 6, 0));
|
||||
}
|
||||
return (0.6 * Math.max(enchantLevel - 3, 0)) + (0.6 * Math.max(enchantLevel - 6, 0));
|
||||
}
|
||||
|
Reference in New Issue
Block a user