forgottenserver
forgottenserver copied to clipboard
Added Loyalty System (10.74)
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
- Implemented LOYALTY SYSTEM
- System is optional, can be disabled in config.lua (loyaltyEnabled = false)
- Loyalty bonuses are customizables in config.lua
- Modified Player::GetPercentLevel to return floats (client support decimal numbers on skill bars)
- Loyalty Titles onLook
- Loyalty message bonus on serverlog (Player:onLogin script)
- Kept skill & tries untouched, loyalty is calculated when the player is loaded.
- Loyalty points are updated on startup but only if it's been more than 1 day since last update (server config)
- Added 3 lua functions (Player:getLoyaltyStatus, Player:addLoyalty & Player:removeLoyalty)
- Added migration file to update database (column "loyalty_points" added to accounts table and inserted server config "loyalty_update" value to update loyalty on a daily basis)
Missing:
- Social loyalty badges (social not implemented yet)
- Loyalty highscores (highscores not implemented yet)

Issues addressed: #3871 Version 10.74 (The Loyalty System was introduced.)
Any comments would be highly appreciated. 😃
could you leave some extra functions in LUA to be used in cyclopedia?
getLoyaltyMagicLevel, getLoyaltySkill and getLoyaltyTitleDescription
I also think it would be better to move the descriptions to onLook instead of keeping them directly in the engine
I'd have to rewrite this and make a new pull request (taking your comments in consideration), IIRC I stopped this because I was having issues with float values being inexact 👀