Jump to content

Question

Posted (edited)

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

12 answers to this question

Recommended Posts

  • 0
Posted

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).

  • 0
Posted (edited)

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
  • 0
Posted

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);
	}
  • 0
Posted (edited)

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
  • 0
Posted

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()));

  • 0
Posted
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...

  • 0
Posted
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 ? 

  • 0
Posted

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.

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...