Sneak Script Bug
Posted: Mon Aug 13, 2012 11:25 pm
I noticed sneak was lasting a long time so I checked out the code.
It looks like when composure is active on the target the duration is multiplied twice?
Code: Select all
function onSpellCast(caster,target,spell)
if (target:hasStatusEffect(EFFECT_SNEAK) == false) then
duration = math.random(30, 300);
duration = math.random(30, 300);
duration = math.random(30, 300);
if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then
duration = duration * 3;
end
if (target:getMainLvl() < 20) then
duration = duration * target:getMainLvl() / 20; -- level adjustment
end
if (target:getEquipID(15) == 13692) then -- skulker's cape
duration = duration * 1.5;
end
if (caster:hasStatusEffect(EFFECT_COMPOSURE)) and (caster:getID() == target:getID()) then
duration = duration * 3;
end
spell:setMsg(0);
target:addStatusEffect(EFFECT_SNEAK,0,10,math.floor(duration));
else
spell:setMsg(75); -- no effect.
end
end;