forgottenserver
forgottenserver copied to clipboard
Skull system
Pull Request Prelude
- [X] I have followed proper The Forgotten Server code styling.
- [X] I have read and understood the contribution guidelines before making this PR.
- [X] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
Introduced skull system described in https://tibia.fandom.com/wiki/Skull_System
@EPuncker Can you add reviewers?
Please use the new string formatting style fmt
@MillhioreBT Where do you want me to use that formatting?
@MillhioreBT Where do you want me to use that formatting?
Sorry for not specifically suggesting where
In everything that makes use of: std::ostringstream
This is suggested in the PR #3351, apparently the idea is to get rid of the use of std::ostringstream
and using fmt
instead
@MillhioreBT In my opinion, as long as there are usages of ostringstream
inside that file, we shouldn't mix up different approaches. There should be a separate PR to replace all uses to fmt
in iologindata.cpp
.
I would rather have the control be done in Lua instead, but I consider it an improvement over the current situation.
I also support the idea of handling this in lua, as this seems to be a feature that anyone would want to manipulate for their own purposes and modifications ;), but as rani says, this is fine in any case
It actually shouldn't be hard to move to lua, it's bunch of queries and some logic and we have ondeath/onpreparedeath/onkill events, so you can slap skull system there easily. Honestly I don't see any limitations to make this in lua.
@nekiro @DSpeichert
I don't see it being one system vs the other but rather as different parameters to the same system. We could even ship presets, e.g. make skulls
in config.lua
be a table and allow to set skulls = skullPreset.default
or skulls = skullPreset.legacy
If this is the correct behavior there is no reason not to add it to 1.5, and for those who like the old version, they could simply use version 1.4 along with the 10.98 protocol.
We could leave both systems in place simultaneously - have per day/week/month limits + frag decay and red skull threshold.
But this is okay new behavior as-is.
@DSpeichert I rebased it and solved conflicts.
when merged is going to be added?
I believe this system can be implemented in Lua. When a player is killed by another, recalculate the skull; using a storage value to keep track of skull duration and an event to clear it if the player is online when it expires, or check on login. We already have skull functions in Lua.