function onLogin(player)
for aid, shrine in pairs(SHRINES_CONFIG) do
local storage = player:getStorageValue(shrine.storage)
if storage > 0 then
player:setStorageValue(shrine.storage, 0)
end
end
player:registerEvent("ShrinesDeath")
player:registerEvent("ShrinesHealth")
player:registerEvent("ShrinesKill")
return true
end
function onLogout(player)
for aid, shrine in pairs(SHRINES_CONFIG) do
local storage = player:getStorageValue(shrine.storage)
if storage > 0 then
player:setStorageValue(shrine.storage, 0)
end
end
return true
end
function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
for aid, shrine in pairs(SHRINES_CONFIG) do
local storage = player:getStorageValue(shrine.storage)
if storage > 0 then
player:setStorageValue(shrine.storage, 0)
end
end
return true
end
function onKill(player, target, lastHit)
return Shrines_onKill(player, target, lastHit)
end
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
return Shrines_onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
end