Remove cache and batch event libraries, update locales

Deleted the cache and batch event libraries from the codebase, including all related client, server, and shared files. Removed server-side particle library and associated client event handlers. Updated utility and clothing modules to remove cache dependencies. Improved utility logging and deprecated point functions with notices. Updated all locales to use a consistent 'PurchasedItem' message format and added Bulgarian (bg) translation. Bumped version to 0.13.1 in fxmanifest.
This commit is contained in:
MrNewb committed 2025-12-23 19:27:27 -05:00
1 parent 5fd0744ca5
commit 48f8122197
76 files changed
+488 -875

No files matched your search

+27 -24
View File
@@ -1,42 +1,54 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
XP_CACHE = {}
local cachedXp = {}
-- Calculate XP required for a level using RuneScape algorithm (with caching)
Skills.GetXPForLevel = function(level)
function Skills.GetResourceName()
return "default"
end
---Calculate XP required for a level using RuneScape algorithm (with caching)
---@param level number
---@return number
function Skills.GetXPForLevel(level)
if not level or level < 1 then return 0 end
if level == 1 then return 0 end -- Level 1 requires 0 XP
-- Check cache first
if XP_CACHE[level] then
return XP_CACHE[level]
end
if cachedXp[level] then return cachedXp[level] end
-- Calculate and cache
local xp = 0
for n = 1, level - 1 do
xp = xp + math.floor(n + 300 * (2 ^ (n / 7)))
end
local result = math.floor(xp / 4)
XP_CACHE[level] = result
cachedXp[level] = result
return result
end
-- Create a skill (for initialization)
Skills.Create = function(name, maxLevel, baseXP)
---Create a skill (for initialization)
---@param name string
---@param maxLevel number
---@param baseXP number
---@return table
function Skills.Create(name, maxLevel, baseXP)
if not name then return end
Skills.All[name] = { name = name, maxLevel = maxLevel or 99, baseXP = baseXP or 50 }
return Skills.All[name]
end
Skills.GetScaledXP = function(baseXP, playerLevel)
---Get scaled XP based on player level
---@param baseXP number
---@param playerLevel number
---@return number
function Skills.GetScaledXP(baseXP, playerLevel)
return math.floor(baseXP * (1 + playerLevel * 0.05))
end
-- Get XP required to complete the current level
Skills.GetXPRequiredForLevel = function(level)
---@param level number
---@return number
function Skills.GetXPRequiredForLevel(level)
if not level or level < 1 then return 0 end
if level == 1 then return 83 end -- Level 1 to 2 requires 83 XP
return Skills.GetXPForLevel(level)
@@ -45,7 +57,7 @@ end
---This will get the skill level of the passed skill name. (returns 1 if not found)
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
function Skills.GetSkillLevel(skillName)
if not skillName then return 0 end
local plyrSkills = Bridge.Framework.GetPlayerMetaData("community_bridge_skills")
if not plyrSkills or not plyrSkills[skillName] then return 1 end
@@ -55,20 +67,11 @@ end
---This will get the skill xp of the passed skill name. (returns 1 if not found)
---@param skillName string
---@return number
Skills.GetXP = function(skillName)
function Skills.GetXP(skillName)
if not skillName then return 0 end
local plyrSkills = Bridge.Framework.GetPlayerMetaData("community_bridge_skills")
if not plyrSkills or not plyrSkills[skillName] then return 1 end
return plyrSkills[skillName].currentXP or 1
end
Skills.GetResourceName = function()
return "default"
end
-- RegisterCommand("getfishingLevel", function(source, args)
-- local level = Skills.GetSkillLevel("fishing")
-- print("Client Fishing Level issssssssss " .. level)
-- end, false)
return Skills