Minor code format.
This commit is contained in:
@ -219,16 +219,16 @@ public class ShortCuts implements IRestorable
|
||||
* Updates the shortcut bars with the new skill.
|
||||
* @param skillId the skill Id to search and update.
|
||||
* @param skillLevel the skill level to update.
|
||||
* @param skillSubLevel the skill sub level to update.
|
||||
* @param skillSubLevel the skill sub level to update.
|
||||
*/
|
||||
public synchronized void updateShortCuts(int skillId, int skillLevel, int skillSubLevel )
|
||||
public synchronized void updateShortCuts(int skillId, int skillLevel, int skillSubLevel)
|
||||
{
|
||||
// Update all the shortcuts for this skill
|
||||
for (Shortcut sc : _shortCuts.values())
|
||||
{
|
||||
if ((sc.getId() == skillId) && (sc.getType() == ShortcutType.SKILL))
|
||||
{
|
||||
final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), skillLevel, skillSubLevel , 1);
|
||||
final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), skillLevel, skillSubLevel, 1);
|
||||
_owner.sendPacket(new ShortCutRegister(newsc));
|
||||
_owner.registerShortCut(newsc);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public class TimeStamp
|
||||
* Gets the skill sub level.
|
||||
* @return the skill level
|
||||
*/
|
||||
public int getSkillSubLevel ()
|
||||
public int getSkillSubLevel()
|
||||
{
|
||||
return _id3;
|
||||
}
|
||||
|
@ -1588,11 +1588,11 @@ public class PlayerInstance extends Playable
|
||||
* Updates the shortcut bars with the new skill.
|
||||
* @param skillId the skill Id to search and update.
|
||||
* @param skillLevel the skill level to update.
|
||||
* @param skillSubLevel the skill sub level to update.
|
||||
* @param skillSubLevel the skill sub level to update.
|
||||
*/
|
||||
public void updateShortCuts(int skillId, int skillLevel, int skillSubLevel )
|
||||
public void updateShortCuts(int skillId, int skillLevel, int skillSubLevel)
|
||||
{
|
||||
_shortCuts.updateShortCuts(skillId, skillLevel, skillSubLevel );
|
||||
_shortCuts.updateShortCuts(skillId, skillLevel, skillSubLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -7236,7 +7236,7 @@ public class PlayerInstance extends Playable
|
||||
statement.setInt(1, getObjectId());
|
||||
statement.setInt(2, t.getSkillId());
|
||||
statement.setInt(3, t.getSkillLevel());
|
||||
statement.setInt(4, t.getSkillSubLevel ());
|
||||
statement.setInt(4, t.getSkillSubLevel());
|
||||
statement.setInt(5, -1);
|
||||
statement.setLong(6, t.getReuse());
|
||||
statement.setDouble(7, t.getStamp());
|
||||
|
@ -29,6 +29,7 @@ public enum AnnouncementType
|
||||
EVENT,
|
||||
AUTO_NORMAL,
|
||||
AUTO_CRITICAL;
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(AnnouncementType.class.getName());
|
||||
|
||||
public static AnnouncementType findById(int id)
|
||||
|
@ -27,22 +27,22 @@ public class SkillHolder
|
||||
{
|
||||
private final int _skillId;
|
||||
private final int _skillLevel;
|
||||
private final int _skillSubLevel ;
|
||||
private final int _skillSubLevel;
|
||||
private Skill _skill;
|
||||
|
||||
public SkillHolder(int skillId, int skillLevel)
|
||||
{
|
||||
_skillId = skillId;
|
||||
_skillLevel = skillLevel;
|
||||
_skillSubLevel = 0;
|
||||
_skillSubLevel = 0;
|
||||
_skill = null;
|
||||
}
|
||||
|
||||
public SkillHolder(int skillId, int skillLevel, int skillSubLevel )
|
||||
public SkillHolder(int skillId, int skillLevel, int skillSubLevel)
|
||||
{
|
||||
_skillId = skillId;
|
||||
_skillLevel = skillLevel;
|
||||
_skillSubLevel = skillSubLevel ;
|
||||
_skillSubLevel = skillSubLevel;
|
||||
_skill = null;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class SkillHolder
|
||||
{
|
||||
_skillId = skill.getId();
|
||||
_skillLevel = skill.getLevel();
|
||||
_skillSubLevel = skill.getSubLevel();
|
||||
_skillSubLevel = skill.getSubLevel();
|
||||
_skill = skill;
|
||||
}
|
||||
|
||||
@ -64,16 +64,16 @@ public class SkillHolder
|
||||
return _skillLevel;
|
||||
}
|
||||
|
||||
public int getSkillSubLevel ()
|
||||
public int getSkillSubLevel()
|
||||
{
|
||||
return _skillSubLevel ;
|
||||
return _skillSubLevel;
|
||||
}
|
||||
|
||||
public Skill getSkill()
|
||||
{
|
||||
if (_skill == null)
|
||||
{
|
||||
_skill = SkillData.getInstance().getSkill(_skillId, Math.max(_skillLevel, 1), _skillSubLevel );
|
||||
_skill = SkillData.getInstance().getSkill(_skillId, Math.max(_skillLevel, 1), _skillSubLevel);
|
||||
}
|
||||
return _skill;
|
||||
}
|
||||
@ -92,7 +92,7 @@ public class SkillHolder
|
||||
}
|
||||
|
||||
final SkillHolder holder = (SkillHolder) obj;
|
||||
return (holder.getSkillId() == _skillId) && (holder.getSkillLevel() == _skillLevel) && (holder.getSkillSubLevel () == _skillSubLevel );
|
||||
return (holder.getSkillId() == _skillId) && (holder.getSkillLevel() == _skillLevel) && (holder.getSkillSubLevel() == _skillSubLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -102,7 +102,7 @@ public class SkillHolder
|
||||
int result = 1;
|
||||
result = (prime * result) + _skillId;
|
||||
result = (prime * result) + _skillLevel;
|
||||
result = (prime * result) + _skillSubLevel ;
|
||||
result = (prime * result) + _skillSubLevel;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class RequestDispel implements IClientIncomingPacket
|
||||
private int _objectId;
|
||||
private int _skillId;
|
||||
private int _skillLevel;
|
||||
private int _skillSubLevel ;
|
||||
private int _skillSubLevel;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
@ -41,7 +41,7 @@ public class RequestDispel implements IClientIncomingPacket
|
||||
_objectId = packet.readD();
|
||||
_skillId = packet.readD();
|
||||
_skillLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class RequestDispel implements IClientIncomingPacket
|
||||
{
|
||||
return;
|
||||
}
|
||||
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
|
||||
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
|
||||
if (skill == null)
|
||||
{
|
||||
return;
|
||||
|
@ -49,7 +49,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
|
||||
private SkillEnchantType _type;
|
||||
private int _skillId;
|
||||
private int _skillLevel;
|
||||
private int _skillSubLevel ;
|
||||
private int _skillSubLevel;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
@ -64,14 +64,14 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
|
||||
_type = SkillEnchantType.values()[type];
|
||||
_skillId = packet.readD();
|
||||
_skillLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
|
||||
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
|
||||
{
|
||||
if (_type == SkillEnchantType.CHANGE)
|
||||
{
|
||||
final int group1 = (_skillSubLevel % 1000);
|
||||
final int group1 = (_skillSubLevel % 1000);
|
||||
final int group2 = (skill.getSubLevel() % 1000);
|
||||
if (group1 != group2)
|
||||
{
|
||||
@ -135,14 +135,14 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if ((skill.getSubLevel() + 1) != _skillSubLevel )
|
||||
else if ((skill.getSubLevel() + 1) != _skillSubLevel)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Client: " + client + " send incorrect sub level: " + _skillSubLevel + " expected: " + (skill.getSubLevel() + 1));
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Client: " + client + " send incorrect sub level: " + _skillSubLevel + " expected: " + (skill.getSubLevel() + 1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final EnchantSkillHolder enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(_skillSubLevel % 1000);
|
||||
final EnchantSkillHolder enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(_skillSubLevel % 1000);
|
||||
|
||||
// Verify if player has all the ingredients
|
||||
for (ItemHolder holder : enchantSkillHolder.getRequiredItems(_type))
|
||||
@ -179,7 +179,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
|
||||
{
|
||||
if (Rnd.get(100) <= enchantSkillHolder.getChance(_type))
|
||||
{
|
||||
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
|
||||
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
|
||||
if (Config.LOG_SKILL_ENCHANTS)
|
||||
{
|
||||
LOGGER_ENCHANT.log(Level.INFO, "Success, Character:" + player.getName() + " [" + player.getObjectId() + "] Account:" + player.getAccountName() + " IP:" + player.getIPAddress() + ", +" + enchantedSkill.getLevel() + " " + enchantedSkill.getSubLevel() + " - " + enchantedSkill.getName() + " (" + enchantedSkill.getId() + "), " + enchantSkillHolder.getChance(_type));
|
||||
@ -218,7 +218,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
|
||||
{
|
||||
if (Rnd.get(100) <= enchantSkillHolder.getChance(_type))
|
||||
{
|
||||
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
|
||||
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
|
||||
if (Config.LOG_SKILL_ENCHANTS)
|
||||
{
|
||||
LOGGER_ENCHANT.info("Success, Character:" + player.getName() + " [" + player.getObjectId() + "] Account:" + player.getAccountName() + " IP:" + player.getIPAddress() + ", +" + enchantedSkill.getLevel() + " " + enchantedSkill.getSubLevel() + " - " + enchantedSkill.getName() + " (" + enchantedSkill.getId() + "), " + enchantSkillHolder.getChance(_type));
|
||||
|
@ -35,21 +35,21 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
|
||||
{
|
||||
private int _skillId;
|
||||
private int _skillLevel;
|
||||
private int _skillSubLevel ;
|
||||
private int _skillSubLevel;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_skillId = packet.readD();
|
||||
_skillLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
|
||||
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -65,7 +65,7 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
|
||||
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
|
||||
if ((skill == null) || (skill.getId() != _skillId))
|
||||
{
|
||||
return;
|
||||
@ -77,12 +77,12 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Skill playerSkill = player.getKnownSkill(_skillId);
|
||||
if ((playerSkill.getLevel() != _skillLevel) || (playerSkill.getSubLevel() != _skillSubLevel ))
|
||||
if ((playerSkill.getLevel() != _skillLevel) || (playerSkill.getSubLevel() != _skillSubLevel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
client.sendPacket(new ExEnchantSkillInfo(_skillId, _skillLevel, _skillSubLevel , playerSkill.getSubLevel()));
|
||||
client.sendPacket(new ExEnchantSkillInfo(_skillId, _skillLevel, _skillSubLevel, playerSkill.getSubLevel()));
|
||||
// ExEnchantSkillInfoDetail - not really necessary I think
|
||||
// client.sendPacket(new ExEnchantSkillInfoDetail(SkillEnchantType.NORMAL, _skillId, _skillLevel, _skillSubLevel , activeChar));
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
|
||||
private SkillEnchantType _type;
|
||||
private int _skillId;
|
||||
private int _skillLevel;
|
||||
private int _skillSubLevel ;
|
||||
private int _skillSubLevel;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
@ -38,14 +38,14 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
|
||||
_type = SkillEnchantType.values()[packet.readD()];
|
||||
_skillId = packet.readD();
|
||||
_skillLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
_skillSubLevel = packet.readH();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
|
||||
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -55,6 +55,6 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
|
||||
{
|
||||
return;
|
||||
}
|
||||
player.sendPacket(new ExEnchantSkillInfoDetail(_type, _skillId, _skillLevel, _skillSubLevel , player));
|
||||
player.sendPacket(new ExEnchantSkillInfoDetail(_type, _skillId, _skillLevel, _skillSubLevel, player));
|
||||
}
|
||||
}
|
||||
|
@ -28,14 +28,14 @@ public class ExEnchantSkillInfo implements IClientOutgoingPacket
|
||||
|
||||
private final int _skillId;
|
||||
private final int _skillLevel;
|
||||
private final int _skillSubLevel ;
|
||||
private final int _skillSubLevel;
|
||||
private final int _currentSubLevel;
|
||||
|
||||
public ExEnchantSkillInfo(int skillId, int skillLevel, int skillSubLevel , int currentSubLevel)
|
||||
public ExEnchantSkillInfo(int skillId, int skillLevel, int skillSubLevel, int currentSubLevel)
|
||||
{
|
||||
_skillId = skillId;
|
||||
_skillLevel = skillLevel;
|
||||
_skillSubLevel = skillSubLevel ;
|
||||
_skillSubLevel = skillSubLevel;
|
||||
_currentSubLevel = currentSubLevel;
|
||||
_routes = EnchantSkillGroupsData.getInstance().getRouteForSkill(_skillId, _skillLevel);
|
||||
}
|
||||
@ -46,14 +46,14 @@ public class ExEnchantSkillInfo implements IClientOutgoingPacket
|
||||
OutgoingPackets.EX_ENCHANT_SKILL_INFO.writeId(packet);
|
||||
packet.writeD(_skillId);
|
||||
packet.writeH(_skillLevel);
|
||||
packet.writeH(_skillSubLevel );
|
||||
packet.writeD((_skillSubLevel % 1000) == EnchantSkillGroupsData.MAX_ENCHANT_LEVEL ? 0 : 1);
|
||||
packet.writeD(_skillSubLevel > 1000 ? 1 : 0);
|
||||
packet.writeH(_skillSubLevel);
|
||||
packet.writeD((_skillSubLevel % 1000) == EnchantSkillGroupsData.MAX_ENCHANT_LEVEL ? 0 : 1);
|
||||
packet.writeD(_skillSubLevel > 1000 ? 1 : 0);
|
||||
packet.writeD(_routes.size());
|
||||
_routes.forEach(route ->
|
||||
{
|
||||
final int routeId = route / 1000;
|
||||
final int currentRouteId = _skillSubLevel / 1000;
|
||||
final int currentRouteId = _skillSubLevel / 1000;
|
||||
final int subLevel = _currentSubLevel > 0 ? (route + (_currentSubLevel % 1000)) - 1 : route;
|
||||
packet.writeH(_skillLevel);
|
||||
packet.writeH(currentRouteId != routeId ? subLevel : Math.min(subLevel + 1, route + (EnchantSkillGroupsData.MAX_ENCHANT_LEVEL - 1)));
|
||||
|
@ -34,16 +34,16 @@ public class ExEnchantSkillInfoDetail implements IClientOutgoingPacket
|
||||
private final SkillEnchantType _type;
|
||||
private final int _skillId;
|
||||
private final int _skillLevel;
|
||||
private final int _skillSubLevel ;
|
||||
private final int _skillSubLevel;
|
||||
private final EnchantSkillHolder _enchantSkillHolder;
|
||||
|
||||
public ExEnchantSkillInfoDetail(SkillEnchantType type, int skillId, int skillLevel, int skillSubLevel , PlayerInstance player)
|
||||
public ExEnchantSkillInfoDetail(SkillEnchantType type, int skillId, int skillLevel, int skillSubLevel, PlayerInstance player)
|
||||
{
|
||||
_type = type;
|
||||
_skillId = skillId;
|
||||
_skillLevel = skillLevel;
|
||||
_skillSubLevel = skillSubLevel ;
|
||||
_enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(skillSubLevel % 1000);
|
||||
_skillSubLevel = skillSubLevel;
|
||||
_enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(skillSubLevel % 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,7 +54,7 @@ public class ExEnchantSkillInfoDetail implements IClientOutgoingPacket
|
||||
packet.writeD(_type.ordinal());
|
||||
packet.writeD(_skillId);
|
||||
packet.writeH(_skillLevel);
|
||||
packet.writeH(_skillSubLevel );
|
||||
packet.writeH(_skillSubLevel);
|
||||
if (_enchantSkillHolder != null)
|
||||
{
|
||||
packet.writeQ(_enchantSkillHolder.getSp(_type));
|
||||
|
@ -25,14 +25,14 @@ public class ShortBuffStatusUpdate implements IClientOutgoingPacket
|
||||
|
||||
private final int _skillId;
|
||||
private final int _skillLevel;
|
||||
private final int _skillSubLevel ;
|
||||
private final int _skillSubLevel;
|
||||
private final int _duration;
|
||||
|
||||
public ShortBuffStatusUpdate(int skillId, int skillLevel, int skillSubLevel , int duration)
|
||||
public ShortBuffStatusUpdate(int skillId, int skillLevel, int skillSubLevel, int duration)
|
||||
{
|
||||
_skillId = skillId;
|
||||
_skillLevel = skillLevel;
|
||||
_skillSubLevel = skillSubLevel ;
|
||||
_skillSubLevel = skillSubLevel;
|
||||
_duration = duration;
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class ShortBuffStatusUpdate implements IClientOutgoingPacket
|
||||
|
||||
packet.writeD(_skillId);
|
||||
packet.writeH(_skillLevel);
|
||||
packet.writeH(_skillSubLevel );
|
||||
packet.writeH(_skillSubLevel);
|
||||
packet.writeD(_duration);
|
||||
return true;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
|
||||
_currentTime = System.currentTimeMillis();
|
||||
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
|
||||
{
|
||||
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel ()).isNotBroadcastable())
|
||||
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
|
||||
{
|
||||
_skillReuseTimeStamps.add(ts);
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ public class ExBRBuyProduct implements IClientOutgoingPacket
|
||||
NOT_DAY_OF_WEEK(-12),
|
||||
NOT_TIME_OF_DAY(-13),
|
||||
SOLD_OUT(-14);
|
||||
|
||||
private final int _id;
|
||||
|
||||
ExBrProductReplyType(int id)
|
||||
|
Reference in New Issue
Block a user