fixing "//reload npc" and quests problem

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Locked
Ghurdyl
Posts: 55
Joined: Tue Jun 03, 2008 4:52 pm
Location: Hannut, Belgium

fixing "//reload npc" and quests problem

Post 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.
~Ghurdyl~
"If you give a man a fire, he'll be warm for a day. If you set a man on fire, he'll be warm for the rest of his life" :)
KARAKAN
Posts: 74
Joined: Thu May 04, 2006 11:31 am

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

Post by KARAKAN »

some devs should check this !
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

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

Post by janiii »

DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
galagard
Posts: 28
Joined: Tue Dec 21, 2010 5:58 am

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

Post by galagard »

the command "//reload quest <number>" don't work anymore?
User avatar
shinomidefuego
Posts: 122
Joined: Thu Jun 28, 2007 5:37 pm
Location: Venezuela
Contact:

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

Post by shinomidefuego »

-.- yes it works, read the entire post
Image
MMMMMmmmmmMMMMM
galagard
Posts: 28
Joined: Tue Dec 21, 2010 5:58 am

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

Post by galagard »

Sorry but, //reload quests <number> don't work

the correct is //script_load <name>
User avatar
TeNaCiOuS
Posts: 10
Joined: Mon May 23, 2011 12:17 pm
Location: Chile

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

Post by TeNaCiOuS »

janiii wrote:viewtopic.php?f=75&t=11907
test and report ;)
not exist :S
User avatar
St3eT
Posts: 961
Joined: Sun Mar 07, 2010 6:50 pm

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

Post 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
If i should be black sheep for sure no as punishment
Image
Locked