YASSE Armor (script)

From Elanthipedia
Jump to navigation Jump to search
YASSE Armor (script)
Category utility
Front-end YASSE
Author Hithrael


Description

Wears or unwears armor. Values determined by YASSE Global Variables (script).

Syntax

Run as .scriptname <on/off>, where on is to put on armor, and off is to remove it.

Updates

Last Updated:

  • 04/16/2011: Correctly handles leg and eye armor.
  • 04/12/2011: Skips leg and eye armor if the variables are not set under global, put in pausetext strings to skip armor if an armor is worn that is not from the default.
  • 03/30/2011: Revision 2

Script

set predefined on

action [can't fit over] put [stow right]
setvariable status %1

goto $status$

off:
echo [Removing armor]
pause
put rem my $armorhead$
put stow my $armorhead$
pausetext 05 You put
pause
put rem my $armormain$
put stow my $armormain$
pausetext 05 You put
pause
put rem my $armorhand$
put stow my $armorhand$
pausetext 05 You put
pause
put rem my $shield$
put stow my $shield$
pausetext 05 You put
pause
ifexists $armorleg$ gosub armorleg
pause
ifexists $armoreyes$ gosub armoreyes
pause
goto end

on:
save on
echo [Donning armor]
pause
put get my $armorhead$
put wear my $armorhead$
pausetext 05 on your head
pause
put get my $armormain$
put wear my $armormain$
pausetext 05 You work
pause
put get my $armorhand$
put wear my $armorhand$
pausetext 05 You slip
pause
put get my $shield$
put wear my $shield$
pausetext 05 You slide
pause
ifexists $armorleg$ gosub armorleg
pause
ifexists $armoreyes$ gosub armoreyes
pause
goto end

armorleg:
if $status$ eq off
	begin
	put rem my $armorleg$
	put stow my $armorleg$
	pausetext 05 You put
	end
if $status$ eq on
	begin
	put get my $armorleg$
	put wear my $armorleg$
	end
pause
return

armoreyes:
if %s eq off
	begin
	put rem my $armoreye$
	put stow my $armoreye$
	pausetext 05 You take
	end
if %s eq on
	begin
	put get my $armoreye$
	put wear my $armoreye$
	pausetext 05 You put
	end
pause
return

end:
pause
put sort auto headtotoe
echo [Done]