Need a way to auto-generate the QUEST_HELPER table
It is extremely painful to add rows to the QUEST_HELPER table by hand. I would like to remove this table altogether but at the very least we should have a way to generate it automatically.
I think it is impossible with these EVT files because we know which questID corresponds to which quest from the comments in the EVT if there is any, Addition to that, there is no info about the NPC that is the quest is displayed, so unless you first organise the EVT by adding these kind of stuff, there is no way that I can think to do that.
I agree, using just the EVTs this is impossible but the server itself is able to pair each NPC with an EventID so perhaps we can find some way of using that information. I need to look into how the server does this. Currently, to implement a NPC I have the GameServer printing out the NPC id and the event id and then we manually add a row to the QUEST_HELPER table based on this information. I would be nice to have the server auto-generate some SQL whenever a NPC is selected but no EventID exists and all we have to do is paste this SQL into the sql manager to add the row (or even have the server automatically insert a new row into the table). I don't know, we'll have to play around with this.
Correct me if I'm wrong, but, as far as I remember, the server doesn't pairs the NPC with the EventID , we specify the NPC for a EventID in QUEST_HELPER.Of course, if you are talking about the NPCs like gates or the one who is dealing with cape and the symbol of the clan's, it is different.
Sometimes when you right click in an NPC you get that information. If it doesn't happen all the time when yes you are correct. Lol someone should write up a tutorial about this shit. I've worked with all aspects of the NPC questing system and I'm constantly forgetting how everything works. How the hell do we figure it out then? Lol. Like how do we know what to put in the table? There must be some sort of procedure to it, we aren't just getting lucky here.
In the version 15xx and the later versions of the game, these quests are all in .tbl files, so if we can fill the QUEST_HELPER table from those .tbls.
You're honestly better off not trying to shoehorn the new system with the old. Frankly, the new system's painful enough to deal with as it is.
Having said that, you could still implement your scripts by NPC instead of zone. Converting the existing EVTs for that that would still be... um, a little painful. Theoretically it's possible but you'd have to properly parse the EVT, link them with (unique) NPCs (in the zone) via their byTypes and then only dump applicable event chains back in a Lua format.
Or just rewrite them from scratch, because there was never that much to them (that said, now I'm feeling a little like taking a stab at that -_-).
As far as connecting them server-side where there's no direct attachment, that's easy: you just store the currently selected NPC. I believe the codebase should already do it even (if not, pretty simple tweak to make).