	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<>();
		if (activeChar instanceof L2Playable)
		{
			final L2PcInstance player = activeChar.getActingPlayer();

			if (player == null)
				return _emptyTargetList;

			if (player.isInOlympiadMode())
				return new L2Character[] { player };

			final int radius = skill.getSkillRadius();
			final L2Clan clan = player.getClan();

			if (L2Skill.addSummon(activeChar, player, radius, true))
				targetList.add(player.getPet());

			if (clan != null)
			{
				L2PcInstance obj;
				for (L2ClanMember member : clan.getMembers())
				{
					obj = member.getPlayerInstance();

					if (obj == null || obj == player)
						continue;

					if (player.isInDuel())
					{
						if (player.getDuelId() != obj.getDuelId())
							continue;
						if (player.isInParty() && obj.isInParty() && player.getParty().getLeaderObjectId() != obj.getParty().getLeaderObjectId())
							continue;
					}

					// Don't add this target if this is a Pc->Pc pvp casting and pvp condition not met
					if (!player.checkPvpSkill(obj, skill))
						continue;

					if (!TvTEvent.checkForTvTSkill(player, obj, skill))
						continue;

					if (!onlyFirst && L2Skill.addSummon(activeChar, obj, radius, true))
						targetList.add(obj.getPet());

					if (!L2Skill.addCharacter(activeChar, obj, radius, true))
						continue;

					if (skill.getSkillType() == L2SkillType.RESURRECT)
					{
						// check target is not in a active siege zone
						if (obj.isInsideZone(L2Character.ZONE_SIEGE) && !obj.isInSiege())
							continue;
					}

					if (onlyFirst)
						return new L2Character[] { obj };

					if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
						break;

					targetList.add(obj);
				}
			}
		}
		else if (activeChar instanceof L2Npc)
		{
			// for buff purposes, returns friendly mobs nearby and mob itself
			final L2Npc npc = (L2Npc) activeChar;
			if (npc.getFactionId() == null || npc.getFactionId().isEmpty())
			{
				return new L2Character[] { activeChar };
			}

			targetList.add(activeChar);

			final Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values();

			for (L2Object newTarget : objs)
			{
				if (newTarget instanceof L2Npc && npc.getFactionId().equals(((L2Npc) newTarget).getFactionId()))
				{
					if (!Util.checkIfInRange(skill.getCastRange(), activeChar, newTarget, true))
						continue;

					if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
						break;

					targetList.add((L2Npc) newTarget);
				}
			}
		}

		return targetList.toArray(new L2Character[targetList.size()]);
	}

	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<L2Character>();
		if (activeChar instanceof L2Playable)
		{
			final L2PcInstance player = activeChar.getActingPlayer();

			if (player == null)
				return _emptyTargetList;

			if (player.isInOlympiadMode())
				return new L2Character[] { player };

			final int radius = skill.getSkillRadius();
			final L2Clan clan = player.getClan();

			if (L2Skill.addSummon(activeChar, player, radius, true))
				targetList.add(player.getPet());

			if (clan != null)
			{
				L2PcInstance obj;
				for (L2ClanMember member : clan.getMembers())
				{
					obj = member.getPlayerInstance();

					if (obj == null || obj == player)
						continue;

					if (player.isInDuel())
					{
						if (player.getDuelId() != obj.getDuelId())
							continue;
						if (player.isInParty() && obj.isInParty() && player.getParty().getLeaderObjectId() != obj.getParty().getLeaderObjectId())
							continue;
					}

					// Don't add this target if this is a Pc->Pc pvp casting and pvp condition not met
					if (!player.checkPvpSkill(obj, skill))
						continue;

					if (!TvTEvent.checkForTvTSkill(player, obj, skill))
						continue;

					if (!onlyFirst && L2Skill.addSummon(activeChar, obj, radius, true))
						targetList.add(obj.getPet());

					if (!L2Skill.addCharacter(activeChar, obj, radius, true))
						continue;

					if (skill.getSkillType() == L2SkillType.RESURRECT)
					{
						// check target is not in a active siege zone
						if (obj.isInsideZone(L2Character.ZONE_SIEGE) && !obj.isInSiege())
							continue;
					}

					if (onlyFirst)
						return new L2Character[] { obj };

					if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
						break;

					targetList.add(obj);
				}
			}
		}
		else if (activeChar instanceof L2Npc)
		{
			// for buff purposes, returns friendly mobs nearby and mob itself
			final L2Npc npc = (L2Npc) activeChar;
			if (npc.getFactionId() == null || npc.getFactionId().isEmpty())
			{
				return new L2Character[] { activeChar };
			}

			targetList.add(activeChar);

			final Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values();

			for (L2Object newTarget : objs)
			{
				if (newTarget instanceof L2Npc && npc.getFactionId().equals(((L2Npc) newTarget).getFactionId()))
				{
					if (!Util.checkIfInRange(skill.getCastRange(), activeChar, newTarget, true))
						continue;

					if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
						break;

					targetList.add((L2Npc) newTarget);
				}
			}
		}

		return targetList.toArray(new L2Character[targetList.size()]);
	}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public getTargetList(skill L2Skill, activeChar L2Character, onlyFirst boolean, target L2Character) : L2Object[] from class handlers.targethandlers.TargetCorpseClan


	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<>();
		final boolean isSummon = target instanceof L2ServitorInstance;
		if (!(isSummon || target instanceof L2Attackable) || !target.isDead())
		{
			activeChar.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
			return _emptyTargetList;
		}

		// Corpse mob only available for half time
		switch (skill.getSkillType())
		{
			case SUMMON:
			{
				if (isSummon && ((L2ServitorInstance)target).getOwner() != null
						&& ((L2ServitorInstance)target).getOwner().getObjectId() == activeChar.getObjectId())
					return _emptyTargetList;

				break;
			}
			case DRAIN:
			{
				if (!((L2Attackable) target).checkCorpseTime(activeChar.getActingPlayer(), (Config.NPC_DECAY_TIME / 2), true))
				{
					return _emptyTargetList;
				}
			}
		}

		if (!onlyFirst)
		{
			targetList.add(target);
			return targetList.toArray(new L2Object[targetList.size()]);
		}
		return new L2Character[] { target };
	}

	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<L2Character>();
		final boolean isSummon = target instanceof L2ServitorInstance;
		if (!(isSummon || target instanceof L2Attackable) || !target.isDead())
		{
			activeChar.sendPacket(SystemMessageId.TARGET_IS_INCORRECT);
			return _emptyTargetList;
		}

		// Corpse mob only available for half time
		switch (skill.getSkillType())
		{
			case SUMMON:
			{
				if (isSummon && ((L2ServitorInstance)target).getOwner() != null
						&& ((L2ServitorInstance)target).getOwner().getObjectId() == activeChar.getObjectId())
					return _emptyTargetList;

				break;
			}
			case DRAIN:
			{
				if (!((L2Attackable) target).checkCorpseTime(activeChar.getActingPlayer(), (Config.NPC_DECAY_TIME / 2), true))
				{
					return _emptyTargetList;
				}
			}
		}

		if (!onlyFirst)
		{
			targetList.add(target);
			return targetList.toArray(new L2Object[targetList.size()]);
		}
		return new L2Character[] { target };
	}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public getTargetList(skill L2Skill, activeChar L2Character, onlyFirst boolean, target L2Character) : L2Object[] from class handlers.targethandlers.TargetCorpseMob


	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<>();
		if (onlyFirst)
			return new L2Character[] { activeChar };

		targetList.add(activeChar);

		final int radius = skill.getSkillRadius();

		L2PcInstance player = activeChar.getActingPlayer();
		if (activeChar instanceof L2Summon)
		{
			if (L2Skill.addCharacter(activeChar, player, radius, false))
				targetList.add(player);
		}
		else if (activeChar instanceof L2PcInstance)
		{
			if (L2Skill.addSummon(activeChar, player, radius, false))
				targetList.add(player.getPet());
		}

		if (activeChar.isInParty())
		{
			// Get a list of Party Members
			for (L2PcInstance partyMember : activeChar.getParty().getMembers())
			{
				if (partyMember == null || partyMember == player)
					continue;

				if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
					break;

				if (L2Skill.addCharacter(activeChar, partyMember, radius, false))
					targetList.add(partyMember);

				if (L2Skill.addSummon(activeChar, partyMember, radius, false))
					targetList.add(partyMember.getPet());
			}
		}
		return targetList.toArray(new L2Character[targetList.size()]);
	}

	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<L2Character>();
		if (onlyFirst)
			return new L2Character[] { activeChar };

		targetList.add(activeChar);

		final int radius = skill.getSkillRadius();

		L2PcInstance player = activeChar.getActingPlayer();
		if (activeChar instanceof L2Summon)
		{
			if (L2Skill.addCharacter(activeChar, player, radius, false))
				targetList.add(player);
		}
		else if (activeChar instanceof L2PcInstance)
		{
			if (L2Skill.addSummon(activeChar, player, radius, false))
				targetList.add(player.getPet());
		}

		if (activeChar.isInParty())
		{
			// Get a list of Party Members
			for (L2PcInstance partyMember : activeChar.getParty().getMembers())
			{
				if (partyMember == null || partyMember == player)
					continue;

				if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
					break;

				if (L2Skill.addCharacter(activeChar, partyMember, radius, false))
					targetList.add(partyMember);

				if (L2Skill.addSummon(activeChar, partyMember, radius, false))
					targetList.add(partyMember.getPet());
			}
		}
		return targetList.toArray(new L2Character[targetList.size()]);
	}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public getTargetList(skill L2Skill, activeChar L2Character, onlyFirst boolean, target L2Character) : L2Object[] from class handlers.targethandlers.TargetParty


	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<>();
		if (onlyFirst)
			return new L2Character[] { activeChar };

		final L2PcInstance player = activeChar.getActingPlayer();

		if (player == null)
			return _emptyTargetList;

		targetList.add(player);

		final int radius = skill.getSkillRadius();
		final boolean hasClan = player.getClan() != null;
		final boolean hasParty = player.isInParty();

		if (L2Skill.addSummon(activeChar, player, radius, false))
			targetList.add(player.getPet());

		// if player in clan and not in party
		if (!(hasClan || hasParty))
			return targetList.toArray(new L2Character[targetList.size()]);

		// Get all visible objects in a spherical area near the L2Character
		final Collection<L2PcInstance> objs = activeChar.getKnownList().getKnownPlayersInRadius(radius);
		for (L2PcInstance obj : objs)
		{
			if (obj == null)
				continue;

			// olympiad mode - adding only own side
			if (player.isInOlympiadMode())
			{
				if (!obj.isInOlympiadMode())
					continue;
				if (player.getOlympiadGameId() != obj.getOlympiadGameId())
					continue;
				if (player.getOlympiadSide() != obj.getOlympiadSide())
					continue;
			}

			if (player.isInDuel())
			{
				if (player.getDuelId() != obj.getDuelId())
					continue;

				if (hasParty && obj.isInParty() && player.getParty().getLeaderObjectId() != obj.getParty().getLeaderObjectId())
					continue;
			}

			if (!((hasClan && obj.getClanId() == player.getClanId()) || (hasParty && obj.isInParty() && player.getParty().getLeaderObjectId() == obj.getParty().getLeaderObjectId())))
				continue;

			// Don't add this target if this is a Pc->Pc pvp
			// casting and pvp condition not met
			if (!player.checkPvpSkill(obj, skill))
				continue;

			if (!TvTEvent.checkForTvTSkill(player, obj, skill))
				continue;

			if (!onlyFirst && L2Skill.addSummon(activeChar, obj, radius, false))
				targetList.add(obj.getPet());

			if (!L2Skill.addCharacter(activeChar, obj, radius, false))
				continue;

			if (onlyFirst)
				return new L2Character[] { obj };

			if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
				break;

			targetList.add(obj);
		}

		return targetList.toArray(new L2Character[targetList.size()]);
	}

	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<L2Character>();
		if (onlyFirst)
			return new L2Character[] { activeChar };

		final L2PcInstance player = activeChar.getActingPlayer();

		if (player == null)
			return _emptyTargetList;

		targetList.add(player);

		final int radius = skill.getSkillRadius();
		final boolean hasClan = player.getClan() != null;
		final boolean hasParty = player.isInParty();

		if (L2Skill.addSummon(activeChar, player, radius, false))
			targetList.add(player.getPet());

		// if player in clan and not in party
		if (!(hasClan || hasParty))
			return targetList.toArray(new L2Character[targetList.size()]);

		// Get all visible objects in a spherical area near the L2Character
		final Collection<L2PcInstance> objs = activeChar.getKnownList().getKnownPlayersInRadius(radius);
		for (L2PcInstance obj : objs)
		{
			if (obj == null)
				continue;

			// olympiad mode - adding only own side
			if (player.isInOlympiadMode())
			{
				if (!obj.isInOlympiadMode())
					continue;
				if (player.getOlympiadGameId() != obj.getOlympiadGameId())
					continue;
				if (player.getOlympiadSide() != obj.getOlympiadSide())
					continue;
			}

			if (player.isInDuel())
			{
				if (player.getDuelId() != obj.getDuelId())
					continue;

				if (hasParty && obj.isInParty() && player.getParty().getLeaderObjectId() != obj.getParty().getLeaderObjectId())
					continue;
			}

			if (!((hasClan && obj.getClanId() == player.getClanId()) || (hasParty && obj.isInParty() && player.getParty().getLeaderObjectId() == obj.getParty().getLeaderObjectId())))
				continue;

			// Don't add this target if this is a Pc->Pc pvp
			// casting and pvp condition not met
			if (!player.checkPvpSkill(obj, skill))
				continue;

			if (!TvTEvent.checkForTvTSkill(player, obj, skill))
				continue;

			if (!onlyFirst && L2Skill.addSummon(activeChar, obj, radius, false))
				targetList.add(obj.getPet());

			if (!L2Skill.addCharacter(activeChar, obj, radius, false))
				continue;

			if (onlyFirst)
				return new L2Character[] { obj };

			if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
				break;

			targetList.add(obj);
		}

		return targetList.toArray(new L2Character[targetList.size()]);
	}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public getTargetList(skill L2Skill, activeChar L2Character, onlyFirst boolean, target L2Character) : L2Object[] from class handlers.targethandlers.TargetPartyClan


	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<>();
		if (onlyFirst)
			return new L2Character[] { activeChar };

		L2PcInstance player = null;

		if (activeChar instanceof L2Summon)
		{
			player = ((L2Summon) activeChar).getOwner();
			targetList.add(player);
		}
		else if (activeChar instanceof L2PcInstance)
		{
			player = (L2PcInstance) activeChar;
			if (activeChar.getPet() != null)
				targetList.add(activeChar.getPet());
		}

		if (activeChar.getParty() != null)
		{
			List<L2PcInstance> partyList = activeChar.getParty().getMembers();

			for (L2PcInstance partyMember : partyList)
			{
				if (partyMember == null)
					continue;
				else if (partyMember == player)
					continue;
				else if (!partyMember.isDead() && Util.checkIfInRange(skill.getSkillRadius(), activeChar, partyMember, true))
				{
					if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
						break;

					targetList.add(partyMember);

					if (partyMember.getPet() != null && !partyMember.getPet().isDead())
					{
						targetList.add(partyMember.getPet());
					}
				}
			}
		}
		return targetList.toArray(new L2Character[targetList.size()]);
	}

	@Override
	public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
	{
		List<L2Character> targetList = new FastList<L2Character>();
		if (onlyFirst)
			return new L2Character[] { activeChar };

		L2PcInstance player = null;

		if (activeChar instanceof L2Summon)
		{
			player = ((L2Summon) activeChar).getOwner();
			targetList.add(player);
		}
		else if (activeChar instanceof L2PcInstance)
		{
			player = (L2PcInstance) activeChar;
			if (activeChar.getPet() != null)
				targetList.add(activeChar.getPet());
		}

		if (activeChar.getParty() != null)
		{
			List<L2PcInstance> partyList = activeChar.getParty().getMembers();

			for (L2PcInstance partyMember : partyList)
			{
				if (partyMember == null)
					continue;
				else if (partyMember == player)
					continue;
				else if (!partyMember.isDead() && Util.checkIfInRange(skill.getSkillRadius(), activeChar, partyMember, true))
				{
					if (skill.getMaxTargets() > -1 && targetList.size() >= skill.getMaxTargets())
						break;

					targetList.add(partyMember);

					if (partyMember.getPet() != null && !partyMember.getPet().isDead())
					{
						targetList.add(partyMember.getPet());
					}
				}
			}
		}
		return targetList.toArray(new L2Character[targetList.size()]);
	}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public getTargetList(skill L2Skill, activeChar L2Character, onlyFirst boolean, target L2Character) : L2Object[] from class handlers.targethandlers.TargetPartyNotMe


	@Override
	public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int _uptime)
	{
		if (command.startsWith("debug") && command.length() > 6)
		{
			StringTokenizer st = new StringTokenizer(command.substring(6));
			// TODO: Rewrite to use ARM.
			FileOutputStream fos = null;
			OutputStreamWriter out = null;
			try
			{
				String dbg = st.nextToken();

				if (dbg.equals("decay"))
				{
					_print.print(DecayTaskManager.getInstance().toString());
				}
				else if (dbg.equals("packetsend"))
				{
					if (st.countTokens() < 2)
					{
						_print.println("Usage: debug packetsend <charName> <packetData>");
						return false;
					}
					String charName = st.nextToken();
					L2PcInstance targetPlayer = L2World.getInstance().getPlayer(charName);

					if (targetPlayer == null)
					{
						_print.println("Player " + charName + " cannot be found online");
						return false;
					}

					AdminForgePacket sp = new AdminForgePacket();
					while (st.hasMoreTokens())
					{
						String b = st.nextToken();
						if (!b.isEmpty())
							sp.addPart("C".getBytes()[0], "0x" + b);
					}

					targetPlayer.sendPacket(sp);
					_print.println("Packet sent to player " + charName);
				}
				else if (dbg.equals("PacketTP"))
				{
					String str = ThreadPoolManager.getInstance().getPacketStats();
					_print.println(str);
					int i = 0;
					File f = new File("./log/StackTrace-PacketTP-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/StackTrace-PacketTP-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(str);
				}
				else if (dbg.equals("IOPacketTP"))
				{
					String str = ThreadPoolManager.getInstance().getIOPacketStats();
					_print.println(str);
					int i = 0;
					File f = new File("./log/StackTrace-IOPacketTP-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/StackTrace-IOPacketTP-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(str);
				}
				else if (dbg.equals("GeneralTP"))
				{
					String str = ThreadPoolManager.getInstance().getGeneralStats();
					_print.println(str);
					int i = 0;
					File f = new File("./log/StackTrace-GeneralTP-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/StackTrace-GeneralTP-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(str);
				}
				else if (dbg.equals("full"))
				{
					Calendar cal = Calendar.getInstance();
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");

					StringBuilder sb = new StringBuilder();
					sb.append(sdf.format(cal.getTime()));
					sb.append("\n\nL2J Server Version: " + Config.SERVER_VERSION);
					sb.append("\nDP Revision: " + Config.DATAPACK_VERSION);
					sb.append("\n\n");
					uptime = _uptime;
					sb.append(getServerStatus());
					sb.append("\n\n");
					sb.append("\n## Java Platform Information ##");
					sb.append("\nJava Runtime Name: " + System.getProperty("java.runtime.name"));
					sb.append("\nJava Version: " + System.getProperty("java.version"));
					sb.append("\nJava Class Version: " + System.getProperty("java.class.version"));
					sb.append('\n');
					sb.append("\n## Virtual Machine Information ##");
					sb.append("\nVM Name: " + System.getProperty("java.vm.name"));
					sb.append("\nVM Version: " + System.getProperty("java.vm.version"));
					sb.append("\nVM Vendor: " + System.getProperty("java.vm.vendor"));
					sb.append("\nVM Info: " + System.getProperty("java.vm.info"));
					sb.append('\n');
					sb.append("\n## OS Information ##");
					sb.append("\nName: " + System.getProperty("os.name"));
					sb.append("\nArchiteture: " + System.getProperty("os.arch"));
					sb.append("\nVersion: " + System.getProperty("os.version"));
					sb.append('\n');
					sb.append("\n## Runtime Information ##");
					sb.append("\nCPU Count: " + Runtime.getRuntime().availableProcessors());
					sb.append("\nCurrent Free Heap Size: " + (Runtime.getRuntime().freeMemory() / 1024 / 1024) + " mb");
					sb.append("\nCurrent Heap Size: " + (Runtime.getRuntime().totalMemory() / 1024 / 1024) + " mb");
					sb.append("\nMaximum Heap Size: " + (Runtime.getRuntime().maxMemory() / 1024 / 1024) + " mb");

					sb.append('\n');
					sb.append("\n## Class Path Information ##\n");
					String cp = System.getProperty("java.class.path");
					String[] libs = cp.split(File.pathSeparator);
					for (String lib : libs)
					{
						sb.append(lib);
						sb.append('\n');
					}

					sb.append('\n');
					sb.append("## Threads Information ##\n");
					Map<Thread, StackTraceElement[]> allThread = Thread.getAllStackTraces();

					FastTable<Entry<Thread, StackTraceElement[]>> entries = new FastTable<>();
					entries.setValueComparator(new FastComparator<Entry<Thread, StackTraceElement[]>>()
					{

						/**
						 *
						 */
						private static final long serialVersionUID = 1L;

						@Override
						public boolean areEqual(Entry<Thread, StackTraceElement[]> e1, Entry<Thread, StackTraceElement[]> e2)
						{
							return e1.getKey().getName().equals(e2.getKey().getName());
						}

						@Override
						public int compare(Entry<Thread, StackTraceElement[]> e1, Entry<Thread, StackTraceElement[]> e2)
						{
							return e1.getKey().getName().compareTo(e2.getKey().getName());
						}

						@Override
						public int hashCodeOf(Entry<Thread, StackTraceElement[]> e)
						{
							return e.hashCode();
						}

					});
					entries.addAll(allThread.entrySet());
					entries.sort();
					for (Entry<Thread, StackTraceElement[]> entry : entries)
					{
						StackTraceElement[] stes = entry.getValue();
						Thread t = entry.getKey();
						sb.append("--------------\n");
						sb.append(t.toString() + " (" + t.getId() + ")\n");
						sb.append("State: " + t.getState() + '\n');
						sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + '\n');
						sb.append('\n');
						for (StackTraceElement ste : stes)
						{
							sb.append(ste.toString());
							sb.append('\n');
						}
						sb.append('\n');
					}

					sb.append('\n');
					ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
					long[] ids = findDeadlockedThreads(mbean);
					if (ids != null && ids.length > 0)
					{
						Thread[] threads = new Thread[ids.length];
						for (int i = 0; i < threads.length; i++)
						{
							threads[i] = findMatchingThread(mbean.getThreadInfo(ids[i]));
						}
						sb.append("Deadlocked Threads:\n");
						sb.append("-------------------\n");
						for (Thread thread : threads)
						{
							System.err.println(thread);
							for (StackTraceElement ste : thread.getStackTrace())
							{
								sb.append("\t" + ste);
								sb.append('\n');
							}
						}
					}

					sb.append("\n\n## Thread Pool Manager Statistics ##\n");
					for (String line : ThreadPoolManager.getInstance().getStats())
					{
						sb.append(line);
						sb.append('\n');
					}

					int i = 0;
					File f = new File("./log/Debug-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/Debug-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(sb.toString());
					out.flush();
					out.close();
					fos.close();

					_print.println("Debug output saved to log/" + f.getName());
					_print.flush();
				}
			}
			catch (Exception e)
			{
			}
			finally
			{
				try
				{
					if (out != null)
					{
						out.close();
					}
				}
				catch (Exception e)
				{
				}

				try
				{
					if (fos != null)
					{
						fos.close();
					}
				}
				catch (Exception e)
				{
				}
			}

		}
		return false;
	}

	@Override
	public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int _uptime)
	{
		if (command.startsWith("debug") && command.length() > 6)
		{
			StringTokenizer st = new StringTokenizer(command.substring(6));
			// TODO: Rewrite to use ARM.
			FileOutputStream fos = null;
			OutputStreamWriter out = null;
			try
			{
				String dbg = st.nextToken();

				if (dbg.equals("decay"))
				{
					_print.print(DecayTaskManager.getInstance().toString());
				}
				else if (dbg.equals("packetsend"))
				{
					if (st.countTokens() < 2)
					{
						_print.println("Usage: debug packetsend <charName> <packetData>");
						return false;
					}
					String charName = st.nextToken();
					L2PcInstance targetPlayer = L2World.getInstance().getPlayer(charName);

					if (targetPlayer == null)
					{
						_print.println("Player " + charName + " cannot be found online");
						return false;
					}

					AdminForgePacket sp = new AdminForgePacket();
					while (st.hasMoreTokens())
					{
						String b = st.nextToken();
						if (!b.isEmpty())
							sp.addPart("C".getBytes()[0], "0x" + b);
					}

					targetPlayer.sendPacket(sp);
					_print.println("Packet sent to player " + charName);
				}
				else if (dbg.equals("PacketTP"))
				{
					String str = ThreadPoolManager.getInstance().getPacketStats();
					_print.println(str);
					int i = 0;
					File f = new File("./log/StackTrace-PacketTP-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/StackTrace-PacketTP-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(str);
				}
				else if (dbg.equals("IOPacketTP"))
				{
					String str = ThreadPoolManager.getInstance().getIOPacketStats();
					_print.println(str);
					int i = 0;
					File f = new File("./log/StackTrace-IOPacketTP-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/StackTrace-IOPacketTP-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(str);
				}
				else if (dbg.equals("GeneralTP"))
				{
					String str = ThreadPoolManager.getInstance().getGeneralStats();
					_print.println(str);
					int i = 0;
					File f = new File("./log/StackTrace-GeneralTP-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/StackTrace-GeneralTP-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(str);
				}
				else if (dbg.equals("full"))
				{
					Calendar cal = Calendar.getInstance();
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");

					StringBuilder sb = new StringBuilder();
					sb.append(sdf.format(cal.getTime()));
					sb.append("\n\nL2J Server Version: " + Config.SERVER_VERSION);
					sb.append("\nDP Revision: " + Config.DATAPACK_VERSION);
					sb.append("\n\n");
					uptime = _uptime;
					sb.append(getServerStatus());
					sb.append("\n\n");
					sb.append("\n## Java Platform Information ##");
					sb.append("\nJava Runtime Name: " + System.getProperty("java.runtime.name"));
					sb.append("\nJava Version: " + System.getProperty("java.version"));
					sb.append("\nJava Class Version: " + System.getProperty("java.class.version"));
					sb.append('\n');
					sb.append("\n## Virtual Machine Information ##");
					sb.append("\nVM Name: " + System.getProperty("java.vm.name"));
					sb.append("\nVM Version: " + System.getProperty("java.vm.version"));
					sb.append("\nVM Vendor: " + System.getProperty("java.vm.vendor"));
					sb.append("\nVM Info: " + System.getProperty("java.vm.info"));
					sb.append('\n');
					sb.append("\n## OS Information ##");
					sb.append("\nName: " + System.getProperty("os.name"));
					sb.append("\nArchiteture: " + System.getProperty("os.arch"));
					sb.append("\nVersion: " + System.getProperty("os.version"));
					sb.append('\n');
					sb.append("\n## Runtime Information ##");
					sb.append("\nCPU Count: " + Runtime.getRuntime().availableProcessors());
					sb.append("\nCurrent Free Heap Size: " + (Runtime.getRuntime().freeMemory() / 1024 / 1024) + " mb");
					sb.append("\nCurrent Heap Size: " + (Runtime.getRuntime().totalMemory() / 1024 / 1024) + " mb");
					sb.append("\nMaximum Heap Size: " + (Runtime.getRuntime().maxMemory() / 1024 / 1024) + " mb");

					sb.append('\n');
					sb.append("\n## Class Path Information ##\n");
					String cp = System.getProperty("java.class.path");
					String[] libs = cp.split(File.pathSeparator);
					for (String lib : libs)
					{
						sb.append(lib);
						sb.append('\n');
					}

					sb.append('\n');
					sb.append("## Threads Information ##\n");
					Map<Thread, StackTraceElement[]> allThread = Thread.getAllStackTraces();

					FastTable<Entry<Thread, StackTraceElement[]>> entries = new FastTable<Entry<Thread, StackTraceElement[]>>();
					entries.setValueComparator(new FastComparator<Entry<Thread, StackTraceElement[]>>()
					{

						/**
						 *
						 */
						private static final long serialVersionUID = 1L;

						@Override
						public boolean areEqual(Entry<Thread, StackTraceElement[]> e1, Entry<Thread, StackTraceElement[]> e2)
						{
							return e1.getKey().getName().equals(e2.getKey().getName());
						}

						@Override
						public int compare(Entry<Thread, StackTraceElement[]> e1, Entry<Thread, StackTraceElement[]> e2)
						{
							return e1.getKey().getName().compareTo(e2.getKey().getName());
						}

						@Override
						public int hashCodeOf(Entry<Thread, StackTraceElement[]> e)
						{
							return e.hashCode();
						}

					});
					entries.addAll(allThread.entrySet());
					entries.sort();
					for (Entry<Thread, StackTraceElement[]> entry : entries)
					{
						StackTraceElement[] stes = entry.getValue();
						Thread t = entry.getKey();
						sb.append("--------------\n");
						sb.append(t.toString() + " (" + t.getId() + ")\n");
						sb.append("State: " + t.getState() + '\n');
						sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + '\n');
						sb.append('\n');
						for (StackTraceElement ste : stes)
						{
							sb.append(ste.toString());
							sb.append('\n');
						}
						sb.append('\n');
					}

					sb.append('\n');
					ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
					long[] ids = findDeadlockedThreads(mbean);
					if (ids != null && ids.length > 0)
					{
						Thread[] threads = new Thread[ids.length];
						for (int i = 0; i < threads.length; i++)
						{
							threads[i] = findMatchingThread(mbean.getThreadInfo(ids[i]));
						}
						sb.append("Deadlocked Threads:\n");
						sb.append("-------------------\n");
						for (Thread thread : threads)
						{
							System.err.println(thread);
							for (StackTraceElement ste : thread.getStackTrace())
							{
								sb.append("\t" + ste);
								sb.append('\n');
							}
						}
					}

					sb.append("\n\n## Thread Pool Manager Statistics ##\n");
					for (String line : ThreadPoolManager.getInstance().getStats())
					{
						sb.append(line);
						sb.append('\n');
					}

					int i = 0;
					File f = new File("./log/Debug-" + i + ".txt");
					while (f.exists())
					{
						i++;
						f = new File("./log/Debug-" + i + ".txt");
					}
					f.getParentFile().mkdirs();
					fos = new FileOutputStream(f);
					out = new OutputStreamWriter(fos, "UTF-8");
					out.write(sb.toString());
					out.flush();
					out.close();
					fos.close();

					_print.println("Debug output saved to log/" + f.getName());
					_print.flush();
				}
			}
			catch (Exception e)
			{
			}
			finally
			{
				try
				{
					if (out != null)
					{
						out.close();
					}
				}
				catch (Exception e)
				{
				}

				try
				{
					if (fos != null)
					{
						fos.close();
					}
				}
				catch (Exception e)
				{
				}
			}

		}
		return false;
	}

Replace Generic With Diamond FastTable<Entry<Thread,StackTraceElement[]>> with FastTable<> in method public useCommand(command String, _print PrintWriter, _cSocket Socket, _uptime int) : boolean from class handlers.telnethandlers.DebugHandler


	@Override
	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
		if (tmpworld instanceof CCWorld)
		{
			CCWorld world = (CCWorld) tmpworld;
			teleCoord teleto = new teleCoord();
			teleto.instanceId = world.instanceId;
			if (event.equalsIgnoreCase("TeleportOut"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 149413;
				tele.y = 173078;
				tele.z = -5014;
				exitInstance(player, tele);
			}
			else if (event.equalsIgnoreCase("TeleportParme"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 153689;
				tele.y = 142226;
				tele.z = -9750;
				tele.instanceId = world.instanceId;
				teleportplayer(player, tele);
			}
			else if (event.equalsIgnoreCase("Timer2") || event.equalsIgnoreCase("Timer3") || event.equalsIgnoreCase("Timer4") || event.equalsIgnoreCase("Timer5"))
			{
				teleto.x = 144653;
				teleto.y = 152606;
				teleto.z = -12126;
				if (player.getInstanceId() == world.instanceId)
				{
					teleportplayer(player, teleto);
					player.stopSkillEffects(5239);
					SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player);
					startQuestTimer("Timer2", 300000, npc, player);
				}
			}
			else if (event.equalsIgnoreCase("Timer21") || event.equalsIgnoreCase("Timer31") || event.equalsIgnoreCase("Timer41") || event.equalsIgnoreCase("Timer51"))
			{
				InstanceManager.getInstance().getInstance(world.instanceId).removeNpcs();
				world.npcList2.clear();
				runSteamRooms(world, STEAM1_SPAWNS, 22);
				startQuestTimer("Timer21", 300000, npc, null);
			}

			else if (event.equalsIgnoreCase("checkKechiAttack"))
			{
				if (npc.isInCombat())
				{
					startQuestTimer("spawnGuards", SPAWN[0], npc, null);
					cancelQuestTimers("checkKechiAttack");
					closeDoor(DOOR4, npc.getInstanceId());
					closeDoor(DOOR3, npc.getInstanceId());
				}
				else
					startQuestTimer("checkKechiAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("spawnGuards"))
			{
				world.kechisHenchmanSpawn++;
				world.guards.add(addSpawn(KECHIGUARD, 153622, 149699, -12131, 56890, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153609, 149622, -12131, 64023, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153606, 149428, -12131, 64541, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153601, 149534, -12131, 64901, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153620, 149354, -12131, 1164, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153637, 149776, -12131, 61733, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153638, 149292, -12131, 64071, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153647, 149857, -12131, 59402, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153661, 149227, -12131, 65275, false, 0, false, world.instanceId));
				if (world.kechisHenchmanSpawn <= 5)
					startQuestTimer("spawnGuards", SPAWN[world.kechisHenchmanSpawn], npc, null);
				else
					cancelQuestTimers("spawnGuards");
			}
			else if (event.equalsIgnoreCase("EmeraldSteam"))
			{
				runEmerald(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("CoralGarden"))
			{
				runCoral(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("spawn_oracle"))
			{
				addSpawn(32271, 153572, 142075, -9728, 10800, false, 0, false, world.instanceId);
				addSpawn((getRandom(10) < 5 ? 29116 : 29117), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, false, world.instanceId); // Baylor's Chest
				addSpawn(ORACLE_GUIDE_4, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				this.cancelQuestTimer("baylor_despawn", npc, null);
				this.cancelQuestTimers("baylor_skill");
			}
			else if (event.equalsIgnoreCase("baylorEffect0"))
			{
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
				npc.broadcastSocialAction(1);
				startQuestTimer("baylorCamera0", 11000, npc, null);
				startQuestTimer("baylorEffect1", 19000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorCamera0"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, -45, 170, 5000, 9000, 0, 0, 1, 0));
			}
			else if (event.equalsIgnoreCase("baylorEffect1"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300, 0, 120, 2000, 5000, 0, 0, 1, 0));
				npc.broadcastSocialAction(3);
				startQuestTimer("baylorEffect2", 4000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorEffect2"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 747, 0, 160, 2000, 3000, 0, 0, 1, 0));
				npc.broadcastPacket(new MagicSkillUse(npc, npc, 5402, 1, 2000, 0));
				startQuestTimer("RaidStart", 2000, npc, null);
			}
			else if (event.equalsIgnoreCase("BaylorMinions"))
			{
				for (int i = 0; i < 10; i++)
				{
					int radius = 300;
					int x = (int) (radius * Math.cos(i * 0.618));
					int y = (int) (radius * Math.sin(i * 0.618));
					L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.instanceId);
					mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
					world._animationMobs.add(mob);
				}
				startQuestTimer("baylorEffect0", 200, npc, null);
			}
			else if (event.equalsIgnoreCase("RaidStart"))
			{
				world._camera.decayMe();
				world._camera = null;
				npc.setIsParalyzed(false);
				for (L2PcInstance p : world._raiders)
				{
					p.setIsParalyzed(false);
					Throw(npc, p);
					if (p.getPet() != null)
						Throw(npc, p.getPet());
				}
				world._raidStatus = 0;
				for (L2Npc mob : world._animationMobs)
				{
					mob.doDie(mob);
				}
				world._animationMobs.clear();
				startQuestTimer("baylor_despawn", 60000, npc, null, true);
				startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("checkBaylorAttack"))
			{
				if (npc.isInCombat())
				{
					cancelQuestTimers("checkBaylorAttack");
					startQuestTimer("baylor_alarm", 40000, npc, null);
					startQuestTimer("baylor_skill", 5000, npc, null, true);
					world._raidStatus++;
				}
				else
					startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylor_alarm"))
			{
				if (world._alarm == null)
				{
					int[] spawnLoc = ALARMSPAWN[getRandom(ALARMSPAWN.length)];
					npc.addSkill(SkillTable.getInstance().getInfo(5244, 1));
					npc.addSkill(SkillTable.getInstance().getInfo(5245, 1));
					world._alarm = addSpawn(ALARMID, spawnLoc[0], spawnLoc[1], spawnLoc[2], 10800, false, 0, false, world.instanceId);
					world._alarm.disableCoreAI(true);
					world._alarm.setIsImmobilized(true);
					world._alarm.broadcastPacket(new CreatureSay(world._alarm.getObjectId(), 1, world._alarm.getName(), NpcStringId.AN_ALARM_HAS_BEEN_SET_OFF_EVERYBODY_WILL_BE_IN_DANGER_IF_THEY_ARE_NOT_TAKEN_CARE_OF_IMMEDIATELY));
				}
			}
			else if (event.equalsIgnoreCase("baylor_skill"))
			{
				if (world._baylor == null)
				{
					cancelQuestTimers("baylor_skill");
				}
				else
				{
					int maxHp = npc.getMaxHp();
					double nowHp = npc.getStatus().getCurrentHp();
					int rand = getRandom(100);

					if (nowHp < maxHp * 0.2 && world._raidStatus < 3 && npc.getFirstEffect(5224) == null && npc.getFirstEffect(5225) == null)
					{
						if (nowHp < maxHp * 0.15 && world._raidStatus == 2)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
						}
						else if (rand < 10 || nowHp < maxHp * 0.15)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
							startQuestTimer("baylor_remove_invul", 30000, world._baylor, null);
						}
					}
					else if (nowHp < maxHp * 0.3 && rand > 50 && npc.getFirstEffect(5225) == null && npc.getFirstEffect(5224) == null)
					{
						npc.doCast(SkillTable.getInstance().getInfo(5224, 1));
					}
					else if (rand < 33)
					{
						npc.setTarget(world._raiders.get(getRandom(world._raiders.size())));
						npc.doCast(SkillTable.getInstance().getInfo(5229, 1));
					}
				}
			}
			else if (event.equalsIgnoreCase("baylor_remove_invul"))
			{
				npc.stopSkillEffects(5225);
			}
			else if (event.equalsIgnoreCase("Baylor"))
			{
				world._baylor = addSpawn(29099, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				world._baylor.setIsParalyzed(true);
				world._camera = addSpawn(29120, 153273, 141400, -12738, 10800, false, 0, false, world.instanceId);
				world._camera.broadcastPacket(new SpecialCamera(world._camera.getObjectId(), 700, -45, 160, 500, 15200, 0, 0, 1, 0));
				startQuestTimer("baylorMinions", 2000, world._baylor, null);
			}
			else if (!event.endsWith("Food"))
				return "";
			else if (event.equalsIgnoreCase("autoFood"))
			{
				if (!world.crystalGolems.containsKey(npc))
					world.crystalGolems.put(npc, new CrystalGolem());
				if (world.status != 3 || !world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).foodItem != null || world.crystalGolems.get(npc).isAtDestination)
					return "";
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				List<L2Object> crystals = new FastList<>();
				for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300))
				{
					if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId() == CRYSTALFOOD)
						crystals.add(object);
				}
				int minDist = 300000;
				for (L2Object crystal : crystals)
				{
					int dx = npc.getX() - crystal.getX();
					int dy = npc.getY() - crystal.getY();
					int d = dx * dx + dy * dy;
					if (d < minDist)
					{
						minDist = d;
						cryGolem.foodItem = (L2ItemInstance) crystal;
					}
				}
				if (minDist != 300000)
					startQuestTimer("getFood", 2000, npc, null);
				else
				{
					if (getRandom(100) < 5)
						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.AH_IM_HUNGRY));
					startQuestTimer("autoFood", 2000, npc, null);
				}
				return "";
			}
			else if (!world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).isAtDestination)
				return "";
			else if (event.equalsIgnoreCase("backFood"))
			{
				if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					cancelQuestTimers("backFood");
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					world.crystalGolems.get(npc).foodItem = null;
					startQuestTimer("autoFood", 2000, npc, null);
				}
			}
			else if (event.equalsIgnoreCase("reachFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				int dx;
				int dy;
				if (cryGolem.foodItem == null || !cryGolem.foodItem.isVisible())
				{
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, cryGolem.oldpos);
					cancelQuestTimers("reachFood");
					startQuestTimer("backFood", 2000, npc, null, true);
					return "";
				}
				else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					L2World.getInstance().removeVisibleObject(cryGolem.foodItem, cryGolem.foodItem.getWorldRegion());
					L2World.getInstance().removeObject(cryGolem.foodItem);
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					cryGolem.foodItem = null;
					dx = npc.getX() - 142999;
					dy = npc.getY() - 151671;
					int d1 = dx * dx + dy * dy;
					dx = npc.getX() - 139494;
					dy = npc.getY() - 151668;
					int d2 = dx * dx + dy * dy;
					if (d1 < 10000 || d2 < 10000)
					{
						npc.broadcastPacket(new MagicSkillUse(npc, npc, 5441, 1, 1, 0));
						cryGolem.isAtDestination = true;
						world.correctGolems++;
						if (world.correctGolems >= 2)
						{
							openDoor(24220026, world.instanceId);
							world.status = 4;
						}
					}
					else
						startQuestTimer("autoFood", 2000, npc, null);
					cancelQuestTimers("reachFood");
				}
				return "";
			}
			else if (event.equalsIgnoreCase("getFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				L2CharPosition newpos = new L2CharPosition(cryGolem.foodItem.getX(), cryGolem.foodItem.getY(), cryGolem.foodItem.getZ(), 0);
				cryGolem.oldpos = new L2CharPosition(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading());
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, newpos);
				startQuestTimer("reachFood", 2000, npc, null, true);
				cancelQuestTimers("getFood");
			}
		}
		return "";
	}

	@Override
	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
		if (tmpworld instanceof CCWorld)
		{
			CCWorld world = (CCWorld) tmpworld;
			teleCoord teleto = new teleCoord();
			teleto.instanceId = world.instanceId;
			if (event.equalsIgnoreCase("TeleportOut"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 149413;
				tele.y = 173078;
				tele.z = -5014;
				exitInstance(player, tele);
			}
			else if (event.equalsIgnoreCase("TeleportParme"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 153689;
				tele.y = 142226;
				tele.z = -9750;
				tele.instanceId = world.instanceId;
				teleportplayer(player, tele);
			}
			else if (event.equalsIgnoreCase("Timer2") || event.equalsIgnoreCase("Timer3") || event.equalsIgnoreCase("Timer4") || event.equalsIgnoreCase("Timer5"))
			{
				teleto.x = 144653;
				teleto.y = 152606;
				teleto.z = -12126;
				if (player.getInstanceId() == world.instanceId)
				{
					teleportplayer(player, teleto);
					player.stopSkillEffects(5239);
					SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player);
					startQuestTimer("Timer2", 300000, npc, player);
				}
			}
			else if (event.equalsIgnoreCase("Timer21") || event.equalsIgnoreCase("Timer31") || event.equalsIgnoreCase("Timer41") || event.equalsIgnoreCase("Timer51"))
			{
				InstanceManager.getInstance().getInstance(world.instanceId).removeNpcs();
				world.npcList2.clear();
				runSteamRooms(world, STEAM1_SPAWNS, 22);
				startQuestTimer("Timer21", 300000, npc, null);
			}

			else if (event.equalsIgnoreCase("checkKechiAttack"))
			{
				if (npc.isInCombat())
				{
					startQuestTimer("spawnGuards", SPAWN[0], npc, null);
					cancelQuestTimers("checkKechiAttack");
					closeDoor(DOOR4, npc.getInstanceId());
					closeDoor(DOOR3, npc.getInstanceId());
				}
				else
					startQuestTimer("checkKechiAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("spawnGuards"))
			{
				world.kechisHenchmanSpawn++;
				world.guards.add(addSpawn(KECHIGUARD, 153622, 149699, -12131, 56890, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153609, 149622, -12131, 64023, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153606, 149428, -12131, 64541, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153601, 149534, -12131, 64901, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153620, 149354, -12131, 1164, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153637, 149776, -12131, 61733, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153638, 149292, -12131, 64071, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153647, 149857, -12131, 59402, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153661, 149227, -12131, 65275, false, 0, false, world.instanceId));
				if (world.kechisHenchmanSpawn <= 5)
					startQuestTimer("spawnGuards", SPAWN[world.kechisHenchmanSpawn], npc, null);
				else
					cancelQuestTimers("spawnGuards");
			}
			else if (event.equalsIgnoreCase("EmeraldSteam"))
			{
				runEmerald(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("CoralGarden"))
			{
				runCoral(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("spawn_oracle"))
			{
				addSpawn(32271, 153572, 142075, -9728, 10800, false, 0, false, world.instanceId);
				addSpawn((getRandom(10) < 5 ? 29116 : 29117), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, false, world.instanceId); // Baylor's Chest
				addSpawn(ORACLE_GUIDE_4, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				this.cancelQuestTimer("baylor_despawn", npc, null);
				this.cancelQuestTimers("baylor_skill");
			}
			else if (event.equalsIgnoreCase("baylorEffect0"))
			{
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
				npc.broadcastSocialAction(1);
				startQuestTimer("baylorCamera0", 11000, npc, null);
				startQuestTimer("baylorEffect1", 19000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorCamera0"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, -45, 170, 5000, 9000, 0, 0, 1, 0));
			}
			else if (event.equalsIgnoreCase("baylorEffect1"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300, 0, 120, 2000, 5000, 0, 0, 1, 0));
				npc.broadcastSocialAction(3);
				startQuestTimer("baylorEffect2", 4000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorEffect2"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 747, 0, 160, 2000, 3000, 0, 0, 1, 0));
				npc.broadcastPacket(new MagicSkillUse(npc, npc, 5402, 1, 2000, 0));
				startQuestTimer("RaidStart", 2000, npc, null);
			}
			else if (event.equalsIgnoreCase("BaylorMinions"))
			{
				for (int i = 0; i < 10; i++)
				{
					int radius = 300;
					int x = (int) (radius * Math.cos(i * 0.618));
					int y = (int) (radius * Math.sin(i * 0.618));
					L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.instanceId);
					mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
					world._animationMobs.add(mob);
				}
				startQuestTimer("baylorEffect0", 200, npc, null);
			}
			else if (event.equalsIgnoreCase("RaidStart"))
			{
				world._camera.decayMe();
				world._camera = null;
				npc.setIsParalyzed(false);
				for (L2PcInstance p : world._raiders)
				{
					p.setIsParalyzed(false);
					Throw(npc, p);
					if (p.getPet() != null)
						Throw(npc, p.getPet());
				}
				world._raidStatus = 0;
				for (L2Npc mob : world._animationMobs)
				{
					mob.doDie(mob);
				}
				world._animationMobs.clear();
				startQuestTimer("baylor_despawn", 60000, npc, null, true);
				startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("checkBaylorAttack"))
			{
				if (npc.isInCombat())
				{
					cancelQuestTimers("checkBaylorAttack");
					startQuestTimer("baylor_alarm", 40000, npc, null);
					startQuestTimer("baylor_skill", 5000, npc, null, true);
					world._raidStatus++;
				}
				else
					startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylor_alarm"))
			{
				if (world._alarm == null)
				{
					int[] spawnLoc = ALARMSPAWN[getRandom(ALARMSPAWN.length)];
					npc.addSkill(SkillTable.getInstance().getInfo(5244, 1));
					npc.addSkill(SkillTable.getInstance().getInfo(5245, 1));
					world._alarm = addSpawn(ALARMID, spawnLoc[0], spawnLoc[1], spawnLoc[2], 10800, false, 0, false, world.instanceId);
					world._alarm.disableCoreAI(true);
					world._alarm.setIsImmobilized(true);
					world._alarm.broadcastPacket(new CreatureSay(world._alarm.getObjectId(), 1, world._alarm.getName(), NpcStringId.AN_ALARM_HAS_BEEN_SET_OFF_EVERYBODY_WILL_BE_IN_DANGER_IF_THEY_ARE_NOT_TAKEN_CARE_OF_IMMEDIATELY));
				}
			}
			else if (event.equalsIgnoreCase("baylor_skill"))
			{
				if (world._baylor == null)
				{
					cancelQuestTimers("baylor_skill");
				}
				else
				{
					int maxHp = npc.getMaxHp();
					double nowHp = npc.getStatus().getCurrentHp();
					int rand = getRandom(100);

					if (nowHp < maxHp * 0.2 && world._raidStatus < 3 && npc.getFirstEffect(5224) == null && npc.getFirstEffect(5225) == null)
					{
						if (nowHp < maxHp * 0.15 && world._raidStatus == 2)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
						}
						else if (rand < 10 || nowHp < maxHp * 0.15)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
							startQuestTimer("baylor_remove_invul", 30000, world._baylor, null);
						}
					}
					else if (nowHp < maxHp * 0.3 && rand > 50 && npc.getFirstEffect(5225) == null && npc.getFirstEffect(5224) == null)
					{
						npc.doCast(SkillTable.getInstance().getInfo(5224, 1));
					}
					else if (rand < 33)
					{
						npc.setTarget(world._raiders.get(getRandom(world._raiders.size())));
						npc.doCast(SkillTable.getInstance().getInfo(5229, 1));
					}
				}
			}
			else if (event.equalsIgnoreCase("baylor_remove_invul"))
			{
				npc.stopSkillEffects(5225);
			}
			else if (event.equalsIgnoreCase("Baylor"))
			{
				world._baylor = addSpawn(29099, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				world._baylor.setIsParalyzed(true);
				world._camera = addSpawn(29120, 153273, 141400, -12738, 10800, false, 0, false, world.instanceId);
				world._camera.broadcastPacket(new SpecialCamera(world._camera.getObjectId(), 700, -45, 160, 500, 15200, 0, 0, 1, 0));
				startQuestTimer("baylorMinions", 2000, world._baylor, null);
			}
			else if (!event.endsWith("Food"))
				return "";
			else if (event.equalsIgnoreCase("autoFood"))
			{
				if (!world.crystalGolems.containsKey(npc))
					world.crystalGolems.put(npc, new CrystalGolem());
				if (world.status != 3 || !world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).foodItem != null || world.crystalGolems.get(npc).isAtDestination)
					return "";
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				List<L2Object> crystals = new FastList<L2Object>();
				for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300))
				{
					if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId() == CRYSTALFOOD)
						crystals.add(object);
				}
				int minDist = 300000;
				for (L2Object crystal : crystals)
				{
					int dx = npc.getX() - crystal.getX();
					int dy = npc.getY() - crystal.getY();
					int d = dx * dx + dy * dy;
					if (d < minDist)
					{
						minDist = d;
						cryGolem.foodItem = (L2ItemInstance) crystal;
					}
				}
				if (minDist != 300000)
					startQuestTimer("getFood", 2000, npc, null);
				else
				{
					if (getRandom(100) < 5)
						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.AH_IM_HUNGRY));
					startQuestTimer("autoFood", 2000, npc, null);
				}
				return "";
			}
			else if (!world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).isAtDestination)
				return "";
			else if (event.equalsIgnoreCase("backFood"))
			{
				if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					cancelQuestTimers("backFood");
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					world.crystalGolems.get(npc).foodItem = null;
					startQuestTimer("autoFood", 2000, npc, null);
				}
			}
			else if (event.equalsIgnoreCase("reachFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				int dx;
				int dy;
				if (cryGolem.foodItem == null || !cryGolem.foodItem.isVisible())
				{
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, cryGolem.oldpos);
					cancelQuestTimers("reachFood");
					startQuestTimer("backFood", 2000, npc, null, true);
					return "";
				}
				else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					L2World.getInstance().removeVisibleObject(cryGolem.foodItem, cryGolem.foodItem.getWorldRegion());
					L2World.getInstance().removeObject(cryGolem.foodItem);
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					cryGolem.foodItem = null;
					dx = npc.getX() - 142999;
					dy = npc.getY() - 151671;
					int d1 = dx * dx + dy * dy;
					dx = npc.getX() - 139494;
					dy = npc.getY() - 151668;
					int d2 = dx * dx + dy * dy;
					if (d1 < 10000 || d2 < 10000)
					{
						npc.broadcastPacket(new MagicSkillUse(npc, npc, 5441, 1, 1, 0));
						cryGolem.isAtDestination = true;
						world.correctGolems++;
						if (world.correctGolems >= 2)
						{
							openDoor(24220026, world.instanceId);
							world.status = 4;
						}
					}
					else
						startQuestTimer("autoFood", 2000, npc, null);
					cancelQuestTimers("reachFood");
				}
				return "";
			}
			else if (event.equalsIgnoreCase("getFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				L2CharPosition newpos = new L2CharPosition(cryGolem.foodItem.getX(), cryGolem.foodItem.getY(), cryGolem.foodItem.getZ(), 0);
				cryGolem.oldpos = new L2CharPosition(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading());
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, newpos);
				startQuestTimer("reachFood", 2000, npc, null, true);
				cancelQuestTimers("getFood");
			}
		}
		return "";
	}

Replace Generic With Diamond FastList<L2Object> with FastList<> in method public onAdvEvent(event String, npc L2Npc, player L2PcInstance) : String from class instances.CrystalCaverns.CrystalCaverns


		@Override
		public void run()
		{
			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world)
				return;
			switch (_status)
			{
				case 0: // new song play
					if (_world.isVideo)
						_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), 1000);
					else if (_world.frintezza != null && !_world.frintezza.isDead())
					{
						int rnd = getRandom(100);
						for (int i = 0; i < FRINTEZZASONGLIST.length; i++)
						{
							if (rnd < FRINTEZZASONGLIST[i].chance)
							{
								_world.OnSong = FRINTEZZASONGLIST[i];
								broadCastPacket(_world, new ExShowScreenMessage(FRINTEZZASONGLIST[i].songName, 2, 500));
								broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, FRINTEZZASONGLIST[i].skill.getSkillId(), FRINTEZZASONGLIST[i].skill.getSkillLvl(), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime(), 0));
								_world.songEffectTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 1), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime() - 10000);
								_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime());
								break;
							}
						}
					}
					break;
				case 1: // Frintezza song effect
					_world.songEffectTask = null;
					L2Skill skill = _world.OnSong.effectSkill.getSkill();
					if (skill == null)
						return;

					if (_world.frintezza != null && !_world.frintezza.isDead() && _world.activeScarlet != null && !_world.activeScarlet.isDead())
					{
						List<L2Character> targetList = new FastList<>();
						if (skill.getSkillType() == L2SkillType.STUN || skill.getSkillType() == L2SkillType.DEBUFF)
						{
							for (int objId : _world.allowed)
							{
								L2PcInstance player = L2World.getInstance().getPlayer(objId);
								if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
								{
									if (!player.isDead())
										targetList.add(player);
									if (player.getPet() != null && !player.getPet().isDead())
										targetList.add(player.getPet());
								}
							}
						}
						else
							targetList.add(_world.activeScarlet);
						if (targetList.size() > 0)
							_world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()]));
					}
					break;
				case 2: // finish morph
					_world.activeScarlet.setRHandId(SECOND_SCARLET_WEAPON);
					_world.activeScarlet.setIsInvul(false);
					break;
			}
		}

		@Override
		public void run()
		{
			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world)
				return;
			switch (_status)
			{
				case 0: // new song play
					if (_world.isVideo)
						_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), 1000);
					else if (_world.frintezza != null && !_world.frintezza.isDead())
					{
						int rnd = getRandom(100);
						for (int i = 0; i < FRINTEZZASONGLIST.length; i++)
						{
							if (rnd < FRINTEZZASONGLIST[i].chance)
							{
								_world.OnSong = FRINTEZZASONGLIST[i];
								broadCastPacket(_world, new ExShowScreenMessage(FRINTEZZASONGLIST[i].songName, 2, 500));
								broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, FRINTEZZASONGLIST[i].skill.getSkillId(), FRINTEZZASONGLIST[i].skill.getSkillLvl(), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime(), 0));
								_world.songEffectTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 1), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime() - 10000);
								_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime());
								break;
							}
						}
					}
					break;
				case 1: // Frintezza song effect
					_world.songEffectTask = null;
					L2Skill skill = _world.OnSong.effectSkill.getSkill();
					if (skill == null)
						return;

					if (_world.frintezza != null && !_world.frintezza.isDead() && _world.activeScarlet != null && !_world.activeScarlet.isDead())
					{
						List<L2Character> targetList = new FastList<L2Character>();
						if (skill.getSkillType() == L2SkillType.STUN || skill.getSkillType() == L2SkillType.DEBUFF)
						{
							for (int objId : _world.allowed)
							{
								L2PcInstance player = L2World.getInstance().getPlayer(objId);
								if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
								{
									if (!player.isDead())
										targetList.add(player);
									if (player.getPet() != null && !player.getPet().isDead())
										targetList.add(player.getPet());
								}
							}
						}
						else
							targetList.add(_world.activeScarlet);
						if (targetList.size() > 0)
							_world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()]));
					}
					break;
				case 2: // finish morph
					_world.activeScarlet.setRHandId(SECOND_SCARLET_WEAPON);
					_world.activeScarlet.setIsInvul(false);
					break;
			}
		}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public run() : void from class instances.FinalEmperialTomb.FinalEmperialTomb.SongTask


	@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.isCastingNow() && !npc.isDead() && !_lematanNpc.isDead())
			{
				npc.setTarget(_lematanNpc);
				npc.doCast(energy_skill);
			}
			startQuestTimer("follower_cast", 2000 + Rnd.get(100, 1000), npc, null);
			return null;
		}
		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)
			{
				st.set("cond", "2");
				return "32498-07.htm";
			}
			return "32498-09.htm";
		}
		else if (event.equalsIgnoreCase("32498-05.htm"))
		{
			if (cond == 0)
			{
				st.set("cond", "1");
				st.setState(State.STARTED);
				st.playSound("ItemSound.quest_accept");
			}
		}
		else if (event.equalsIgnoreCase("32501-03.htm"))
		{
			if (cond == 2)
			{
				st.giveItems(SWORD, 1);
				st.set("cond", "3");
				st.playSound("ItemSound.quest_middle");
			}
		}
		else if (event.equalsIgnoreCase("32510-02.htm"))
		{
			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)
			{
				// Reduce Hate
				((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)
		{
			// Teleport Lematan
			npc.teleToLocation(84973, -208721, -3340);
			// Set onShip
			_isOnShip = true;
			// Set Spawn loc to ship. If he loose aggro he should stay on board ;)
			npc.getSpawn().setLocx(84973);
			npc.getSpawn().setLocy(-208721);
			npc.getSpawn().setLocz(-3340);
			// To be sure, reduce again
			((L2Attackable) npc).reduceHate(player, 9999);
			// Spawn followers
			_followerslist = new FastList<>();
			for (int[] SPAWN : FOLLOWERS_SPAWNS)
			{
				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 onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		// Must be here, because of player == null
		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);
			return null;
		}
		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)
			{
				st.set("cond", "2");
				return "32498-07.htm";
			}
			return "32498-09.htm";
		}
		else if (event.equalsIgnoreCase("32498-05.htm"))
		{
			if (cond == 0)
			{
				st.set("cond", "1");
				st.setState(State.STARTED);
				st.playSound("ItemSound.quest_accept");
			}
		}
		else if (event.equalsIgnoreCase("32501-03.htm"))
		{
			if (cond == 2)
			{
				st.giveItems(SWORD, 1);
				st.set("cond", "3");
				st.playSound("ItemSound.quest_middle");
			}
		}
		else if (event.equalsIgnoreCase("32510-02.htm"))
		{
			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)
			{
				// Reduce Hate
				((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)
		{
			// Teleport Lematan
			npc.teleToLocation(84973, -208721, -3340);
			// Set onShip
			_isOnShip = true;
			// Set Spawn loc to ship. If he loose aggro he should stay on board ;)
			npc.getSpawn().setLocx(84973);
			npc.getSpawn().setLocy(-208721);
			npc.getSpawn().setLocz(-3340);
			// To be sure, reduce again
			((L2Attackable) npc).reduceHate(player, 9999);
			// Spawn followers
			_followerslist = new FastList<L2Npc>();
			for (int[] SPAWN : FOLLOWERS_SPAWNS)
			{
				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;
	}

Replace Generic With Diamond FastList<L2Npc> with FastList<> in method public onAdvEvent(event String, npc L2Npc, player L2PcInstance) : String from class instances.Pailaka.PailakaDevilsLegacy


	@Override
	public boolean eventStart()
	{
		// 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<>();

		// Set Event active
		_isactive = true;

		// Spawn Elpy's
		int location = getRandom(0, _locations.length - 1);

		int[] _spawndata = _spawns[location];

		_elpies_count = 0;

		for (int i = 0; i < _option_howmuch; i++)
		{
			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("Help us exterminate them!");
		Announcements.getInstance().announceToAll("You have " + _event_time + " min...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

	@Override
	public boolean eventStart()
	{
		// 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>();

		// Set Event active
		_isactive = true;

		// Spawn Elpy's
		int location = getRandom(0, _locations.length - 1);

		int[] _spawndata = _spawns[location];

		_elpies_count = 0;

		for (int i = 0; i < _option_howmuch; i++)
		{
			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("Help us exterminate them!");
		Announcements.getInstance().announceToAll("You have " + _event_time + " min...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

Replace Generic With Diamond FastList<L2Npc> with FastList<> in method public eventStart() : boolean from class mods.eventmodElpies.eventmodElpies


	@Override
	public boolean eventStart()
	{
		// 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<>();

		// Set Event active
		_isactive = true;

		// Spawn Manager
		recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);

		// Spawn Chests
		for (int i = 0; i < _option_howmuch; i++)
		{
			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...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

	@Override
	public boolean eventStart()
	{
		// 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>();

		// Set Event active
		_isactive = true;

		// Spawn Manager
		recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);

		// Spawn Chests
		for (int i = 0; i < _option_howmuch; i++)
		{
			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...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

Replace Generic With Diamond FastList<L2Npc> with FastList<> in method public eventStart() : boolean from class mods.eventmodRabbits.eventmodRabbits


	private void load()
	{
		try
		{
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			factory.setValidating(false);
			factory.setIgnoringComments(true);

			File file = new File(Config.DATAPACK_ROOT, "data/levelUpCrystalData.xml");
			if (!file.exists())
			{
				_log.severe("[EnhanceYourWeapon] Missing levelUpCrystalData.xml. The quest wont work without it!");
				return;
			}

			Document doc = factory.newDocumentBuilder().parse(file);
			Node first = doc.getFirstChild();
			if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
			{
				for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
				{
					if ("crystal".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("itemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing itemId in Crystal List, skipping");
									continue;
								}
								int itemId = Integer.parseInt(attrs.getNamedItem("itemId").getNodeValue());

								att = attrs.getNamedItem("level");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing level in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int level = Integer.parseInt(attrs.getNamedItem("level").getNodeValue());

								att = attrs.getNamedItem("leveledItemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing leveledItemId in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int leveledItemId = Integer.parseInt(attrs.getNamedItem("leveledItemId").getNodeValue());

								_soulCrystals.put(itemId, new SoulCrystal(level, itemId, leveledItemId));
							}
						}
					}
					else if ("npc".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("npcId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing npcId in NPC List, skipping");
									continue;
								}
								int npcId = Integer.parseInt(att.getNodeValue());

								FastMap<Integer, LevelingInfo> temp = new FastMap<>();

								for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
								{
									boolean isSkillNeeded = false;
									int chance = 5;
									AbsorbCrystalType absorbType = AbsorbCrystalType.LAST_HIT;

									if ("detail".equalsIgnoreCase(cd.getNodeName()))
									{
										attrs = cd.getAttributes();

										att = attrs.getNamedItem("absorbType");
										if (att != null)
										{
											absorbType = Enum.valueOf(AbsorbCrystalType.class, att.getNodeValue());
										}

										att = attrs.getNamedItem("chance");
										if (att != null)
										{
											chance = Integer.parseInt(att.getNodeValue());
										}

										att = attrs.getNamedItem("skill");
										if (att != null)
										{
											isSkillNeeded = Boolean.parseBoolean(att.getNodeValue());
										}

										Node att1 = attrs.getNamedItem("maxLevel");
										Node att2 = attrs.getNamedItem("levelList");
										if ((att1 == null) && (att2 == null))
										{
											_log.severe("[EnhanceYourWeapon] Missing maxlevel/levelList in NPC List npcId: " + npcId + ", skipping");
											continue;
										}
										LevelingInfo info = new LevelingInfo(absorbType, isSkillNeeded, chance);
										if (att1 != null)
										{
											int maxLevel = Integer.parseInt(att1.getNodeValue());
											for (int i = 0; i <= maxLevel; i++)
											{
												temp.put(i, info);
											}
										}
										else
										{
											StringTokenizer st = new StringTokenizer(att2.getNodeValue(), ",");
											int tokenCount = st.countTokens();
											for (int i = 0; i < tokenCount; i++)
											{
												Integer value = Integer.decode(st.nextToken().trim());
												if (value == null)
												{
													_log.severe("[EnhanceYourWeapon] Bad Level value!! npcId: " + npcId + " token: " + i);
													value = 0;
												}
												temp.put(value, info);
											}
										}
									}
								}

								if (temp.isEmpty())
								{
									_log.severe("[EnhanceYourWeapon] No leveling info for npcId: " + npcId + ", skipping");
									continue;
								}
								_npcLevelingInfos.put(npcId, temp);
							}
						}
					}
				}
			}
		}
		catch (Exception e)
		{
			_log.log(Level.WARNING, "[EnhanceYourWeapon] Could not parse levelUpCrystalData.xml file: " + e.getMessage(), e);
		}
		_log.info("[EnhanceYourWeapon] Loaded " + _soulCrystals.size() + " Soul Crystal data.");
		_log.info("[EnhanceYourWeapon] Loaded " + _npcLevelingInfos.size() + " npc Leveling info data.");
	}

	private void load()
	{
		try
		{
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			factory.setValidating(false);
			factory.setIgnoringComments(true);

			File file = new File(Config.DATAPACK_ROOT, "data/levelUpCrystalData.xml");
			if (!file.exists())
			{
				_log.severe("[EnhanceYourWeapon] Missing levelUpCrystalData.xml. The quest wont work without it!");
				return;
			}

			Document doc = factory.newDocumentBuilder().parse(file);
			Node first = doc.getFirstChild();
			if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
			{
				for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
				{
					if ("crystal".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("itemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing itemId in Crystal List, skipping");
									continue;
								}
								int itemId = Integer.parseInt(attrs.getNamedItem("itemId").getNodeValue());

								att = attrs.getNamedItem("level");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing level in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int level = Integer.parseInt(attrs.getNamedItem("level").getNodeValue());

								att = attrs.getNamedItem("leveledItemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing leveledItemId in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int leveledItemId = Integer.parseInt(attrs.getNamedItem("leveledItemId").getNodeValue());

								_soulCrystals.put(itemId, new SoulCrystal(level, itemId, leveledItemId));
							}
						}
					}
					else if ("npc".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("npcId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing npcId in NPC List, skipping");
									continue;
								}
								int npcId = Integer.parseInt(att.getNodeValue());

								FastMap<Integer, LevelingInfo> temp = new FastMap<Integer, LevelingInfo>();

								for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
								{
									boolean isSkillNeeded = false;
									int chance = 5;
									AbsorbCrystalType absorbType = AbsorbCrystalType.LAST_HIT;

									if ("detail".equalsIgnoreCase(cd.getNodeName()))
									{
										attrs = cd.getAttributes();

										att = attrs.getNamedItem("absorbType");
										if (att != null)
										{
											absorbType = Enum.valueOf(AbsorbCrystalType.class, att.getNodeValue());
										}

										att = attrs.getNamedItem("chance");
										if (att != null)
										{
											chance = Integer.parseInt(att.getNodeValue());
										}

										att = attrs.getNamedItem("skill");
										if (att != null)
										{
											isSkillNeeded = Boolean.parseBoolean(att.getNodeValue());
										}

										Node att1 = attrs.getNamedItem("maxLevel");
										Node att2 = attrs.getNamedItem("levelList");
										if ((att1 == null) && (att2 == null))
										{
											_log.severe("[EnhanceYourWeapon] Missing maxlevel/levelList in NPC List npcId: " + npcId + ", skipping");
											continue;
										}
										LevelingInfo info = new LevelingInfo(absorbType, isSkillNeeded, chance);
										if (att1 != null)
										{
											int maxLevel = Integer.parseInt(att1.getNodeValue());
											for (int i = 0; i <= maxLevel; i++)
											{
												temp.put(i, info);
											}
										}
										else
										{
											StringTokenizer st = new StringTokenizer(att2.getNodeValue(), ",");
											int tokenCount = st.countTokens();
											for (int i = 0; i < tokenCount; i++)
											{
												Integer value = Integer.decode(st.nextToken().trim());
												if (value == null)
												{
													_log.severe("[EnhanceYourWeapon] Bad Level value!! npcId: " + npcId + " token: " + i);
													value = 0;
												}
												temp.put(value, info);
											}
										}
									}
								}

								if (temp.isEmpty())
								{
									_log.severe("[EnhanceYourWeapon] No leveling info for npcId: " + npcId + ", skipping");
									continue;
								}
								_npcLevelingInfos.put(npcId, temp);
							}
						}
					}
				}
			}
		}
		catch (Exception e)
		{
			_log.log(Level.WARNING, "[EnhanceYourWeapon] Could not parse levelUpCrystalData.xml file: " + e.getMessage(), e);
		}
		_log.info("[EnhanceYourWeapon] Loaded " + _soulCrystals.size() + " Soul Crystal data.");
		_log.info("[EnhanceYourWeapon] Loaded " + _npcLevelingInfos.size() + " npc Leveling info data.");
	}

Replace Generic With Diamond FastMap<Integer,LevelingInfo> with FastMap<> in method private load() : void from class quests.Q350_EnhanceYourWeapon.Q350_EnhanceYourWeapon


	@Override
	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		int npcId = npc.getNpcId();
		QuestState st = player.getQuestState(qn);
		for (int Archon_Minion = 21646; Archon_Minion < 21652; Archon_Minion++)
		{
			if (npcId == Archon_Minion)
			{
				L2Party party = player.getParty();
				if (party != null)
				{
					L2FastList<QuestState> PartyQuestMembers = new L2FastList<>();
					for (L2PcInstance player1 : party.getMembers())
					{
						QuestState st1 = findQuest(player1);
						if ((st1 != null) && player1.isInsideRadius(player, Config.ALT_PARTY_RANGE2, false, false))
						{
							if (st1.getInt("cond") == 15)
							{
								PartyQuestMembers.add(st1);
							}
						}
					}
					if (PartyQuestMembers.size() > 0)
					{
						QuestState st2 = PartyQuestMembers.get(getRandom(PartyQuestMembers.size()));
						giveHallishaMark(st2);
					}
				}
				else
				{
					QuestState st1 = findQuest(player);
					if (st1 != null)
					{
						if (st1.getInt("cond") == 15)
						{
							giveHallishaMark(st1);
						}
					}
				}
				return super.onKill(npc, player, isPet);
			}
		}

		int[] Archon_Hellisha_Norm =
		{
			18212,
			18214,
			18215,
			18216,
			18218
		};
		for (int element : Archon_Hellisha_Norm)
		{
			if (npcId == element)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 15)
					{
						// This is just a guess....not really sure what it actually says, if anything
						AutoChat(npc, Text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
						st1.giveItems(Items[8], 1);
						st1.takeItems(Items[3], -1);
						st1.set("cond", "16");
						st1.playSound("ItemSound.quest_middle");
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}

		for (int Guardian_Angel = 27214; Guardian_Angel < 27217; Guardian_Angel++)
		{
			if (npcId == Guardian_Angel)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 6)
					{
						if (st1.getInt("kills") < 9)
						{
							st1.set("kills", String.valueOf(st1.getInt("kills") + 1));
						}
						else
						{
							st1.playSound("ItemSound.quest_middle");
							st1.giveItems(Items[5], 1);
							st1.set("cond", "7");
						}
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}
		if ((st != null) && (npcId != Mob[2]))
		{
			QuestState st2 = findRightState(npc);
			if (st2 == null)
			{
				return super.onKill(npc, player, isPet);
			}
			int cond = st.getInt("cond");
			if ((npcId == Mob[0]) && (cond == 8))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[12].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[6], 1);
						st.set("cond", "9");
						st.playSound("ItemSound.quest_middle");
					}
				}
				cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
			else if ((npcId == Mob[1]) && (cond == 15))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[4].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[8], 1);
						st.takeItems(Items[3], -1);
						st.set("cond", "16");
						st.playSound("ItemSound.quest_middle");
					}
					else
					{
						AutoChat(npc, Text[5].replace("PLAYERNAME", player.getName()));
					}
				}
				cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
		}
		else
		{
			if (npcId == Mob[0])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Mob_1 has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
			else if (npcId == Mob[1])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Archon Hellisha has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
		}
		return super.onKill(npc, player, isPet);
	}

	@Override
	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		int npcId = npc.getNpcId();
		QuestState st = player.getQuestState(qn);
		for (int Archon_Minion = 21646; Archon_Minion < 21652; Archon_Minion++)
		{
			if (npcId == Archon_Minion)
			{
				L2Party party = player.getParty();
				if (party != null)
				{
					L2FastList<QuestState> PartyQuestMembers = new L2FastList<QuestState>();
					for (L2PcInstance player1 : party.getMembers())
					{
						QuestState st1 = findQuest(player1);
						if ((st1 != null) && player1.isInsideRadius(player, Config.ALT_PARTY_RANGE2, false, false))
						{
							if (st1.getInt("cond") == 15)
							{
								PartyQuestMembers.add(st1);
							}
						}
					}
					if (PartyQuestMembers.size() > 0)
					{
						QuestState st2 = PartyQuestMembers.get(getRandom(PartyQuestMembers.size()));
						giveHallishaMark(st2);
					}
				}
				else
				{
					QuestState st1 = findQuest(player);
					if (st1 != null)
					{
						if (st1.getInt("cond") == 15)
						{
							giveHallishaMark(st1);
						}
					}
				}
				return super.onKill(npc, player, isPet);
			}
		}

		int[] Archon_Hellisha_Norm =
		{
			18212,
			18214,
			18215,
			18216,
			18218
		};
		for (int element : Archon_Hellisha_Norm)
		{
			if (npcId == element)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 15)
					{
						// This is just a guess....not really sure what it actually says, if anything
						AutoChat(npc, Text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
						st1.giveItems(Items[8], 1);
						st1.takeItems(Items[3], -1);
						st1.set("cond", "16");
						st1.playSound("ItemSound.quest_middle");
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}

		for (int Guardian_Angel = 27214; Guardian_Angel < 27217; Guardian_Angel++)
		{
			if (npcId == Guardian_Angel)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 6)
					{
						if (st1.getInt("kills") < 9)
						{
							st1.set("kills", String.valueOf(st1.getInt("kills") + 1));
						}
						else
						{
							st1.playSound("ItemSound.quest_middle");
							st1.giveItems(Items[5], 1);
							st1.set("cond", "7");
						}
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}
		if ((st != null) && (npcId != Mob[2]))
		{
			QuestState st2 = findRightState(npc);
			if (st2 == null)
			{
				return super.onKill(npc, player, isPet);
			}
			int cond = st.getInt("cond");
			if ((npcId == Mob[0]) && (cond == 8))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[12].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[6], 1);
						st.set("cond", "9");
						st.playSound("ItemSound.quest_middle");
					}
				}
				cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
			else if ((npcId == Mob[1]) && (cond == 15))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[4].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[8], 1);
						st.takeItems(Items[3], -1);
						st.set("cond", "16");
						st.playSound("ItemSound.quest_middle");
					}
					else
					{
						AutoChat(npc, Text[5].replace("PLAYERNAME", player.getName()));
					}
				}
				cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
		}
		else
		{
			if (npcId == Mob[0])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Mob_1 has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
			else if (npcId == Mob[1])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Archon Hellisha has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
		}
		return super.onKill(npc, player, isPet);
	}

Replace Generic With Diamond L2FastList<QuestState> with L2FastList<> in method public onKill(npc L2Npc, player L2PcInstance, isPet boolean) : String from class quests.SagasScripts.SagasSuperClass


    public static <T> PageResult<T> error(IExceptionService codeEnum) {
        return new PageResult<>(codeEnum);
    }

    public static <T> PageResult<T> error(IExceptionService codeEnum) {
        return new PageResult<T>(codeEnum.getCode(), codeEnum.getMessage());
    }

Replace Generic With Diamond PageResult<T> with PageResult<> in method public error(codeEnum IExceptionService) : PageResult<T> from class com.liyz.boot3.common.api.result.PageResult


  @Test
  void checkDomain() throws IOException {
    ConcurrentTaskScheduler taskScheduler = create();
    AtomicBoolean ok = new AtomicBoolean(false);
    taskScheduler.addTask(new FutureTask<>((Callable<Object>) () -> {
      ThreadLocalContext.checkDomain("test");
      ok.set(true);
      return true;
    }));
    WaitForState.waitFor(100, TimeUnit.MILLISECONDS, ok::get);

    taskScheduler.addTask(new FutureTask<>((Callable<Object>) () -> {
      try {
        ThreadLocalContext.checkDomain("should_fail");
        ok.set(true);
      } catch (Exception exception) {
        ok.set(false);
      }
      return true;
    }));
    WaitForState.waitFor(100, TimeUnit.MILLISECONDS, ()-> !ok.get());
  }

  @Test
  void checkDomain() throws IOException {
    ConcurrentTaskScheduler taskScheduler = create();
    AtomicBoolean ok = new AtomicBoolean(false);
    taskScheduler.addTask(new FutureTask<>(new Callable<Object>(){
      @Override
      public Object call() throws Exception {
        ThreadLocalContext.checkDomain("test");
        ok.set(true);
        return true;
      }
    }));
    WaitForState.waitFor(100, TimeUnit.MILLISECONDS, ()->ok.get());

    taskScheduler.addTask(new FutureTask<>(new Callable<Object>(){
      @Override
      public Object call() throws Exception {
        try {
          ThreadLocalContext.checkDomain("should_fail");
          ok.set(true);
        } catch (Exception exception) {
          ok.set(false);
        }
        return true;
      }
    }));
    WaitForState.waitFor(100, TimeUnit.MILLISECONDS, ()-> !ok.get());
  }

Replace Anonymous With Lambda io.mapsmessaging.utilities.threads.tasks.ConcurrentTaskSchedulerTest.checkDomain.addTask.new FutureTask<>.new Callable<Object> with () -> {tryThreadLocalContext.checkDomain("should_fail"); in method package checkDomain() : void from class io.mapsmessaging.utilities.threads.tasks.ConcurrentTaskSchedulerTest


  @NotNull
  @Override
  public  Future<?> submit(@NotNull Runnable task) {
    return addTask(new FutureTask<>(task, new VoidResponse()));
  }

  @NotNull
  @Override
  public  Future<?> submit(@NotNull Runnable task) {
    return addTask(new FutureTask<VoidResponse>(task, new VoidResponse()));
  }

Replace Generic With Diamond FutureTask<VoidResponse> with FutureTask<> in method public submit(task Runnable) : Future<?> from class io.mapsmessaging.utilities.threads.tasks.ConcurrentTaskScheduler