Make use of script random methods.
This commit is contained in:
		| @@ -19,7 +19,6 @@ package ai.areas.EnchantedValley; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.Player; | ||||
|  | ||||
| @@ -53,7 +52,7 @@ public class FlowerBud extends AbstractNpcAI | ||||
| 	{ | ||||
| 		if (event.equals("spawn") && npc.isDead()) | ||||
| 		{ | ||||
| 			final Npc elegant = addSpawn(FLOWER_SPAWNS.get(Rnd.get(FLOWER_SPAWNS.size())), npc, false, 120000, false); | ||||
| 			final Npc elegant = addSpawn(FLOWER_SPAWNS.get(getRandom(FLOWER_SPAWNS.size())), npc, false, 120000, false); | ||||
| 			addAttackPlayerDesire(elegant, player); | ||||
| 		} | ||||
| 		return event; | ||||
|   | ||||
| @@ -16,7 +16,6 @@ | ||||
|  */ | ||||
| package ai.areas.RaidersCrossroads.Kaysen; | ||||
|  | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.model.Location; | ||||
| import org.l2jmobius.gameserver.model.World; | ||||
| @@ -105,7 +104,7 @@ public class Kaysen extends AbstractNpcAI | ||||
| 					} | ||||
| 					npc.setScriptValue(1); | ||||
| 					 | ||||
| 					if (Rnd.get(100) < REWARD_CHANCE) | ||||
| 					if (getRandom(100) < REWARD_CHANCE) | ||||
| 					{ | ||||
| 						npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_THOUGHT_I_D_BE_A_PUSHOVER_DIDN_T_YOU); | ||||
| 						giveItems(player, REWARD); | ||||
|   | ||||
| @@ -23,7 +23,6 @@ import java.util.List; | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.CommonUtil; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.ai.CtrlIntention; | ||||
| import org.l2jmobius.gameserver.data.xml.SkillData; | ||||
| import org.l2jmobius.gameserver.enums.TeleportWhereType; | ||||
| @@ -406,7 +405,7 @@ public class Anakim extends AbstractNpcAI | ||||
| 				{ | ||||
| 					for (int i = 0; i < 2; i++) | ||||
| 					{ | ||||
| 						randomSpawn = _spawns.get(Rnd.get(_spawns.size())); | ||||
| 						randomSpawn = _spawns.get(getRandom(_spawns.size())); | ||||
| 						if (randomSpawn != null) | ||||
| 						{ | ||||
| 							final Npc remnant = addSpawn(REMNANT, randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ(), randomSpawn.getHeading(), true, 0, false, 0); | ||||
| @@ -416,7 +415,7 @@ public class Anakim extends AbstractNpcAI | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					randomSpawn = _spawns.get(Rnd.get(_spawns.size())); | ||||
| 					randomSpawn = _spawns.get(getRandom(_spawns.size())); | ||||
| 					if (randomSpawn != null) | ||||
| 					{ | ||||
| 						npc.teleToLocation(randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ()); | ||||
| @@ -596,7 +595,7 @@ public class Anakim extends AbstractNpcAI | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		if ((npc.getId() == REMNANT) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.30)) && !npc.isCastingNow() && (Rnd.get(100) > 95)) | ||||
| 		if ((npc.getId() == REMNANT) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.30)) && !npc.isCastingNow() && (getRandom(100) > 95)) | ||||
| 		{ | ||||
| 			npc.doCast(REMANT_TELE); | ||||
| 		} | ||||
| @@ -645,7 +644,7 @@ public class Anakim extends AbstractNpcAI | ||||
| 	@Override | ||||
| 	public String onSkillSee(Npc npc, Player caster, Skill skill, WorldObject[] targets, boolean isPet) | ||||
| 	{ | ||||
| 		if (CommonUtil.contains(ANAKIM_MINIONS, npc.getId()) && Rnd.nextBoolean() && (skill.getAbnormalType() == AbnormalType.HP_RECOVER) && !npc.isCastingNow() && (npc.getTarget() != npc) && (npc.getTarget() != caster) && (npc.getTarget() != _anakimBoss)) | ||||
| 		if (CommonUtil.contains(ANAKIM_MINIONS, npc.getId()) && getRandomBoolean() && (skill.getAbnormalType() == AbnormalType.HP_RECOVER) && !npc.isCastingNow() && (npc.getTarget() != npc) && (npc.getTarget() != caster) && (npc.getTarget() != _anakimBoss)) | ||||
| 		{ | ||||
| 			((Attackable) npc).clearAggroList(); | ||||
| 			npc.setTarget(caster); | ||||
|   | ||||
| @@ -19,7 +19,6 @@ package ai.bosses.Balok; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.ai.CtrlIntention; | ||||
| import org.l2jmobius.gameserver.enums.Movie; | ||||
| import org.l2jmobius.gameserver.model.Location; | ||||
| @@ -147,7 +146,7 @@ public class BalokWarzone extends AbstractInstance | ||||
| 				} | ||||
| 				case "stage_last_send_minions": | ||||
| 				{ | ||||
| 					final Npc minion = _minionList.get(Rnd.get(_minionList.size())); | ||||
| 					final Npc minion = _minionList.get(getRandom(_minionList.size())); | ||||
| 					if (minion != null) | ||||
| 					{ | ||||
| 						minion.setRunning(); | ||||
| @@ -186,7 +185,7 @@ public class BalokWarzone extends AbstractInstance | ||||
| 				} | ||||
| 				case "imprission_minions": | ||||
| 				{ | ||||
| 					final int[] randomJail = PRISONS_SPAWN[Rnd.get(PRISONS_SPAWN.length)]; // Random jail | ||||
| 					final int[] randomJail = PRISONS_SPAWN[getRandom(PRISONS_SPAWN.length)]; // Random jail | ||||
| 					player.teleToLocation(randomJail[0], randomJail[1], randomJail[2]); | ||||
| 					world.broadcastPacket(new ExShowScreenMessage("$s1, locked away in the prison.".replace("$s1", player.getName()), 5000)); | ||||
| 					break; | ||||
| @@ -220,7 +219,7 @@ public class BalokWarzone extends AbstractInstance | ||||
| 				} | ||||
| 				World.getInstance().forEachVisibleObjectInRange(npc, Player.class, 300, instPlayer -> | ||||
| 				{ | ||||
| 					if ((instPlayer == null) || (Rnd.get(100) > 2)) | ||||
| 					if ((instPlayer == null) || (getRandom(100) > 2)) | ||||
| 					{ | ||||
| 						return; | ||||
| 					} | ||||
|   | ||||
| @@ -21,7 +21,6 @@ import java.util.List; | ||||
|  | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.data.xml.SkillData; | ||||
| import org.l2jmobius.gameserver.enums.Movie; | ||||
| import org.l2jmobius.gameserver.enums.TeleportWhereType; | ||||
| @@ -196,21 +195,21 @@ public class Kelbim extends AbstractNpcAI | ||||
| 				GrandBossManager.getInstance().addBoss(_kelbimBoss); | ||||
| 				_lastAction = Chronos.currentTimeMillis(); | ||||
| 				startQuestTimer("check_activity_task", 60000, null, null); | ||||
| 				startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null); | ||||
| 				startQuestTimer("stage_all_random_area_attack", getRandom(2, 3) * 60000, null, null); | ||||
| 				break; | ||||
| 			} | ||||
| 			case "stage_all_spawn_minions": | ||||
| 			{ | ||||
| 				for (int i = 0; i < Rnd.get((_bossStage * 5) / 2, _bossStage * 5); i++) | ||||
| 				for (int i = 0; i < getRandom((_bossStage * 5) / 2, _bossStage * 5); i++) | ||||
| 				{ | ||||
| 					final Npc minion = addSpawn(KELBIM_GUARD, _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0); | ||||
| 					minion.setRunning(); | ||||
| 					((Attackable) minion).setIsRaidMinion(true); | ||||
| 					_minions.add(minion); | ||||
| 				} | ||||
| 				for (int i = 0; i < Rnd.get((_bossStage * 2) / 2, _bossStage * 2); i++) | ||||
| 				for (int i = 0; i < getRandom((_bossStage * 2) / 2, _bossStage * 2); i++) | ||||
| 				{ | ||||
| 					final Npc minion = addSpawn(KELBIM_GUARDIANS[Rnd.get(KELBIM_GUARDIANS.length)], _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0); | ||||
| 					final Npc minion = addSpawn(KELBIM_GUARDIANS[getRandom(KELBIM_GUARDIANS.length)], _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0); | ||||
| 					minion.setRunning(); | ||||
| 					((Attackable) minion).setIsRaidMinion(true); | ||||
| 					_minions.add(minion); | ||||
| @@ -223,7 +222,7 @@ public class Kelbim extends AbstractNpcAI | ||||
| 				{ | ||||
| 					if (_kelbimBoss.isInCombat()) | ||||
| 					{ | ||||
| 						final Skill randomAttackSkill = AREA_SKILLS[Rnd.get(AREA_SKILLS.length)]; | ||||
| 						final Skill randomAttackSkill = AREA_SKILLS[getRandom(AREA_SKILLS.length)]; | ||||
| 						final List<Npc> skillNpcs = new ArrayList<>(); | ||||
| 						for (Player pl : ZONE.getPlayersInside()) | ||||
| 						{ | ||||
| @@ -231,7 +230,7 @@ public class Kelbim extends AbstractNpcAI | ||||
| 							{ | ||||
| 								continue; | ||||
| 							} | ||||
| 							if (Rnd.get(100) > 40) | ||||
| 							if (getRandom(100) > 40) | ||||
| 							{ | ||||
| 								final Npc skillMob = addSpawn(KELBIM_SHOUT, pl.getX(), pl.getY(), pl.getZ() + 10, 0, true, 60000, false, 0); | ||||
| 								skillNpcs.add(skillMob); | ||||
| @@ -247,7 +246,7 @@ public class Kelbim extends AbstractNpcAI | ||||
| 							skillNpc.doCast(randomAttackSkill); | ||||
| 						} | ||||
| 					} | ||||
| 					startQuestTimer("stage_all_random_area_attack", Rnd.get(1, 2) * 60000, null, null); | ||||
| 					startQuestTimer("stage_all_random_area_attack", getRandom(1, 2) * 60000, null, null); | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
|   | ||||
| @@ -23,7 +23,6 @@ import java.util.List; | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.CommonUtil; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.ai.CtrlIntention; | ||||
| import org.l2jmobius.gameserver.data.xml.SkillData; | ||||
| import org.l2jmobius.gameserver.enums.TeleportWhereType; | ||||
| @@ -432,7 +431,7 @@ public class Lilith extends AbstractNpcAI | ||||
| 				{ | ||||
| 					for (int i = 0; i < 2; i++) | ||||
| 					{ | ||||
| 						randomSpawn = _spawns.get(Rnd.get(_spawns.size())); | ||||
| 						randomSpawn = _spawns.get(getRandom(_spawns.size())); | ||||
| 						if (randomSpawn != null) | ||||
| 						{ | ||||
| 							final Npc remnant = addSpawn(REMNANT, randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ(), randomSpawn.getHeading(), true, 0, false, 0); | ||||
| @@ -442,7 +441,7 @@ public class Lilith extends AbstractNpcAI | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					randomSpawn = _spawns.get(Rnd.get(_spawns.size())); | ||||
| 					randomSpawn = _spawns.get(getRandom(_spawns.size())); | ||||
| 					if (randomSpawn != null) | ||||
| 					{ | ||||
| 						npc.teleToLocation(randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ()); | ||||
| @@ -612,7 +611,7 @@ public class Lilith extends AbstractNpcAI | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		if ((npc.getId() == REMNANT) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.30)) && !npc.isCastingNow() && (Rnd.get(100) > 95)) | ||||
| 		if ((npc.getId() == REMNANT) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.30)) && !npc.isCastingNow() && (getRandom(100) > 95)) | ||||
| 		{ | ||||
| 			npc.doCast(REMANT_TELE); | ||||
| 		} | ||||
| @@ -661,7 +660,7 @@ public class Lilith extends AbstractNpcAI | ||||
| 	@Override | ||||
| 	public String onSkillSee(Npc npc, Player caster, Skill skill, WorldObject[] targets, boolean isPet) | ||||
| 	{ | ||||
| 		if (CommonUtil.contains(LILITH_MINIONS, npc.getId()) && Rnd.nextBoolean() && (skill.getAbnormalType() == AbnormalType.HP_RECOVER) && !npc.isCastingNow() && (npc.getTarget() != npc) && (npc.getTarget() != caster) && (npc.getTarget() != _lilithBoss)) | ||||
| 		if (CommonUtil.contains(LILITH_MINIONS, npc.getId()) && getRandomBoolean() && (skill.getAbnormalType() == AbnormalType.HP_RECOVER) && !npc.isCastingNow() && (npc.getTarget() != npc) && (npc.getTarget() != caster) && (npc.getTarget() != _lilithBoss)) | ||||
| 		{ | ||||
| 			((Attackable) npc).clearAggroList(); | ||||
| 			npc.setTarget(caster); | ||||
|   | ||||
| @@ -23,7 +23,6 @@ import java.util.concurrent.ScheduledFuture; | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.threads.ThreadPool; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.ai.CtrlIntention; | ||||
| import org.l2jmobius.gameserver.data.SpawnTable; | ||||
| import org.l2jmobius.gameserver.enums.ChatType; | ||||
| @@ -946,8 +945,8 @@ public class Lindvior extends AbstractNpcAI | ||||
| 		int y = loc.getY(); | ||||
| 		if (radius > 0) | ||||
| 		{ | ||||
| 			x += Rnd.get(-radius, radius); | ||||
| 			y += Rnd.get(-radius, radius); | ||||
| 			x += getRandom(-radius, radius); | ||||
| 			y += getRandom(-radius, radius); | ||||
| 		} | ||||
| 		 | ||||
| 		for (int i = 0; i < count; i++) | ||||
|   | ||||
| @@ -22,7 +22,6 @@ import java.util.concurrent.CopyOnWriteArrayList; | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.CommonUtil; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.data.xml.SkillData; | ||||
| import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.enums.Movie; | ||||
| @@ -233,7 +232,7 @@ public class Ramona extends AbstractNpcAI | ||||
| 			{ | ||||
| 				if ((_bossStage == 1) && _ramona1.isInCombat()) | ||||
| 				{ | ||||
| 					Skill randomAttackSkill = RAMONA1_SKILLS[Rnd.get(RAMONA1_SKILLS.length)]; | ||||
| 					Skill randomAttackSkill = RAMONA1_SKILLS[getRandom(RAMONA1_SKILLS.length)]; | ||||
| 					if (getRandom(100) > 20) | ||||
| 					{ | ||||
| 						_ramona1.doCast(randomAttackSkill); | ||||
| @@ -248,7 +247,7 @@ public class Ramona extends AbstractNpcAI | ||||
| 				{ | ||||
| 					if (_ramona2 != null) | ||||
| 					{ | ||||
| 						final Npc minion = addSpawn(MINION_LIST[Rnd.get(MINION_LIST.length)], _ramona2.getX() + getRandom(-200, 200), _ramona2.getY() + getRandom(-200, 200), _ramona2.getZ(), _ramona2.getHeading(), false, 600000); | ||||
| 						final Npc minion = addSpawn(MINION_LIST[getRandom(MINION_LIST.length)], _ramona2.getX() + getRandom(-200, 200), _ramona2.getY() + getRandom(-200, 200), _ramona2.getZ(), _ramona2.getHeading(), false, 600000); | ||||
| 						minion.setRunning(); | ||||
| 						((Attackable) minion).setIsRaidMinion(true); | ||||
| 						addAttackPlayerDesire(minion, player); | ||||
| @@ -262,7 +261,7 @@ public class Ramona extends AbstractNpcAI | ||||
| 			{ | ||||
| 				if ((_bossStage == 2) && _ramona2.isInCombat()) | ||||
| 				{ | ||||
| 					Skill randomAttackSkill = RAMONA2_SKILLS[Rnd.get(RAMONA2_SKILLS.length)]; | ||||
| 					Skill randomAttackSkill = RAMONA2_SKILLS[getRandom(RAMONA2_SKILLS.length)]; | ||||
| 					if (getRandom(100) > 20) | ||||
| 					{ | ||||
| 						_ramona2.doCast(randomAttackSkill); | ||||
| @@ -277,7 +276,7 @@ public class Ramona extends AbstractNpcAI | ||||
| 				{ | ||||
| 					if (_ramona3 != null) | ||||
| 					{ | ||||
| 						final Npc minion = addSpawn(MINION_LIST[Rnd.get(MINION_LIST.length)], _ramona3.getX() + getRandom(-200, 200), _ramona3.getY() + getRandom(-200, 200), _ramona3.getZ(), _ramona3.getHeading(), false, 600000); | ||||
| 						final Npc minion = addSpawn(MINION_LIST[getRandom(MINION_LIST.length)], _ramona3.getX() + getRandom(-200, 200), _ramona3.getY() + getRandom(-200, 200), _ramona3.getZ(), _ramona3.getHeading(), false, 600000); | ||||
| 						minion.setRunning(); | ||||
| 						((Attackable) minion).setIsRaidMinion(true); | ||||
| 						addAttackPlayerDesire(minion, player); | ||||
| @@ -291,7 +290,7 @@ public class Ramona extends AbstractNpcAI | ||||
| 			{ | ||||
| 				if ((_bossStage == 3) && _ramona3.isInCombat()) | ||||
| 				{ | ||||
| 					Skill randomAttackSkill = RAMONA3_SKILLS[Rnd.get(RAMONA3_SKILLS.length)]; | ||||
| 					Skill randomAttackSkill = RAMONA3_SKILLS[getRandom(RAMONA3_SKILLS.length)]; | ||||
| 					if (getRandom(100) > 20) | ||||
| 					{ | ||||
| 						_ramona3.doCast(randomAttackSkill); | ||||
| @@ -510,7 +509,7 @@ public class Ramona extends AbstractNpcAI | ||||
| 		 | ||||
| 		if ((player != null) && !player.isDead()) | ||||
| 		{ | ||||
| 			Skill skillToCast = RAMONA3_SKILLS[Rnd.get(RAMONA3_SKILLS.length)]; | ||||
| 			Skill skillToCast = RAMONA3_SKILLS[getRandom(RAMONA3_SKILLS.length)]; | ||||
| 			if ((skillToCast != null) && SkillCaster.checkUseConditions(npc, skillToCast)) | ||||
| 			 | ||||
| 			{ | ||||
|   | ||||
| @@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger; | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.threads.ThreadPool; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.data.SpawnTable; | ||||
| import org.l2jmobius.gameserver.data.xml.DoorData; | ||||
| import org.l2jmobius.gameserver.enums.Movie; | ||||
| @@ -626,7 +625,7 @@ public class Trasken extends AbstractNpcAI | ||||
| 							_tieTrasken.getSpawn().stopRespawn(); | ||||
| 							_tieTrasken.decayMe(); | ||||
| 							 | ||||
| 							final int[] spawn = TAIL_RANDOM_SPAWN[Rnd.get(TAIL_RANDOM_SPAWN.length)]; | ||||
| 							final int[] spawn = TAIL_RANDOM_SPAWN[getRandom(TAIL_RANDOM_SPAWN.length)]; | ||||
| 							if (SpawnTable.getInstance().getSpawns(TAIL_TRASKEN) == null) | ||||
| 							{ | ||||
| 								ThreadPool.schedule(() -> | ||||
| @@ -647,7 +646,7 @@ public class Trasken extends AbstractNpcAI | ||||
| 							_trasken.getSpawn().stopRespawn(); | ||||
| 							_trasken.decayMe(); | ||||
| 							 | ||||
| 							final int[] spawn1 = TRASKEN_RANDOM_SPAWN[Rnd.get(TRASKEN_RANDOM_SPAWN.length)]; | ||||
| 							final int[] spawn1 = TRASKEN_RANDOM_SPAWN[getRandom(TRASKEN_RANDOM_SPAWN.length)]; | ||||
| 							if (SpawnTable.getInstance().getSpawns(TRASKEN) == null) | ||||
| 							{ | ||||
| 								ThreadPool.schedule(() -> | ||||
|   | ||||
| @@ -27,7 +27,6 @@ import java.util.logging.Level; | ||||
| import java.util.logging.Logger; | ||||
|  | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.data.xml.MultisellData; | ||||
| import org.l2jmobius.gameserver.enums.CategoryType; | ||||
| import org.l2jmobius.gameserver.enums.ClassId; | ||||
| @@ -351,7 +350,7 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler | ||||
| 						LOGGER.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); | ||||
| 						return false; | ||||
| 					} | ||||
| 					final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); | ||||
| 					final Location loc = spectatorSpawns.get(getRandom(spectatorSpawns.size())); | ||||
| 					player.enterOlympiadObserverMode(loc, arenaId); | ||||
| 				} | ||||
| 			} | ||||
|   | ||||
| @@ -16,7 +16,6 @@ | ||||
|  */ | ||||
| package custom.listeners; | ||||
|  | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.model.actor.Attackable; | ||||
| import org.l2jmobius.gameserver.model.events.Containers; | ||||
| import org.l2jmobius.gameserver.model.events.EventType; | ||||
| @@ -126,7 +125,7 @@ public class ListenerTest extends AbstractNpcAI | ||||
| 	private void OnCreatureKill(OnCreatureDeath event) | ||||
| 	{ | ||||
| 		// 70% chance to drop | ||||
| 		if (Rnd.get(100) >= 70) | ||||
| 		if (getRandom(100) >= 70) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| @@ -135,7 +134,7 @@ public class ListenerTest extends AbstractNpcAI | ||||
| 		if ((event.getAttacker() != null) && event.getAttacker().isPlayable() && event.getTarget().isAttackable()) | ||||
| 		{ | ||||
| 			final Attackable monster = (Attackable) event.getTarget(); | ||||
| 			monster.dropItem(event.getAttacker().getActingPlayer(), new ItemHolder(57, Rnd.get(100, 1000))); | ||||
| 			monster.dropItem(event.getAttacker().getActingPlayer(), new ItemHolder(57, getRandom(100, 1000))); | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
|   | ||||
| @@ -29,7 +29,6 @@ import java.util.stream.Collectors; | ||||
| import org.l2jmobius.commons.database.DatabaseFactory; | ||||
| import org.l2jmobius.commons.threads.ThreadPool; | ||||
| import org.l2jmobius.commons.util.Chronos; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.enums.CategoryType; | ||||
| import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult; | ||||
| import org.l2jmobius.gameserver.enums.PartyMessageType; | ||||
| @@ -724,16 +723,16 @@ public class CeremonyOfChaos extends AbstractNpcAI | ||||
| 				msg.addString(winner.getName()); | ||||
| 				 | ||||
| 				// Rewards according to https://l2wiki.com/Ceremony_of_Chaos | ||||
| 				final int marksRewarded = Rnd.get(2, 5); // Guessed | ||||
| 				final int boxs = Rnd.get(1, 5); | ||||
| 				final int marksRewarded = getRandom(2, 5); // Guessed | ||||
| 				final int boxs = getRandom(1, 5); | ||||
| 				winner.addItem("CoC-Winner", 45584, marksRewarded, winner, true); // Mark of battle | ||||
| 				winner.addItem("CoC-Winner", 36333, boxs, winner, true); // Mysterious Box | ||||
| 				// Possible additional rewards | ||||
| 				 | ||||
| 				// Improved Life Stone | ||||
| 				if (Rnd.get(10) < 3) // Chance to get reward (30%) | ||||
| 				if (getRandom(10) < 3) // Chance to get reward (30%) | ||||
| 				{ | ||||
| 					switch (Rnd.get(4)) | ||||
| 					switch (getRandom(4)) | ||||
| 					{ | ||||
| 						case 0: | ||||
| 						{ | ||||
| @@ -758,9 +757,9 @@ public class CeremonyOfChaos extends AbstractNpcAI | ||||
| 					} | ||||
| 				} | ||||
| 				// Soul Crystal Fragment | ||||
| 				else if (Rnd.get(10) < 3) // Chance to get reward (30%) | ||||
| 				else if (getRandom(10) < 3) // Chance to get reward (30%) | ||||
| 				{ | ||||
| 					switch (Rnd.get(6)) | ||||
| 					switch (getRandom(6)) | ||||
| 					{ | ||||
| 						case 0: | ||||
| 						{ | ||||
| @@ -795,7 +794,7 @@ public class CeremonyOfChaos extends AbstractNpcAI | ||||
| 					} | ||||
| 				} | ||||
| 				// Mysterious Belt | ||||
| 				else if (Rnd.get(10) < 1) // Chance to get reward (10%) | ||||
| 				else if (getRandom(10) < 1) // Chance to get reward (10%) | ||||
| 				{ | ||||
| 					winner.addItem("CoC-Winner", 35565, 1, winner, true); // Mysterious Belt | ||||
| 				} | ||||
|   | ||||
| @@ -21,7 +21,6 @@ import java.util.stream.Collectors; | ||||
|  | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.CommonUtil; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.ai.CtrlIntention; | ||||
| import org.l2jmobius.gameserver.enums.CategoryType; | ||||
| import org.l2jmobius.gameserver.enums.ChatType; | ||||
| @@ -152,7 +151,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 		new Location(116925, -180420, -1200, 46585), | ||||
| 		new Location(116656, -180461, -1240, 56363), | ||||
| 	}; | ||||
| 	private static final Location DE_VILLAGE_START = new Location(10400, 17092, -4584, Rnd.get(65520)); | ||||
| 	private static final Location DE_VILLAGE_START = new Location(10400, 17092, -4584, getRandom(65520)); | ||||
| 	// Misc | ||||
| 	private static final int FIRE_IN_DWARVEN_VILLAGE = 23120700; | ||||
| 	private static final int TEMPLATE_ID = 200; | ||||
| @@ -221,7 +220,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 						case "FIGHT": | ||||
| 						{ | ||||
| 							addSpawn(npc, npc.getParameters().getInt("npcId"), npc.getLocation(), true, instance.getId()); | ||||
| 							switch (Rnd.get(3)) | ||||
| 							switch (getRandom(3)) | ||||
| 							{ | ||||
| 								case 0: | ||||
| 								{ | ||||
| @@ -553,7 +552,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 			case "ATTACK_TIME": | ||||
| 			{ | ||||
| 				final List<Npc> tentacles = npc.getInstanceWorld().getAliveNpcs(TENTACLE).stream().filter(n -> n.getVariables().getBoolean("isLeaderKiller", false)).collect(Collectors.toList()); | ||||
| 				npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> addAttackDesire(n, tentacles.get(Rnd.get(tentacles.size())))); | ||||
| 				npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> addAttackDesire(n, tentacles.get(getRandom(tentacles.size())))); | ||||
| 				break; | ||||
| 			} | ||||
| 			case "RUN_TIME": | ||||
| @@ -561,7 +560,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 				npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> | ||||
| 				{ | ||||
| 					n.setRunning(); | ||||
| 					n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_RUN[Rnd.get(SHOUT_RUN.length)]); | ||||
| 					n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_RUN[getRandom(SHOUT_RUN.length)]); | ||||
| 					n.getAI().moveTo(DWARVES_MOVE_1); | ||||
| 				}); | ||||
| 				break; | ||||
| @@ -640,7 +639,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 			} | ||||
| 			case "TIMER_ID_DIE": | ||||
| 			{ | ||||
| 				npc.broadcastSay(ChatType.NPC_GENERAL, SACRIFICED_DARK_ELF_SUICIDE_MESSAGES[Rnd.get(SACRIFICED_DARK_ELF_SUICIDE_MESSAGES.length)]); | ||||
| 				npc.broadcastSay(ChatType.NPC_GENERAL, SACRIFICED_DARK_ELF_SUICIDE_MESSAGES[getRandom(SACRIFICED_DARK_ELF_SUICIDE_MESSAGES.length)]); | ||||
| 				npc.doDie(npc); | ||||
| 				DecayTaskManager.getInstance().cancel(npc); | ||||
| 				break; | ||||
| @@ -675,7 +674,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 			} | ||||
| 			else if ((npc.getX() == DWARVES_MOVE_3.getX()) && (npc.getY() == DWARVES_MOVE_3.getY())) | ||||
| 			{ | ||||
| 				addMoveToDesire(npc, DWARVES_MOVE_RANDOM[Rnd.get(DWARVES_MOVE_RANDOM.length)], 23); | ||||
| 				addMoveToDesire(npc, DWARVES_MOVE_RANDOM[getRandom(DWARVES_MOVE_RANDOM.length)], 23); | ||||
| 			} | ||||
| 		} | ||||
| 		switch (npc.getId()) | ||||
| @@ -864,7 +863,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					dwarf.broadcastSay(ChatType.NPC_GENERAL, SHOUT_BRONK_DEATH[Rnd.get(SHOUT_BRONK_DEATH.length)]); | ||||
| 					dwarf.broadcastSay(ChatType.NPC_GENERAL, SHOUT_BRONK_DEATH[getRandom(SHOUT_BRONK_DEATH.length)]); | ||||
| 				} | ||||
| 			} | ||||
| 			npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.UGH_IF_I_SEE_YOU_IN_THE_SPIRIT_WORLD_FIRST_ROUND_IS_ON_ME); | ||||
| @@ -873,7 +872,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 		} | ||||
| 		else if (npc.getId() == SILVERA) | ||||
| 		{ | ||||
| 			npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_SILVERA_DEATH[Rnd.get(SHOUT_SILVERA_DEATH.length)])); | ||||
| 			npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_SILVERA_DEATH[getRandom(SHOUT_SILVERA_DEATH.length)])); | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| @@ -970,7 +969,7 @@ public class MemoryOfDisaster extends AbstractInstance | ||||
| 		final Instance instance = receiver.getInstanceWorld(); | ||||
| 		if (isInInstance(instance) && event.equals("SCE_J4D_DARK_ELF_START")) | ||||
| 		{ | ||||
| 			getTimers().addTimer("TIMER_ID_DIE", Rnd.get(60000) + 5000, receiver, null); | ||||
| 			getTimers().addTimer("TIMER_ID_DIE", getRandom(60000) + 5000, receiver, null); | ||||
| 		} | ||||
| 		return super.onEventReceived(event, sender, receiver, reference); | ||||
| 	} | ||||
|   | ||||
| @@ -17,7 +17,6 @@ | ||||
| package quests.Q00181_DevilsStrikeBackAdventOfBalok; | ||||
|  | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.enums.QuestSound; | ||||
| import org.l2jmobius.gameserver.enums.QuestType; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| @@ -77,7 +76,7 @@ public class Q00181_DevilsStrikeBackAdventOfBalok extends Quest | ||||
| 				giveAdena(player, 37128000, true); | ||||
| 				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET); | ||||
| 				qs.exitQuest(QuestType.ONE_TIME, true); | ||||
| 				switch (Rnd.get(3)) | ||||
| 				switch (getRandom(3)) | ||||
| 				{ | ||||
| 					case 0: | ||||
| 					{ | ||||
|   | ||||
| @@ -16,7 +16,6 @@ | ||||
|  */ | ||||
| package quests.Q00620_FourGoblets; | ||||
|  | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.enums.QuestSound; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.Player; | ||||
| @@ -141,7 +140,7 @@ public class Q00620_FourGoblets extends Quest | ||||
| 					htmltext = "31454-13.htm"; | ||||
| 					takeItems(player, SEALED_BOX, 1); | ||||
| 					int reward = 0; | ||||
| 					final int rnd = Rnd.get(5); | ||||
| 					final int rnd = getRandom(5); | ||||
| 					if (rnd == 0) | ||||
| 					{ | ||||
| 						giveItems(player, 57, 10000); | ||||
| @@ -149,10 +148,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 					} | ||||
| 					else if (rnd == 1) | ||||
| 					{ | ||||
| 						if (Rnd.get(1000) < 848) | ||||
| 						if (getRandom(1000) < 848) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 43) | ||||
| 							{ | ||||
| 								giveItems(player, 1884, 42); | ||||
| @@ -194,10 +193,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 								giveItems(player, 4043, 1); | ||||
| 							} | ||||
| 						} | ||||
| 						else if (Rnd.get(1000) < 323) | ||||
| 						else if (getRandom(1000) < 323) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 335) | ||||
| 							{ | ||||
| 								giveItems(player, 1888, 1); | ||||
| @@ -230,10 +229,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 					} | ||||
| 					else if (rnd == 2) | ||||
| 					{ | ||||
| 						if (Rnd.get(1000) < 847) | ||||
| 						if (getRandom(1000) < 847) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 148) | ||||
| 							{ | ||||
| 								giveItems(player, 1878, 8); | ||||
| @@ -275,10 +274,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 								giveItems(player, 4044, 1); | ||||
| 							} | ||||
| 						} | ||||
| 						else if (Rnd.get(1000) < 251) | ||||
| 						else if (getRandom(1000) < 251) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 350) | ||||
| 							{ | ||||
| 								giveItems(player, 1887, 1); | ||||
| @@ -311,10 +310,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 					} | ||||
| 					else if (rnd == 3) | ||||
| 					{ | ||||
| 						if (Rnd.get(1000) < 31) | ||||
| 						if (getRandom(1000) < 31) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 223) | ||||
| 							{ | ||||
| 								giveItems(player, 730, 1); | ||||
| @@ -328,10 +327,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 								giveItems(player, 960, 1); | ||||
| 							} | ||||
| 						} | ||||
| 						else if (Rnd.get(1000) < 50) | ||||
| 						else if (getRandom(1000) < 50) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 202) | ||||
| 							{ | ||||
| 								giveItems(player, 729, 1); | ||||
| @@ -348,10 +347,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 					} | ||||
| 					else if (rnd == 4) | ||||
| 					{ | ||||
| 						if (Rnd.get(1000) < 329) | ||||
| 						if (getRandom(1000) < 329) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 88) | ||||
| 							{ | ||||
| 								giveItems(player, 6698, 1); | ||||
| @@ -421,10 +420,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 								giveItems(player, 6714, 1); | ||||
| 							} | ||||
| 						} | ||||
| 						else if (Rnd.get(1000) < 54) | ||||
| 						else if (getRandom(1000) < 54) | ||||
| 						{ | ||||
| 							reward = 1; | ||||
| 							final int i = Rnd.get(1000); | ||||
| 							final int i = getRandom(1000); | ||||
| 							if (i < 100) | ||||
| 							{ | ||||
| 								giveItems(player, 6688, 1); | ||||
| @@ -469,7 +468,7 @@ public class Q00620_FourGoblets extends Quest | ||||
| 					} | ||||
| 					else if (reward == 0) | ||||
| 					{ | ||||
| 						if (Rnd.nextBoolean()) | ||||
| 						if (getRandomBoolean()) | ||||
| 						{ | ||||
| 							htmltext = "31454-14.htm"; | ||||
| 						} | ||||
| @@ -590,7 +589,7 @@ public class Q00620_FourGoblets extends Quest | ||||
| 				htmltext = "31919-3.htm"; | ||||
| 				takeItems(player, SEALED_BOX, 1); | ||||
| 				int reward = 0; | ||||
| 				final int rnd = Rnd.get(5); | ||||
| 				final int rnd = getRandom(5); | ||||
| 				if (rnd == 0) | ||||
| 				{ | ||||
| 					giveItems(player, 57, 10000); | ||||
| @@ -598,10 +597,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 				} | ||||
| 				else if (rnd == 1) | ||||
| 				{ | ||||
| 					if (Rnd.get(1000) < 848) | ||||
| 					if (getRandom(1000) < 848) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 43) | ||||
| 						{ | ||||
| 							giveItems(player, 1884, 42); | ||||
| @@ -643,10 +642,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 							giveItems(player, 4043, 1); | ||||
| 						} | ||||
| 					} | ||||
| 					else if (Rnd.get(1000) < 323) | ||||
| 					else if (getRandom(1000) < 323) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 335) | ||||
| 						{ | ||||
| 							giveItems(player, 1888, 1); | ||||
| @@ -679,10 +678,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 				} | ||||
| 				else if (rnd == 2) | ||||
| 				{ | ||||
| 					if (Rnd.get(1000) < 847) | ||||
| 					if (getRandom(1000) < 847) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 148) | ||||
| 						{ | ||||
| 							giveItems(player, 1878, 8); | ||||
| @@ -724,10 +723,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 							giveItems(player, 4044, 1); | ||||
| 						} | ||||
| 					} | ||||
| 					else if (Rnd.get(1000) < 251) | ||||
| 					else if (getRandom(1000) < 251) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 350) | ||||
| 						{ | ||||
| 							giveItems(player, 1887, 1); | ||||
| @@ -760,10 +759,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 				} | ||||
| 				else if (rnd == 3) | ||||
| 				{ | ||||
| 					if (Rnd.get(1000) < 31) | ||||
| 					if (getRandom(1000) < 31) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 223) | ||||
| 						{ | ||||
| 							giveItems(player, 730, 1); | ||||
| @@ -777,11 +776,11 @@ public class Q00620_FourGoblets extends Quest | ||||
| 							giveItems(player, 960, 1); | ||||
| 						} | ||||
| 					} | ||||
| 					else if (Rnd.get(1000) < 5) | ||||
| 					else if (getRandom(1000) < 5) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 					} | ||||
| 					final int i = Rnd.get(1000); | ||||
| 					final int i = getRandom(1000); | ||||
| 					if (i < 202) | ||||
| 					{ | ||||
| 						giveItems(player, 729, 1); | ||||
| @@ -797,10 +796,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 				} | ||||
| 				else if (rnd == 4) | ||||
| 				{ | ||||
| 					if (Rnd.get(1000) < 329) | ||||
| 					if (getRandom(1000) < 329) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 88) | ||||
| 						{ | ||||
| 							giveItems(player, 6698, 1); | ||||
| @@ -870,10 +869,10 @@ public class Q00620_FourGoblets extends Quest | ||||
| 							giveItems(player, 6714, 1); | ||||
| 						} | ||||
| 					} | ||||
| 					else if (Rnd.get(1000) < 54) | ||||
| 					else if (getRandom(1000) < 54) | ||||
| 					{ | ||||
| 						reward = 1; | ||||
| 						final int i = Rnd.get(1000); | ||||
| 						final int i = getRandom(1000); | ||||
| 						if (i < 100) | ||||
| 						{ | ||||
| 							giveItems(player, 6688, 1); | ||||
| @@ -918,7 +917,7 @@ public class Q00620_FourGoblets extends Quest | ||||
| 				} | ||||
| 				if (reward == 0) | ||||
| 				{ | ||||
| 					if (Rnd.nextBoolean()) | ||||
| 					if (getRandomBoolean()) | ||||
| 					{ | ||||
| 						htmltext = "31919-4.htm"; | ||||
| 					} | ||||
| @@ -1158,7 +1157,7 @@ public class Q00620_FourGoblets extends Quest | ||||
| 		final int npcId = npc.getId(); | ||||
| 		if ((qs != null) && (qs.getCond() > 0) && (npcId >= 18120) && (npcId <= 18256)) | ||||
| 		{ | ||||
| 			if (Rnd.get(100) < 15) | ||||
| 			if (getRandom(100) < 15) | ||||
| 			{ | ||||
| 				giveItems(killer, SEALED_BOX, 1); | ||||
| 				playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); | ||||
|   | ||||
| @@ -22,7 +22,6 @@ import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| import org.l2jmobius.Config; | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.enums.QuestSound; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.Player; | ||||
| @@ -673,7 +672,7 @@ public class Q00662_AGameOfCards extends Quest | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 		final Player player = players.get(Rnd.get(players.size())); | ||||
| 		final Player player = players.get(getRandom(players.size())); | ||||
| 		if ((player != null) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, npc, player, false) && (MONSTERS.get(npc.getId()) < getRandom(1000))) | ||||
| 		{ | ||||
| 			final QuestState qs = getQuestState(player, false); | ||||
|   | ||||
| @@ -19,7 +19,6 @@ package quests.Q00663_SeductiveWhispers; | ||||
| import java.util.Arrays; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| import org.l2jmobius.commons.util.Rnd; | ||||
| import org.l2jmobius.gameserver.model.actor.Npc; | ||||
| import org.l2jmobius.gameserver.model.actor.Player; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| @@ -198,7 +197,7 @@ public class Q00663_SeductiveWhispers extends Quest | ||||
| 			{ | ||||
| 				if (playerCard == null) | ||||
| 				{ | ||||
| 					playerCard = cards[Rnd.get(0, 9)]; | ||||
| 					playerCard = cards[getRandom(0, 9)]; | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| @@ -233,7 +232,7 @@ public class Q00663_SeductiveWhispers extends Quest | ||||
| 				// Player draw a card (Always player start first !!) | ||||
| 				if (playerCard == null) | ||||
| 				{ | ||||
| 					playerCard = cards[Rnd.get(0, 9)]; | ||||
| 					playerCard = cards[getRandom(0, 9)]; | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| @@ -346,7 +345,7 @@ public class Q00663_SeductiveWhispers extends Quest | ||||
| 		final QuestState qs = getQuestState(killer, false); | ||||
| 		if ((qs != null) && qs.isCond(1)) | ||||
| 		{ | ||||
| 			switch (Rnd.get(0, 5)) | ||||
| 			switch (getRandom(0, 5)) | ||||
| 			{ | ||||
| 				case 0: | ||||
| 				case 1: | ||||
| @@ -379,7 +378,7 @@ public class Q00663_SeductiveWhispers extends Quest | ||||
| 	 | ||||
| 	private Card getRandomCard() | ||||
| 	{ | ||||
| 		final int index = Rnd.get(0, 7); | ||||
| 		final int index = getRandom(0, 7); | ||||
| 		return Arrays.stream(cards).filter(card -> (!card.equals(playerCard)) && (!card.equals(npcCard))).collect(Collectors.toList()).get(index); | ||||
| 	} | ||||
| 	 | ||||
| @@ -461,12 +460,12 @@ public class Q00663_SeductiveWhispers extends Quest | ||||
| 	 | ||||
| 	private int getRandomRecipeBGrade() | ||||
| 	{ | ||||
| 		return RECIPES_B_GRADE[Rnd.get(0, RECIPES_B_GRADE.length - 1)]; | ||||
| 		return RECIPES_B_GRADE[getRandom(0, RECIPES_B_GRADE.length - 1)]; | ||||
| 	} | ||||
| 	 | ||||
| 	private int getRandomPartBGrade() | ||||
| 	{ | ||||
| 		return PART_B_GRADE[Rnd.get(0, PART_B_GRADE.length - 1)]; | ||||
| 		return PART_B_GRADE[getRandom(0, PART_B_GRADE.length - 1)]; | ||||
| 	} | ||||
| 	 | ||||
| 	private enum Side | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment