forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Added Loyalty System (10.74)

Open reyaleman opened this issue 3 years ago • 2 comments

Pull Request Prelude

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)

loyalty

Issues addressed: #3871 Version 10.74 (The Loyalty System was introduced.)

Any comments would be highly appreciated. 😃

reyaleman avatar May 29 '22 15:05 reyaleman

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

omarcopires avatar Jun 09 '23 18:06 omarcopires

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 👀

reyaleman avatar Jun 09 '23 19:06 reyaleman