Page 1 of 1

Buff keeps on casting

Posted: Tue Dec 07, 2010 4:22 am
by botje

Code: Select all

<onSkillCast><![CDATA[
		player:updateBuffs("player")
		if player.Class1 == CLASS_KNIGHT then
			if not player:hasBuff("Enhanced Armor") then
				player:cast(KNIGHT_ENHANCED_ARMOR);
			end
		else
			if not player:hasBuff("Blocking Stance") then
				player:cast("WARRIOR_BLOCKING_STANCE");
			end
		end
	]]></onSkillCast>
this SHOULD only cast when its not there, but it keeps casting O.o

Code: Select all

<skill name="WARRIOR_BLOCKING_STANCE"     modifier="" hotkey="VK_9" priority="0" />
or is there something i have to change here?

Botje

Re: Buff keeps on casting

Posted: Tue Dec 07, 2010 4:59 am
by Giram
This has been working but haven't been able to witness lately.

Code: Select all

<skill name="ROGUE_SHADOW_STEP"        hotkey="VK_9" autouse="false" />

Code: Select all

	<onSkillCast><![CDATA[
	player:update()
	if player.Fighting then
		if( os.difftime(os.time(), player.lastHitTime) > 5 ) then -- more than 5 sec without damaging target
			player:cast("ROGUE_SHADOW_STEP");
		end
	end
	]]></onSkillCast>
Even if you set priority to 0 it still casts it. That just defines order when each skill is casted.

Re: Buff keeps on casting

Posted: Tue Dec 07, 2010 5:53 am
by rock5
botje wrote:this SHOULD only cast when its not there, but it keeps casting O.o

or is there something i have to change here?

Botje
If you are saying you want it to only caste when this code casts it, then add autouse="false"

Code: Select all

<skill name="WARRIOR_BLOCKING_STANCE"     modifier="" hotkey="VK_9" priority="0" autouse="false" />
Edit: Oops. I just noticed that Giram already mentioned 'autouse'.

Re: Buff keeps on casting

Posted: Tue Dec 07, 2010 6:17 am
by botje
nice thanx ^^

Botje