LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
303 stars 614 forks source link

🐛 Gain Experience ROE Doesn't Work Like Retail #6098

Open drummerix opened 3 months ago

drummerix commented 3 months ago

I affirm:

OS / platform the server is running (if known)

Ubuntu

Branch affected by issue

base

Steps to reproduce

During Gain Experience Time ROE event, you do not get points if you level up while gaining the EXP. If you do not level up, then it counts the points under Gain Experience.

Expected behavior

In retail, Gain Experience counts the points even when you level up.

I researched the issue and tracked it down to charutils.cpp. During a LEVELUP event, the code just passes a level up event and then returns before passing a EXP_GAIN event if it needs to. I fixed it in my local copy by copying the code underneath where it checks that the EXP was from a monster and then raises the EXP_GAIN event under roe.

I copied line 5101 in charutils.cpp to line 5083 and it fixed it for me:

if (PMob != PChar) // Only mob kills count for gain EXP records { roeutils::event(ROE_EXPGAIN, PChar, RoeDatagram("exp", exp)); }

claywar commented 3 months ago

This is not just limited to Gain XP objective, but all RoE objectives that grant XP (and most likely CP as well, but fairly certain in normal gameplay its not possible to get >30cp in a single objective). Retail behavior for this is that it will grant up to 1 xp less on the following level, but not pass that point (so if you hit a level that is 10k to the following, it'll cap rewarded xp at 9999)

claywar commented 3 months ago

Following up, in addition, levels gained as a result of RoE objectives should not display the level up animation