Huge Hellbound Issues

Issue #168 resolved
Avanael created an issue

In the current develop branch, there are still two huge issues for hellbound which hasn't been adressed yet.

First Issue: If you set hellbound to any level, you'll see all 598 Spawns being spawned when it really shouldn't.

for (Node element = npc.getFirstChild(); element != null; element = element.getNextSibling())
            {
                System.out.println("Element Node: " + element.getNodeName());
                final NamedNodeMap attrs = element.getAttributes();
                minLevel = 1;
                maxLevel = 100;
                switch (element.getNodeName())
                {
                    case "location":
                    {
                        loc = new Location(parseInteger(attrs, "x"), parseInteger(attrs, "y"), parseInteger(attrs, "z"), parseInteger(attrs, "heading", 0));
                        break;
                    }
                    case "respawn":
                    {
                        delay = parseInteger(attrs, "delay");
                        randomInterval = attrs.getNamedItem("randomInterval") != null ? parseInteger(attrs, "randomInterval") : 1;
                        break;
                    }
                    case "hellboundLevel":
                    {
                        minLevel = parseInteger(attrs, "min", 1);
                        maxLevel = parseInteger(attrs, "max", 100);
                        break;
                    }
                }
            }

That's in HellboundSpawns.java and you see that I've put a print line at the start of the loop and that's what I've got so far:

Element Node: location
Element Node: #text
Element Node: respawn
Element Node: #text
Element Node: hellboundLevel
Element Node: #text

It loops through text nodes (aka white spaces) too, so technically because minLevel/maxLevel is setted to 1/100 before the switch, it will always save 1/100 for every NPC in the HashMap.

Second issue is in the same file:

_spawnLevels.put(npcId, new int[]
                {
                    minLevel,
                    maxLevel
                });

Let's assume you're parsing 2 NPCs with the same ID and they should spawn in different levels. One spawns up to 4, the other one from 5 onwards.

While the loop goes on, the second one overrides the first one. The first one will never spawn in any case.

Comments (11)

  1. Avanael reporter

    Well yeah that's what I'm talking about, no one has adressed this yet and it's the reason I created this ticket. But yours and mine is nowhere close to the solution, I think it needs to be reworked.

  2. ShinichiYao

    Yes! That's really a huge issue and been discussed over one year. I didn't realized that its never been fixed since then. Which makes the whole HellBound part useless.

  3. Avanael reporter

    Yep, but I think it counts the same for the automatic way, haven't looked into L2J for a long time now.

  4. Log in to comment