scripts/globals/spells/bluemagic/head_butt.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/globals/spells/bluemagic/head_butt.lua b/scripts/globals/spells/bluemagic/head_butt.lua index b3e5ada..cdb486c 100644 --- a/scripts/globals/spells/bluemagic/head_butt.lua +++ b/scripts/globals/spells/bluemagic/head_butt.lua @@ -19,12 +19,20 @@ function onSpellCast(caster,target,spell) params.str_wsc = 0.2; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.2; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; damage = BluePhysicalSpell(caster, target, spell, params); damage = BlueFinalAdjustments(caster, target, spell, damage, params); - -if(target:hasStatusEffect(EFFECT_STUN)) then - spell:setMsg(75); -- no effect - else -target:addStatusEffect(EFFECT_STUN,0,0,math.random(1,5)); - end + + if(target:hasStatusEffect(EFFECT_STUN)) then + spell:setMsg(75); -- no effect + else + local bonus = AffinityBonus(caster, spell:getElement()); + local dINT = caster:getStat(MOD_INT) - target:getStat(MOD_INT); + local resist = applyResistance(caster,spell,target,dINT,37,bonus); + + if(resist <= 0.125) then + spell:setMsg(85); + else + target:addStatusEffect(EFFECT_STUN,0,0,math.random(1,5)); + end + end return damage; end; \ No newline at end of file