Jump to content
  • 0

Console


milosvamp

Question

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
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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);
	}
Link to comment
Share on other sites

  • 0

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

Edited by SweeTs
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 0

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.

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...