Here is the new Cure 1:
Code: Select all
function onSpellCast(caster,target,spell)
--Pull base stats from caster.
MND = caster:getStat(MOD_MND);
VIT = target:getStat(MOD_VIT);
Healing = caster:getSkillLevel(HEALING_MAGIC_SKILL);
power = ((3 * MND) + (VIT) + (3 * math.floor(Healing / 5)));
--printf("MIND: %u",MND);
--printf("VIT: %u",VIT);
--printf("POWER: %u",power);
-- Rate and Constant are based on which soft caps have been overcome by the caster.
rate = 1;
constant = -10;
if(power > 100) then
rate = 57;
constant = 29.125;
elseif(power > 60) then
rate = 2;
constant = 5;
end
--Amount to cure the target with.
cure = (math.floor(power / 2)) / (rate) + constant;
--printf("CURE: %u",cure);
--Adjust bonus for staff.
--staff = StaffBonus(caster,spell);--Don't need this anymore.
--Check for cure potency equipment. Cure potency caps at 50%
potency = caster:getMod(MOD_CURE_POTENCY);
if(potency > 50)
potency = 0.5;
else
potency = (potency / 100)
end;
day = 1;--spellDayWeatherBonus(caster, spell, false);
--print("Total day/weather bonus:",day);
--Final amount to heal the target with.
--final = cure * day * (1 + potency) * CURE_POWER;
final = cure * day;
-- Do it!
if(target:getRank() ~= nil) then
--Divine Seal adds 100% to cure potency
if(caster:getStatusEffect(EFFECT_DIVINE_SEAL) ~= nil) then
potency = potency + 1;
end;
final = (final * potency);
--Raise the amount above the minimum hard cap. Cure used as a nuke CAN hit for 0, so this check is inside this if block.
if(final < 10) then
final = 10;
end;
final = (final * CURE_POWER);
--Apply stoneskin from Afflatus Solace, 25% of cure power after potency and Divine Seal
if(caster:getStatusEffect(EFFECT_AFFLATUS_SOLACE) ~= nil) and (target:getStatusEffect(EFFECT_STONESKIN) == nil) then
Afflatus_Stoneskin = math.floor(final / 4);
if(Afflatus_Stoneskin > 300) then
Afflatus_Stoneskin = 300;
end;
target:addStatusEffect(EFFECT_STONESKIN,Afflatus_Stoneskin,0,25);
end;
--Check to see if the target doesn't need that much healing.
maxhp = target:getMaxHP();
hp = target:getHP();
diff = (maxhp - hp);
if(final > diff) then
final = diff;
end;
final = math.floor(final);
target:addHP(final);
else
final = (final * potency * CURE_POWER);
harm = 1;--cureResist(target:getFamily());
if(harm < 0) then
spell:setMsg(2);
if(mobfinal < 0) then
mobfinal = mobfinal * -1;
end;
target:delHP(mobfinal);
final = mobfinal;
else
final = 0;
end;
end;
caster:updateEnmityFromCure(target,final);
return final;
end;