Page 1 of 1

fixing "//reload npc" and quests problem

Posted: Mon May 25, 2009 9:55 pm
by Ghurdyl
L2J Revision 3014:
L2JDP Revision 6075:

Hello,

I'm tying to fix the problem we have when a GM uses "//reload npc" command.

(When command is used, NPC don't handle any quest anymore. Clicking "[quest]" link simply closes the window)

I found that the command actually triggers an null pointer exception in net.sf.l2j.gameserver.instancemanager.QuestManager.java at line 90 (line 8 in the piece of code below).
Reloading npc involves reloading quests (I don't know why actually but this is in the datapack side)

Code: Select all

    public final void reloadAllQuests(){        _log.info("Reloading Server Scripts");        try        {            // unload all scripts            for (Quest quest : _quests.values())            {                if (quest != null)                    quest.unload();            }            // now load all scripts            File scripts = new File(Config.DATAPACK_ROOT + "/data/scripts.cfg");            L2ScriptEngineManager.getInstance().executeScriptList(scripts);            QuestManager.getInstance().report();        }        catch (IOException ioe)        {            _log.severe("Failed loading scripts.cfg, no script going to be loaded");        }}
It's quite strange to get a null pointer exception on that line. ( for (Quest quest : _quests.values()) )
the _quests attribute is initialized when declared ( private Map<String, Quest> _quests = new FastMap<String, Quest>();) so it cannot be null ... I think.

If we completely remove that "for" loop, the command "//reload npc" reloads npc and quests without error.
The problem is that it seems that quests are loaded twice : a given NPC who usually give "quest A, quest B" will now give "Quest A, Quest B, Quest A, Quest B". (they are only twice, typing more "//reload npc" don't add more lines to NPC HTLM quest message)

The strangest stuff is that if GM uses "//reload quests" before "//reload npc" then everything seems to be allright. Quests are working and are not found twice.

So I am looking for some help in fixing that.

Re: fixing "//reload npc" and quests problem

Posted: Sat Jun 13, 2009 7:30 am
by KARAKAN
some devs should check this !

Re: fixing "//reload npc" and quests problem

Posted: Sat Jun 13, 2009 10:33 am
by janiii

Re: fixing "//reload npc" and quests problem

Posted: Thu Jan 13, 2011 3:59 am
by galagard
the command "//reload quest <number>" don't work anymore?

Re: fixing "//reload npc" and quests problem

Posted: Thu Jan 13, 2011 5:37 pm
by shinomidefuego
-.- yes it works, read the entire post

Re: fixing "//reload npc" and quests problem

Posted: Sat Jan 15, 2011 4:52 am
by galagard
Sorry but, //reload quests <number> don't work

the correct is //script_load <name>

Re: fixing "//reload npc" and quests problem

Posted: Fri Jun 07, 2013 3:27 am
by TeNaCiOuS
janiii wrote:viewtopic.php?f=75&t=11907
test and report ;)
not exist :S

Re: fixing "//reload npc" and quests problem

Posted: Fri Jun 07, 2013 10:30 am
by St3eT
TeNaCiOuS wrote:
janiii wrote:viewtopic.php?f=75&t=11907
test and report ;)
not exist :S

by janiii » Sat Jun 13, 2009 12:33 pm

Image