fredi-68 / luswca

Remember to put full project title here
GNU General Public License v3.0
0 stars 0 forks source link

Trigger level up after surpassing score threshold #48

Closed fredi-68 closed 5 years ago

fredi-68 commented 5 years ago

We can do this easily by looking into the client database, it has a table that tells us how much score is needed for each level. All we have to do is check these thresholds against our current value in character.Character.addLegoScore() and send the correct game messages upon detecting a level up (as well as incrementing player level). This is also where level up rewards will be handed out. It remains to be discovered if those rewards were implemented as missions (in which case we just add an achievement hook here) or were hardcoded into the server.

fredi-68 commented 5 years ago

I've implemented the mapping and the server now correctly keeps track of the player experience and level values. However, in doing so I discovered an issue with the mission system: Score points are given out to the player, but the client never updates the display. In fact, 0x05b3 ModifyLegoScore doesn't seem to do anything at all... I must be sending it at the wrong time because it IS working for achievements. Well, unless the client just counts those automatically.

fredi-68 commented 5 years ago

After looking at traffic for a bit, the issue was easily fixed by changing the sourceType of the score to 2. Which apparently stands for "Actually Fucking Work". Successfully tested on some random achievement from Frostburg as well so I think it is safe to say that this will just work for everything