#IF (!@czd_scripts) {#ALIAS csver {#EC;#EC Cosmo Drazi Scripts;#IF (@czd_scripts) {#FORALL {@czd_scripts} {#IF (%mod(%ismember(%i,@czd_scripts),2)) {#ECHOPROMPT %i v} {#ECHOPROMPT %i;#EC}}} {#EC No scripts are currently loaded.}};#VAR czd_scripts {VialControl|1.0}} {#ADDITEM czd_scripts {VialControl|1.0}};#ALIAS apply {#IF (!%ismember(%1,@vapply)) {#t- ingame;apply %0;#t+ ingame} {#IF (%item(@v%1,2)) {#VA salves %additem(v%1,@salves);#IF (%ismember(%3,head|arms|legs|body)) {#VA salves %additem(%3,@salves)} {#VA salves %additem(none,@salves)};#t- ingame;apply %item(@v%1,1) %2 %3;#t+ ingame} {#EC You have no %upper(%1)};#VA fixsalve 1;fixsalve}} {ingame};#ALIAS drink {#IF (!%ismember(%1,@vdrink)) {#t- ingame;drink %0;#t+ ingame} {#IF (%item(@v%1,2)) {#VA drinks %additem(v%1,@drinks);#t- ingame;drink %item(@v%1,1);#t+ ingame} {#EC You have no %upper(%1);#IF (%ismember(%1,venom|levitation)) {#VA fixvial 1;fixvial}}}} {ingame};#ALIAS vout {#IF (%if(%1=empty,%2,%1)) {#IF (%ismember(%insert(v,%if(%1=empty,%2,%1),1),@vials)) {#IF (%if(%1=empty,%ismember(0,@{v%2}),@{v%1})) {#LOOP %if(%1=empty,%eval(%ismember(0,@{v%if(%1=empty,%2,%1)})/2),1),%eval(%numitems(@{v%if(%1=empty,%2,%1)})/2) {get %item(@{v%if(%1=empty,%2,%1)},(2*%i)-1) from pack}}} {#EC %upper(%if(%1=empty,%2,%1)) is not a valid vial type.}} {#VAR temp 1;#UNTIL (@temp > %numitems(@vials)) {#IF (%if(%1,%ismember(0,@{%item(@vials,@temp)}),%numitems(@{%item(@vials,@temp)}))) {#LOOP %if(%1,%eval(%ismember(0,@{%item(@vials,@temp)})/2),1),%eval(%numitems(@{%item(@vials,@temp)})/2) {get %item(@{%item(@vials,@temp)},(2*%i)-1) from pack}};#ADD temp (1)}}} {vials};#ALIAS vin {#IF (%if(%1=empty,%2,%1)) {#IF (%ismember(%insert(v,%if(%1=empty,%2,%1),1),@vials)) {#IF (%if(%1=empty,%ismember(0,@{v%2}),@{v%1})) {#LOOP %if(%1=empty,%eval(%ismember(0,@{v%if(%1=empty,%2,%1)})/2),1),%eval(%numitems(@{v%if(%1=empty,%2,%1)})/2) {put %item(@{v%if(%1=empty,%2,%1)},(2*%i)-1) in pack}}} {#EC %upper(%if(%1=empty,%2,%1)) is not a valid vial type.}} {#VAR temp 1;#UNTIL (@temp > %numitems(@vials)) {#IF (%if(%1,%ismember(0,@{%item(@vials,@temp)}),%numitems(@{%item(@vials,@temp)}))) {#LOOP %if(%1,%eval(%ismember(0,@{%item(@vials,@temp)})/2),1),%eval(%numitems(@{%item(@vials,@temp)})/2) {put %item(@{%item(@vials,@temp)},(2*%i)-1) in pack}};#ADD temp (1)}}} {vials};#ALIAS fillvial {get gold from pack;#FORALL {vhealth|vmana|vimmunity|vcaloric|vspeed|vmending} {#WHILE (%ismember(0,@{%i})) {refill %item(@{%i},%ismember(0,@{%i})-1) with %delete(%i,1,1);#VA %i %additem(%item(@{%i},%ismember(0,@{%i})-1)|1,@{%i});#VA %i %delitem(%item(@{%i},%ismember(0,@{%i})-1)|0,@{%i})}};put gold in pack} {vials};#ALIAS vials {#IF (%1) {#IF (%ismember(%insert(v,%1,1),@vials)) {#EC;#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item(@{v%1},@count)) {#IF (%item(@{v%1},@count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%1: %eval((@count-1)/2) %if(@vempty,(@vempty Empty))};#VA count 0}}}} {#EC;#FORALL {@vials} {#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item(@{%i},@count)) {#IF (%item(@{%i},@count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%delete(%i,1,1): %eval((@count-1)/2) %if(@vempty,(@vempty Empty))};#VA count 0}}}}} {vials};#ALIAS vp {#VA count 1;#WHILE (@count>0) {#IF (%item(@{v%1},@count)) {p %item(@{v%1},@count);#ADD count (2)} {#VA count 0}}} {vials};#ALIAS vg {#IF (%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))) {#IF (%ismember(%insert(v,%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1)),1),@vials)) {#VA temp %eval(%ismember(%if(%if(%isnumber(%1),%2,%1)=empty,0,1),@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))})/2);#WHILE (@temp>0 & %item(@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))},2*@temp)=%if(%if(%isnumber(%1),%2,%1)=empty,0,1)) {#IF (%item(@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))},2*@temp)=%if(%if(%isnumber(%1),%2,%1)=empty,0,1)) {#ADD temp (1)}};#IF (@temp = 0) {#EC You have no %if(%if(%isnumber(%1),%2,%1)=empty,empty,full) %upper(%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))) vials.} {#ADD temp (-%eval(%ismember(%if(%if(%isnumber(%1),%2,%1)=empty,0,1),@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))})/2));#IF (@temp < %if(%isnumber(%1),%1,1)) {#EC You only have @temp %if(%if(%isnumber(%1),%2,%1)=empty,empty,full) %upper(%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))) vial%if(@temp=1,,s).} {#IF (%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%4,%3),%if(%isnumber(%1),%3,%2))) {#VA temp %eval(%ismember(%if(%if(%isnumber(%1),%2,%1)=empty,0,1),@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))})-1);#LOOP %if(%isnumber(%1),%1,1) {give %item(@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))},@temp) to %if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%4,%3),%if(%isnumber(%1),%3,%2));#ADD temp (2)}} {#EC Syntax vg (#) (empty) type person}}}} {#EC %upper(%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1)) is not a valid vial type.}} {#EC Syntax: vg (#) (empty) type person}} {vials};#ALIAS vmove {#IF (%ismember(%insert(v,%1,1),@vials)) {#IF (%ismember(%insert(v,%2,1),@vials)) {#IF (%ismember(0,@{v%1})) {#VAR v%2 %additem(%item(@{v%1},%ismember(0,@{v%1})-1)|0,@{v%2});#VAR v%1 %delitem(%item(@{v%1},%ismember(0,@{v%1})-1)|0,@{v%1});#EC Empty %upper(%1) moved to empty %upper(%2).} {#EC You have no empty %upper(%1) vials to move.}} {#EC %if(%2,%upper(%2) is not a valid vial selection.,Syntax: vmove type1 type2)}} {#EC %if(%1,%upper(%1) is not a valid vial selection.,Syntax: vmove type1 type2)}} {vials};#ALIAS vset {#IF (%isnumber(%1)) {#IF (%ismember(%insert(v,%if(%2=empty,%3,%2),1),@vials)) {#IF (%2=empty) {#IF (%ismember(%1,@{v%3})) {#VAR v%3 %delitem(%1|%item(@{v%3},%ismember(%1,@{v%3})+1),@{v%3})};#VAR v%3 %additem(%1|0,@{v%3})} {#IF (%ismember(%1,@{v%2})) {#VAR v%2 %delitem(%1|%item(@{v%2},%ismember(%1,@{v%2})+1),@{v%2})};#VAR v%2 %additem(%1|1,@{v%2});#IF (%ismember(0,@{v%2})) {#WHILE (%ismember(0,@{v%2}) < %ismember(%1,@{v%2})) {#VAR v%2 %additem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2});#VAR v%2 %delitem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2})}}};#EC %1 set to %if(%2=empty,%upper(%3) (empty),%upper(%2)).} {#EC %if(%if(%2=empty,%3,%2),%upper(%if(%2=empty,%3,%2)) is not a valid vial type.,Syntax: vset #vial (empty) type)}} {#EC Syntax: vset #vial (empty) type}} {vials};#ALIAS vdel {#IF (%isnumber(%1)) {#IF (%ismember(%insert(v,%2,1),@vials)) {#IF (%ismember(%1,@{v%2})) {#VA v%2 %delitem(%item(@{v%2},%ismember(%1,@{v%2}))|%item(@{v%2},%ismember(%1,@{v%2})+1),@{v%2});#EC %1 removed from %upper(%2).} {#EC %1 is not a %upper(%2) vial number.}} {#EC %if(%2,%upper(%2) is not a valid vial type.,Syntax: vdel #vial type)}} {#EC Syntax: vdel #vial type}} {vials};#VAR vmana {} {_nodef} {vials};#VAR vhealth {} {_nodef} {vials};#VAR vvenom {} {_nodef} {vials};#VAR vimmunity {} {_nodef} {vials};#VAR vspeed {} {_nodef} {vials};#VAR vmass {} {_nodef} {vials};#VAR vcaloric {} {_nodef} {vials};#VAR vmending {} {_nodef} {vials};#VAR vapply {caloric|mending|restoration|mass} {_nodef} {vials};#VAR vdrink {health|mana|immunity|venom|frost|levitation|speed} {_nodef} {vials};#VAR vials {vhealth|vmana|vimmunity|vvenom|vcaloric|vfrost|vlevitation|vspeed|vepidermal|vmending|vrestoration|vmass} {_nodef} {vials};#VAR vfrost {} {_nodef} {vials};#VAR vlevitation {} {_nodef} {vials};#VAR drinks {} {_nodef} {vials};#VAR vrestoration {} {_nodef} {vials};#VAR salves {} {_nodef} {vials};#VAR vepidermal {} {_nodef} {vials};#VAR count {};#VAR vempty {} {_nodef} {vials};#VAR temp {};#TRIGGER {You take a drink from a} {#VA drinks %delitem(%item(@drinks,1),@drinks)} {vials} 517;#TRIGGER {You down the last drop from a} {#VA temp @%item(@drinks,1);#VA %item(@drinks,1) %additem(%item(@temp,1),@temp);#VA %item(@drinks,1) %additem(0,@temp);#VA %item(@drinks,1) %delitem(%item(@temp,1),@temp);#VA %item(@drinks,1) %delitem(%item(@temp,1),@temp);#IF (%item(@temp,2) = 0) {#EC You have run out of %upper(%delete(%item(@drinks,1),1,1))} {#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item(@temp,@count)) {#IF (%item(@temp,@count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%delete(%item(@drinks,1),1,1): %eval((@count-1)/2) %if(@vempty,(@vempty Empty))};#VA count 0}}};#VA drinks %delitem(%item(@drinks,1),@drinks)} {vials} 517;#TRIGGER {{You take out some salve and quickly rub it on|The salve dissolves and quickly disappears after you apply it}} {#VA salves %delitem(%item(@salves,1)|%item(@salves,2),@salves)} {vials} 517;#TRIGGER {vial contains nothing that is spreadable.} {#VA temp @%item(@salves,1);#VA %item(@salves,1) %additem(%item(@temp,1),@temp);#VA %item(@salves,1) %additem(0,@temp);#VA %item(@salves,1) %delitem(%item(@temp,1),@temp);#VA %item(@salves,1) %delitem(%item(@temp,1),@temp);#IF (%item(@temp,2) = 0) {#EC You have run out of %upper(%delete(%item(@salves,1),1,1))} {apply %delete(%item(@salves,1),1,1)%if(%item(@salves,2) != none," to "%item(@salves,2));#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item(@temp,@count)) {#IF (%item(@temp,@count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%delete(%item(@salves,1),1,1): %eval((@count-1)/2) %if(@vempty,(@vempty Empty))};#VA count 0}}};#VA salves %delitem(%item(@salves,1)|%item(@salves,2),@salves)} {vials} 517;#TRIGGER {{You feel your insides clench as your soul is frozen|You have been slain}} {#VA drinks "";#VA salves ""} {vials} 519;#EC;#EC {VialControl v%item(@czd_scripts,%ismember(VialControl,@czd_scripts)+1) successfully installed.};#EC;#EC {Refer to http://www.geocities.com/cosmo_drazi/achaea/vialcon.html};#EC { for setup and usage documentation.};#EC