Code style changes.

This commit is contained in:
MobiusDev
2016-04-26 19:21:19 +00:00
parent 6a13705766
commit fc070c9238
768 changed files with 3338 additions and 4252 deletions

View File

@@ -63,7 +63,7 @@ public final class GameTimeController extends Thread
super.start();
}
public static final void init()
public static void init()
{
_instance = new GameTimeController();
}
@@ -180,7 +180,7 @@ public final class GameTimeController extends Thread
}
}
public static final GameTimeController getInstance()
public static GameTimeController getInstance()
{
return _instance;
}

View File

@@ -508,7 +508,7 @@ public class GeoData
prevY = curY;
prevZ = curZ;
}
return (!hasGeoPos(prevX, prevY) || (prevZ == toZ));
return !hasGeoPos(prevX, prevY) || (prevZ == toZ);
}
public int traceTerrainZ(int x, int y, int z, int tx, int ty)
@@ -574,6 +574,6 @@ public class GeoData
private static class SingletonHolder
{
protected final static GeoData _instance = new GeoData();
protected static final GeoData _instance = new GeoData();
}
}

View File

@@ -59,32 +59,9 @@ public final class ItemsAutoDestroy
{
_items.remove(item.getObjectId());
}
else
else if (item.getItem().getAutoDestroyTime() > 0)
{
if (item.getItem().getAutoDestroyTime() > 0)
{
if ((curtime - item.getDropTime()) > item.getItem().getAutoDestroyTime())
{
L2World.getInstance().removeVisibleObject(item, item.getWorldRegion());
L2World.getInstance().removeObject(item);
_items.remove(item.getObjectId());
if (Config.SAVE_DROPPED_ITEM)
{
ItemsOnGroundManager.getInstance().removeObject(item);
}
}
}
else if (item.getItem().hasExImmediateEffect() && ((curtime - item.getDropTime()) > Config.HERB_AUTO_DESTROY_TIME))
{
L2World.getInstance().removeVisibleObject(item, item.getWorldRegion());
L2World.getInstance().removeObject(item);
_items.remove(item.getObjectId());
if (Config.SAVE_DROPPED_ITEM)
{
ItemsOnGroundManager.getInstance().removeObject(item);
}
}
else if ((curtime - item.getDropTime()) > ((Config.AUTODESTROY_ITEM_AFTER == 0) ? 3600000 : Config.AUTODESTROY_ITEM_AFTER * 1000))
if ((curtime - item.getDropTime()) > item.getItem().getAutoDestroyTime())
{
L2World.getInstance().removeVisibleObject(item, item.getWorldRegion());
L2World.getInstance().removeObject(item);
@@ -95,6 +72,26 @@ public final class ItemsAutoDestroy
}
}
}
else if (item.getItem().hasExImmediateEffect() && ((curtime - item.getDropTime()) > Config.HERB_AUTO_DESTROY_TIME))
{
L2World.getInstance().removeVisibleObject(item, item.getWorldRegion());
L2World.getInstance().removeObject(item);
_items.remove(item.getObjectId());
if (Config.SAVE_DROPPED_ITEM)
{
ItemsOnGroundManager.getInstance().removeObject(item);
}
}
else if ((curtime - item.getDropTime()) > ((Config.AUTODESTROY_ITEM_AFTER == 0) ? 3600000 : Config.AUTODESTROY_ITEM_AFTER * 1000))
{
L2World.getInstance().removeVisibleObject(item, item.getWorldRegion());
L2World.getInstance().removeObject(item);
_items.remove(item.getObjectId());
if (Config.SAVE_DROPPED_ITEM)
{
ItemsOnGroundManager.getInstance().removeObject(item);
}
}
}
}

View File

@@ -219,7 +219,7 @@ public class LoginServerThread extends Thread
try
{
publicKey = (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic((new RSAPublicKeySpec(new BigInteger(init.getRSAKey()), RSAKeyGenParameterSpec.F4)));
publicKey = (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(new RSAPublicKeySpec(new BigInteger(init.getRSAKey()), RSAKeyGenParameterSpec.F4));
}
catch (GeneralSecurityException e)
{

View File

@@ -186,13 +186,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
}
// Check if the target isn't dead, is in the Aggro range and is at the same height
if (target.isAlikeDead() || ((target.isPlayable()) && !me.isInsideRadius(target, me.getAggroRange(), true, false)))
if (target.isAlikeDead() || (target.isPlayable() && !me.isInsideRadius(target, me.getAggroRange(), true, false)))
{
return false;
}
// Check if the target is a L2Playable
if (target.isPlayable() && !(me.isRaid()) && !(me.canSeeThroughSilentMove()) && ((L2Playable) target).isSilentMovingAffected())
if (target.isPlayable() && !me.isRaid() && !me.canSeeThroughSilentMove() && ((L2Playable) target).isSilentMovingAffected())
{
return false;
}
@@ -859,7 +859,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
{
continue;
}
if (!Util.checkIfInRange((healSkill.getCastRange() + collision + leader.getTemplate().getCollisionRadius()), npc, leader, false) && !isParty(healSkill) && !npc.isMovementDisabled())
if (!Util.checkIfInRange(healSkill.getCastRange() + collision + leader.getTemplate().getCollisionRadius(), npc, leader, false) && !isParty(healSkill) && !npc.isMovementDisabled())
{
moveToPawn(leader, healSkill.getCastRange() + collision + leader.getTemplate().getCollisionRadius());
return;
@@ -956,7 +956,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
{
continue;
}
if (!Util.checkIfInRange((sk.getCastRange() + collision + leader.getTemplate().getCollisionRadius()), npc, leader, false) && !isParty(sk) && !npc.isMovementDisabled())
if (!Util.checkIfInRange(sk.getCastRange() + collision + leader.getTemplate().getCollisionRadius(), npc, leader, false) && !isParty(sk) && !npc.isMovementDisabled())
{
moveToPawn(leader, sk.getCastRange() + collision + leader.getTemplate().getCollisionRadius());
return;
@@ -989,7 +989,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
continue;
}
final L2Attackable targets = ((L2Attackable) obj);
final L2Attackable targets = (L2Attackable) obj;
if (!npc.isInMyClan(targets))
{
continue;
@@ -1167,34 +1167,31 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
return true;
}
}
else
else if (GeoData.getInstance().canSeeTarget(caster, attackTarget) && !canAOE(sk) && !attackTarget.isDead() && (dist2 <= srange))
{
if (GeoData.getInstance().canSeeTarget(caster, attackTarget) && !canAOE(sk) && !attackTarget.isDead() && (dist2 <= srange))
{
if (!attackTarget.isAffectedBySkill(sk.getId()))
{
clientStopMoving(null);
caster.doCast(sk);
return true;
}
}
else if (canAOE(sk))
{
if ((sk.getTargetType() == L2TargetType.AURA) || (sk.getTargetType() == L2TargetType.BEHIND_AURA) || (sk.getTargetType() == L2TargetType.FRONT_AURA) || (sk.getTargetType() == L2TargetType.AURA_CORPSE_MOB) //
|| (((sk.getTargetType() == L2TargetType.AREA) || (sk.getTargetType() == L2TargetType.BEHIND_AREA) || (sk.getTargetType() == L2TargetType.FRONT_AREA)) && GeoData.getInstance().canSeeTarget(caster, attackTarget) && !attackTarget.isDead() && (dist2 <= srange)))
{
clientStopMoving(null);
caster.doCast(sk);
return true;
}
}
else if ((sk.getTargetType() == L2TargetType.ONE) && (effectTargetReconsider(sk, false) != null))
if (!attackTarget.isAffectedBySkill(sk.getId()))
{
clientStopMoving(null);
caster.doCast(sk);
return true;
}
}
else if (canAOE(sk))
{
if ((sk.getTargetType() == L2TargetType.AURA) || (sk.getTargetType() == L2TargetType.BEHIND_AURA) || (sk.getTargetType() == L2TargetType.FRONT_AURA) || (sk.getTargetType() == L2TargetType.AURA_CORPSE_MOB) //
|| (((sk.getTargetType() == L2TargetType.AREA) || (sk.getTargetType() == L2TargetType.BEHIND_AREA) || (sk.getTargetType() == L2TargetType.FRONT_AREA)) && GeoData.getInstance().canSeeTarget(caster, attackTarget) && !attackTarget.isDead() && (dist2 <= srange)))
{
clientStopMoving(null);
caster.doCast(sk);
return true;
}
}
else if ((sk.getTargetType() == L2TargetType.ONE) && (effectTargetReconsider(sk, false) != null))
{
clientStopMoving(null);
caster.doCast(sk);
return true;
}
}
if (sk.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT))
@@ -1235,7 +1232,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
final L2Character leader = caster.getLeader();
if ((leader != null) && !leader.isDead() && (Rnd.get(100) > ((leader.getCurrentHp() / leader.getMaxHp()) * 100)))
{
if (!Util.checkIfInRange((sk.getCastRange() + caster.getTemplate().getCollisionRadius() + leader.getTemplate().getCollisionRadius()), caster, leader, false) && !isParty(sk) && !caster.isMovementDisabled())
if (!Util.checkIfInRange(sk.getCastRange() + caster.getTemplate().getCollisionRadius() + leader.getTemplate().getCollisionRadius(), caster, leader, false) && !isParty(sk) && !caster.isMovementDisabled())
{
moveToPawn(leader, sk.getCastRange() + caster.getTemplate().getCollisionRadius() + leader.getTemplate().getCollisionRadius());
}
@@ -1268,7 +1265,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
continue;
}
final L2Attackable targets = ((L2Attackable) obj);
final L2Attackable targets = (L2Attackable) obj;
if (!caster.isInMyClan(targets))
{
continue;
@@ -1416,7 +1413,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
final L2Character leader = caster.getLeader();
if (leader != null)
{
if (leader.isDead() && !Util.checkIfInRange((sk.getCastRange() + caster.getTemplate().getCollisionRadius() + leader.getTemplate().getCollisionRadius()), caster, leader, false) && !isParty(sk) && !caster.isMovementDisabled())
if (leader.isDead() && !Util.checkIfInRange(sk.getCastRange() + caster.getTemplate().getCollisionRadius() + leader.getTemplate().getCollisionRadius(), caster, leader, false) && !isParty(sk) && !caster.isMovementDisabled())
{
moveToPawn(leader, sk.getCastRange() + caster.getTemplate().getCollisionRadius() + leader.getTemplate().getCollisionRadius());
}
@@ -1438,7 +1435,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
continue;
}
final L2Attackable targets = ((L2Attackable) obj);
final L2Attackable targets = (L2Attackable) obj;
if (!caster.isInMyClan(targets))
{
continue;
@@ -1462,7 +1459,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
{
continue;
}
if (caster.isInMyClan(((L2Npc) obj)) && (obj.getCurrentHp() < obj.getMaxHp()) && (Rnd.get(100) <= 20))
if (caster.isInMyClan((L2Npc) obj) && (obj.getCurrentHp() < obj.getMaxHp()) && (Rnd.get(100) <= 20))
{
clientStopMoving(null);
caster.setTarget(caster);
@@ -1601,7 +1598,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
}
// -------------------------------------------------------------
// Start ATK SKILL when nothing can be done
if ((npc.isMovementDisabled() || (npc.getAiType() == AIType.MAGE) || (npc.getAiType() == AIType.HEALER)))
if (npc.isMovementDisabled() || (npc.getAiType() == AIType.MAGE) || (npc.getAiType() == AIType.HEALER))
{
for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.ATTACK))
{
@@ -1794,7 +1791,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
continue;
}
final L2Attackable targets = ((L2Attackable) obj);
final L2Attackable targets = (L2Attackable) obj;
if (targets.isInMyClan(actor))
{
continue;

View File

@@ -911,7 +911,7 @@ public class L2CharacterAI extends AbstractAI
}
// If pathfinding enabled the creature will go to the destination or it will go to the nearest obstacle.
setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, (Config.PATHFINDING > 0 ? GeoData.getInstance().moveCheck(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ, _actor.getInstanceId()) : new Location(posX, posY, posZ)));
setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, Config.PATHFINDING > 0 ? GeoData.getInstance().moveCheck(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ, _actor.getInstanceId()) : new Location(posX, posY, posZ));
}
protected boolean maybeMoveToPosition(ILocational worldPosition, int offset)
@@ -1483,46 +1483,43 @@ public class L2CharacterAI extends AbstractAI
}
}
}
else
else if ((sk.getTargetType() == L2TargetType.AURA) || (sk.getTargetType() == L2TargetType.BEHIND_AURA) || (sk.getTargetType() == L2TargetType.FRONT_AURA) || (sk.getTargetType() == L2TargetType.AURA_CORPSE_MOB))
{
if ((sk.getTargetType() == L2TargetType.AURA) || (sk.getTargetType() == L2TargetType.BEHIND_AURA) || (sk.getTargetType() == L2TargetType.FRONT_AURA) || (sk.getTargetType() == L2TargetType.AURA_CORPSE_MOB))
boolean cancast = false;
for (L2Character target : _actor.getKnownList().getKnownCharactersInRadius(sk.getAffectRange()))
{
boolean cancast = false;
for (L2Character target : _actor.getKnownList().getKnownCharactersInRadius(sk.getAffectRange()))
if (!GeoData.getInstance().canSeeTarget(_actor, target) || ((target instanceof L2Attackable) && !((L2Npc) _actor).isChaos()))
{
if (!GeoData.getInstance().canSeeTarget(_actor, target) || ((target instanceof L2Attackable) && !((L2Npc) _actor).isChaos()))
{
continue;
}
if (!target.getEffectList().isEmpty())
{
cancast = true;
}
continue;
}
if (cancast)
if (!target.getEffectList().isEmpty())
{
return true;
cancast = true;
}
}
else if ((sk.getTargetType() == L2TargetType.AREA) || (sk.getTargetType() == L2TargetType.BEHIND_AREA) || (sk.getTargetType() == L2TargetType.FRONT_AREA))
if (cancast)
{
boolean cancast = true;
for (L2Character target : getAttackTarget().getKnownList().getKnownCharactersInRadius(sk.getAffectRange()))
return true;
}
}
else if ((sk.getTargetType() == L2TargetType.AREA) || (sk.getTargetType() == L2TargetType.BEHIND_AREA) || (sk.getTargetType() == L2TargetType.FRONT_AREA))
{
boolean cancast = true;
for (L2Character target : getAttackTarget().getKnownList().getKnownCharactersInRadius(sk.getAffectRange()))
{
if (!GeoData.getInstance().canSeeTarget(_actor, target) || ((target instanceof L2Attackable) && !((L2Npc) _actor).isChaos()))
{
if (!GeoData.getInstance().canSeeTarget(_actor, target) || ((target instanceof L2Attackable) && !((L2Npc) _actor).isChaos()))
{
continue;
}
if (target.isAffectedBySkill(sk.getId()))
{
cancast = false;
}
continue;
}
if (cancast)
if (target.isAffectedBySkill(sk.getId()))
{
return true;
cancast = false;
}
}
if (cancast)
{
return true;
}
}
return false;
}
@@ -1539,7 +1536,7 @@ public class L2CharacterAI extends AbstractAI
{
continue;
}
if (((L2Npc) target).isInMyClan(((L2Npc) _actor)))
if (((L2Npc) target).isInMyClan((L2Npc) _actor))
{
count++;
if (target.isAffectedBySkill(sk.getId()))
@@ -1558,6 +1555,6 @@ public class L2CharacterAI extends AbstractAI
public boolean isParty(Skill sk)
{
return (sk.getTargetType() == L2TargetType.PARTY);
return sk.getTargetType() == L2TargetType.PARTY;
}
}

View File

@@ -129,7 +129,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
L2PcInstance player = null;
if (target instanceof L2PcInstance)
{
player = ((L2PcInstance) target);
player = (L2PcInstance) target;
}
else if (target instanceof L2Summon)
{
@@ -486,16 +486,16 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
if ((dist_2 <= (castRange * castRange)) && (castRange > 70) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !sk.isPassive())
{
final L2Object OldTarget = _actor.getTarget();
if ((sk.isContinuous() && !sk.isDebuff()) || (sk.hasEffectType(L2EffectType.HEAL)))
if ((sk.isContinuous() && !sk.isDebuff()) || sk.hasEffectType(L2EffectType.HEAL))
{
boolean useSkillSelf = true;
if ((sk.hasEffectType(L2EffectType.HEAL)) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
if (sk.hasEffectType(L2EffectType.HEAL) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
{
useSkillSelf = false;
break;
}
if ((sk.isContinuous() && !sk.isDebuff()) && _actor.isAffectedBySkill(sk.getId()))
if (sk.isContinuous() && !sk.isDebuff() && _actor.isAffectedBySkill(sk.getId()))
{
useSkillSelf = false;
}
@@ -514,7 +514,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
}
// Check if the L2SiegeGuardInstance is attacking, knows the target and can't run
if (!(_actor.isAttackingNow()) && (_actor.getRunSpeed() == 0) && (_actor.getKnownList().knowsObject(attackTarget)))
if (!_actor.isAttackingNow() && (_actor.getRunSpeed() == 0) && _actor.getKnownList().knowsObject(attackTarget))
{
// Cancel the target
_actor.getKnownList().removeKnownObject(attackTarget);
@@ -530,30 +530,26 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
final double homeY = attackTarget.getY() - sGuard.getSpawn().getY();
// Check if the L2SiegeGuardInstance isn't too far from it's home location
if ((((dx * dx) + (dy * dy)) > 10000) && (((homeX * homeX) + (homeY * homeY)) > 3240000) && (_actor.getKnownList().knowsObject(attackTarget)))
if ((((dx * dx) + (dy * dy)) > 10000) && (((homeX * homeX) + (homeY * homeY)) > 3240000) && _actor.getKnownList().knowsObject(attackTarget))
{
// Cancel the target
_actor.getKnownList().removeKnownObject(attackTarget);
_actor.setTarget(null);
setIntention(AI_INTENTION_IDLE, null, null);
}
else
// Move the actor to Pawn server side AND client side by sending Server->Client packet MoveToPawn (broadcast)
// Temporary hack for preventing guards jumping off towers,
// before replacing this with effective geodata checks and AI modification
else if ((dz * dz) < (170 * 170))
{
// Temporary hack for preventing guards jumping off towers,
// before replacing this with effective geodata checks and AI modification
if ((dz * dz) < (170 * 170))
if (_selfAnalysis.isMage)
{
if (_selfAnalysis.isMage)
{
range = _selfAnalysis.maxCastRange - 50;
}
if (_actor.getWalkSpeed() <= 0)
{
return;
}
moveToPawn(attackTarget, attackTarget.isMoving() ? range - 70 : range);
range = _selfAnalysis.maxCastRange - 50;
}
if (_actor.getWalkSpeed() <= 0)
{
return;
}
moveToPawn(attackTarget, attackTarget.isMoving() ? range - 70 : range);
}
}
}
@@ -603,16 +599,16 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
if (((castRange * castRange) >= dist_2) && !sk.isPassive() && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !_actor.isSkillDisabled(sk))
{
final L2Object OldTarget = _actor.getTarget();
if ((sk.isContinuous() && !sk.isDebuff()) || (sk.hasEffectType(L2EffectType.HEAL)))
if ((sk.isContinuous() && !sk.isDebuff()) || sk.hasEffectType(L2EffectType.HEAL))
{
boolean useSkillSelf = true;
if ((sk.hasEffectType(L2EffectType.HEAL)) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
if (sk.hasEffectType(L2EffectType.HEAL) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
{
useSkillSelf = false;
break;
}
if ((sk.isContinuous() && !sk.isDebuff()) && _actor.isAffectedBySkill(sk.getId()))
if (sk.isContinuous() && !sk.isDebuff() && _actor.isAffectedBySkill(sk.getId()))
{
useSkillSelf = false;
}

View File

@@ -45,7 +45,7 @@ public abstract class L2PlayableAI extends L2CharacterAI
{
if (target instanceof L2Playable)
{
if (target.getActingPlayer().isProtectionBlessingAffected() && ((_actor.getActingPlayer().getLevel() - target.getActingPlayer().getLevel()) >= 10) && (_actor.getActingPlayer().getReputation() < 0) && !(target.isInsideZone(ZoneId.PVP)))
if (target.getActingPlayer().isProtectionBlessingAffected() && ((_actor.getActingPlayer().getLevel() - target.getActingPlayer().getLevel()) >= 10) && (_actor.getActingPlayer().getReputation() < 0) && !target.isInsideZone(ZoneId.PVP))
{
// If attacker have karma and have level >= 10 than his target and target have
// Newbie Protection Buff,
@@ -54,7 +54,7 @@ public abstract class L2PlayableAI extends L2CharacterAI
return;
}
if (_actor.getActingPlayer().isProtectionBlessingAffected() && ((target.getActingPlayer().getLevel() - _actor.getActingPlayer().getLevel()) >= 10) && (target.getActingPlayer().getReputation() < 0) && !(target.isInsideZone(ZoneId.PVP)))
if (_actor.getActingPlayer().isProtectionBlessingAffected() && ((target.getActingPlayer().getLevel() - _actor.getActingPlayer().getLevel()) >= 10) && (target.getActingPlayer().getReputation() < 0) && !target.isInsideZone(ZoneId.PVP))
{
// If target have karma and have level >= 10 than his target and actor have
// Newbie Protection Buff,

View File

@@ -495,16 +495,16 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
if ((dist_2 <= (castRange * castRange)) && (castRange > 70) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !sk.isPassive())
{
final L2Object OldTarget = _actor.getTarget();
if ((sk.isContinuous() && !sk.isDebuff()) || (sk.hasEffectType(L2EffectType.HEAL)))
if ((sk.isContinuous() && !sk.isDebuff()) || sk.hasEffectType(L2EffectType.HEAL))
{
boolean useSkillSelf = true;
if ((sk.hasEffectType(L2EffectType.HEAL)) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
if (sk.hasEffectType(L2EffectType.HEAL) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
{
useSkillSelf = false;
break;
}
if ((sk.isContinuous() && !sk.isDebuff()) && _actor.isAffectedBySkill(sk.getId()))
if (sk.isContinuous() && !sk.isDebuff() && _actor.isAffectedBySkill(sk.getId()))
{
useSkillSelf = false;
}
@@ -523,7 +523,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
}
// Check if the L2SiegeGuardInstance is attacking, knows the target and can't run
if (!(_actor.isAttackingNow()) && (_actor.getRunSpeed() == 0) && (_actor.getKnownList().knowsObject(attackTarget)))
if (!_actor.isAttackingNow() && (_actor.getRunSpeed() == 0) && _actor.getKnownList().knowsObject(attackTarget))
{
// Cancel the target
_actor.getKnownList().removeKnownObject(attackTarget);
@@ -539,31 +539,26 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
final double homeY = attackTarget.getY() - sGuard.getSpawn().getY();
// Check if the L2SiegeGuardInstance isn't too far from it's home location
if ((((dx * dx) + (dy * dy)) > 10000) && (((homeX * homeX) + (homeY * homeY)) > 3240000) // 1800 * 1800
&& (_actor.getKnownList().knowsObject(attackTarget)))
if ((((dx * dx) + (dy * dy)) > 10000) && (((homeX * homeX) + (homeY * homeY)) > 3240000) && _actor.getKnownList().knowsObject(attackTarget))
{
// Cancel the target
_actor.getKnownList().removeKnownObject(attackTarget);
_actor.setTarget(null);
setIntention(AI_INTENTION_IDLE, null, null);
}
else
// Move the actor to Pawn server side AND client side by sending Server->Client packet MoveToPawn (broadcast)
// Temporary hack for preventing guards jumping off towers,
// before replacing this with effective geodata checks and AI modification
else if ((dz * dz) < (170 * 170)) // normally 130 if guard z coordinates correct
{
// Temporary hack for preventing guards jumping off towers,
// before replacing this with effective geodata checks and AI modification
if ((dz * dz) < (170 * 170)) // normally 130 if guard z coordinates correct
if (_selfAnalysis.isHealer)
{
if (_selfAnalysis.isHealer)
{
return;
}
if (_selfAnalysis.isMage)
{
range = _selfAnalysis.maxCastRange - 50;
}
moveToPawn(attackTarget, attackTarget.isMoving() ? range - 70 : range);
return;
}
if (_selfAnalysis.isMage)
{
range = _selfAnalysis.maxCastRange - 50;
}
moveToPawn(attackTarget, attackTarget.isMoving() ? range - 70 : range);
}
}
}
@@ -609,16 +604,16 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
if (((castRange * castRange) >= dist_2) && !sk.isPassive() && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !_actor.isSkillDisabled(sk))
{
final L2Object OldTarget = _actor.getTarget();
if ((sk.isContinuous() && !sk.isDebuff()) || (sk.hasEffectType(L2EffectType.HEAL)))
if ((sk.isContinuous() && !sk.isDebuff()) || sk.hasEffectType(L2EffectType.HEAL))
{
boolean useSkillSelf = true;
if ((sk.hasEffectType(L2EffectType.HEAL)) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
if (sk.hasEffectType(L2EffectType.HEAL) && (_actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5)))
{
useSkillSelf = false;
break;
}
if ((sk.isContinuous() && !sk.isDebuff()) && _actor.isAffectedBySkill(sk.getId()))
if (sk.isContinuous() && !sk.isDebuff() && _actor.isAffectedBySkill(sk.getId()))
{
useSkillSelf = false;
}

View File

@@ -28,7 +28,7 @@ public class NextAction
{
public interface NextActionCallback
{
public void doWork();
void doWork();
}
private List<CtrlEvent> _events;

View File

@@ -111,7 +111,7 @@ public final class FighterAI implements Runnable
// Out of combat follow logic.
if (!_guard.isInCombat())
{
_guard.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, (new Location((_player.getLocation().getX() + Rnd.get((_followRange * -1), _followRange)), (_player.getLocation().getY() + Rnd.get((_followRange * -1), _followRange)), _player.getLocation().getZ())));
_guard.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((_player.getLocation().getX() + Rnd.get(_followRange * -1, _followRange)), (_player.getLocation().getY() + Rnd.get(_followRange * -1, _followRange)), _player.getLocation().getZ()));
}
}
}

View File

@@ -119,7 +119,7 @@ public final class HealerAI implements Runnable
// Out of combat follow logic.
if (!_guard.isInCombat())
{
_guard.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, (new Location((_player.getLocation().getX() + Rnd.get((_followRange * -1), _followRange)), (_player.getLocation().getY() + Rnd.get((_followRange * -1), _followRange)), _player.getLocation().getZ())));
_guard.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((_player.getLocation().getX() + Rnd.get(_followRange * -1, _followRange)), (_player.getLocation().getY() + Rnd.get(_followRange * -1, _followRange)), _player.getLocation().getZ()));
}
}
}

View File

@@ -78,7 +78,7 @@ public class HtmCache
public double getMemoryUsage()
{
return ((float) _bytesBuffLen / 1048576);
return (float) _bytesBuffLen / 1048576;
}
public int getLoadedFiles()

View File

@@ -45,7 +45,7 @@ public class ForumsBBSManager extends BaseBBSManager
{
while (rs.next())
{
addForum((new Forum(rs.getInt("forum_id"), null)));
addForum(new Forum(rs.getInt("forum_id"), null));
}
}
catch (Exception e)

View File

@@ -70,7 +70,7 @@ public class PostBBSManager extends BaseBBSManager
final int idp = Integer.parseInt(st.nextToken());
final String index = st.hasMoreTokens() ? st.nextToken() : null;
final int ind = index == null ? 1 : Integer.parseInt(index);
showPost((TopicBBSManager.getInstance().getTopicByID(idp)), ForumsBBSManager.getInstance().getForumByID(idf), activeChar, ind);
showPost(TopicBBSManager.getInstance().getTopicByID(idp), ForumsBBSManager.getInstance().getForumByID(idf), activeChar, ind);
}
else if (command.startsWith("_bbsposts;edit;"))
{
@@ -80,7 +80,7 @@ public class PostBBSManager extends BaseBBSManager
final int idf = Integer.parseInt(st.nextToken());
final int idt = Integer.parseInt(st.nextToken());
final int idp = Integer.parseInt(st.nextToken());
showEditPost((TopicBBSManager.getInstance().getTopicByID(idt)), ForumsBBSManager.getInstance().getForumByID(idf), activeChar, idp);
showEditPost(TopicBBSManager.getInstance().getTopicByID(idt), ForumsBBSManager.getInstance().getForumByID(idf), activeChar, idp);
}
else
{

View File

@@ -91,7 +91,7 @@ public class SummonSkillsTable
{
if (cha.getLevel() < 70)
{
lvl = (cha.getLevel() / 10);
lvl = cha.getLevel() / 10;
if (lvl <= 0)
{
lvl = 1;
@@ -99,7 +99,7 @@ public class SummonSkillsTable
}
else
{
lvl = (7 + ((cha.getLevel() - 70) / 5));
lvl = 7 + ((cha.getLevel() - 70) / 5);
}
// formula usable for skill that have 10 or more skill levels

View File

@@ -91,7 +91,7 @@ public final class AbilityPointsData implements IXmlReader
return prevHolder != null ? prevHolder.getSP() : points >= 13 ? 1_000_000_000 : points >= 9 ? 750_000_000 : points >= 5 ? 500_000_000 : 250_000_000;
}
public static final AbilityPointsData getInstance()
public static AbilityPointsData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -141,7 +141,7 @@ public class AppearanceItemData implements IXmlReader
* Gets the single instance of AppearanceItemData.
* @return single instance of AppearanceItemData
*/
public static final AppearanceItemData getInstance()
public static AppearanceItemData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -124,7 +124,7 @@ public final class BeautyShopData implements IXmlReader
att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
beautyData.addFace((new BeautyItem(set)));
beautyData.addFace(new BeautyItem(set));
}
}

View File

@@ -190,7 +190,7 @@ public class EnchantItemBonusData implements IXmlReader
* Gets the single instance of EnchantBonusData.
* @return single instance of EnchantBonusData
*/
public static final EnchantItemBonusData getInstance()
public static EnchantItemBonusData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -153,7 +153,7 @@ public class EnchantItemData implements IXmlReader
* Gets the single instance of EnchantItemData.
* @return single instance of EnchantItemData
*/
public static final EnchantItemData getInstance()
public static EnchantItemData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -112,7 +112,7 @@ public class EnchantItemOptionsData implements IXmlReader
* Gets the single instance of EnchantOptionsData.
* @return single instance of EnchantOptionsData
*/
public static final EnchantItemOptionsData getInstance()
public static EnchantItemOptionsData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -84,7 +84,7 @@ public final class ItemCrystalizationData implements IXmlReader
* Gets the single instance of ItemCrystalizationData.
* @return single instance of ItemCrystalizationData
*/
public static final ItemCrystalizationData getInstance()
public static ItemCrystalizationData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -271,7 +271,7 @@ public final class MultisellData implements IXmlReader
separateAndSend(listId, player, npc, inventoryOnly, 1, 1);
}
public static final boolean hasSpecialIngredient(int id, long amount, L2PcInstance player)
public static boolean hasSpecialIngredient(int id, long amount, L2PcInstance player)
{
switch (id)
{
@@ -324,13 +324,13 @@ public final class MultisellData implements IXmlReader
return false;
}
public static final boolean takeSpecialIngredient(int id, long amount, L2PcInstance player)
public static boolean takeSpecialIngredient(int id, long amount, L2PcInstance player)
{
switch (id)
{
case PC_BANG_POINTS: // PcBang points
{
final int cost = player.getPcBangPoints() - (int) (amount);
final int cost = player.getPcBangPoints() - (int) amount;
player.setPcBangPoints(cost);
final SystemMessage smsgpc = SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_USING_S1_POINT);
smsgpc.addLong((int) amount);
@@ -362,7 +362,7 @@ public final class MultisellData implements IXmlReader
return false;
}
public static final void giveSpecialProduct(int id, long amount, L2PcInstance player)
public static void giveSpecialProduct(int id, long amount, L2PcInstance player)
{
switch (id)
{

View File

@@ -550,54 +550,51 @@ public class NpcData implements IXmlReader
aiSkillScopes.add(shortOrLongRangeScope);
}
}
else if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT))
{
aiSkillScopes.add(AISkillScope.NEGATIVE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.HEAL))
{
aiSkillScopes.add(AISkillScope.HEAL);
}
else if (skill.hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK, L2EffectType.MAGICAL_ATTACK, L2EffectType.DEATH_LINK, L2EffectType.HP_DRAIN))
{
aiSkillScopes.add(AISkillScope.ATTACK);
aiSkillScopes.add(AISkillScope.UNIVERSAL);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.SLEEP))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
}
else if (skill.hasEffectType(L2EffectType.STUN, L2EffectType.ROOT))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.MUTE, L2EffectType.FEAR))
{
aiSkillScopes.add(AISkillScope.COT);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.PARALYZE))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT))
{
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.RESURRECTION))
{
aiSkillScopes.add(AISkillScope.RES);
}
else
{
if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT))
{
aiSkillScopes.add(AISkillScope.NEGATIVE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.HEAL))
{
aiSkillScopes.add(AISkillScope.HEAL);
}
else if (skill.hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK, L2EffectType.MAGICAL_ATTACK, L2EffectType.DEATH_LINK, L2EffectType.HP_DRAIN))
{
aiSkillScopes.add(AISkillScope.ATTACK);
aiSkillScopes.add(AISkillScope.UNIVERSAL);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.SLEEP))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
}
else if (skill.hasEffectType(L2EffectType.STUN, L2EffectType.ROOT))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.MUTE, L2EffectType.FEAR))
{
aiSkillScopes.add(AISkillScope.COT);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.PARALYZE))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT))
{
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.RESURRECTION))
{
aiSkillScopes.add(AISkillScope.RES);
}
else
{
aiSkillScopes.add(AISkillScope.UNIVERSAL);
}
aiSkillScopes.add(AISkillScope.UNIVERSAL);
}
}

View File

@@ -149,7 +149,7 @@ public class OptionData implements IXmlReader
* Gets the single instance of OptionsData.
* @return single instance of OptionsData
*/
public static final OptionData getInstance()
public static OptionData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -128,7 +128,7 @@ public final class PlayerTemplateData implements IXmlReader
}
else if (!cnd.getNodeName().equals("#text"))
{
set.set((nd.getNodeName() + cnd.getNodeName()), cnd.getTextContent());
set.set(nd.getNodeName() + cnd.getNodeName(), cnd.getTextContent());
}
}
}
@@ -138,8 +138,8 @@ public final class PlayerTemplateData implements IXmlReader
}
}
// calculate total pdef and mdef from parts
set.set("basePDef", (set.getInt("basePDefchest", 0) + set.getInt("basePDeflegs", 0) + set.getInt("basePDefhead", 0) + set.getInt("basePDeffeet", 0) + set.getInt("basePDefgloves", 0) + set.getInt("basePDefunderwear", 0) + set.getInt("basePDefcloak", 0)));
set.set("baseMDef", (set.getInt("baseMDefrear", 0) + set.getInt("baseMDeflear", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefneck", 0)));
set.set("basePDef", set.getInt("basePDefchest", 0) + set.getInt("basePDeflegs", 0) + set.getInt("basePDefhead", 0) + set.getInt("basePDeffeet", 0) + set.getInt("basePDefgloves", 0) + set.getInt("basePDefunderwear", 0) + set.getInt("basePDefcloak", 0));
set.set("baseMDef", set.getInt("baseMDefrear", 0) + set.getInt("baseMDeflear", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefneck", 0));
_playerTemplates.put(ClassId.getClassId(classId), new L2PcTemplate(set, creationPoints));
}
@@ -180,7 +180,7 @@ public final class PlayerTemplateData implements IXmlReader
return _playerTemplates.get(ClassId.getClassId(classId));
}
public static final PlayerTemplateData getInstance()
public static PlayerTemplateData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -110,7 +110,7 @@ public class SiegeScheduleData implements IXmlReader
return _scheduleData;
}
public static final SiegeScheduleData getInstance()
public static SiegeScheduleData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -697,7 +697,7 @@ public final class SkillTreesData implements IXmlReader
continue;
}
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && (!Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet) && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()) || isRemoveSkill(classId, skill.getSkillId()))
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && !Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()) || isRemoveSkill(classId, skill.getSkillId()))
{
continue;
}
@@ -750,7 +750,7 @@ public final class SkillTreesData implements IXmlReader
continue;
}
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && (!Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet) && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()) || isRemoveSkill(classId, skill.getSkillId()))
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && !Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()) || isRemoveSkill(classId, skill.getSkillId()))
{
continue;
}
@@ -835,7 +835,7 @@ public final class SkillTreesData implements IXmlReader
final int maxLvl = SkillData.getInstance().getMaxLevel(skill.getSkillId());
final int hashCode = SkillData.getSkillHashCode(skill.getSkillId(), maxLvl);
if (skill.isAutoGet() && ((player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel())))
if (skill.isAutoGet() && (player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel()))
{
final Skill oldSkill = player.getKnownSkill(skill.getSkillId());
if (oldSkill != null)
@@ -871,7 +871,7 @@ public final class SkillTreesData implements IXmlReader
continue;
}
if (skill.isLearnedByNpc() && ((player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel())))
if (skill.isLearnedByNpc() && (player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel()))
{
final Skill oldSkill = player.getSkills().get(skill.getSkillId());
if (oldSkill != null)
@@ -922,7 +922,7 @@ public final class SkillTreesData implements IXmlReader
for (L2SkillLearn skill : _alchemySkillTree.values())
{
if (skill.isLearnedByNpc() && ((player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel())))
if (skill.isLearnedByNpc() && (player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel()))
{
final Skill oldSkill = player.getSkills().get(skill.getSkillId());
@@ -1005,7 +1005,7 @@ public final class SkillTreesData implements IXmlReader
final Race race = player.getRace();
for (L2SkillLearn skill : _transformSkillTree.values())
{
if (((player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel())) && (skill.getRaces().isEmpty() || skill.getRaces().contains(race)))
if ((player.getLevel() >= skill.getGetLevel()) && (player.getDualClassLevel() >= skill.getDualClassLevel()) && (skill.getRaces().isEmpty() || skill.getRaces().contains(race)))
{
final Skill oldSkill = player.getSkills().get(skill.getSkillId());
if (oldSkill != null)
@@ -1079,7 +1079,7 @@ public final class SkillTreesData implements IXmlReader
{
for (L2SkillLearn skill : _subPledgeSkillTree.values())
{
if ((clan.getLevel() >= skill.getGetLevel()))
if (clan.getLevel() >= skill.getGetLevel())
{
final Skill oldSkill = clan.getSkills().get(skill.getSkillId());
if ((oldSkill == null) || (oldSkill.getLevel() < skill.getSkillLevel()))
@@ -1547,7 +1547,7 @@ public final class SkillTreesData implements IXmlReader
for (int i = 0; i < classlevel; i++)
{
classId = classId.getParent();
if (isCurrentClassSkillNoParent(classId, hashCurrentLevel) && (!isCurrentClassSkillNoParent(player.getClassId(), hashMaxLevel) && !isCurrentClassSkillNoParent(player.getClassId(), hashNextLevel)) && !isRemoveSkill(player.getClassId(), skill.getId()))
if (isCurrentClassSkillNoParent(classId, hashCurrentLevel) && !isCurrentClassSkillNoParent(player.getClassId(), hashMaxLevel) && !isCurrentClassSkillNoParent(player.getClassId(), hashNextLevel) && !isRemoveSkill(player.getClassId(), skill.getId()))
{
player.removeSkill(skill, true, true);
}

View File

@@ -525,10 +525,10 @@ public class AugmentationData
int stat34 = 0;
if (Config.RETAIL_LIKE_AUGMENTATION)
{
final List<AugmentationChance> _selectedChances12 = new ArrayList<>();
final List<AugmentationChance> _selectedChances34 = new ArrayList<>();
if (item.getItem().isMagicWeapon())
{
final List<AugmentationChance> _selectedChances12 = new ArrayList<>();
final List<AugmentationChance> _selectedChances34 = new ArrayList<>();
for (AugmentationChance ac : _augmentationChances)
{
if (ac.getWeaponType().equals("mage") && (ac.getStoneId() == lifeStoneId))
@@ -543,87 +543,9 @@ public class AugmentationData
}
}
}
int r = Rnd.get(10000);
float s = 10000;
for (AugmentationChance ac : _selectedChances12)
{
if (s > r)
{
s -= (ac.getAugmentChance() * 100);
stat12 = ac.getAugmentId();
}
}
int[] gradeChance = null;
switch (lifeStoneGrade)
{
case AbstractRefinePacket.GRADE_NONE:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
break;
}
case AbstractRefinePacket.GRADE_MID:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_MID_CHANCE;
break;
}
case AbstractRefinePacket.GRADE_HIGH:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE;
break;
}
case AbstractRefinePacket.GRADE_TOP:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_TOP_CHANCE;
break;
}
default:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
}
}
int c = Rnd.get(100);
if (c < gradeChance[0])
{
c = 55;
}
else if (c < (gradeChance[0] + gradeChance[1]))
{
c = 35;
}
else if (c < (gradeChance[0] + gradeChance[1] + gradeChance[2]))
{
c = 7;
}
else
{
c = 3;
}
final List<AugmentationChance> _selectedChances34final = new ArrayList<>();
for (AugmentationChance ac : _selectedChances34)
{
if (ac.getCategoryChance() == c)
{
_selectedChances34final.add(ac);
}
}
r = Rnd.get(10000);
s = 10000;
for (AugmentationChance ac : _selectedChances34final)
{
if (s > r)
{
s -= (ac.getAugmentChance() * 100);
stat34 = ac.getAugmentId();
}
}
}
else
{
final List<AugmentationChance> _selectedChances12 = new ArrayList<>();
final List<AugmentationChance> _selectedChances34 = new ArrayList<>();
for (AugmentationChance ac : _augmentationChances)
{
if (ac.getWeaponType().equals("warrior") && (ac.getStoneId() == lifeStoneId))
@@ -638,79 +560,78 @@ public class AugmentationData
}
}
}
int r = Rnd.get(10000);
float s = 10000;
for (AugmentationChance ac : _selectedChances12)
}
int r = Rnd.get(10000);
float s = 10000;
for (AugmentationChance ac : _selectedChances12)
{
if (s > r)
{
if (s > r)
{
s -= (ac.getAugmentChance() * 100);
stat12 = ac.getAugmentId();
}
s -= ac.getAugmentChance() * 100;
stat12 = ac.getAugmentId();
}
int[] gradeChance = null;
switch (lifeStoneGrade)
}
int[] gradeChance = null;
switch (lifeStoneGrade)
{
case AbstractRefinePacket.GRADE_NONE:
{
case AbstractRefinePacket.GRADE_NONE:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
break;
}
case AbstractRefinePacket.GRADE_MID:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_MID_CHANCE;
break;
}
case AbstractRefinePacket.GRADE_HIGH:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE;
break;
}
case AbstractRefinePacket.GRADE_TOP:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_TOP_CHANCE;
break;
}
default:
{
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
}
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
break;
}
int c = Rnd.get(100);
if (c < gradeChance[0])
case AbstractRefinePacket.GRADE_MID:
{
c = 55;
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_MID_CHANCE;
break;
}
else if (c < (gradeChance[0] + gradeChance[1]))
case AbstractRefinePacket.GRADE_HIGH:
{
c = 35;
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE;
break;
}
else if (c < (gradeChance[0] + gradeChance[1] + gradeChance[2]))
case AbstractRefinePacket.GRADE_TOP:
{
c = 7;
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_TOP_CHANCE;
break;
}
else
default:
{
c = 3;
gradeChance = Config.RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
}
final List<AugmentationChance> _selectedChances34final = new ArrayList<>();
for (AugmentationChance ac : _selectedChances34)
}
int c = Rnd.get(100);
if (c < gradeChance[0])
{
c = 55;
}
else if (c < (gradeChance[0] + gradeChance[1]))
{
c = 35;
}
else if (c < (gradeChance[0] + gradeChance[1] + gradeChance[2]))
{
c = 7;
}
else
{
c = 3;
}
final List<AugmentationChance> _selectedChances34final = new ArrayList<>();
for (AugmentationChance ac : _selectedChances34)
{
if (ac.getCategoryChance() == c)
{
if (ac.getCategoryChance() == c)
{
_selectedChances34final.add(ac);
}
_selectedChances34final.add(ac);
}
r = Rnd.get(10000);
s = 10000;
for (AugmentationChance ac : _selectedChances34final)
}
r = Rnd.get(10000);
s = 10000;
for (AugmentationChance ac : _selectedChances34final)
{
if (s > r)
{
if (s > r)
{
s -= (ac.getAugmentChance() * 100);
stat34 = ac.getAugmentId();
}
s -= ac.getAugmentChance() * 100;
stat34 = ac.getAugmentId();
}
}
return new L2Augmentation(((stat34 << 16) + stat12));
@@ -802,20 +723,17 @@ public class AugmentationData
resultColor = 0;
}
}
else if ((resultColor <= ((10 * lifeStoneGrade) + 5)) || (stat34 != 0))
{
resultColor = 3;
}
else if (resultColor <= ((10 * lifeStoneGrade) + 10))
{
resultColor = 1;
}
else
{
if ((resultColor <= ((10 * lifeStoneGrade) + 5)) || (stat34 != 0))
{
resultColor = 3;
}
else if (resultColor <= ((10 * lifeStoneGrade) + 10))
{
resultColor = 1;
}
else
{
resultColor = 2;
}
resultColor = 2;
}
// generate a skill if necessary
@@ -866,29 +784,26 @@ public class AugmentationData
if (stat34 == 0)
{
final int temp = Rnd.get(2, 3);
final int colorOffset = (resultColor * (10 * STAT_SUBBLOCKSIZE)) + (temp * STAT_BLOCKSIZE) + 1;
final int colorOffset = (resultColor * 10 * STAT_SUBBLOCKSIZE) + (temp * STAT_BLOCKSIZE) + 1;
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + colorOffset;
stat34 = Rnd.get(offset, (offset + STAT_SUBBLOCKSIZE) - 1);
if (generateGlow && (lifeStoneGrade >= 2))
{
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + ((temp - 2) * STAT_BLOCKSIZE) + (lifeStoneGrade * (10 * STAT_SUBBLOCKSIZE)) + 1;
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + ((temp - 2) * STAT_BLOCKSIZE) + (lifeStoneGrade * 10 * STAT_SUBBLOCKSIZE) + 1;
}
else
{
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + ((temp - 2) * STAT_BLOCKSIZE) + (Rnd.get(0, 1) * (10 * STAT_SUBBLOCKSIZE)) + 1;
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + ((temp - 2) * STAT_BLOCKSIZE) + (Rnd.get(0, 1) * 10 * STAT_SUBBLOCKSIZE) + 1;
}
}
else if (!generateGlow)
{
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + 1;
}
else
{
if (!generateGlow)
{
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + 1;
}
else
{
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + (((lifeStoneGrade + resultColor) / 2) * (10 * STAT_SUBBLOCKSIZE)) + 1;
}
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + (((lifeStoneGrade + resultColor) / 2) * 10 * STAT_SUBBLOCKSIZE) + 1;
}
stat12 = Rnd.get(offset, (offset + STAT_SUBBLOCKSIZE) - 1);
@@ -927,7 +842,7 @@ public class AugmentationData
{
if (s > r)
{
s -= (ac.getAugmentChance() * 100);
s -= ac.getAugmentChance() * 100;
stat12 = ac.getAugmentId();
}
}
@@ -962,7 +877,7 @@ public class AugmentationData
{
if (s > r)
{
s -= (ac.getAugmentChance() * 100);
s -= ac.getAugmentChance() * 100;
stat34 = ac.getAugmentId();
}
}
@@ -1031,7 +946,7 @@ public class AugmentationData
return new L2Augmentation(((stat34 << 16) + stat12));
}
public static final AugmentationData getInstance()
public static AugmentationData getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -288,7 +288,7 @@ public final class BotReportTable
return false;
}
final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
final long reuse = System.currentTimeMillis() - rcdRep.getLastReporTime();
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);

View File

@@ -260,7 +260,7 @@ public class ItemTable
String referenceName = "no-reference";
if (reference instanceof L2Object)
{
referenceName = (((L2Object) reference).getName() != null ? ((L2Object) reference).getName() : "no-name");
referenceName = ((L2Object) reference).getName() != null ? ((L2Object) reference).getName() : "no-name";
}
else if (reference instanceof String)
{
@@ -268,7 +268,7 @@ public class ItemTable
}
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + itemId + " count: " + count + " name: " + item.getItemName() + " objId: " + item.getObjectId() + ")", (actor.getTarget() != null ? actor.getTarget().getName() : "no-target"), "L2Object referencing this action is: " + referenceName);
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + itemId + " count: " + count + " name: " + item.getItemName() + " objId: " + item.getObjectId() + ")", actor.getTarget() != null ? actor.getTarget().getName() : "no-target", "L2Object referencing this action is: " + referenceName);
}
}
@@ -327,7 +327,7 @@ public class ItemTable
String referenceName = "no-reference";
if (reference instanceof L2Object)
{
referenceName = (((L2Object) reference).getName() != null ? ((L2Object) reference).getName() : "no-name");
referenceName = ((L2Object) reference).getName() != null ? ((L2Object) reference).getName() : "no-name";
}
else if (reference instanceof String)
{
@@ -335,7 +335,7 @@ public class ItemTable
}
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + item.getId() + " count: " + item.getCount() + " itemObjId: " + item.getObjectId() + ")", (actor.getTarget() != null ? actor.getTarget().getName() : "no-target"), "L2Object referencing this action is: " + referenceName);
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + item.getId() + " count: " + item.getCount() + " itemObjId: " + item.getObjectId() + ")", actor.getTarget() != null ? actor.getTarget().getName() : "no-target", "L2Object referencing this action is: " + referenceName);
}
}

View File

@@ -103,7 +103,7 @@ public class MerchantPriceConfigTable implements InstanceListManager
}
}
final MerchantPriceConfig defaultMpc = this.getMerchantPriceConfig(defaultPriceConfigId);
final MerchantPriceConfig defaultMpc = getMerchantPriceConfig(defaultPriceConfigId);
if (defaultMpc == null)
{
throw new IllegalStateException("'defaultPriceConfig' points to an non-loaded priceConfig");

View File

@@ -104,13 +104,13 @@ public class NpcPersonalAIData
{
case "disableRandomAnimation":
{
npc.setRandomAnimationEnabled((map.get(key) == 0));
npc.setRandomAnimationEnabled(map.get(key) == 0);
break;
}
case "disableRandomWalk":
{
npc.setIsNoRndWalk((map.get(key) == 1));
spawn.setIsNoRndWalk((map.get(key) == 1));
npc.setIsNoRndWalk(map.get(key) == 1);
spawn.setIsNoRndWalk(map.get(key) == 1);
break;
}
}

View File

@@ -342,7 +342,7 @@ public abstract class DocumentBase
private StatsSet parseParameters(Node n, Object template)
{
StatsSet parameters = null;
while ((n != null))
while (n != null)
{
// Parse all parameters.
if ((n.getNodeType() == Node.ELEMENT_NODE) && "param".equals(n.getNodeName()))

View File

@@ -170,7 +170,7 @@ public enum CategoryType
* @param categoryName
* @return A {@code CategoryType} if category was found, {@code null} if category was not found
*/
public static final CategoryType findByName(String categoryName)
public static CategoryType findByName(String categoryName)
{
for (CategoryType type : values())
{

View File

@@ -28,7 +28,7 @@ public enum IllegalActionPunishmentType
KICKBAN,
JAIL;
public static final IllegalActionPunishmentType findByName(String name)
public static IllegalActionPunishmentType findByName(String name)
{
for (IllegalActionPunishmentType type : values())
{

View File

@@ -28,7 +28,7 @@ public enum PlayerAction
private PlayerAction()
{
_mask = (1 << ordinal());
_mask = 1 << ordinal();
}
public int getMask()

View File

@@ -30,7 +30,7 @@ public enum ShotType
private ShotType()
{
_mask = (1 << ordinal());
_mask = 1 << ordinal();
}
public int getMask()

View File

@@ -52,7 +52,7 @@ public class AdminCommandHandler implements IHandler<IAdminCommandHandler, Strin
@Override
public IAdminCommandHandler getHandler(String adminCommand)
{
return _datatable.get((adminCommand.contains(" ") ? adminCommand.substring(0, adminCommand.indexOf(" ")) : adminCommand));
return _datatable.get(adminCommand.contains(" ") ? adminCommand.substring(0, adminCommand.indexOf(" ")) : adminCommand);
}
@Override

View File

@@ -63,7 +63,7 @@ public final class EffectHandler implements IHandler<Class<? extends AbstractEff
{
try
{
L2ScriptEngineManager.getInstance().executeScript((new File(L2ScriptEngineManager.SCRIPT_FOLDER, "handlers/EffectMasterHandler.java")));
L2ScriptEngineManager.getInstance().executeScript(new File(L2ScriptEngineManager.SCRIPT_FOLDER, "handlers/EffectMasterHandler.java"));
}
catch (Exception e)
{

View File

@@ -24,9 +24,9 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public interface IActionHandler
{
public static Logger _log = Logger.getLogger(IActionHandler.class.getName());
Logger _log = Logger.getLogger(IActionHandler.class.getName());
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact);
boolean action(L2PcInstance activeChar, L2Object target, boolean interact);
public InstanceType getInstanceType();
InstanceType getInstanceType();
}

View File

@@ -24,9 +24,9 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public interface IActionShiftHandler
{
public static Logger _log = Logger.getLogger(IActionShiftHandler.class.getName());
Logger _log = Logger.getLogger(IActionShiftHandler.class.getName());
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact);
boolean action(L2PcInstance activeChar, L2Object target, boolean interact);
public InstanceType getInstanceType();
InstanceType getInstanceType();
}

View File

@@ -26,11 +26,11 @@ public interface IAdminCommandHandler
* @param command
* @return command success
*/
public boolean useAdminCommand(String command, L2PcInstance activeChar);
boolean useAdminCommand(String command, L2PcInstance activeChar);
/**
* this method is called at initialization to register all the item ids automatically
* @return all known itemIds
*/
public String[] getAdminCommandList();
String[] getAdminCommandList();
}

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
*/
public interface IBypassHandler
{
public static Logger _log = Logger.getLogger(IBypassHandler.class.getName());
Logger _log = Logger.getLogger(IBypassHandler.class.getName());
/**
* This is the worker method that is called when someone uses an bypass command.
@@ -35,11 +35,11 @@ public interface IBypassHandler
* @param bypassOrigin
* @return success
*/
public boolean useBypass(String command, L2PcInstance activeChar, L2Character bypassOrigin);
boolean useBypass(String command, L2PcInstance activeChar, L2Character bypassOrigin);
/**
* This method is called at initialization to register all bypasses automatically.
* @return all known bypasses
*/
public String[] getBypassList();
String[] getBypassList();
}

View File

@@ -32,11 +32,11 @@ public interface IChatHandler
* @param target
* @param text
*/
public void handleChat(ChatType type, L2PcInstance activeChar, String target, String text);
void handleChat(ChatType type, L2PcInstance activeChar, String target, String text);
/**
* Returns a list of all chat types registered to this handler
* @return
*/
public ChatType[] getChatTypeList();
ChatType[] getChatTypeList();
}

View File

@@ -23,11 +23,11 @@ package com.l2jmobius.gameserver.handler;
*/
public interface IHandler<K, V>
{
public void registerHandler(K handler);
void registerHandler(K handler);
public void removeHandler(K handler);
void removeHandler(K handler);
public K getHandler(V val);
K getHandler(V val);
public int size();
int size();
}

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
*/
public interface IItemHandler
{
public static final Logger _log = Logger.getLogger(IItemHandler.class.getName());
Logger _log = Logger.getLogger(IItemHandler.class.getName());
/**
* Launch task associated to the item.
@@ -35,5 +35,5 @@ public interface IItemHandler
* @param forceUse ctrl hold on item use
* @return {@code true} if the item all conditions are met and the item is used, {@code false} otherwise.
*/
public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse);
boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse);
}

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
*/
public interface IParseBoardHandler
{
public static final Logger LOG = Logger.getLogger(IParseBoardHandler.class.getName());
Logger LOG = Logger.getLogger(IParseBoardHandler.class.getName());
/**
* Parses a community board command.
@@ -34,11 +34,11 @@ public interface IParseBoardHandler
* @param player the player
* @return
*/
public boolean parseCommunityBoardCommand(String command, L2PcInstance player);
boolean parseCommunityBoardCommand(String command, L2PcInstance player);
/**
* Gets the community board commands.
* @return the community board commands
*/
public String[] getCommunityBoardCommands();
String[] getCommunityBoardCommands();
}

View File

@@ -26,11 +26,11 @@ import com.l2jmobius.gameserver.model.punishment.PunishmentType;
*/
public interface IPunishmentHandler
{
static final Logger _log = Logger.getLogger(IPunishmentHandler.class.getName());
Logger _log = Logger.getLogger(IPunishmentHandler.class.getName());
public void onStart(PunishmentTask task);
void onStart(PunishmentTask task);
public void onEnd(PunishmentTask task);
void onEnd(PunishmentTask task);
public PunishmentType getType();
PunishmentType getType();
}

View File

@@ -26,9 +26,9 @@ import com.l2jmobius.gameserver.model.skills.targets.L2TargetType;
*/
public interface ITargetTypeHandler
{
static final L2Object[] EMPTY_TARGET_LIST = new L2Object[0];
L2Object[] EMPTY_TARGET_LIST = new L2Object[0];
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target);
L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target);
public Enum<L2TargetType> getTargetType();
Enum<L2TargetType> getTargetType();
}

View File

@@ -25,7 +25,7 @@ import java.util.logging.Logger;
*/
public interface ITelnetHandler
{
public static Logger _log = Logger.getLogger(ITelnetHandler.class.getName());
Logger _log = Logger.getLogger(ITelnetHandler.class.getName());
/**
* this is the worker method that is called when someone uses an bypass command
@@ -35,11 +35,11 @@ public interface ITelnetHandler
* @param __uptime
* @return success
*/
public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int __uptime);
boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int __uptime);
/**
* this method is called at initialization to register all bypasses automatically
* @return all known bypasses
*/
public String[] getCommandList();
String[] getCommandList();
}

View File

@@ -22,7 +22,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public interface IUserCommandHandler
{
public static Logger _log = Logger.getLogger(IUserCommandHandler.class.getName());
Logger _log = Logger.getLogger(IUserCommandHandler.class.getName());
/**
* this is the worker method that is called when someone uses an admin command.
@@ -30,11 +30,11 @@ public interface IUserCommandHandler
* @param activeChar
* @return command success
*/
public boolean useUserCommand(int id, L2PcInstance activeChar);
boolean useUserCommand(int id, L2PcInstance activeChar);
/**
* this method is called at initialization to register all the item ids automatically
* @return all known itemIds
*/
public int[] getUserCommandList();
int[] getUserCommandList();
}

View File

@@ -22,7 +22,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public interface IVoicedCommandHandler
{
public static Logger _log = Logger.getLogger(IVoicedCommandHandler.class.getName());
Logger _log = Logger.getLogger(IVoicedCommandHandler.class.getName());
/**
* this is the worker method that is called when someone uses an admin command.
@@ -31,11 +31,11 @@ public interface IVoicedCommandHandler
* @param params
* @return command success
*/
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params);
boolean useVoicedCommand(String command, L2PcInstance activeChar, String params);
/**
* this method is called at initialization to register all the item ids automatically
* @return all known itemIds
*/
public String[] getVoicedCommandList();
String[] getVoicedCommandList();
}

View File

@@ -34,5 +34,5 @@ public interface IWriteBoardHandler extends IParseBoardHandler
* @param arg5 the fifth argument
* @return
*/
public boolean writeCommunityBoardCommand(L2PcInstance player, String arg1, String arg2, String arg3, String arg4, String arg5);
boolean writeCommunityBoardCommand(L2PcInstance player, String arg1, String arg2, String arg3, String arg4, String arg5);
}

View File

@@ -52,7 +52,7 @@ public class VoicedCommandHandler implements IHandler<IVoicedCommandHandler, Str
@Override
public IVoicedCommandHandler getHandler(String voicedCommand)
{
return _datatable.get((voicedCommand.contains(" ") ? voicedCommand.substring(0, voicedCommand.indexOf(" ")) : voicedCommand));
return _datatable.get(voicedCommand.contains(" ") ? voicedCommand.substring(0, voicedCommand.indexOf(" ")) : voicedCommand);
}
@Override

View File

@@ -137,7 +137,7 @@ public class BitSetIDFactory extends IdFactory
*/
protected synchronized int usedIdCount()
{
return (size() - FIRST_OID);
return size() - FIRST_OID;
}
/**

View File

@@ -92,7 +92,7 @@ public class CompactionIDFactory extends IdFactory
for (int i = 1; i <= hole; i++)
{
id = tmp_obj_ids[N - i];
_log.info(getClass().getSimpleName() + ": Compacting DB object ID=" + id + " into " + (_curOID));
_log.info(getClass().getSimpleName() + ": Compacting DB object ID=" + id + " into " + _curOID);
for (String update : ID_UPDATES)
{
try (PreparedStatement ps = con.prepareStatement(update))

View File

@@ -281,7 +281,7 @@ public class AirShipManager
}
}
public static final AirShipManager getInstance()
public static AirShipManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -246,7 +246,7 @@ public final class AntiFeedManager
return Config.L2JMOD_DUALBOX_CHECK_WHITELIST.containsKey(addrHash) ? max + Config.L2JMOD_DUALBOX_CHECK_WHITELIST.get(addrHash) : max;
}
public static final AntiFeedManager getInstance()
public static AntiFeedManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -37,7 +37,7 @@ public class BoatManager
public static final int GLUDIN_HARBOR = 2;
public static final int RUNE_HARBOR = 3;
public static final BoatManager getInstance()
public static BoatManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -313,7 +313,7 @@ public final class CastleManager implements InstanceListManager
return count;
}
public static final CastleManager getInstance()
public static CastleManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -91,7 +91,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
{
_mode = ManorMode.MODIFIABLE;
}
else if ((hour == Config.ALT_MANOR_REFRESH_TIME) && ((min >= Config.ALT_MANOR_REFRESH_MIN) && (min < maintenanceMin)))
else if ((hour == Config.ALT_MANOR_REFRESH_TIME) && (min >= Config.ALT_MANOR_REFRESH_MIN) && (min < maintenanceMin))
{
_mode = ManorMode.MAINTENANCE;
}
@@ -279,7 +279,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
ThreadPoolManager.getInstance().scheduleGeneral(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
ThreadPoolManager.getInstance().scheduleGeneral(this::changeMode, _nextModeChange.getTimeInMillis() - System.currentTimeMillis());
}
public final void changeMode()
@@ -552,7 +552,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
public final List<SeedProduction> getSeedProduction(int castleId, boolean nextPeriod)
{
return (nextPeriod) ? _productionNext.get(castleId) : _production.get(castleId);
return nextPeriod ? _productionNext.get(castleId) : _production.get(castleId);
}
public final SeedProduction getSeedProduct(int castleId, int seedId, boolean nextPeriod)
@@ -569,7 +569,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
public final List<CropProcure> getCropProcure(int castleId, boolean nextPeriod)
{
return (nextPeriod) ? _procureNext.get(castleId) : _procure.get(castleId);
return nextPeriod ? _procureNext.get(castleId) : _procure.get(castleId);
}
public final CropProcure getCropProcure(int castleId, int cropId, boolean nextPeriod)
@@ -597,7 +597,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
}
for (CropProcure crop : procure)
{
total += (crop.getPrice() * crop.getStartAmount());
total += crop.getPrice() * crop.getStartAmount();
}
return total;
}
@@ -813,7 +813,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
// -------------------------------------------------------
// Static methods
// -------------------------------------------------------
public static final CastleManorManager getInstance()
public static CastleManorManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -365,7 +365,7 @@ public class ClanEntryManager
sortBy = Util.constrain(sortBy, 1, CLAN_COMPARATOR.size() - 1);
//@formatter:off
return _clanList.values().stream()
.filter((p -> (((clanLevel < 0) && (karma >= 0) && (karma != p.getKarma())) || ((clanLevel >= 0) && (karma < 0) && (clanLevel != p.getClanLevel())) || ((clanLevel >= 0) && (karma >= 0) && ((clanLevel != p.getClanLevel()) || (karma != p.getKarma()))))))
.filter(p -> (((clanLevel < 0) && (karma >= 0) && (karma != p.getKarma())) || ((clanLevel >= 0) && (karma < 0) && (clanLevel != p.getClanLevel())) || ((clanLevel >= 0) && (karma >= 0) && ((clanLevel != p.getClanLevel()) || (karma != p.getKarma())))))
.sorted(descending ? CLAN_COMPARATOR.get(sortBy).reversed() : CLAN_COMPARATOR.get(sortBy))
.collect(Collectors.toList());
//@formatter:on

View File

@@ -172,7 +172,7 @@ public final class ClanHallAuctionManager
}
}
public static final ClanHallAuctionManager getInstance()
public static ClanHallAuctionManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -109,7 +109,7 @@ public final class ClanHallManager
}
}
public static final Map<Integer, ClanHall> getAllClanHalls()
public static Map<Integer, ClanHall> getAllClanHalls()
{
return _allClanHalls;
}
@@ -138,7 +138,7 @@ public final class ClanHallManager
return _allAuctionableClanHalls;
}
public static final void addClanHall(ClanHall hall)
public static void addClanHall(ClanHall hall)
{
_allClanHalls.put(hall.getId(), hall);
}

View File

@@ -236,7 +236,7 @@ public final class CommissionManager
return;
}
final long registrationFee = (long) Math.max(MIN_REGISTRATION_AND_SALE_FEE, (totalPrice * REGISTRATION_FEE_PER_DAY) * durationInDays);
final long registrationFee = (long) Math.max(MIN_REGISTRATION_AND_SALE_FEE, totalPrice * REGISTRATION_FEE_PER_DAY * durationInDays);
if (!player.getInventory().reduceAdena("Commission Registration Fee", registrationFee, player, null))
{
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ADENA_TO_REGISTER_THE_ITEM);
@@ -382,7 +382,7 @@ public final class CommissionManager
if (deleteItemFromDB(commissionId))
{
final long saleFee = (long) Math.max(MIN_REGISTRATION_AND_SALE_FEE, (totalPrice * SALE_FEE_PER_DAY) * commissionItem.getDurationInDays());
final long saleFee = (long) Math.max(MIN_REGISTRATION_AND_SALE_FEE, totalPrice * SALE_FEE_PER_DAY * commissionItem.getDurationInDays());
final Message mail = new Message(itemInstance.getOwnerId(), itemInstance, MailType.COMMISSION_ITEM_SOLD);
final Mail attachement = mail.createAttachments();

View File

@@ -136,7 +136,7 @@ public final class CoupleManager
return _couples;
}
public static final CoupleManager getInstance()
public static CoupleManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -412,7 +412,7 @@ public final class CursedWeaponsManager
}
}
public static final CursedWeaponsManager getInstance()
public static CursedWeaponsManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -88,14 +88,11 @@ public final class DuelManager
return;
}
}
else
else if ((playerA.getPvpFlag() != 0) || (playerB.getPvpFlag() != 0))
{
if ((playerA.getPvpFlag() != 0) || (playerB.getPvpFlag() != 0))
{
playerA.sendMessage(engagedInPvP);
playerB.sendMessage(engagedInPvP);
return;
}
playerA.sendMessage(engagedInPvP);
playerB.sendMessage(engagedInPvP);
return;
}
final int duelId = _currentDuelId.incrementAndGet();
_duels.put(duelId, new Duel(playerA, playerB, partyDuel, duelId));
@@ -195,7 +192,7 @@ public final class DuelManager
{
reason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_CURRENTLY_POLYMORPHED;
}
else if (target.isDead() || target.isAlikeDead() || ((target.getCurrentHp() < (target.getMaxHp() / 2)) || (target.getCurrentMp() < (target.getMaxMp() / 2))))
else if (target.isDead() || target.isAlikeDead() || (target.getCurrentHp() < (target.getMaxHp() / 2)) || (target.getCurrentMp() < (target.getMaxMp() / 2)))
{
reason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_S_HP_OR_MP_IS_BELOW_50;
}
@@ -239,7 +236,7 @@ public final class DuelManager
return true;
}
public static final DuelManager getInstance()
public static DuelManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -33,7 +33,7 @@ public final class EventShrineManager
ENABLE_SHRINES = enabled;
}
public static final EventShrineManager getInstance()
public static EventShrineManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -195,7 +195,7 @@ public final class FortManager implements InstanceListManager
}
}
public static final FortManager getInstance()
public static FortManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -260,7 +260,7 @@ public final class FortSiegeManager
public boolean isCombat(int itemId)
{
return (itemId == 9819);
return itemId == 9819;
}
public boolean activateCombatFlag(L2PcInstance player, L2ItemInstance item)
@@ -321,7 +321,7 @@ public final class FortSiegeManager
}
}
public static final FortSiegeManager getInstance()
public static FortSiegeManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -1537,7 +1537,7 @@ public final class FourSepulchersManager
{
continue;
}
((L2SepulcherNpcInstance) temp.getLastSpawn()).sayInShout((min == 90 ? NpcStringId.GAME_OVER_THE_TELEPORT_WILL_APPEAR_MOMENTARILY : NpcStringId.MINUTE_S_HAVE_PASSED));
((L2SepulcherNpcInstance) temp.getLastSpawn()).sayInShout(min == 90 ? NpcStringId.GAME_OVER_THE_TELEPORT_WILL_APPEAR_MOMENTARILY : NpcStringId.MINUTE_S_HAVE_PASSED);
}
}
else if (_inEntryTime)
@@ -1571,7 +1571,7 @@ public final class FourSepulchersManager
player.sendPacket(html);
}
public static final FourSepulchersManager getInstance()
public static FourSepulchersManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -130,7 +130,7 @@ public final class GlobalVariablesManager extends AbstractVariables
* Gets the single instance of {@code GlobalVariablesManager}.
* @return single instance of {@code GlobalVariablesManager}
*/
public static final GlobalVariablesManager getInstance()
public static GlobalVariablesManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -132,13 +132,13 @@ public final class GraciaSeedsManager
public void updateSodState()
{
final Quest quest = QuestManager.getInstance().getQuest(ENERGY_SEEDS);
if (quest == null)
if (quest != null)
{
_log.warning(getClass().getSimpleName() + ": missing EnergySeeds Quest!");
quest.notifyEvent("StopSoDAi", null, null);
}
else
{
quest.notifyEvent("StopSoDAi", null, null);
_log.warning(getClass().getSimpleName() + ": missing EnergySeeds Quest!");
}
}
@@ -155,13 +155,13 @@ public final class GraciaSeedsManager
}
saveData(SODTYPE);
final Quest esQuest = QuestManager.getInstance().getQuest(ENERGY_SEEDS);
if (esQuest == null)
if (esQuest != null)
{
_log.warning(getClass().getSimpleName() + ": missing EnergySeeds Quest!");
esQuest.notifyEvent("StartSoDAi", null, null);
}
else
{
esQuest.notifyEvent("StartSoDAi", null, null);
_log.warning(getClass().getSimpleName() + ": missing EnergySeeds Quest!");
}
}
@@ -199,7 +199,7 @@ public final class GraciaSeedsManager
}
case 2:
{
return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
return (_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis();
}
case 3:
{
@@ -228,7 +228,7 @@ public final class GraciaSeedsManager
* Gets the single instance of {@code GraciaSeedsManager}.
* @return single instance of {@code GraciaSeedsManager}
*/
public static final GraciaSeedsManager getInstance()
public static GraciaSeedsManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -204,7 +204,7 @@ public final class InstanceManager implements IXmlReader
{
return _instanceIdNames.get(id);
}
return ("UnknownInstance");
return "UnknownInstance";
}
@Override
@@ -253,7 +253,7 @@ public final class InstanceManager implements IXmlReader
{
for (InstanceWorld temp : _instanceWorlds.values())
{
if ((temp != null) && (temp.isAllowed(player.getObjectId())))
if ((temp != null) && temp.isAllowed(player.getObjectId()))
{
return temp;
}
@@ -384,7 +384,7 @@ public final class InstanceManager implements IXmlReader
* Gets the single instance of {@code InstanceManager}.
* @return single instance of {@code InstanceManager}
*/
public static final InstanceManager getInstance()
public static InstanceManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -102,7 +102,7 @@ public final class ItemAuctionManager
throw new Exception("Dublicated instanceId " + instanceId);
}
_managerInstances.put(instanceId, (new ItemAuctionInstance(instanceId, _auctionIds, nb)));
_managerInstances.put(instanceId, new ItemAuctionInstance(instanceId, _auctionIds, nb));
}
}
}
@@ -133,7 +133,7 @@ public final class ItemAuctionManager
return _auctionIds.getAndIncrement();
}
public static final void deleteAuction(int auctionId)
public static void deleteAuction(int auctionId)
{
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
@@ -159,7 +159,7 @@ public final class ItemAuctionManager
* Gets the single instance of {@code ItemAuctionManager}.
* @return single instance of {@code ItemAuctionManager}
*/
public static final ItemAuctionManager getInstance()
public static ItemAuctionManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -218,8 +218,8 @@ public final class ItemsOnGroundManager implements Runnable
ps.setInt(5, item.getX());
ps.setInt(6, item.getY());
ps.setInt(7, item.getZ());
ps.setLong(8, (item.isProtected() ? -1 : item.getDropTime())); // item is protected or AutoDestroyed
ps.setLong(9, (item.isEquipable() ? 1 : 0)); // set equip-able
ps.setLong(8, item.isProtected() ? -1 : item.getDropTime()); // item is protected or AutoDestroyed
ps.setLong(9, item.isEquipable() ? 1 : 0); // set equip-able
ps.execute();
ps.clearParameters();
}
@@ -239,7 +239,7 @@ public final class ItemsOnGroundManager implements Runnable
* Gets the single instance of {@code ItemsOnGroundManager}.
* @return single instance of {@code ItemsOnGroundManager}
*/
public static final ItemsOnGroundManager getInstance()
public static ItemsOnGroundManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -200,7 +200,7 @@ public class JumpManager
return;
}
final Track t = getTrack(player.getJumpTrackId());
if (!((t.x == 0) && (t.y == 0) && (t.z == 0)))
if ((t.x != 0) || (t.y != 0) || (t.z != 0))
{
player.broadcastPacket(new FlyToLocation(player, t.x, t.y, t.z, FlyType.DUMMY));
player.setXYZ(t.x, t.y, t.z);
@@ -226,7 +226,7 @@ public class JumpManager
player.setXYZ(n.getX(), n.getY(), n.getZ());
}
public static final JumpManager getInstance()
public static JumpManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -258,7 +258,7 @@ public final class MapRegionManager implements IXmlReader
if (castle == null)
{
castle = CastleManager.getInstance().getCastle(player);
if (!((castle != null) && castle.getSiege().isInProgress() && (castle.getSiege().getDefenderClan(player.getClan()) != null)))
if ((castle == null) || !castle.getSiege().isInProgress() || (castle.getSiege().getDefenderClan(player.getClan()) == null))
{
castle = null;
}
@@ -279,7 +279,7 @@ public final class MapRegionManager implements IXmlReader
if (fort == null)
{
fort = FortManager.getInstance().getFort(player);
if (!((fort != null) && fort.getSiege().isInProgress() && (fort.getOwnerClan() == player.getClan())))
if ((fort == null) || !fort.getSiege().isInProgress() || (fort.getOwnerClan() != player.getClan()))
{
fort = null;
}
@@ -406,7 +406,7 @@ public final class MapRegionManager implements IXmlReader
{
try
{
final L2PcInstance player = ((L2PcInstance) activeChar);
final L2PcInstance player = (L2PcInstance) activeChar;
final L2MapRegion region = _regions.get(point);
if (region.getBannedRace().containsKey(player.getRace()))

View File

@@ -121,7 +121,7 @@ public final class MercTicketManager
for (int i2 = 0; i2 < 50; i2 += 10)
{
// Simplified if statement;
if (((itemId >= ITEM_IDS[i2 + (i * GUARDIAN_TYPES_COUNT)]) && (itemId <= ITEM_IDS[i2 + 9 + (i * GUARDIAN_TYPES_COUNT)])))
if ((itemId >= ITEM_IDS[i2 + (i * GUARDIAN_TYPES_COUNT)]) && (itemId <= ITEM_IDS[i2 + 9 + (i * GUARDIAN_TYPES_COUNT)]))
{
return i + 1;
}
@@ -182,7 +182,7 @@ public final class MercTicketManager
if (NPC_IDS[i] == npcId) // Find the index of the item used
{
// only handle tickets if a siege is not ongoing in this npc's castle
if ((castle != null) && !(castle.getSiege().isInProgress()))
if ((castle != null) && !castle.getSiege().isInProgress())
{
itemId = ITEM_IDS[i];
// create the ticket in the gameworld
@@ -346,7 +346,7 @@ public final class MercTicketManager
final L2DefenderInstance npc = new L2DefenderInstance(template);
npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
npc.setDecayed(false);
npc.spawnMe(x, y, (z + 20));
npc.spawnMe(x, y, z + 20);
if (despawnDelay > 0)
{
npc.scheduleDespawn(despawnDelay);
@@ -413,7 +413,7 @@ public final class MercTicketManager
* Gets the single instance of {@code MercTicketManager}.
* @return single instance of {@code MercTicketManager}
*/
public static final MercTicketManager getInstance()
public static MercTicketManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -85,7 +85,7 @@ public final class PcCafePointsManager
* Gets the single instance of {@code PcCafePointsManager}.
* @return single instance of {@code PcCafePointsManager}
*/
public static final PcCafePointsManager getInstance()
public static PcCafePointsManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -108,12 +108,12 @@ public final class PetitionManager
{
if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId()))
{
return (currPetition.endPetitionConsultation(PetitionState.PETITIONER_CANCEL));
return currPetition.endPetitionConsultation(PetitionState.PETITIONER_CANCEL);
}
if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId()))
{
return (currPetition.endPetitionConsultation(PetitionState.RESPONDER_CANCEL));
return currPetition.endPetitionConsultation(PetitionState.RESPONDER_CANCEL);
}
}
@@ -160,7 +160,7 @@ public final class PetitionManager
if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId()))
{
return (currPetition.endPetitionConsultation(PetitionState.COMPLETED));
return currPetition.endPetitionConsultation(PetitionState.COMPLETED);
}
}
@@ -309,7 +309,7 @@ public final class PetitionManager
}
currPetition.setResponder(respondingAdmin);
return (currPetition.endPetitionConsultation(PetitionState.RESPONDER_REJECT));
return currPetition.endPetitionConsultation(PetitionState.RESPONDER_REJECT);
}
public boolean sendActivePetitionMessage(L2PcInstance player, String messageText)
@@ -374,8 +374,8 @@ public final class PetitionManager
continue;
}
StringUtil.append(htmlContent, "<tr><td width=\"270\"><table width=\"270\" cellpadding=\"2\" bgcolor=", (color ? "131210" : "444444"), "><tr><td width=\"130\">", dateFormat.format(new Date(currPetition.getSubmitTime())));
StringUtil.append(htmlContent, "</td><td width=\"140\" align=right><font color=\"", (currPetition.getPetitioner().isOnline() ? "00FF00" : "999999"), "\">", currPetition.getPetitioner().getName(), "</font></td></tr>");
StringUtil.append(htmlContent, "<tr><td width=\"270\"><table width=\"270\" cellpadding=\"2\" bgcolor=", color ? "131210" : "444444", "><tr><td width=\"130\">", dateFormat.format(new Date(currPetition.getSubmitTime())));
StringUtil.append(htmlContent, "</td><td width=\"140\" align=right><font color=\"", currPetition.getPetitioner().isOnline() ? "00FF00" : "999999", "\">", currPetition.getPetitioner().getName(), "</font></td></tr>");
StringUtil.append(htmlContent, "<tr><td width=\"130\">");
if (currPetition.getState() != PetitionState.IN_PROCESS)
{
@@ -432,7 +432,7 @@ public final class PetitionManager
html.replace("%time%", dateFormat.format(new Date(currPetition.getSubmitTime())));
html.replace("%type%", currPetition.getTypeAsString());
html.replace("%petitioner%", currPetition.getPetitioner().getName());
html.replace("%online%", (currPetition.getPetitioner().isOnline() ? "00FF00" : "999999"));
html.replace("%online%", currPetition.getPetitioner().isOnline() ? "00FF00" : "999999");
html.replace("%text%", currPetition.getContent());
activeChar.sendPacket(html);
@@ -442,7 +442,7 @@ public final class PetitionManager
* Gets the single instance of {@code PetitionManager}.
* @return single instance of {@code PetitionManager}
*/
public static final PetitionManager getInstance()
public static PetitionManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -124,7 +124,7 @@ public class PremiumManager
}
}
public static final PremiumManager getInstance()
public static PremiumManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -123,7 +123,7 @@ public final class PunishmentManager
* Gets the single instance of {@code PunishmentManager}.
* @return single instance of {@code PunishmentManager}
*/
public static final PunishmentManager getInstance()
public static PunishmentManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -187,7 +187,7 @@ public final class QuestManager extends ScriptManager<Quest>
if (Config.ALT_DEV_SHOW_QUESTS_LOAD_IN_LOGS)
{
_log.info("Loaded quest " + Util.splitWords((quest.getName().contains("_") ? quest.getName().substring(quest.getName().indexOf('_') + 1) : quest.getName())) + ".");
_log.info("Loaded quest " + Util.splitWords(quest.getName().contains("_") ? quest.getName().substring(quest.getName().indexOf('_') + 1) : quest.getName()) + ".");
}
}

View File

@@ -242,7 +242,7 @@ public class RaidBossSpawnManager
}
else
{
_schedules.put(bossId, ThreadPoolManager.getInstance().scheduleGeneral(new SpawnSchedule(bossId), (respawnTime - Calendar.getInstance().getTimeInMillis())));
_schedules.put(bossId, ThreadPoolManager.getInstance().scheduleGeneral(new SpawnSchedule(bossId), respawnTime - Calendar.getInstance().getTimeInMillis()));
}
_spawns.put(bossId, spawnDat);

View File

@@ -239,7 +239,7 @@ public final class SiegeGuardManager
ps.setInt(4, y);
ps.setInt(5, z);
ps.setInt(6, heading);
ps.setInt(7, (isHire == 1 ? 0 : 600));
ps.setInt(7, isHire == 1 ? 0 : 600);
ps.setInt(8, isHire);
ps.execute();
}

View File

@@ -294,7 +294,7 @@ public final class SiegeManager
}
}
public static final SiegeManager getInstance()
public static SiegeManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -22,7 +22,7 @@ import com.l2jmobius.gameserver.model.zone.type.L2TownZone;
public final class TownManager
{
public static final int getTownCastle(int townId)
public static int getTownCastle(int townId)
{
switch (townId)
{
@@ -69,7 +69,7 @@ public final class TownManager
}
}
public static final boolean townHasCastleInSiege(int townId)
public static boolean townHasCastleInSiege(int townId)
{
final int castleIndex = getTownCastle(townId);
@@ -84,12 +84,12 @@ public final class TownManager
return false;
}
public static final boolean townHasCastleInSiege(int x, int y)
public static boolean townHasCastleInSiege(int x, int y)
{
return townHasCastleInSiege(MapRegionManager.getInstance().getMapRegionLocId(x, y));
}
public static final L2TownZone getTown(int townId)
public static L2TownZone getTown(int townId)
{
for (L2TownZone temp : ZoneManager.getInstance().getAllZones(L2TownZone.class))
{
@@ -108,7 +108,7 @@ public final class TownManager
* @param z
* @return
*/
public static final L2TownZone getTown(int x, int y, int z)
public static L2TownZone getTown(int x, int y, int z)
{
for (L2ZoneType temp : ZoneManager.getInstance().getZones(x, y, z))
{

View File

@@ -285,36 +285,33 @@ public final class WalkingManager implements IXmlReader
ThreadPoolManager.getInstance().scheduleGeneral(new StartMovingTask(npc, routeName), 60000);
}
}
else
// walk was stopped due to some reason (arrived to node, script action, fight or something else), resume it
else if (_activeRoutes.containsKey(npc.getObjectId()) && ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE) || (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)))
{
if (_activeRoutes.containsKey(npc.getObjectId()) && ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE) || (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)))
final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
if (walk == null)
{
final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
if (walk == null)
{
return;
}
// Prevent call simultaneously from scheduled task and onArrived() or temporarily stop walking for resuming in future
if (walk.isBlocked() || walk.isSuspended())
{
npc.sendDebugMessage("Failed to continue moving along route '" + routeName + "' (operation is blocked)");
return;
}
walk.setBlocked(true);
final L2NpcWalkerNode node = walk.getCurrentNode();
npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId());
npc.setIsRunning(node.runToLocation());
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setBlocked(false);
walk.setStoppedByAttack(false);
return;
}
else
// Prevent call simultaneously from scheduled task and onArrived() or temporarily stop walking for resuming in future
if (walk.isBlocked() || walk.isSuspended())
{
npc.sendDebugMessage("Failed to continue moving along route '" + routeName + "' (wrong AI state - " + npc.getAI().getIntention() + ")");
npc.sendDebugMessage("Failed to continue moving along route '" + routeName + "' (operation is blocked)");
return;
}
walk.setBlocked(true);
final L2NpcWalkerNode node = walk.getCurrentNode();
npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId());
npc.setIsRunning(node.runToLocation());
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setBlocked(false);
walk.setStoppedByAttack(false);
}
else
{
npc.sendDebugMessage("Failed to continue moving along route '" + routeName + "' (wrong AI state - " + npc.getAI().getIntention() + ")");
}
}
}
@@ -455,7 +452,7 @@ public final class WalkingManager implements IXmlReader
}
}
public static final WalkingManager getInstance()
public static WalkingManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -515,11 +515,11 @@ public final class ZoneManager implements IXmlReader
*/
public <T extends L2ZoneType> T getZone(L2Object object, Class<T> type)
{
if (object == null)
if (object != null)
{
return null;
return getZone(object.getX(), object.getY(), object.getZ(), type);
}
return getZone(object.getX(), object.getY(), object.getZ(), type);
return null;
}
/**
@@ -631,7 +631,7 @@ public final class ZoneManager implements IXmlReader
{
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
{
return ((L2ArenaZone) temp);
return (L2ArenaZone) temp;
}
}
@@ -654,7 +654,7 @@ public final class ZoneManager implements IXmlReader
{
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
{
return ((L2OlympiadStadiumZone) temp);
return (L2OlympiadStadiumZone) temp;
}
}
return null;
@@ -734,7 +734,7 @@ public final class ZoneManager implements IXmlReader
* Gets the single instance of ZoneManager.
* @return single instance of ZoneManager
*/
public static final ZoneManager getInstance()
public static ZoneManager getInstance()
{
return SingletonHolder._instance;
}

View File

@@ -78,7 +78,7 @@ public abstract class AbstractPlayerGroup
*/
public boolean isLeader(L2PcInstance player)
{
return (getLeaderObjectId() == player.getObjectId());
return getLeaderObjectId() == player.getObjectId();
}
/**

View File

@@ -56,8 +56,7 @@ public final class ArenaParticipantsHolder
public List<L2PcInstance> getAllPlayers()
{
final List<L2PcInstance> all = new ArrayList<>(12);
all.addAll(_redPlayers);
final List<L2PcInstance> all = new ArrayList<>(_redPlayers);
all.addAll(_bluePlayers);
return all;
}

View File

@@ -100,7 +100,7 @@ public class AutoSpawnHandler
{
if (asi != null)
{
this.removeSpawn(asi);
removeSpawn(asi);
}
}
@@ -314,7 +314,7 @@ public class AutoSpawnHandler
public final long getTimeToNextSpawn(AutoSpawnInstance spawnInst)
{
final int objectId = spawnInst.getObjectId();
return !isSpawnRegistered(objectId) ? -1 : (_runningSpawns.containsKey(objectId)) ? _runningSpawns.get(objectId).getDelay(TimeUnit.MILLISECONDS) : 0;
return !isSpawnRegistered(objectId) ? -1 : _runningSpawns.containsKey(objectId) ? _runningSpawns.get(objectId).getDelay(TimeUnit.MILLISECONDS) : 0;
}
/**
@@ -486,7 +486,7 @@ public class AutoSpawnHandler
// If there is no despawn time, do not create a despawn task.
if (spawnInst.getDespawnDelay() > 0)
{
ThreadPoolManager.getInstance().scheduleAi((new AutoDespawner(_objectId)), spawnInst.getDespawnDelay() - 1000);
ThreadPoolManager.getInstance().scheduleAi(new AutoDespawner(_objectId), spawnInst.getDespawnDelay() - 1000);
}
}
catch (Exception e)

View File

@@ -515,13 +515,13 @@ public final class CharEffectList
if (_owner.isPlayer())
{
_shortBuff = info;
if (info == null)
if (info != null)
{
_owner.sendPacket(ShortBuffStatusUpdate.RESET_SHORT_BUFF);
_owner.sendPacket(new ShortBuffStatusUpdate(info.getSkill().getId(), info.getSkill().getLevel(), info.getTime()));
}
else
{
_owner.sendPacket(new ShortBuffStatusUpdate(info.getSkill().getId(), info.getSkill().getLevel(), info.getTime()));
_owner.sendPacket(ShortBuffStatusUpdate.RESET_SHORT_BUFF);
}
}
}

View File

@@ -165,42 +165,39 @@ public class CursedWeapon implements INamable
}
}
}
else
// either this cursed weapon is in the inventory of someone who has another cursed weapon equipped,
// OR this cursed weapon is on the ground.
else if ((_player != null) && (_player.getInventory().getItemByItemId(_itemId) != null))
{
// either this cursed weapon is in the inventory of someone who has another cursed weapon equipped,
// OR this cursed weapon is on the ground.
if ((_player != null) && (_player.getInventory().getItemByItemId(_itemId) != null))
// Destroy
final L2ItemInstance removedItem = _player.getInventory().destroyItemByItemId("", _itemId, 1, _player, null);
if (!Config.FORCE_INVENTORY_UPDATE)
{
// Destroy
final L2ItemInstance removedItem = _player.getInventory().destroyItemByItemId("", _itemId, 1, _player, null);
if (!Config.FORCE_INVENTORY_UPDATE)
final InventoryUpdate iu = new InventoryUpdate();
if (removedItem.getCount() == 0)
{
final InventoryUpdate iu = new InventoryUpdate();
if (removedItem.getCount() == 0)
{
iu.addRemovedItem(removedItem);
}
else
{
iu.addModifiedItem(removedItem);
}
_player.sendPacket(iu);
iu.addRemovedItem(removedItem);
}
else
{
_player.sendPacket(new ItemList(_player, true));
iu.addModifiedItem(removedItem);
}
_player.broadcastUserInfo();
_player.sendPacket(iu);
}
// is dropped on the ground
else if (_item != null)
else
{
_item.decayMe();
L2World.getInstance().removeObject(_item);
_log.info(_name + " item has been removed from World.");
_player.sendPacket(new ItemList(_player, true));
}
_player.broadcastUserInfo();
}
// is dropped on the ground
else if (_item != null)
{
_item.decayMe();
L2World.getInstance().removeObject(_item);
_log.info(_name + " item has been removed from World.");
}
// Delete infos from table if any
@@ -692,7 +689,7 @@ public class CursedWeapon implements INamable
{
return _skillMaxLevel;
}
return (_nbKills / _stageKills);
return _nbKills / _stageKills;
}
public long getTimeLeft()

View File

@@ -116,17 +116,17 @@ public class ItemInfo
// Get the action to do clientside
switch (item.getLastChange())
{
case (L2ItemInstance.ADDED):
case L2ItemInstance.ADDED:
{
_change = 1;
break;
}
case (L2ItemInstance.MODIFIED):
case L2ItemInstance.MODIFIED:
{
_change = 2;
break;
}
case (L2ItemInstance.REMOVED):
case L2ItemInstance.REMOVED:
{
_change = 3;
break;

View File

@@ -210,6 +210,6 @@ public class L2AccessLevel
_childsAccessLevel = AdminData.getInstance().getAccessLevel(_child);
}
return ((_childsAccessLevel.getLevel() == accessLevel.getLevel()) || _childsAccessLevel.hasChildAccess(accessLevel));
return (_childsAccessLevel.getLevel() == accessLevel.getLevel()) || _childsAccessLevel.hasChildAccess(accessLevel);
}
}

Some files were not shown because too many files have changed in this diff Show More