mirror of
https://github.com/opentibiabr/canary
synced 2026-08-16 06:26:09 -04:00
This refactors the PlayerDeath event script to improve code readability and maintainability. The original function has been split into smaller, more focused functions, each handling a specific part of the player death processing logic. This includes identifying the killer, logging deaths in the database, sending messages to the guild channel, and checking guild wars. With this refactoring, the code is more modular and easier to understand, making future modifications and maintenance more manageable. The PlayerDeath event logic remains unchanged, ensuring the system continues to function as expected. Changes: •. Split the onDeath function into smaller local functions. •. Improved SQL query formatting using string.format for clarity and to avoid repetitive code. •. Renamed local variables to follow the camelCase convention.
9 lines
266 B
Lua
9 lines
266 B
Lua
dofile(CORE_DIRECTORY .. "/libs/systems/blessing.lua")
|
|
|
|
local adventurerBlessingLogin = CreatureEvent("AdventurerBlessingLogin")
|
|
|
|
function adventurerBlessingLogin.onLogin(player)
|
|
return Blessings.doAdventurerBlessing(player)
|
|
end
|
|
|
|
adventurerBlessingLogin:register()
|