YASSE Stance (script)

From Elanthipedia
Jump to navigation Jump to search
YASSE Stance (script)
Category combat
Front-end YASSE
Author Ithrios


Description

Changes stances, equips or wears/stows a shield and uses the block, parry or dodge defensive manoeuvre based on player input. Will calculate the maximum stance if you have extra stance points and stores them in a global variable.

In order to equip or wear/stow a shield the following global variables need to be defined:
shield: The name of your shield (e.g. target shield)

Syntax

Syntax Effect
.stance e or .stance d puts you in an Evasion stance (evasion 100 with the remaining points in parry), wears/stows your shield (if held) and uses the dodge command
.stance p puts you in a Parry stance (parry 100 with the remaining points in evasion), wears/stows your shield (if held) and uses the parry command
.stance s or .stance b puts you in a Shield stance (Shield 100 with the remaining points in parry), equips your shield (if not held) and uses the block command
.stance r puts you in a Ranged stance (Evasion 100 with the remaining points in shield), equips your shield (if not held) and uses the dodge command
.stance n1 n2 n3 puts you in a custom stance stance (Evasion n1, Parry n2 and Shield n3), equips your shield or wears/stows your shield (depending on whether you have points in shield stance) and uses the dodge, parry or block command
.stance returns to your last stance (useful if changed manually or by another script)

Updates

Last Updated:
02 May 2013 - Script Posted
24 May 2013 - Fixed a problem where shields were equipped after changing to a shield heavy stance or stowed while still in a shield heavy stance and tidied the scripts' functions.
13 June 2013 - Added ranged and custom stance options

Script

setvariable stance-next stance-parry
ifexists stance-evasion goto stance-parry
setvariable evasion 100
setvariable parry 80
setvariable shieldset 0
stance-evasion-check-0:
setglobalvariable stance-evasion "$evasion$ $parry$ $shieldset$ 100"
match stance-evasion-check-3 You have 0 stance points left
match stance-evasion-check-1 stance points left
match stance-evasion-check-2 Please try again.
put stance set $stance-evasion$
matchwait

stance-evasion-check-1:
counter set $evasion$
if_c < 100
	begin
	counter add 1
	setvariable evasion $c$
	goto stance-evasion-check-0
	end

counter set $parry$
if_c < 100
	begin
	counter add 1
	setvariable parry $c$
	goto stance-evasion-check-0
	end
counter set $shieldset$
if_c < 100
	begin
	counter add 1
	setvariable shieldset $c$
	goto stance-evasion-check-0
	end
goto stance-evasion-check-0

stance-evasion-check-2:
counter set $shieldset$
if_c > 0
	begin
	counter sub 1
	setvariable shieldset $c$
	goto stance-evasion-check-0
	end
counter set $parry$
if_c > 80
	begin
	counter sub 1
	setvariable parry $c$
	goto stance-evasion-check-0
	end
goto stance-evasion-check-0

stance-evasion-check-3:
stance evasion save
goto $stance-next$

stance-evasion-high:
stance-evasion-low:
setvariable evasion 100
setvariable parry 80
setvariable shieldset 0
goto stance-evasion-check-0

stance-parry:
setvariable stance-next stance-shield
ifexists stance-parry goto stance-shield
setvariable parry 100
setvariable evasion 80
setvariable shieldset 0
stance-parry-check-0:
setglobalvariable stance-parry "$evasion$ $parry$ $shieldset$ 100"
match stance-parry-check-3 You have 0 stance points left
match stance-parry-check-1 stance points left
match stance-parry-check-2 Please try again.
put stance set $stance-parry$
matchwait

stance-parry-check-1:
echo 1
counter set $parry$
if_c < 100
	begin
	counter add 1
	setvariable parry $c$
	goto stance-parry-check-0
	end
counter set $evasion$
if_c < 100
	begin
	counter add 1
	setvariable evasion $c$
	goto stance-parry-check-0
	end
counter set $shieldset$
if_c < 100
	begin
	counter add 1
	setvariable shieldset $c$
	goto stance-parry-check-0
	end
goto stance-parry-check-0

stance-parry-high:
stance-parry-low:
setvariable evasion 80
setvariable parry 100
setvariable shieldset 0
goto stance-parry-check-0

stance-parry-check-2:
counter set $shieldset$
if_c > 0
	begin
	counter sub 1
	setvariable shieldset $c$
	goto stance-parry-check-0
	end
counter set $evasion$
if_c > 80
	begin
	counter sub 1
	setvariable evasion $c$
	goto stance-parry-check-0
	end
goto stance-parry-check-0

stance-parry-check-3:
stance parry save
goto $stance-next$

stance-shield:
ifexists stance-shield goto stance-ranged
setvariable stance-next stance-ranged
setvariable parry 80
setvariable evasion 0
setvariable shieldset 100
stance-shield-check-0:
setglobalvariable stance-shield "$evasion$ $parry$ $shieldset$ 100"
match stance-shield-check-3 You have 0 stance points left
match stance-shield-check-1 stance points left
match stance-shield-check-2 Please try again.
put stance set $stance-shield$
matchwait

stance-shield-check-1:
counter set $shieldset$
if_c < 100
	begin
	counter add 1
	setvariable shieldset $c$
	goto stance-shield-check-0
	end
counter set $parry$
if_c < 100
	begin
	counter add 1
	setvariable parry $c$
	goto stance-shield-check-0
	end
counter set $evasion$
if_c < 100
	begin
	counter add 1
	setvariable evasion $c$
	goto stance-shield-check-0
	end
goto stance-shield-check-0

stance-shield-check-2:
counter set $evasion$
if_c > 0
	begin
	counter sub 1
	setvariable evasion $c$
	goto stance-shield-check-0
	end
counter set $parry$
if_c > 80
	begin
	counter sub 1
	setvariable parry $c$
	goto stance-shield-check-0
	end
goto stance-shield-check-0

stance-shield-check-3:
stance shield save
goto $stance-next$

stance-shield-high:
stance-shield-low:
setvariable evasion 0
setvariable parry 80
setvariable shieldset 100
goto stance-shield-check-0

stance-ranged:
setvariable stance-next start
ifexists stance-ranged goto start
setvariable evasion 100
setvariable parry 0
setvariable shieldset 80
stance-ranged-check-0:
setglobalvariable stance-ranged "$evasion$ $parry$ $shieldset$ 100"
match stance-ranged-check-3 You have 0 stance points left
match stance-ranged-check-1 stance points left
match stance-ranged-check-2 Please try again.
put stance set $stance-ranged$
matchwait

stance-ranged-check-1:
counter set $evasion$
if_c < 100
	begin
	counter add 1
	setvariable evasion $c$
	goto stance-ranged-check-0
	end
counter set $shieldset$
if_c < 100
	begin
	counter add 1
	setvariable shieldset $c$
	goto stance-ranged-check-0
	end
counter set $parry$
if_c < 100
	begin
	counter add 1
	setvariable parry $c$
	goto stance-ranged-check-0
	end
goto stance-ranged-check-0

stance-ranged-check-2:
counter set $parry$
if_c > 80
	begin
	counter sub 1
	setvariable parry $c$
	goto stance-ranged-check-0
	end
counter set $shieldset$
if_c > 0
	begin
	counter sub 1
	setvariable shieldset $c$
	goto stance-ranged-check-0
	end
goto stance-ranged-check-0

stance-ranged-check-3:
stance shield save
goto $stance-next$

stance-ranged-high:
stance-ranged-low:
setvariable evasion 100
setvariable parry 0
setvariable shieldset 80
goto stance-ranged-check-0

stance-custom:
setglobalvariable stance-current custom
setvariable stance-next start-1
setvariable evasion $1$
setvariable parry $2$
setvariable shieldset $3$
stance-custom-check-0:
setglobalvariable stance-custom "$evasion$ $parry$ $shieldset$ 100"
match stance-custom-check-3 You have 0 stance points left
match stance-custom-check-1 stance points left
match stance-custom-check-2 Please try again.
put stance set $stance-custom$
matchwait

stance-custom-check-1:
counter set $evasion$
if_c < 100
	begin
	counter add 1
	setvariable evasion $c$
	goto stance-custom-check-0
	end
counter set $parry$
if_c < 100
	begin
	counter add 1
	setvariable parry $c$
	goto stance-custom-check-0
	end
counter set $shieldset$
if_c < 100
	begin
	counter add 1
	setvariable shieldset $c$
	goto stance-custom-check-0
	end
goto stance-custom-check-0

stance-custom-check-2:
counter set $shieldset$
if_c > 0
	begin
	counter sub 1
	setvariable shieldset $c$
	goto stance-custom-check-0
	end
counter set $parry$
if_c > 80
	begin
	counter sub 1
	setvariable parry $c$
	goto stance-custom-check-0
	end
goto stance-custom-check-0

stance-custom-high:
stance-custom-low:
setglobalvariable stance-current stance-evasion
goto start-1

stance-custom-check-3:
stance custom save
goto $stance-next$

start:
if $1$ >= 0
	begin
	counter set $1$
	counter add $2$
	counter add $3$
	if $c$ > 0 goto stance-custom
	end
if x$1$ contains xb
	begin
	setglobalvariable stance-current shield
	end
if x$1$ contains xd
	begin
	setglobalvariable stance-current evasion
	end
if x$1$ contains xe
	begin
	setglobalvariable stance-current evasion
	end
if x$1$ contains xp
	begin
	setglobalvariable stance-current parry
	end
if x$1$ contains xr
	begin
	setglobalvariable stance-current ranged
	end
if x$1$ contains xs
	begin
	setglobalvariable stance-current shield
	end

start-1:
put glance
waitfor you glance
if $righthanditem$ contains $shield$
	begin
	put swap
	waitfor You move
	end
if stance-current contains evasion goto end-evasion
if stance-current contains parry goto end-parry
if stance-current contains shield goto end-shield
if stance-current contains ranged goto end-ranged
if stance-current contains custom goto end-custom
setglobalvariable stance-current evasion
put stance set $stance-evasion$
goto end

end-evasion:
setvariable stance-next end-evasion
match end-evasion-0 You have 0 stance points left
match stance-evasion-low stance points left
match stance-evasion-high Please try again.
put stance set $stance-evasion$
matchwait

end-evasion-0:
if $lefthanditem$ contains $shield$
	begin
	match end-evasion-2 you slide
	match end-evasion-2 you sling
	match end-evasion-2 You are already wearing that.
	match end-evasion-2 You attach
	match end-evasion-1 You can't wear any more
	put wear my $shield$
	end
end-evasion-1:
if $lefthanditem$ contains $shield$
	begin
	match end-evasion-2 you slide
	match end-evasion-2 you sling
	match end-evasion-2 you stow
	match end-evasion-2 you put
	match end-evasion-2 that's closed.
	match end-evasion-2 There isn't any more room
	match end-evasion-2 Stow what?
	put stow my $shield$
	end
end-evasion-2:
put dodge
echo **************************************** Entering EVASION stance: $stance-evasion$ ****************************************
goto end

end-parry:
setvariable stance-next end-parry
match end-parry-0 You have 0 stance points left
match stance-parry-low stance points left
match stance-parry-high Please try again.
put stance set $stance-parry$
matchwait:

end-parry-0
if $lefthanditem$ contains $shield$
	begin
	match end-parry-2 you slide
	match end-parry-2 you sling
	match end-parry-2 You are already wearing that.
	match end-parry-2 You attach
	match end-parry-1 You can't wear any more
	put wear my $shield$
	end
end-parry-1:
if $lefthanditem$ contains $shield$
	begin
	match end-parry-2 you slide
	match end-parry-2 you sling
	match end-parry-2 you stow
	match end-parry-2 you put
	match end-parry-2 that's closed.
	match end-parry-2 There isn't any more room
	match end-parry-2 Stow what?
	put stow my $shield$
	end
parry-2:
put parry
echo **************************************** Entering parry stance: $stance-parry$ ****************************************
goto end

end-shield:
if $lefthanditem$ contains "$shield$" goto end-shield-4
if $lefthanditem$ contains Empty goto end-shield-2
match end-shield-2 you slide
match end-shield-2 you sling
match end-shield-2 you stow
match end-shield-2 you put
match end-shield-2 that's closed.
match end-shield-2 There isn't any more room
match end-shield-2 Stow what?
put stow my $lefthanditem$
matchwait

end-shield-2:
match end-shield-4 you slide
match end-shield-4 you sling
match end-shield-4 you remove
match end-shield-3 remove what?
match end-shield-3 aren't wearing that.
put remove $shield$
matchwait

end-shield-3:
match end-shield-4 You draw out
match end-shield-4 you get
match end-shield-4 already in your inventory.
match end-shield-4 What were you referring to?
match end-shield-4 already holding that.
put wield left my $shield$
matchwait

end-shield-4:
if righthanditem contains $shield$
	begin
	put swap
	waitfor You move
	end

put block

end-shield-5:
setvariable stance-next end-shield-4
match end-shield-6 You have 0 stance points left
match stance-shield-low stance points left
match stance-shield-high Please try again.
put stance set $stance-shield$
matchwait

end-shield-6:
echo **************************************** Entering BLOCK stance: $stance-shield$ ****************************************
goto end

end-ranged:
if $lefthanditem$ contains "$shield$" goto end-ranged-4
if $lefthanditem$ contains Empty goto end-ranged-2
match end-ranged-2 you slide
match end-ranged-2 you sling
match end-ranged-2 you stow
match end-ranged-2 you put
match end-ranged-2 that's closed.
match end-ranged-2 There isn't any more room
match end-ranged-2 Stow what?
put stow my $lefthanditem$
matchwait

end-ranged-2:
match end-ranged-4 you slide
match end-ranged-4 you sling
match end-ranged-4 you remove
match end-ranged-3 remove what?
match end-ranged-3 aren't wearing that.
put remove $shield$
matchwait

end-ranged-3:
match end-ranged-4 You draw out
match end-ranged-4 you get
match end-ranged-4 already in your inventory.
match end-ranged-4 What were you referring to?
match end-ranged-4 already holding that.
put wield left my $shield$
matchwait

end-ranged-4:
if righthanditem contains $shield$
	begin
	put swap
	waitfor You move
	end

put dodge

end-ranged-5:
setvariable stance-next end-ranged-4
match end-ranged-6 You have 0 stance points left
match stance-ranged-low stance points left
match stance-ranged-high Please try again.
put stance set $stance-ranged$
matchwait

end-ranged-6:
echo **************************************** Entering Ranged stance: $stance-ranged$ ****************************************
goto end

end-custom:
setvariable evasion $stance-custom$
calculate evasion left 2
setvariable parry $stance-custom$
calculate parry left 5
calculate parry right 3
setvariable shieldset $stance-custom$
calculate shieldset right 6
calculate shieldset left 2

end-custom-2:
if $shieldset$ <= 0 goto end-custom-3ns
if $lefthanditem$ contains "$shield$" goto end-custom-5
if $lefthanditem$ contains Empty goto end-custom-3
match end-custom-3 you slide
match end-custom-3 you sling
match end-custom-3 you stow
match end-custom-3 you put
match end-custom-3 that's closed.
match end-custom-3 There isn't any more room
match end-custom-3 Stow what?
put stow my $lefthanditem$
matchwait

end-custom-3:
match end-custom-5 you slide
match end-custom-5 you sling
match end-custom-5 you remove
match end-custom-4 remove what?
match end-custom-4 aren't wearing that.
put remove $shield$
matchwait

end-custom-4:
match end-custom-5 You draw out
match end-custom-5 you get
match end-custom-5 already in your inventory.
match end-custom-5 What were you referring to?
match end-custom-5 already holding that.
put wield left my $shield$
matchwait

end-custom-5:
if righthanditem contains $shield$
	begin
	put swap
	waitfor You move
	end

end-custom-6:
if $evasion$ >= $parry$
	begin
	if $evasion$ >= $shieldset$
		begin
		put dodge
		goto end-custom-7
		end
	end
if $parry$ >= $sheildset$
	begin
	put parry
	goto end-custom-7
	end
put block
goto end-custom-6

end-custom-2ns:
if $lefthanditem$ contains $shield$
	begin
	match end-custom-4ns you slide
	match end-custom-4ns you sling
	match end-custom-4ns You are already wearing that.
	match end-custom-4ns You attach
	match end-custom-3ns You can't wear any more
	put wear my $shield$
	end
end-custom-3ns:
if $lefthanditem$ contains $shield$
	begin
	match end-custom-4ns you slide
	match end-custom-4ns you sling
	match end-custom-4ns you stow
	match end-custom-4ns you put
	match end-custom-4ns that's closed.
	match end-custom-4ns There isn't any more room
	match end-custom-4ns Stow what?
	put stow my $shield$
	end

end-custom-4ns:
if $parry$ >= $dodge$
	begin
	put parry
	goto end-custom-6
	end
put dodge
goto end-custom-6

end-custom-6:
match end-custom-7 You have 0 stance points left
match end-evasion stance points left
match end-evasion Please try again.
put stance set $stance-custom$
matchwait

end-custom-7:
echo **************************************** Entering a CUSTOM stance: $stance-custom$ ****************************************
goto end

end: