Page 1 of 1

Sneak Script Bug

Posted: Mon Aug 13, 2012 11:25 pm
by lautan
I noticed sneak was lasting a long time so I checked out the code.

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;
It looks like when composure is active on the target the duration is multiplied twice?

Re: Sneak Script Bug

Posted: Tue Aug 14, 2012 4:46 am
by bluekirby0
That does appear to be the case. If you could do us a favor and post a report on the bug tracker, someone should be able to fix it soon.

Re: Sneak Script Bug

Posted: Tue Aug 14, 2012 1:52 pm
by lautan
Thanks I will be submitting all bugs to there for now on. I will also try to fix some of these issues myself.