srmeier/KnightOnline

WIZ_CLASS_CHANGE subopcode 6 needs implementing

SavvyNik opened this issue · 8 comments

Once you've completed your lvl 10 quest you must relog in order to see your skills. It'd be nice to have the job change to complete online. Almost seems like a bug with the quest at first because I forgot this was an issue with the original KO.

When you say "original KO" what are you referring to? Does this happen with the official 1.298 server + client? I don't remember this being an issue; I would very much believe it's something specific to our stuff.

I was going off memory so I'm uncertain. I need a copy of some 1.298 server files and a client and I can give it a try. Actually, that'd be nice to have. Anyone have a place to download them from?

I've just looked into it, and the server's at fault. The opcode isn't considered as "read" when the packet (from the server) is passed to CUser::ClassChange(), so it gets read as the subopcode.. and what should be the class is the subopcode.

But it looks like someone's tampered with this method because they've thought that value was a "class code" (aka like, 2 for rogue). Only it's always 2, regardless, because it's actually just the subopcode. And we have a bunch of error checks added to it for no reason because of this.

It's a mess, and all of that can go, but the takeaway is that it's the server's fault that it's breaking and not official behaviour.

Edit:
By which I mean to say it's not official behaviour, but it is behaviour that needs to be implemented (subopcode 6). This exists and works fine in the official 1.298 client though.

Changed the title for this. The remaining issue is simply that our client source needs to implement subopcode 6 for WIZ_CLASS_CHANGE to handle:

  1. Showing the effect on the specified player
  2. Changing the class for the specified player
  3. When the specified player is ourselves, we need to reset the skillbar (to remove references to old skills) and reload the skill tree (InitIconUpdate()).

Would the idea be in CGameProcMain::MsgRecv_NpcChangeOpen() when the client receives the packet sub op code 6 to invoke a class that handles a NoviceClassChange? Should we be creating a new class for this or using an existing?

There's really no need. It literally only needs to do the 3 things I mentioned, which only need a very small method for an extra handler.

@twostars
I've done some work and ran into one thing. I think strings in the Skills UI will need to be updated. For example, a rouge becomes hunter on first skill change etc.. Some input if I'm on the right track would be great. Also I need to find the correct FX to be shown when a user changes his class (1920 heal).

ClassChange commit

Possibly CUISkillTreeDlg::PageButtonInitialize() -> CUISkillTreeDlg::SetPageInCharRegion()?