otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.57k stars 1.05k forks source link

Added request resource balance #4646

Closed reyaleman closed 3 months ago

reyaleman commented 5 months ago

Pull Request Prelude

Changes Proposed

Added request resource balance so it's triggered when the client requests certain resources (gold, charm points, prey wildcards, etc)

This is used in:

Not used in:

Issues addressed: None.

krecikondexin commented 5 months ago

I'm not sure if charms point will work, did you test it?

please check this PR: https://github.com/otland/forgottenserver/pull/4614

reyaleman commented 5 months ago

I'm not sure if charms point will work, did you test it?

please check this PR: #4614

When opening cyclopedia window it requests the following resources balances.

[Info] Requested resource type 0x1E (charm points)
[Info] Requested resource type 0x00 (gold in bank)
[Info] Requested resource type 0x01 (gold equipped)

Keep in mind it doesn't replaces that you'll have to send an updated balance when using any resource, i.e. when unlocking a charm and losing some charm points as the request only occurs when opening those type of windows.

ranisalt commented 4 months ago

Keep in mind it doesn't replaces that you'll have to send an updated balance when using any resource

Fun fact: the Tibia client handles this so badly that if your premium time expires while you are online, and you open your character list again (Ctrl+G by default), it will update premium status and shit itself closing everything that's premium-only, no matter what you are doing. It happened to me in the middle of a hunt :<