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


void script_9410(int a0) {
	int v8 = -1;
	int v20 = -1;
	int v15 = -1;
	int v7 = -1;
	int v23 = -1;
	int v2 = -1;
	int v0 = -1;
	int v22 = -1;
	int v18 = 0;
	int v5 = idx17mapData('i', 'J', 8211, a0);
	int v4 = a0;
	script_9409_struct(9,0,0) v1 = script_9409(v4);
	int v12 = v1.intpart_8;
	int v11 = v1.intpart_7;
	int v13 = v1.intpart_6;
	int v14 = v1.intpart_5;
	int v19 = v1.intpart_4;
	int v10 = v1.intpart_3;
	int v21 = v1.intpart_2;
	int v3 = v1.intpart_1;
	int v16 = v1.intpart_0;
	if (v16 == -1 || v3 == -1 || v21 == -1) {
		return;
	}
	int v6 = idx22mapAttribute(v5, 3937);
	if (v19 == 1 && idx22mapAttribute(v5, 3943) == 1) {
		v6 = cs2method_10122(40, 100, v6);
		if (client_configs['cfg3975'].bitcfg21115 == 3) {
			if (script_259(idx22mapAttribute(v5, 3931)) == 0 && client_configs['cfg3835'].bitcfg21223 == 0) {
				v19 = 0;
			}
		} else {
			if (script_259(idx22mapAttribute(v5, 3932)) == 0 && client_configs['cfg3835'].bitcfg21224 == 0) {
				v19 = 0;
			}
		}
	}
	if (cs2_configs['cfg3859'] == 1) {
		v6 = cs2method_10122(95, 100, v6);
	}
	if (client_configs['cfg3975'].bitcfg21115 == 3) {
		cs2method_10026(v16, cs2method_10018(idx22mapAttribute(v5, 3931)));
		cs2method_10026(v3, (string)cs2method_10055(v6, 1) + " renown");
		if (idx22mapAttribute(v5, 3941) == 1) {
			cs2method_10758(idx22mapAttribute(v5, 3948), v21);
		} else {
			cs2method_10039(idx22mapAttribute(v5, 3931), -1, v21);
		}
	} else if (idx22mapAttribute(v5, 3941) == 1) {
		cs2method_10758(idx22mapAttribute(v5, 3949), v21);
	} else {
		cs2method_10039(idx22mapAttribute(v5, 3932), -1, v21);
	}
	cs2method_10026(v16, cs2method_10018(idx22mapAttribute(v5, 3932)));
	cs2method_10026(v3, (string)cs2method_10055(v6, 1) + " renown");
	int v9 = idx22mapAttribute(v5, 3939);
	int v17 = 0;
	cs2method_10606(v10, 5, v17);
	if (v9 == 0) {
		if (client_configs['cfg3975'].bitcfg21115 == 3) {
			cs2method_11070(30254, -1);
		} else {
			cs2method_11070(30259, -1);
		}
	} else if (v9 == 1) {
		if (client_configs['cfg3975'].bitcfg21115 == 3) {
			cs2method_11070(30255, -1);
		} else {
			cs2method_11070(30260, -1);
		}
	} else if (v9 == 2) {
		if (client_configs['cfg3975'].bitcfg21115 == 3) {
			cs2method_11070(30256, -1);
		} else {
			cs2method_11070(30261, -1);
		}
	} else if (v9 == 3) {
		if (client_configs['cfg3975'].bitcfg21115 == 3) {
			cs2method_11070(30257, -1);
		} else {
			cs2method_11070(30262, -1);
		}
	} else {
		if (v9 == 4) {
			if (client_configs['cfg3975'].bitcfg21115 == 3) {
				cs2method_11070(30258, -1);
			} else {
				cs2method_11070(30263, -1);
			}
		}
	}
	cs2method_10013(25, 25, 0, 0);
	cs2method_10063(cs2method_10461(cs2method_10191(v3), 25), cs2method_10461(cs2method_10152(v3), 3), 0, 0);
	cs2method_10337(1);
	cs2method_20353(new function<script_9418>(int a0,int a1) {
		object v0 = "";
		switch (a1) {
			case 0:
				v0 = "Bronze token required";
				break;
			case 1:
				v0 = "Silver token required";
				break;
			case 2:
				v0 = "Gold token required";
				break;
			case 3:
				v0 = "Runite token required";
				break;
			case 4:
				v0 = "Dragon token required";
		}
		script_8800(a0, -1, v0);
		return;
	}, new WidgetPointer(v14), v9, "Ii");
	cs2method_20884(new function<script_8805>() {
		script_8808();
		return;
	}, "");
	script_9413(a0, v19);
	return;
}
