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


int script_24(int a0,int a1,int a2,int a3,object a4,int a5) {
	cs2method_10606(32702470, 4, cs2method_10051(a5, 3));
	cs2method_10013(26, 32, 0, 0);
	if (a1 > 0) {
		cs2method_10797(cs2method_10379(a1));
	} else {
		cs2method_10797(" ");
	}
	cs2method_10063(0, a0, 0, 0);
	cs2method_11105(2, 0, 0);
	cs2method_10811(4600330);
	cs2method_10692(497);
	cs2method_10173(0);
	cs2method_10606(32702470, 5, cs2method_10060(cs2method_10051(a5, 3), 1));
	cs2method_10013(36, 32, 0, 0);
	if (script_1566(client_configs['cfg1226'].bitcfg3295, client_configs['cfg1226'].bitcfg3296) == 1) {
		if (client_configs['cfg1226'].bitcfg3295 == 7) {
			cs2method_10013(30, 30, 0, 0);
		} else {
			if (client_configs['cfg1226'].bitcfg3295 == 4) {
				cs2method_10013(24, 24, 0, 0);
				cs2method_10063(0, a0, 1, 0);
			}
		}
		cs2method_10356(0);
		if (a3 != -1) {
			cs2method_10310(a3);
		} else {
			cs2method_10310(2287);
		}
	} else if (a2 != -1) {
		cs2method_10356(1);
		cs2method_10278(6311474);
		cs2method_11070(a2, -1);
		if (client_configs['cfg1226'].bitcfg3295 == 22 && client_configs['cfg1226'].bitcfg3296 != 13 && client_configs['cfg1226'].bitcfg3296 != 14 && client_configs['cfg1226'].bitcfg3296 != 15) {
			cs2method_10057(1, "Check materials");
			cs2method_20703(new function<script_1864>(int a0,int a1,int a2,int a3) {
				if (a2 != 1) {
					return;
				}
				switch (a1) {
					case 12:
						switch (a3) {
							case 0:
								cs2method_10810("Rick: " + (string)cs2method_10379(idx17mapData('i', 'i', 238, 1)) + " coins.");
								break;
							case 1:
								cs2method_10810("Maid: " + (string)cs2method_10379(idx17mapData('i', 'i', 238, 3)) + " coins.");
								break;
							case 2:
								cs2method_10810("Cook: " + (string)cs2method_10379(idx17mapData('i', 'i', 238, 5)) + " coins.");
								break;
							case 3:
								cs2method_10810("Butler: " + (string)cs2method_10379(idx17mapData('i', 'i', 238, 6)) + " coins.");
								break;
							case 4:
								cs2method_10810("Demon Butler: " + (string)cs2method_10379(idx17mapData('i', 'i', 238, 8)) + " coins.");
						}
						return;
					case 0:
						switch (a0) {
							case 8170:
								a0 = 8415;
								break;
							case 8315:
								a0 = 8395;
								break;
							case 8222:
								a0 = 8396;
								break;
							case 8121:
								a0 = 8397;
								break;
							case 8379:
								a0 = 8406;
								break;
							case 8037:
								a0 = 8398;
								break;
							case 8255:
								a0 = 8401;
								break;
							case 8163:
								a0 = 8399;
								break;
							case 8027:
								a0 = 8400;
								break;
							case 8259:
								a0 = 8403;
								break;
							case 8340:
								a0 = 8407;
								break;
							case 9822:
								a0 = 9842;
								break;
							case 8068:
								a0 = 8405;
								break;
							case 8333:
								a0 = 8408;
								break;
							case 8195:
								a0 = 8416;
								break;
							case 8363:
								a0 = 8409;
								break;
							case 8302:
								a0 = 8410;
								break;
							case 8123:
								a0 = 8411;
								break;
							case 8122:
								a0 = 18800;
								break;
							case 8151:
								a0 = 8414;
						}
						cs2method_10810((string)cs2method_10018(a0) + ": " + (string)cs2method_10055(cs2method_10340(a0), 1) + " coins.");
						return;
					case 14:
					case 15:
						return;
				}
				globalarray_0 = new int[6];
				globalarray_1 = new int[6];
				int v0 = 0;
				if (itemDefsAttribute(a0, 211) != -1) {
					globalarray_0[0] = itemDefsAttribute(a0, 211);
					globalarray_0[0] = itemDefsAttribute(a0, 212);
					v0 = cs2method_10060(v0, 1);
				}
				if (itemDefsAttribute(a0, 213) != -1) {
					globalarray_0[1] = itemDefsAttribute(a0, 213);
					globalarray_0[1] = itemDefsAttribute(a0, 214);
					v0 = cs2method_10060(v0, 1);
				}
				if (itemDefsAttribute(a0, 215) != -1) {
					globalarray_0[2] = itemDefsAttribute(a0, 215);
					globalarray_0[2] = itemDefsAttribute(a0, 216);
					v0 = cs2method_10060(v0, 1);
				}
				if (itemDefsAttribute(a0, 217) != -1) {
					globalarray_0[3] = itemDefsAttribute(a0, 217);
					globalarray_0[3] = itemDefsAttribute(a0, 218);
					v0 = cs2method_10060(v0, 1);
				}
				if (itemDefsAttribute(a0, 219) != -1) {
					globalarray_0[4] = itemDefsAttribute(a0, 219);
					globalarray_0[4] = itemDefsAttribute(a0, 220);
					v0 = cs2method_10060(v0, 1);
				}
				if (itemDefsAttribute(a0, 221) != -1) {
					globalarray_0[5] = itemDefsAttribute(a0, 221);
					globalarray_0[5] = itemDefsAttribute(a0, 222);
					v0 = cs2method_10060(v0, 1);
				}
				switch (v0) {
					case 1:
						cs2method_10810((string)cs2method_10018(a0) + ":");
						cs2method_10810((string)cs2method_10055(globalarray_1[0], 1) + " x " + (string)cs2method_10018(globalarray_0[0]));
						break;
					case 2:
						cs2method_10810((string)cs2method_10018(a0) + ":");
						cs2method_10810((string)cs2method_10055(globalarray_1[0], 1) + " x " + (string)cs2method_10018(globalarray_0[0]));
						cs2method_10810((string)cs2method_10055(globalarray_1[1], 1) + " x " + (string)cs2method_10018(globalarray_0[1]));
						break;
					case 3:
						cs2method_10810((string)cs2method_10018(a0) + ":");
						cs2method_10810((string)cs2method_10055(globalarray_1[0], 1) + " x " + (string)cs2method_10018(globalarray_0[0]));
						cs2method_10810((string)cs2method_10055(globalarray_1[1], 1) + " x " + (string)cs2method_10018(globalarray_0[1]));
						cs2method_10810((string)cs2method_10055(globalarray_1[2], 1) + " x " + (string)cs2method_10018(globalarray_0[2]));
						break;
					case 4:
						cs2method_10810((string)cs2method_10018(a0) + ":");
						cs2method_10810((string)cs2method_10055(globalarray_1[0], 1) + " x " + (string)cs2method_10018(globalarray_0[0]));
						cs2method_10810((string)cs2method_10055(globalarray_1[1], 1) + " x " + (string)cs2method_10018(globalarray_0[1]));
						cs2method_10810((string)cs2method_10055(globalarray_1[2], 1) + " x " + (string)cs2method_10018(globalarray_0[2]));
						cs2method_10810((string)cs2method_10055(globalarray_1[3], 1) + " x " + (string)cs2method_10018(globalarray_0[3]));
						break;
					case 5:
						cs2method_10810((string)cs2method_10018(a0) + ":");
						cs2method_10810((string)cs2method_10055(globalarray_1[0], 1) + " x " + (string)cs2method_10018(globalarray_0[0]));
						cs2method_10810((string)cs2method_10055(globalarray_1[1], 1) + " x " + (string)cs2method_10018(globalarray_0[1]));
						cs2method_10810((string)cs2method_10055(globalarray_1[2], 1) + " x " + (string)cs2method_10018(globalarray_0[2]));
						cs2method_10810((string)cs2method_10055(globalarray_1[3], 1) + " x " + (string)cs2method_10018(globalarray_0[3]));
						cs2method_10810((string)cs2method_10055(globalarray_1[4], 1) + " x " + (string)cs2method_10018(globalarray_0[4]));
						break;
					case 6:
						cs2method_10810((string)cs2method_10018(a0) + ":");
						cs2method_10810((string)cs2method_10055(globalarray_1[0], 1) + " x " + (string)cs2method_10018(globalarray_0[0]));
						cs2method_10810((string)cs2method_10055(globalarray_1[1], 1) + " x " + (string)cs2method_10018(globalarray_0[1]));
						cs2method_10810((string)cs2method_10055(globalarray_1[2], 1) + " x " + (string)cs2method_10018(globalarray_0[2]));
						cs2method_10810((string)cs2method_10055(globalarray_1[3], 1) + " x " + (string)cs2method_10018(globalarray_0[3]));
						cs2method_10810((string)cs2method_10055(globalarray_1[4], 1) + " x " + (string)cs2method_10018(globalarray_0[4]));
						cs2method_10810((string)cs2method_10055(globalarray_1[5], 1) + " x " + (string)cs2method_10018(globalarray_0[5]));
						break;
					default:
						cs2method_10810(cs2method_10018(a0));
				}
				return;
			}, -2147483644, a2, client_configs['cfg1226'].bitcfg3296, a5, "ioii");
			cs2method_20674(new function<script_1862>(int a0,int a1) {
				if (cs2method_11038(a1, a0) == 1) {
					cs2method_10002(100);
				}
				return;
			}, new WidgetPointer(-32768,3), -2147483643, "Ii");
			cs2method_20884(new function<script_1863>(int a0,int a1) {
				if (cs2method_11038(a1, a0) == 1) {
					cs2method_10002(0);
				}
				return;
			}, new WidgetPointer(-32768,3), -2147483643, "Ii");
		}
	} else {
		cs2method_11070(7620, -1);
	}
	cs2method_10063(28, a0, 0, 0);
	cs2method_10606(32702470, 4, cs2method_10060(cs2method_10051(a5, 3), 2));
	int v0 = cs2method_10805(228, 495, a4);
	cs2method_10013(228, cs2method_10051(v0, 15), 0, 0);
	cs2method_10797(a4);
	cs2method_10063(66, a0, 0, 0);
	cs2method_11105(0, 0, 0);
	cs2method_10811(4600330);
	cs2method_10692(495);
	cs2method_10173(0);
	if (cs2method_10051(v0, 15) < 32) {
		return 32;
	}
	return cs2method_10060(cs2method_10051(v0, 15), 5);
}
