Minor Rnd method usage corrections.
This commit is contained in:
@@ -275,7 +275,7 @@ public class QueenAnt extends Quest
|
||||
{
|
||||
if (Rnd.get(3) == 0)
|
||||
{
|
||||
if (Rnd.get(2) == 0)
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
|
||||
}
|
||||
|
@@ -733,7 +733,7 @@ public class Valakas extends Quest
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4683, 1);
|
||||
}
|
||||
else if (Rnd.get(2) == 0)
|
||||
else if (Rnd.nextBoolean())
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4681, 1); // left hand
|
||||
}
|
||||
@@ -787,7 +787,7 @@ public class Valakas extends Quest
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4683, 1);
|
||||
}
|
||||
else if (Rnd.get(2) == 0)
|
||||
else if (Rnd.nextBoolean())
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4681, 1); // left hand
|
||||
}
|
||||
@@ -841,7 +841,7 @@ public class Valakas extends Quest
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4683, 1);
|
||||
}
|
||||
else if (Rnd.get(2) == 0)
|
||||
else if (Rnd.nextBoolean())
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4681, 1); // left hand
|
||||
}
|
||||
@@ -895,7 +895,7 @@ public class Valakas extends Quest
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4683, 1);
|
||||
}
|
||||
else if (Rnd.get(2) == 0)
|
||||
else if (Rnd.nextBoolean())
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(4681, 1); // left hand
|
||||
}
|
||||
|
@@ -833,7 +833,7 @@ public class Zaken extends Quest
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Rnd.get(2) < 1)
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
if (attacker == ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
@@ -898,7 +898,7 @@ public class Zaken extends Quest
|
||||
* public String onSkillSee(L2NpcInstance npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) { int npcId = npc.getNpcId(); if (npcId == ZAKEN) { if (skill.getAggroPoints() > 0) { ((L2Attackable) npc).addDamageHate(caster, 0, (((skill.getAggroPoints() / npc.getMaxHp()) *
|
||||
* 10) * 150)); } if (Rnd.get(12) < 1) { int i0 = Rnd.get((15 * 15)); if (i0 < 1) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4216, 1)); } else if (i0 < 2) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4217, 1)); } else if (i0 < 4) {
|
||||
* npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4219, 1)); } else if (i0 < 8) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4218, 1)); } else if (i0 < 15) { for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100)) { if
|
||||
* (character != caster) continue; if (caster != ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4221, 1)); } } } if (Rnd.get(2) < 1) { if (caster == ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster);
|
||||
* (character != caster) continue; if (caster != ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4221, 1)); } } } if (Rnd.get(2)ss < 1) { if (caster == ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster);
|
||||
* npc.doCast(SkillTable.getInstance().getInfo(4220, 1)); } } } } return super.onSkillSee(npc, caster, skill, targets, isPet); }
|
||||
*/
|
||||
|
||||
@@ -977,7 +977,7 @@ public class Zaken extends Quest
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Rnd.get(2) < 1)
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
if (player == ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
|
@@ -63,8 +63,8 @@ public class L2ControllableMobAI extends L2AttackableAI
|
||||
|
||||
if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true))
|
||||
{
|
||||
final int signX = Rnd.get(2) == 0 ? -1 : 1;
|
||||
final int signY = Rnd.get(2) == 0 ? -1 : 1;
|
||||
final int signX = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int signY = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE);
|
||||
final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE);
|
||||
|
||||
|
@@ -1256,7 +1256,7 @@ public class FourSepulchersManager extends GrandBossManager
|
||||
List<L2SepulcherMonsterInstance> mobs = new ArrayList<>();
|
||||
L2Spawn keyBoxMobSpawn;
|
||||
|
||||
if (Rnd.get(2) == 0)
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
monsterList = _physicalMonsters.get(npcId);
|
||||
}
|
||||
|
@@ -149,8 +149,8 @@ public final class MobGroup
|
||||
{
|
||||
L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate);
|
||||
|
||||
final int signX = Rnd.get(2) == 0 ? -1 : 1;
|
||||
final int signY = Rnd.get(2) == 0 ? -1 : 1;
|
||||
final int signX = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int signY = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
|
||||
@@ -324,8 +324,8 @@ public final class MobGroup
|
||||
continue;
|
||||
}
|
||||
|
||||
final int signX = Rnd.get(2) == 0 ? -1 : 1;
|
||||
final int signY = Rnd.get(2) == 0 ? -1 : 1;
|
||||
final int signX = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int signY = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
|
||||
|
@@ -4730,8 +4730,6 @@ public class SevenSignsFestival implements SpawnListener
|
||||
*/
|
||||
protected void festivalInit()
|
||||
{
|
||||
boolean isPositive;
|
||||
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
LOGGER.info("SevenSignsFestival: Initializing festival for " + SevenSigns.getCabalShortName(_cabal) + " (" + getFestivalName(_levelRange) + ")");
|
||||
@@ -4750,9 +4748,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
int x = _startLocation._x;
|
||||
int y = _startLocation._y;
|
||||
|
||||
isPositive = Rnd.get(2) == 1;
|
||||
|
||||
if (isPositive)
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
x += Rnd.get(FESTIVAL_MAX_OFFSET_X);
|
||||
y += Rnd.get(FESTIVAL_MAX_OFFSET_Y);
|
||||
@@ -4843,8 +4839,6 @@ public class SevenSignsFestival implements SpawnListener
|
||||
*/
|
||||
protected void moveMonstersToCenter()
|
||||
{
|
||||
boolean isPositive;
|
||||
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
LOGGER.info("SevenSignsFestival: Moving spawns to arena center for festival " + SevenSigns.getCabalShortName(_cabal) + " (" + getFestivalName(_levelRange) + ")");
|
||||
@@ -4871,9 +4865,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
/*
|
||||
* Random X and Y coords around the player start location, up to half of the maximum allowed offset are generated to prevent the mobs from all moving to the exact same place.
|
||||
*/
|
||||
isPositive = Rnd.get(2) == 1;
|
||||
|
||||
if (isPositive)
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
x += Rnd.get(FESTIVAL_MAX_OFFSET_X);
|
||||
y += Rnd.get(FESTIVAL_MAX_OFFSET_Y);
|
||||
|
Reference in New Issue
Block a user