Replaced assignments with compound operators.
This commit is contained in:
@@ -181,7 +181,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2)
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i += 2)
|
||||
{
|
||||
// test 3 skills if some is lvl 4
|
||||
if (_zone.getSkillLevel(i) > 3)
|
||||
@@ -218,7 +218,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2)
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i += 2)
|
||||
{
|
||||
_zone.removeSkill(i);
|
||||
}
|
||||
|
@@ -90,7 +90,7 @@ public final class Anais extends AbstractNpcAI
|
||||
final L2Object target = npc.getTarget();
|
||||
_nextTarget = (target != null) && target.isPlayer() ? (L2PcInstance) target : null;
|
||||
final L2Npc b = _divineBurners.get(_pot);
|
||||
_pot = _pot + 1;
|
||||
_pot += 1;
|
||||
b.setDisplayEffect(1);
|
||||
b.setWalking();
|
||||
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||
|
@@ -1266,7 +1266,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
name = player.getName();
|
||||
if (name.toLowerCase().contains(CharacterToFind.toLowerCase()))
|
||||
{
|
||||
CharactersFound = CharactersFound + 1;
|
||||
CharactersFound += 1;
|
||||
replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_info ");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("\">");
|
||||
@@ -1366,7 +1366,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
name = player.getName();
|
||||
CharactersFound = CharactersFound + 1;
|
||||
CharactersFound += 1;
|
||||
replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_info ");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("\">");
|
||||
|
@@ -311,7 +311,7 @@ public final class Q00386_StolenDignity extends Quest
|
||||
|
||||
private String fillBoard(L2PcInstance player, QuestState qs, String html)
|
||||
{
|
||||
for (int i0 = 0; i0 < 9; i0 = i0 + 1)
|
||||
for (int i0 = 0; i0 < 9; i0 += 1)
|
||||
{
|
||||
final int i1 = getNumberFromBingoBoard(qs, i0);
|
||||
if (isSelectedBingoNumber(qs, i1))
|
||||
@@ -328,7 +328,7 @@ public final class Q00386_StolenDignity extends Quest
|
||||
|
||||
private String colorBoard(L2PcInstance player, QuestState qs, String html)
|
||||
{
|
||||
for (int i0 = 0; i0 < 9; i0 = i0 + 1)
|
||||
for (int i0 = 0; i0 < 9; i0 += 1)
|
||||
{
|
||||
final int i1 = getNumberFromBingoBoard(qs, i0);
|
||||
html = html.replace("<?FontColor" + (i0 + 1) + "?>", isSelectedBingoNumber(qs, i1) ? "ff0000" : "ffffff");
|
||||
|
@@ -150,83 +150,83 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
}
|
||||
if (i1 >= 57)
|
||||
{
|
||||
i1 = i1 - 56;
|
||||
i1 -= 56;
|
||||
}
|
||||
else if (i1 >= 43)
|
||||
{
|
||||
i1 = i1 - 42;
|
||||
i1 -= 42;
|
||||
}
|
||||
else if (i1 >= 29)
|
||||
{
|
||||
i1 = i1 - 28;
|
||||
i1 -= 28;
|
||||
}
|
||||
else if (i1 >= 15)
|
||||
{
|
||||
i1 = i1 - 14;
|
||||
i1 -= 14;
|
||||
}
|
||||
if (i2 >= 57)
|
||||
{
|
||||
i2 = i2 - 56;
|
||||
i2 -= 56;
|
||||
}
|
||||
else if (i2 >= 43)
|
||||
{
|
||||
i2 = i2 - 42;
|
||||
i2 -= 42;
|
||||
}
|
||||
else if (i2 >= 29)
|
||||
{
|
||||
i2 = i2 - 28;
|
||||
i2 -= 28;
|
||||
}
|
||||
else if (i2 >= 15)
|
||||
{
|
||||
i2 = i2 - 14;
|
||||
i2 -= 14;
|
||||
}
|
||||
if (i3 >= 57)
|
||||
{
|
||||
i3 = i3 - 56;
|
||||
i3 -= 56;
|
||||
}
|
||||
else if (i3 >= 43)
|
||||
{
|
||||
i3 = i3 - 42;
|
||||
i3 -= 42;
|
||||
}
|
||||
else if (i3 >= 29)
|
||||
{
|
||||
i3 = i3 - 28;
|
||||
i3 -= 28;
|
||||
}
|
||||
else if (i3 >= 15)
|
||||
{
|
||||
i3 = i3 - 14;
|
||||
i3 -= 14;
|
||||
}
|
||||
if (i4 >= 57)
|
||||
{
|
||||
i4 = i4 - 56;
|
||||
i4 -= 56;
|
||||
}
|
||||
else if (i4 >= 43)
|
||||
{
|
||||
i4 = i4 - 42;
|
||||
i4 -= 42;
|
||||
}
|
||||
else if (i4 >= 29)
|
||||
{
|
||||
i4 = i4 - 28;
|
||||
i4 -= 28;
|
||||
}
|
||||
else if (i4 >= 15)
|
||||
{
|
||||
i4 = i4 - 14;
|
||||
i4 -= 14;
|
||||
}
|
||||
if (i5 >= 57)
|
||||
{
|
||||
i5 = i5 - 56;
|
||||
i5 -= 56;
|
||||
}
|
||||
else if (i5 >= 43)
|
||||
{
|
||||
i5 = i5 - 42;
|
||||
i5 -= 42;
|
||||
}
|
||||
else if (i5 >= 29)
|
||||
{
|
||||
i5 = i5 - 28;
|
||||
i5 -= 28;
|
||||
}
|
||||
else if (i5 >= 15)
|
||||
{
|
||||
i5 = i5 - 14;
|
||||
i5 -= 14;
|
||||
}
|
||||
|
||||
st.setCond((i4 * 1000000) + (i3 * 10000) + (i2 * 100) + i1);
|
||||
@@ -256,7 +256,7 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if ((i9 % 2) < 1)
|
||||
{
|
||||
i9 = i9 + 1;
|
||||
i9 += 1;
|
||||
}
|
||||
if ((i9 % 32) < 31)
|
||||
{
|
||||
@@ -268,7 +268,7 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if ((i9 % 4) < 2)
|
||||
{
|
||||
i9 = i9 + 2;
|
||||
i9 += 2;
|
||||
}
|
||||
if ((i9 % 32) < 31)
|
||||
{
|
||||
@@ -280,7 +280,7 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if ((i9 % 8) < 4)
|
||||
{
|
||||
i9 = i9 + 4;
|
||||
i9 += 4;
|
||||
}
|
||||
if ((i9 % 32) < 31)
|
||||
{
|
||||
@@ -292,7 +292,7 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if ((i9 % 16) < 8)
|
||||
{
|
||||
i9 = i9 + 8;
|
||||
i9 += 8;
|
||||
}
|
||||
if ((i9 % 32) < 31)
|
||||
{
|
||||
@@ -304,7 +304,7 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if ((i9 % 32) < 16)
|
||||
{
|
||||
i9 = i9 + 16;
|
||||
i9 += 16;
|
||||
}
|
||||
if ((i9 % 32) < 31)
|
||||
{
|
||||
@@ -326,23 +326,23 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i1 == i2)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 8;
|
||||
i6 += 10;
|
||||
i8 += 8;
|
||||
}
|
||||
if (i1 == i3)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 4;
|
||||
i6 += 10;
|
||||
i8 += 4;
|
||||
}
|
||||
if (i1 == i4)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 2;
|
||||
i6 += 10;
|
||||
i8 += 2;
|
||||
}
|
||||
if (i1 == i5)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 1;
|
||||
i6 += 10;
|
||||
i8 += 1;
|
||||
}
|
||||
if ((i6 % 100) < 10)
|
||||
{
|
||||
@@ -352,24 +352,24 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i2 == i3)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 4;
|
||||
i6 += 10;
|
||||
i8 += 4;
|
||||
}
|
||||
}
|
||||
if ((i8 % 4) < 2)
|
||||
{
|
||||
if (i2 == i4)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 2;
|
||||
i6 += 10;
|
||||
i8 += 2;
|
||||
}
|
||||
}
|
||||
if ((i8 % 2) < 1)
|
||||
{
|
||||
if (i2 == i5)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 1;
|
||||
i6 += 10;
|
||||
i8 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,24 +382,24 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i2 == i3)
|
||||
{
|
||||
i6 = i6 + 1;
|
||||
i8 = i8 + 4;
|
||||
i6 += 1;
|
||||
i8 += 4;
|
||||
}
|
||||
}
|
||||
if ((i8 % 4) < 2)
|
||||
{
|
||||
if (i2 == i4)
|
||||
{
|
||||
i6 = i6 + 1;
|
||||
i8 = i8 + 2;
|
||||
i6 += 1;
|
||||
i8 += 2;
|
||||
}
|
||||
}
|
||||
if ((i8 % 2) < 1)
|
||||
{
|
||||
if (i2 == i5)
|
||||
{
|
||||
i6 = i6 + 1;
|
||||
i8 = i8 + 1;
|
||||
i6 += 1;
|
||||
i8 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -412,16 +412,16 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i3 == i4)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 2;
|
||||
i6 += 10;
|
||||
i8 += 2;
|
||||
}
|
||||
}
|
||||
if ((i8 % 2) < 1)
|
||||
{
|
||||
if (i3 == i5)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 1;
|
||||
i6 += 10;
|
||||
i8 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,16 +434,16 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i3 == i4)
|
||||
{
|
||||
i6 = i6 + 1;
|
||||
i8 = i8 + 2;
|
||||
i6 += 1;
|
||||
i8 += 2;
|
||||
}
|
||||
}
|
||||
if ((i8 % 2) < 1)
|
||||
{
|
||||
if (i3 == i5)
|
||||
{
|
||||
i6 = i6 + 1;
|
||||
i8 = i8 + 1;
|
||||
i6 += 1;
|
||||
i8 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -456,8 +456,8 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i4 == i5)
|
||||
{
|
||||
i6 = i6 + 10;
|
||||
i8 = i8 + 1;
|
||||
i6 += 10;
|
||||
i8 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -470,8 +470,8 @@ public final class Q00662_AGameOfCards extends Quest
|
||||
{
|
||||
if (i4 == i5)
|
||||
{
|
||||
i6 = i6 + 1;
|
||||
i8 = i8 + 1;
|
||||
i6 += 1;
|
||||
i8 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -187,7 +187,7 @@ public class LoginServerThread extends Thread
|
||||
while ((newBytes != -1) && (receivedBytes < (length - 2)))
|
||||
{
|
||||
newBytes = in.read(incoming, receivedBytes, left);
|
||||
receivedBytes = receivedBytes + newBytes;
|
||||
receivedBytes += newBytes;
|
||||
left -= newBytes;
|
||||
}
|
||||
|
||||
|
@@ -125,7 +125,7 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
int newX = combinedCollision + Rnd.get(40);
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
newX = originalAttackTarget.getX() + newX;
|
||||
newX += originalAttackTarget.getX();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -134,7 +134,7 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
int newY = combinedCollision + Rnd.get(40);
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
newY = originalAttackTarget.getY() + newY;
|
||||
newY += originalAttackTarget.getY();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,20 +167,20 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
|
||||
if (originalAttackTarget.getX() < posX)
|
||||
{
|
||||
posX = posX + 300;
|
||||
posX += 300;
|
||||
}
|
||||
else
|
||||
{
|
||||
posX = posX - 300;
|
||||
posX -= 300;
|
||||
}
|
||||
|
||||
if (originalAttackTarget.getY() < posY)
|
||||
{
|
||||
posY = posY + 300;
|
||||
posY += 300;
|
||||
}
|
||||
else
|
||||
{
|
||||
posY = posY - 300;
|
||||
posY -= 300;
|
||||
}
|
||||
|
||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceWorld()))
|
||||
@@ -197,10 +197,10 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
int range = npc.getPhysicalAttackRange() + combinedCollision;
|
||||
if (originalAttackTarget.isMoving())
|
||||
{
|
||||
range = range + 50;
|
||||
range += 50;
|
||||
if (npc.isMoving())
|
||||
{
|
||||
range = range + 50;
|
||||
range += 50;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -757,7 +757,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
int newX = combinedCollision + Rnd.get(40);
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
newX = target.getX() + newX;
|
||||
newX += target.getX();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -766,7 +766,7 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
int newY = combinedCollision + Rnd.get(40);
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
newY = target.getY() + newY;
|
||||
newY += target.getY();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -799,20 +799,20 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
|
||||
if (target.getX() < posX)
|
||||
{
|
||||
posX = posX + 300;
|
||||
posX += 300;
|
||||
}
|
||||
else
|
||||
{
|
||||
posX = posX - 300;
|
||||
posX -= 300;
|
||||
}
|
||||
|
||||
if (target.getY() < posY)
|
||||
{
|
||||
posY = posY + 300;
|
||||
posY += 300;
|
||||
}
|
||||
else
|
||||
{
|
||||
posY = posY - 300;
|
||||
posY -= 300;
|
||||
}
|
||||
|
||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceWorld()))
|
||||
|
@@ -132,7 +132,7 @@ public class StackIDFactory extends IdFactory
|
||||
else
|
||||
{
|
||||
id = _curOID;
|
||||
_curOID = _curOID + 1;
|
||||
_curOID += 1;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
@@ -813,7 +813,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
int heading = Util.calculateHeadingFrom(this, target) - _heading;
|
||||
if (heading < 0)
|
||||
{
|
||||
heading = 65535 + heading;
|
||||
heading += 65535;
|
||||
}
|
||||
return Util.convertHeadingToDegree(heading);
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ public final class L2TamedBeastInstance extends L2FeedableBeastInstance
|
||||
public void onReceiveFood()
|
||||
{
|
||||
// Eating food extends the duration by 20secs, to a max of 20minutes
|
||||
_remainingTime = _remainingTime + DURATION_INCREASE_INTERVAL;
|
||||
_remainingTime += DURATION_INCREASE_INTERVAL;
|
||||
if (_remainingTime > MAX_DURATION)
|
||||
{
|
||||
_remainingTime = MAX_DURATION;
|
||||
|
@@ -199,7 +199,7 @@ public class Hero
|
||||
private String calcFightTime(long FightTime)
|
||||
{
|
||||
final String format = String.format("%%0%dd", 2);
|
||||
FightTime = FightTime / 1000;
|
||||
FightTime /= 1000;
|
||||
final String seconds = String.format(format, FightTime % 60);
|
||||
final String minutes = String.format(format, (FightTime % 3600) / 60);
|
||||
return minutes + ":" + seconds;
|
||||
|
@@ -256,7 +256,7 @@ public final class Formulas
|
||||
// Autoattack critical depends on level difference at high levels as well.
|
||||
if ((activeChar.getLevel() >= 78) || (target.getLevel() >= 78))
|
||||
{
|
||||
rate = rate + (Math.sqrt(activeChar.getLevel()) * (activeChar.getLevel() - target.getLevel()) * 0.125);
|
||||
rate += (Math.sqrt(activeChar.getLevel()) * (activeChar.getLevel() - target.getLevel()) * 0.125);
|
||||
}
|
||||
|
||||
// Autoattack critical rate is limited between 3%-97%.
|
||||
|
@@ -112,13 +112,13 @@ public class ZoneCuboid extends L2ZoneForm
|
||||
final int _y2 = _r.y + _r.height;
|
||||
|
||||
// x1->x2
|
||||
for (int x = _x1; x < _x2; x = x + STEP)
|
||||
for (int x = _x1; x < _x2; x += STEP)
|
||||
{
|
||||
dropDebugItem(Inventory.ADENA_ID, 1, x, _y1, z);
|
||||
dropDebugItem(Inventory.ADENA_ID, 1, x, _y2, z);
|
||||
}
|
||||
// y1->y2
|
||||
for (int y = _y1; y < _y2; y = y + STEP)
|
||||
for (int y = _y1; y < _y2; y += STEP)
|
||||
{
|
||||
dropDebugItem(Inventory.ADENA_ID, 1, _x1, y, z);
|
||||
dropDebugItem(Inventory.ADENA_ID, 1, _x2, y, z);
|
||||
|
@@ -87,7 +87,7 @@ public final class Util
|
||||
double angleTarget = Math.toDegrees(Math.atan2(toY - fromY, toX - fromX));
|
||||
if (angleTarget < 0)
|
||||
{
|
||||
angleTarget = 360 + angleTarget;
|
||||
angleTarget += 360;
|
||||
}
|
||||
return angleTarget;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public final class Util
|
||||
double angleTarget = Math.toDegrees(Math.atan2(toY - fromY, toX - fromX));
|
||||
if (angleTarget < 0)
|
||||
{
|
||||
angleTarget = 360 + angleTarget;
|
||||
angleTarget += 360;
|
||||
}
|
||||
return (int) (angleTarget * 182.044444444);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public final class Util
|
||||
double angleTarget = Math.toDegrees(Math.atan2(dy, dx));
|
||||
if (angleTarget < 0)
|
||||
{
|
||||
angleTarget = 360 + angleTarget;
|
||||
angleTarget += 360;
|
||||
}
|
||||
return (int) (angleTarget * 182.044444444);
|
||||
}
|
||||
|
@@ -104,7 +104,7 @@ public class GameServerThread extends Thread
|
||||
while ((newBytes != -1) && (receivedBytes < (length - 2)))
|
||||
{
|
||||
newBytes = _in.read(data, receivedBytes, left);
|
||||
receivedBytes = receivedBytes + newBytes;
|
||||
receivedBytes += newBytes;
|
||||
left -= newBytes;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user