/* 
 * Script decompiled by jagdecs2 v3.2
 * Decompiler opts:
 * --------------
 * t1LocalAnalyzer:true
 * t2LocalAnalyzer:true
 * beautifier:true
 * --------------
 * Made by mgi125 ;)
 */


void script_2246(int a0,int a1,int a2,int a3) {
	int v0 = cs2method_10640(a1, a3);
	if (v0 == -1) {
		cs2method_10467(1, a2);
		cs2method_10467(0, a0);
	}
	cs2method_10467(0, a2);
	cs2method_10467(1, a0);
	cs2method_10039(v0, cs2method_11065(94, a3), a2);
	cs2method_10495(a2);
	cs2method_20486(new function<script_1620>(int a0,int a1,int a2,int a3,int a4) {
		int v0 = cs2method_10060(a1, cs2method_10133());
		if (cs2method_11038(a2, a0) == 1 || a0 == -1 && cs2method_10324(a2) == 1) {
			cs2method_10002(a4);
			cs2method_20061(new function<script_1621>(int a0,int a1,int a2,int a3) {
				if (cs2method_10133() < a3) {
					return;
				}
				if (cs2method_11038(a0, a1) == 1 || a1 == -1 && cs2method_10324(a0) == 1) {
					cs2method_10002(a2);
					cs2method_20061(new function<none>() {
					}, "");
				}
				return;
			}, new WidgetPointer(a2), a0, a3, v0, "Iiii");
		}
		return;
	}, new WidgetPointer(-32768,3), -1, 100, 0, 8, "Iiiii", new WidgetPointer(a2));
	if (itemDefsAttribute(v0, 1047) > 0) {
		if (itemDefsAttribute(v0, 1050) > 0 || itemDefsAttribute(v0, 1051) > 0) {
			cs2method_11127(3, a2, "Destroy");
		} else {
			cs2method_11127(3, a2, "Bind");
		}
	}
	cs2method_11127(10, a2, "Examine");
	cs2method_10316(a2, "<col=ff9040>" + (string)cs2method_10018(v0));
	return;
}
