# Jedi Knight Paint Ball Cog Script
#
# JKPB_PB_1.COG
#
# PAINTBALL script
#
# A command that switches to the next big Hopper.
#
# [XIAN]
#
# (C) 1998 Moldy Crow Productions
# ========================================================================================

symbols

sound		co2Snd=bactaUse.WAV
thing		player

message		activated

end

# ========================================================================================

code

activated:
	player = GetSourceRef();

	Print("Changing Hopper");

	if (GetInv(player, 46) > 0.0) // Has a 200 hopper
	{
		Sleep(3.0);
		ChangeInv(player, 46, -1.0);
		SetInv(player, 43, 2.0);
		SetInv(player, 15, 200.0);
		Print("200 Paintball Hopper loaded");
		Return;
	}
	else if (GetInv(player, 45) > 0.0) // Has a 150 hopper
	{
		Sleep(3.0);
		ChangeInv(player, 45, -1.0);
		SetInv(player, 43, 1.0);
		SetInv(player, 12, 150.0);
		Print("150 Paintball Hopper loaded");
		Return;
	}
	else if (GetInv(player, 44) > 0.0) // Has a 50 hopper
	{
		Sleep(3.0);
		ChangeInv(player, 44, -1.0);
		SetInv(player, 43, 0.0);
		SetInv(player, 11, 50.0);
		Print("50 Paintball Hopper loaded");
		Return;
	}
	Print("No hopper available");
end

