diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 3d32942dd5..7665345773 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 3d32942dd5..7665345773 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 3d32942dd5..7665345773 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 3d32942dd5..7665345773 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 3d32942dd5..7665345773 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 3d32942dd5..7665345773 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 94b33192c9..5232d1bc06 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -557,8 +557,8 @@ public class L2AttackableAI extends L2CharacterAI int y1; int z1; - x1 = (((L2MinionInstance) _actor).getLeader().getX() + Rnd.nextInt((offset - 30) * 2)) - (offset - 30); - y1 = (((L2MinionInstance) _actor).getLeader().getY() + Rnd.nextInt((offset - 30) * 2)) - (offset - 30); + x1 = (((L2MinionInstance) _actor).getLeader().getX() + Rnd.get((offset - 30) * 2)) - (offset - 30); + y1 = (((L2MinionInstance) _actor).getLeader().getY() + Rnd.get((offset - 30) * 2)) - (offset - 30); z1 = ((L2MinionInstance) _actor).getLeader().getZ(); // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast) moveTo(x1, y1, z1); @@ -566,7 +566,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if (!(npc instanceof L2ChestInstance) && (npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0)) + else if (!(npc instanceof L2ChestInstance) && (npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0)) { int x1; int y1; @@ -610,8 +610,8 @@ public class L2AttackableAI extends L2CharacterAI } // If NPC with fixed coord - x1 = (npc.getSpawn().getX() + Rnd.nextInt(Config.MAX_DRIFT_RANGE * 2)) - Config.MAX_DRIFT_RANGE; - y1 = (npc.getSpawn().getY() + Rnd.nextInt(Config.MAX_DRIFT_RANGE * 2)) - Config.MAX_DRIFT_RANGE; + x1 = (npc.getSpawn().getX() + Rnd.get(Config.MAX_DRIFT_RANGE * 2)) - Config.MAX_DRIFT_RANGE; + y1 = (npc.getSpawn().getY() + Rnd.get(Config.MAX_DRIFT_RANGE * 2)) - Config.MAX_DRIFT_RANGE; z1 = npc.getZ(); } @@ -772,7 +772,7 @@ public class L2AttackableAI extends L2CharacterAI // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running // around player without any sense, so decrease chance for now - if (!_actor.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!_actor.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Object nearby : _actor.getKnownList().getKnownObjects().values()) { @@ -879,7 +879,7 @@ public class L2AttackableAI extends L2CharacterAI if (dist2 > (range * range)) { // check for long ranged skills and heal/buff skills - if (!_actor.isMuted() && (!Config.ALT_GAME_MOB_ATTACK_AI || ((_actor instanceof L2MonsterInstance) && (Rnd.nextInt(100) <= 5)))) + if (!_actor.isMuted() && (!Config.ALT_GAME_MOB_ATTACK_AI || ((_actor instanceof L2MonsterInstance) && (Rnd.get(100) <= 5)))) { for (L2Skill sk : skills) { @@ -891,7 +891,7 @@ public class L2AttackableAI extends L2CharacterAI _inRange = true; } - if (((sk.getSkillType() == L2Skill.SkillType.BUFF) || (sk.getSkillType() == L2Skill.SkillType.HEAL) || _inRange) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !sk.isPassive() && (Rnd.nextInt(100) <= 5)) + if (((sk.getSkillType() == L2Skill.SkillType.BUFF) || (sk.getSkillType() == L2Skill.SkillType.HEAL) || _inRange) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !sk.isPassive() && (Rnd.get(100) <= 5)) { if ((sk.getSkillType() == L2Skill.SkillType.BUFF) || (sk.getSkillType() == L2Skill.SkillType.HEAL)) { @@ -959,7 +959,7 @@ public class L2AttackableAI extends L2CharacterAI for (L2Skill sk : skills) { - if (/* sk.getCastRange() >= dist && sk.getCastRange() <= 70 && */!sk.isPassive() && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !_actor.isSkillDisabled(sk) && ((Rnd.nextInt(100) <= 8) || ((_actor instanceof L2PenaltyMonsterInstance) && (Rnd.nextInt(100) <= 20)))) + if (/* sk.getCastRange() >= dist && sk.getCastRange() <= 70 && */!sk.isPassive() && (_actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk)) && !_actor.isSkillDisabled(sk) && ((Rnd.get(100) <= 8) || ((_actor instanceof L2PenaltyMonsterInstance) && (Rnd.get(100) <= 20)))) { if ((sk.getSkillType() == L2Skill.SkillType.BUFF) || (sk.getSkillType() == L2Skill.SkillType.HEAL)) { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index f4eb39855f..df13088359 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = Rnd.nextInt(2) == 0 ? -1 : 1; - final int signY = Rnd.nextInt(2) == 0 ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = Rnd.get(2) == 0 ? -1 : 1; + final int signY = Rnd.get(2) == 0 ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -344,7 +344,7 @@ public class L2ControllableMobAI extends L2AttackableAI setAttackTarget(hated); } - if (!_actor.isMuted() && (skills.length > 0) && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (skills.length > 0) && (Rnd.get(5) == 3)) { for (L2Skill sk : skills) { @@ -476,7 +476,7 @@ public class L2ControllableMobAI extends L2AttackableAI } // we choose a random target - final int choice = Rnd.nextInt(potentialTarget.size()); + final int choice = Rnd.get(potentialTarget.size()); final L2Character target = potentialTarget.get(choice); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java index 6becd2bacd..21ed4fd855 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java @@ -802,7 +802,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable _attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getGameTicks(); // check for close combat skills && heal/buff skills - if (!_actor.isMuted() && (Rnd.nextInt(100) <= 5)) + if (!_actor.isMuted() && (Rnd.get(100) <= 5)) { for (L2Skill sk : skills) { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java index f1d157906a..c4e64a9dc7 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java @@ -374,7 +374,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable if (!_actor.isMuted() && (dist_2 > ((range + 20) * (range + 20)))) { // check for long ranged skills and heal/buff skills - if (!Config.ALT_GAME_MOB_ATTACK_AI || ((_actor instanceof L2MonsterInstance) && (Rnd.nextInt(100) <= 5))) + if (!Config.ALT_GAME_MOB_ATTACK_AI || ((_actor instanceof L2MonsterInstance) && (Rnd.get(100) <= 5))) { for (L2Skill sk : skills) { @@ -500,7 +500,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable _attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getGameTicks(); // check for close combat skills && heal/buff skills - if (!_actor.isMuted() && (Rnd.nextInt(100) <= 5)) + if (!_actor.isMuted() && (Rnd.get(100) <= 5)) { for (L2Skill sk : skills) { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java index 031c0b621e..d28fb564aa 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java @@ -759,7 +759,7 @@ public class AutoChatHandler implements SpawnListener } final int maxIndex = chatDef.getChatTexts().length; - int lastIndex = Rnd.nextInt(maxIndex); + int lastIndex = Rnd.get(maxIndex); String creatureName = chatNpc.getName(); String text; @@ -786,7 +786,7 @@ public class AutoChatHandler implements SpawnListener if (!nearbyPlayers.isEmpty()) { - final int randomPlayerIndex = Rnd.nextInt(nearbyPlayers.size()); + final int randomPlayerIndex = Rnd.get(nearbyPlayers.size()); L2PcInstance randomPlayer = nearbyPlayers.get(randomPlayerIndex); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Harvest.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Harvest.java index 002efccf2f..50d843a834 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Harvest.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Harvest.java @@ -182,7 +182,7 @@ public class Harvest implements ISkillHandler basicSuccess = 1; } - final int rate = Rnd.nextInt(99); + final int rate = Rnd.get(99); if (rate < basicSuccess) { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Sow.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Sow.java index eab1b61bd2..3b05ea120b 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Sow.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/Sow.java @@ -185,7 +185,7 @@ public class Sow implements ISkillHandler basicSuccess = 1; } - final int rate = Rnd.nextInt(99); + final int rate = Rnd.get(99); return (rate < basicSuccess); } diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Territory.java index cbe0d21234..16b2d12266 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -158,7 +158,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (i = 0; i < _points.length; i++) { final Point p1 = _points[i]; diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/MobGroup.java index 774e29db69..c50cc10b47 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -149,10 +149,10 @@ public final class MobGroup { L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = Rnd.nextInt(2) == 0 ? -1 : 1; - final int signY = Rnd.nextInt(2) == 0 ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = Rnd.get(2) == 0 ? -1 : 1; + final int signY = Rnd.get(2) == 0 ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setX(x + (signX * randX)); spawn.setY(y + (signY * randY)); @@ -191,8 +191,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(x, y, player.getZ(), true); L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); @@ -210,7 +210,7 @@ public final class MobGroup return null; } - final int choice = Rnd.nextInt(getMobs().size()); + final int choice = Rnd.get(getMobs().size()); return getMobs().get(choice); } @@ -324,10 +324,10 @@ public final class MobGroup continue; } - final int signX = Rnd.nextInt(2) == 0 ? -1 : 1; - final int signY = Rnd.nextInt(2) == 0 ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = Rnd.get(2) == 0 ? -1 : 1; + final int signY = Rnd.get(2) == 0 ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 152aaae1ea..7f0d33e70b 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -93,7 +93,7 @@ public final class L2GuardInstance extends L2Attackable super(objectId, template); getKnownList(); // init knownlist - ThreadPool.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000)); + ThreadPool.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.get(60000)); } /* @@ -290,7 +290,7 @@ public final class L2GuardInstance extends L2Attackable { // Send a Server->Client packet SocialAction to the all L2PcInstance on the _knownPlayer of the L2NpcInstance // to display a social action of the L2GuardInstance on their client - SocialAction sa = new SocialAction(getObjectId(), Rnd.nextInt(8)); + SocialAction sa = new SocialAction(getObjectId(), Rnd.get(8)); broadcastPacket(sa); // Open a chat window on client with the text of the L2GuardInstance diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java index f5d507dd1c..6494fb8a69 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java @@ -91,7 +91,7 @@ public final class L2GuardNoHTMLInstance extends L2Attackable { super(objectId, template); getKnownList(); // init knownlist - ThreadPool.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000)); + ThreadPool.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.get(60000)); } /* diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java index 3a6392b1b5..5bd31d7991 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java @@ -204,13 +204,13 @@ public class L2MonsterInstance extends L2Attackable final int masterZ = getZ(); // Calculate a new random coord for the minion based on the master's coord - int minionX = (masterX + Rnd.nextInt(401)) - 200; - int minionY = (masterY + Rnd.nextInt(401)) - 200; + int minionX = (masterX + Rnd.get(401)) - 200; + int minionY = (masterY + Rnd.get(401)) - 200; final int minionZ = masterZ; while (((minionX != (masterX + 30)) && (minionX != (masterX - 30))) || ((minionY != (masterY + 30)) && (minionY != (masterY - 30)))) { - minionX = (masterX + Rnd.nextInt(401)) - 200; - minionY = (masterY + Rnd.nextInt(401)) - 200; + minionX = (masterX + Rnd.get(401)) - 200; + minionY = (masterY + Rnd.get(401)) - 200; } // Move the minion to the new coords diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PenaltyMonsterInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PenaltyMonsterInstance.java index 7b94e13345..b09e5524ed 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PenaltyMonsterInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PenaltyMonsterInstance.java @@ -56,7 +56,7 @@ public class L2PenaltyMonsterInstance extends L2MonsterInstance public void setPlayerToKill(L2PcInstance ptk) { - if (Rnd.nextInt(100) <= 80) + if (Rnd.get(100) <= 80) { CreatureSay cs = new CreatureSay(getObjectId(), Say2.ALL, getName(), "mmm your bait was delicious"); broadcastPacket(cs); @@ -75,7 +75,7 @@ public class L2PenaltyMonsterInstance extends L2MonsterInstance return false; } - if (Rnd.nextInt(100) <= 75) + if (Rnd.get(100) <= 75) { CreatureSay cs = new CreatureSay(getObjectId(), Say2.ALL, getName(), "I will tell fishes not to take your bait"); broadcastPacket(cs); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeGuardInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeGuardInstance.java index 175c7a1c24..540e6ec177 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeGuardInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeGuardInstance.java @@ -199,7 +199,7 @@ public class L2SiegeGuardInstance extends L2Attackable } else { - SocialAction sa = new SocialAction(getObjectId(), Rnd.nextInt(8)); + SocialAction sa = new SocialAction(getObjectId(), Rnd.get(8)); broadcastPacket(sa); sendPacket(sa); showChatWindow(player, 0); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java index 2b6e3fa2c8..ccf0cde3c0 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java @@ -48,7 +48,7 @@ public class L2XmassTreeInstance extends L2NpcInstance { for (L2PcInstance player : getKnownList().getKnownPlayers().values()) { - final int i = Rnd.nextInt(3); + final int i = Rnd.get(3); handleCast(player, (4262 + i)); } } diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java index a392006df6..1ab1aec343 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java @@ -68,14 +68,14 @@ public class CTF implements EventTask /** The _joining location name. */ protected static String _eventName = new String(); - + /** - * The _joining location name. + * The _joining location name. */ protected static String _eventDesc = new String(); - + /** - * The _joining location name. + * The _joining location name. */ protected static String _joiningLocationName = new String(); @@ -84,92 +84,92 @@ public class CTF implements EventTask /** The _in progress. */ protected static boolean _joining = false; - + /** - * The _in progress. + * The _in progress. */ protected static boolean _teleport = false; - + /** - * The _in progress. + * The _in progress. */ protected static boolean _started = false; - + /** - * The _in progress. + * The _in progress. */ protected static boolean _aborted = false; - + /** - * The _in progress. + * The _in progress. */ protected static boolean _sitForced = false; - + /** - * The _in progress. + * The _in progress. */ protected static boolean _inProgress = false; /** The _max players. */ protected static int _npcId = 0; - + /** - * The _max players. + * The _max players. */ protected static int _npcX = 0; - + /** - * The _max players. + * The _max players. */ protected static int _npcY = 0; - + /** - * The _max players. + * The _max players. */ protected static int _npcZ = 0; - + /** - * The _max players. + * The _max players. */ protected static int _npcHeading = 0; - + /** - * The _max players. + * The _max players. */ protected static int _rewardId = 0; - + /** - * The _max players. + * The _max players. */ protected static int _rewardAmount = 0; - + /** - * The _max players. + * The _max players. */ protected static int _minlvl = 0; - + /** - * The _max players. + * The _max players. */ protected static int _maxlvl = 0; - + /** - * The _max players. + * The _max players. */ protected static int _joinTime = 0; - + /** - * The _max players. + * The _max players. */ protected static int _eventTime = 0; - + /** - * The _max players. + * The _max players. */ protected static int _minPlayers = 0; - + /** - * The _max players. + * The _max players. */ protected static int _maxPlayers = 0; @@ -193,37 +193,37 @@ public class CTF implements EventTask /** The _save player teams. */ public static Vector _teams = new Vector<>(); - + /** - * The _save player teams. + * The _save player teams. */ public static Vector _savePlayers = new Vector<>(); - + /** - * The _save player teams. + * The _save player teams. */ public static Vector _savePlayerTeams = new Vector<>(); /** The _teams z. */ public static Vector _teamPlayersCount = new Vector<>(); - + /** - * The _teams z. + * The _teams z. */ public static Vector _teamColors = new Vector<>(); - + /** - * The _teams z. + * The _teams z. */ public static Vector _teamsX = new Vector<>(); - + /** - * The _teams z. + * The _teams z. */ public static Vector _teamsY = new Vector<>(); - + /** - * The _teams z. + * The _teams z. */ public static Vector _teamsZ = new Vector<>(); @@ -235,53 +235,53 @@ public class CTF implements EventTask /** The _event offset. */ public static int _eventCenterX = 0; - + /** - * The _event offset. + * The _event offset. */ public static int _eventCenterY = 0; - + /** - * The _event offset. + * The _event offset. */ public static int _eventCenterZ = 0; - + /** - * The _event offset. + * The _event offset. */ public static int _eventOffset = 0; /** The _ fla g_ i n_ han d_ ite m_ id. */ private static int _FlagNPC = 35062; - + /** - * The _ fla g_ i n_ han d_ ite m_ id. + * The _ fla g_ i n_ han d_ ite m_ id. */ private static int _FLAG_IN_HAND_ITEM_ID = 6718; /** The _flags z. */ public static Vector _flagIds = new Vector<>(); - + /** - * The _flags z. + * The _flags z. */ public static Vector _flagsX = new Vector<>(); - + /** - * The _flags z. + * The _flags z. */ public static Vector _flagsY = new Vector<>(); - + /** - * The _flags z. + * The _flags z. */ public static Vector _flagsZ = new Vector<>(); /** The _throne spawns. */ public static Vector _flagSpawns = new Vector<>(); - + /** - * The _throne spawns. + * The _throne spawns. */ public static Vector _throneSpawns = new Vector<>(); @@ -2530,7 +2530,7 @@ public class CTF implements EventTask break; } - final int playerToAddIndex = Rnd.nextInt(_playersShuffle.size()); + final int playerToAddIndex = Rnd.get(_playersShuffle.size()); L2PcInstance player = null; player = _playersShuffle.get(playerToAddIndex); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java index b6f793b41f..a5a7fbd214 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java @@ -2240,7 +2240,7 @@ public class TvT implements EventTask break; } - final int playerToAddIndex = Rnd.nextInt(_playersShuffle.size()); + final int playerToAddIndex = Rnd.get(_playersShuffle.size()); L2PcInstance player = null; player = _playersShuffle.get(playerToAddIndex); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/OlympiadManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/OlympiadManager.java index f775e8dd64..ae60d44c4a 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/OlympiadManager.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/OlympiadManager.java @@ -387,7 +387,7 @@ class OlympiadManager implements Runnable return null; } - return list.get(classList.get(Rnd.nextInt(classList.size()))); + return list.get(classList.get(Rnd.get(classList.size()))); } protected List nextOpponents(List list) @@ -407,11 +407,11 @@ class OlympiadManager implements Runnable return opponents; } - first = Rnd.nextInt(list.size()); + first = Rnd.get(list.size()); opponents.add(list.get(first)); list.remove(first); - second = Rnd.nextInt(list.size()); + second = Rnd.get(list.size()); opponents.add(list.get(second)); list.remove(second); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java index 4385d311d5..2af4ea42dd 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java @@ -4750,17 +4750,17 @@ public class SevenSignsFestival implements SpawnListener int x = _startLocation._x; int y = _startLocation._y; - isPositive = Rnd.nextInt(2) == 1; + isPositive = Rnd.get(2) == 1; if (isPositive) { - x += Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y += Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x += Rnd.get(FESTIVAL_MAX_OFFSET_X); + y += Rnd.get(FESTIVAL_MAX_OFFSET_Y); } else { - x -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x -= Rnd.get(FESTIVAL_MAX_OFFSET_X); + y -= Rnd.get(FESTIVAL_MAX_OFFSET_Y); } participant.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); @@ -4871,20 +4871,20 @@ 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.nextInt(2) == 1; + isPositive = Rnd.get(2) == 1; if (isPositive) { - x += Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y += Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x += Rnd.get(FESTIVAL_MAX_OFFSET_X); + y += Rnd.get(FESTIVAL_MAX_OFFSET_Y); } else { - x -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x -= Rnd.get(FESTIVAL_MAX_OFFSET_X); + y -= Rnd.get(FESTIVAL_MAX_OFFSET_Y); } - Location moveTo = new Location(x, y, _startLocation._z, Rnd.nextInt(65536)); + Location moveTo = new Location(x, y, _startLocation._z, Rnd.get(65536)); festivalMob.setRunning(); festivalMob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, moveTo); @@ -4953,7 +4953,7 @@ public class SevenSignsFestival implements SpawnListener npcSpawn.setX(currSpawn._x); npcSpawn.setY(currSpawn._y); npcSpawn.setZ(currSpawn._z); - npcSpawn.setHeading(Rnd.nextInt(65536)); + npcSpawn.setHeading(Rnd.get(65536)); npcSpawn.setAmount(1); npcSpawn.setRespawnDelay(respawnDelay); @@ -5166,7 +5166,7 @@ public class SevenSignsFestival implements SpawnListener _z = z; // Generate a random heading if no positive one given. - _heading = heading < 0 ? Rnd.nextInt(65536) : heading; + _heading = heading < 0 ? Rnd.get(65536) : heading; _npcId = -1; } @@ -5181,7 +5181,7 @@ public class SevenSignsFestival implements SpawnListener _y = spawnData[1]; _z = spawnData[2]; - _heading = spawnData[3] < 0 ? Rnd.nextInt(65536) : spawnData[3]; + _heading = spawnData[3] < 0 ? Rnd.get(65536) : spawnData[3]; if (spawnData.length > 4) { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/Quest.java index b9507a92b2..06a00951a6 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/Quest.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/Quest.java @@ -1627,7 +1627,8 @@ public class Quest extends ManagedScript } // Return random candidate. - return Rnd.get(getPartyMembers(player, npc, var, value)); + final List members = getPartyMembers(player, npc, var, value); + return members.get(Rnd.get(members.size())); } /** @@ -1749,7 +1750,8 @@ public class Quest extends ManagedScript } // Return random candidate. - return Rnd.get(getPartyMembersState(player, npc, state)); + final List members = getPartyMembersState(player, npc, state); + return members.get(Rnd.get(members.size())); } /** diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java index f663df4ca5..a084a110bb 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java @@ -506,7 +506,7 @@ public class AutoSpawn } final int locationCount = locationList.length; - int locationIndex = Rnd.nextInt(locationCount); + int locationIndex = Rnd.get(locationCount); /* * If random spawning is disabled, the spawn at the next set of co-ordinates after the last. If the index is greater than the number of possible spawns, reset the counter to zero. @@ -578,7 +578,7 @@ public class AutoSpawn // To prevent spawning of more than one NPC in the exact // same spot, // move it slightly by a small random offset. - npcInst.setXYZ(npcInst.getX() + Rnd.nextInt(50), npcInst.getY() + Rnd.nextInt(50), npcInst.getZ()); + npcInst.setXYZ(npcInst.getX() + Rnd.get(50), npcInst.getY() + Rnd.get(50), npcInst.getZ()); // Add the NPC instance to the list of managed // instances. diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2GroupSpawn.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2GroupSpawn.java index 841ad00683..593fa620e2 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2GroupSpawn.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2GroupSpawn.java @@ -94,7 +94,7 @@ public class L2GroupSpawn extends L2Spawn if (getHeading() == -1) { - mob.setHeading(Rnd.nextInt(61794)); + mob.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java index 1e53cc0fb8..1e9bba7491 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java @@ -579,7 +579,7 @@ public class L2Spawn // Set the heading of the L2NpcInstance (random heading if not defined) if (_heading == -1) { - mob.setHeading(Rnd.nextInt(61794)); + mob.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfuseMob.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfuseMob.java index c5bf4dd285..6943389da0 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfuseMob.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfuseMob.java @@ -84,7 +84,7 @@ final class EffectConfuseMob extends L2Effect } // Choosing randomly a new target - final int nextTargetIdx = Rnd.nextInt(targetList.size()); + final int nextTargetIdx = Rnd.get(targetList.size()); final L2Object target = targetList.get(nextTargetIdx); // Attacking the target diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfusion.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfusion.java index b9a3d74960..5114d60ff9 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfusion.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/effects/EffectConfusion.java @@ -83,7 +83,7 @@ final class EffectConfusion extends L2Effect } // Choosing randomly a new target - final int nextTargetIdx = Rnd.nextInt(targetList.size()); + final int nextTargetIdx = Rnd.get(targetList.size()); final L2Object target = targetList.get(nextTargetIdx); // Attacking the target diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/l2skills/L2SkillCreateItem.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/l2skills/L2SkillCreateItem.java index eeec468be8..4761b222e6 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/l2skills/L2SkillCreateItem.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/skills/l2skills/L2SkillCreateItem.java @@ -63,8 +63,8 @@ public class L2SkillCreateItem extends L2Skill final L2PcInstance player = (L2PcInstance) activeChar; if (activeChar instanceof L2PcInstance) { - final int count = _createItemCount * (Rnd.nextInt(_randomCount) + 1); - final int rndid = Rnd.nextInt(_createItemId.length); + final int count = _createItemCount * (Rnd.get(_randomCount) + 1); + final int rndid = Rnd.get(_createItemId.length); giveItems(player, _createItemId[rndid], count); } } diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/MinionList.java index 66417984bd..2d26bcaf78 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/MinionList.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/MinionList.java @@ -240,18 +240,18 @@ public class MinionList int spawnConstant; final int randSpawnLim = 170; int randPlusMin = 1; - spawnConstant = Rnd.nextInt(randSpawnLim); + spawnConstant = Rnd.get(randSpawnLim); // randomize +/- - randPlusMin = Rnd.nextInt(2); + randPlusMin = Rnd.get(2); if (randPlusMin == 1) { spawnConstant *= -1; } final int newX = master.getX() + spawnConstant; - spawnConstant = Rnd.nextInt(randSpawnLim); + spawnConstant = Rnd.get(randSpawnLim); // randomize +/- - randPlusMin = Rnd.nextInt(2); + randPlusMin = Rnd.get(2); if (randPlusMin == 1) { diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/GameServerTable.java index bfa0e190f5..2a44cd9ba8 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/GameServerTable.java @@ -245,7 +245,7 @@ public class GameServerTable public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } private byte[] stringToHex(String string) diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/L2LoginClient.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/L2LoginClient.java index 1502dd1545..04f4276a88 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/L2LoginClient.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/L2LoginClient.java @@ -87,7 +87,7 @@ public final class L2LoginClient extends MMOClient> _scrambledPair = LoginController.getInstance().getScrambledRSAKeyPair(); _blowfishKey = LoginController.getInstance().getBlowfishKey(); - _sessionId = Rnd.nextInt(Integer.MAX_VALUE); + _sessionId = Rnd.get(Integer.MAX_VALUE); _connectionStartTime = System.currentTimeMillis(); _loginCrypt = new LoginCrypt(); _loginCrypt.setKey(_blowfishKey); diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/LoginController.java index 07ed3cfa6e..13f52c6bc3 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/loginserver/LoginController.java @@ -192,7 +192,7 @@ public class LoginController { for (int j = 0; j < _blowfishKeys[i].length; j++) { - _blowfishKeys[i][j] = (byte) (Rnd.nextInt(255) + 1); + _blowfishKeys[i][j] = (byte) (Rnd.get(255) + 1); } } LOGGER.info("Stored " + _blowfishKeys.length + " keys for Blowfish communication"); @@ -561,7 +561,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java index ef251060d2..280f59c09b 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java @@ -140,22 +140,22 @@ public class Status extends Thread for (int i = 0; i < length; i++) { - final int charSet = Rnd.nextInt(3); + final int charSet = Rnd.get(3); switch (charSet) { case 0: { - password.append(lowerChar.charAt(Rnd.nextInt(lowerChar.length() - 1))); + password.append(lowerChar.charAt(Rnd.get(lowerChar.length() - 1))); break; } case 1: { - password.append(upperChar.charAt(Rnd.nextInt(upperChar.length() - 1))); + password.append(upperChar.charAt(Rnd.get(upperChar.length() - 1))); break; } case 2: { - password.append(digits.charAt(Rnd.nextInt(digits.length() - 1))); + password.append(digits.charAt(Rnd.get(digits.length() - 1))); break; } } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java index c27a26ead9..ff78fb84b2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java @@ -58,7 +58,7 @@ public final class AltarsOfSacrifice extends AbstractNpcAI spawn.setHeading(Rnd.get(65536)); final int radius = Rnd.get(BOSS_MIN_SPAWN_RADIUS, BOSS_MAX_SPAWN_RADIUS); - final double angleRadians = Rnd.get() * 2 * Math.PI; + final double angleRadians = Rnd.nextDouble() * 2 * Math.PI; final int spawnX = (int) (radius * Math.cos(angleRadians)) + _middlePoint.getX(); final int spawnY = (int) (radius * Math.sin(angleRadians)) + _middlePoint.getY(); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index ab1232cfaf..0c99e45be7 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -87,7 +87,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target info.getEffected().setTarget(target); info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 86a3c95bf4..62fcc6221f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -138,6 +138,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Sow.java index cf2019fb26..c78ddd381f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -128,6 +128,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java index f70537bc6b..c1a8f66924 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java @@ -2100,17 +2100,17 @@ public class SevenSignsFestival implements SpawnListener int x = _startLocation._x; int y = _startLocation._y; - isPositive = (Rnd.nextInt(2) == 1); + isPositive = (Rnd.get(2) == 1); if (isPositive) { - x += Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y += Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x += Rnd.get(FESTIVAL_MAX_OFFSET_X); + y += Rnd.get(FESTIVAL_MAX_OFFSET_Y); } else { - x -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x -= Rnd.get(FESTIVAL_MAX_OFFSET_X); + y -= Rnd.get(FESTIVAL_MAX_OFFSET_Y); } participant.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); @@ -2196,21 +2196,21 @@ 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.nextInt(2) == 1); + isPositive = (Rnd.get(2) == 1); if (isPositive) { - x += Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y += Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x += Rnd.get(FESTIVAL_MAX_OFFSET_X); + y += Rnd.get(FESTIVAL_MAX_OFFSET_Y); } else { - x -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_X); - y -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y); + x -= Rnd.get(FESTIVAL_MAX_OFFSET_X); + y -= Rnd.get(FESTIVAL_MAX_OFFSET_Y); } festivalMob.setRunning(); - festivalMob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(x, y, _startLocation._z, Rnd.nextInt(65536))); + festivalMob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(x, y, _startLocation._z, Rnd.get(65536))); } } @@ -2267,7 +2267,7 @@ public class SevenSignsFestival implements SpawnListener final L2Spawn npcSpawn = new L2Spawn(currSpawn._npcId); npcSpawn.setXYZ(currSpawn._x, currSpawn._y, currSpawn._z); - npcSpawn.setHeading(Rnd.nextInt(65536)); + npcSpawn.setHeading(Rnd.get(65536)); npcSpawn.setAmount(1); npcSpawn.setRespawnDelay(respawnDelay); @@ -2430,7 +2430,7 @@ public class SevenSignsFestival implements SpawnListener _z = z; // Generate a random heading if no positive one given. - _heading = (heading < 0) ? Rnd.nextInt(65536) : heading; + _heading = (heading < 0) ? Rnd.get(65536) : heading; _npcId = -1; } @@ -2441,7 +2441,7 @@ public class SevenSignsFestival implements SpawnListener _y = spawnData[1]; _z = spawnData[2]; - _heading = (spawnData[3] < 0) ? Rnd.nextInt(65536) : spawnData[3]; + _heading = (spawnData[3] < 0) ? Rnd.get(65536) : spawnData[3]; if (spawnData.length > 4) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 8ffbcbbc6f..a74ef36d3e 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -622,7 +622,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -694,7 +694,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, z1); return; } - if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -706,7 +706,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -731,7 +731,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -887,7 +887,7 @@ public class L2AttackableAI extends L2CharacterAI // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running // around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java index f3f4941090..7575d828a6 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java @@ -1357,7 +1357,7 @@ public class L2CharacterAI extends AbstractAI public void update(L2Character target) { // update status once in 4 seconds - if ((target == character) && (Rnd.nextInt(100) > 25)) + if ((target == character) && (Rnd.get(100) > 25)) { return; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 15d7a1ca12..5053f6e909 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -66,7 +66,7 @@ public final class L2ControllableMobAI extends L2AttackableAI { if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, _actor, getForcedTarget(), true)) { - moveTo(getForcedTarget().getX() + (((Rnd.nextInt(2) == 0) ? -1 : 1) * Rnd.nextInt(MobGroupTable.FOLLOW_RANGE)), getForcedTarget().getY() + (((Rnd.nextInt(2) == 0) ? -1 : 1) * Rnd.nextInt(MobGroupTable.FOLLOW_RANGE)), getForcedTarget().getZ()); + moveTo(getForcedTarget().getX() + (((Rnd.get(2) == 0) ? -1 : 1) * Rnd.get(MobGroupTable.FOLLOW_RANGE)), getForcedTarget().getY() + (((Rnd.get(2) == 0) ? -1 : 1) * Rnd.get(MobGroupTable.FOLLOW_RANGE)), getForcedTarget().getZ()); } } @@ -335,7 +335,7 @@ public final class L2ControllableMobAI extends L2AttackableAI setAttackTarget(hated); } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -418,7 +418,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java index eff421ac60..3dca63e322 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java @@ -584,7 +584,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable _attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks(); // check for close combat skills && heal/buff skills - if (!_actor.isMuted() && (Rnd.nextInt(100) <= 5)) + if (!_actor.isMuted() && (Rnd.get(100) <= 5)) { for (Skill sk : skills) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java index dcc1cfb003..dc99f40006 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java @@ -584,7 +584,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable _attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks(); // check for close combat skills && heal/buff skills - if (!_actor.isMuted() && (Rnd.nextInt(100) <= 5)) + if (!_actor.isMuted() && (Rnd.get(100) <= 5)) { for (Skill sk : skills) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 59a1a06774..7d904a17d4 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -304,7 +304,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java index db45d11bc5..cb7a714079 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java @@ -427,7 +427,7 @@ public class AutoSpawnHandler } final int locationCount = locationList.length; - int locationIndex = Rnd.nextInt(locationCount); + int locationIndex = Rnd.get(locationCount); // If random spawning is disabled, the spawn at the next set of co-ordinates after the last. // If the index is greater than the number of possible spawns, reset the counter to zero. @@ -478,7 +478,7 @@ public class AutoSpawnHandler npcInst = newSpawn.doSpawn(); // To prevent spawning of more than one NPC in the exact same spot, move it slightly by a small random offset. - npcInst.setXYZ(npcInst.getX() + Rnd.nextInt(50), npcInst.getY() + Rnd.nextInt(50), npcInst.getZ()); + npcInst.setXYZ(npcInst.getX() + Rnd.get(50), npcInst.getY() + Rnd.get(50), npcInst.getZ()); // Add the NPC instance to the list of managed instances. spawnInst.addNpcInstance(npcInst); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index 6aa41da6d5..cf7bb0eee6 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java index 13767423f8..649880f1eb 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -433,7 +433,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Territory.java index 0246a36d59..f3ec0a6a27 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/MobGroup.java index db099d3fa7..ff85c7675c 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -146,10 +146,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -184,8 +184,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -196,7 +196,7 @@ public final class MobGroup public L2ControllableMobInstance getRandomMob() { removeDead(); - return getMobs().size() == 0 ? null : getMobs().get(Rnd.nextInt(getMobs().size())); + return getMobs().size() == 0 ? null : getMobs().get(Rnd.get(getMobs().size())); } public void unspawnGroup() @@ -306,7 +306,7 @@ public final class MobGroup continue; } - ((L2ControllableMobAI) mobInst.getAI()).move(activeChar.getX() + (((Rnd.nextInt(2) == 0) ? -1 : 1) * Rnd.nextInt(MobGroupTable.RANDOM_RANGE)), activeChar.getY() + (((Rnd.nextInt(2) == 0) ? -1 : 1) * Rnd.nextInt(MobGroupTable.RANDOM_RANGE)), activeChar.getZ()); + ((L2ControllableMobAI) mobInst.getAI()).move(activeChar.getX() + (((Rnd.get(2) == 0) ? -1 : 1) * Rnd.get(MobGroupTable.RANDOM_RANGE)), activeChar.getY() + (((Rnd.get(2) == 0) ? -1 : 1) * Rnd.get(MobGroupTable.RANDOM_RANGE)), activeChar.getZ()); } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 2811450b34..4fe04e8dcc 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -66,7 +66,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index dd786e5284..83638a5eee 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -74,14 +74,14 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (list.size() > 1) { - playerOneObjectId = list.remove(Rnd.nextInt(list.size())); + playerOneObjectId = list.remove(Rnd.get(list.size())); playerOne = L2World.getInstance().getPlayer(playerOneObjectId); if ((playerOne == null) || !playerOne.isOnline()) { continue; } - playerTwo = L2World.getInstance().getPlayer(list.remove(Rnd.nextInt(list.size()))); + playerTwo = L2World.getInstance().getPlayer(list.remove(Rnd.get(list.size()))); if ((playerTwo == null) || !playerTwo.isOnline()) { list.add(playerOneObjectId); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTeams.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTeams.java index c8a7d7ecbf..63c07b7dbd 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTeams.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTeams.java @@ -109,7 +109,7 @@ public class OlympiadGameTeams extends AbstractOlympiadGame while (list.size() > 1) { - teamOne = list.remove(Rnd.nextInt(list.size())); + teamOne = list.remove(Rnd.get(list.size())); if ((teamOne == null) || teamOne.isEmpty()) { @@ -131,7 +131,7 @@ public class OlympiadGameTeams extends AbstractOlympiadGame continue; } - teamTwo = list.remove(Rnd.nextInt(list.size())); + teamTwo = list.remove(Rnd.get(list.size())); if ((teamTwo == null) || teamTwo.isEmpty()) { list.add(teamOne); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index 7b66343b80..c8e2907072 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/GameServerTable.java index 6e0acf7823..b806090d02 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/LoginController.java index 71379c5cec..695df07b8d 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 106114c780..a71e638b27 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 106114c780..a71e638b27 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 106114c780..a71e638b27 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Confuse.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Confuse.java index c7bdcdfd58..84731035ba 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Confuse.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Confuse.java @@ -76,7 +76,7 @@ public final class Confuse extends AbstractEffect if (!targetList.isEmpty()) { // Choosing randomly a new target - final L2Character target = targetList.get(Rnd.nextInt(targetList.size())); + final L2Character target = targetList.get(Rnd.get(targetList.size())); // Attacking the target effected.setTarget(target); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java index 106114c780..a71e638b27 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Harvesting.java @@ -140,6 +140,6 @@ public final class Harvesting extends AbstractEffect { basicSuccess = 1; } - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Sow.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Sow.java index a8ae85ed90..98486d11ba 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Sow.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Sow.java @@ -129,6 +129,6 @@ public final class Sow extends AbstractEffect // chance can't be less than 1% Math.max(basicSuccess, 1); - return Rnd.nextInt(99) < basicSuccess; + return Rnd.get(99) < basicSuccess; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java index 873ee3d3df..8c8e9a6aba 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/FriendlyNpcAI.java @@ -116,7 +116,7 @@ public class FriendlyNpcAI extends L2AttackableAI final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius(); - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 1a4a42371a..363199be74 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -497,7 +497,7 @@ public class L2AttackableAI extends L2CharacterAI } // Chance to forget attackers after some time - if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0)) + if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.get(500) == 0)) { npc.clearAggroList(); npc.getAttackByList().clear(); @@ -567,7 +567,7 @@ public class L2AttackableAI extends L2CharacterAI moveTo(x1, y1, leader.getZ()); return; } - else if (Rnd.nextInt(RANDOM_WALK_RATE) == 0) + else if (Rnd.get(RANDOM_WALK_RATE) == 0) { for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF)) { @@ -582,7 +582,7 @@ public class L2AttackableAI extends L2CharacterAI } } // Order to the L2MonsterInstance to random walk (1/100) - else if ((npc.getSpawn() != null) && (Rnd.nextInt(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) + else if ((npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0) && npc.isRandomWalkingEnabled()) { int x1 = 0; int y1 = 0; @@ -610,7 +610,7 @@ public class L2AttackableAI extends L2CharacterAI } else { - final int deltaX = Rnd.nextInt(range * 2); // x + final int deltaX = Rnd.get(range * 2); // x int deltaY = Rnd.get(deltaX, range * 2); // distance deltaY = (int) Math.sqrt((deltaY * deltaY) - (deltaX * deltaX)); // y x1 = (deltaX + x1) - range; @@ -745,7 +745,7 @@ public class L2AttackableAI extends L2CharacterAI // In case many mobs are trying to hit from same place, move a bit, circling around the target // Note from Gnacik: // On l2js because of that sometimes mobs don't attack player only running around player without any sense, so decrease chance for now - if (!npc.isMovementDisabled() && (Rnd.nextInt(100) <= 3)) + if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3)) { for (L2Attackable nearby : L2World.getInstance().getVisibleObjects(npc, L2Attackable.class)) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java index 7442f0df45..a93b5aca43 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/ai/L2ControllableMobAI.java @@ -63,10 +63,10 @@ public final class L2ControllableMobAI extends L2AttackableAI if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true)) { - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.FOLLOW_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE); + final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE); moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ()); } @@ -350,7 +350,7 @@ public final class L2ControllableMobAI extends L2AttackableAI target = hated; } - if (!_actor.isMuted() && (Rnd.nextInt(5) == 3)) + if (!_actor.isMuted() && (Rnd.get(5) == 3)) { for (Skill sk : _actor.getAllSkills()) { @@ -449,7 +449,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } }); - return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.nextInt(potentialTarget.size())) : null; + return !potentialTarget.isEmpty() ? potentialTarget.get(Rnd.get(potentialTarget.size())) : null; } private L2ControllableMobInstance findNextGroupTarget() diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index 10efa33d19..6ed727df78 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -308,7 +308,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable if (crop.getStartAmount() != crop.getAmount()) { long count = (long) ((crop.getStartAmount() - crop.getAmount()) * 0.9); - if ((count < 1) && (Rnd.nextInt(99) < 90)) + if ((count < 1) && (Rnd.get(99) < 90)) { count = 1; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java index f485978cf6..7b54ca5052 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2GroupSpawn.java @@ -68,7 +68,7 @@ public class L2GroupSpawn extends L2Spawn final L2Npc mob = new L2ControllableMobInstance(_template); mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp()); - mob.setHeading(getHeading() == -1 ? Rnd.nextInt(61794) : getHeading()); + mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading()); mob.setSpawn(this); mob.spawnMe(newlocx, newlocy, newlocz); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Spawn.java index 8a79e5a62e..4d52ad29e2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -426,7 +426,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable // Set the heading of the L2NpcInstance (random heading if not defined) if (getHeading() == -1) { - npc.setHeading(Rnd.nextInt(61794)); + npc.setHeading(Rnd.get(61794)); } else { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Territory.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Territory.java index 8df38c5461..9f7705b70f 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Territory.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/L2Territory.java @@ -150,7 +150,7 @@ public class L2Territory if (_procMax > 0) { int pos = 0; - final int rnd = Rnd.nextInt(_procMax); + final int rnd = Rnd.get(_procMax); for (Point p1 : _points) { pos += p1._proc; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/MobGroup.java index 2fd7bbd949..bd9111f8e4 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/MobGroup.java @@ -147,10 +147,10 @@ public final class MobGroup { final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate); - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); spawn.setXYZ(x + (signX * randX), y + (signY * randY), z); spawn.stopRespawn(); @@ -185,8 +185,8 @@ public final class MobGroup if (!mobInst.isDead()) { - final int x = player.getX() + Rnd.nextInt(50); - final int y = player.getY() + Rnd.nextInt(50); + final int x = player.getX() + Rnd.get(50); + final int y = player.getY() + Rnd.get(50); mobInst.teleToLocation(new Location(x, y, player.getZ()), true); ((L2ControllableMobAI) mobInst.getAI()).follow(player); @@ -203,7 +203,7 @@ public final class MobGroup return null; } - int choice = Rnd.nextInt(getMobs().size()); + int choice = Rnd.get(getMobs().size()); for (L2ControllableMobInstance mob : getMobs()) { if (--choice == 0) @@ -321,10 +321,10 @@ public final class MobGroup continue; } - final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1; - final int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); - final int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE); + final int signX = (Rnd.get(2) == 0) ? -1 : 1; + final int signY = (Rnd.get(2) == 0) ? -1 : 1; + final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE); + final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE); final L2ControllableMobAI ai = (L2ControllableMobAI) mobInst.getAI(); ai.move(activeChar.getX() + (signX * randX), activeChar.getY() + (signY * randY), activeChar.getZ()); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java index 5c58ff25b4..f20fff2ee4 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java @@ -68,7 +68,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal Participant[] opponents; while (!classList.isEmpty()) { - list = classList.get(Rnd.nextInt(classList.size())); + list = classList.get(Rnd.get(classList.size())); if ((list == null) || (list.size() < 2)) { classList.remove(list); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java index 2824298209..ffe67aa63d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java @@ -76,7 +76,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame while (set.size() > 1) { - int random = Rnd.nextInt(set.size()); + int random = Rnd.get(set.size()); Iterator iter = set.iterator(); while (iter.hasNext()) { @@ -94,7 +94,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame continue; } - random = Rnd.nextInt(set.size()); + random = Rnd.get(set.size()); iter = set.iterator(); while (iter.hasNext()) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java index a9de5f286e..88f1f2597e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataCategory.java @@ -39,7 +39,7 @@ public final class OptionDataCategory Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (Map.Entry entry : _options.entrySet()) { if (entry.getValue() >= random) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java index 9732fcf4e4..ece6d1b34f 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/options/OptionDataGroup.java @@ -37,7 +37,7 @@ public final class OptionDataGroup Options result = null; do { - double random = Rnd.get() * 100.0; + double random = Rnd.nextDouble() * 100.0; for (OptionDataCategory category : _categories) { if (category.getChance() >= random) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java index f9a3b6f93a..322d63a992 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/zone/form/ZoneCylinder.java @@ -138,8 +138,8 @@ public class ZoneCylinder extends L2ZoneForm @Override public Location getRandomPoint() { - final int q = (int) (Rnd.get() * 2 * Math.PI); - final int r = (int) Math.sqrt(Rnd.get()); + final int q = (int) (Rnd.nextDouble() * 2 * Math.PI); + final int r = (int) Math.sqrt(Rnd.nextDouble()); final int x = (int) ((_rad * r * Math.cos(q)) + _x); final int y = (int) ((_rad * r * Math.sin(q)) + _y); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/GameServerTable.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/GameServerTable.java index 2410f6ede8..456224d78c 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/GameServerTable.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/GameServerTable.java @@ -261,7 +261,7 @@ public final class GameServerTable implements IGameXmlReader */ public KeyPair getKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /** diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/LoginController.java index 71c96fedce..72a1c3a642 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/LoginController.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/loginserver/LoginController.java @@ -484,7 +484,7 @@ public class LoginController */ public ScrambledKeyPair getScrambledRSAKeyPair() { - return _keyPairs[Rnd.nextInt(10)]; + return _keyPairs[Rnd.get(10)]; } /**