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


int script_7157(int a0,int a1) {
	int v10 = 0;
	int v4 = 0;
	int v1 = -1;
	object v13 = "null";
	int v8 = 0;
	int v11 = 0;
	int v7 = 0;
	int v6 = 0;
	int v3 = 0;
	int v9 = 0;
	int v0 = cs2method_10060(cs2method_10152(89849954), cs2method_10823(89849954));
	int v5 = 0;
	int v2 = 0;
	int v12 = 13083202;
	cs2method_10273(a1);
	while (v10 <= 10) {
		switch (v10) {
			case 0:
				v7 = script_7246(a0);
				if (v7 > 0) {
					v8 = 104;
					v11 = 6;
				} else {
					v8 = 0;
				}
				break;
			case 1:
				v8 = itemDefsAttribute(a0, 2997);
				v11 = itemDefsAttribute(a0, 2998);
				v7 = itemDefsAttribute(a0, 2999);
				v6 = itemDefsAttribute(a0, 3000);
				break;
			case 2:
				v8 = itemDefsAttribute(a0, 3001);
				v11 = itemDefsAttribute(a0, 3002);
				v7 = itemDefsAttribute(a0, 3003);
				v6 = itemDefsAttribute(a0, 3004);
				break;
			case 3:
				v8 = itemDefsAttribute(a0, 3005);
				v11 = itemDefsAttribute(a0, 3006);
				v7 = itemDefsAttribute(a0, 3007);
				v6 = itemDefsAttribute(a0, 3008);
				break;
			case 4:
				v8 = itemDefsAttribute(a0, 3009);
				v11 = itemDefsAttribute(a0, 3010);
				v7 = itemDefsAttribute(a0, 3011);
				v6 = itemDefsAttribute(a0, 3012);
				break;
			case 5:
				v8 = itemDefsAttribute(a0, 3013);
				v11 = itemDefsAttribute(a0, 3014);
				v7 = itemDefsAttribute(a0, 3015);
				v6 = itemDefsAttribute(a0, 3016);
				break;
			case 6:
				v8 = itemDefsAttribute(a0, 3017);
				v11 = itemDefsAttribute(a0, 3018);
				v7 = itemDefsAttribute(a0, 3019);
				v6 = itemDefsAttribute(a0, 3020);
				break;
			case 7:
				v8 = itemDefsAttribute(a0, 3021);
				v11 = itemDefsAttribute(a0, 3022);
				v7 = itemDefsAttribute(a0, 3023);
				v6 = itemDefsAttribute(a0, 3024);
				break;
			case 8:
				v8 = itemDefsAttribute(a0, 3025);
				v11 = itemDefsAttribute(a0, 3026);
				v7 = itemDefsAttribute(a0, 3027);
				v6 = itemDefsAttribute(a0, 3028);
				break;
			case 9:
				v8 = itemDefsAttribute(a0, 3029);
				v11 = itemDefsAttribute(a0, 3030);
				v7 = itemDefsAttribute(a0, 3031);
				v6 = itemDefsAttribute(a0, 3032);
				break;
			case 10:
				v8 = itemDefsAttribute(a0, 3033);
				v11 = itemDefsAttribute(a0, 3034);
				v7 = itemDefsAttribute(a0, 3035);
				v6 = itemDefsAttribute(a0, 3036);
		}
		if (v8 != 0) {
			v3 = 1;
			int v15 = script_7158(v8, v11);
			int v18 = v8;
			int v14 = v11;
			int v23 = v7;
			int v16 = v6;
			script_7159_struct(1,1,0) v21 = script_7159(v18, v14, v23, v16);
			int v19 = v21.intpart_0;
			object v29 = v21.objectpart_0;
			int v28 = cs2method_10060(v0, 1);
			int v17 = 0;
			int v27 = v4;
			int v25 = script_7132(a1, v4);
			int v22 = cs2method_10060(cs2method_10060(3, 15), 5);
			script_7134(a1, 17813, v19, v28, v29, v22, cs2method_10461(cs2method_10236(a1), v22), v25);
			int v24 = cs2method_11048(v17, cs2method_10060(cs2method_10406(), cs2method_10664()));
			int v20 = cs2method_10060(v25, 1);
			cs2method_10606(a1, 5, v20);
			cs2method_10310(v15);
			cs2method_10013(15, 15, 0, 0);
			cs2method_10063(3, cs2method_11048(v28, cs2method_10461(cs2method_10060(cs2method_10406(), cs2method_10968(cs2method_10664(), 2)), cs2method_10968(cs2method_10664(), 2))), 0, 0);
			int v26 = cs2method_11048(v24, cs2method_10060(cs2method_10406(), cs2method_10664()));
			v4 = cs2method_10060(v20, 1);
			int v30 = cs2method_10060(v26, 3);
			script_7133(0, cs2method_10461(v28, 1), cs2method_10236(a1), cs2method_10461(v30, v28), a1, cs2method_10461(v4, 5));
			v0 = v30;
		}
		v10 = cs2method_10060(v10, 1);
	}
	if (v3 == 1) {
		return v0;
	}
	return 0;
}
