const sml = new Array("p001", 18, 18, "p002", 15, 15, "p003", 22, 15, "p004", 15, 15, "p005", 20, 20, "p006", 31, 28, "p007", 15, 15, "p008", 21, 22, "p009", 28, 24, "p010", 28, 21, "p011", 62, 28, "p012", 15, 21, "p013", 15, 19, "p014", 15, 15, "p015", 16, 16, "p016", 15, 15, "p017", 21, 15, "p018", 15, 21, "p019", 42, 23, "p020", 26, 25, "p021", 25, 27, "p022", 26, 26, "p023", 26, 27, "p024", 27, 22, "p025", 26, 28, "p026", 15, 15, "p027", 19, 17, "p028", 15, 18, "p029", 15, 15, "p030", 49, 18, "p031", 37, 15, "p032", 27, 15, "p033", 15, 15, "p034", 15, 15, "p035", 15, 15, "p036", 37, 15, "p037", 15, 15, "p038", 27, 28, "p039", 55, 24, "p040", 15, 22, "p041", 15, 15, "p042", 15, 15, "p043", 15, 20, "p044", 22, 19, "p045", 70, 25, "p046", 27, 29, "p047", 22, 16, "p048", 15, 15, "p049", 46, 26, "p050", 30, 26, "p051", 13, 15, "p052", 23, 19, "p053", 40, 18, "p054", 20, 20, "p055", 56, 15, "p056", 15, 20, "p057", 15, 15, "p058", 57, 28, "p059", 16, 16, "p060", 15, 15, "p061", 38, 18, "p062", 15, 15, "p063", 82, 16, "p064", 36, 15, "p065", 15, 15, "p066", 15, 15, "p067", 23, 15, "p068", 15, 15, "p069", 26, 16, "p070", 33, 19, "p071", 43, 19, "p072", 80, 20, "p073", 100, 34, "p074", 70, 34, "p075", 40, 28, "p076", 34, 27, "p077", 28, 29, "p078", 60, 40, "p079", 48, 20, "p080", 35, 25, "p081", 39, 26, "p082", 25, 21, "p083", 37, 37, "p084", 37, 37, "p085", 27, 27, "p086", 37, 37, "p087", 37, 37, "p088", 37, 37, "p089", 37, 37, "p090", 37, 37, "p091", 37, 37, "p092", 32, 23, "p093", 33, 37, "p094", 33, 27, "p095", 25, 25, "p096", 25, 25, "p097", 39, 25, "p098", 39, 25, "p099", 30, 21, "p100", 40, 21, "p101", 30, 21, "p102", 31, 36, "p103", 30, 35, "p104", 32, 32, "p105", 45, 45, "p106", 50, 35, "p107", 45, 41, "p108", 31, 27, "p109", 44, 30, "p110", 29, 20, "p111", 29, 27, "p112", 29, 20, "p113", 29, 20, "p114", 51, 24, "p115", 43, 35, "p116", 45, 23, "p117", 36, 24, "p118", 51, 35, "p119", 41, 31, "p120", 29, 29, "p121", 32, 26, "p122", 40, 25, "p123", 37, 22, "p124", 40, 36, "p125", 38, 33, "p126", 23, 23, "p127", 33, 24, "p128", 30, 20); let cb_id = 1, cb_date = {}, cb_rdate = {}, cb_ndate = {}, cb_select = 1, ed_select = -1, cb_conf = {1: '100000001110', 2: '200010100001', 3: '211101010001'}; let petsel = ''; function winframe(id, title, w, h, url) { win.add(`${id}winframe`, `${title}  `, '', {'d': ``}, 0, 1, ''); } function petbuy() { const r = ` `; petsel = 0; win.add('buypet', 'Призвать зверя (цена: 50 кр.))  ', `
Введите кличку и выберите зверя

${r}
`, { 'a1': `petbuyAct($(\'#petbuylogin\').val(),\'\')`, 'usewin': '$(\'#petbuylogin\').focus()', 'd': '' }, 2, 1, 'min-width:290px;'); } function petbuyAct(data) { getUrl('main', 'main.php?newanimal&pet=' + petsel + '&petname=' + data); } function petbuySet(id) { let i = 1; while (i <= 7) { petbutSetCss(i++, "3px", "0") } petbutSetCss(id, "0", "3px solid #7788ff") petsel = id; } function petbutSetCss(count, padding, border) { $(`#apet${count}`).css({ 'padding': padding, 'border': border }); } // 1 function eda(id, name, price, vvv) { win.add('animaleda1', `Покормить "${name}"  `, `
Введите количество еды:
(цена 1 ед. = ${price} кр.)
`, { 'a1': `edaGo(${(0 + id)},$(\'#edaanimal1vvv\').val())`, 'usewin': '', 'd': `
` }, 3, 1, 'min-width:300px;'); } // 2 function edaGo(id, val) { getUrl('main', `main.php?newanimal&eda=${id}&vvv=${val}`); } // 3 function anrename(id, name) { win.add('animaleda2', `Изменить кличку "${name}"  `, '
Введите новую кличку:
(цена 30 кр.)
', { 'a1': `anrenameGo(${(0 + id)},$(\'#edaanimal2vvv\').val())`, 'usewin': '', 'd': '
' }, 3, 1, 'min-width:300px;'); } // 4 function anrenameGo(id, val) { getUrl('main', `main.php?newanimal&rename=${id}&vvv=${val}`); } //Каптча на действия // 5 function captcha(title, act) { win.add('captcha', `${title}  `, '
Укажите код с картинки:
', { 'a1': `captchatext1($(\'#captchatext1\').val(),\'${act}\')`, 'usewin': '$(\'#captchatext1\').focus()', 'd': '' }, 3, 1, 'min-width:230px;'); } // 6 function captchatext1(val, act) { getUrl('main', `${act}&cptch1=${val}`); } // 7 function leaderFight() { win.add('leaderFightNew1', 'Передать флаг  ', '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': 'leaderFx($(\'#leaderFightgroup1\').val())', 'usewin': 'chat.inObj = $(\'#leaderFightgroup1\');$(\'#leaderFightgroup1\').focus()', 'd': '
' }, 3, 1, 'min-width:300px;'); chat.inObj = $('#leaderFightgroup1'); } // оптимизация с вызовом function leaderFx(login) { top.frames['main'].leader_login = login; top.frames['main'].leader_type = 1; top.frames['main'].reflesh(); } function leaderFight2() { win.add('leaderFightNew2', 'Убить  ', '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': 'leaderFx2($(\'#leaderFightgroup2\').val())', 'usewin': 'chat.inObj = $(\'#leaderFightgroup2\');$(\'#leaderFightgroup2\').focus()', 'd': '
' }, 3, 1, 'min-width:300px;'); chat.inObj = $('#leaderFightgroup2'); } // оптимизация с вызовом function leaderFx2(login) { top.frames['main'].leader_login = login; top.frames['main'].leader_type = 2; top.frames['main'].reflesh(); } // оптимизация в цикле 8 function intransferNew(id, login) { win.add( `intransfer${id}New`, 'Приглашение на обмен  ', `
Персонаж ${login} предлагает вам совершить обмен. Вы согласны?

`, { 'a1': 'frames[\'main\'].location.href=\'/main.php?transfer=1&rnd=1\';', 'a2': 'frames[\'main\'].location.href=\'/main.php?transfer=1&exit_transfer=1&rnd=1\';', 'a3': 'frames[\'main\'].location.href=\'/main.php?transfer=1&exit_transfer=1&rnd=1\';' }, 2, 1, 'min-width:300px;' ); } // оптимизация в цикле 9 function inclanNew(id, align, clan_img, name, login) { win.add( `inclan${id}New`, `Приглашение вступить в клан "${name}"  `, `

${login} предлагает вам вступить в клан  ${name}. Вы согласны?

`, { 'a1': `inclanNewsave(${id},1);`, 'a2': `inclanNewsave(${id},2);`, 'a3': `inclanNewsave(${id},2);` }, 2, 1, 'min-width:300px;' ); } // 10 function inclanNewsave(id, val) { getUrl('main', `/main.php?newclan=${id}&newclan_val=${val}`); } // function savePriems() { win.add('saveComplPriem', 'Запомнить набор приемов  ', '
Запомнить набор приемов, для быстрого переключения.Введите название набора:
', { 'a1': 'addSavedPriems($(\'#addSavedPriems\').val());', 'usewin': '$(\'#addSavedPriems\').focus()', 'd': '
' }, 3, 1, 'min-width:300px;'); } // 12 function addSavedPriems(val) { getUrl('main', `main.php?skills=1&rz=4&savePriems=${val}&sd4=${sd4key}`); } function atackTower() { win.add('towerAttakWin', 'Напасть на персонажа  ', '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': 'atackTowergo($(\'#towerAttakTxt\').val());', 'usewin': 'chat.inObj = $(\'#towerAttakTxt\');$(\'#towerAttakTxt\').focus()', 'd': '
' }, 3, 1, 'min-width:300px;'); chat.inObj = $('#towerAttakTxt'); } // 13 function atackTowergo(val) { getUrl('main', `main.php?attack=${val}`); } function anren() { win.add('neAnimName', 'Выберите кличку  ', '
Введите одно слово:
(Не более десяти символов)
', { 'a1': 'anrenSave($(\'#addSavedAnmName\').val());', 'usewin': '$(\'#addSavedAnmName\').focus()', 'd': '
' }, 3, 1, 'min-width:300px;'); } // 14 function anrenSave(name) { getUrl('main', `main.php?pet=1&anml_login=${name}&sd4=${sd4key}`); } // 15 /** * @param {number} id * @param {string} name * @param {string} main * @param {string} indata */ function add_cb(id, name, main, indata = '') { const cb = document.getElementById('chat_menu'); const ch = document.getElementById('canals'); if (!cb) { return; } cb_date[cb_id] = id; cb_rdate[id] = cb_id; console.log(cb_ndate, name, cb_ndate['Системные сообщения'], cb_ndate['Чат']); if (cb_ndate[name] !== undefined) { let j = 1, name2 = ''; while (j !== -1) { name2 = `${name} (${j})`; console.log(name2) if (cb_ndate[name2] === undefined) { name = name2; j -= 2; // тут1 } j++; } } cb_ndate[name] = cb_id; let unright = '', unleft = ''; function unLeft(count) { return unleft = `
`; } if (cb_id === 1) { unright = `
`; unLeft(cb_id); } else { unLeft(cb_id); document.getElementById(`ldb${cb_id - 1}`).className = 'zbtn1r2'; } let cd_wdw = [0, 30, 70, 25, 150, 25, 70]; let cd_stl = ['', '', '', '', '', '', '']; if (!cd_wdw[id]) cd_wdw = ''; else cd_wdw = `width:${cd_wdw[id]}px`; cb.innerHTML = `
${unleft}${unright}
${name}
`; if (!$(`#canal${id}`).html()) { ch.innerHTML = ``; } cb_id++; open_cb(cb_select, null); } function create_radio(id, act, clss) { return `
`; } // 1 function create_check(id, act, clss) { return `
`; } var slcbrc = [0, 0, 1, 0, 0]; // 2 function cb_radio_click_b(el, id) { if ($(el).attr('radio_check') == 1) { if ($(el).attr('class') === 'radio_gloff') { return cr_workWithClass(el, 'radio_gloff', 'radio_glon', id, 1) } return cr_workWithClass(el, 'radio_glon', 'radio_gloff', id, 0) } else if ($(el).attr('radio_check') == 2) { if ($(el).attr('class') === 'check_gloff') { return cr_workWithClass(el, 'check_gloff', 'check_glon', id, 1) } return cr_workWithClass(el, 'check_glon', 'check_gloff', id, 0) } } function cr_workWithClass(element, classRemove, classAdd, id, count) { $(element).removeClass(classRemove); $(element).addClass(classAdd); slcbrc[id] = count; } // 3 function cb_radio_click(el, id) { let cb_sm = true; if (id === 1) { if (slcbrc[1] === 0) { if (slcbrc[2] === 1) { cb_radio_click_b($('#cr_rach_rc2'), 2); } if (slcbrc[3] === 1) { cb_radio_click_b($('#cr_rach_rc3'), 3); } } else return cb_sm = false; } else if (id === 2) { if (slcbrc[2] === 0) { if (slcbrc[1] === 1) { cb_radio_click_b($('#cr_rach_rc1'), 1); } } else return cb_sm = false; } else if (id === 3) { if (slcbrc[3] === 0) { if (slcbrc[1] === 1) { cb_radio_click_b($('#cr_rach_rc1'), 1); } if (slcbrc[2] === 0) { cb_radio_click_b($('#cr_rach_rc2'), 2); } if (slcbrc[4] === 1) { cb_radio_click_b($('#cr_rach_rc4'), 4); } } } else if (id === 4) { if (slcbrc[4] === 0) { if (slcbrc[3] === 1) { cb_radio_click_b($('#cr_rach_rc3'), 3); } } } cb_radio_click_b(el, id); } var fasthtmlarr = [0, [], []]; var fastpanelopen = 0; // 4) function addfastpanel(id, name, type, price, price2, madein, img, itemid, iznosnow, iznosmax, otdel, mbodet, mbused, norefl) { if (fasthtmlarr[0] >= 10) { return alert('Все слоты под быстрый доступ заполнены!'); } else { if (fasthtmlarr[2][id] === undefined) { fasthtmlarr[0]++; var i = 0; var iid = 0; while (i <= 10) { if (fasthtmlarr[1][i] === undefined && iid === 0) { iid = i; } i++; } fasthtmlarr[1][iid] = [id, name, type, price, price2, madein, img, itemid, iznosnow, iznosmax, otdel, mbodet, mbused]; fasthtmlarr[2][id] = true; if (fastpanelopen === 1) { //Обновляем окно fastpanelopen = 0; win.closew('fastpanel'); } if (norefl == 0) return fastpanelsave(); } return alert('Данный предмет уже выставлен в слот!'); } } // 5 function intvalor(mixed_var, base) { let tmp; if (typeof (mixed_var) == 'string') { tmp = parseInt(mixed_var); if (isNaN(tmp)) return 0; return tmp.toString(base || 10); } else if (typeof (mixed_var) == 'number') { return Math.floor(mixed_var); } else { return 0; } } function fastpanel() { //окно быстрого доступа if (fastpanelopen === 0) { fastpanelopen = 1; var fasthtml = ''; var i = 1; while (i <= 10) { var slot = ''; var clss = ''; if (fasthtmlarr[1][i] !== undefined) { var titlemini = `${fasthtmlarr[1][i][1]}
`; if (fasthtmlarr[1][i][3] > 0) { titlemini += `
Цена: ${fasthtmlarr[1][i][3]} кр.`; } if (fasthtmlarr[1][i][4] > 0) { titlemini += `
Цена: ${fasthtmlarr[1][i][4]} екр.`; } if (fasthtmlarr[1][i][9] > 0) { titlemini += `
Долговечность: ${intvalor(fasthtmlarr[1][i][8])}/${intvalor(fasthtmlarr[1][i][9])}`; } if (fasthtmlarr[1][i][5] !== '') { titlemini += `
Сделано в ${fasthtmlarr[1][i][5]}`; } slot = ``; clss = `filter: alpha(opacity=100);opacity:1.00;-moz-opacity:1.00;-khtml-opacity:1.00;" onclick="fastpanelused(${i},event);" oncontextmenu="fastpanelused(${i},event); return false;" class="cp" onMouseOver="top.hi(this,\'${titlemini}\',event,2,1,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();`; } else { slot = ``; clss = 'filter: alpha(opacity=30);opacity:0.30;-moz-opacity:0.30;-khtml-opacity:0.30;'; } fasthtml += `
${slot}
`; i++; } win.add('fastpanel', 'Панель быстрого доступа  ', `
${fasthtml}
`, { 'closewin': 'fastpanelopen=0;', 'd': '' }, 1, 1, 'min-width:230px;'); } else { fastpanelopen = 0; win.closew('fastpanel'); } } function fastpanelused(i, e) { const mnmnmn = []; let mni = 0; if (fasthtmlarr[1][i][12] === 1) { mnmnmn[mni] = [`top.frames[\'main\'].location.href=\'${c.https}/main.php?otdel=${fasthtmlarr[1][i][10]}&inv=1&use_pid=${fasthtmlarr[1][i][0]}&sd4=\';`, 'Использовать']; mni++; } if (fasthtmlarr[1][i][11] === 1) { mnmnmn[mni] = [`top.frames[\'main\'].location.href=\'${c.https}/main.php?otdel=${fasthtmlarr[1][i][10]}&inv=1&oid=${fasthtmlarr[1][i][0]}&rnd=1\';`, 'Надеть предмет']; mni++; } // mnmnmn[mni] = [`fastpanelusedDelete(\'${i}\');`, 'Убрать']; mni++; infoMenuMy('test', e, '', mnmnmn); } function fastpanelusedDelete(i) { delete fasthtmlarr[2][fasthtmlarr[1][i][0]]; delete fasthtmlarr[1][i]; fasthtmlarr[0]--; if (fastpanelopen === 1) { //Обновляем окно fastpanelopen = 0; win.closew('fastpanel'); fastpanel(); } fastpanelsave(); } function fastpanelsave() { var fpitm = ''; var i = 0; while (i <= 10) { if (fasthtmlarr[1][i] !== undefined && fasthtmlarr[1][i][0] !== undefined) { fpitm += `${fasthtmlarr[1][i][0]}|`; } else fpitm += '0|'; i++; } // $.getJSON('fastpanel.php', {'items': fpitm}); // } // 4.1 function cb_getBtl() { return `
${create_radio('rc1', '', 'off')} Упрощенный бой
${create_radio('rc2', '', 'on')} Стандартный бой
  ${create_check('rc3', '', 'off')}  Удар при выставлении хода
${create_check('rc4', '', 'off')} Не сбрасывать выбор
`; } // 4.2 let cb_status_now = 0; /** * @param {number} id */ function cb_status(id) { //top.open_cb(cb_rdate[5],null); if (window.des !== 1) { return; } if ((top.frames['main'].locitems !== 0 || (top.frames['main'].locitems === undefined && $('#canal1').html())) && id < 2) id += 2; if (id === cb_status_now) { return; } var chat_btlConfig = cb_getBtl(); function out_of_battleTop(count, canalTrue) { if (canalTrue) $("#canal3").html(''); add_cb(4, 'Системные сообщения', 'ch4', '
'); // все (4) add_cb(5, 'Чат', 'ch5', '
'); // все (4) open_cb(cb_rdate[count], null); // все (4) cb_status_now = id; // все } if (id === 1 || id === 2 || id === 3 || id === 4) { open_clear_cb(); $("#chat_menu").html(''); cb_id = 1; cb_date = {}; cb_rdate = {}; cb_ndate = {}; cb_select = 1; ed_select = -1; cb_conf = {1: '100000001110', 2: '200010100001', 3: '211101010001'}; } if (id === 1) { //чат return out_of_battleTop(5, true) } else if (id === 2) { // боевая система add_cb(2, 'Настройки', 'ch2', chat_btlConfig); add_cb(3, 'Лог', 'ch3', '
'); add_cb(7, 'Мой Лог', 'ch7', '
'); return out_of_battleTop(3, false) } else if (id === 3) { //чат + предмет return out_of_battleTop(5, true) } else if (id === 4) { // боевая система + предмет add_cb(3, 'Лог', 'ch3', '
'); return out_of_battleTop(3, false) } } // 4.3 function cb_statusTest() { if (window.des !== 1) { return; } if (top.frames['main'] !== undefined) { if (top.frames['main'].battle !== undefined) { if (top.frames['main'].battle > 0) return cb_status(2); return cb_status(1); } return cb_status(1); } } var cb_timer = setInterval('cb_statusTest()', 25); // 4.4 function falseBlue(id) { $(`#blueText${id}`).css({'color': ''}); } // 4.5 /** * @param {number} id */ function blueTextSee(id) { let color = id === 6 ? 'red' : 'blue'; if (cb_select !== cb_rdate[id] && (id === 4 || id === 5 || id === 6)) { return $(`#blueText${cb_rdate[id]}`).css({'color': color}); } } //[0][1][2][3][4][5][6][7][8][9] /* 0 - движение, 1 - вверх, 2 - вниз, 3 - без действия 1 - общий чат 2 - приватный чат 3 - система (личная) 4 - система (общая) 5 - клан 6 - клан (система) 7 - межгород 8 - лог боя 9 - лог боя (личный) 10 - автоочистка чата (после боя) 11 - автоочистка чата (хранить только видимые сообщения) */ // 4.6 function open_clear_work(symbId, count, className) { top.document.getElementById(`${symbId}db${count}`).className = className; top.document.getElementById(`canal${cb_date[count]}`).style.display = 'none'; } function open_clear_cb() { let i = 1; while (i !== -1) { if (top.document.getElementById(`cb${i}`)) { open_clear_work("c", i, "zbtn1c") if (i === 1) { open_clear_work("r", i, "zbtn1r") } if (i === cb_id - 1) { open_clear_work("l", i, "zbtn1l") } if (i >= 1 && i < cb_id - 1) { open_clear_work("l", i, "zbtn1r2") } } else { i = -2; } i++; } } function open_cb_work(select) { const ed = top.document.getElementById(`blueText${select}`); const edv = top.document.getElementById(`edit_name${select}`); ed.innerHTML = edv.value; ed_select = -1; } // 4.7 function open_cb(id, ed) { // if (ed == null) { if (top.document.getElementById(`blueText${ed_select}`) && id !== ed_select) { opern_cfg(ed_select, 2); open_cb_work(ed_select) } open_clear_cb(); if (top.document.getElementById(`cb${id}`)) { top.document.getElementById(`cdb${id}`).className = 'zbtn2c'; if (id === 1) { top.document.getElementById(`rdb${id}`).className = 'zbtn2r'; } if (id === cb_id - 1) { if (top.document.getElementById(`ldb${id}`)) { top.document.getElementById(`ldb${id}`).className = 'zbtn2l'; } if (top.document.getElementById(`ldb${(id - 1)}`)) { top.document.getElementById(`ldb${(id - 1)}`).className = 'zbtn2r2'; } } if (id >= 1 && id < cb_id - 1) { if (top.document.getElementById(`ldb${id}`)) { top.document.getElementById(`ldb${id}`).className = 'zbtn2r3'; } if (top.document.getElementById(`ldb${(id - 1)}`)) { top.document.getElementById(`ldb${(id - 1)}`).className = 'zbtn2r2'; } } top.document.getElementById(`canal${cb_date[id]}`).style.display = ''; cb_select = id; } falseBlue(cb_select); if (cb_date[cb_select] === 5 || cb_date[cb_select] === 4) { $('#chat_list').scrollTop($('#chat_list')[0].scrollHeight); } else { $('#chat_list').scrollTop(0); } } else if (ed_select === -1) { opern_cfg(ed_select, 2); if (top.document.getElementById(`blueText${id}`)) { let ed = top.document.getElementById(`blueText${id}`); ed.innerHTML = `
`; ed_select = id; } } else { opern_cfg(ed_select, 2); if (top.document.getElementById(`blueText${ed_select}`)) { open_cb_work(ed_select) } } } function rmve(id) { $(id).remove(); } // 4.8 function buyShopNow(id, url, itm = 'неизвестный предмет', money = 0, prc = '') { const i = top.frames['main'].document.getElementById(`shpcolvo${id}`); if (i) { url += `&x=${i.value}`; if (i.value > 1) { itm += ` (x${i.value})`; // тут money *= i.value; // тут } } if (confirm(`Вы хотите купить "${itm}" за ${(money)} ${prc}`)) { top.frames['main'].location = url; } } // 4.9 function payPlus(id) { const i = top.frames['main'].document.getElementById(`shopPlus${id}`); if (i) { const i2 = top.frames['main'].document.getElementById(`shopPlus${lshp}`); if (i2 && i2.innerHTML !== '') i2.innerHTML = ''; i.innerHTML = `Кол-во:
`; lshp = id; } } function getUrl(f, s) { top.frames['main'].location = s; } // 4.10 var game = { sort1: function (i, ii) { // По возрастанию if (i > ii) return 1; else return -1; }, sort2: function (i, ii) { // По убыванию if (i > ii) return -1; else return 1; }, testCity: function (v) { return v === 'abandonedplain' ? 'dungeon' : v; } } // 4.12 function grava(id, name, money, date) { win.add(`idgrav${id}`, `Выгравировать надпись за ${money} кр.`, `
Текст:
`, {'a1': `gravas(${id});`}, 2, 1, 'width:300px;'); } // 4.13 function un_grava(id, name, money, date) { win.add(`idgrav${id}`, `Изменить надпись за ${money} кр.`, `
Текст:
`, {'a1': `un_gravas(${id});`}, 2, 1, 'width:300px;'); } // 4.14 function gravas(id) { if (id <= 0) { return; } getUrl('main', `main.php?r=2&grav_text=${$(`#txtgrav${id}`).val()}&grav=${id}&sd4=${sd4key}`); } // 4.15 function un_gravas(id) { if (id <= 0) { return; } getUrl('main', `main.php?r=2&grav_text=${$(`#txtgrav${id}`).val()}&un_grav=${id}&sd4=${sd4key}`); } /*Розыгрыш предмета*/ // 4.17 function fartgame(id, img, name, x) { if (id <= 0) { return; } win.add( `idfart${id}`, 'Розыгрыш предмета', `
Принять участие в розыгрыше предмета "${name}" ?
`, { 'a1': `fartok(${id});`, 'a2': `fartcancel(${id});`, 'n': '' }, 2, 1, 'width:300px;'); } // 4.18 function fartok(id) { getUrl('main', `main.php?itm_luck=${id}`); } // 4.19 function fartcancel(id) { getUrl('main', `main.php?itm_unluck=${id}`); } /* Разделить предметы? */ function unstack(id, img, name, x, date, r, fdfdf) { if (id <= 0) { return; } win.add(`iunstack${id}`, 'Разделить предмет?', date, { 'a1': `unstackAction(${id},${r});`, 'n': ` ` }, 2, 1, 'width:300px;'); } // 4.20 function unstackAction(id, r) { let inv1 = ''; if ($(`#chiunstack${id}`).val() > 0) { inv1 += `unstackCount=${$(`#chiunstack${id}`).val()}&`; } if (r !== 0) inv1 += `inv&otdel=${r}&`; getUrl('main', `main.php?${inv1}unstack=${id}&sd4=${sd4key}`); } /* Выкинуть предмет */ // 4.21 function drop(id, img, name, x, date, r, fdfdf) { if (id <= 0) { return; } win.add(`idrop${id}`, 'Выбросить предмет?', date, { 'a1': `del(${id},${r});`, 'n': ` ` }, 2, 1, 'width:300px;'); } // 4.22 function del(id, r) { let inv1 = ''; if ($(`#chidrop${id}`).attr('checked')) { inv1 += 'deleteall7=1&'; } if (r !== 0) inv1 += `inv&otdel=${r}&`; getUrl('main', `main.php?${inv1}delete=${id}&sd4=${sd4key}`); } /* Использование предмета */ // 4.23 function useiteminv(id, img, name, x, date, r, inv) { if (id <= 0) { return; } if (inv === 0) { r = 0; } win.add(`iuse${id}`, 'Подтверждение', date, {'a1': `useitminv(${id},${r});`}, 2, 1, 'width:300px;'); } // 4.24 function useitminv(id, r) { let inv1 = ''; if (r !== 0) inv1 = `inv&otdel=${r}&`; getUrl('main', `main.php?${inv1}use_pid=${id}&sd4=${sd4key}`); } /* Использовать предмет в поединке */ // 4.25 function useMagicBattle(name, id, img, type, type_use, text, team) { let onEnLogin; if (type_use === 1) { onEnLogin = team === 1 ? c.login : ''; win.add( `iusemg${id}`, `Используем "${name}"  `, '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': `useMagicGoGoBattle('${id}');`, 'usewin': `chat.inObj = $('#useMagicLoginBtl${id}');$('#useMagicLoginBtl${id}').focus()`, 'd': `
` }, 3, 1, 'min-width:300px;' ); chat.inObj = $(`#useMagicLoginBtl${id}`); } else if (type_use === 2) { let txxt = `
"${name}"
Использовать сейчас?
`; win.add( `iusemg${id}`, `Используем "${name}"  `, txxt, { 'a1': `useMagicGoGoBattle('${id}'` }, 2, 1, 'width:300px;' ); } } // 4.26 function useMagicGoGoBattle(id) { top.frames['main'].useitem(id, 1, $(`#useMagicLoginBtl${id}`).val()); } /* Использовать предмет на */ // 4.27 function useMagic(name, id, img, type, urlUse) { win.add(`iusemg${id}`, `Используем "${name}"  `, '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': `useMagicGoGo(\'${urlUse}\',\'${id}\');`, 'usewin': `chat.inObj = $(\'#useMagicLogin${id}\');$(\'#useMagicLogin${id}\').focus()`, 'd': `
` }, 3, 1, 'min-width:300px;'); chat.inObj = $(`#useMagicLogin${id}`); } // 4.28 function useMagicGoGo(url, id) { getUrl('main', `${url}&login=${$(`#useMagicLogin${id}`).val()}&sd4=${sd4key}`); } /* Использовать предмет на предмет */ // 4.29 function useRune(id, name, img, urlUse) { win.add(`iuseRN${id}`, `Используем "${name}"  `, '
Укажите название предмета:
(предмет должен находится в инвентаре)
', { 'a1': `useRuneGoGo(\'${urlUse}\',\'${id}\');`, 'usewin': `$(\'#useRubeItem${id}\').focus()`, 'd': `
` }, 3, 1, 'min-width:300px;'); } // 4.30 function useRuneGoGo(url, id) { getUrl('main', `${url}&item_rune=${$(`#useRubeItem${id}`).val()}&sd4=${sd4key}`); } /* Используем смену */ function smena1() { win.add('smena1_enemy', 'Смена противника  ', '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': 'smena2($(\'#useSmena1_enemy\').val())', 'usewin': 'chat.inObj = $(\'#useSmena1_enemy\');$(\'#useSmena1_enemy\').focus()', 'd': '
' }, 3, 1, 'min-width:300px;'); chat.inObj = $('#useSmena1_enemy'); } function smena2(login) { top.frames['main'].smena_login = login; top.frames['main'].reflesh(); } /* Использовать прием на */ // 4.31 function priemOnUser(pr, id, nm, onInUser, img) { let styleWin = 1; if (img.substring(4, 7) === 'air') { styleWin = 3; } else if (img.substring(4, 9) === 'water') { styleWin = 4; } else if (img.substring(4, 9) === 'earth') { styleWin = 5; } else if (img.substring(4, 8) === 'fire') { styleWin = 2; } win.add(`iusepr${pr}`, `Используем "${nm}"  `, '
Укажите логин персонажа:
(можно щелкнуть по логину в чате)
', { 'a1': `usePriemNow(\'${pr}\');`, 'usewin': `chat.inObj = $(\'#usePriemLogin${pr}\');$(\'#usePriemLogin${pr}\').focus()`, 'd': `
` }, 3, styleWin, 'min-width:300px;'); chat.inObj = $(`#usePriemLogin${pr}`); $(`#usePriemLogin${pr}`).focus(); } // 4.32 function usePriemNow(id) { top.frames['main'].use_on_pers = $(`#usePriemLogin${id}`).val(); top.frames['main'].usepriem(id, 1, ''); } var datas = ''; function qn_win_cls() { $('#qsst').html(''); $('#qsst').css('display', 'none'); } /* Поединки */ function goSit(dd) { let bcl = []; bcl[1] = 0; bcl[2] = 1; bcl[3] = 0; bcl[4] = 0; if (top.frames['main']) { if (top.frames['main'].document.getElementById('auto_battle')) { top.frames['main'].document.getElementById('auto_battle').value = bcl[3]; } if (top.frames['main'].document.getElementById('save_zones')) { top.frames['main'].document.getElementById('save_zones').value = bcl[4]; } if (top.frames['main'].document.getElementById('fast_battle')) { top.frames['main'].document.getElementById('fast_battle').value = bcl[1]; } } } function btlclearlog() { $(top.document.getElementById('battle_logg')).html(''); $(top.document.getElementById('battle_mlogg')).html(''); //Тут новый лог } function r_page(a) { top.frames['main'].location.reload(); } const key_actions = ['', '', 1]; $(document).ready(function () { $('#globalMain').click(function () { win.addaction(2, 0); }); $(document).keypress(function (e) { if (key_actions[2] === 1) { if (e.keyCode === 13 && key_actions[0] !== '') { //нажата клавиша enter eval(key_actions[0]); } } }); }); // 4.32 function qn_slk() { if (!qst_sml) { return; } $('#qsst').fadeIn('fast'); $('#mini_qsst').fadeOut('fast'); $('#mini_qsst').html(''); qst_sml = ''; } function opern_cfg(id, v) { if (top.document.getElementById("confcb" + id)) { const cm = top.document.getElementById("confcb" + id); let display = window.getComputedStyle(cm).getPropertyValue('display') if (!display || v === 2) { $('#confcb' + id).html(''); window.getComputedStyle(cm).setProperty('display', 'none') } else { $('#confcb' + id) .html('
Движение:none
' + '
Общий чат:none
' + '
Приват:none
' + '
System (1):none
' + '
System (2):none
' + '
Клан чат:none
' + '
System (3):none
' + '
Мужгород:none
' + '
Лог боя (1):none
' + '
Лог боя (2):none
' + '
Очистка (1):none
' + '
Очистка (2):none
' + '

[+] [+] [+]
'); cm.style.display = ''; } } }