• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.X+ TFS 1.4.2 protection holy

Mjmackan

Mapper ~ Writer
Joined
Jul 18, 2009
Messages
1,474
Solutions
17
Reaction score
194
Location
Sweden
Doing a protection spell-type of thing, can't find anything similiar, someone up to help?

Below doesn't seem to work, any ideas? Its suppose to protect X(storage) percent protection.
LUA:
function updateHolyProtection(player) --fully solved
local holyTalent = Condition(CONDITION_ATTRIBUTES)
    holyTalent:setParameter(CONDITION_PARAM_SUBID, 50014)
    holyTalent:setParameter(COMBAT_HOLYDAMAGE, (player:getStorageValue(50014)))
    holyTalent:setParameter(CONDITION_PARAM_TICKS, -1)
    player:addCondition(holyTalent)
end
 
'''Lua
local holyBlock = CreatureEvent("HolyBlock")

function holyBlock.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not creature:isPlayer() then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end

local STORAGE = 12345

if creature:getStorageValue(STORAGE) == 1 then
if primaryType == COMBAT_HOLYDAMAGE then
primaryDamage = 0
end

if secondaryType == COMBAT_HOLYDAMAGE then
secondaryDamage = 0
end
end

return primaryDamage, primaryType, secondaryDamage, secondaryType
end

holyBlock:register()
'''
 
Back
Top