Skip to content

Featured Replies

Hi guys. Does anybody know why is this error showing up on gameserver console ?

 com.l2jserver.gameserver.model.quest.Quest showError
WARNING: game\data\scripts\quests\QuestMasterHandler.java
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.LinkedList.checkElementIndex(Unknown Source)
	at java.util.LinkedList.get(Unknown Source)
	at quests.Q00663_SeductiveWhispers.Q00663_SeductiveWhispers.onKill(Q00663_SeductiveWhispers.java:753)
	at com.l2jserver.gameserver.model.quest.Quest.notifyKill(Quest.java:591)
	at com.l2jserver.gameserver.model.quest.Quest.lambda$addKillId$15(Quest.java:1941)
	at com.l2jserver.gameserver.model.events.listeners.ConsumerEventListener.executeEvent(ConsumerEventListener.java:46)
	at com.l2jserver.gameserver.model.events.EventDispatcher.notifyToListeners(EventDispatcher.java:242)
	at com.l2jserver.gameserver.model.events.EventDispatcher.notifyEventImpl(EventDispatcher.java:216)
	at com.l2jserver.gameserver.model.events.EventDispatcher.notifyEvent(EventDispatcher.java:85)
	at com.l2jserver.gameserver.model.events.EventDispatcher.lambda$notifyEventAsyncDelayed$1(EventDispatcher.java:135)
	at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Edited by milosvamp


at quests.Q00663_SeductiveWhispers.Q00663_SeductiveWhispers.onKill(Q00663_SeductiveWhispers.java:753)

Q00663_SeductiveWhispers quest checks content of a List (probably using a .get), but the list is either empty or has been edited meanwhile (and so indexes don't match anymore).

  • Author

Q00663_SeductiveWhispers quest checks content of a List (probably using a .get), but the list is either empty or has been edited meanwhile (and so indexes don't match anymore).

Thanks, is it a big problem and should i fix it... ( and how ) :X ?

 

this is the line that is console showing

 

753 line -------    final L2PcInstance rewardedPlayer = players.get(getRandom(players.size()));

Edited by milosvamp

show getRandom() method

  • Author

This was the whole method.....  thank you melron

final L2PcInstance rewardedPlayer = players.get(getRandom(players.size()));
		if ((rewardedPlayer != null) && Util.checkIfInRange(1500, npc, rewardedPlayer, false))
		{
			final int rnd = getRandom(1000);
			
			if (npc.getId() == SPITEFUL_SOUL_LEADER)
			{
				if (rnd <= SPITEFUL_SOUL_LEADER_CHANCE)
				{
					giveItems(rewardedPlayer, SPIRIT_BEAD, 2);
				}
				else
				{
					giveItems(rewardedPlayer, SPIRIT_BEAD, 1);
				}
			}
			else if (rnd < MONSTERS.get(npc.getId()))
			{
				giveItems(rewardedPlayer, SPIRIT_BEAD, 1);
				playSound(rewardedPlayer, Sound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
		
		return super.onKill(npc, killer, isSummon);
	}

As Tk said, players List looks empty. Upload whole code on pastebin.

Edited by SweeTs

  • Author

As Tk said, players List looks empty. Upload whole code on pastebin.

ok here is it, thank you very much

 

https://pastebin.com/4vWMzrBq

  • 1 month later...

Hi, I'm sorry for posting in this thread, but I didn't want to make a new one, since I'm getting the same error.

The weird thing is I never really started the quest. I just wanted to test how is the drop in FG, and when I killed a Doom Night I got this:

Shot00013.jpg

Here's a link to the code, since the link above is dead.

https://pastebin.com/grE16mRk

 

Any ideas on that? Thanks! :)

 

 

Edited by toshkabg

as @SweeTs said players list is empty to avoid error replace line 753 with 

final L2PcInstance rewardedPlayer = (players.size() == 0) ? null : players.get(getRandom(players.size()));

22 minutes ago, SamDev-Coder said:

as @SweeTs said players list is empty to avoid error replace line 753 with 

final L2PcInstance rewardedPlayer = (players.size() == 0) ? null : players.get(getRandom(players.size()));

Thank you!  My Java skills are close to none, so that was very helpful.

I need to educate myself...

  • Author
5 hours ago, toshkabg said:

Thank you!  My Java skills are close to none, so that was very helpful.

I need to educate myself...

so this is the fix ? 

  • Author

Nevermind, yes it it ! Thank you very much guys.

Just change the 753 line with:  final L2PcInstance rewardedPlayer = (players.size() == 0) ? null : players.get(getRandom(players.size()));   

 

Thank you guys one more time !

The post can be locked.

 

  • SweeTs locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.