eq2emu-content/Spells/Fighter/Intercept.lua
2025-08-16 00:00:06 +00:00

38 lines
No EOL
1.2 KiB
Lua
Executable file

--[[
Script Name : Spells/Fighter/Intercept.lua
Script Author : John Adams
Script Date : 2013.08.10 02:08:36
Script Notes : Intercept damage to Target --]]
function precast(Caster, Target)
if GetID(Caster) == GetID(Target) then
return false, 38
end
return true
end
function cast(Caster, Target)
local HalfMaxHP = GetMaxHP(Target) * .5
local CurrentHP = GetHP(Target)
--Say(Caster, "[DEVL: HalfMaxHP: " .. HalfMaxHP .. " CurrentHP: " .. CurrentHP)
if CurrentHP <= HalfMaxHP then
AddWard(0,0,0,0,25,0,50,2)
-- 100% chance to intercept all damage on target.
-- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
-- Spell ends after 2 successful intercepts.
else
AddWard(0,0,0,0,25,0,50,1)
-- 100% chance to intercept all damage on target.
-- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
-- Spell ends after 1 successful intercept.
end
end
function remove(Caster, Target)
RemoveWard()
end