Sneak Script Bug

Forum rules
NO LONGER BEING MAINTAINED!
Post Reply
lautan
Developer
Posts: 164
Joined: Mon Jul 30, 2012 6:17 pm

Sneak Script Bug

Post by lautan » Mon Aug 13, 2012 11:25 pm

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?

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Sneak Script Bug

Post by bluekirby0 » Tue Aug 14, 2012 4:46 am

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.

lautan
Developer
Posts: 164
Joined: Mon Jul 30, 2012 6:17 pm

Re: Sneak Script Bug

Post by lautan » Tue Aug 14, 2012 1:52 pm

Thanks I will be submitting all bugs to there for now on. I will also try to fix some of these issues myself.

Post Reply