//What says on the tin.
#library "PrussianRoverkill"
#include "zcommon.acs"

script 702 (void)
{
	SetMusic("");
	delay(35*69);
	SetMusic("*");
	Terminate;
}

Script 705 (void)
{
	SetMusic("");
	Terminate;
}

Script 706 (void)
{
	SetMusic("*");
	Terminate;
}

script 692 (int a) net
{
if (a == 1) {GiveInventory("RO_GotoReload",1);}
else if (a == 2) {TakeInventory("RO_GotoReload",1);}
else if (a == 3) {GiveInventory("RO_GotoZoom",1);}
else {TakeInventory("RO_GotoZoom",1);}
}

script 685 (void)
{
	for (int i = 0; i < 64; i++)
	{
		if (fdistance(29167+i, ActivatorTID() < 256)) {GiveActorInventory(29167+i, "HealStreamItem", 4);}
	}
	GiveInventory("HealStreamItem", 4);
}

function int fdistance (int tid1, int tid2)
{
	int len;
	int y = getactory(tid1) - getactory(tid2);
	int x = getactorx(tid1) - getactorx(tid2);
	int z = getactorz(tid1) - getactorz(tid2);

	int ang = vectorangle(x,y);
	if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(y, sin(ang));
	else len = fixeddiv(x, cos(ang));

	ang = vectorangle(len, z);
	if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(z, sin(ang));
	else len = fixeddiv(len, cos(ang));

	return len;
}