So I didn't get any luck finding where the path companion is set, and instead began working on a more complex feature: the event system (which I used to called the script system).

I've got my head around how it works which unlocks a lot of possibilities with the game. As I've mentioned before, every actor has a script bound to it as it's created. This basically instantiates a new object in the Lua engine as the class you are binding to it. For example, if you want an NPC to have access to the PopulaceLinkshellManager (LS Person) script, you instantiate it as a PopulaceLinkshellManager object in packet 0xCC. Then this actor is initialized according to it's lua script (IE: a Retainer will have it's nameplate purple), and the server can call it's functions. Here is an example:

I've spawned Emoni; the linkshell manager that stood in the Carline Canopy (aka Adventurer's Guild). Her Lua object was instantiated from the PopulaceLinkshellManager class, so any function I send to her has to be part of that script.

undefined

When I talk to her, the client will send packet 0x12D to start the event. Given is the actor id involved, something I call an "eventStarter" (not sure what it actually related to) which for NPCs is "talkDefault", some fields I don't know yet, and a bunch of Lua parameters.

undefined

In response, the server sends 0x130, telling what function to fire as well as the original "eventStarter". Lua parameters are also given. In the LinkshellManager script is a bunch of functions labeled "talkEvent1", "talkEvent2", etc. TalkEvent1 and 2 take a single boolean, if false the NPC acts like you never saw a LS, if true the opposite. I skipped "talkEvent1" since it's just an intro speech, and instead fired "talkEvent2" with the boolean set to false.

undefined

After going through the LS creation process, the client sends a 0x12E packet, the "EventUpdate" packet. This basically means the function has returned with some parameters and the client now waits for either another function to fire, or the "EndEvent" packet 0x131. Here you can see the script returned the chosen name and crest the player selected.

undefined

undefined

My plan is to move all this processing into lua scripts so that new handlers can be added and modified with ease. After this is built and fleshed out, a LOT of the game will be easier to implement. NPCs are not the only thing that uses this: 90% of commands in the game fire off a start event packet, though a lot don't go through the whole update/end event portion. Stuff that send 0x12D include emotes, battle actions (ws/spells), basic functions like check/trade/invite/kick/etc, and some menus.

Higher res pictures here: http://imgur.com/a/YrvRx