Hello, I have a problem with exp bonus castle when a guild takes over such a castle.
After taking over the castle the guild does not get bonus exp.
data/events/player.lua
data/lib/castle.lua
After taking over the castle the guild does not get bonus exp.
data/events/player.lua
Code:
function Player:onGainExperience(source, exp, rawExp)
local xpCastle = 0
if self:getGuild() and self:getGuild():getId() == CASTLE24H:getGuildIdFromCastle() then
xpCastle = exp * 1.20 -- +20% XP
end
data/lib/castle.lua
LUA:
function CASTLE24H:getGuildIdFromCastle()
local guildId = -1
local resultId = db.storeQuery("SELECT `guild_id` FROM `castle`;")
if (resultId ~= false) then
guildId = result.getDataInt(resultId, "guild_id")
result.free(resultId)
end
return guildId
end
Attachments
-
image.png3.8 KB · Views: 7 · VirusTotal
Last edited: