Hey there,
browse the forum and seen some older posts, they seem to work but not really
TFS 1.4 and using OTC
here is my lua spell
here is my lua creaturescript script
i have edited the login.lua and all is well, i cast the spell but it blocks ALL damage, not just energy, it also blocks melee, fire, etc...
browse the forum and seen some older posts, they seem to work but not really
TFS 1.4 and using OTC
here is my lua spell
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
local protect = Condition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT)
protect:setParameter(CONDITION_PARAM_SUBID, 56)
protect:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
protect:setParameter(CONDITION_PARAM_TICKS, 5 * 1000)
combat:addCondition(protect)
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
here is my lua creaturescript script
LUA:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if creature and creature:isPlayer() then
if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 56) then
if primaryType == COMBAT_ENERGYDAMAGE then
primaryDamage = primaryDamage / 2
end
if secondaryType == COMBAT_ENERGYDAMAGE then
secondaryDamage = secondaryDamage / 2
end
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
i have edited the login.lua and all is well, i cast the spell but it blocks ALL damage, not just energy, it also blocks melee, fire, etc...
Last edited: