----------------------------------------- -- Spell: Repose ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) duration = 90; bonus = AffinityBonus(caster, spell); pMND = caster:getStat(MOD_MND); mMND = target:getStat(MOD_MND); dMND = (pMND - mMND); resm = applyResistance(caster,spell,target,dMND,DIVINE_MAGIC_SKILL,bonus); if(resm < 0.5) then spell:setMsg(85);--resist message return EFFECT_SLEEP_II; end if(target:hasStatusEffect(EFFECT_SLEEP_II) or target:hasStatusEffect(EFFECT_SLEEP_I)) then --No effect spell:setMsg(75); else spell:setMsg(237); target:addStatusEffect(EFFECT_SLEEP_II,1,0,duration); end return EFFECT_SLEEP_II; end;