Minor Rnd method usage corrections.

This commit is contained in:
MobiusDev
2018-09-14 01:42:50 +00:00
parent b4e8040541
commit a2604e2048
55 changed files with 114 additions and 130 deletions

View File

@@ -63,8 +63,8 @@ public class L2ControllableMobAI extends L2AttackableAI
if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true))
{
final int signX = Rnd.get(2) == 0 ? -1 : 1;
final int signY = Rnd.get(2) == 0 ? -1 : 1;
final int signX = Rnd.nextBoolean() ? -1 : 1;
final int signY = Rnd.nextBoolean() ? -1 : 1;
final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE);
final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE);

View File

@@ -1256,7 +1256,7 @@ public class FourSepulchersManager extends GrandBossManager
List<L2SepulcherMonsterInstance> mobs = new ArrayList<>();
L2Spawn keyBoxMobSpawn;
if (Rnd.get(2) == 0)
if (Rnd.nextBoolean())
{
monsterList = _physicalMonsters.get(npcId);
}

View File

@@ -149,8 +149,8 @@ public final class MobGroup
{
L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate);
final int signX = Rnd.get(2) == 0 ? -1 : 1;
final int signY = Rnd.get(2) == 0 ? -1 : 1;
final int signX = Rnd.nextBoolean() ? -1 : 1;
final int signY = Rnd.nextBoolean() ? -1 : 1;
final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE);
final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE);
@@ -324,8 +324,8 @@ public final class MobGroup
continue;
}
final int signX = Rnd.get(2) == 0 ? -1 : 1;
final int signY = Rnd.get(2) == 0 ? -1 : 1;
final int signX = Rnd.nextBoolean() ? -1 : 1;
final int signY = Rnd.nextBoolean() ? -1 : 1;
final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE);
final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE);

View File

@@ -4730,8 +4730,6 @@ public class SevenSignsFestival implements SpawnListener
*/
protected void festivalInit()
{
boolean isPositive;
if (Config.DEBUG)
{
LOGGER.info("SevenSignsFestival: Initializing festival for " + SevenSigns.getCabalShortName(_cabal) + " (" + getFestivalName(_levelRange) + ")");
@@ -4750,9 +4748,7 @@ public class SevenSignsFestival implements SpawnListener
int x = _startLocation._x;
int y = _startLocation._y;
isPositive = Rnd.get(2) == 1;
if (isPositive)
if (Rnd.nextBoolean())
{
x += Rnd.get(FESTIVAL_MAX_OFFSET_X);
y += Rnd.get(FESTIVAL_MAX_OFFSET_Y);
@@ -4843,8 +4839,6 @@ public class SevenSignsFestival implements SpawnListener
*/
protected void moveMonstersToCenter()
{
boolean isPositive;
if (Config.DEBUG)
{
LOGGER.info("SevenSignsFestival: Moving spawns to arena center for festival " + SevenSigns.getCabalShortName(_cabal) + " (" + getFestivalName(_levelRange) + ")");
@@ -4871,9 +4865,7 @@ public class SevenSignsFestival implements SpawnListener
/*
* Random X and Y coords around the player start location, up to half of the maximum allowed offset are generated to prevent the mobs from all moving to the exact same place.
*/
isPositive = Rnd.get(2) == 1;
if (isPositive)
if (Rnd.nextBoolean())
{
x += Rnd.get(FESTIVAL_MAX_OFFSET_X);
y += Rnd.get(FESTIVAL_MAX_OFFSET_Y);