Browse Source

BETA: Cleanup and format of some java scripts.

Zoey76 13 years ago
parent
commit
a46919792c
20 changed files with 1977 additions and 977 deletions
  1. 1 1
      L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/FairyTrees.java
  2. 18 10
      L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/Monastery.java
  3. 4 5
      L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/StarStones.java
  4. 132 75
      L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Antharas.java
  5. 122 33
      L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Baium.java
  6. 123 59
      L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/IceFairySirra.java
  7. 54 22
      L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/QueenAnt.java
  8. 168 119
      L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Valakas.java
  9. 262 153
      L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Zaken.java
  10. 222 121
      L2J_DataPack_BETA/dist/game/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
  11. 1 2
      L2J_DataPack_BETA/dist/game/data/scripts/hellbound/Kanaf/Kanaf.java
  12. 164 89
      L2J_DataPack_BETA/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java
  13. 180 95
      L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaDevilsLegacy.java
  14. 151 42
      L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaSongOfIceAndFire.java
  15. 36 20
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodElpies/eventmodElpies.java
  16. 45 26
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/eventmodRabbits.java
  17. 66 28
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/eventmodRace.java
  18. 3 4
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q463_IMustBeaGenius/Q463_IMustBeaGenius.java
  19. 114 46
      L2J_DataPack_BETA/dist/game/data/scripts/quests/TerritoryWarScripts/TerritoryWarSuperClass.java
  20. 111 27
      L2J_DataPack_BETA/dist/game/data/scripts/retail/PriestOfBlessing/PriestOfBlessing.java

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/FairyTrees.java

@@ -57,7 +57,7 @@ public class FairyTrees extends L2AttackableAIScript
 				newNpc.setRunning();
 				newNpc.addDamageHate(originalKiller, 0, 999);
 				newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalKiller);
-				if (Rnd.get(1, 2) == 1)
+				if (Rnd.nextBoolean())
 				{
 					L2Skill skill = SkillTable.getInstance().getInfo(4243, 1);
 					if ((skill != null) && (originalKiller != null))

+ 18 - 10
L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/Monastery.java

@@ -33,7 +33,6 @@ import com.l2jserver.gameserver.model.skills.L2SkillType;
 import com.l2jserver.gameserver.network.NpcStringId;
 import com.l2jserver.gameserver.network.serverpackets.NpcSay;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * @author Kerberos
@@ -42,11 +41,16 @@ public class Monastery extends L2AttackableAIScript
 {
 	private static final int[] mobs1 =
 	{
-		22124, 22125, 22126, 22127, 22129
+		22124,
+		22125,
+		22126,
+		22127,
+		22129
 	};
 	private static final int[] mobs2 =
 	{
-		22134, 22135
+		22134,
+		22135
 	};
 	
 	private static final NpcStringId[] messages =
@@ -66,7 +70,7 @@ public class Monastery extends L2AttackableAIScript
 	@Override
 	public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
 	{
-		if (Util.contains(mobs1, npc.getNpcId()) && !npc.isInCombat() && npc.getTarget() == null)
+		if (Util.contains(mobs1, npc.getNpcId()) && !npc.isInCombat() && (npc.getTarget() == null))
 		{
 			if (player.getActiveWeaponInstance() != null)
 			{
@@ -91,7 +95,9 @@ public class Monastery extends L2AttackableAIScript
 				}
 			}
 			else if (((L2Attackable) npc).getMostHated() == null)
+			{
 				return null;
+			}
 		}
 		return super.onAggroRangeEnter(npc, player, isPet);
 	}
@@ -101,13 +107,13 @@ public class Monastery extends L2AttackableAIScript
 	{
 		if (Util.contains(mobs2, npc.getNpcId()))
 		{
-			if (skill.getSkillType() == L2SkillType.AGGDAMAGE && targets.length != 0)
+			if ((skill.getSkillType() == L2SkillType.AGGDAMAGE) && (targets.length != 0))
 			{
 				for (L2Object obj : targets)
 				{
 					if (obj.equals(npc))
 					{
-						NpcSay packet = new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), messages[Rnd.get(2) + 1]);
+						NpcSay packet = new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), messages[getRandom(2) + 1]);
 						packet.addStringParameter(caster.getName());
 						npc.broadcastPacket(packet);
 						((L2Attackable) npc).addDamageHate(caster, 0, 999);
@@ -129,19 +135,21 @@ public class Monastery extends L2AttackableAIScript
 			Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
 			for (L2Object obj : objs)
 			{
-				if (obj instanceof L2PcInstance || obj instanceof L2PetInstance)
+				if ((obj instanceof L2PcInstance) || (obj instanceof L2PetInstance))
 				{
 					if (Util.checkIfInRange(npc.getAggroRange(), npc, obj, true) && !((L2Character) obj).isDead())
+					{
 						result.add((L2Playable) obj);
+					}
 				}
 			}
-			if (!result.isEmpty() && result.size() != 0)
+			if (!result.isEmpty() && (result.size() != 0))
 			{
 				Object[] characters = result.toArray();
 				for (Object obj : characters)
 				{
 					L2Playable target = (L2Playable) (obj instanceof L2PcInstance ? obj : ((L2Summon) obj).getOwner());
-					if (target.getActiveWeaponInstance() != null && !npc.isInCombat() && npc.getTarget() == null)
+					if ((target.getActiveWeaponInstance() != null) && !npc.isInCombat() && (npc.getTarget() == null))
 					{
 						npc.setTarget(target);
 						npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), messages[0]));
@@ -173,7 +181,7 @@ public class Monastery extends L2AttackableAIScript
 	@Override
 	public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
 	{
-		if (Util.contains(mobs1, npc.getNpcId()) && skill.getId() == 4589)
+		if (Util.contains(mobs1, npc.getNpcId()) && (skill.getId() == 4589))
 		{
 			npc.setIsRunning(true);
 			((L2Attackable) npc).addDamageHate(player, 0, 999);

+ 4 - 5
L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/StarStones.java

@@ -20,7 +20,6 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * @author Gigiikun
@@ -79,15 +78,15 @@ public class StarStones extends L2AttackableAIScript
 					// unknown npc!
 					return super.onSkillSee(npc, caster, skill, targets, isPet);
 			}
-			if (Rnd.get(100) < 33)
+			if (getRandom(100) < 33)
 			{
 				caster.sendPacket(SystemMessageId.THE_COLLECTION_HAS_SUCCEEDED);
-				caster.addItem("StarStone", itemId, Rnd.get(RATE + 1, 2 * RATE), null, true);
+				caster.addItem("StarStone", itemId, getRandom(RATE + 1, 2 * RATE), null, true);
 			}
-			else if (((skill.getLevel() == 1) && (Rnd.get(100) < 15)) || ((skill.getLevel() == 2) && (Rnd.get(100) < 50)) || ((skill.getLevel() == 3) && (Rnd.get(100) < 75)))
+			else if (((skill.getLevel() == 1) && (getRandom(100) < 15)) || ((skill.getLevel() == 2) && (getRandom(100) < 50)) || ((skill.getLevel() == 3) && (getRandom(100) < 75)))
 			{
 				caster.sendPacket(SystemMessageId.THE_COLLECTION_HAS_SUCCEEDED);
-				caster.addItem("StarStone", itemId, Rnd.get(1, RATE), null, true);
+				caster.addItem("StarStone", itemId, getRandom(1, RATE), null, true);
 			}
 			else
 			{

+ 132 - 75
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Antharas.java

@@ -46,7 +46,6 @@ import com.l2jserver.gameserver.network.serverpackets.Earthquake;
 import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
 import com.l2jserver.gameserver.network.serverpackets.PlaySound;
 import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
-import com.l2jserver.util.Rnd;
 
 /**
  * This class ... control for sequence of fight against Antharas.
@@ -56,7 +55,7 @@ public class Antharas extends L2AttackableAIScript
 {
 	// config
 	private static final int FWA_ACTIVITYTIMEOFANTHARAS = 120;
-	//private static final int FWA_APPTIMEOFANTHARAS = 1800000;
+	// private static final int FWA_APPTIMEOFANTHARAS = 1800000;
 	private static final int FWA_INACTIVITYTIME = 900000;
 	private static final boolean FWA_OLDANTHARAS = false;
 	private static final boolean FWA_MOVEATRANDOM = true;
@@ -72,7 +71,15 @@ public class Antharas extends L2AttackableAIScript
 	private static final int FWA_SELFDESTRUCTTIME = 15000;
 	// Location of teleport cube.
 	private final int _teleportCubeId = 31859;
-	private final int _teleportCubeLocation[][] = { { 177615, 114941, -7709, 0 } };
+	private final int _teleportCubeLocation[][] =
+	{
+		{
+			177615,
+			114941,
+			-7709,
+			0
+		}
+	};
 	
 	protected List<L2Spawn> _teleportCubeSpawn = new FastList<L2Spawn>();
 	protected List<L2Npc> _teleportCube = new FastList<L2Npc>();
@@ -101,12 +108,12 @@ public class Antharas extends L2AttackableAIScript
 	protected ScheduledFuture<?> _moveAtRandomTask = null;
 	protected ScheduledFuture<?> _movieTask = null;
 	
-	//Antharas Status Tracking :
-	private static final byte DORMANT = 0;		//Antharas is spawned and no one has entered yet. Entry is unlocked
-	private static final byte WAITING = 1;		//Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter
-	//before he unleashes his attack. Entry is unlocked
-	private static final byte FIGHTING = 2;		//Antharas is engaged in battle, annihilating his foes. Entry is locked
-	private static final byte DEAD = 3;			//Antharas has been killed. Entry is locked
+	// Antharas Status Tracking :
+	private static final byte DORMANT = 0; // Antharas is spawned and no one has entered yet. Entry is unlocked
+	private static final byte WAITING = 1; // Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter
+	// before he unleashes his attack. Entry is unlocked
+	private static final byte FIGHTING = 2; // Antharas is engaged in battle, annihilating his foes. Entry is locked
+	private static final byte DEAD = 3; // Antharas has been killed. Entry is locked
 	
 	protected static long _LastAction = 0;
 	
@@ -115,14 +122,28 @@ public class Antharas extends L2AttackableAIScript
 	public static void main(String[] args)
 	{
 		// now call the constructor (starts up the ai)
-		new Antharas(-1,"antharas","ai");
+		new Antharas(-1, "antharas", "ai");
 	}
 	
 	// Boss: Antharas
-	public Antharas(int id,String name,String descr)
+	public Antharas(int id, String name, String descr)
 	{
-		super(id,name,descr);
-		int[] mob = {ANTHARASOLDID,ANTHARASWEAKID,ANTHARASNORMALID,ANTHARASSTRONGID,29069,29070,29071,29072,29073,29074,29075,29076};
+		super(id, name, descr);
+		int[] mob =
+		{
+			ANTHARASOLDID,
+			ANTHARASWEAKID,
+			ANTHARASNORMALID,
+			ANTHARASSTRONGID,
+			29069,
+			29070,
+			29071,
+			29072,
+			29073,
+			29074,
+			29075,
+			29076
+		};
 		this.registerMobs(mob);
 		init();
 	}
@@ -133,7 +154,7 @@ public class Antharas extends L2AttackableAIScript
 		// Setting spawn data of monsters.
 		try
 		{
-			_Zone = GrandBossManager.getInstance().getZone(179700,113800,-7709);
+			_Zone = GrandBossManager.getInstance().getZone(179700, 113800, -7709);
 			L2NpcTemplate template1;
 			L2Spawn tempSpawn;
 			
@@ -214,15 +235,15 @@ public class Antharas extends L2AttackableAIScript
 			_log.warning(e.getMessage());
 		}
 		int status = GrandBossManager.getInstance().getBossStatus(ANTHARASOLDID);
-		if (FWA_OLDANTHARAS || status == WAITING)
+		if (FWA_OLDANTHARAS || (status == WAITING))
 		{
 			StatsSet info = GrandBossManager.getInstance().getStatsSet(ANTHARASOLDID);
 			Long respawnTime = info.getLong("respawn_time");
-			if (status == DEAD && respawnTime <= System.currentTimeMillis())
+			if ((status == DEAD) && (respawnTime <= System.currentTimeMillis()))
 			{
 				// the time has already expired while the server was offline. Immediately spawn antharas in his cave.
 				// also, the status needs to be changed to DORMANT
-				GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,DORMANT);
+				GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, DORMANT);
 				status = DORMANT;
 			}
 			else if (status == FIGHTING)
@@ -233,9 +254,9 @@ public class Antharas extends L2AttackableAIScript
 				int heading = info.getInteger("heading");
 				int hp = info.getInteger("currentHP");
 				int mp = info.getInteger("currentMP");
-				_antharas = (L2GrandBossInstance) addSpawn(ANTHARASOLDID,loc_x,loc_y,loc_z,heading,false,0);
+				_antharas = (L2GrandBossInstance) addSpawn(ANTHARASOLDID, loc_x, loc_y, loc_z, heading, false, 0);
 				GrandBossManager.getInstance().addBoss(_antharas);
-				_antharas.setCurrentHpMp(hp,mp);
+				_antharas.setCurrentHpMp(hp, mp);
 				_LastAction = System.currentTimeMillis();
 				// Start repeating timer to check for inactivity
 				_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
@@ -255,22 +276,22 @@ public class Antharas extends L2AttackableAIScript
 			int statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARASNORMALID);
 			int statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARASSTRONGID);
 			int antharasId = 0;
-			if (statusWeak == FIGHTING || statusWeak == DEAD)
+			if ((statusWeak == FIGHTING) || (statusWeak == DEAD))
 			{
 				antharasId = ANTHARASWEAKID;
 				status = statusWeak;
 			}
-			else if (statusNormal == FIGHTING || statusNormal == DEAD)
+			else if ((statusNormal == FIGHTING) || (statusNormal == DEAD))
 			{
 				antharasId = ANTHARASNORMALID;
 				status = statusNormal;
 			}
-			else if (statusStrong == FIGHTING || statusStrong == DEAD)
+			else if ((statusStrong == FIGHTING) || (statusStrong == DEAD))
 			{
 				antharasId = ANTHARASSTRONGID;
 				status = statusStrong;
 			}
-			if (antharasId != 0 && status == FIGHTING)
+			if ((antharasId != 0) && (status == FIGHTING))
 			{
 				StatsSet info = GrandBossManager.getInstance().getStatsSet(antharasId);
 				int loc_x = info.getInteger("loc_x");
@@ -279,14 +300,14 @@ public class Antharas extends L2AttackableAIScript
 				int heading = info.getInteger("heading");
 				int hp = info.getInteger("currentHP");
 				int mp = info.getInteger("currentMP");
-				_antharas = (L2GrandBossInstance) addSpawn(antharasId,loc_x,loc_y,loc_z,heading,false,0);
+				_antharas = (L2GrandBossInstance) addSpawn(antharasId, loc_x, loc_y, loc_z, heading, false, 0);
 				GrandBossManager.getInstance().addBoss(_antharas);
-				_antharas.setCurrentHpMp(hp,mp);
+				_antharas.setCurrentHpMp(hp, mp);
 				_LastAction = System.currentTimeMillis();
 				// Start repeating timer to check for inactivity
 				_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
 			}
-			else if (antharasId != 0 && status == DEAD)
+			else if ((antharasId != 0) && (status == DEAD))
 			{
 				StatsSet info = GrandBossManager.getInstance().getStatsSet(antharasId);
 				Long respawnTime = info.getLong("respawn_time");
@@ -294,7 +315,7 @@ public class Antharas extends L2AttackableAIScript
 				{
 					// the time has already expired while the server was offline. Immediately spawn antharas in his cave.
 					// also, the status needs to be changed to DORMANT
-					GrandBossManager.getInstance().setBossStatus(antharasId,DORMANT);
+					GrandBossManager.getInstance().setBossStatus(antharasId, DORMANT);
 					status = DORMANT;
 				}
 				else
@@ -335,12 +356,12 @@ public class Antharas extends L2AttackableAIScript
 	{
 		if (_monsterSpawnTask == null)
 		{
-			synchronized(this)
+			synchronized (this)
 			{
 				if (_monsterSpawnTask == null)
 				{
-					GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,WAITING);
-					_monsterSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(1),Config.Antharas_Wait_Time);
+					GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, WAITING);
+					_monsterSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(1), Config.Antharas_Wait_Time);
 				}
 			}
 		}
@@ -349,9 +370,11 @@ public class Antharas extends L2AttackableAIScript
 	@Override
 	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
 	{
-		if(event.equalsIgnoreCase("waiting"))
+		if (event.equalsIgnoreCase("waiting"))
+		{
 			setAntharasSpawnTask();
-
+		}
+		
 		return super.onAdvEvent(event, npc, player);
 	}
 	
@@ -403,13 +426,21 @@ public class Antharas extends L2AttackableAIScript
 					_monsterSpawnTask.cancel(false);
 					_monsterSpawnTask = null;
 					if (FWA_OLDANTHARAS)
+					{
 						npcId = 29019; // old
+					}
 					else if (_players.length <= FWA_LIMITOFWEAK)
+					{
 						npcId = 29066; // weak
+					}
 					else if (_players.length > FWA_LIMITOFNORMAL)
+					{
 						npcId = 29068; // strong
+					}
 					else
+					{
 						npcId = 29067; // normal
+					}
 					
 					// Do spawn.
 					antharasSpawn = _monsterSpawn.get(npcId);
@@ -419,8 +450,8 @@ public class Antharas extends L2AttackableAIScript
 					_monsters.add(_antharas);
 					_antharas.setIsImmobilized(true);
 					
-					GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,DORMANT);
-					GrandBossManager.getInstance().setBossStatus(npcId,FIGHTING);
+					GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, DORMANT);
+					GrandBossManager.getInstance().setBossStatus(npcId, FIGHTING);
 					_LastAction = System.currentTimeMillis();
 					// Start repeating timer to check for inactivity
 					_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
@@ -441,7 +472,7 @@ public class Antharas extends L2AttackableAIScript
 					break;
 				case 2:
 					// Set camera.
-					broadcastPacket(new SpecialCamera(_antharas.getObjectId(),700,13,-19,0,20000,0,0,1,0));
+					broadcastPacket(new SpecialCamera(_antharas.getObjectId(), 700, 13, -19, 0, 20000, 0, 0, 1, 0));
 					
 					// Set next task.
 					if (_socialTask != null)
@@ -451,10 +482,10 @@ public class Antharas extends L2AttackableAIScript
 					}
 					_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(3), 3000);
 					break;
-					
+				
 				case 3:
 					// Do social.
-					broadcastPacket(new SpecialCamera(_antharas.getObjectId(),700,13,0,6000,20000,0,0,1,0));
+					broadcastPacket(new SpecialCamera(_antharas.getObjectId(), 700, 13, 0, 6000, 20000, 0, 0, 1, 0));
 					// Set next task.
 					if (_socialTask != null)
 					{
@@ -464,7 +495,7 @@ public class Antharas extends L2AttackableAIScript
 					_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(4), 10000);
 					break;
 				case 4:
-					broadcastPacket(new SpecialCamera(_antharas.getObjectId(),3700,0,-3,0,10000,0,0,1,0));
+					broadcastPacket(new SpecialCamera(_antharas.getObjectId(), 3700, 0, -3, 0, 10000, 0, 0, 1, 0));
 					// Set next task.
 					if (_socialTask != null)
 					{
@@ -473,10 +504,10 @@ public class Antharas extends L2AttackableAIScript
 					}
 					_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(5), 200);
 					break;
-					
+				
 				case 5:
 					// Do social.
-					broadcastPacket(new SpecialCamera(_antharas.getObjectId(),1100,0,-3,22000,30000,0,0,1,0));
+					broadcastPacket(new SpecialCamera(_antharas.getObjectId(), 1100, 0, -3, 22000, 30000, 0, 0, 1, 0));
 					// Set next task.
 					if (_socialTask != null)
 					{
@@ -485,10 +516,10 @@ public class Antharas extends L2AttackableAIScript
 					}
 					_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(6), 10800);
 					break;
-					
+				
 				case 6:
 					// Set camera.
-					broadcastPacket(new SpecialCamera(_antharas.getObjectId(),1100,0,-3,300,7000,0,0,1,0));
+					broadcastPacket(new SpecialCamera(_antharas.getObjectId(), 1100, 0, -3, 300, 7000, 0, 0, 1, 0));
 					// Set next task.
 					if (_socialTask != null)
 					{
@@ -497,7 +528,7 @@ public class Antharas extends L2AttackableAIScript
 					}
 					_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(7), 1900);
 					break;
-					
+				
 				case 7:
 					_antharas.abortCast();
 					
@@ -506,8 +537,8 @@ public class Antharas extends L2AttackableAIScript
 					// Move at random.
 					if (FWA_MOVEATRANDOM)
 					{
-						L2CharPosition pos = new L2CharPosition(Rnd.get(175000,178500), Rnd.get(112400, 116000), -7707, 0);
-						_moveAtRandomTask = ThreadPoolManager.getInstance().scheduleGeneral(new MoveAtRandom(_antharas, pos),500);
+						L2CharPosition pos = new L2CharPosition(getRandom(175000, 178500), getRandom(112400, 116000), -7707, 0);
+						_moveAtRandomTask = ThreadPoolManager.getInstance().scheduleGeneral(new MoveAtRandom(_antharas, pos), 500);
 					}
 					
 					if (_socialTask != null)
@@ -527,7 +558,9 @@ public class Antharas extends L2AttackableAIScript
 			for (L2Character characters : _Zone.getCharactersInsideArray())
 			{
 				if (characters instanceof L2PcInstance)
+				{
 					characters.sendPacket(mov);
+				}
 			}
 		}
 	}
@@ -544,20 +577,26 @@ public class Antharas extends L2AttackableAIScript
 		{
 			L2NpcTemplate template1;
 			L2Spawn tempSpawn;
-			boolean isBehemoth = Rnd.get(100) < FWA_PERCENTOFBEHEMOTH;
+			boolean isBehemoth = getRandom(100) < FWA_PERCENTOFBEHEMOTH;
 			try
 			{
 				int mobNumber = (isBehemoth ? 2 : 3);
 				// Set spawn.
-				for(int i = 0; i < mobNumber; i++)
+				for (int i = 0; i < mobNumber; i++)
 				{
 					if (_monsters.size() >= FWA_MAXMOBS)
+					{
 						break;
+					}
 					int npcId;
 					if (isBehemoth)
+					{
 						npcId = 29069;
+					}
 					else
-						npcId = Rnd.get(29070, 29076);
+					{
+						npcId = getRandom(29070, 29076);
+					}
 					template1 = NpcTable.getInstance().getTemplate(npcId);
 					tempSpawn = new L2Spawn(template1);
 					// allocates it at random in the lair of Antharas.
@@ -565,21 +604,25 @@ public class Antharas extends L2AttackableAIScript
 					boolean notFound = true;
 					int x = 175000;
 					int y = 112400;
-					int dt = (_antharas.getX() - x) * (_antharas.getX() - x) + (_antharas.getY() - y) * (_antharas.getY() - y);
-					while (tried++ < 25 && notFound)
+					int dt = ((_antharas.getX() - x) * (_antharas.getX() - x)) + ((_antharas.getY() - y) * (_antharas.getY() - y));
+					while ((tried++ < 25) && notFound)
 					{
-						int rx = Rnd.get(175000, 179900);
-						int ry = Rnd.get(112400, 116000);
-						int rdt = (_antharas.getX() - rx) * (_antharas.getX() - rx) + (_antharas.getY() - ry) * (_antharas.getY() - ry);
+						int rx = getRandom(175000, 179900);
+						int ry = getRandom(112400, 116000);
+						int rdt = ((_antharas.getX() - rx) * (_antharas.getX() - rx)) + ((_antharas.getY() - ry) * (_antharas.getY() - ry));
 						if (GeoData.getInstance().canSeeTarget(_antharas.getX(), _antharas.getY(), -7704, rx, ry, -7704))
+						{
 							if (rdt < dt)
 							{
 								x = rx;
 								y = ry;
 								dt = rdt;
 								if (rdt <= 900000)
+								{
 									notFound = false;
+								}
 							}
+						}
 					}
 					tempSpawn.setLocx(x);
 					tempSpawn.setLocy(y);
@@ -600,7 +643,7 @@ public class Antharas extends L2AttackableAIScript
 	}
 	
 	@Override
-	public String onAggroRangeEnter (L2Npc npc, L2PcInstance player, boolean isPet)
+	public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
 	{
 		switch (npc.getNpcId())
 		{
@@ -611,8 +654,10 @@ public class Antharas extends L2AttackableAIScript
 			case 29074:
 			case 29075:
 			case 29076:
-				if (_selfDestructionTask == null && !npc.isDead())
+				if ((_selfDestructionTask == null) && !npc.isDead())
+				{
 					_selfDestructionTask = ThreadPoolManager.getInstance().scheduleGeneral(new SelfDestructionOfBomber(npc), FWA_SELFDESTRUCTTIME);
+				}
 				break;
 		}
 		return super.onAggroRangeEnter(npc, player, isPet);
@@ -663,7 +708,7 @@ public class Antharas extends L2AttackableAIScript
 		{
 			return null;
 		}
-		else if (skill != null && (skill.getId() == 5097 || skill.getId() == 5094))
+		else if ((skill != null) && ((skill.getId() == 5097) || (skill.getId() == 5094)))
 		{
 			switch (npc.getNpcId())
 			{
@@ -690,7 +735,7 @@ public class Antharas extends L2AttackableAIScript
 			Long temp = (System.currentTimeMillis() - _LastAction);
 			if (temp > FWA_INACTIVITYTIME)
 			{
-				GrandBossManager.getInstance().setBossStatus(_antharas.getNpcId(),DORMANT);
+				GrandBossManager.getInstance().setBossStatus(_antharas.getNpcId(), DORMANT);
 				setUnspawn();
 			}
 		}
@@ -780,7 +825,9 @@ public class Antharas extends L2AttackableAIScript
 				_cubeSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new CubeSpawn(1), 1800000);
 			}
 			else
+			{
 				setUnspawn();
+			}
 		}
 	}
 	
@@ -797,10 +844,14 @@ public class Antharas extends L2AttackableAIScript
 		@Override
 		public void run()
 		{
-			GrandBossManager.getInstance().setBossStatus(_bossId,DORMANT);
+			GrandBossManager.getInstance().setBossStatus(_bossId, DORMANT);
 			if (FWA_DOSERVEREARTHQUAKE)
-				for(L2PcInstance p : L2World.getInstance().getAllPlayersArray())
-					p.broadcastPacket(new Earthquake(185708,114298,-8221,20,10));
+			{
+				for (L2PcInstance p : L2World.getInstance().getAllPlayersArray())
+				{
+					p.broadcastPacket(new Earthquake(185708, 114298, -8221, 20, 10));
+				}
+			}
 		}
 	}
 	
@@ -848,21 +899,21 @@ public class Antharas extends L2AttackableAIScript
 	}
 	
 	@Override
-	public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
 	{
-		if (npc.getNpcId() == 29019 || npc.getNpcId() == 29066 || npc.getNpcId() == 29067 || npc.getNpcId() == 29068)
+		if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068))
 		{
 			_LastAction = System.currentTimeMillis();
 			if (GrandBossManager.getInstance().getBossStatus(_antharas.getNpcId()) != FIGHTING)
 			{
 				_Zone.oustAllPlayers();
 			}
-			else if (!FWA_OLDANTHARAS && _mobsSpawnTask == null)
+			else if (!FWA_OLDANTHARAS && (_mobsSpawnTask == null))
 			{
 				startMinionSpawns(npc.getNpcId());
 			}
 		}
-		else if (npc.getNpcId() > 29069 && npc.getNpcId() < 29077 && npc.getCurrentHp() <= damage)
+		else if ((npc.getNpcId() > 29069) && (npc.getNpcId() < 29077) && (npc.getCurrentHp() <= damage))
 		{
 			L2Skill skill = null;
 			switch (npc.getNpcId())
@@ -886,31 +937,37 @@ public class Antharas extends L2AttackableAIScript
 	}
 	
 	@Override
-	public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
 	{
-		if (npc.getNpcId() == 29019 || npc.getNpcId() == 29066 || npc.getNpcId() == 29067 || npc.getNpcId() == 29068)
+		if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068))
 		{
 			npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
 			_cubeSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new CubeSpawn(0), 10000);
-			GrandBossManager.getInstance().setBossStatus(npc.getNpcId(),DEAD);
-			long respawnTime = (long)Config.Interval_Of_Antharas_Spawn + Rnd.get(Config.Random_Of_Antharas_Spawn);
+			GrandBossManager.getInstance().setBossStatus(npc.getNpcId(), DEAD);
+			long respawnTime = (long) Config.Interval_Of_Antharas_Spawn + getRandom(Config.Random_Of_Antharas_Spawn);
 			ThreadPoolManager.getInstance().scheduleGeneral(new UnlockAntharas(npc.getNpcId()), respawnTime);
 			// also save the respawn time so that the info is maintained past reboots
 			StatsSet info = GrandBossManager.getInstance().getStatsSet(npc.getNpcId());
-			info.set("respawn_time",(System.currentTimeMillis() + respawnTime));
-			GrandBossManager.getInstance().setStatsSet(npc.getNpcId(),info);
+			info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
+			GrandBossManager.getInstance().setStatsSet(npc.getNpcId(), info);
 		}
 		else if (npc.getNpcId() == 29069)
 		{
-			int countHPHerb = Rnd.get(6, 18);
-			int countMPHerb = Rnd.get(6, 18);
+			int countHPHerb = getRandom(6, 18);
+			int countMPHerb = getRandom(6, 18);
 			for (int i = 0; i < countHPHerb; i++)
-				((L2MonsterInstance)npc).dropItem(killer, 8602, 1);
+			{
+				((L2MonsterInstance) npc).dropItem(killer, 8602, 1);
+			}
 			for (int i = 0; i < countMPHerb; i++)
-				((L2MonsterInstance)npc).dropItem(killer, 8605, 1);
+			{
+				((L2MonsterInstance) npc).dropItem(killer, 8605, 1);
+			}
 		}
 		if (_monsters.contains(npc))
+		{
 			_monsters.remove(npc);
-		return super.onKill(npc,killer,isPet);
+		}
+		return super.onKill(npc, killer, isPet);
 	}
 }

+ 122 - 33
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Baium.java

@@ -47,7 +47,6 @@ import com.l2jserver.gameserver.network.serverpackets.Earthquake;
 import com.l2jserver.gameserver.network.serverpackets.MoveToPawn;
 import com.l2jserver.gameserver.network.serverpackets.PlaySound;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * Baium AI Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but players also lose their ability to wake baium up. However, should another person enter the room and wake him up, the players who had stayed inside may join the raid. This can be helpful for
@@ -156,7 +155,9 @@ public class Baium extends L2AttackableAIScript
 			}, 100L);
 		}
 		else
+		{
 			addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
+		}
 	}
 	
 	@Override
@@ -167,7 +168,7 @@ public class Baium extends L2AttackableAIScript
 			GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
 			addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
 		}
-		else if (event.equalsIgnoreCase("skill_range") && npc != null)
+		else if (event.equalsIgnoreCase("skill_range") && (npc != null))
 		{
 			callSkillAI(npc);
 		}
@@ -175,7 +176,7 @@ public class Baium extends L2AttackableAIScript
 		{
 			_target = getRandomTarget(npc);
 		}
-		else if (event.equalsIgnoreCase("baium_wakeup") && npc != null)
+		else if (event.equalsIgnoreCase("baium_wakeup") && (npc != null))
 		{
 			if (npc.getNpcId() == LIVE_BAIUM)
 			{
@@ -196,7 +197,9 @@ public class Baium extends L2AttackableAIScript
 							baium.setIsInvul(false);
 							baium.setIsImmobilized(false);
 							for (L2Npc minion : _Minions)
+							{
 								minion.setShowSummonAnimation(false);
+							}
 						}
 						catch (Exception e)
 						{
@@ -206,9 +209,9 @@ public class Baium extends L2AttackableAIScript
 				}, 11100L);
 				// TODO: the person who woke baium up should be knocked across the room, onto a wall, and
 				// lose massive amounts of HP.
-				for (int i = 0; i < ANGEL_LOCATION.length; i++)
+				for (Location element : ANGEL_LOCATION)
 				{
-					L2Npc angel = addSpawn(ARCHANGEL, ANGEL_LOCATION[i], false, 0, true);
+					L2Npc angel = addSpawn(ARCHANGEL, element, false, 0, true);
 					angel.setIsInvul(true);
 					_Minions.add(angel);
 				}
@@ -216,29 +219,33 @@ public class Baium extends L2AttackableAIScript
 			// despawn the live baium after 30 minutes of inactivity
 			// also check if the players are cheating, having pulled Baium outside his zone...
 		}
-		else if (event.equalsIgnoreCase("baium_despawn") && npc != null)
+		else if (event.equalsIgnoreCase("baium_despawn") && (npc != null))
 		{
 			if (npc.getNpcId() == LIVE_BAIUM)
 			{
 				// just in case the zone reference has been lost (somehow...), restore the reference
 				if (_Zone == null)
+				{
 					_Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
-				if (_LastAttackVsBaiumTime + 1800000 < System.currentTimeMillis())
+				}
+				if ((_LastAttackVsBaiumTime + 1800000) < System.currentTimeMillis())
 				{
 					npc.deleteMe(); // despawn the live-baium
 					for (L2Npc minion : _Minions)
+					{
 						if (minion != null)
 						{
 							minion.getSpawn().stopRespawn();
 							minion.deleteMe();
 						}
+					}
 					_Minions.clear();
 					addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium
 					GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more
 					_Zone.oustAllPlayers();
 					cancelQuestTimer("baium_despawn", npc, null);
 				}
-				else if ((_LastAttackVsBaiumTime + 300000 < System.currentTimeMillis()) && npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0))
+				else if (((_LastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)))
 				{
 					npc.setIsCastingNow(false); // just in case
 					npc.setTarget(npc);
@@ -246,18 +253,24 @@ public class Baium extends L2AttackableAIScript
 					if (skill.isMagic())
 					{
 						if (npc.isMuted())
+						{
 							return super.onAdvEvent(event, npc, player);
+						}
 					}
 					else
 					{
 						if (npc.isPhysicalMuted())
+						{
 							return super.onAdvEvent(event, npc, player);
+						}
 					}
 					npc.doCast(skill);
 					npc.setIsCastingNow(true);
 				}
 				else if (!_Zone.isInsideZone(npc))
+				{
 					npc.teleToLocation(116033, 17447, 10104);
+				}
 			}
 		}
 		return super.onAdvEvent(event, npc, player);
@@ -269,10 +282,14 @@ public class Baium extends L2AttackableAIScript
 		int npcId = npc.getNpcId();
 		String htmltext = "";
 		if (_Zone == null)
+		{
 			_Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
+		}
 		if (_Zone == null)
+		{
 			return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>";
-		if (npcId == STONE_BAIUM && GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP)
+		}
+		if ((npcId == STONE_BAIUM) && (GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP))
 		{
 			if (_Zone.isPlayerAllowed(player))
 			{
@@ -304,7 +321,9 @@ public class Baium extends L2AttackableAIScript
 				}, 100L);
 			}
 			else
+			{
 				htmltext = "Conditions are not right to wake up Baium";
+			}
 		}
 		else if (npcId == ANGELIC_VORTEX)
 		{
@@ -314,7 +333,7 @@ public class Baium extends L2AttackableAIScript
 				return "<html><body>Angelic Vortex:<br>You may not enter while flying a wyvern</body></html>";
 			}
 			
-			if (GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP && player.getQuestState("baium").hasQuestItems(4295)) // bloody fabric
+			if ((GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP) && player.getQuestState("baium").hasQuestItems(4295)) // bloody fabric
 			{
 				player.getQuestState("baium").takeItems(4295, 1);
 				// allow entry for the player for the next 30 secs (more than enough time for the TP to happen)
@@ -323,7 +342,9 @@ public class Baium extends L2AttackableAIScript
 				player.teleToLocation(113100, 14500, 10077);
 			}
 			else
+			{
 				npc.showChatWindow(player, 1);
+			}
 		}
 		return htmltext;
 	}
@@ -336,7 +357,7 @@ public class Baium extends L2AttackableAIScript
 			npc.getAI().setIntention(AI_INTENTION_IDLE);
 			return null;
 		}
-		else if (npc.getNpcId() == LIVE_BAIUM && !npc.isInvul())
+		else if ((npc.getNpcId() == LIVE_BAIUM) && !npc.isInvul())
 		{
 			callSkillAI(npc);
 		}
@@ -363,18 +384,20 @@ public class Baium extends L2AttackableAIScript
 			npc.getAI().setIntention(AI_INTENTION_IDLE);
 			return super.onAttack(npc, attacker, damage, isPet);
 		}
-		else if (npc.getNpcId() == LIVE_BAIUM && !npc.isInvul())
+		else if ((npc.getNpcId() == LIVE_BAIUM) && !npc.isInvul())
 		{
 			if (attacker.getMountType() == 1)
 			{
 				int sk_4258 = 0;
 				L2Effect[] effects = attacker.getAllEffects();
-				if (effects != null && effects.length != 0)
+				if ((effects != null) && (effects.length != 0))
 				{
 					for (L2Effect e : effects)
 					{
 						if (e.getSkill().getId() == 4258)
+						{
 							sk_4258 = 1;
+						}
 					}
 				}
 				if (sk_4258 == 0)
@@ -384,12 +407,16 @@ public class Baium extends L2AttackableAIScript
 					if (skill.isMagic())
 					{
 						if (npc.isMuted())
+						{
 							return super.onAttack(npc, attacker, damage, isPet);
+						}
 					}
 					else
 					{
 						if (npc.isPhysicalMuted())
+						{
 							return super.onAttack(npc, attacker, damage, isPet);
+						}
 					}
 					npc.doCast(skill);
 				}
@@ -409,7 +436,7 @@ public class Baium extends L2AttackableAIScript
 		// spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair)
 		addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // //should we teleport everyone out if the cubic despawns??
 		// "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs]
-		long respawnTime = (long) Config.Interval_Of_Baium_Spawn + Rnd.get(Config.Random_Of_Baium_Spawn);
+		long respawnTime = (long) Config.Interval_Of_Baium_Spawn + getRandom(Config.Random_Of_Baium_Spawn);
 		GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, DEAD);
 		startQuestTimer("baium_unlock", respawnTime, null, null);
 		// also save the respawn time so that the info is maintained past reboots
@@ -417,14 +444,18 @@ public class Baium extends L2AttackableAIScript
 		info.set("respawn_time", (System.currentTimeMillis()) + respawnTime);
 		GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM, info);
 		for (L2Npc minion : _Minions)
+		{
 			if (minion != null)
 			{
 				minion.getSpawn().stopRespawn();
 				minion.deleteMe();
 			}
+		}
 		_Minions.clear();
 		if (getQuestTimer("skill_range", npc, null) != null)
+		{
 			getQuestTimer("skill_range", npc, null).cancel();
+		}
 		return super.onKill(npc, killer, isPet);
 	}
 	
@@ -435,29 +466,39 @@ public class Baium extends L2AttackableAIScript
 		{
 			for (L2Object obj : objs)
 			{
-				if (obj instanceof L2Playable || obj instanceof L2DecoyInstance)
+				if ((obj instanceof L2Playable) || (obj instanceof L2DecoyInstance))
 				{
 					if (obj instanceof L2PcInstance)
 					{
 						if (((L2PcInstance) obj).getAppearance().getInvisible())
+						{
 							continue;
+						}
 					}
 					
-					if (((L2Character) obj).getZ() < (npc.getZ() - 100) && ((L2Character) obj).getZ() > (npc.getZ() + 100) || !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ())))
+					if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ())))
+					{
 						continue;
+					}
 				}
-				if (obj instanceof L2Playable || obj instanceof L2DecoyInstance)
+				if ((obj instanceof L2Playable) || (obj instanceof L2DecoyInstance))
 				{
 					if (Util.checkIfInRange(9000, npc, obj, true) && !((L2Character) obj).isDead())
+					{
 						result.add((L2Character) obj);
+					}
 				}
 			}
 		}
 		if (result.isEmpty())
 		{
 			for (L2Npc minion : _Minions)
+			{
 				if (minion != null)
+				{
 					result.add(minion);
+				}
+			}
 		}
 		
 		if (result.isEmpty())
@@ -469,9 +510,11 @@ public class Baium extends L2AttackableAIScript
 		Object[] characters = result.toArray();
 		QuestTimer timer = getQuestTimer("clean_player", npc, null);
 		if (timer != null)
+		{
 			timer.cancel();
+		}
 		startQuestTimer("clean_player", 20000, npc, null);
-		L2Character target = (L2Character) characters[Rnd.get(characters.length)];
+		L2Character target = (L2Character) characters[getRandom(characters.length)];
 		FastList.recycle(result);
 		return target;
 		
@@ -480,32 +523,42 @@ public class Baium extends L2AttackableAIScript
 	public synchronized void callSkillAI(L2Npc npc)
 	{
 		if (npc.isInvul() || npc.isCastingNow())
+		{
 			return;
+		}
 		
-		if (_target == null || _target.isDead() || !(_Zone.isInsideZone(_target)))
+		if ((_target == null) || _target.isDead() || !(_Zone.isInsideZone(_target)))
 		{
 			_target = getRandomTarget(npc);
 			if (_target != null)
+			{
 				_skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1);
+			}
 		}
 		
 		L2Character target = _target;
 		L2Skill skill = _skill;
 		if (skill == null)
+		{
 			skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1);
+		}
 		
 		if (skill.isMagic())
 		{
 			if (npc.isMuted())
+			{
 				return;
+			}
 		}
 		else
 		{
 			if (npc.isPhysicalMuted())
+			{
 				return;
+			}
 		}
 		
-		if (target == null || target.isDead() || !(_Zone.isInsideZone(target)))
+		if ((target == null) || target.isDead() || !(_Zone.isInsideZone(target)))
 		{
 			npc.setIsCastingNow(false);
 			return;
@@ -519,7 +572,9 @@ public class Baium extends L2AttackableAIScript
 			_target = null;
 			_skill = null;
 			if (getDist(skill.getCastRange()) > 0)
+			{
 				npc.broadcastPacket(new MoveToPawn(npc, target, getDist(skill.getCastRange())));
+			}
 			try
 			{
 				Thread.sleep(1000);
@@ -543,47 +598,81 @@ public class Baium extends L2AttackableAIScript
 		int skill;
 		if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0))
 		{
-			if (Rnd.get(100) < 10)
+			if (getRandom(100) < 10)
+			{
 				skill = 4128;
-			else if (Rnd.get(100) < 10)
+			}
+			else if (getRandom(100) < 10)
+			{
 				skill = 4129;
+			}
 			else
+			{
 				skill = 4127;
+			}
 		}
 		else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0))
 		{
-			if (Rnd.get(100) < 10)
+			if (getRandom(100) < 10)
+			{
 				skill = 4131;
-			else if (Rnd.get(100) < 10)
+			}
+			else if (getRandom(100) < 10)
+			{
 				skill = 4128;
-			else if (Rnd.get(100) < 10)
+			}
+			else if (getRandom(100) < 10)
+			{
 				skill = 4129;
+			}
 			else
+			{
 				skill = 4127;
+			}
 		}
 		else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4.0))
 		{
-			if (Rnd.get(100) < 10)
+			if (getRandom(100) < 10)
+			{
 				skill = 4130;
-			else if (Rnd.get(100) < 10)
+			}
+			else if (getRandom(100) < 10)
+			{
 				skill = 4131;
-			else if (Rnd.get(100) < 10)
+			}
+			else if (getRandom(100) < 10)
+			{
 				skill = 4128;
-			else if (Rnd.get(100) < 10)
+			}
+			else if (getRandom(100) < 10)
+			{
 				skill = 4129;
+			}
 			else
+			{
 				skill = 4127;
+			}
 		}
-		else if (Rnd.get(100) < 10)
+		else if (getRandom(100) < 10)
+		{
 			skill = 4130;
-		else if (Rnd.get(100) < 10)
+		}
+		else if (getRandom(100) < 10)
+		{
 			skill = 4131;
-		else if (Rnd.get(100) < 10)
+		}
+		else if (getRandom(100) < 10)
+		{
 			skill = 4128;
-		else if (Rnd.get(100) < 10)
+		}
+		else if (getRandom(100) < 10)
+		{
 			skill = 4129;
+		}
 		else
+		{
 			skill = 4127;
+		}
 		return skill;
 	}
 	

+ 123 - 59
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/IceFairySirra.java

@@ -37,7 +37,6 @@ import com.l2jserver.gameserver.network.NpcStringId;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jserver.util.Rnd;
 
 /**
  * Ice Fairy Sirra AI
@@ -52,19 +51,30 @@ public class IceFairySirra extends L2AttackableAIScript
 	protected FastList<L2Npc> _allMobs = new FastList<L2Npc>();
 	protected Future<?> _onDeadEventTask = null;
 	
-	public IceFairySirra(int id,String name,String descr)
+	public IceFairySirra(int id, String name, String descr)
 	{
-		super(id,name,descr);
-		int[] mob = {22100, 22102, 22104, 29056};
+		super(id, name, descr);
+		int[] mob =
+		{
+			22100,
+			22102,
+			22104,
+			29056
+		};
 		registerMobs(mob);
-		registerMobs(new int[] { STEWARD } , QuestEventType.QUEST_START, QuestEventType.ON_TALK, QuestEventType.ON_FIRST_TALK);
+		registerMobs(new int[]
+		{
+			STEWARD
+		}, QuestEventType.QUEST_START, QuestEventType.ON_TALK, QuestEventType.ON_FIRST_TALK);
 		
 		String test = loadGlobalQuestVar("Sirra_Respawn");
 		if (!test.equalsIgnoreCase(""))
 		{
 			long remain = Long.parseLong(test) - System.currentTimeMillis();
 			if (remain <= 0)
+			{
 				init(false);
+			}
 			else
 			{
 				init(true);
@@ -72,12 +82,14 @@ public class IceFairySirra extends L2AttackableAIScript
 			}
 		}
 		else
+		{
 			init(false);
+		}
 	}
 	
 	public void init(boolean isBusy)
 	{
-		_sirrasZone = GrandBossManager.getInstance().getZone(105546 , -127892 , -2768);
+		_sirrasZone = GrandBossManager.getInstance().getZone(105546, -127892, -2768);
 		if (_sirrasZone == null)
 		{
 			_log.warning("IceFairySirraManager: Failed to load zone");
@@ -86,17 +98,19 @@ public class IceFairySirra extends L2AttackableAIScript
 		_sirrasZone.setZoneEnabled(false);
 		L2Npc steward = findTemplate(STEWARD);
 		if (steward != null)
+		{
 			steward.setBusy(isBusy);
+		}
 		openGates();
 	}
 	
 	public void cleanUp()
 	{
 		init(false);
-		cancelQuestTimer("30MinutesRemaining",null, _player);
-		cancelQuestTimer("20MinutesRemaining",null, _player);
-		cancelQuestTimer("10MinutesRemaining",null, _player);
-		cancelQuestTimer("End",null, _player);
+		cancelQuestTimer("30MinutesRemaining", null, _player);
+		cancelQuestTimer("20MinutesRemaining", null, _player);
+		cancelQuestTimer("10MinutesRemaining", null, _player);
+		cancelQuestTimer("End", null, _player);
 		for (L2Npc mob : _allMobs)
 		{
 			try
@@ -117,7 +131,7 @@ public class IceFairySirra extends L2AttackableAIScript
 		L2Npc npc = null;
 		for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
 		{
-			if (spawn != null && spawn.getNpcid() == npcId)
+			if ((spawn != null) && (spawn.getNpcid() == npcId))
 			{
 				npc = spawn.getLastSpawn();
 				break;
@@ -128,7 +142,7 @@ public class IceFairySirra extends L2AttackableAIScript
 	
 	protected void openGates()
 	{
-		for (int i = 23140001; i < 23140003; i++ )
+		for (int i = 23140001; i < 23140003; i++)
 		{
 			try
 			{
@@ -139,7 +153,7 @@ public class IceFairySirra extends L2AttackableAIScript
 				}
 				else
 				{
-					_log.warning("IceFairySirraManager: Attempted to open undefined door. doorId: "+i);
+					_log.warning("IceFairySirraManager: Attempted to open undefined door. doorId: " + i);
 				}
 			}
 			catch (Exception e)
@@ -151,7 +165,7 @@ public class IceFairySirra extends L2AttackableAIScript
 	
 	protected void closeGates()
 	{
-		for (int i = 23140001; i < 23140003; i++ )
+		for (int i = 23140001; i < 23140003; i++)
 		{
 			try
 			{
@@ -162,7 +176,7 @@ public class IceFairySirra extends L2AttackableAIScript
 				}
 				else
 				{
-					_log.warning("IceFairySirraManager: Attempted to close undefined door. doorId: "+i);
+					_log.warning("IceFairySirraManager: Attempted to close undefined door. doorId: " + i);
 				}
 			}
 			catch (Exception e)
@@ -172,23 +186,27 @@ public class IceFairySirra extends L2AttackableAIScript
 		}
 	}
 	
-	public boolean checkItems (L2PcInstance player)
+	public boolean checkItems(L2PcInstance player)
 	{
 		if (player.getParty() != null)
 		{
 			for (L2PcInstance pc : player.getParty().getPartyMembers())
 			{
 				L2ItemInstance i = pc.getInventory().getItemByItemId(SILVER_HEMOCYTE);
-				if 	(i == null || i.getCount() < 10)
+				if ((i == null) || (i.getCount() < 10))
+				{
 					return false;
+				}
 			}
 		}
 		else
+		{
 			return false;
+		}
 		return true;
 	}
 	
-	public void destroyItems (L2PcInstance player)
+	public void destroyItems(L2PcInstance player)
 	{
 		if (player.getParty() != null)
 		{
@@ -199,27 +217,31 @@ public class IceFairySirra extends L2AttackableAIScript
 			}
 		}
 		else
+		{
 			cleanUp();
+		}
 	}
 	
-	public void teleportInside (L2PcInstance player)
+	public void teleportInside(L2PcInstance player)
 	{
 		if (player.getParty() != null)
 		{
 			for (L2PcInstance pc : player.getParty().getPartyMembers())
 			{
-				pc.teleToLocation(113533,-126159,-3488,false);
+				pc.teleToLocation(113533, -126159, -3488, false);
 				if (_sirrasZone == null)
 				{
 					_log.warning("IceFairySirraManager: Failed to load zone");
 					cleanUp();
 					return;
 				}
-				_sirrasZone.allowPlayerEntry(pc,2103);
+				_sirrasZone.allowPlayerEntry(pc, 2103);
 			}
 		}
 		else
+		{
 			cleanUp();
+		}
 	}
 	
 	public void screenMessage(L2PcInstance player, NpcStringId npcString, int time)
@@ -232,21 +254,51 @@ public class IceFairySirra extends L2AttackableAIScript
 			}
 		}
 		else
+		{
 			cleanUp();
+		}
 	}
 	
 	public void doSpawns()
 	{
-		int[][] mobs = { {29060 , 105546 , -127892 , -2768} ,
-				{29056 , 102779 , -125920 , -2840},
-				{22100 , 111719 , -126646 , -2992},
-				{22102 , 109509 , -128946 , -3216},
-				{22104 , 109680 , -125756 , -3136}};
+		int[][] mobs =
+		{
+			{
+				29060,
+				105546,
+				-127892,
+				-2768
+			},
+			{
+				29056,
+				102779,
+				-125920,
+				-2840
+			},
+			{
+				22100,
+				111719,
+				-126646,
+				-2992
+			},
+			{
+				22102,
+				109509,
+				-128946,
+				-3216
+			},
+			{
+				22104,
+				109680,
+				-125756,
+				-3136
+			}
+		};
 		L2Spawn spawnDat;
 		L2NpcTemplate template;
 		try
 		{
-			for (int i = 0; i <5; i++)
+			for (int i = 0; i < 5; i++)
 			{
 				template = NpcTable.getInstance().getTemplate(mobs[i][0]);
 				if (template != null)
@@ -264,13 +316,13 @@ public class IceFairySirra extends L2AttackableAIScript
 				}
 				else
 				{
-					_log.warning("IceFairySirraManager: Data missing in NPC table for ID: "+mobs[i][0]);
+					_log.warning("IceFairySirraManager: Data missing in NPC table for ID: " + mobs[i][0]);
 				}
 			}
 		}
 		catch (Exception e)
 		{
-			_log.warning("IceFairySirraManager: Spawns could not be initialized: "+ e);
+			_log.warning("IceFairySirraManager: Spawns could not be initialized: " + e);
 		}
 	}
 	
@@ -280,7 +332,9 @@ public class IceFairySirra extends L2AttackableAIScript
 		
 		pom = "32029-" + val;
 		if (val == 0)
+		{
 			pom = "32029";
+		}
 		
 		String temp = "data/html/default/" + pom + ".htm";
 		
@@ -288,10 +342,14 @@ public class IceFairySirra extends L2AttackableAIScript
 		{
 			// If not running lazy cache the file must be in the cache or it doesnt exist
 			if (HtmCache.getInstance().contains(temp))
+			{
 				return temp;
+			}
 		}
 		else if (HtmCache.getInstance().isLoadable(temp))
+		{
 			return temp;
+		}
 		
 		// If the file is not found, the standard message "I have nothing to say to you" is returned
 		return "data/html/npcdefault.htm";
@@ -303,45 +361,51 @@ public class IceFairySirra extends L2AttackableAIScript
 		html.setFile(player.getHtmlPrefix(), filename);
 		html.replace("%objectId%", String.valueOf(npc.getObjectId()));
 		player.sendPacket(html);
-		player.sendPacket( ActionFailed.STATIC_PACKET );
+		player.sendPacket(ActionFailed.STATIC_PACKET);
 	}
 	
 	@Override
-	public String onFirstTalk (L2Npc npc, L2PcInstance player)
+	public String onFirstTalk(L2Npc npc, L2PcInstance player)
 	{
 		if (player.getQuestState("IceFairySirra") == null)
+		{
 			newQuestState(player);
+		}
 		player.setLastQuestNpcObject(npc.getObjectId());
 		String filename = "";
 		if (npc.isBusy())
+		{
 			filename = getHtmlPath(10);
+		}
 		else
+		{
 			filename = getHtmlPath(0);
+		}
 		sendHtml(npc, player, filename);
 		return null;
 	}
 	
 	@Override
-	public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
 	{
 		if (event.equalsIgnoreCase("check_condition"))
 		{
-			if (npc.isBusy())//should never happen
+			if (npc.isBusy())// should never happen
 			{
 				return super.onAdvEvent(event, npc, player);
 			}
 			
 			String filename = "";
-			if (player.isInParty() && player.getParty().getPartyLeaderOID() == player.getObjectId())
+			if (player.isInParty() && (player.getParty().getPartyLeaderOID() == player.getObjectId()))
 			{
 				if (checkItems(player))
 				{
-					startQuestTimer("start",100000,null,player);
+					startQuestTimer("start", 100000, null, player);
 					_player = player;
 					destroyItems(player);
-					player.getInventory().addItem("Scroll",8379,3,player,null);
+					player.getInventory().addItem("Scroll", 8379, 3, player, null);
 					npc.setBusy(true);
-					screenMessage(player,NpcStringId.STEWARD_PLEASE_WAIT_A_MOMENT,100000);
+					screenMessage(player, NpcStringId.STEWARD_PLEASE_WAIT_A_MOMENT, 100000);
 					filename = getHtmlPath(3);
 				}
 				else
@@ -366,32 +430,32 @@ public class IceFairySirra extends L2AttackableAIScript
 			_sirrasZone.setZoneEnabled(true);
 			closeGates();
 			doSpawns();
-			startQuestTimer("Party_Port",2000,null,player);
-			startQuestTimer("End",1802000,null,player);
+			startQuestTimer("Party_Port", 2000, null, player);
+			startQuestTimer("End", 1802000, null, player);
 		}
 		else if (event.equalsIgnoreCase("Party_Port"))
 		{
 			teleportInside(player);
-			screenMessage(player,NpcStringId.STEWARD_PLEASE_RESTORE_THE_QUEENS_FORMER_APPEARANCE,10000);
-			startQuestTimer("30MinutesRemaining",300000,null,player);
+			screenMessage(player, NpcStringId.STEWARD_PLEASE_RESTORE_THE_QUEENS_FORMER_APPEARANCE, 10000);
+			startQuestTimer("30MinutesRemaining", 300000, null, player);
 		}
 		else if (event.equalsIgnoreCase("30MinutesRemaining"))
 		{
-			screenMessage(player,NpcStringId.N30_MINUTES_REMAIN,10000);
-			startQuestTimer("20minutesremaining",600000,null,player);
+			screenMessage(player, NpcStringId.N30_MINUTES_REMAIN, 10000);
+			startQuestTimer("20minutesremaining", 600000, null, player);
 		}
 		else if (event.equalsIgnoreCase("20MinutesRemaining"))
 		{
-			screenMessage(player,NpcStringId.N20_MINUTES_REMAIN,10000);
-			startQuestTimer("10minutesremaining",600000,null,player);
+			screenMessage(player, NpcStringId.N20_MINUTES_REMAIN, 10000);
+			startQuestTimer("10minutesremaining", 600000, null, player);
 		}
 		else if (event.equalsIgnoreCase("10MinutesRemaining"))
 		{
-			screenMessage(player,NpcStringId.STEWARD_WASTE_NO_TIME_PLEASE_HURRY,10000);
+			screenMessage(player, NpcStringId.STEWARD_WASTE_NO_TIME_PLEASE_HURRY, 10000);
 		}
 		else if (event.equalsIgnoreCase("End"))
 		{
-			screenMessage(player,NpcStringId.STEWARD_WAS_IT_INDEED_TOO_MUCH_TO_ASK,10000);
+			screenMessage(player, NpcStringId.STEWARD_WAS_IT_INDEED_TOO_MUCH_TO_ASK, 10000);
 			cleanUp();
 		}
 		else if (event.equalsIgnoreCase("respawn"))
@@ -402,14 +466,14 @@ public class IceFairySirra extends L2AttackableAIScript
 	}
 	
 	@Override
-	public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
 	{
 		if (npc.getNpcId() == 29056)
 		{
-			cancelQuestTimer("30MinutesRemaining",null, _player);
-			cancelQuestTimer("20MinutesRemaining",null, _player);
-			cancelQuestTimer("10MinutesRemaining",null, _player);
-			cancelQuestTimer("End",null, _player);
+			cancelQuestTimer("30MinutesRemaining", null, _player);
+			cancelQuestTimer("20MinutesRemaining", null, _player);
+			cancelQuestTimer("10MinutesRemaining", null, _player);
+			cancelQuestTimer("End", null, _player);
 			for (L2Npc mob : _allMobs)
 			{
 				try
@@ -424,18 +488,18 @@ public class IceFairySirra extends L2AttackableAIScript
 			}
 			_allMobs.clear();
 			init(true);
-			int respawnMinDelay = 43200000  * (int)(Config.RAID_MIN_RESPAWN_MULTIPLIER);
-			int respawnMaxDelay = 129600000 * (int)(Config.RAID_MAX_RESPAWN_MULTIPLIER);
-			int respawn_delay = Rnd.get(respawnMinDelay,respawnMaxDelay);
-			saveGlobalQuestVar("Sirra_Respawn", String.valueOf(System.currentTimeMillis()+respawn_delay));
+			int respawnMinDelay = 43200000 * (int) (Config.RAID_MIN_RESPAWN_MULTIPLIER);
+			int respawnMaxDelay = 129600000 * (int) (Config.RAID_MAX_RESPAWN_MULTIPLIER);
+			int respawn_delay = getRandom(respawnMinDelay, respawnMaxDelay);
+			saveGlobalQuestVar("Sirra_Respawn", String.valueOf(System.currentTimeMillis() + respawn_delay));
 			startQuestTimer("respawn", respawn_delay, null, null);
-			screenMessage(killer,NpcStringId.STEWARD_PLEASE_RESTORE_THE_QUEENS_FORMER_APPEARANCE,10000);
+			screenMessage(killer, NpcStringId.STEWARD_PLEASE_RESTORE_THE_QUEENS_FORMER_APPEARANCE, 10000);
 		}
-		return super.onKill(npc,killer,isPet);
+		return super.onKill(npc, killer, isPet);
 	}
 	
 	public static void main(String[] args)
 	{
-		new IceFairySirra(-1,"IceFairySirra","ai");
+		new IceFairySirra(-1, "IceFairySirra", "ai");
 	}
 }

+ 54 - 22
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/QueenAnt.java

@@ -52,7 +52,11 @@ public class QueenAnt extends L2AttackableAIScript
 	
 	private static final int[] MOBS =
 	{
-		QUEEN, LARVA, NURSE, GUARD, ROYAL
+		QUEEN,
+		LARVA,
+		NURSE,
+		GUARD,
+		ROYAL
 	};
 	
 	private static final int QUEEN_X = -21610;
@@ -90,7 +94,9 @@ public class QueenAnt extends L2AttackableAIScript
 			// if queen ant is locked until a certain time, mark it so and start the unlock timer
 			// the unlock time has not yet expired.
 			if (temp > 0)
+			{
 				startQuestTimer("queen_unlock", temp, null, null);
+			}
 			else
 			{
 				// the time has already expired while the server was offline. Immediately spawn queen ant.
@@ -122,18 +128,24 @@ public class QueenAnt extends L2AttackableAIScript
 	private void spawnBoss(L2GrandBossInstance npc)
 	{
 		GrandBossManager.getInstance().addBoss(npc);
-		if (Rnd.get(100) < 33)
+		if (getRandom(100) < 33)
+		{
 			_zone.movePlayersTo(-19480, 187344, -5600);
-		else if (Rnd.get(100) < 50)
+		}
+		else if (getRandom(100) < 50)
+		{
 			_zone.movePlayersTo(-17928, 180912, -5520);
+		}
 		else
+		{
 			_zone.movePlayersTo(-23808, 182368, -5600);
+		}
 		GrandBossManager.getInstance().addBoss(npc);
 		startQuestTimer("action", 10000, npc, null, true);
 		startQuestTimer("heal", 1000, null, null, true);
 		npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
 		_queen = npc;
-		_larva = (L2MonsterInstance) addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0);
+		_larva = (L2MonsterInstance) addSpawn(LARVA, -21600, 179482, -5846, getRandom(360), false, 0);
 	}
 	
 	@Override
@@ -142,17 +154,19 @@ public class QueenAnt extends L2AttackableAIScript
 		if (event.equalsIgnoreCase("heal"))
 		{
 			boolean notCasting;
-			final boolean larvaNeedHeal = _larva != null && _larva.getCurrentHp() < _larva.getMaxHp();
-			final boolean queenNeedHeal = _queen != null && _queen.getCurrentHp() < _queen.getMaxHp();
+			final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp());
+			final boolean queenNeedHeal = (_queen != null) && (_queen.getCurrentHp() < _queen.getMaxHp());
 			for (L2MonsterInstance nurse : _nurses)
 			{
-				if (nurse == null || nurse.isDead() || nurse.isCastingNow())
+				if ((nurse == null) || nurse.isDead() || nurse.isCastingNow())
+				{
 					continue;
+				}
 				
 				notCasting = nurse.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST;
 				if (larvaNeedHeal)
 				{
-					if (nurse.getTarget() != _larva || notCasting)
+					if ((nurse.getTarget() != _larva) || notCasting)
 					{
 						nurse.setTarget(_larva);
 						nurse.useMagic(Rnd.nextBoolean() ? HEAL1.getSkill() : HEAL2.getSkill());
@@ -161,10 +175,12 @@ public class QueenAnt extends L2AttackableAIScript
 				}
 				if (queenNeedHeal)
 				{
-					if (nurse.getLeader() == _larva) // skip larva's minions
+					if (nurse.getLeader() == _larva)
+					{
 						continue;
+					}
 					
-					if (nurse.getTarget() != _queen || notCasting)
+					if ((nurse.getTarget() != _queen) || notCasting)
 					{
 						nurse.setTarget(_queen);
 						nurse.useMagic(HEAL1.getSkill());
@@ -172,15 +188,17 @@ public class QueenAnt extends L2AttackableAIScript
 					continue;
 				}
 				// if nurse not casting - remove target
-				if (notCasting && nurse.getTarget() != null)
+				if (notCasting && (nurse.getTarget() != null))
+				{
 					nurse.setTarget(null);
+				}
 			}
 		}
-		else if (event.equalsIgnoreCase("action") && npc != null)
+		else if (event.equalsIgnoreCase("action") && (npc != null))
 		{
-			if (Rnd.get(3) == 0)
+			if (getRandom(3) == 0)
 			{
-				if (Rnd.get(2) == 0)
+				if (getRandom(2) == 0)
 				{
 					npc.broadcastSocialAction(3);
 				}
@@ -227,10 +245,12 @@ public class QueenAnt extends L2AttackableAIScript
 	@Override
 	public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
 	{
-		if (caller == null || npc == null)
+		if ((caller == null) || (npc == null))
+		{
 			return super.onFactionCall(npc, caller, attacker, isPet);
+		}
 		
-		if (!npc.isCastingNow() && npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
+		if (!npc.isCastingNow() && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST))
 		{
 			if (caller.getCurrentHp() < caller.getMaxHp())
 			{
@@ -245,7 +265,9 @@ public class QueenAnt extends L2AttackableAIScript
 	public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
 	{
 		if (npc == null)
+		{
 			return null;
+		}
 		
 		final boolean isMage;
 		final L2Playable character;
@@ -261,20 +283,26 @@ public class QueenAnt extends L2AttackableAIScript
 		}
 		
 		if (character == null)
+		{
 			return null;
+		}
 		
-		if (!Config.RAID_DISABLE_CURSE && character.getLevel() - npc.getLevel() > 8)
+		if (!Config.RAID_DISABLE_CURSE && ((character.getLevel() - npc.getLevel()) > 8))
 		{
 			L2Skill curse = null;
 			if (isMage)
 			{
-				if (!character.isMuted() && Rnd.get(4) == 0)
+				if (!character.isMuted() && (getRandom(4) == 0))
+				{
 					curse = SkillTable.FrequentSkill.RAID_CURSE.getSkill();
+				}
 			}
 			else
 			{
-				if (!character.isParalyzed() && Rnd.get(4) == 0)
+				if (!character.isParalyzed() && (getRandom(4) == 0))
+				{
 					curse = SkillTable.FrequentSkill.RAID_CURSE2.getSkill();
+				}
 			}
 			
 			if (curse != null)
@@ -299,7 +327,7 @@ public class QueenAnt extends L2AttackableAIScript
 			npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
 			GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);
 			// time is 36hour +/- 17hour
-			long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + Rnd.get(Config.Random_Of_QueenAnt_Spawn);
+			long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + getRandom(Config.Random_Of_QueenAnt_Spawn);
 			startQuestTimer("queen_unlock", respawnTime, null, null);
 			cancelQuestTimer("action", npc, null);
 			cancelQuestTimer("heal", null, null);
@@ -312,20 +340,24 @@ public class QueenAnt extends L2AttackableAIScript
 			_larva = null;
 			_queen = null;
 		}
-		else if (_queen != null && !_queen.isAlikeDead())
+		else if ((_queen != null) && !_queen.isAlikeDead())
 		{
 			if (npcId == ROYAL)
 			{
 				L2MonsterInstance mob = (L2MonsterInstance) npc;
 				if (mob.getLeader() != null)
-					mob.getLeader().getMinionList().onMinionDie(mob, (280 + Rnd.get(40)) * 1000);
+				{
+					mob.getLeader().getMinionList().onMinionDie(mob, (280 + getRandom(40)) * 1000);
+				}
 			}
 			else if (npcId == NURSE)
 			{
 				L2MonsterInstance mob = (L2MonsterInstance) npc;
 				_nurses.remove(mob);
 				if (mob.getLeader() != null)
+				{
 					mob.getLeader().getMinionList().onMinionDie(mob, 10000);
+				}
 			}
 		}
 		return super.onKill(npc, killer, isPet);

File diff suppressed because it is too large
+ 168 - 119
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Valakas.java


+ 262 - 153
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Zaken.java

@@ -36,7 +36,6 @@ import com.l2jserver.gameserver.model.effects.L2Effect;
 import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.model.zone.type.L2BossZone;
 import com.l2jserver.gameserver.network.serverpackets.PlaySound;
-import com.l2jserver.util.Rnd;
 
 /**
  * Zaken AI
@@ -66,15 +65,57 @@ public class Zaken extends L2AttackableAIScript
 	private static final int pirates_zombie_b = 29027;
 	private static final int[] Xcoords =
 	{
-		53950, 55980, 54950, 55970, 53930, 55970, 55980, 54960, 53950, 53930, 55970, 55980, 54960, 53950, 53930
+		53950,
+		55980,
+		54950,
+		55970,
+		53930,
+		55970,
+		55980,
+		54960,
+		53950,
+		53930,
+		55970,
+		55980,
+		54960,
+		53950,
+		53930
 	};
 	private static final int[] Ycoords =
 	{
-		219860, 219820, 218790, 217770, 217760, 217770, 219920, 218790, 219860, 217760, 217770, 219920, 218790, 219860, 217760
+		219860,
+		219820,
+		218790,
+		217770,
+		217760,
+		217770,
+		219920,
+		218790,
+		219860,
+		217760,
+		217770,
+		219920,
+		218790,
+		219860,
+		217760
 	};
 	private static final int[] Zcoords =
 	{
-		-3488, -3488, -3488, -3488, -3488, -3216, -3216, -3216, -3216, -3216, -2944, -2944, -2944, -2944, -2944
+		-3488,
+		-3488,
+		-3488,
+		-3488,
+		-3488,
+		-3216,
+		-3216,
+		-3216,
+		-3216,
+		-3216,
+		-2944,
+		-2944,
+		-2944,
+		-2944,
+		-2944
 	};
 	
 	// ZAKEN Status Tracking :
@@ -124,7 +165,11 @@ public class Zaken extends L2AttackableAIScript
 		
 		int[] mobs =
 		{
-			ZAKEN, doll_blader_b, vale_master_b, pirates_zombie_captain_b, pirates_zombie_b
+			ZAKEN,
+			doll_blader_b,
+			vale_master_b,
+			pirates_zombie_captain_b,
+			pirates_zombie_b
 		};
 		registerMobs(mobs);
 		_Zone = GrandBossManager.getInstance().getZone(55312, 219168, -3223);
@@ -138,7 +183,9 @@ public class Zaken extends L2AttackableAIScript
 			// if zaken is locked until a certain time, mark it so and start the unlock timer
 			// the unlock time has not yet expired.
 			if (temp > 0)
+			{
 				startQuestTimer("zaken_unlock", temp, null, null);
+			}
 			else
 			{
 				// the time has already expired while the server was offline. Immediately spawn zaken.
@@ -196,8 +243,10 @@ public class Zaken extends L2AttackableAIScript
 	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
 	{
 		int status = GrandBossManager.getInstance().getBossStatus(ZAKEN);
-		if (status == DEAD && !event.equalsIgnoreCase("zaken_unlock"))
+		if ((status == DEAD) && !event.equalsIgnoreCase("zaken_unlock"))
+		{
 			return super.onAdvEvent(event, npc, player);
+		}
 		
 		if (event.equalsIgnoreCase("1001"))
 		{
@@ -209,7 +258,7 @@ public class Zaken extends L2AttackableAIScript
 			int sk_4223 = 0;
 			int sk_4227 = 0;
 			L2Effect[] effects = npc.getAllEffects();
-			if (effects != null && effects.length != 0)
+			if ((effects != null) && (effects.length != 0))
 			{
 				for (L2Effect e : effects)
 				{
@@ -238,93 +287,139 @@ public class Zaken extends L2AttackableAIScript
 					npc.setTarget(npc);
 					npc.doCast(SkillTable.getInstance().getInfo(4227, 1));
 				}
-				if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _ai0 == 0)
+				if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK) && (_ai0 == 0))
 				{
 					int i0 = 0;
 					int i1 = 1;
 					if (((L2Attackable) npc).getMostHated() != null)
 					{
 						if ((((((L2Attackable) npc).getMostHated().getX() - _ai1) * (((L2Attackable) npc).getMostHated().getX() - _ai1)) + ((((L2Attackable) npc).getMostHated().getY() - _ai2) * (((L2Attackable) npc).getMostHated().getY() - _ai2))) > (1500 * 1500))
+						{
 							i0 = 1;
+						}
 						else
+						{
 							i0 = 0;
+						}
 						if (i0 == 0)
+						{
 							i1 = 0;
+						}
 						if (_quest0 > 0)
 						{
 							if (c_quest0 == null)
+							{
 								i0 = 0;
+							}
 							else if ((((c_quest0.getX() - _ai1) * (c_quest0.getX() - _ai1)) + ((c_quest0.getY() - _ai2) * (c_quest0.getY() - _ai2))) > (1500 * 1500))
+							{
 								i0 = 1;
+							}
 							else
+							{
 								i0 = 0;
+							}
 							if (i0 == 0)
+							{
 								i1 = 0;
+							}
 						}
 						if (_quest0 > 1)
 						{
 							if (c_quest1 == null)
+							{
 								i0 = 0;
+							}
 							else if ((((c_quest1.getX() - _ai1) * (c_quest1.getX() - _ai1)) + ((c_quest1.getY() - _ai2) * (c_quest1.getY() - _ai2))) > (1500 * 1500))
+							{
 								i0 = 1;
+							}
 							else
+							{
 								i0 = 0;
+							}
 							if (i0 == 0)
+							{
 								i1 = 0;
+							}
 						}
 						if (_quest0 > 2)
 						{
 							if (c_quest2 == null)
+							{
 								i0 = 0;
+							}
 							else if ((((c_quest2.getX() - _ai1) * (c_quest2.getX() - _ai1)) + ((c_quest2.getY() - _ai2) * (c_quest2.getY() - _ai2))) > (1500 * 1500))
+							{
 								i0 = 1;
+							}
 							else
+							{
 								i0 = 0;
+							}
 							if (i0 == 0)
+							{
 								i1 = 0;
+							}
 						}
 						if (_quest0 > 3)
 						{
 							if (c_quest3 == null)
+							{
 								i0 = 0;
+							}
 							else if ((((c_quest3.getX() - _ai1) * (c_quest3.getX() - _ai1)) + ((c_quest3.getY() - _ai2) * (c_quest3.getY() - _ai2))) > (1500 * 1500))
+							{
 								i0 = 1;
+							}
 							else
+							{
 								i0 = 0;
+							}
 							if (i0 == 0)
+							{
 								i1 = 0;
+							}
 						}
 						if (_quest0 > 4)
 						{
 							if (c_quest4 == null)
+							{
 								i0 = 0;
+							}
 							else if ((((c_quest4.getX() - _ai1) * (c_quest4.getX() - _ai1)) + ((c_quest4.getY() - _ai2) * (c_quest4.getY() - _ai2))) > (1500 * 1500))
+							{
 								i0 = 1;
+							}
 							else
+							{
 								i0 = 0;
+							}
 							if (i0 == 0)
+							{
 								i1 = 0;
+							}
 						}
 						if (i1 == 1)
 						{
 							_quest0 = 0;
-							int i2 = Rnd.get(15);
-							_ai1 = Xcoords[i2] + Rnd.get(650);
-							_ai2 = Ycoords[i2] + Rnd.get(650);
+							int i2 = getRandom(15);
+							_ai1 = Xcoords[i2] + getRandom(650);
+							_ai2 = Ycoords[i2] + getRandom(650);
 							_ai3 = Zcoords[i2];
 							npc.setTarget(npc);
 							npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
 						}
 					}
 				}
-				if (Rnd.get(20) < 1 && _ai0 == 0)
+				if ((getRandom(20) < 1) && (_ai0 == 0))
 				{
 					_ai1 = npc.getX();
 					_ai2 = npc.getY();
 					_ai3 = npc.getZ();
 				}
 				L2Character c_ai0 = null;
-				if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 == 0)
+				if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK) && (_quest1 == 0))
 				{
 					if (((L2Attackable) npc).getMostHated() != null)
 					{
@@ -332,7 +427,7 @@ public class Zaken extends L2AttackableAIScript
 						_quest1 = 1;
 					}
 				}
-				else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 != 0)
+				else if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK) && (_quest1 != 0))
 				{
 					if (((L2Attackable) npc).getMostHated() != null)
 					{
@@ -356,7 +451,9 @@ public class Zaken extends L2AttackableAIScript
 					((L2Attackable) npc).stopHating(c_ai0);
 					L2Character nextTarget = ((L2Attackable) npc).getMostHated();
 					if (nextTarget != null)
+					{
 						npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
+					}
 					_quest1 = 0;
 				}
 			}
@@ -371,11 +468,11 @@ public class Zaken extends L2AttackableAIScript
 				npc.setTarget(npc);
 				npc.doCast(SkillTable.getInstance().getInfo(4242, 1));
 			}
-			if (Rnd.get(40) < 1)
+			if (getRandom(40) < 1)
 			{
-				int i2 = Rnd.get(15);
-				_ai1 = Xcoords[i2] + Rnd.get(650);
-				_ai2 = Ycoords[i2] + Rnd.get(650);
+				int i2 = getRandom(15);
+				_ai1 = Xcoords[i2] + getRandom(650);
+				_ai2 = Ycoords[i2] + getRandom(650);
 				_ai3 = Zcoords[i2];
 				npc.setTarget(npc);
 				npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
@@ -392,126 +489,126 @@ public class Zaken extends L2AttackableAIScript
 		{
 			if (_ai4 == 1)
 			{
-				int rr = Rnd.get(15);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				int rr = getRandom(15);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, Xcoords[rr] + getRandom(650), Ycoords[rr] + getRandom(650), Zcoords[rr], getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 2;
 			}
 			else if (_ai4 == 2)
 			{
-				int rr = Rnd.get(15);
-				((L2Attackable) addSpawn(doll_blader_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				int rr = getRandom(15);
+				((L2Attackable) addSpawn(doll_blader_b, Xcoords[rr] + getRandom(650), Ycoords[rr] + getRandom(650), Zcoords[rr], getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 3;
 			}
 			else if (_ai4 == 3)
 			{
-				((L2Attackable) addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 4;
 			}
 			else if (_ai4 == 4)
 			{
-				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 5;
 			}
 			else if (_ai4 == 5)
 			{
-				((L2Attackable) addSpawn(doll_blader_b, 52675, 219371, -3290, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 52687, 219596, -3368, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 52672, 219740, -3418, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 52857, 219992, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 52959, 219997, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 53381, 220151, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 57113, 218079, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56186, 217153, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 52675, 219371, -3290, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 52687, 219596, -3368, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 52672, 219740, -3418, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 52857, 219992, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 52959, 219997, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 53381, 220151, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 57113, 218079, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56186, 217153, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 6;
 			}
 			else if (_ai4 == 6)
 			{
-				((L2Attackable) addSpawn(pirates_zombie_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54413, 217132, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 54841, 217132, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 55372, 217128, -3343, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 55893, 217122, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56282, 217237, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 56963, 218080, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54464, 219095, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 53412, 218077, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54413, 217132, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 54841, 217132, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 55372, 217128, -3343, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 55893, 217122, -3488, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56282, 217237, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 56963, 218080, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54464, 219095, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 7;
 			}
 			else if (_ai4 == 7)
 			{
-				((L2Attackable) addSpawn(pirates_zombie_b, 54228, 217504, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54181, 217168, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 54714, 217123, -3168, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 55298, 217127, -3073, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 55787, 217130, -2993, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56284, 217216, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 56963, 218080, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54464, 219095, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54280, 217200, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
-				((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54228, 217504, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54181, 217168, -3216, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 54714, 217123, -3168, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 55298, 217127, -3073, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 55787, 217130, -2993, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56284, 217216, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 56963, 218080, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54464, 219095, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 54280, 217200, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
+				((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -2944, getRandom(65536), false, 0)).setIsRaidMinion(true);
 				_ai4 = 8;
 				cancelQuestTimer("1003", null, null);
 			}
@@ -533,15 +630,17 @@ public class Zaken extends L2AttackableAIScript
 	@Override
 	public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
 	{
-		if (caller == null || npc == null)
+		if ((caller == null) || (npc == null))
+		{
 			return super.onFactionCall(npc, caller, attacker, isPet);
+		}
 		int npcId = npc.getNpcId();
 		int callerId = caller.getNpcId();
 		
-		if (getTimeHour() < 5 && callerId != ZAKEN && npcId == ZAKEN)
+		if ((getTimeHour() < 5) && (callerId != ZAKEN) && (npcId == ZAKEN))
 		{
 			int damage = 0; // well damage required :x
-			if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE && _ai0 == 0 && damage < 10 && Rnd.get((30 * 15)) < 1)// todo - damage missing
+			if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE) && (_ai0 == 0) && (damage < 10) && (getRandom((30 * 15)) < 1))// todo - damage missing
 			{
 				_ai0 = 1;
 				_ai1 = caller.getX();
@@ -566,22 +665,24 @@ public class Zaken extends L2AttackableAIScript
 			}
 			else if (skillId == 4216)
 			{
-				int i1 = Rnd.get(15);
-				player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+				int i1 = getRandom(15);
+				player.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 				((L2Attackable) npc).stopHating(player);
 				L2Character nextTarget = ((L2Attackable) npc).getMostHated();
 				if (nextTarget != null)
+				{
 					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
+				}
 				
 			}
 			else if (skillId == 4217)
 			{
 				int i0 = 0;
-				int i1 = Rnd.get(15);
-				player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+				int i1 = getRandom(15);
+				player.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 				((L2Attackable) npc).stopHating(player);
 				
-				if (c_quest0 != null && _quest0 > 0 && c_quest0 != player && c_quest0.getZ() > (player.getZ() - 100) && c_quest0.getZ() < (player.getZ() + 100))
+				if ((c_quest0 != null) && (_quest0 > 0) && (c_quest0 != player) && (c_quest0.getZ() > (player.getZ() - 100)) && (c_quest0.getZ() < (player.getZ() + 100)))
 				{
 					if ((((c_quest0.getX() - player.getX()) * (c_quest0.getX() - player.getX())) + ((c_quest0.getY() - player.getY()) * (c_quest0.getY() - player.getY()))) > (250 * 250))
 					{
@@ -593,12 +694,12 @@ public class Zaken extends L2AttackableAIScript
 					}
 					if (i0 == 0)
 					{
-						i1 = Rnd.get(15);
-						c_quest0.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+						i1 = getRandom(15);
+						c_quest0.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 						((L2Attackable) npc).stopHating(c_quest0);
 					}
 				}
-				if (c_quest1 != null && _quest0 > 1 && c_quest1 != player && c_quest1.getZ() > (player.getZ() - 100) && c_quest1.getZ() < (player.getZ() + 100))
+				if ((c_quest1 != null) && (_quest0 > 1) && (c_quest1 != player) && (c_quest1.getZ() > (player.getZ() - 100)) && (c_quest1.getZ() < (player.getZ() + 100)))
 				{
 					if ((((c_quest1.getX() - player.getX()) * (c_quest1.getX() - player.getX())) + ((c_quest1.getY() - player.getY()) * (c_quest1.getY() - player.getY()))) > (250 * 250))
 					{
@@ -610,12 +711,12 @@ public class Zaken extends L2AttackableAIScript
 					}
 					if (i0 == 0)
 					{
-						i1 = Rnd.get(15);
-						c_quest1.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+						i1 = getRandom(15);
+						c_quest1.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 						((L2Attackable) npc).stopHating(c_quest1);
 					}
 				}
-				if (c_quest2 != null && _quest0 > 2 && c_quest2 != player && c_quest2.getZ() > (player.getZ() - 100) && c_quest2.getZ() < (player.getZ() + 100))
+				if ((c_quest2 != null) && (_quest0 > 2) && (c_quest2 != player) && (c_quest2.getZ() > (player.getZ() - 100)) && (c_quest2.getZ() < (player.getZ() + 100)))
 				{
 					if ((((c_quest2.getX() - player.getX()) * (c_quest2.getX() - player.getX())) + ((c_quest2.getY() - player.getY()) * (c_quest2.getY() - player.getY()))) > (250 * 250))
 					{
@@ -627,12 +728,12 @@ public class Zaken extends L2AttackableAIScript
 					}
 					if (i0 == 0)
 					{
-						i1 = Rnd.get(15);
-						c_quest2.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+						i1 = getRandom(15);
+						c_quest2.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 						((L2Attackable) npc).stopHating(c_quest2);
 					}
 				}
-				if (c_quest3 != null && _quest0 > 3 && c_quest3 != player && c_quest3.getZ() > (player.getZ() - 100) && c_quest3.getZ() < (player.getZ() + 100))
+				if ((c_quest3 != null) && (_quest0 > 3) && (c_quest3 != player) && (c_quest3.getZ() > (player.getZ() - 100)) && (c_quest3.getZ() < (player.getZ() + 100)))
 				{
 					if ((((c_quest3.getX() - player.getX()) * (c_quest3.getX() - player.getX())) + ((c_quest3.getY() - player.getY()) * (c_quest3.getY() - player.getY()))) > (250 * 250))
 					{
@@ -644,12 +745,12 @@ public class Zaken extends L2AttackableAIScript
 					}
 					if (i0 == 0)
 					{
-						i1 = Rnd.get(15);
-						c_quest3.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+						i1 = getRandom(15);
+						c_quest3.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 						((L2Attackable) npc).stopHating(c_quest3);
 					}
 				}
-				if (c_quest4 != null && _quest0 > 4 && c_quest4 != player && c_quest4.getZ() > (player.getZ() - 100) && c_quest4.getZ() < (player.getZ() + 100))
+				if ((c_quest4 != null) && (_quest0 > 4) && (c_quest4 != player) && (c_quest4.getZ() > (player.getZ() - 100)) && (c_quest4.getZ() < (player.getZ() + 100)))
 				{
 					if ((((c_quest4.getX() - player.getX()) * (c_quest4.getX() - player.getX())) + ((c_quest4.getY() - player.getY()) * (c_quest4.getY() - player.getY()))) > (250 * 250))
 					{
@@ -661,14 +762,16 @@ public class Zaken extends L2AttackableAIScript
 					}
 					if (i0 == 0)
 					{
-						i1 = Rnd.get(15);
-						c_quest4.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
+						i1 = getRandom(15);
+						c_quest4.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1]);
 						((L2Attackable) npc).stopHating(c_quest4);
 					}
 				}
 				L2Character nextTarget = ((L2Attackable) npc).getMostHated();
 				if (nextTarget != null)
+				{
 					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
+				}
 			}
 		}
 		return super.onSpellFinished(npc, player, skill);
@@ -684,7 +787,7 @@ public class Zaken extends L2AttackableAIScript
 			{
 				int sk_4258 = 0;
 				L2Effect[] effects = attacker.getAllEffects();
-				if (effects != null && effects.length != 0)
+				if ((effects != null) && (effects.length != 0))
 				{
 					for (L2Effect e : effects)
 					{
@@ -703,9 +806,9 @@ public class Zaken extends L2AttackableAIScript
 			L2Character originalAttacker = isPet ? attacker.getPet() : attacker;
 			int hate = (int) (((damage / npc.getMaxHp()) / 0.05) * 20000);
 			((L2Attackable) npc).addDamageHate(originalAttacker, 0, hate);
-			if (Rnd.get(10) < 1)
+			if (getRandom(10) < 1)
 			{
-				int i0 = Rnd.get((15 * 15));
+				int i0 = getRandom((15 * 15));
 				if (i0 < 1)
 				{
 					npc.setTarget(attacker);
@@ -731,7 +834,9 @@ public class Zaken extends L2AttackableAIScript
 					for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
 					{
 						if (character != attacker)
+						{
 							continue;
+						}
 						if (attacker != ((L2Attackable) npc).getMostHated())
 						{
 							npc.setTarget(attacker);
@@ -739,7 +844,7 @@ public class Zaken extends L2AttackableAIScript
 						}
 					}
 				}
-				if (Rnd.get(2) < 1)
+				if (getRandom(2) < 1)
 				{
 					if (attacker == ((L2Attackable) npc).getMostHated())
 					{
@@ -754,9 +859,9 @@ public class Zaken extends L2AttackableAIScript
 			else if (npc.getCurrentHp() < ((npc.getMaxHp() * _quest2) / 4.0))
 			{
 				_quest2 = (_quest2 - 1);
-				int i2 = Rnd.get(15);
-				_ai1 = Xcoords[i2] + Rnd.get(650);
-				_ai2 = Ycoords[i2] + Rnd.get(650);
+				int i2 = getRandom(15);
+				_ai1 = Xcoords[i2] + getRandom(650);
+				_ai2 = Ycoords[i2] + getRandom(650);
 				_ai3 = Zcoords[i2];
 				npc.setTarget(npc);
 				npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
@@ -774,7 +879,7 @@ public class Zaken extends L2AttackableAIScript
 			npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
 			GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD);
 			// time is 36hour +/- 17hour
-			long respawnTime = (long) Config.Interval_Of_Zaken_Spawn + Rnd.get(Config.Random_Of_Zaken_Spawn);
+			long respawnTime = (long) Config.Interval_Of_Zaken_Spawn + getRandom(Config.Random_Of_Zaken_Spawn);
 			startQuestTimer("zaken_unlock", respawnTime, null, null);
 			cancelQuestTimer("1001", npc, null);
 			cancelQuestTimer("1003", npc, null);
@@ -787,7 +892,7 @@ public class Zaken extends L2AttackableAIScript
 		{
 			if (npcId != ZAKEN)
 			{
-				startQuestTimer("CreateOnePrivateEx", ((30 + Rnd.get(60)) * 1000), npc, null);
+				startQuestTimer("CreateOnePrivateEx", ((30 + getRandom(60)) * 1000), npc, null);
 			}
 		}
 		return super.onKill(npc, killer, isPet);
@@ -803,9 +908,9 @@ public class Zaken extends L2AttackableAIScript
 			{
 				((L2Attackable) npc).addDamageHate(caster, 0, (((skill.getAggroPoints() / npc.getMaxHp()) * 10) * 150));
 			}
-			if (Rnd.get(12) < 1)
+			if (getRandom(12) < 1)
 			{
-				int i0 = Rnd.get((15 * 15));
+				int i0 = getRandom((15 * 15));
 				if (i0 < 1)
 				{
 					npc.setTarget(caster);
@@ -831,7 +936,9 @@ public class Zaken extends L2AttackableAIScript
 					for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
 					{
 						if (character != caster)
+						{
 							continue;
+						}
 						if (caster != ((L2Attackable) npc).getMostHated())
 						{
 							npc.setTarget(caster);
@@ -839,7 +946,7 @@ public class Zaken extends L2AttackableAIScript
 						}
 					}
 				}
-				if (Rnd.get(2) < 1)
+				if (getRandom(2) < 1)
 				{
 					if (caster == ((L2Attackable) npc).getMostHated())
 					{
@@ -863,9 +970,9 @@ public class Zaken extends L2AttackableAIScript
 				L2Character target = isPet ? player.getPet() : player;
 				((L2Attackable) npc).addDamageHate(target, 1, 200);
 			}
-			if (player.getZ() > (npc.getZ() - 100) && player.getZ() < (npc.getZ() + 100))
+			if ((player.getZ() > (npc.getZ() - 100)) && (player.getZ() < (npc.getZ() + 100)))
 			{
-				if (_quest0 < 5 && Rnd.get(3) < 1)
+				if ((_quest0 < 5) && (getRandom(3) < 1))
 				{
 					if (_quest0 == 0)
 					{
@@ -889,9 +996,9 @@ public class Zaken extends L2AttackableAIScript
 					}
 					_quest0++;
 				}
-				if (Rnd.get(15) < 1)
+				if (getRandom(15) < 1)
 				{
-					int i0 = Rnd.get((15 * 15));
+					int i0 = getRandom((15 * 15));
 					if (i0 < 1)
 					{
 						npc.setTarget(player);
@@ -917,7 +1024,9 @@ public class Zaken extends L2AttackableAIScript
 						for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
 						{
 							if (character != player)
+							{
 								continue;
+							}
 							if (player != ((L2Attackable) npc).getMostHated())
 							{
 								npc.setTarget(player);
@@ -925,7 +1034,7 @@ public class Zaken extends L2AttackableAIScript
 							}
 						}
 					}
-					if (Rnd.get(2) < 1)
+					if (getRandom(2) < 1)
 					{
 						if (player == ((L2Attackable) npc).getMostHated())
 						{

+ 222 - 121
L2J_DataPack_BETA/dist/game/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java

@@ -56,7 +56,6 @@ import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.network.clientpackets.Say2;
 import com.l2jserver.gameserver.network.serverpackets.NpcSay;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * Rainbow Springs Chateau clan hall siege script.
@@ -67,81 +66,90 @@ public class RainbowSpringsChateau extends Quest
 	private static final Logger _log = Logger.getLogger(RainbowSpringsChateau.class.getName());
 	
 	private static class SetFinalAttackers implements Runnable
-	{ 
+	{
 		@Override
 		public void run()
 		{
-			if(_rainbow == null)
+			if (_rainbow == null)
+			{
 				_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+			}
 			
 			int spotLeft = 4;
-			if(_rainbow.getOwnerId() > 0)
+			if (_rainbow.getOwnerId() > 0)
 			{
 				L2Clan owner = ClanTable.getInstance().getClan(_rainbow.getOwnerId());
-				if(owner != null)
+				if (owner != null)
 				{
 					_rainbow.free();
 					owner.setHideoutId(0);
 					_acceptedClans.add(owner);
 					--spotLeft;
 				}
-					
-				for(int i = 0; i < spotLeft; i++)
+				
+				for (int i = 0; i < spotLeft; i++)
 				{
 					long counter = 0;
 					L2Clan clan = null;
-					for(int clanId : _warDecreesCount.keys())
+					for (int clanId : _warDecreesCount.keys())
 					{
 						L2Clan actingClan = ClanTable.getInstance().getClan(clanId);
-						if(actingClan == null || actingClan.getDissolvingExpiryTime() > 0)
+						if ((actingClan == null) || (actingClan.getDissolvingExpiryTime() > 0))
 						{
 							_warDecreesCount.remove(clanId);
 							continue;
 						}
 						
 						final long count = _warDecreesCount.get(clanId);
-						if(count > counter)
-						{								counter = count;
+						if (count > counter)
+						{
+							counter = count;
 							clan = actingClan;
 						}
 					}
-					if(_acceptedClans.size() < 4)
+					if (_acceptedClans.size() < 4)
 					{
 						_acceptedClans.add(clan);
 						L2PcInstance leader = clan.getLeader().getPlayerInstance();
-						if(leader != null)
+						if (leader != null)
+						{
 							leader.sendMessage("Your clan has been accepted to join the RainBow Srpings Chateau siege!");
+						}
 					}
 				}
-				if(_acceptedClans.size() >= 2)
+				if (_acceptedClans.size() >= 2)
 				{
 					_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStart(), 3600000);
 					_rainbow.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
 				}
 				else
+				{
 					Announcements.getInstance().announceToAll("Rainbow Springs Chateau siege aborted due lack of population");
+				}
 			}
-		}		
+		}
 	}
 	
 	private static class SiegeStart implements Runnable
-	{		
+	{
 		@Override
 		public void run()
 		{
-			if(_rainbow == null)
+			if (_rainbow == null)
+			{
 				_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
-
-			//XXX _rainbow.siegeStarts();
+			}
+			
+			// XXX _rainbow.siegeStarts();
 			
 			spawnGourds();
 			_siegeEnd = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeEnd(null), _rainbow.getSiegeLenght() - 120000);
 		}
 	}
-		
+	
 	private static class SiegeEnd implements Runnable
 	{
-		private L2Clan _winner;
+		private final L2Clan _winner;
 		
 		private SiegeEnd(L2Clan winner)
 		{
@@ -151,32 +159,36 @@ public class RainbowSpringsChateau extends Quest
 		@Override
 		public void run()
 		{
-			if(_rainbow == null)
+			if (_rainbow == null)
+			{
 				_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
-
+			}
+			
 			unSpawnGourds();
 			
-			if(_winner != null)
+			if (_winner != null)
+			{
 				_rainbow.setOwner(_winner);
+			}
 			
-			//XXX _rainbow.siegeEnds();
+			// XXX _rainbow.siegeEnds();
 			
 			ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
-			setRegistrationEndString(_rainbow.getNextSiegeTime() + System.currentTimeMillis() - 3600000);
+			setRegistrationEndString((_rainbow.getNextSiegeTime() + System.currentTimeMillis()) - 3600000);
 			// Teleport out of the arenas is made 2 mins after game ends
 			ThreadPoolManager.getInstance().scheduleGeneral(new TeleportBack(), 120000);
 		}
 	}
 	
 	private static class TeleportBack implements Runnable
-	{		
+	{
 		@Override
 		public void run()
 		{
-			for(int arenaId : ARENA_ZONES)
+			for (int arenaId : ARENA_ZONES)
 			{
 				final L2Character[] chars = ZoneManager.getInstance().getZoneById(arenaId).getCharactersInsideArray();
-				for(L2Character chr : chars)
+				for (L2Character chr : chars)
 				{
 					if (chr != null)
 					{
@@ -192,7 +204,7 @@ public class RainbowSpringsChateau extends Quest
 	private static final int RAINBOW_SPRINGS = 62;
 	
 	private static final int WAR_DECREES = 8034;
-	private static final int RAINBOW_NECTAR= 8030;
+	private static final int RAINBOW_NECTAR = 8030;
 	private static final int RAINBOW_MWATER = 8031;
 	private static final int RAINBOW_WATER = 8032;
 	private static final int RAINBOW_SULFUR = 8033;
@@ -201,20 +213,54 @@ public class RainbowSpringsChateau extends Quest
 	private static final int CARETAKER = 35603;
 	private static final int CHEST = 35593;
 	
-	private static final int[] GOURDS = { 35588, 35589, 35590, 35591 };
+	private static final int[] GOURDS =
+	{
+		35588,
+		35589,
+		35590,
+		35591
+	};
 	private static L2Spawn[] _gourds = new L2Spawn[4];
 	
-	private static final int[] YETIS = { 35596, 35597, 35598, 35599 };
+	private static final int[] YETIS =
+	{
+		35596,
+		35597,
+		35598,
+		35599
+	};
 	
 	private static final int[][] ARENAS =
 	{
-		{ 151562, -127080, -2214 }, // Arena 1
-		{ 153141, -125335, -2214 }, // Arena 2
-		{ 153892, -127530, -2214 }, // Arena 3
-		{ 155657, -125752, -2214 }, // Arena 4
+		{
+			151562,
+			-127080,
+			-2214
+		}, // Arena 1
+		{
+			153141,
+			-125335,
+			-2214
+		}, // Arena 2
+		{
+			153892,
+			-127530,
+			-2214
+		}, // Arena 3
+		{
+			155657,
+			-125752,
+			-2214
+		}, // Arena 4
 	};
 	
-	private static final int[] ARENA_ZONES = { 112081, 112082, 112083, 112084 };
+	private static final int[] ARENA_ZONES =
+	{
+		112081,
+		112082,
+		112083,
+		112084
+	};
 	
 	private static final String[] _textPassages =
 	{
@@ -234,7 +280,7 @@ public class RainbowSpringsChateau extends Quest
 	{
 		SkillTable.getInstance().getInfo(0, 1)
 	};
-		
+	
 	private static TIntLongHashMap _warDecreesCount = new TIntLongHashMap();
 	private static List<L2Clan> _acceptedClans = new ArrayList<L2Clan>(4);
 	private static Map<String, ArrayList<L2Clan>> _usedTextPassages = new HashMap<String, ArrayList<L2Clan>>();
@@ -244,7 +290,6 @@ public class RainbowSpringsChateau extends Quest
 	private static ScheduledFuture<?> _nextSiege, _siegeEnd;
 	private static String _registrationEnds;
 	
-	
 	/**
 	 * @param questId
 	 * @param name
@@ -264,16 +309,18 @@ public class RainbowSpringsChateau extends Quest
 		loadAttackers();
 		
 		_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
-		if(_rainbow != null)
+		if (_rainbow != null)
 		{
 			long delay = _rainbow.getNextSiegeTime();
-			if(delay > -1)
+			if (delay > -1)
 			{
 				setRegistrationEndString(delay - 3600000);
 				_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), delay);
 			}
 			else
+			{
 				_log.warning("CHSiegeManager: No Date setted for RainBow Springs Chateau Clan hall siege!. SIEGE CANCELED!");
+			}
 		}
 	}
 	
@@ -282,7 +329,7 @@ public class RainbowSpringsChateau extends Quest
 	{
 		String html = "";
 		final int npcId = npc.getNpcId();
-		if(npcId == MESSENGER)
+		if (npcId == MESSENGER)
 		{
 			final String main = (_rainbow.getOwnerId() > 0) ? "messenger_yetti001.htm" : "messenger_yetti001a.htm";
 			html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/scripts/conquerablehalls/RainbowSpringsChateau/" + main);
@@ -292,9 +339,9 @@ public class RainbowSpringsChateau extends Quest
 				html = html.replace("%owner%", ClanTable.getInstance().getClan(_rainbow.getOwnerId()).getName());
 			}
 		}
-		else if(npcId == CARETAKER)
+		else if (npcId == CARETAKER)
 		{
-			if(_rainbow.isInSiege())
+			if (_rainbow.isInSiege())
 			{
 				html = "game_manager003.htm";
 			}
@@ -319,7 +366,9 @@ public class RainbowSpringsChateau extends Quest
 					{
 						int index = _acceptedClans.indexOf(clan);
 						if (npcId == YETIS[index])
+						{
 							html = "yeti_main.htm";
+						}
 					}
 				}
 			}
@@ -347,22 +396,22 @@ public class RainbowSpringsChateau extends Quest
 						{
 							html = "messenger_yetti012.htm";
 						}
-						else if(!_rainbow.isRegistering())
+						else if (!_rainbow.isRegistering())
 						{
 							html = "messenger_yetti014.htm";
 						}
-						else if(_warDecreesCount.containsKey(clan.getClanId()))
+						else if (_warDecreesCount.containsKey(clan.getClanId()))
 						{
 							html = "messenger_yetti013.htm";
 						}
-						else if(clan.getLevel() < 3 || clan.getMembersCount() < 5)
+						else if ((clan.getLevel() < 3) || (clan.getMembersCount() < 5))
 						{
 							html = "messenger_yetti011.htm";
 						}
 						else
 						{
 							final L2ItemInstance warDecrees = player.getInventory().getItemByItemId(WAR_DECREES);
-							if(warDecrees == null)
+							if (warDecrees == null)
 							{
 								html = "messenger_yetti008.htm";
 							}
@@ -381,11 +430,11 @@ public class RainbowSpringsChateau extends Quest
 						{
 							html = "messenger_yetti010.htm";
 						}
-						else if(!_warDecreesCount.containsKey(clan.getClanId()))
+						else if (!_warDecreesCount.containsKey(clan.getClanId()))
 						{
 							html = "messenger_yetti016.htm";
 						}
-						else if(!_rainbow.isRegistering())
+						else if (!_rainbow.isRegistering())
 						{
 							html = "messenger_yetti017.htm";
 						}
@@ -396,7 +445,7 @@ public class RainbowSpringsChateau extends Quest
 						}
 						break;
 					case "unregister":
-						if(_rainbow.isRegistering())
+						if (_rainbow.isRegistering())
 						{
 							if (_warDecreesCount.contains(clan.getClanId()))
 							{
@@ -409,7 +458,7 @@ public class RainbowSpringsChateau extends Quest
 								html = "messenger_yetti020.htm";
 							}
 						}
-						else if(_rainbow.isWaitingBattle())
+						else if (_rainbow.isWaitingBattle())
 						{
 							_acceptedClans.remove(clan);
 							html = "messenger_yetti020.htm";
@@ -418,22 +467,22 @@ public class RainbowSpringsChateau extends Quest
 				}
 				break;
 			case CARETAKER:
-				if(event.equals("portToArena"))
+				if (event.equals("portToArena"))
 				{
 					final L2Party party = player.getParty();
 					if (clan == null)
 					{
 						html = "game_manager009.htm";
 					}
-					else if(!player.isClanLeader())
+					else if (!player.isClanLeader())
 					{
 						html = "game_manager004.htm";
 					}
-					else if(!player.isInParty())
+					else if (!player.isInParty())
 					{
 						html = "game_manager005.htm";
 					}
-					else if(party.getPartyLeaderOID() != player.getObjectId())
+					else if (party.getPartyLeaderOID() != player.getObjectId())
 					{
 						html = "game_manager006.htm";
 					}
@@ -454,7 +503,7 @@ public class RainbowSpringsChateau extends Quest
 						{
 							html = "game_manager007.htm";
 						}
-						else if(party.getMemberCount() < 5)
+						else if (party.getMemberCount() < 5)
 						{
 							html = "game_manager008.htm";
 						}
@@ -468,19 +517,19 @@ public class RainbowSpringsChateau extends Quest
 						}
 						// else if () // Something about the rules.
 						// {
-						// 	html = "game_manager012.htm";
+						// html = "game_manager012.htm";
 						// }
 						// else if () // Already registered.
 						// {
-						// 	html = "game_manager013.htm";
+						// html = "game_manager013.htm";
 						// }
-						else if(!_acceptedClans.contains(clan))
+						else if (!_acceptedClans.contains(clan))
 						{
 							html = "game_manager014.htm";
 						}
 						// else if () // Not have enough cards to register.
 						// {
-						// 	html = "game_manager015.htm";
+						// html = "game_manager015.htm";
 						// }
 						else
 						{
@@ -491,52 +540,64 @@ public class RainbowSpringsChateau extends Quest
 				break;
 		}
 		
-		if(event.startsWith("enterText"))
+		if (event.startsWith("enterText"))
 		{
 			// Shouldn't happen
-			if(!_acceptedClans.contains(clan))
+			if (!_acceptedClans.contains(clan))
+			{
 				return null;
+			}
 			
 			String[] split = event.split("_ ");
-			if(split.length < 2)
+			if (split.length < 2)
+			{
 				return null;
+			}
 			
 			final String passage = split[1];
 			
-			if(!isValidPassage(passage))
+			if (!isValidPassage(passage))
+			{
 				return null;
+			}
 			
-			if(_usedTextPassages.containsKey(passage))
+			if (_usedTextPassages.containsKey(passage))
 			{
 				ArrayList<L2Clan> list = _usedTextPassages.get(passage);
 				
-				if(list.contains(clan))
+				if (list.contains(clan))
+				{
 					html = "yeti_passage_used.htm";
+				}
 				else
 				{
 					list.add(clan);
-					synchronized(_pendingItemToGet)
+					synchronized (_pendingItemToGet)
 					{
-						if(_pendingItemToGet.containsKey(clan))
+						if (_pendingItemToGet.containsKey(clan))
 						{
 							int left = _pendingItemToGet.get(clan);
 							++left;
 							_pendingItemToGet.put(clan, left);
 						}
 						else
+						{
 							_pendingItemToGet.put(clan, 1);
+						}
 					}
 					html = "yeti_item_exchange.htm";
 				}
 			}
 		}
-		else if(event.startsWith("getItem"))
+		else if (event.startsWith("getItem"))
 		{
-			if(!_pendingItemToGet.containsKey(clan))
+			if (!_pendingItemToGet.containsKey(clan))
+			{
 				html = "yeti_cannot_exchange.htm";
-				
+			}
+			
 			int left = _pendingItemToGet.get(clan);
-			if(left > 0)
+			if (left > 0)
 			{
 				int itemId = Integer.parseInt(event.split("_")[1]);
 				player.addItem("Rainbow Spring Chateau Siege", itemId, 1, npc, true);
@@ -545,7 +606,9 @@ public class RainbowSpringsChateau extends Quest
 				html = "yeti_main.htm";
 			}
 			else
+			{
 				html = "yeti_cannot_exchange.htm";
+			}
 		}
 		
 		return html;
@@ -554,26 +617,32 @@ public class RainbowSpringsChateau extends Quest
 	@Override
 	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
 	{
-		if(!_rainbow.isInSiege())
+		if (!_rainbow.isInSiege())
+		{
 			return null;
+		}
 		
 		final L2Clan clan = killer.getClan();
-		if(clan == null || !_acceptedClans.contains(clan))
+		if ((clan == null) || !_acceptedClans.contains(clan))
+		{
 			return null;
+		}
 		
 		final int npcId = npc.getNpcId();
 		final int index = _acceptedClans.indexOf(clan);
 		
-		if(npcId == CHEST)
+		if (npcId == CHEST)
 		{
 			shoutRandomText(npc);
 		}
-		else if(npcId == GOURDS[index])
+		else if (npcId == GOURDS[index])
 		{
-			synchronized(this)
+			synchronized (this)
 			{
-				if(_siegeEnd != null)
+				if (_siegeEnd != null)
+				{
 					_siegeEnd.cancel(false);
+				}
 				ThreadPoolManager.getInstance().executeTask(new SiegeEnd(clan));
 			}
 		}
@@ -584,23 +653,31 @@ public class RainbowSpringsChateau extends Quest
 	@Override
 	public String onItemUse(L2Item item, L2PcInstance player)
 	{
-		if(!_rainbow.isInSiege())
+		if (!_rainbow.isInSiege())
+		{
 			return null;
+		}
 		
 		L2Object target = player.getTarget();
 		
-		if(target == null || !(target instanceof L2Npc))
+		if ((target == null) || !(target instanceof L2Npc))
+		{
 			return null;
+		}
 		
-		int yeti = ((L2Npc)target).getNpcId();
+		int yeti = ((L2Npc) target).getNpcId();
 		
-		if(!isYetiTarget(yeti))
+		if (!isYetiTarget(yeti))
+		{
 			return null;
+		}
 		
 		final L2Clan clan = player.getClan();
 		
-		if(clan == null || !_acceptedClans.contains(clan))
+		if ((clan == null) || !_acceptedClans.contains(clan))
+		{
 			return null;
+		}
 		
 		final int itemId = item.getItemId();
 		
@@ -611,20 +688,20 @@ public class RainbowSpringsChateau extends Quest
 		// - Change arena gourds ( moveGourds() )
 		// - Increase gourd hp ( increaseGourdHp(int) )
 		
-		if(itemId == RAINBOW_NECTAR)
+		if (itemId == RAINBOW_NECTAR)
 		{
 			// Spawn enraged (where?)
 			reduceGourdHp(_acceptedClans.indexOf(clan), player);
 		}
-		else if(itemId == RAINBOW_MWATER)
+		else if (itemId == RAINBOW_MWATER)
 		{
 			increaseGourdHp(_acceptedClans.indexOf(clan));
 		}
-		else if(itemId == RAINBOW_WATER)
+		else if (itemId == RAINBOW_WATER)
 		{
 			moveGourds();
 		}
-		else if(itemId == RAINBOW_SULFUR)
+		else if (itemId == RAINBOW_SULFUR)
 		{
 			castDebuffsOnEnemies(_acceptedClans.indexOf(clan));
 		}
@@ -633,26 +710,30 @@ public class RainbowSpringsChateau extends Quest
 	
 	private static void portToArena(L2PcInstance leader, int arena)
 	{
-		if(arena < 0 || arena > 3)
+		if ((arena < 0) || (arena > 3))
 		{
-			_log.warning("RainbowSptringChateau siege: Wrong arena id passed: "+arena);
+			_log.warning("RainbowSptringChateau siege: Wrong arena id passed: " + arena);
 			return;
 		}
-		for(L2PcInstance pc : leader.getParty().getPartyMembers())
-			if(pc != null)
+		for (L2PcInstance pc : leader.getParty().getPartyMembers())
+		{
+			if (pc != null)
 			{
 				pc.stopAllEffects();
-				if(pc.getPet() != null)
+				if (pc.getPet() != null)
+				{
 					pc.getPet().unSummon(pc);
+				}
 				pc.teleToLocation(ARENAS[arena][0], ARENAS[arena][1], ARENAS[arena][2]);
-			}	
+			}
+		}
 	}
 	
 	private static void spawnGourds()
 	{
-		for(int i = 0; i < _acceptedClans.size(); i++)
+		for (int i = 0; i < _acceptedClans.size(); i++)
 		{
-			if(_gourds[i] == null)
+			if (_gourds[i] == null)
 			{
 				try
 				{
@@ -663,7 +744,7 @@ public class RainbowSpringsChateau extends Quest
 					_gourds[i].setHeading(1);
 					_gourds[i].setAmount(1);
 				}
-				catch(Exception e)
+				catch (Exception e)
 				{
 					e.printStackTrace();
 				}
@@ -675,7 +756,7 @@ public class RainbowSpringsChateau extends Quest
 	
 	private static void unSpawnGourds()
 	{
-		for(int i = 0; i < _acceptedClans.size(); i++)
+		for (int i = 0; i < _acceptedClans.size(); i++)
 		{
 			_gourds[i].getLastSpawn().deleteMe();
 			SpawnTable.getInstance().deleteSpawn(_gourds[i], false);
@@ -686,12 +767,12 @@ public class RainbowSpringsChateau extends Quest
 	{
 		L2Spawn[] tempArray = _gourds;
 		int iterator = _acceptedClans.size();
-		for(int i = 0; i < iterator; i++)
+		for (int i = 0; i < iterator; i++)
 		{
-			L2Spawn oldSpawn = _gourds[(iterator-1)-i];
+			L2Spawn oldSpawn = _gourds[(iterator - 1) - i];
 			L2Spawn curSpawn = tempArray[i];
 			
-			_gourds[(iterator -1) - i] = curSpawn;
+			_gourds[(iterator - 1) - i] = curSpawn;
 			
 			int newX = oldSpawn.getLocx();
 			int newY = oldSpawn.getLocy();
@@ -716,17 +797,19 @@ public class RainbowSpringsChateau extends Quest
 	
 	private static void castDebuffsOnEnemies(int myArena)
 	{
-		for(int id : ARENA_ZONES)
+		for (int id : ARENA_ZONES)
 		{
-			if(id == myArena)
+			if (id == myArena)
+			{
 				continue;
+			}
 			
 			final L2Character[] chars = ZoneManager.getInstance().getZoneById(id).getCharactersInsideArray();
-			for(L2Character chr : chars)
+			for (L2Character chr : chars)
 			{
 				if (chr != null)
 				{
-					for(L2Skill sk : DEBUFFS)
+					for (L2Skill sk : DEBUFFS)
 					{
 						sk.getEffects(chr, chr);
 					}
@@ -739,14 +822,18 @@ public class RainbowSpringsChateau extends Quest
 	{
 		int length = _textPassages.length;
 		
-		if(_usedTextPassages.size() >= length)
+		if (_usedTextPassages.size() >= length)
+		{
 			return;
-
-		int randomPos = Rnd.get(length);
+		}
+		
+		int randomPos = getRandom(length);
 		String message = _textPassages[randomPos];
 		
-		if(_usedTextPassages.containsKey(message))
+		if (_usedTextPassages.containsKey(message))
+		{
 			shoutRandomText(npc);
+		}
 		else
 		{
 			_usedTextPassages.put(message, new ArrayList<L2Clan>());
@@ -759,17 +846,25 @@ public class RainbowSpringsChateau extends Quest
 	
 	private static boolean isValidPassage(String text)
 	{
-		for(String st : _textPassages)
-			if(st.equalsIgnoreCase(text))
+		for (String st : _textPassages)
+		{
+			if (st.equalsIgnoreCase(text))
+			{
 				return true;
+			}
+		}
 		return false;
 	}
 	
 	private static boolean isYetiTarget(int npcId)
 	{
-		for(int yeti : YETIS)
-			if(yeti == npcId)
+		for (int yeti : YETIS)
+		{
+			if (yeti == npcId)
+			{
 				return true;
+			}
+		}
 		return false;
 	}
 	
@@ -780,7 +875,7 @@ public class RainbowSpringsChateau extends Quest
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
 			PreparedStatement statement;
-			if(remove)
+			if (remove)
 			{
 				statement = con.prepareStatement("DELETE FROM rainbowsprings_attacker_list WHERE clanId = ?");
 				statement.setInt(1, clanId);
@@ -794,7 +889,7 @@ public class RainbowSpringsChateau extends Quest
 			statement.execute();
 			statement.close();
 		}
-		catch(Exception e)
+		catch (Exception e)
 		{
 			e.printStackTrace();
 		}
@@ -812,7 +907,7 @@ public class RainbowSpringsChateau extends Quest
 			con = L2DatabaseFactory.getInstance().getConnection();
 			PreparedStatement statement = con.prepareStatement("SELECT * FROM rainbowsprings_attacker_list");
 			ResultSet rset = statement.executeQuery();
-			while(rset.next())
+			while (rset.next())
 			{
 				int clanId = rset.getInt("clan_id");
 				long count = rset.getLong("decrees_count");
@@ -821,7 +916,7 @@ public class RainbowSpringsChateau extends Quest
 			rset.close();
 			statement.close();
 		}
-		catch(Exception e)
+		catch (Exception e)
 		{
 			e.printStackTrace();
 		}
@@ -841,7 +936,7 @@ public class RainbowSpringsChateau extends Quest
 		int hour = c.get(Calendar.HOUR);
 		int mins = c.get(Calendar.MINUTE);
 		
-		_registrationEnds = year+"-"+month+"-"+day+" "+hour+":"+mins;
+		_registrationEnds = year + "-" + month + "-" + day + " " + hour + ":" + mins;
 	}
 	
 	public static void launchSiege()
@@ -852,19 +947,25 @@ public class RainbowSpringsChateau extends Quest
 	
 	public static void endSiege()
 	{
-		if(_siegeEnd != null)
+		if (_siegeEnd != null)
+		{
 			_siegeEnd.cancel(false);
+		}
 		ThreadPoolManager.getInstance().executeTask(new SiegeEnd(null));
 	}
 	
 	public static void updateAdminDate(long date)
 	{
-		if(_rainbow == null)
+		if (_rainbow == null)
+		{
 			_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
+		}
 		
 		_rainbow.setNextSiegeDate(date);
-		if(_nextSiege != null)
+		if (_nextSiege != null)
+		{
 			_nextSiege.cancel(true);
+		}
 		date -= 3600000;
 		setRegistrationEndString(date);
 		_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), _rainbow.getNextSiegeTime());

+ 1 - 2
L2J_DataPack_BETA/dist/game/data/scripts/hellbound/Kanaf/Kanaf.java

@@ -17,7 +17,6 @@ package hellbound.Kanaf;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.quest.Quest;
-import com.l2jserver.util.Rnd;
 
 /**
  * @author GKR
@@ -31,7 +30,7 @@ public class Kanaf extends Quest
 	{
 		if (event.equalsIgnoreCase("info"))
 		{
-			return "32346-0" + Rnd.get(1, 3) + ".htm";
+			return "32346-0" + getRandom(1, 3) + ".htm";
 		}
 		
 		return null;

+ 164 - 89
L2J_DataPack_BETA/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java

@@ -35,7 +35,6 @@ import com.l2jserver.gameserver.model.zone.L2ZoneType;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * 2010-10-15 Based on official server Naia
@@ -55,37 +54,65 @@ public class NornilsGarden extends Quest
 		{
 		}
 	}
-
+	
 	private static final String qn = "NornilsGarden";
 	private static final int INSTANCE_ID = 11;
-
+	
 	private static final int DURATION_TIME = 70;
 	private static final int EMPTY_DESTROY_TIME = 5;
-
+	
 	private static final int INSTANCE_LVL_MIN = 18;
 	private static final int INSTANCE_LVL_MAX = 22;
-
+	
 	private static final int _garden_guard = 32330;
-
-	private static final int[] _final_gates = { 32260, 32261, 32262 };
 	
-	private static final int[] SPAWN_PPL = { -111184, 74540, -12430 };
-	private static final int[] EXIT_PPL  = {  -74058, 52040,  -3680 };
+	private static final int[] _final_gates =
+	{
+		32260,
+		32261,
+		32262
+	};
+	
+	private static final int[] SPAWN_PPL =
+	{
+		-111184,
+		74540,
+		-12430
+	};
+	private static final int[] EXIT_PPL =
+	{
+		-74058,
+		52040,
+		-3680
+	};
 	
 	private static final int[][] _auto_gates =
 	{
-		{ 20110, 16200001 }, // Warriors gate
-		{ 20111, 16200004 }, // Midway gate
-		{ 20112, 16200013 }  // Gate
+		// Warriors gate
+		{
+			20110,
+			16200001
+		},
+		// Midway gate
+		{
+			20111,
+			16200004
+		},
+		// Gate
+		{
+			20112,
+			16200013
+		}
 	};
 	
 	private static final L2Skill skill1 = SkillTable.getInstance().getInfo(4322, 1);
 	private static final L2Skill skill2 = SkillTable.getInstance().getInfo(4327, 1);
 	private static final L2Skill skill3 = SkillTable.getInstance().getInfo(4329, 1);
 	private static final L2Skill skill4 = SkillTable.getInstance().getInfo(4324, 1);
-
+	
 	private static final int _herb_jar = 18478;
-
+	
+	// @formatter:off
 	private static final int[][] _gatekeepers =
 	{
 		{ 18352, 9703, 0 }, // Kamael Guard
@@ -100,13 +127,15 @@ public class NornilsGarden extends Quest
 		{ 18361, 9711, 0 }, // Guardian of Prediction
 		{ 25528, 9712, 0 }  // Tiberias
 	};
-
+	
 	private static final int[][] HP_HERBS_DROPLIST =
 	{
 		// itemId, count, chance
-		{ 8602, 1, 10 }, { 8601, 2, 40 }, { 8600, 3, 70 }
+		{ 8602, 1, 10 },
+		{ 8601, 2, 40 },
+		{ 8600, 3, 70 }
 	};
-
+	
 	private static final int[][] _group_1 = 
 	{
 		{ 18363, -109899, 74431, -12528, 16488 },
@@ -138,7 +167,7 @@ public class NornilsGarden extends Quest
 		{ 18363, -109016, 80642, -12912, 0 },
 		{ 18483, -108740, 80546, -12912, 0 }
 	};
-
+	
 	private static final int[][] _group_4 =
 	{
 		{ 18362, -110082, 83998, -12928, 0 },
@@ -155,44 +184,61 @@ public class NornilsGarden extends Quest
 	private static final int[][] MP_HERBS_DROPLIST =
 	{
 		// itemId, count, chance
-		{ 8605, 1, 10 }, { 8604, 2, 40 }, { 8603, 3, 70 }
+		{ 8605, 1, 10 },
+		{ 8604, 2, 40 },
+		{ 8603, 3, 70 }
 	};
-
+	// @formatter:on
+	
 	private static final void dropHerb(L2Npc mob, L2PcInstance player, int[][] drop)
 	{
-		final int chance = Rnd.get(100);
-		for (int i = 0; i < drop.length; i++)
+		final int chance = getRandom(100);
+		for (int[] element : drop)
 		{
-			if (chance < drop[i][2])
-				((L2MonsterInstance)mob).dropItem(player, drop[i][0], drop[i][1]);
+			if (chance < element[2])
+			{
+				((L2MonsterInstance) mob).dropItem(player, element[0], element[1]);
+			}
 		}
 	}
-
+	
 	private static final void removeBuffs(L2Character ch)
 	{
 		for (L2Effect e : ch.getAllEffects())
 		{
 			if (e == null)
+			{
 				continue;
+			}
 			L2Skill skill = e.getSkill();
 			if (skill.isDebuff() || skill.isStayAfterDeath())
+			{
 				continue;
+			}
 			e.exit();
 		}
 	}
-
+	
 	private static final void giveBuffs(L2Character ch)
 	{
-		if(skill1 != null)
+		if (skill1 != null)
+		{
 			skill1.getEffects(ch, ch);
-		if(skill2 != null)
+		}
+		if (skill2 != null)
+		{
 			skill2.getEffects(ch, ch);
-		if(skill3 != null)
+		}
+		if (skill3 != null)
+		{
 			skill3.getEffects(ch, ch);
-		if(skill4 != null)
+		}
+		if (skill4 != null)
+		{
 			skill4.getEffects(ch, ch);
+		}
 	}
-
+	
 	private static final void teleportPlayer(L2PcInstance player, int[] coords, int instanceId)
 	{
 		QuestState st = player.getQuestState(qn);
@@ -200,7 +246,7 @@ public class NornilsGarden extends Quest
 		{
 			Quest q = QuestManager.getInstance().getQuest(qn);
 			st = q.newQuestState(player);
-		}		
+		}
 		removeBuffs(player);
 		giveBuffs(player);
 		if (player.getPet() != null)
@@ -212,7 +258,7 @@ public class NornilsGarden extends Quest
 		player.setInstanceId(instanceId);
 		player.teleToLocation(coords[0], coords[1], coords[2], true);
 	}
-
+	
 	private void exitInstance(L2PcInstance player)
 	{
 		InstanceWorld inst = InstanceManager.getInstance().getWorld(player.getInstanceId());
@@ -231,13 +277,13 @@ public class NornilsGarden extends Quest
 		InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
 		if (world != null)
 		{
-			if (!(world instanceof NornilsWorld) || world.templateId != INSTANCE_ID)
+			if (!(world instanceof NornilsWorld) || (world.templateId != INSTANCE_ID))
 			{
 				player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER);
 				return null;
 			}
 			// check for level difference again on reenter
-			if (player.getLevel() > INSTANCE_LVL_MAX || player.getLevel() < INSTANCE_LVL_MIN)
+			if ((player.getLevel() > INSTANCE_LVL_MAX) || (player.getLevel() < INSTANCE_LVL_MIN))
 			{
 				SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT);
 				sm.addPcName(player);
@@ -248,20 +294,27 @@ public class NornilsGarden extends Quest
 			Instance inst = InstanceManager.getInstance().getInstance(world.instanceId);
 			if (inst != null)
 			{
-				teleportPlayer(player, SPAWN_PPL , world.instanceId);
+				teleportPlayer(player, SPAWN_PPL, world.instanceId);
 			}
 			return null;
 		}
 		// Creating new instance
 		String result = checkConditions(npc, player);
 		if (!(result.equalsIgnoreCase("ok")))
+		{
 			return result;
-
+		}
+		
 		final int instanceId = InstanceManager.getInstance().createDynamicInstance("NornilsGarden.xml");
 		final Instance inst = InstanceManager.getInstance().getInstance(instanceId);
 		
 		inst.setName(InstanceManager.getInstance().getInstanceIdName(INSTANCE_ID));
-		final int[] returnLoc = { player.getX(), player.getY(), player.getZ() };
+		final int[] returnLoc =
+		{
+			player.getX(),
+			player.getY(),
+			player.getZ()
+		};
 		inst.setSpawnLoc(returnLoc);
 		inst.setAllowSummon(false);
 		inst.setDuration(DURATION_TIME * 60000);
@@ -271,12 +324,12 @@ public class NornilsGarden extends Quest
 		world.templateId = INSTANCE_ID;
 		InstanceManager.getInstance().addWorld(world);
 		_log.info("Nornils Garden: started, Instance: " + instanceId + " created by player: " + player.getName());
-
+		
 		prepareInstance((NornilsWorld) world);
 		
 		// and finally teleport party into instance
 		final L2Party party = player.getParty();
-		if(party != null)
+		if (party != null)
 		{
 			for (L2PcInstance partyMember : party.getPartyMembers())
 			{
@@ -289,8 +342,8 @@ public class NornilsGarden extends Quest
 	
 	private void prepareInstance(NornilsWorld world)
 	{
-		world.first_npc = addSpawn(18362,-109702,74696,-12528, 49568, false, 0, false, world.instanceId);
-	
+		world.first_npc = addSpawn(18362, -109702, 74696, -12528, 49568, false, 0, false, world.instanceId);
+		
 		L2DoorInstance door = InstanceManager.getInstance().getInstance(world.instanceId).getDoor(16200010);
 		if (door != null)
 		{
@@ -350,9 +403,9 @@ public class NornilsGarden extends Quest
 					addSpawn(mob[0], mob[1], mob[2], mob[3], mob[4], false, 0, false, world.instanceId);
 				}
 			}
-		}		
+		}
 	}
-
+	
 	private void spawn4(L2Character cha)
 	{
 		InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
@@ -368,24 +421,26 @@ public class NornilsGarden extends Quest
 					addSpawn(mob[0], mob[1], mob[2], mob[3], mob[4], false, 0, false, world.instanceId);
 				}
 			}
-		}		
+		}
 	}
 	
 	private void openDoor(QuestState st, L2PcInstance player, int doorId)
 	{
-		st.unset("correct");		
+		st.unset("correct");
 		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
 		if (tmpworld instanceof NornilsWorld)
 		{
 			L2DoorInstance door = InstanceManager.getInstance().getInstance(tmpworld.instanceId).getDoor(doorId);
 			if (door != null)
+			{
 				door.openMe();
+			}
 		}
 	}
 	
 	private static final String checkConditions(L2Npc npc, L2PcInstance player)
 	{
-		final L2Party party = player.getParty();		
+		final L2Party party = player.getParty();
 		// player must be in party
 		if (party == null)
 		{
@@ -417,7 +472,7 @@ public class NornilsGarden extends Quest
 				player.sendPacket(sm);
 				return "32330-07.html";
 			}
-			if ( partyMember.getClassId().level() != 0)
+			if (partyMember.getClassId().level() != 0)
 			{
 				SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT);
 				sm.addPcName(partyMember);
@@ -435,7 +490,7 @@ public class NornilsGarden extends Quest
 			if (partyMember.getRace().ordinal() == 5)
 			{
 				QuestState checkst = partyMember.getQuestState("179_IntoTheLargeCavern");
-				if(checkst != null && checkst.getState() == State.STARTED)
+				if ((checkst != null) && (checkst.getState() == State.STARTED))
 				{
 					_kamael = true;
 				}
@@ -454,14 +509,11 @@ public class NornilsGarden extends Quest
 		}
 		return "ok";
 	}
-
+	
 	@Override
 	public String onEnterZone(L2Character character, L2ZoneType zone)
 	{
-		if (character instanceof L2PcInstance
-				&& !character.isDead()
-				&& !character.isTeleporting()
-				&& ((L2PcInstance)character).isOnline())
+		if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
 		{
 			InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
 			if (tmpworld instanceof NornilsWorld)
@@ -472,17 +524,23 @@ public class NornilsGarden extends Quest
 					{
 						L2DoorInstance door = InstanceManager.getInstance().getInstance(tmpworld.instanceId).getDoor(_auto[1]);
 						if (door != null)
+						{
 							door.openMe();
+						}
 					}
 					if (zone.getId() == 20111)
+					{
 						spawn3(character);
-					else if(zone.getId() == 20112)
+					}
+					else if (zone.getId() == 20112)
+					{
 						spawn4(character);
+					}
 					
 				}
 			}
 		}
-		return super.onEnterZone(character,zone);
+		return super.onEnterZone(character, zone);
 	}
 	
 	@Override
@@ -492,10 +550,12 @@ public class NornilsGarden extends Quest
 		
 		String htmltext = event;
 		QuestState st = player.getQuestState(qn);
-		if(st == null)
+		if (st == null)
+		{
 			return getNoQuestMsg(player);
-
-		if(npc.getNpcId() == _garden_guard && event.equalsIgnoreCase("enter_instance"))
+		}
+		
+		if ((npc.getNpcId() == _garden_guard) && event.equalsIgnoreCase("enter_instance"))
 		{
 			try
 			{
@@ -505,7 +565,7 @@ public class NornilsGarden extends Quest
 			{
 			}
 		}
-		else if (npc.getNpcId() == 32258 && event.equalsIgnoreCase("exit"))
+		else if ((npc.getNpcId() == 32258) && event.equalsIgnoreCase("exit"))
 		{
 			try
 			{
@@ -517,28 +577,36 @@ public class NornilsGarden extends Quest
 		}
 		else if (Util.contains(_final_gates, npc.getNpcId()))
 		{
-			if(event.equalsIgnoreCase("32260-02.html") || event.equalsIgnoreCase("32261-02.html") || event.equalsIgnoreCase("32262-02.html"))
+			if (event.equalsIgnoreCase("32260-02.html") || event.equalsIgnoreCase("32261-02.html") || event.equalsIgnoreCase("32262-02.html"))
 			{
 				st.unset("correct");
 			}
-			else if(Util.isDigit(event))
+			else if (Util.isDigit(event))
 			{
 				int correct = st.getInt("correct");
 				correct++;
 				st.set("correct", String.valueOf(correct));
-				htmltext = npc.getNpcId()+"-0"+String.valueOf(correct+2)+".html";
+				htmltext = npc.getNpcId() + "-0" + String.valueOf(correct + 2) + ".html";
 			}
 			else if (event.equalsIgnoreCase("check"))
 			{
 				int correct = st.getInt("correct");
-				if(npc.getNpcId() == 32260 && correct == 3)
+				if ((npc.getNpcId() == 32260) && (correct == 3))
+				{
 					openDoor(st, player, 16200014);
-				else if (npc.getNpcId() == 32261 && correct == 3)
+				}
+				else if ((npc.getNpcId() == 32261) && (correct == 3))
+				{
 					openDoor(st, player, 16200015);
-				else if (npc.getNpcId() == 32262 && correct == 4)
+				}
+				else if ((npc.getNpcId() == 32262) && (correct == 4))
+				{
 					openDoor(st, player, 16200016);
+				}
 				else
-					return npc.getNpcId()+"-00.html";
+				{
+					return npc.getNpcId() + "-00.html";
+				}
 			}
 		}
 		return htmltext;
@@ -550,18 +618,18 @@ public class NornilsGarden extends Quest
 		if (Util.contains(_final_gates, npc.getNpcId()))
 		{
 			QuestState cst = player.getQuestState("179_IntoTheLargeCavern");
-			if (cst != null && cst.getState() == State.STARTED)
+			if ((cst != null) && (cst.getState() == State.STARTED))
 			{
-				return npc.getNpcId()+"-01.html";
+				return npc.getNpcId() + "-01.html";
 			}
 			return getNoQuestMsg(player);
 		}
-
+		
 		return null;
 	}
-
+	
 	@Override
-	public final String onFirstTalk (L2Npc npc, L2PcInstance player)
+	public final String onFirstTalk(L2Npc npc, L2PcInstance player)
 	{
 		QuestState st = player.getQuestState(qn);
 		if (st == null)
@@ -569,38 +637,40 @@ public class NornilsGarden extends Quest
 			Quest q = QuestManager.getInstance().getQuest(qn);
 			st = q.newQuestState(player);
 		}
-		return npc.getNpcId()+".html";
+		return npc.getNpcId() + ".html";
 	}
-
+	
 	@Override
 	public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
 	{
-		if (npc.getNpcId() == _herb_jar && !npc.isDead())
+		if ((npc.getNpcId() == _herb_jar) && !npc.isDead())
 		{
 			dropHerb(npc, attacker, HP_HERBS_DROPLIST);
 			dropHerb(npc, attacker, MP_HERBS_DROPLIST);
-			npc.doDie(attacker);			
+			npc.doDie(attacker);
 		}
-		else if (npc.getNpcId() == 18362 && npc.getInstanceId() > 0)
+		else if ((npc.getNpcId() == 18362) && (npc.getInstanceId() > 0))
 		{
 			spawn1(npc);
 		}
 		return null;
 	}
-
+	
 	@Override
 	public final String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
 	{
 		QuestState st = player.getQuestState(qn);
 		if (st == null)
+		{
 			return null;
-
+		}
+		
 		for (int _gk[] : _gatekeepers)
 		{
 			if (npc.getNpcId() == _gk[0])
 			{
 				// Drop key
-				((L2MonsterInstance)npc).dropItem(player, _gk[1], 1);
+				((L2MonsterInstance) npc).dropItem(player, _gk[1], 1);
 				
 				// Check if gatekeeper should open bridge, and open it
 				if (_gk[2] > 0)
@@ -617,31 +687,36 @@ public class NornilsGarden extends Quest
 					}
 				}
 			}
-			if(npc.getNpcId() == 18355)
+			if (npc.getNpcId() == 18355)
+			{
 				spawn2(npc);
+			}
 		}
 		return super.onKill(npc, player, isPet);
 	}
-
+	
 	public NornilsGarden(int questId, String name, String descr)
 	{
 		super(questId, name, descr);
-
+		
 		addStartNpc(_garden_guard);
 		addFirstTalkId(_garden_guard);
 		addTalkId(_garden_guard);
-
-		for(int i[] : _gatekeepers)
+		
+		for (int i[] : _gatekeepers)
+		{
 			addKillId(i[0]);
-		for(int i[] : _auto_gates)
+		}
+		for (int i[] : _auto_gates)
+		{
 			addEnterZoneId(i[0]);
-		for(int i : _final_gates)
-			addTalkId(i);
+		}
+		addTalkId(_final_gates);
 		
 		addAttackId(_herb_jar);
 		addAttackId(18362); // first garden guard
 	}
-
+	
 	public static void main(String[] args)
 	{
 		new NornilsGarden(-1, qn, "instances");

+ 180 - 95
L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaDevilsLegacy.java

@@ -43,21 +43,32 @@ import com.l2jserver.util.Rnd;
 public class PailakaDevilsLegacy extends Quest
 {
 	private static final String qn = "129_PailakaDevilsLegacy";
-
+	
 	protected static final Logger _log = Logger.getLogger(PailakaDevilsLegacy.class.getName());
 	
 	private static final int MIN_LEVEL = 61;
 	private static final int MAX_LEVEL = 67;
 	private static final int EXIT_TIME = 5;
 	private static final int INSTANCE_ID = 44;
-	private static final int[] TELEPORT = { 76428, -219038, -3752 };
+	private static final int[] TELEPORT =
+	{
+		76428,
+		-219038,
+		-3752
+	};
 	private static final int ZONE = 20109;
-
+	
 	private static final int SURVIVOR = 32498;
 	private static final int SUPPORTER = 32501;
 	private static final int ADVENTURER1 = 32508;
 	private static final int ADVENTURER2 = 32511;
-	private static final int[] NPCS = { SURVIVOR, SUPPORTER, ADVENTURER1, ADVENTURER2 };
+	private static final int[] NPCS =
+	{
+		SURVIVOR,
+		SUPPORTER,
+		ADVENTURER1,
+		ADVENTURER2
+	};
 	
 	private static final int KAMS = 18629;
 	private static final int HIKORO = 18630;
@@ -68,9 +79,22 @@ public class PailakaDevilsLegacy extends Quest
 	private static final int TREASURE_BOX = 32495;
 	private static final int POWDER_KEG = 18622;
 	private static final int[] MONSTERS =
-	{ KAMS, HIKORO, ALKASO, GERBERA, LEMATAN, FOLLOWERS, TREASURE_BOX, POWDER_KEG,
-		18623, 18624, 18625, 18626, 18627 };
-
+	{
+		KAMS,
+		HIKORO,
+		ALKASO,
+		GERBERA,
+		LEMATAN,
+		FOLLOWERS,
+		TREASURE_BOX,
+		POWDER_KEG,
+		18623,
+		18624,
+		18625,
+		18626,
+		18627
+	};
+	
 	private static final int SWORD = 13042;
 	private static final int ENH_SWORD1 = 13043;
 	private static final int ENH_SWORD2 = 13044;
@@ -86,35 +110,57 @@ public class PailakaDevilsLegacy extends Quest
 	private static boolean _isOnShip = false;
 	private static L2Npc _lematanNpc = null;
 	private List<L2Npc> _followerslist;
-
-	private static final int[] ITEMS = { SWORD, ENH_SWORD1, ENH_SWORD2, SCROLL_1, SCROLL_2, HEALING_POTION, ANTIDOTE_POTION, DIVINE_POTION, DEFENCE_POTION, PAILAKA_KEY };
-
+	
+	private static final int[] ITEMS =
+	{
+		SWORD,
+		ENH_SWORD1,
+		ENH_SWORD2,
+		SCROLL_1,
+		SCROLL_2,
+		HEALING_POTION,
+		ANTIDOTE_POTION,
+		DIVINE_POTION,
+		DEFENCE_POTION,
+		PAILAKA_KEY
+	};
+	
+	// @formatter:off
 	private static final int[][] DROPLIST =
 	{
 		// must be sorted by npcId !
 		// npcId, itemId, chance, max
-		{ TREASURE_BOX,  HEALING_POTION, 20 },
-		{ TREASURE_BOX,   DIVINE_POTION, 40 },
-		{ TREASURE_BOX,  DEFENCE_POTION, 60 },
-		{ TREASURE_BOX,     PAILAKA_KEY, 80 },
-		{ TREASURE_BOX, ANTIDOTE_POTION,100 }
+		{ TREASURE_BOX, HEALING_POTION, 20 },
+		{ TREASURE_BOX, DIVINE_POTION, 40 },
+		{ TREASURE_BOX, DEFENCE_POTION, 60 },
+		{ TREASURE_BOX, PAILAKA_KEY, 80 },
+		{ TREASURE_BOX, ANTIDOTE_POTION, 100 }
 	};
-
+	
 	private static final int[][] HP_HERBS_DROPLIST = 
 	{
 		// itemId, count, chance
-		{ 8602, 1, 10 }, { 8601, 1, 40 }, { 8600, 1, 70 }
+		{ 8602, 1, 10 },
+		{ 8601, 1, 40 },
+		{ 8600, 1, 70 }
 	};
-
+	
 	private static final int[][] MP_HERBS_DROPLIST =
 	{
 		// itemId, count, chance
-		{ 8605, 1, 10 }, { 8604, 1, 40 }, { 8603, 1, 70 }
+		{ 8605, 1, 10 },
+		{ 8604, 1, 40 },
+		{ 8603, 1, 70 }
 	};
-
-	private static final int[] REWARDS = { 13295, 13129 };
-
-	private static final int[][] FOLLOWERS_SPAWNS = {
+	
+	private static final int[] REWARDS =
+	{
+		13295,
+		13129
+	};
+	
+	private static final int[][] FOLLOWERS_SPAWNS =
+	{
 		{ 85067, -208943, -3336, 20106, 60 },
 		{ 84904, -208944, -3336, 10904, 60 },
 		{ 85062, -208538, -3336, 44884, 60 },
@@ -124,6 +170,7 @@ public class PailakaDevilsLegacy extends Quest
 		{ 85144, -208855, -3341, 33380, 60 },
 		{ 85139, -208630, -3339, 31777, 60 }		
 	};
+	// @formatter:on
 	
 	private static L2Skill boom_skill = SkillTable.getInstance().getInfo(5714, 1);
 	private static L2Skill energy_skill = SkillTable.getInstance().getInfo(5712, 1);
@@ -134,50 +181,51 @@ public class PailakaDevilsLegacy extends Quest
 		npc.addDamageHate(attacker, 0, 999);
 		npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
 	}
-
+	
 	private static final void dropHerb(L2Npc mob, L2PcInstance player, int[][] drop)
 	{
 		final int chance = Rnd.get(100);
-		for (int i = 0; i < drop.length; i++)
+		for (int[] element : drop)
 		{
-			if (chance < drop[i][2])
+			if (chance < element[2])
 			{
-				((L2MonsterInstance)mob).dropItem(player, drop[i][0], drop[i][1]);
+				((L2MonsterInstance) mob).dropItem(player, element[0], element[1]);
 				return;
 			}
 		}
 	}
-
+	
 	private static final void dropItem(L2Npc mob, L2PcInstance player)
 	{
 		final int npcId = mob.getNpcId();
 		final int chance = Rnd.get(100);
-		for (int i = 0; i < DROPLIST.length; i++)
+		for (int[] drop : DROPLIST)
 		{
-			int[] drop = DROPLIST[i];
 			if (npcId == drop[0])
 			{
 				if (chance < drop[2])
 				{
-					((L2MonsterInstance)mob).dropItem(player, drop[1], Rnd.get(1,6));
+					((L2MonsterInstance) mob).dropItem(player, drop[1], Rnd.get(1, 6));
 					return;
 				}
 			}
 			if (npcId < drop[0])
+			{
 				return; // not found
+			}
 		}
 	}
-
+	
 	private static final void teleportPlayer(L2PcInstance player, int[] coords, int instanceId)
 	{
 		player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
 		player.setInstanceId(instanceId);
 		player.teleToLocation(coords[0], coords[1], coords[2], true);
 	}
-
+	
 	private final synchronized void enterInstance(L2PcInstance player)
 	{
-		//check for existing instances for this player
+		// check for existing instances for this player
 		InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
 		if (world != null)
 		{
@@ -188,55 +236,59 @@ public class PailakaDevilsLegacy extends Quest
 			}
 			Instance inst = InstanceManager.getInstance().getInstance(world.instanceId);
 			if (inst != null)
+			{
 				teleportPlayer(player, TELEPORT, world.instanceId);
+			}
 			return;
 		}
-		//New instance
+		// New instance
 		final int instanceId = InstanceManager.getInstance().createDynamicInstance("PailakaDevilsLegacy.xml");
-
+		
 		world = new InstanceWorld();
 		world.instanceId = instanceId;
 		world.templateId = INSTANCE_ID;
 		InstanceManager.getInstance().addWorld(world);
-
+		
 		world.allowed.add(player.getObjectId());
 		teleportPlayer(player, TELEPORT, instanceId);
 		
 		_lematanNpc = addSpawn(LEMATAN, 88108, -209252, -3744, 64255, false, 0, false, instanceId);
 		
 	}
-
+	
 	@Override
 	public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
 	{
 		// Must be here, because of player == null
-		if (npc.getNpcId() == FOLLOWERS && event.equals("follower_cast"))
+		if ((npc.getNpcId() == FOLLOWERS) && event.equals("follower_cast"))
 		{
 			if (!npc.isCastingNow() && !npc.isDead() && !_lematanNpc.isDead())
 			{
 				npc.setTarget(_lematanNpc);
 				npc.doCast(energy_skill);
 			}
-			startQuestTimer("follower_cast", 2000+Rnd.get(100, 1000), npc, null);
+			startQuestTimer("follower_cast", 2000 + Rnd.get(100, 1000), npc, null);
 			return null;
 		}
-		else if (npc.getNpcId() == POWDER_KEG && event.equalsIgnoreCase("keg_trigger"))
+		else if ((npc.getNpcId() == POWDER_KEG) && event.equalsIgnoreCase("keg_trigger"))
 		{
 			onAttack(npc, player, 600, false);
 		}
 		
 		final QuestState st = player.getQuestState(qn);
 		if (st == null)
+		{
 			return getNoQuestMsg(player);
-
+		}
+		
 		final int cond = st.getInt("cond");
 		
 		if (event.equalsIgnoreCase("enter"))
 		{
 			enterInstance(player);
-			if(st.getInt("cond") == 1)
+			if (st.getInt("cond") == 1)
 			{
-				st.set("cond","2");
+				st.set("cond", "2");
 				return "32498-07.htm";
 			}
 			return "32498-09.htm";
@@ -245,7 +297,7 @@ public class PailakaDevilsLegacy extends Quest
 		{
 			if (cond == 0)
 			{
-				st.set("cond","1");
+				st.set("cond", "1");
 				st.setState(State.STARTED);
 				st.playSound("ItemSound.quest_accept");
 			}
@@ -255,7 +307,7 @@ public class PailakaDevilsLegacy extends Quest
 			if (cond == 2)
 			{
 				st.giveItems(SWORD, 1);
-				st.set("cond","3");
+				st.set("cond", "3");
 				st.playSound("ItemSound.quest_middle");
 			}
 		}
@@ -264,37 +316,41 @@ public class PailakaDevilsLegacy extends Quest
 			st.unset("cond");
 			st.playSound("ItemSound.quest_finish");
 			st.exitQuest(false);
-
+			
 			Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
 			inst.setDuration(EXIT_TIME * 60000);
 			inst.setEmptyDestroyTime(0);
-
+			
 			if (inst.containsPlayer(player.getObjectId()))
 			{
 				player.setVitalityPoints(20000, true);
 				st.addExpAndSp(810000, 50000);
 				for (int id : REWARDS)
+				{
 					st.giveItems(id, 1);
+				}
 			}
 		}
 		else if (event.equalsIgnoreCase("lematan_teleport"))
 		{
-			if (npc.getNpcId() == LEMATAN && !npc.isMovementDisabled()&& !_isOnShip)
+			if ((npc.getNpcId() == LEMATAN) && !npc.isMovementDisabled() && !_isOnShip)
 			{
 				// Reduce Hate
-				((L2Attackable)npc).reduceHate(player, 9999);
-				((L2Attackable)npc).abortAttack();
-				((L2Attackable)npc).abortCast();
+				((L2Attackable) npc).reduceHate(player, 9999);
+				((L2Attackable) npc).abortAttack();
+				((L2Attackable) npc).abortCast();
 				// Broadcast Escape
 				npc.broadcastPacket(new MagicSkillUse(npc, 2100, 1, 1000, 0));
 				// Schedule telport - when Lematan Finish casting
 				startQuestTimer("lematan_finish_teleport", 1500, npc, player);
 			}
 			else
+			{
 				_isTeleportScheduled = false;
+			}
 			return null;
 		}
-		else if (npc.getNpcId() == LEMATAN && event.equalsIgnoreCase("lematan_finish_teleport") && !_isOnShip)
+		else if ((npc.getNpcId() == LEMATAN) && event.equalsIgnoreCase("lematan_finish_teleport") && !_isOnShip)
 		{
 			// Teleport Lematan
 			npc.teleToLocation(84973, -208721, -3340);
@@ -305,37 +361,42 @@ public class PailakaDevilsLegacy extends Quest
 			npc.getSpawn().setLocy(-208721);
 			npc.getSpawn().setLocz(-3340);
 			// To be sure, reduce again
-			((L2Attackable)npc).reduceHate(player, 9999);
+			((L2Attackable) npc).reduceHate(player, 9999);
 			// Spawn followers
 			_followerslist = new FastList<L2Npc>();
-			for (int i = 0; i < FOLLOWERS_SPAWNS.length; i++)
+			for (int[] SPAWN : FOLLOWERS_SPAWNS)
 			{
-				int[] SPAWN = FOLLOWERS_SPAWNS[i];
 				L2Npc _follower = addSpawn(FOLLOWERS, SPAWN[0], SPAWN[1], SPAWN[2], SPAWN[3], false, 0, true, player.getInstanceId());
 				if (_follower != null)
+				{
 					_followerslist.add(_follower);
+				}
 			}
 			return null;
 		}
 		return event;
 	}
-
+	
 	@Override
 	public final String onFirstTalk(L2Npc npc, L2PcInstance player)
 	{
 		final QuestState st = player.getQuestState(qn);
-		if (st != null && npc.getNpcId() == ADVENTURER2 && st.isCompleted())
+		if ((st != null) && (npc.getNpcId() == ADVENTURER2) && st.isCompleted())
+		{
 			return "32511-03.htm";
+		}
 		return npc.getNpcId() + ".htm";
 	}
-
+	
 	@Override
 	public final String onTalk(L2Npc npc, L2PcInstance player)
 	{
 		final QuestState st = player.getQuestState(qn);
 		if (st == null)
+		{
 			return getNoQuestMsg(player);
-
+		}
+		
 		final int cond = st.getInt("cond");
 		switch (npc.getNpcId())
 		{
@@ -344,13 +405,19 @@ public class PailakaDevilsLegacy extends Quest
 				{
 					case State.CREATED:
 						if (player.getLevel() < MIN_LEVEL)
+						{
 							return "32498-11.htm";
+						}
 						if (player.getLevel() > MAX_LEVEL)
+						{
 							return "32498-12.htm";
+						}
 						return "32498-01.htm";
 					case State.STARTED:
 						if (cond > 1)
+						{
 							return "32498-08.htm";
+						}
 						return "32498-06.htm";
 					case State.COMPLETED:
 						return "32498-10.htm";
@@ -358,15 +425,17 @@ public class PailakaDevilsLegacy extends Quest
 						return "32498-01.htm";
 				}
 			case SUPPORTER:
-				if(st.getInt("cond") > 2)
+				if (st.getInt("cond") > 2)
+				{
 					return "32501-04.htm";
+				}
 				return "32501-01.htm";
 			case ADVENTURER1:
-				if(player.getPet() == null)
+				if (player.getPet() == null)
 				{
 					if (st.hasQuestItems(SWORD))
 					{
-						if(st.getQuestItemsCount(SCROLL_1) > 0)
+						if (st.getQuestItemsCount(SCROLL_1) > 0)
 						{
 							st.takeItems(SWORD, -1);
 							st.takeItems(SCROLL_1, -1);
@@ -377,7 +446,7 @@ public class PailakaDevilsLegacy extends Quest
 					}
 					else if (st.getQuestItemsCount(ENH_SWORD1) > 0)
 					{
-						if(st.getQuestItemsCount(SCROLL_2) > 0)
+						if (st.getQuestItemsCount(SCROLL_2) > 0)
 						{
 							st.takeItems(ENH_SWORD1, -1);
 							st.takeItems(SCROLL_2, -1);
@@ -387,9 +456,13 @@ public class PailakaDevilsLegacy extends Quest
 						return "32508-04.htm";
 					}
 					else if (st.getQuestItemsCount(ENH_SWORD2) > 0)
+					{
 						return "32508-06.htm";
+					}
 					else
+					{
 						return "32508-00.htm";
+					}
 				}
 				return "32508-07.htm";
 			case ADVENTURER2:
@@ -398,17 +471,19 @@ public class PailakaDevilsLegacy extends Quest
 					st.unset("cond");
 					st.playSound("ItemSound.quest_finish");
 					st.exitQuest(false);
-
+					
 					Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
 					inst.setDuration(EXIT_TIME * 60000);
 					inst.setEmptyDestroyTime(0);
-
+					
 					if (inst.containsPlayer(player.getObjectId()))
 					{
 						player.setVitalityPoints(20000, true);
 						st.addExpAndSp(10800000, 950000);
 						for (int id : REWARDS)
+						{
 							st.giveItems(id, 1);
+						}
 					}
 					return "32511-01.htm";
 				}
@@ -416,40 +491,46 @@ public class PailakaDevilsLegacy extends Quest
 		}
 		return getNoQuestMsg(player);
 	}
-
+	
 	@Override
 	public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
 	{
-		if(npc.getNpcId() == POWDER_KEG && !npc.isDead())
+		if ((npc.getNpcId() == POWDER_KEG) && !npc.isDead())
 		{
 			npc.doCast(boom_skill);
 			
-			if( npc.getKnownList() != null)
-			{				
+			if (npc.getKnownList() != null)
+			{
 				for (L2Character target : npc.getKnownList().getKnownCharactersInRadius(900))
 				{
-					target.reduceCurrentHp(500+Rnd.get(0,200), npc, boom_skill);
-
+					target.reduceCurrentHp(500 + Rnd.get(0, 200), npc, boom_skill);
+					
 					if (target instanceof L2MonsterInstance)
 					{
-						if (((L2MonsterInstance) target).getNpcId() == POWDER_KEG )
+						if (((L2MonsterInstance) target).getNpcId() == POWDER_KEG)
 						{
-							startQuestTimer("keg_trigger", 500, (L2Npc)target, attacker);							
+							startQuestTimer("keg_trigger", 500, (L2Npc) target, attacker);
 						}
 						else
 						{
-							if(isPet)
+							if (isPet)
+							{
 								attackPlayer((L2Attackable) npc, attacker.getPet());
+							}
 							else
+							{
 								attackPlayer((L2Attackable) npc, attacker);
+							}
 						}
 					}
 				}
 			}
 			if (!npc.isDead())
+			{
 				npc.doDie(attacker);
+			}
 		}
-		else if (npc.getNpcId() == LEMATAN && npc.getCurrentHp() < (npc.getMaxHp()/2) && !_isTeleportScheduled)
+		else if ((npc.getNpcId() == LEMATAN) && (npc.getCurrentHp() < (npc.getMaxHp() / 2)) && !_isTeleportScheduled)
 		{
 			startQuestTimer("lematan_teleport", 1000, npc, attacker);
 		}
@@ -458,18 +539,19 @@ public class PailakaDevilsLegacy extends Quest
 			dropItem(npc, attacker);
 			npc.doDie(attacker);
 		}
-
-
+		
 		return super.onAttack(npc, attacker, damage, isPet);
 	}
-
+	
 	@Override
 	public final String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
 	{
 		QuestState st = player.getQuestState(qn);
-		if (st == null || st.getState() != State.STARTED)
+		if ((st == null) || (st.getState() != State.STARTED))
+		{
 			return null;
-
+		}
+		
 		switch (npc.getNpcId())
 		{
 			case KAMS:
@@ -487,10 +569,12 @@ public class PailakaDevilsLegacy extends Quest
 				}
 				break;
 			case LEMATAN:
-				if (_followerslist != null && !_followerslist.isEmpty())
+				if ((_followerslist != null) && !_followerslist.isEmpty())
 				{
 					for (L2Npc _follower : _followerslist)
+					{
 						_follower.deleteMe();
+					}
 					_followerslist.clear();
 				}
 				st.set("cond", "4");
@@ -514,7 +598,7 @@ public class PailakaDevilsLegacy extends Quest
 	@Override
 	public final String onSpawn(L2Npc npc)
 	{
-		startQuestTimer("follower_cast", 1000+Rnd.get(100, 1000), npc, null);
+		startQuestTimer("follower_cast", 1000 + Rnd.get(100, 1000), npc, null);
 		npc.disableCoreAI(true);
 		return null;
 	}
@@ -522,35 +606,34 @@ public class PailakaDevilsLegacy extends Quest
 	@Override
 	public String onEnterZone(L2Character character, L2ZoneType zone)
 	{
-		if (character instanceof L2PcInstance
-				&& !character.isDead()
-				&& !character.isTeleporting()
-				&& ((L2PcInstance)character).isOnline())
+		if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
 		{
 			InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
-			if (world != null && world.templateId == INSTANCE_ID)
+			if ((world != null) && (world.templateId == INSTANCE_ID))
+			{
 				ThreadPoolManager.getInstance().scheduleGeneral(new Teleport(character, world.instanceId), 1000);
+			}
 		}
-		return super.onEnterZone(character,zone);
+		return super.onEnterZone(character, zone);
 	}
-
+	
 	static final class Teleport implements Runnable
 	{
 		private final L2Character _char;
 		private final int _instanceId;
-
+		
 		public Teleport(L2Character c, int id)
 		{
 			_char = c;
 			_instanceId = id;
 		}
-
+		
 		@Override
 		public void run()
 		{
 			try
 			{
-				teleportPlayer((L2PcInstance)_char, TELEPORT, _instanceId);
+				teleportPlayer((L2PcInstance) _char, TELEPORT, _instanceId);
 			}
 			catch (Exception e)
 			{
@@ -558,7 +641,7 @@ public class PailakaDevilsLegacy extends Quest
 			}
 		}
 	}
-
+	
 	public PailakaDevilsLegacy(int questId, String name, String descr)
 	{
 		super(questId, name, descr);
@@ -572,13 +655,15 @@ public class PailakaDevilsLegacy extends Quest
 		addAttackId(POWDER_KEG);
 		addAttackId(LEMATAN);
 		for (int mobId : MONSTERS)
+		{
 			addKillId(mobId);
+		}
 		addEnterZoneId(ZONE);
 		addSpawnId(FOLLOWERS);
 		
 		questItemIds = ITEMS;
 	}
-
+	
 	public static void main(String[] args)
 	{
 		new PailakaDevilsLegacy(129, qn, "Pailaka - Devil's Legacy");

+ 151 - 42
L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaSongOfIceAndFire.java

@@ -28,7 +28,6 @@ import com.l2jserver.gameserver.model.quest.QuestState;
 import com.l2jserver.gameserver.model.quest.State;
 import com.l2jserver.gameserver.model.zone.L2ZoneType;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.util.Rnd;
 
 public class PailakaSongOfIceAndFire extends Quest
 {
@@ -38,14 +37,25 @@ public class PailakaSongOfIceAndFire extends Quest
 	private static final int MAX_LEVEL = 42;
 	private static final int EXIT_TIME = 5;
 	private static final int INSTANCE_ID = 43;
-	private static final int[] TELEPORT = { -52875, 188232, -4696 };
+	private static final int[] TELEPORT =
+	{
+		-52875,
+		188232,
+		-4696
+	};
 	private static final int ZONE = 20108;
 	
 	private static final int ADLER1 = 32497;
 	private static final int ADLER2 = 32510;
 	private static final int SINAI = 32500;
 	private static final int INSPECTOR = 32507;
-	private static final int[] NPCS = { ADLER1, ADLER2, SINAI, INSPECTOR };
+	private static final int[] NPCS =
+	{
+		ADLER1,
+		ADLER2,
+		SINAI,
+		INSPECTOR
+	};
 	
 	private static final int HILLAS = 18610;
 	private static final int PAPION = 18609;
@@ -56,8 +66,21 @@ public class PailakaSongOfIceAndFire extends Quest
 	private static final int BOTTLE = 32492;
 	private static final int BRAZIER = 32493;
 	private static final int[] MONSTERS =
-	{ HILLAS, PAPION, KINSUS, GARGOS, ADIANTUM, BLOOM, BOTTLE, BRAZIER,
-		18611, 18612, 18613, 18614, 18615 };
+	{
+		HILLAS,
+		PAPION,
+		KINSUS,
+		GARGOS,
+		ADIANTUM,
+		BLOOM,
+		BOTTLE,
+		BRAZIER,
+		18611,
+		18612,
+		18613,
+		18614,
+		18615
+	};
 	
 	private static final int SWORD = 13034;
 	private static final int ENH_SWORD1 = 13035;
@@ -75,45 +98,105 @@ public class PailakaSongOfIceAndFire extends Quest
 	private static final int HEAL_POTION = 13033;
 	private static final int FIRE_ENHANCER = 13040;
 	private static final int WATER_ENHANCER = 13041;
-	private static final int[] ITEMS = { SWORD, ENH_SWORD1, ENH_SWORD2, BOOK1, BOOK2, BOOK3, BOOK4, BOOK5, BOOK6, BOOK7,
-		WATER_ESSENCE, FIRE_ESSENCE, SHIELD_POTION, HEAL_POTION, FIRE_ENHANCER, WATER_ENHANCER };
+	private static final int[] ITEMS =
+	{
+		SWORD,
+		ENH_SWORD1,
+		ENH_SWORD2,
+		BOOK1,
+		BOOK2,
+		BOOK3,
+		BOOK4,
+		BOOK5,
+		BOOK6,
+		BOOK7,
+		WATER_ESSENCE,
+		FIRE_ESSENCE,
+		SHIELD_POTION,
+		HEAL_POTION,
+		FIRE_ENHANCER,
+		WATER_ENHANCER
+	};
 	
+	// @formatter:off
 	private static final int[][] DROPLIST =
 	{
 		// must be sorted by npcId !
 		// npcId, itemId, chance
-		{ BLOOM,   SHIELD_POTION, 30 },
-		{ BLOOM,     HEAL_POTION, 80 },
-		{ BOTTLE,  SHIELD_POTION, 10 },
-		{ BOTTLE, WATER_ENHANCER, 40 },
-		{ BOTTLE,    HEAL_POTION, 80 },
-		{ BRAZIER, SHIELD_POTION, 10 },
-		{ BRAZIER, FIRE_ENHANCER, 40 },
-		{ BRAZIER,   HEAL_POTION, 80 }
+		{
+			BLOOM, SHIELD_POTION, 30
+		},
+		{
+			BLOOM, HEAL_POTION, 80
+		},
+		{
+			BOTTLE, SHIELD_POTION, 10
+		},
+		{
+			BOTTLE, WATER_ENHANCER, 40
+		},
+		{
+			BOTTLE, HEAL_POTION, 80
+		},
+		{
+			BRAZIER, SHIELD_POTION, 10
+		},
+		{
+			BRAZIER, FIRE_ENHANCER, 40
+		},
+		{
+			BRAZIER, HEAL_POTION, 80
+		}
 	};
 	
+	/**
+	 * itemId, count, chance
+	 */
 	private static final int[][] HP_HERBS_DROPLIST =
 	{
-		// itemId, count, chance
-		{ 8602, 1, 10 }, { 8601, 1, 40 }, { 8600, 1, 70 }
+		{
+			8602, 1, 10
+		},
+		{
+			8601, 1, 40
+		},
+		{
+			8600, 1, 70
+		}
 	};
 	
+	/**
+	 * itemId, count, chance
+	 */
 	private static final int[][] MP_HERBS_DROPLIST =
 	{
-		// itemId, count, chance
-		{ 8605, 1, 10 }, { 8604, 1, 40 }, { 8603, 1, 70 }
+		{
+			8605, 1, 10
+		},
+		{
+			8604, 1, 40
+		},
+		{
+			8603, 1, 70
+		}
 	};
+	// @formatter:on
 	
-	private static final int[] REWARDS = { 13294, 13293, 13129 };
+	private static final int[] REWARDS =
+	{
+		13294,
+		13293,
+		13129
+	};
 	
 	private static final void dropHerb(L2Npc mob, L2PcInstance player, int[][] drop)
 	{
-		final int chance = Rnd.get(100);
-		for (int i = 0; i < drop.length; i++)
+		final int chance = getRandom(100);
+		for (int[] element : drop)
 		{
-			if (chance < drop[i][2])
+			if (chance < element[2])
 			{
-				((L2MonsterInstance)mob).dropItem(player, drop[i][0], drop[i][1]);
+				((L2MonsterInstance) mob).dropItem(player, element[0], element[1]);
 				return;
 			}
 		}
@@ -122,20 +205,21 @@ public class PailakaSongOfIceAndFire extends Quest
 	private static final void dropItem(L2Npc mob, L2PcInstance player)
 	{
 		final int npcId = mob.getNpcId();
-		final int chance = Rnd.get(100);
-		for (int i = 0; i < DROPLIST.length; i++)
+		final int chance = getRandom(100);
+		for (int[] drop : DROPLIST)
 		{
-			int[] drop = DROPLIST[i];
 			if (npcId == drop[0])
 			{
 				if (chance < drop[2])
 				{
-					((L2MonsterInstance)mob).dropItem(player, drop[1], Rnd.get(1,6));
+					((L2MonsterInstance) mob).dropItem(player, drop[1], getRandom(1, 6));
 					return;
 				}
 			}
 			if (npcId < drop[0])
+			{
 				return; // not found
+			}
 		}
 	}
 	
@@ -148,7 +232,7 @@ public class PailakaSongOfIceAndFire extends Quest
 	
 	private final synchronized void enterInstance(L2PcInstance player)
 	{
-		//check for existing instances for this player
+		// check for existing instances for this player
 		InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
 		if (world != null)
 		{
@@ -159,10 +243,12 @@ public class PailakaSongOfIceAndFire extends Quest
 			}
 			Instance inst = InstanceManager.getInstance().getInstance(world.instanceId);
 			if (inst != null)
+			{
 				teleportPlayer(player, TELEPORT, world.instanceId);
+			}
 			return;
 		}
-		//New instance
+		// New instance
 		final int instanceId = InstanceManager.getInstance().createDynamicInstance("PailakaSongOfIceAndFire.xml");
 		
 		world = new InstanceWorld();
@@ -180,7 +266,9 @@ public class PailakaSongOfIceAndFire extends Quest
 	{
 		final QuestState st = player.getQuestState(qn);
 		if (st == null)
+		{
 			return getNoQuestMsg(player);
+		}
 		
 		final int cond = st.getInt("cond");
 		if (event.equalsIgnoreCase("enter"))
@@ -192,7 +280,7 @@ public class PailakaSongOfIceAndFire extends Quest
 		{
 			if (cond == 0)
 			{
-				st.set("cond","1");
+				st.set("cond", "1");
 				st.setState(State.STARTED);
 				st.playSound("ItemSound.quest_accept");
 			}
@@ -201,7 +289,7 @@ public class PailakaSongOfIceAndFire extends Quest
 		{
 			if (cond == 1)
 			{
-				st.set("cond","2");
+				st.set("cond", "2");
 				st.playSound("ItemSound.quest_itemget");
 				st.giveItems(SWORD, 1);
 				st.giveItems(BOOK1, 1);
@@ -211,7 +299,7 @@ public class PailakaSongOfIceAndFire extends Quest
 		{
 			if (cond == 3)
 			{
-				st.set("cond","4");
+				st.set("cond", "4");
 				st.playSound("ItemSound.quest_middle");
 				st.takeItems(SWORD, -1);
 				st.takeItems(WATER_ESSENCE, -1);
@@ -224,7 +312,7 @@ public class PailakaSongOfIceAndFire extends Quest
 		{
 			if (cond == 6)
 			{
-				st.set("cond","7");
+				st.set("cond", "7");
 				st.playSound("ItemSound.quest_itemget");
 				st.takeItems(ENH_SWORD1, -1);
 				st.takeItems(BOOK5, -1);
@@ -248,7 +336,9 @@ public class PailakaSongOfIceAndFire extends Quest
 				player.setVitalityPoints(20000, true);
 				st.addExpAndSp(810000, 50000);
 				for (int id : REWARDS)
+				{
 					st.giveItems(id, 1);
+				}
 			}
 		}
 		return event;
@@ -265,7 +355,9 @@ public class PailakaSongOfIceAndFire extends Quest
 	{
 		final QuestState st = player.getQuestState(qn);
 		if (st == null)
+		{
 			return getNoQuestMsg(player);
+		}
 		
 		final int cond = st.getInt("cond");
 		switch (npc.getNpcId())
@@ -275,13 +367,19 @@ public class PailakaSongOfIceAndFire extends Quest
 				{
 					case State.CREATED:
 						if (player.getLevel() < MIN_LEVEL)
+						{
 							return "32497-05.htm";
+						}
 						if (player.getLevel() > MAX_LEVEL)
+						{
 							return "32497-06.htm";
+						}
 						return "32497-01.htm";
 					case State.STARTED:
 						if (cond > 1)
+						{
 							return "32497-00.htm";
+						}
 						return "32497-03.htm";
 					case State.COMPLETED:
 						return "32497-07.htm";
@@ -290,7 +388,9 @@ public class PailakaSongOfIceAndFire extends Quest
 				}
 			case SINAI:
 				if (cond > 1)
+				{
 					return "32500-00.htm";
+				}
 				return "32500-01.htm";
 			case INSPECTOR:
 				switch (st.getInt("cond"))
@@ -311,9 +411,13 @@ public class PailakaSongOfIceAndFire extends Quest
 				}
 			case ADLER2:
 				if (st.getState() == State.COMPLETED)
+				{
 					return "32510-00.htm";
+				}
 				else if (cond == 9)
+				{
 					return "32510-01.htm";
+				}
 		}
 		return getNoQuestMsg(player);
 	}
@@ -322,7 +426,9 @@ public class PailakaSongOfIceAndFire extends Quest
 	public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
 	{
 		if (!npc.isDead())
+		{
 			npc.doDie(attacker);
+		}
 		
 		return super.onAttack(npc, attacker, damage, isPet);
 	}
@@ -331,8 +437,10 @@ public class PailakaSongOfIceAndFire extends Quest
 	public final String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
 	{
 		QuestState st = player.getQuestState(qn);
-		if (st == null || st.getState() != State.STARTED)
+		if ((st == null) || (st.getState() != State.STARTED))
+		{
 			return null;
+		}
 		
 		final int cond = st.getInt("cond");
 		switch (npc.getNpcId())
@@ -405,16 +513,15 @@ public class PailakaSongOfIceAndFire extends Quest
 	@Override
 	public String onExitZone(L2Character character, L2ZoneType zone)
 	{
-		if (character instanceof L2PcInstance
-				&& !character.isDead()
-				&& !character.isTeleporting()
-				&& ((L2PcInstance)character).isOnline())
+		if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
 		{
 			InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
-			if (world != null && world.templateId == INSTANCE_ID)
+			if ((world != null) && (world.templateId == INSTANCE_ID))
+			{
 				ThreadPoolManager.getInstance().scheduleGeneral(new Teleport(character, world.instanceId), 1000);
+			}
 		}
-		return super.onExitZone(character,zone);
+		return super.onExitZone(character, zone);
 	}
 	
 	static final class Teleport implements Runnable
@@ -433,7 +540,7 @@ public class PailakaSongOfIceAndFire extends Quest
 		{
 			try
 			{
-				teleportPlayer((L2PcInstance)_char, TELEPORT, _instanceId);
+				teleportPlayer((L2PcInstance) _char, TELEPORT, _instanceId);
 			}
 			catch (Exception e)
 			{
@@ -454,7 +561,9 @@ public class PailakaSongOfIceAndFire extends Quest
 		addAttackId(BOTTLE);
 		addAttackId(BRAZIER);
 		for (int mobId : MONSTERS)
+		{
 			addKillId(mobId);
+		}
 		addExitZoneId(ZONE);
 		questItemIds = ITEMS;
 	}

+ 36 - 20
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodElpies/eventmodElpies.java

@@ -27,7 +27,6 @@ import com.l2jserver.gameserver.model.actor.instance.L2EventMonsterInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.quest.Event;
-import com.l2jserver.util.Rnd;
 
 public class eventmodElpies extends Event
 {
@@ -57,6 +56,8 @@ public class eventmodElpies extends Event
 		"Dion",
 		"Oren"
 	};
+	
+	// @formatter:off
 	private static final int[][] _spawns =
 	{
 		// minx, maxx, miny, maxy, zspawn
@@ -68,8 +69,8 @@ public class eventmodElpies extends Event
 	};
 	
 	/**
-	 * Drop data:<br />
-	 * Higher the chance harder the item.<br />
+	 * Drop data:<br>
+	 * Higher the chance harder the item.<br>
 	 * ItemId, chance in percent, min amount, max amount
 	 */
 	private static final int[][] DROPLIST =
@@ -84,6 +85,7 @@ public class eventmodElpies extends Event
 		{ 20004,   1,  1, 1 },	// Energy Ginseng
 		{ 20004,   0,  1, 1 }	// Energy Ginseng
 	};
+	
 	private static final int[][] DROPLIST_CRYSTALS =
 	{
 		{ 1458, 80, 50, 100 },	// Crystal D-Grade
@@ -92,6 +94,8 @@ public class eventmodElpies extends Event
 		{ 1461, 20, 20,  30 },	// Crystal A-Grade
 		{ 1462,  0, 10,  20 },	// Crystal S-Grade
 	};
+	// @formatter:on
+	
 	public static void main(String[] args)
 	{
 		new eventmodElpies(-1, "eventmodElpies", "mods");
@@ -108,8 +112,8 @@ public class eventmodElpies extends Event
 	@Override
 	public String onSpawn(L2Npc npc)
 	{
-		((L2EventMonsterInstance)npc).eventSetDropOnGround(true);
-		((L2EventMonsterInstance)npc).eventSetBlockOffensiveSkills(true);
+		((L2EventMonsterInstance) npc).eventSetDropOnGround(true);
+		((L2EventMonsterInstance) npc).eventSetBlockOffensiveSkills(true);
 		
 		return super.onSpawn(npc);
 	}
@@ -118,13 +122,13 @@ public class eventmodElpies extends Event
 	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
 	{
 		// Drop only if event is active
-		if(_isactive)
+		if (_isactive)
 		{
 			dropItem(npc, killer, DROPLIST);
 			dropItem(npc, killer, DROPLIST_CRYSTALS);
 			_elpies_count--;
 			
-			if(_elpies_count <= 0)
+			if (_elpies_count <= 0)
 			{
 				Announcements.getInstance().announceToAll("No more elpies...");
 				eventStop();
@@ -139,11 +143,15 @@ public class eventmodElpies extends Event
 	{
 		// Don't start event if its active
 		if (_isactive)
+		{
 			return false;
+		}
 		
 		// Check Custom Table - we use custom NPC's
 		if (!Config.CUSTOM_NPC_TABLE)
+		{
 			return false;
+		}
 		
 		// Initialize list
 		_npclist = new FastList<L2Npc>();
@@ -152,25 +160,25 @@ public class eventmodElpies extends Event
 		_isactive = true;
 		
 		// Spawn Elpy's
-		int location = Rnd.get(0, _locations.length-1);
+		int location = getRandom(0, _locations.length - 1);
 		
 		int[] _spawndata = _spawns[location];
 		
 		_elpies_count = 0;
 		
-		for(int i=0; i < _option_howmuch; i++)
+		for (int i = 0; i < _option_howmuch; i++)
 		{
-			int x = Rnd.get(_spawndata[0], _spawndata[1]);
-			int y = Rnd.get(_spawndata[2], _spawndata[3]);
-			recordSpawn(_elpy, x, y, _spawndata[4], 0, true, _event_time*60*1000);
+			int x = getRandom(_spawndata[0], _spawndata[1]);
+			int y = getRandom(_spawndata[2], _spawndata[3]);
+			recordSpawn(_elpy, x, y, _spawndata[4], 0, true, _event_time * 60 * 1000);
 			_elpies_count++;
 		}
 		
 		// Announce event start
 		Announcements.getInstance().announceToAll("*Squeak Squeak*");
-		Announcements.getInstance().announceToAll("Elpy invasion in "+_locations[location]);
+		Announcements.getInstance().announceToAll("Elpy invasion in " + _locations[location]);
 		Announcements.getInstance().announceToAll("Help us exterminate them!");
-		Announcements.getInstance().announceToAll("You have "+_event_time+" min...");
+		Announcements.getInstance().announceToAll("You have " + _event_time + " min...");
 		
 		// Schedule Event end
 		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
@@ -180,7 +188,7 @@ public class eventmodElpies extends Event
 			{
 				timeUp();
 			}
-		}, _event_time*60*1000);
+		}, _event_time * 60 * 1000);
 		
 		return true;
 	}
@@ -195,8 +203,10 @@ public class eventmodElpies extends Event
 	public boolean eventStop()
 	{
 		// Don't stop inactive event
-		if(!_isactive)
+		if (!_isactive)
+		{
 			return false;
+		}
 		
 		// Set inactive
 		_isactive = false;
@@ -208,11 +218,15 @@ public class eventmodElpies extends Event
 			_eventTask = null;
 		}
 		// Despawn Npc's
-		if(!_npclist.isEmpty())
+		if (!_npclist.isEmpty())
 		{
 			for (L2Npc _npc : _npclist)
+			{
 				if (_npc != null)
+				{
 					_npc.deleteMe();
+				}
+			}
 		}
 		_npclist.clear();
 		
@@ -225,13 +239,13 @@ public class eventmodElpies extends Event
 	
 	private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)
 	{
-		final int chance = Rnd.get(100);
+		final int chance = getRandom(100);
 		
 		for (int[] drop : droplist)
 		{
 			if (chance > drop[1])
 			{
-				((L2MonsterInstance)mob).dropItem(player, drop[0], Rnd.get(drop[2], drop[3]));
+				((L2MonsterInstance) mob).dropItem(player, drop[0], getRandom(drop[2], drop[3]));
 				return;
 			}
 		}
@@ -240,8 +254,10 @@ public class eventmodElpies extends Event
 	private L2Npc recordSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
 	{
 		L2Npc _tmp = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);
-		if(_tmp != null)
+		if (_tmp != null)
+		{
 			_npclist.add(_tmp);
+		}
 		return _tmp;
 	}
 	

+ 45 - 26
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/eventmodRabbits.java

@@ -35,7 +35,6 @@ import com.l2jserver.gameserver.model.quest.Quest;
 import com.l2jserver.gameserver.model.quest.QuestState;
 import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 public class eventmodRabbits extends Event
 {
@@ -52,17 +51,18 @@ public class eventmodRabbits extends Event
 	// How much Chests
 	private static final int _option_howmuch = 100;
 	// NPc's
-	public static final int _npc_snow  = 900101;
+	public static final int _npc_snow = 900101;
 	public static final int _npc_chest = 900102;
 	// Skills
 	public static final int _skill_tornado = 630;
 	public static final int _skill_magic_eye = 629;
 	
 	/**
-	 * Drop data:<br />
-	 * Higher the chance harder the item.<br />
+	 * Drop data:<br>
+	 * Higher the chance harder the item.<br>
 	 * ItemId, chance in percent, min amount, max amount
 	 */
+	// @formatter:off
 	private static final int[][] DROPLIST =
 	{
 		{  1540,  80, 10, 15 },	// Quick Healing Potion
@@ -75,6 +75,7 @@ public class eventmodRabbits extends Event
 		{ 20004,   1,  1, 1 },	// Energy Ginseng
 		{ 20004,   0,  1, 1 }	// Energy Ginseng
 	};
+	// @formatter:on
 	
 	public static void main(String[] args)
 	{
@@ -98,8 +99,8 @@ public class eventmodRabbits extends Event
 	@Override
 	public String onSpawn(L2Npc npc)
 	{
-		((L2EventMonsterInstance)npc).eventSetDropOnGround(true);
-		((L2EventMonsterInstance)npc).eventSetBlockOffensiveSkills(true);
+		((L2EventMonsterInstance) npc).eventSetDropOnGround(true);
+		((L2EventMonsterInstance) npc).eventSetBlockOffensiveSkills(true);
 		
 		npc.setIsImmobilized(true);
 		npc.disableCoreAI(true);
@@ -111,12 +112,16 @@ public class eventmodRabbits extends Event
 	public boolean eventStart()
 	{
 		// Don't start event if its active
-		if(_isactive)
+		if (_isactive)
+		{
 			return false;
+		}
 		
 		// Check Custom Table - we use custom NPC's
 		if (!Config.CUSTOM_NPC_TABLE)
+		{
 			return false;
+		}
 		
 		// Initialize list
 		_npclist = new FastList<L2Npc>();
@@ -128,18 +133,18 @@ public class eventmodRabbits extends Event
 		recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);
 		
 		// Spawn Chests
-		for(int i=0; i < _option_howmuch; i++)
+		for (int i = 0; i < _option_howmuch; i++)
 		{
-			int x = Rnd.get(-60653, -58772);
-			int y = Rnd.get(-55830, -57718);
-			recordSpawn(_npc_chest, x, y, -2030, 0, true, _event_time*60*1000);
+			int x = getRandom(-60653, -58772);
+			int y = getRandom(-55830, -57718);
+			recordSpawn(_npc_chest, x, y, -2030, 0, true, _event_time * 60 * 1000);
 			_chest_count++;
 		}
 		
 		// Announce event start
 		Announcements.getInstance().announceToAll("Rabbit Event : Chests spawned!");
 		Announcements.getInstance().announceToAll("Go to Fantasy Isle and grab some rewards!");
-		Announcements.getInstance().announceToAll("You have "+_event_time+" min - after that time all chests will disappear...");
+		Announcements.getInstance().announceToAll("You have " + _event_time + " min - after that time all chests will disappear...");
 		
 		// Schedule Event end
 		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
@@ -149,7 +154,7 @@ public class eventmodRabbits extends Event
 			{
 				timeUp();
 			}
-		}, _event_time*60*1000);
+		}, _event_time * 60 * 1000);
 		
 		return true;
 	}
@@ -164,8 +169,10 @@ public class eventmodRabbits extends Event
 	public boolean eventStop()
 	{
 		// Don't stop inactive event
-		if(!_isactive)
+		if (!_isactive)
+		{
 			return false;
+		}
 		
 		// Set inactive
 		_isactive = false;
@@ -177,11 +184,15 @@ public class eventmodRabbits extends Event
 			_eventTask = null;
 		}
 		// Despawn Npc's
-		if(!_npclist.isEmpty())
+		if (!_npclist.isEmpty())
 		{
 			for (L2Npc _npc : _npclist)
+			{
 				if (_npc != null)
+				{
 					_npc.deleteMe();
+				}
+			}
 		}
 		_npclist.clear();
 		
@@ -199,7 +210,9 @@ public class eventmodRabbits extends Event
 		if (event.equalsIgnoreCase("transform"))
 		{
 			if (player.isTransformed() || player.isInStance())
+			{
 				player.untransform();
+			}
 			
 			SkillTable.getInstance().getInfo(2428, 1).getEffects(npc, player);
 			
@@ -217,21 +230,21 @@ public class eventmodRabbits extends Event
 			Quest q = QuestManager.getInstance().getQuest(getName());
 			st = q.newQuestState(player);
 		}
-		return npc.getNpcId()+".htm";
+		return npc.getNpcId() + ".htm";
 	}
 	
 	@Override
 	public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
 	{
-		if (Util.contains(targets,npc))
+		if (Util.contains(targets, npc))
 		{
-			if(skill.getId() == _skill_tornado)
+			if (skill.getId() == _skill_tornado)
 			{
 				dropItem(npc, caster, DROPLIST);
 				npc.deleteMe();
 				_chest_count--;
 				
-				if(_chest_count <= 0)
+				if (_chest_count <= 0)
 				{
 					Announcements.getInstance().announceToAll("No more chests...");
 					eventStop();
@@ -239,11 +252,13 @@ public class eventmodRabbits extends Event
 			}
 			else if (skill.getId() == _skill_magic_eye)
 			{
-				if(npc instanceof L2EventChestInstance)
-					((L2EventChestInstance)npc).trigger();
+				if (npc instanceof L2EventChestInstance)
+				{
+					((L2EventChestInstance) npc).trigger();
+				}
 			}
 		}
-		return super.onSkillSee(npc,caster,skill,targets,isPet);
+		return super.onSkillSee(npc, caster, skill, targets, isPet);
 	}
 	
 	@Override
@@ -251,21 +266,23 @@ public class eventmodRabbits extends Event
 	{
 		// Some retards go to event and disturb it by breaking chests
 		// So... Apply raid curse if player don't use skill on chest but attack it
-		if(_isactive && npc.getNpcId() == _npc_chest)
+		if (_isactive && (npc.getNpcId() == _npc_chest))
+		{
 			SkillTable.getInstance().getInfo(4515, 1).getEffects(npc, attacker);
+		}
 		
 		return super.onAttack(npc, attacker, damage, isPet);
 	}
 	
 	private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)
 	{
-		final int chance = Rnd.get(100);
+		final int chance = getRandom(100);
 		
 		for (int[] drop : droplist)
 		{
 			if (chance > drop[1])
 			{
-				((L2MonsterInstance)mob).dropItem(player, drop[0], Rnd.get(drop[2], drop[3]));
+				((L2MonsterInstance) mob).dropItem(player, drop[0], getRandom(drop[2], drop[3]));
 				return;
 			}
 		}
@@ -274,8 +291,10 @@ public class eventmodRabbits extends Event
 	private L2Npc recordSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
 	{
 		L2Npc _tmp = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);
-		if(_tmp != null)
+		if (_tmp != null)
+		{
 			_npclist.add(_tmp);
+		}
 		return _tmp;
 	}
 	

+ 66 - 28
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/eventmodRace.java

@@ -33,7 +33,6 @@ import com.l2jserver.gameserver.model.quest.QuestState;
 import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jserver.util.Rnd;
 
 /**
  * @author Gnacik
@@ -58,26 +57,31 @@ public class eventmodRace extends Event
 	private static final int _time_race = 10;
 	// NPC's
 	private static final int _start_npc = 900103;
-	private static final int _stop_npc  = 900104;
+	private static final int _stop_npc = 900104;
 	// Skills (Frog by default)
 	private static int _skill = 6201;
 	// We must keep second NPC spawn for radar
 	private static int[] _randspawn = null;
 	// Locations
-	private static final String[] _locations = {
+	private static final String[] _locations =
+	{
 		"Heretic catacomb enterance",
 		"Dion castle bridge",
 		"Floran village enterance",
 		"Floran fort gate"
 	};
-	private static final int[][] _coords = {
+	
+	// @formatter:off
+	private static final int[][] _coords =
+	{
 		// x, y, z, heading
 		{ 39177, 144345, -3650, 0 },
 		{ 22294, 155892, -2950, 0 },
 		{ 16537, 169937, -3500, 0 },
 		{  7644, 150898, -2890, 0 }
 	};
-	private static final int[][] _rewards = {
+	private static final int[][] _rewards =
+	{
 		{ 6622, 2 }, // Giant's Codex
 		{ 9625, 2 }, // Giant's Codex -
 		{ 9626, 2 }, // Giant's Codex -
@@ -93,6 +97,7 @@ public class eventmodRace extends Event
 		{ 9576, 1 }, // Top-Grade Life Stone: level 80
 		{ 20034,1 }  // Revita pop
 	};
+	// @formatter:on
 	
 	public static void main(String[] args)
 	{
@@ -116,11 +121,15 @@ public class eventmodRace extends Event
 	public boolean eventStart()
 	{
 		// Don't start event if its active
-		if(_isactive)
+		if (_isactive)
+		{
 			return false;
+		}
 		// Check Custom Table - we use custom NPC's
 		if (!Config.CUSTOM_NPC_TABLE)
+		{
 			return false;
+		}
 		// Initialize list
 		_npclist = new FastList<L2Npc>();
 		_players = new FastList<L2PcInstance>();
@@ -131,7 +140,7 @@ public class eventmodRace extends Event
 		
 		// Announce event start
 		Announcements.getInstance().announceToAll("* Race Event started! *");
-		Announcements.getInstance().announceToAll("Visit Event Manager in Dion village and signup, you have "+_time_register+" min before Race Start...");
+		Announcements.getInstance().announceToAll("Visit Event Manager in Dion village and signup, you have " + _time_register + " min before Race Start...");
 		
 		// Schedule Event end
 		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
@@ -141,7 +150,7 @@ public class eventmodRace extends Event
 			{
 				StartRace();
 			}
-		}, _time_register*60*1000);
+		}, _time_register * 60 * 1000);
 		
 		return true;
 		
@@ -161,18 +170,18 @@ public class eventmodRace extends Event
 		// Announce
 		Announcements.getInstance().announceToAll("Race started!");
 		// Get random Finish
-		int location = Rnd.get(0, _locations.length-1);
+		int location = getRandom(0, _locations.length - 1);
 		_randspawn = _coords[location];
 		// And spawn NPC
 		recordSpawn(_stop_npc, _randspawn[0], _randspawn[1], _randspawn[2], _randspawn[3], false, 0);
 		// Transform players and send message
 		for (L2PcInstance player : _players)
 		{
-			if (player != null && player.isOnline())
+			if ((player != null) && player.isOnline())
 			{
 				if (player.isInsideRadius(_npc, 500, false, false))
 				{
-					sendMessage(player, "Race started! Go find Finish NPC as fast as you can... He is located near "+_locations[location]);
+					sendMessage(player, "Race started! Go find Finish NPC as fast as you can... He is located near " + _locations[location]);
 					transformPlayer(player);
 					player.getRadar().addMarker(_randspawn[0], _randspawn[1], _randspawn[2]);
 				}
@@ -191,15 +200,17 @@ public class eventmodRace extends Event
 			{
 				timeUp();
 			}
-		}, _time_race*60*1000);
+		}, _time_race * 60 * 1000);
 	}
 	
 	@Override
 	public boolean eventStop()
 	{
 		// Don't stop inactive event
-		if(!_isactive)
+		if (!_isactive)
+		{
 			return false;
+		}
 		
 		// Set inactive
 		_isactive = false;
@@ -217,7 +228,7 @@ public class eventmodRace extends Event
 		{
 			for (L2PcInstance player : _players)
 			{
-				if (player != null && player.isOnline())
+				if ((player != null) && player.isOnline())
 				{
 					player.untransform();
 					player.teleToLocation(_npc.getX(), _npc.getY(), _npc.getZ(), true);
@@ -225,11 +236,15 @@ public class eventmodRace extends Event
 			}
 		}
 		// Despawn Npc's
-		if(!_npclist.isEmpty())
+		if (!_npclist.isEmpty())
 		{
 			for (L2Npc _npc : _npclist)
+			{
 				if (_npc != null)
+				{
 					_npc.deleteMe();
+				}
+			}
 		}
 		_npclist.clear();
 		_players.clear();
@@ -252,7 +267,7 @@ public class eventmodRace extends Event
 			{
 				int _number = Integer.valueOf(bypass.substring(5));
 				L2Skill _sk = SkillTable.getInstance().getInfo(_number, 1);
-				if(_sk != null)
+				if (_sk != null)
 				{
 					_skill = _number;
 					activeChar.sendMessage("Transform skill set to:");
@@ -267,10 +282,14 @@ public class eventmodRace extends Event
 		}
 		else if (bypass.startsWith("tele"))
 		{
-			if(Integer.valueOf(bypass.substring(4)) > 0 && _randspawn != null)
+			if ((Integer.valueOf(bypass.substring(4)) > 0) && (_randspawn != null))
+			{
 				activeChar.teleToLocation(_randspawn[0], _randspawn[1], _randspawn[2]);
+			}
 			else
+			{
 				activeChar.teleToLocation(18429, 145861, -3090);
+			}
 		}
 		showMenu(activeChar);
 		return true;
@@ -282,7 +301,9 @@ public class eventmodRace extends Event
 		String htmltext = event;
 		QuestState st = player.getQuestState(getName());
 		if (st == null)
+		{
 			return null;
+		}
 		
 		if (event.equalsIgnoreCase("transform"))
 		{
@@ -302,7 +323,9 @@ public class eventmodRace extends Event
 		else if (event.equalsIgnoreCase("signup"))
 		{
 			if (_players.contains(player))
+			{
 				return "900103-onlist.htm";
+			}
 			_players.add(player);
 			return "900103-signup.htm";
 		}
@@ -310,7 +333,9 @@ public class eventmodRace extends Event
 		{
 			player.untransform();
 			if (_players.contains(player))
+			{
 				_players.remove(player);
+			}
 			return "900103-quit.htm";
 		}
 		else if (event.equalsIgnoreCase("finish"))
@@ -338,49 +363,62 @@ public class eventmodRace extends Event
 		{
 			if (_isRaceStarted)
 			{
-				return _start_npc+"-started-"+isRacing(player)+".htm";
+				return _start_npc + "-started-" + isRacing(player) + ".htm";
 			}
-			return _start_npc+"-"+isRacing(player)+".htm";
+			return _start_npc + "-" + isRacing(player) + ".htm";
 		}
-		else if (npc.getNpcId() == _stop_npc && _isRaceStarted)
+		else if ((npc.getNpcId() == _stop_npc) && _isRaceStarted)
 		{
-			return _stop_npc+"-"+isRacing(player)+".htm";
+			return _stop_npc + "-" + isRacing(player) + ".htm";
 		}
-		return npc.getNpcId()+".htm";
+		return npc.getNpcId() + ".htm";
 	}
 	
 	private int isRacing(L2PcInstance player)
 	{
 		if (_players.isEmpty())
+		{
 			return 0;
+		}
 		if (_players.contains(player))
+		{
 			return 1;
+		}
 		return 0;
 	}
 	
 	private L2Npc recordSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
 	{
 		L2Npc _tmp = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);
-		if(_tmp != null)
+		if (_tmp != null)
+		{
 			_npclist.add(_tmp);
+		}
 		return _tmp;
 	}
 	
 	private void transformPlayer(L2PcInstance player)
 	{
 		if (player.isTransformed() || player.isInStance())
+		{
 			player.untransform();
+		}
 		if (player.isSitting())
+		{
 			player.standUp();
+		}
 		
 		for (L2Effect e : player.getAllEffects())
 		{
 			if (e.getAbnormalType().equalsIgnoreCase("speed_up"))
+			{
 				e.exit();
-			if (e.getSkill() != null && (
-					e.getSkill().getId() == 268 ||	// Song of Wind
-					e.getSkill().getId() == 298)) 	// Rabbit Spirit Totem
+			}
+			if ((e.getSkill() != null) && ((e.getSkill().getId() == 268) || // Song of Wind
+			(e.getSkill().getId() == 298)))
+			{
 				e.exit();
+			}
 		}
 		
 		SkillTable.getInstance().getInfo(_skill, 1).getEffects(player, player);
@@ -407,9 +445,9 @@ public class eventmodRace extends Event
 	
 	private void winRace(L2PcInstance player)
 	{
-		int[] _reward = _rewards[Rnd.get(_rewards.length-1)];
+		int[] _reward = _rewards[getRandom(_rewards.length - 1)];
 		player.addItem("eventModRace", _reward[0], _reward[1], _npc, true);
-		Announcements.getInstance().announceToAll(player.getName()+" is a winner!");
+		Announcements.getInstance().announceToAll(player.getName() + " is a winner!");
 		eventStop();
 	}
 }

+ 3 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q463_IMustBeaGenius/Q463_IMustBeaGenius.java

@@ -22,7 +22,6 @@ import com.l2jserver.gameserver.model.quest.State;
 import com.l2jserver.gameserver.network.NpcStringId;
 import com.l2jserver.gameserver.network.serverpackets.NpcSay;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * 2010-08-19 Based on Freya PTS.
@@ -66,12 +65,12 @@ public class Q463_IMustBeaGenius extends Quest
 				st.setState(State.STARTED);
 				st.set("cond", "1");
 				// Generate random daily number for player
-				int _number = Rnd.get(500, 600);
+				int _number = getRandom(500, 600);
 				st.set("number", String.valueOf(_number));
 				// Set drop for mobs
 				for (int _mob : _mobs)
 				{
-					int _rand = Rnd.get(-2, 4);
+					int _rand = getRandom(-2, 4);
 					if (_rand == 0)
 					{
 						_rand = 5;
@@ -79,7 +78,7 @@ public class Q463_IMustBeaGenius extends Quest
 					st.set(String.valueOf(_mob), String.valueOf(_rand));
 				}
 				// One with higher chance
-				st.set(String.valueOf(_mobs[Rnd.get(0, _mobs.length - 1)]), String.valueOf(Rnd.get(1, 100)));
+				st.set(String.valueOf(_mobs[getRandom(_mobs.length)]), String.valueOf(getRandom(1, 100)));
 				htmltext = getHtm(st.getPlayer().getHtmlPrefix(), "32069-03.htm");
 				htmltext = htmltext.replace("%num%", String.valueOf(_number));
 			}

+ 114 - 46
L2J_DataPack_BETA/dist/game/data/scripts/quests/TerritoryWarScripts/TerritoryWarSuperClass.java

@@ -34,7 +34,6 @@ import com.l2jserver.gameserver.network.NpcStringId;
 import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
 import com.l2jserver.gameserver.util.Util;
 import com.l2jserver.util.L2FastMap;
-import com.l2jserver.util.Rnd;
 
 public class TerritoryWarSuperClass extends Quest
 {
@@ -62,16 +61,22 @@ public class TerritoryWarSuperClass extends Quest
 	{
 		addKillId(CATAPULT_ID);
 		for (int mobid : LEADER_IDS)
+		{
 			addKillId(mobid);
+		}
 		for (int mobid : GUARD_IDS)
+		{
 			addKillId(mobid);
+		}
 	}
 	
 	// Used to register NPCs "Protect the ..." quests
 	public void registerAttackIds()
 	{
 		for (int mobid : NPC_IDS)
+		{
 			addAttackId(mobid);
+		}
 	}
 	
 	@Override
@@ -96,16 +101,20 @@ public class TerritoryWarSuperClass extends Quest
 				}
 				TerritoryWard ward = TerritoryWarManager.getInstance().getTerritoryWard(caster);
 				if (ward == null)
+				{
 					return super.onSkillSee(npc, caster, skill, targets, isPet);
+				}
 				if ((caster.getSiegeSide() - 80) == ward.getOwnerCastleId())
 				{
-					for(TerritoryNPCSpawn wardSpawn : TerritoryWarManager.getInstance().getTerritory(ward.getOwnerCastleId()).getOwnedWard())
+					for (TerritoryNPCSpawn wardSpawn : TerritoryWarManager.getInstance().getTerritory(ward.getOwnerCastleId()).getOwnedWard())
+					{
 						if (wardSpawn.getNpcId() == ward.getTerritoryId())
 						{
 							wardSpawn.setNPC(wardSpawn.getNpc().getSpawn().doSpawn());
 							ward.unSpawnMe();
 							ward.setNpc(wardSpawn.getNpc());
 						}
+					}
 				}
 				else
 				{
@@ -125,23 +134,25 @@ public class TerritoryWarSuperClass extends Quest
 	}
 	
 	@Override
-	public String onAttack(L2Npc npc,L2PcInstance player, int damage, boolean isPet)
+	public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)
 	{
-		if (npc.getCurrentHp() == npc.getMaxHp() && Util.contains(NPC_IDS, npc.getNpcId()))
+		if ((npc.getCurrentHp() == npc.getMaxHp()) && Util.contains(NPC_IDS, npc.getNpcId()))
 		{
 			int territoryId = getTerritoryIdForThisNPCId(npc.getNpcId());
-			if (territoryId >= 81 && territoryId <= 89)
+			if ((territoryId >= 81) && (territoryId <= 89))
 			{
-				for(L2PcInstance pl : L2World.getInstance().getAllPlayersArray())
+				for (L2PcInstance pl : L2World.getInstance().getAllPlayersArray())
 				{
 					if (pl.getSiegeSide() == territoryId)
 					{
 						QuestState st = pl.getQuestState(getName());
 						if (st == null)
+						{
 							st = newQuestState(pl);
+						}
 						if (st.getState() != State.STARTED)
 						{
-							st.set("cond","1");
+							st.set("cond", "1");
 							st.setStateAndNotSave(State.STARTED);
 						}
 					}
@@ -152,29 +163,34 @@ public class TerritoryWarSuperClass extends Quest
 	}
 	
 	@Override
-	public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
 	{
 		if (npc.getNpcId() == CATAPULT_ID)
 		{
 			TerritoryWarManager.getInstance().territoryCatapultDestroyed(TERRITORY_ID - 80);
 			TerritoryWarManager.getInstance().giveTWPoint(killer, TERRITORY_ID, 4);
-			TerritoryWarManager.getInstance().announceToParticipants(new ExShowScreenMessage(npcString[0],2,10000), 135000, 13500);
-			handleBecomeMercenaryQuest(killer,true);
+			TerritoryWarManager.getInstance().announceToParticipants(new ExShowScreenMessage(npcString[0], 2, 10000), 135000, 13500);
+			handleBecomeMercenaryQuest(killer, true);
 		}
 		else if (Util.contains(LEADER_IDS, npc.getNpcId()))
+		{
 			TerritoryWarManager.getInstance().giveTWPoint(killer, TERRITORY_ID, 3);
+		}
 		
-		if (killer.getSiegeSide() != TERRITORY_ID
-				&& TerritoryWarManager.getInstance().getTerritory(killer.getSiegeSide() - 80) != null)
+		if ((killer.getSiegeSide() != TERRITORY_ID) && (TerritoryWarManager.getInstance().getTerritory(killer.getSiegeSide() - 80) != null))
+		{
 			TerritoryWarManager.getInstance().getTerritory(killer.getSiegeSide() - 80).getQuestDone()[0]++;
-		return super.onKill(npc,killer,isPet);
+		}
+		return super.onKill(npc, killer, isPet);
 	}
 	
 	@Override
 	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
 	{
-		if (npc != null || player != null)
+		if ((npc != null) || (player != null))
+		{
 			return null;
+		}
 		StringTokenizer st = new StringTokenizer(event, " ");
 		event = st.nextToken(); // Get actual command
 		if (event.equalsIgnoreCase("setNextTWDate"))
@@ -185,9 +201,13 @@ public class TerritoryWarSuperClass extends Quest
 			startTWDate.set(Calendar.MINUTE, 0);
 			startTWDate.set(Calendar.SECOND, 0);
 			if (startTWDate.getTimeInMillis() < System.currentTimeMillis())
+			{
 				startTWDate.add(Calendar.DAY_OF_MONTH, 7);
+			}
 			if (!SevenSigns.getInstance().isDateInSealValidPeriod(startTWDate))
+			{
 				startTWDate.add(Calendar.DAY_OF_MONTH, 7);
+			}
 			saveGlobalQuestVar("nextTWStartDate", String.valueOf(startTWDate.getTimeInMillis()));
 			TerritoryWarManager.getInstance().setTWStartTimeInMillis(startTWDate.getTimeInMillis());
 			_log.info("Next TerritoryWarTime: " + startTWDate.getTime());
@@ -208,15 +228,17 @@ public class TerritoryWarSuperClass extends Quest
 		int kill = 1;
 		int max = 10;
 		if (st == null)
+		{
 			st = newQuestState(player);
+		}
 		if (!st.isCompleted())
 		{
 			if (!st.isStarted())
 			{
 				st.setState(State.STARTED);
-				st.set("cond","1");
+				st.set("cond", "1");
 				st.set("kill", "1");
-				max = Rnd.get(RANDOM_MIN, RANDOM_MAX);
+				max = getRandom(RANDOM_MIN, RANDOM_MAX);
 				st.set("max", String.valueOf(max));
 			}
 			else
@@ -231,13 +253,13 @@ public class TerritoryWarSuperClass extends Quest
 				st.set("doneDate", String.valueOf(Calendar.getInstance().get(Calendar.DAY_OF_YEAR)));
 				st.setState(State.COMPLETED);
 				st.exitQuest(true);
-				player.sendPacket(new ExShowScreenMessage(npcString[1],2,10000));
+				player.sendPacket(new ExShowScreenMessage(npcString[1], 2, 10000));
 			}
 			else
 			{
 				st.set("kill", String.valueOf(kill));
 				
-				ExShowScreenMessage message = new ExShowScreenMessage(npcString[0],2,10000);
+				ExShowScreenMessage message = new ExShowScreenMessage(npcString[0], 2, 10000);
 				message.addStringParameter(String.valueOf(max));
 				message.addStringParameter(String.valueOf(kill));
 				player.sendPacket(message);
@@ -247,12 +269,12 @@ public class TerritoryWarSuperClass extends Quest
 		else if (st.getInt("doneDate") != Calendar.getInstance().get(Calendar.DAY_OF_YEAR))
 		{
 			st.setState(State.STARTED);
-			st.set("cond","1");
+			st.set("cond", "1");
 			st.set("kill", "1");
-			max = Rnd.get(RANDOM_MIN, RANDOM_MAX);
+			max = getRandom(RANDOM_MIN, RANDOM_MAX);
 			st.set("max", String.valueOf(max));
 			
-			ExShowScreenMessage message = new ExShowScreenMessage(npcString[0],2,10000);
+			ExShowScreenMessage message = new ExShowScreenMessage(npcString[0], 2, 10000);
 			message.addStringParameter(String.valueOf(max));
 			message.addStringParameter(String.valueOf(kill));
 			player.sendPacket(message);
@@ -262,12 +284,12 @@ public class TerritoryWarSuperClass extends Quest
 			// just for test
 			player.sendMessage("Cleaning " + getName() + " Territory War quest by force!");
 			st.setState(State.STARTED);
-			st.set("cond","1");
+			st.set("cond", "1");
 			st.set("kill", "1");
-			max = Rnd.get(RANDOM_MIN, RANDOM_MAX);
+			max = getRandom(RANDOM_MIN, RANDOM_MAX);
 			st.set("max", String.valueOf(max));
-
-			ExShowScreenMessage message = new ExShowScreenMessage(npcString[0],2,10000);
+			
+			ExShowScreenMessage message = new ExShowScreenMessage(npcString[0], 2, 10000);
 			message.addStringParameter(String.valueOf(max));
 			message.addStringParameter(String.valueOf(kill));
 			player.sendPacket(message);
@@ -277,19 +299,23 @@ public class TerritoryWarSuperClass extends Quest
 	private void handleBecomeMercenaryQuest(L2PcInstance player, boolean catapult)
 	{
 		QuestState _state = player.getQuestState("147_PathtoBecominganEliteMercenary");
-		if(_state != null && _state.getState() == State.STARTED)
+		if ((_state != null) && (_state.getState() == State.STARTED))
 		{
 			int _cond = _state.getInt("cond");
 			if (catapult)
 			{
 				if (_cond == 2)
+				{
 					_state.set("cond", "4");
+				}
 				else if (_cond == 1)
+				{
 					_state.set("cond", "3");
+				}
 			}
 			else
 			{
-				if (_cond == 1 || _cond == 3)
+				if ((_cond == 1) || (_cond == 3))
 				{
 					// Get
 					int _kills = _state.getInt("kills");
@@ -301,9 +327,13 @@ public class TerritoryWarSuperClass extends Quest
 					if (_kills >= 10)
 					{
 						if (_cond == 1)
+						{
 							_state.set("cond", "2");
+						}
 						else if (_cond == 3)
+						{
 							_state.set("cond", "4");
+						}
 					}
 				}
 			}
@@ -316,10 +346,10 @@ public class TerritoryWarSuperClass extends Quest
 		int cond = 0;
 		// Additional Handle for Quest
 		QuestState _sfh = player.getQuestState("176_StepsForHonor");
-		if (_sfh != null && _sfh.getState() == State.STARTED)
+		if ((_sfh != null) && (_sfh.getState() == State.STARTED))
 		{
 			cond = _sfh.getInt("cond");
-			if ( cond == 1 || cond == 3 || cond == 5 || cond == 7)
+			if ((cond == 1) || (cond == 3) || (cond == 5) || (cond == 7))
 			{
 				// Get kills
 				kills = _sfh.getInt("kills");
@@ -328,22 +358,22 @@ public class TerritoryWarSuperClass extends Quest
 				// Save
 				_sfh.set("kills", String.valueOf(kills));
 				// Check
-				if (cond == 1 && kills >= 9)
+				if ((cond == 1) && (kills >= 9))
 				{
 					_sfh.set("cond", "2");
 					_sfh.set("kills", "0");
 				}
-				else if (cond == 3 && kills >= 18)
+				else if ((cond == 3) && (kills >= 18))
 				{
 					_sfh.set("cond", "4");
 					_sfh.set("kills", "0");
 				}
-				else if (cond == 5 && kills >= 27)
+				else if ((cond == 5) && (kills >= 27))
 				{
 					_sfh.set("cond", "6");
 					_sfh.set("kills", "0");
 				}
-				else if (cond == 7 && kills >= 36)
+				else if ((cond == 7) && (kills >= 36))
 				{
 					_sfh.set("cond", "8");
 					_sfh.unset("kills");
@@ -355,17 +385,21 @@ public class TerritoryWarSuperClass extends Quest
 	@Override
 	public String onDeath(L2Character killer, L2Character victim, QuestState qs)
 	{
-		if (killer == victim || !(victim instanceof L2PcInstance) || victim.getLevel() < 61)
+		if ((killer == victim) || !(victim instanceof L2PcInstance) || (victim.getLevel() < 61))
+		{
 			return "";
+		}
 		L2PcInstance actingPlayer = killer.getActingPlayer();
-		if (actingPlayer != null && qs.getPlayer() != null)
+		if ((actingPlayer != null) && (qs.getPlayer() != null))
 		{
 			if (actingPlayer.getParty() != null)
 			{
-				for(L2PcInstance pl : actingPlayer.getParty().getPartyMembers())
+				for (L2PcInstance pl : actingPlayer.getParty().getPartyMembers())
 				{
-					if (pl.getSiegeSide() == qs.getPlayer().getSiegeSide() || pl.getSiegeSide() == 0 || !Util.checkIfInRange(2000, killer, pl, false))
+					if ((pl.getSiegeSide() == qs.getPlayer().getSiegeSide()) || (pl.getSiegeSide() == 0) || !Util.checkIfInRange(2000, killer, pl, false))
+					{
 						continue;
+					}
 					if (pl == actingPlayer)
 					{
 						handleStepsForHonor(actingPlayer);
@@ -374,7 +408,7 @@ public class TerritoryWarSuperClass extends Quest
 					handleKillTheQuest(pl);
 				}
 			}
-			else if (actingPlayer.getSiegeSide() != qs.getPlayer().getSiegeSide() && actingPlayer.getSiegeSide() > 0)
+			else if ((actingPlayer.getSiegeSide() != qs.getPlayer().getSiegeSide()) && (actingPlayer.getSiegeSide() > 0))
 			{
 				handleKillTheQuest(actingPlayer);
 				handleStepsForHonor(actingPlayer);
@@ -395,8 +429,10 @@ public class TerritoryWarSuperClass extends Quest
 			TerritoryWarSuperClass territoryQuest = _forTheSakeScripts.get(territoryId);
 			QuestState st = player.getQuestState(territoryQuest.getName());
 			if (st == null)
+			{
 				st = territoryQuest.newQuestState(player);
-			st.set("cond","1");
+			}
+			st.set("cond", "1");
 			st.setStateAndNotSave(State.STARTED);
 			
 			// register player on Death
@@ -407,11 +443,15 @@ public class TerritoryWarSuperClass extends Quest
 				{
 					st = player.getQuestState(killthe.getName());
 					if (st == null)
+					{
 						st = killthe.newQuestState(player);
+					}
 					player.addNotifyQuestOfDeath(st);
 				}
 				else
+				{
 					_log.warning("TerritoryWar: Missing Kill the quest for player " + player.getName() + " whose class id: " + player.getClassId().getId());
+				}
 			}
 		}
 		return null;
@@ -422,19 +462,23 @@ public class TerritoryWarSuperClass extends Quest
 	{
 		super.setOnEnterWorld(val);
 		
-		for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
+		for (L2PcInstance player : L2World.getInstance().getAllPlayersArray())
 		{
 			if (player.getSiegeSide() > 0)
 			{
 				TerritoryWarSuperClass territoryQuest = _forTheSakeScripts.get(player.getSiegeSide());
 				if (territoryQuest == null)
+				{
 					continue;
+				}
 				QuestState st = player.getQuestState(territoryQuest.getName());
 				if (st == null)
+				{
 					st = territoryQuest.newQuestState(player);
+				}
 				if (val)
 				{
-					st.set("cond","1");
+					st.set("cond", "1");
 					st.setStateAndNotSave(State.STARTED);
 					// register player on Death
 					if (player.getLevel() >= 61)
@@ -444,30 +488,38 @@ public class TerritoryWarSuperClass extends Quest
 						{
 							st = player.getQuestState(killthe.getName());
 							if (st == null)
+							{
 								st = killthe.newQuestState(player);
+							}
 							player.addNotifyQuestOfDeath(st);
 						}
 						else
+						{
 							_log.warning("TerritoryWar: Missing Kill the quest for player " + player.getName() + " whose class id: " + player.getClassId().getId());
+						}
 					}
 				}
 				else
 				{
 					st.setStateAndNotSave(State.COMPLETED);
 					st.exitQuest(false);
-					for(Quest q : _protectTheScripts.values())
+					for (Quest q : _protectTheScripts.values())
+					{
 						if (player.getQuestState(q.getName()) != null)
 						{
 							player.getQuestState(q.getName()).setStateAndNotSave(State.COMPLETED);
 							player.getQuestState(q.getName()).exitQuest(false);
 						}
+					}
 					// unregister player on Death
 					TerritoryWarSuperClass killthe = _killTheScripts.get(player.getClassIndex());
 					if (killthe != null)
 					{
 						st = player.getQuestState(killthe.getName());
 						if (st != null)
+						{
 							player.removeNotifyQuestOfDeath(st);
+						}
 					}
 				}
 			}
@@ -492,26 +544,32 @@ public class TerritoryWarSuperClass extends Quest
 				startTWDate.set(Calendar.MINUTE, 0);
 				startTWDate.set(Calendar.SECOND, 0);
 				if (startTWDate.getTimeInMillis() < System.currentTimeMillis())
+				{
 					startTWDate.add(Calendar.DAY_OF_MONTH, 7);
+				}
 				if (!SevenSigns.getInstance().isDateInSealValidPeriod(startTWDate))
+				{
 					startTWDate.add(Calendar.DAY_OF_MONTH, 7);
+				}
 				saveGlobalQuestVar("nextTWStartDate", String.valueOf(startTWDate.getTimeInMillis()));
 			}
 			else
 			{
 				startTWDate.setTimeInMillis(Long.parseLong(loadGlobalQuestVar("nextTWStartDate")));
-				if (startTWDate.getTimeInMillis() < System.currentTimeMillis()
-						&& SevenSigns.getInstance().isSealValidationPeriod()
-						&& SevenSigns.getInstance().getMilliToPeriodChange() > 172800000)
+				if ((startTWDate.getTimeInMillis() < System.currentTimeMillis()) && SevenSigns.getInstance().isSealValidationPeriod() && (SevenSigns.getInstance().getMilliToPeriodChange() > 172800000))
 				{
 					startTWDate.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
 					startTWDate.set(Calendar.HOUR_OF_DAY, 20);
 					startTWDate.set(Calendar.MINUTE, 0);
 					startTWDate.set(Calendar.SECOND, 0);
 					if (startTWDate.getTimeInMillis() < System.currentTimeMillis())
+					{
 						startTWDate.add(Calendar.DAY_OF_MONTH, 7);
+					}
 					if (!SevenSigns.getInstance().isDateInSealValidPeriod(startTWDate))
+					{
 						startTWDate.add(Calendar.DAY_OF_MONTH, 7);
+					}
 					saveGlobalQuestVar("nextTWStartDate", String.valueOf(startTWDate.getTimeInMillis()));
 				}
 			}
@@ -523,7 +581,7 @@ public class TerritoryWarSuperClass extends Quest
 	public static void main(String[] args)
 	{
 		// initialize superclass
-		new TerritoryWarSuperClass(-1,qn,"Territory_War");
+		new TerritoryWarSuperClass(-1, qn, "Territory_War");
 		
 		// initialize subclasses
 		// "For The Sake" quests
@@ -559,18 +617,28 @@ public class TerritoryWarSuperClass extends Quest
 		// "Kill the" quests
 		TerritoryWarSuperClass knights = new KillTheKnights();
 		for (int i : knights.CLASS_IDS)
+		{
 			_killTheScripts.put(i, knights);
+		}
 		TerritoryWarSuperClass warriors = new KillTheWarriors();
 		for (int i : warriors.CLASS_IDS)
+		{
 			_killTheScripts.put(i, warriors);
+		}
 		TerritoryWarSuperClass wizards = new KillTheWizards();
 		for (int i : wizards.CLASS_IDS)
+		{
 			_killTheScripts.put(i, wizards);
+		}
 		TerritoryWarSuperClass priests = new KillThePriests();
 		for (int i : priests.CLASS_IDS)
+		{
 			_killTheScripts.put(i, priests);
+		}
 		TerritoryWarSuperClass keys = new KillTheKeyTargets();
 		for (int i : keys.CLASS_IDS)
+		{
 			_killTheScripts.put(i, keys);
+		}
 	}
 }

+ 111 - 27
L2J_DataPack_BETA/dist/game/data/scripts/retail/PriestOfBlessing/PriestOfBlessing.java

@@ -23,7 +23,6 @@ import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Rnd;
 
 /**
  * @author Gnacik
@@ -41,86 +40,171 @@ public class PriestOfBlessing extends Quest
 	//
 	private static final int[] _prices_hourglass =
 	{
-		4000, 30000, 110000, 310000, 970000, 2160000, 5000000
+		4000,
+		30000,
+		110000,
+		310000,
+		970000,
+		2160000,
+		5000000
 	};
 	//
 	private static final int[][] _hourglasses =
 	{
 		{
-			17095, 17096, 17097, 17098, 17099
+			17095,
+			17096,
+			17097,
+			17098,
+			17099
 		},
 		{
-			17100, 17101, 17102, 17103, 17104
+			17100,
+			17101,
+			17102,
+			17103,
+			17104
 		},
 		{
-			17105, 17106, 17107, 17108, 17109
+			17105,
+			17106,
+			17107,
+			17108,
+			17109
 		},
 		{
-			17110, 17111, 17112, 17113, 17114
+			17110,
+			17111,
+			17112,
+			17113,
+			17114
 		},
 		{
-			17115, 17116, 17117, 17118, 17119
+			17115,
+			17116,
+			17117,
+			17118,
+			17119
 		},
 		{
-			17120, 17121, 17122, 17123, 17124
+			17120,
+			17121,
+			17122,
+			17123,
+			17124
 		},
 		{
-			17125, 17126, 17127, 17128, 17129
+			17125,
+			17126,
+			17127,
+			17128,
+			17129
 		}
 	};
 	// Spawns
 	private static final int[][] _spawns =
 	{
 		{
-			-84139, 243145, -3704, 8473
+			-84139,
+			243145,
+			-3704,
+			8473
 		},
 		{
-			-119702, 44557, 360, 33023
+			-119702,
+			44557,
+			360,
+			33023
 		},
 		{
-			45413, 48351, -3056, 50020
+			45413,
+			48351,
+			-3056,
+			50020
 		},
 		{
-			115607, -177945, -896, 38058
+			115607,
+			-177945,
+			-896,
+			38058
 		},
 		{
-			12086, 16589, -4584, 3355
+			12086,
+			16589,
+			-4584,
+			3355
 		},
 		{
-			-45032, -113561, -192, 32767
+			-45032,
+			-113561,
+			-192,
+			32767
 		},
 		{
-			-83112, 150922, -3120, 2280
+			-83112,
+			150922,
+			-3120,
+			2280
 		},
 		{
-			-13931, 121938, -2984, 30212
+			-13931,
+			121938,
+			-2984,
+			30212
 		},
 		{
-			87127, -141330, -1336, 49153
+			87127,
+			-141330,
+			-1336,
+			49153
 		},
 		{
-			43520, -47590, -792, 43738
+			43520,
+			-47590,
+			-792,
+			43738
 		},
 		{
-			148060, -55314, -2728, 40961
+			148060,
+			-55314,
+			-2728,
+			40961
 		},
 		{
-			82801, 149381, -3464, 53707
+			82801,
+			149381,
+			-3464,
+			53707
 		},
 		{
-			82433, 53285, -1488, 22942
+			82433,
+			53285,
+			-1488,
+			22942
 		},
 		{
-			147059, 25930, -2008, 56399
+			147059,
+			25930,
+			-2008,
+			56399
 		},
 		{
-			111171, 221053, -3544, 2058
+			111171,
+			221053,
+			-3544,
+			2058
 		},
 		{
-			15907, 142901, -2688, 14324
+			15907,
+			142901,
+			-2688,
+			14324
 		},
 		{
-			116972, 77255, -2688, 41951
+			116972,
+			77255,
+			-2688,
+			41951
 		}
 	};
 	
@@ -176,7 +260,7 @@ public class PriestOfBlessing extends Quest
 				if (System.currentTimeMillis() > _reuse_time)
 				{
 					int[] _hg = _hourglasses[_index];
-					int _nevit_hourglass = _hg[Rnd.get(0, _hg.length - 1)];
+					int _nevit_hourglass = _hg[getRandom(0, _hg.length - 1)];
 					
 					st.setState(State.STARTED);
 					st.takeItems(57, _price_hourglass);

Some files were not shown because too many files changed in this diff