YASSE Stance (script): Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 11: Line 11:
In order to equip or wear/stow a shield the following global variables need to be defined:<br/>
In order to equip or wear/stow a shield the following global variables need to be defined:<br/>
shield: The name of your shield (e.g. target shield)<br/>
shield: The name of your shield (e.g. target shield)<br/>

optional (without these both defined the shield will be stowed and retrieved via get):<br/>
shield-w: The command to wield your shield (e.g. remove my $shield$ or get my $shield$)<br/>
shield-s: The command to unequip your shield (e.g. wear my $shield$ or stow my $shield$)<br/>


==Syntax==
==Syntax==
Line 27: Line 23:
| .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 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 n1 n2 n3 || puts you in a Custom Stance (based on the numbers) and saves this stance for the future
| .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 custom || puts you in your last custom stance
|-
|-
| .stance || returns to your last stance (useful if changed manually or by another script)
| .stance || returns to your last stance (useful if changed manually or by another script)
Line 35: Line 31:


==Updates==
==Updates==
Last Updated:
Last Updated:<br>
02 May 2013 - Script Posted
02 May 2013 - Script Posted<br>
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.<br>
13 June 2013 - Added ranged and custom stance options<br>


==Script==
==Script==


<pre>
<pre>
setvariable stance-next stance-parry

ifexists stance-evasion goto stance-parry
ifexists stance-evasion goto stance-parry
setvariable evasion 100
setvariable evasion 100
setvariable parry 80
setvariable parry 80
setvariable shield 0
setvariable shieldset 0
stance-evasion-check-0:
stance-evasion-check-0:
setglobalvariable stance-evasion "$evasion$ $parry$ $shield$ 100"
setglobalvariable stance-evasion "$evasion$ $parry$ $shieldset$ 100"
match stance-parry You have 0 stance points left
match stance-evasion-check-3 You have 0 stance points left
match stance-evasion-check-1 stance points left
match stance-evasion-check-1 stance points left
match stance-evasion-check-2 Please try again.
match stance-evasion-check-2 Please try again.
Line 70: Line 68:
goto stance-evasion-check-0
goto stance-evasion-check-0
end
end
counter set $shield$
counter set $shieldset$
if_c < 100
if_c < 100
begin
begin
counter add 1
counter add 1
setvariable shield $c$
setvariable shieldset $c$
goto stance-evasion-check-0
goto stance-evasion-check-0
end
end
goto stance-evasion-check-0
goto end


stance-evasion-check-2:
stance-evasion-check-2:
counter set $shield$
counter set $shieldset$
if_c > 0
if_c > 0
begin
begin
counter sub 1
counter sub 1
setvariable shield $c$
setvariable shieldset $c$
goto stance-evasion-check-0
goto stance-evasion-check-0
end
end
Line 94: Line 92:
goto stance-evasion-check-0
goto stance-evasion-check-0
end
end
goto stance-evasion-check-0
goto end

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


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


stance-parry:
stance-parry:
setvariable stance-next stance-shield
ifexists stance-parry goto stance-shield
ifexists stance-parry goto stance-shield
setvariable parry 100
setvariable parry 100
setvariable evasion 80
setvariable evasion 80
setvariable shield 0
setvariable shieldset 0
stance-parry-check-0:
stance-parry-check-0:
setglobalvariable stance-parry "$evasion$ $parry$ $shield$ 100"
setglobalvariable stance-parry "$evasion$ $parry$ $shieldset$ 100"
match stance-shield You have 0 stance points left
match stance-parry-check-3 You have 0 stance points left
match stance-parry-check-1 stance points left
match stance-parry-check-1 stance points left
match stance-parry-check-2 Please try again.
match stance-parry-check-2 Please try again.
Line 132: Line 135:
goto stance-parry-check-0
goto stance-parry-check-0
end
end
counter set $shield$
counter set $shieldset$
if_c < 100
if_c < 100
begin
begin
counter add 1
counter add 1
setvariable shield $c$
setvariable shieldset $c$
goto stance-parry-check-0
goto stance-parry-check-0
end
end
goto stance-parry-check-0
goto end


stance-parry-high:
stance-parry-high:
Line 145: Line 148:
setvariable evasion 80
setvariable evasion 80
setvariable parry 100
setvariable parry 100
setvariable shield 0
setvariable shieldset 0
goto stance-parry-check-0
goto stance-parry-check-0


stance-parry-check-2:
stance-parry-check-2:
counter set $shield$
counter set $shieldset$
if_c > 0
if_c > 0
begin
begin
counter sub 1
counter sub 1
setvariable shield $c$
setvariable shieldset $c$
goto stance-parry-check-0
goto stance-parry-check-0
end
end
Line 163: Line 166:
goto stance-parry-check-0
goto stance-parry-check-0
end
end
goto stance-parry-check-0
goto end

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


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


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



stance-shield-check-2:
stance-shield-check-2:
Line 218: Line 225:
goto stance-shield-check-0
goto stance-shield-check-0
end
end
goto stance-shield-check-0
goto end

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


stance-shield-high:
stance-shield-high:
Line 224: Line 235:
setvariable evasion 0
setvariable evasion 0
setvariable parry 80
setvariable parry 80
setvariable shield 100
setvariable shieldset 100
goto stance-shield-check-0
goto stance-shield-check-0


stance-ranged:
start:
setvariable stance-next start
if x$1$ contains xb
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
begin
counter add 1
setglobalvariable stance-current shield
setvariable evasion $c$
match end You have 0 stance points left
match stance-shield-low stance points left
goto stance-ranged-check-0
match stance-shield-high Please try again.
put stance set $stance-shield$
matchwait
end
end
counter set $shieldset$
if x$1$ contains xd
if_c < 100
begin
begin
counter add 1
setglobalvariable stance-current evasion
setvariable shieldset $c$
match end You have 0 stance points left
match stance-evasion-low stance points left
goto stance-ranged-check-0
match stance-evasion-high Please try again.
put stance set $stance-evasion$
matchwait
end
end
counter set $parry$
if x$1$ contains xe
if_c < 100
begin
begin
counter add 1
setglobalvariable stance-current evasion
setvariable parry $c$
match end You have 0 stance points left
match stance-evasion-low stance points left
goto stance-ranged-check-0
match stance-evasion-high Please try again.
put stance set $stance-evasion$
matchwait
end
end
goto stance-ranged-check-0
if x$1$ contains xp
begin
setglobalvariable stance-current parry
match end 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
if x$1$ contains xs
begin
setglobalvariable stance-current shield
match end 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


stance-ranged-check-2:

counter set $parry$

if_c > 80
if_1
begin
setglobalvariable stance-current custom
if_1
begin
begin
counter set $1$
counter sub 1
setvariable evasion $c$
if_c > 100
begin
setvariable evasion 100
end
if_c < 0
begin
setvariable evasion 0
end
shift
end
setvariable parry 0
if_1
begin
counter set $1$
setvariable parry $c$
setvariable parry $c$
goto stance-ranged-check-0
if_c > 100
begin
setvariable parry 100
end
if_c < 0
begin
setvariable parry 0
end
shift
end
end
counter set $shieldset$
setvariable shield 0
if_c > 0
if_1
begin
begin
counter set $1$
counter sub 1
setvariable shield $c$
setvariable shieldset $c$
goto stance-ranged-check-0
if_c > 100
begin
setvariable shield 100
end
if_c < 0
begin
setvariable shield 0
end
end
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:
stance-custom-check-0:
setglobalvariable stance-custom "$evasion$ $parry$ $shieldset$ 100"
counter set $evasion$
match stance-custom-check-3 You have 0 stance points left
counter add $parry$
counter add $shield$
if_c < 180 goto stance-custom-check-1
if_c > 190 goto stance-custom-check-2
setglobalvariable stance-custom "$evasion$ $parry$ $shield$ 100"
match end You have 0 stance points left
match stance-custom-check-1 stance points left
match stance-custom-check-1 stance points left
match stance-custom-check-2 Please try again.
match stance-custom-check-2 Please try again.
Line 343: Line 326:
goto stance-custom-check-0
goto stance-custom-check-0
end
end

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


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

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

counter set $parry$
counter set $parry$
if_c > 80
if_c > 80
Line 393: Line 357:
goto stance-custom-check-0
goto stance-custom-check-0
end
end
goto stance-custom-check-0
goto end

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


stance-evasion-check-1:
stance-custom-check-3:
stance custom save
counter set $evasion$
goto $stance-next$
if_c < 100

start:
if $1$ >= 0
begin
begin
counter add 1
counter set $1$
setvariable evasion $c$
counter add $2$
counter add $3$
goto stance-custom-check-0
if $c$ > 0 goto stance-custom
end
end
if x$1$ contains xb
counter set $parry$
if_c < 80
begin
begin
setglobalvariable stance-current shield
counter add 1
setvariable parry $c$
goto stance-custom-check-0
end
end
if x$1$ contains xd
goto end
end

if stance-current contains evasion
begin
begin
put stance set $stance-evasion$
setglobalvariable stance-current evasion
goto end
end
end
if stance-current contains parry
if x$1$ contains xe
begin
begin
setglobalvariable stance-current evasion
put stance set $stance-parry$
goto end
end
end
if stance-current contains shield
if x$1$ contains xp
begin
begin
setglobalvariable stance-current parry
put stance set $stance-shield$
goto end
end
end
if stance-current contains custom
if x$1$ contains xr
begin
begin
setglobalvariable stance-current ranged
put stance set $stance-custom$
goto end
end
if x$1$ contains xs
begin
setglobalvariable stance-current shield
end
end


start-1:
setglobalvariable stance-current evasion
put glance
put stance set $stance-evasion$
waitfor you glance

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


end-evasion:
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$
if $lefthanditem$ contains $shield$
begin
begin
Line 469: Line 451:
put dodge
put dodge
echo **************************************** Entering EVASION stance: $stance-evasion$ ****************************************
echo **************************************** Entering EVASION stance: $stance-evasion$ ****************************************
goto end-2
goto end


end-parry:
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$
if $lefthanditem$ contains $shield$
begin
begin
Line 496: Line 486:
put parry
put parry
echo **************************************** Entering parry stance: $stance-parry$ ****************************************
echo **************************************** Entering parry stance: $stance-parry$ ****************************************
goto end-2
goto end


end-shield:
end-shield:
if $lefthanditem$ contains "$shield$" goto end-shield-4
if $lefthanditem$ contains "$shield$" goto end-shield-4
if $lefthanditem$ contains "Empty" goto end-shield-2
if $lefthanditem$ contains Empty goto end-shield-2

match end-shield-2 you slide
match end-shield-2 you slide
match end-shield-2 you sling
match end-shield-2 you sling
Line 522: Line 511:


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


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

put block
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$ ****************************************
echo **************************************** Entering BLOCK stance: $stance-shield$ ****************************************
goto end-2
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:
end-custom:
if stance-current contains 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
begin
put swap
echo **************************************** Entering a CUSTOM stance: $stance-custom$ ****************************************
waitfor You move
goto end
end
end
goto end-2


end-2:
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:


</pre>
</pre>

Latest revision as of 11:17, 13 June 2013

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: