game/js/gameEngine.js

1122 lines
44 KiB
JavaScript
Raw Normal View History

2023-08-28 11:23:41 +00:00
const sml = ["p001", 18, 18, "p002", 15, 15, "p003", 22, 15, "p004", 15, 15, "p005", 20, 20, "p006", 31, 28, "p007", 15, 15,
2022-06-06 21:30:34 +00:00
"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,
2023-08-28 11:23:41 +00:00
"p121", 32, 26, "p122", 40, 25, "p123", 37, 22, "p124", 40, 36, "p125", 38, 33, "p126", 23, 23, "p127", 33, 24, "p128", 30, 20];
2022-06-06 21:30:34 +00:00
let cb_id = 1,
cb_date = {},
cb_rdate = {},
cb_ndate = {},
cb_select = 1,
ed_select = -1,
cb_conf = {1: '100000001110', 2: '200010100001', 3: '211101010001'};
2022-06-06 21:30:34 +00:00
let petsel = '';
2022-06-06 21:30:34 +00:00
function winframe(id, title, w, h, url) {
win.add(`${id}winframe`, `${title} &nbsp;`, '', {'d': `<iframe width="${w}" height="${h}" frameborder="0" src="${url}"></iframe>`}, 0, 1, '');
2022-06-06 21:30:34 +00:00
}
function petbuy() {
const r = `<img onclick="petbuySet(1);" id="apet1" title="Кот. Добавляет владельцу ловкость" style="cursor:pointer;padding:3px;" src="//img.new-combats.tech/i/items/summon_pet_cat.gif">
<img onclick="petbuySet(2);" id="apet2" title="Сова. Добавляет владельцу интуицию" style="cursor:pointer;padding:3px;" src="//img.new-combats.tech/i/items/summon_pet_owl.gif">
<img onclick="petbuySet(3);" id="apet3" title="Светляк. Добавляет владельцу мощность магии" style="cursor:pointer;padding:3px;" src="//img.new-combats.tech/i/items/summon_pet_wisp.gif">
<img onclick="petbuySet(4);" id="apet4" title="Чертяка. Добавляет владельцу силу" style="cursor:pointer;padding:3px;" src="//img.new-combats.tech/i/items/summon_pet_demon.gif">
<img onclick="petbuySet(6);" id="apet6" title="Свин. Добавляет владельцу защиту" style="cursor:pointer;padding:3px;" src="//img.new-combats.tech/i/items/summon_pet_pig.gif">
<img onclick="petbuySet(5);" id="apet5" title="Пёс. Добавляет владельцу НР" style="cursor:pointer;padding:3px;" src="//img.new-combats.tech/i/items/summon_pet_dog.gif">
`;
petsel = 0;
win.add('buypet',
'Призвать зверя <i>(цена: 50 кр.))</i> &nbsp;',
`<div style="text-align: center;">Введите кличку и выберите зверя<br>
<input style="font-size:12px;margin:5px;width:234px;padding:2px;" type="text" id="petbuylogin"><br><div style="padding:5px;">${r}</div></div>`,
{
'a1': `petbuyAct($(\'#petbuylogin\').val(),\'\')`,
'usewin': '$(\'#petbuylogin\').focus()',
'd': ''
},
2,
1,
'min-width:290px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
function petbuyAct(data) {
getUrl('main', 'main.php?newanimal&pet=' + petsel + '&petname=' + data);
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
function petbuySet(id) {
let i = 1;
2022-06-06 21:30:34 +00:00
while (i <= 7) {
petbutSetCss(i++, "3px", "0")
}
petbutSetCss(id, "0", "3px solid #7788ff")
petsel = id;
}
function petbutSetCss(count, padding, border) {
2022-06-06 21:30:34 +00:00
$(`#apet${count}`).css({
'padding': padding,
'border': border
});
}
2022-06-06 21:30:34 +00:00
// 1
function eda(id, name, price, vvv) {
2023-01-10 16:29:32 +00:00
win.add('animaleda1', `Покормить &quot;${name}&quot; &nbsp;`, `<center>Введите количество еды:<br><i>(цена 1 ед. = ${price} кр.)</i></center>`, {
'a1': `edaGo(${(0 + id)},$(\'#edaanimal1vvv\').val())`,
2022-06-06 21:30:34 +00:00
'usewin': '',
'd': `<center><input style="width:96%; margin:5px;" id="edaanimal1vvv" class="inpt2" type="text" value="${vvv}"></center>`
}, 3, 1, 'min-width:300px;');
}
// 2
2022-06-06 21:30:34 +00:00
function edaGo(id, val) {
getUrl('main', `main.php?newanimal&eda=${id}&vvv=${val}`);
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 3
function anrename(id, name) {
win.add('animaleda2', `Изменить кличку &quot;${name}&quot; &nbsp;`, '<center>Введите новую кличку:<br><i>(цена 30 кр.)</i></center>', {
'a1': `anrenameGo(${(0 + id)},$(\'#edaanimal2vvv\').val())`,
'usewin': '',
'd': '<center><input style="width:96%; margin:5px;" id="edaanimal2vvv" class="inpt2" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4
function anrenameGo(id, val) {
getUrl('main', `main.php?newanimal&rename=${id}&vvv=${val}`);
2022-06-06 21:30:34 +00:00
}
// 6
function captchatext1(val, act) {
getUrl('main', `${act}&cptch1=${val}`);
2022-06-06 21:30:34 +00:00
}
// 7
function leaderFight() {
win.add('leaderFightNew1', 'Передать флаг &nbsp;', '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
'a1': 'leaderFx($(\'#leaderFightgroup1\').val())',
'usewin': 'chat.inObj = $(\'#leaderFightgroup1\');$(\'#leaderFightgroup1\').focus()',
'd': '<center><input style="width:96%; margin:5px;" id="leaderFightgroup1" class="inpt2" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
chat.inObj = $('#leaderFightgroup1');
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
// оптимизация с вызовом
2022-06-06 21:30:34 +00:00
function leaderFx(login) {
top.frames['main'].leader_login = login;
top.frames['main'].leader_type = 1;
top.frames['main'].reflesh();
}
function leaderFight2() {
win.add('leaderFightNew2', 'Убить &nbsp;', '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
'a1': 'leaderFx2($(\'#leaderFightgroup2\').val())',
'usewin': 'chat.inObj = $(\'#leaderFightgroup2\');$(\'#leaderFightgroup2\').focus()',
'd': '<center><input style="width:96%; margin:5px;" id="leaderFightgroup2" class="inpt2" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
chat.inObj = $('#leaderFightgroup2');
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
// оптимизация с вызовом
2022-06-06 21:30:34 +00:00
function leaderFx2(login) {
top.frames['main'].leader_login = login;
top.frames['main'].leader_type = 2;
top.frames['main'].reflesh();
}
2023-01-10 16:29:32 +00:00
// оптимизация в цикле 8
2022-06-06 21:30:34 +00:00
function intransferNew(id, login) {
win.add(
`intransfer${id}New`,
2023-01-10 16:29:32 +00:00
'Приглашение на обмен &nbsp;',
`<center style="padding-top:10px;">Персонаж <b>${login}</b> предлагает вам совершить обмен. Вы согласны?<br><br></center>`, {
'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\';'
2022-06-06 21:30:34 +00:00
}, 2, 1, 'min-width:300px;'
);
}
2023-01-10 16:29:32 +00:00
// оптимизация в цикле 9
2022-06-06 21:30:34 +00:00
function inclanNew(id, align, clan_img, name, login) {
win.add(
`inclan${id}New`,
2023-01-10 16:29:32 +00:00
`Приглашение вступить в клан &quot;${name}&quot; &nbsp;`,
`<center><br><img src="//img.new-combats.tech/i/align/align${align}.gif"><img src="//img.new-combats.tech/i/clan/${clan_img}.gif"><b>${login}</b> предлагает вам вступить в клан <span style="display:inline-block"><img src="//img.new-combats.tech/i/align/align${align}.gif">&nbsp;<b>${name}</b></span>. Вы согласны?<br><br></center>`, {
'a1': `inclanNewsave(${id},1);`,
'a2': `inclanNewsave(${id},2);`,
'a3': `inclanNewsave(${id},2);`
2022-06-06 21:30:34 +00:00
}, 2, 1, 'min-width:300px;'
);
}
2022-06-06 21:30:34 +00:00
// 10
function inclanNewsave(id, val) {
getUrl('main', `/main.php?newclan=${id}&newclan_val=${val}`);
2022-06-06 21:30:34 +00:00
}
//
function savePriems() {
win.add('saveComplPriem', 'Запомнить набор приемов &nbsp;', '<center>Запомнить набор приемов, для быстрого переключения.Введите название набора:<br></center>', {
'a1': 'addSavedPriems($(\'#addSavedPriems\').val());',
'usewin': '$(\'#addSavedPriems\').focus()',
'd': '<center><input style="width:96%; margin:5px;" id="addSavedPriems" class="inpt2" maxlength="30" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
2022-06-06 21:30:34 +00:00
}
// 12
function addSavedPriems(val) {
getUrl('main', `main.php?skills=1&rz=4&savePriems=${val}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
function atackTower() {
win.add('towerAttakWin', 'Напасть на персонажа &nbsp;', '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
'a1': 'atackTowergo($(\'#towerAttakTxt\').val());',
'usewin': 'chat.inObj = $(\'#towerAttakTxt\');$(\'#towerAttakTxt\').focus()',
'd': '<center><input style="width:96%; margin:5px;" id="towerAttakTxt" class="inpt2" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
chat.inObj = $('#towerAttakTxt');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 13
function atackTowergo(val) {
getUrl('main', `main.php?attack=${val}`);
2022-06-06 21:30:34 +00:00
}
function anren() {
win.add('neAnimName', 'Выберите кличку &nbsp;', '<center>Введите одно слово:<br><small>(Не более десяти символов)</small><br></center>', {
'a1': 'anrenSave($(\'#addSavedAnmName\').val());',
'usewin': '$(\'#addSavedAnmName\').focus()',
'd': '<center><input style="width:96%; margin:5px;" id="addSavedAnmName" class="inpt2" maxlength="10" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 14
function anrenSave(name) {
getUrl('main', `main.php?pet=1&anml_login=${name}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 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;
}
2022-06-06 21:30:34 +00:00
cb_date[cb_id] = id;
cb_rdate[id] = cb_id;
2022-06-06 21:30:34 +00:00
console.log(cb_ndate, name, cb_ndate['Системные сообщения'], cb_ndate['Чат']);
2022-06-06 21:30:34 +00:00
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++;
2022-06-06 21:30:34 +00:00
}
}
cb_ndate[name] = cb_id;
let unright = '',
unleft = '';
2022-06-06 21:30:34 +00:00
function unLeft(count) {
return unleft = `<tr><td style="width: 9px;"><div id="ldb${count}" class="zbtn1l"></div></td>`;
}
2022-06-06 21:30:34 +00:00
if (cb_id === 1) {
unright = `<td style="width: 9px;"><div id="rdb${cb_id}" class="zbtn1r"></div></td>`;
unLeft(cb_id);
} else {
unLeft(cb_id);
document.getElementById(`ldb${cb_id - 1}`).className = 'zbtn1r2';
}
2022-06-06 21:30:34 +00:00
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`;
2022-06-06 21:30:34 +00:00
cb.innerHTML = `<div id="cb${cb_id}" style="float:left; postition:static; cursor:default;" unselectable="on" onselectstart="return false;" oncontextmenu="return false;" onclick="open_cb(${cb_id},null);">
<div id="confcb${cb_id}" class="configcb" style="display:none;"></div>
<table border="0" id="usbtn${cb_id}" onMouseDown="open_cb(${cb_id});" cellspacing="0" cellpadding="0">
${unleft}<td class="zbtn1c" id="cdb${cb_id}">
<div style="font-size:11px;${cd_wdw};text-align:center;" id="blueText${cb_id}" class="${cd_stl[id]}">${name}</div>
</td>${unright}</tr></table></div>${$("#chat_menu").html()}`;
if (!$(`#canal${id}`).html()) {
ch.innerHTML = `<div id="canal${id}" style="display:none;">${indata}</div>`;
2022-06-06 21:30:34 +00:00
}
cb_id++;
open_cb(cb_select, null);
2022-06-06 21:30:34 +00:00
}
function create_radio(id, act, clss) {
return `<div class="crop"><img onclick="${act}; return false;" id="cr_rach_${id}" src="//img.new-combats.tech/i/misc/radio.gif" radio_check="1" class="radio_gl${clss}"></div>`;
2022-06-06 21:30:34 +00:00
}
// 1
function create_check(id, act, clss) {
return `<div class="crop2"><img onclick="${act}; return false;" id="cr_rach_${id}" src="//img.new-combats.tech/i/misc/check.gif" radio_check="2" class="check_gl${clss}"></div>`;
2022-06-06 21:30:34 +00:00
}
var slcbrc = [0, 0, 1, 0, 0];
2022-06-06 21:30:34 +00:00
// 2
function cb_radio_click_b(el, id) {
if ($(el).attr('radio_check') == 1) {
if ($(el).attr('class') === 'radio_gloff') {
2022-06-06 21:30:34 +00:00
return cr_workWithClass(el, 'radio_gloff', 'radio_glon', id, 1)
}
2022-06-06 21:30:34 +00:00
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)
}
2022-06-06 21:30:34 +00:00
return cr_workWithClass(el, 'check_glon', 'check_gloff', id, 0)
}
}
function cr_workWithClass(element, classRemove, classAdd, id, count) {
2022-06-06 21:30:34 +00:00
$(element).removeClass(classRemove);
$(element).addClass(classAdd);
slcbrc[id] = count;
2022-06-06 21:30:34 +00:00
}
// 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);
2022-06-06 21:30:34 +00:00
}
if (slcbrc[3] === 1) {
cb_radio_click_b($('#cr_rach_rc3'), 3);
2022-06-06 21:30:34 +00:00
}
} 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);
2022-06-06 21:30:34 +00:00
}
} 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);
2022-06-06 21:30:34 +00:00
}
if (slcbrc[2] === 0) {
cb_radio_click_b($('#cr_rach_rc2'), 2);
2022-06-06 21:30:34 +00:00
}
if (slcbrc[4] === 1) {
cb_radio_click_b($('#cr_rach_rc4'), 4);
2022-06-06 21:30:34 +00:00
}
}
} else if (id === 4) {
if (slcbrc[4] === 0) {
if (slcbrc[3] === 1) {
cb_radio_click_b($('#cr_rach_rc3'), 3);
2022-06-06 21:30:34 +00:00
}
}
}
cb_radio_click_b(el, id);
2022-06-06 21:30:34 +00:00
}
var fasthtmlarr = [0, [], []];
2022-06-06 21:30:34 +00:00
var fastpanelopen = 0;
// 4)
function addfastpanel(id, name, type, price, price2, madein, img, itemid, iznosnow, iznosmax, otdel, mbodet, mbused, norefl) {
if (fasthtmlarr[0] >= 10) {
2023-01-10 16:29:32 +00:00
return alert('Все слоты под быстрый доступ заполнены!');
2022-06-06 21:30:34 +00:00
} else {
if (fasthtmlarr[2][id] === undefined) {
2022-06-06 21:30:34 +00:00
fasthtmlarr[0]++;
var i = 0;
var iid = 0;
while (i <= 10) {
if (fasthtmlarr[1][i] === undefined && iid === 0) {
2022-06-06 21:30:34 +00:00
iid = i;
}
i++;
}
fasthtmlarr[1][iid] = [id, name, type, price, price2, madein, img, itemid, iznosnow, iznosmax, otdel, mbodet, mbused];
2022-06-06 21:30:34 +00:00
fasthtmlarr[2][id] = true;
if (fastpanelopen === 1) {
2023-01-10 16:29:32 +00:00
//Обновляем окно
2022-06-06 21:30:34 +00:00
fastpanelopen = 0;
win.closew('fastpanel');
}
if (norefl == 0) return fastpanelsave();
}
2023-01-10 16:29:32 +00:00
return alert('Данный предмет уже выставлен в слот!');
2022-06-06 21:30:34 +00:00
}
}
// 5
function intvalor(mixed_var, base) {
let tmp;
2022-06-06 21:30:34 +00:00
if (typeof (mixed_var) == 'string') {
tmp = parseInt(mixed_var);
2022-06-06 21:30:34 +00:00
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 = `<b>${fasthtmlarr[1][i][1]}</b><br>`;
if (fasthtmlarr[1][i][3] > 0) {
titlemini += `<br>Цена: ${fasthtmlarr[1][i][3]} кр.`;
}
if (fasthtmlarr[1][i][4] > 0) {
titlemini += `<br>Цена: ${fasthtmlarr[1][i][4]} екр.`;
}
if (fasthtmlarr[1][i][9] > 0) {
titlemini += `<br>Долговечность: ${intvalor(fasthtmlarr[1][i][8])}/${intvalor(fasthtmlarr[1][i][9])}`;
}
if (fasthtmlarr[1][i][5] !== '') {
titlemini += `<br>Сделано в ${fasthtmlarr[1][i][5]}`;
}
slot = `<img style="max-width:41px;height:26px;" src="${c.img2}/i/items/${fasthtmlarr[1][i][6]}">`;
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 = `<img title="Пустой слот" src="${c.img2}/slot.gif">`;
clss = 'filter: alpha(opacity=30);opacity:0.30;-moz-opacity:0.30;-khtml-opacity:0.30;';
}
fasthtml += `<div align="center" style="width:41px;height:26px;margin-top:1px;margin-right:1px;display:inline-block;border-right:solid 1px #333;border-bottom:solid 1px #333;border-left:solid 1px #EEE;border-top:solid 1px #EEE;${clss}">${slot}</div>`;
i++;
}
win.add('fastpanel', 'Панель быстрого доступа &nbsp;', `<center><div style="padding:5px;">${fasthtml}</div></center></center>`, {
'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);
2022-06-06 21:30:34 +00:00
}
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();
2022-06-06 21:30:34 +00:00
}
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});
//
2022-06-06 21:30:34 +00:00
}
// 4.1
function cb_getBtl() {
return `<br>
2022-06-06 21:30:34 +00:00
<table style="padding-left:5px;" width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" onclick="cb_radio_click($('#cr_rach_rc1'),1)">${create_radio('rc1', '', 'off')}</td>
<td onclick="cb_radio_click($('#cr_rach_rc1'),1)">Упрощенный бой</td>
2022-06-06 21:30:34 +00:00
</tr>
<tr>
<td align="left" width="20" height="20" onclick="cb_radio_click($('#cr_rach_rc2'),2)">${create_radio('rc2', '', 'on')}</td>
<td onclick="cb_radio_click($(\'#cr_rach_rc2\'),2)">Стандартный бой</td>
2022-06-06 21:30:34 +00:00
</tr>
<tr>
<td>&nbsp;</td>
<td height="20" onclick="cb_radio_click($('#cr_rach_rc3'),3)">${create_check('rc3', '', 'off')}&nbsp; Удар при выставлении хода</td>
2022-06-06 21:30:34 +00:00
</tr>
<tr>
<td align="left" onclick="cb_radio_click($('#cr_rach_rc4'),4)">${create_check('rc4', '', 'off')}</td>
<td onclick="cb_radio_click($('#cr_rach_rc4'),4)" height="20">Не сбрасывать выбор</td>
2022-06-06 21:30:34 +00:00
</tr>
</table>`;
}
// 4.2
let cb_status_now = 0;
/**
* @param {number} id
*/
2022-06-06 21:30:34 +00:00
function cb_status(id) {
//top.open_cb(cb_rdate[5],null);
if (window.des !== 1) {
return;
}
2022-06-06 21:30:34 +00:00
if ((top.frames['main'].locitems !== 0 || (top.frames['main'].locitems === undefined && $('#canal1').html())) && id < 2) id += 2;
2022-06-06 21:30:34 +00:00
if (id === cb_status_now) {
return;
}
2022-06-06 21:30:34 +00:00
var chat_btlConfig = cb_getBtl();
2022-06-06 21:30:34 +00:00
function out_of_battleTop(count, canalTrue) {
if (canalTrue) $("#canal3").html('');
add_cb(4, 'Системные сообщения', 'ch4', '<br>'); // все (4)
add_cb(5, 'Чат', 'ch5', '<br>'); // все (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', '<br><div id="battle_logg"></div>');
add_cb(7, 'Мой Лог', 'ch7', '<br><div id="battle_mlogg"></div>');
return out_of_battleTop(3, false)
} else if (id === 3) {
//чат + предмет
return out_of_battleTop(5, true)
} else if (id === 4) {
// боевая система + предмет
add_cb(3, 'Лог', 'ch3', '<br><div id="battle_logg"></div>');
return out_of_battleTop(3, false)
2022-06-06 21:30:34 +00:00
}
}
2022-06-06 21:30:34 +00:00
// 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);
2022-06-06 21:30:34 +00:00
return cb_status(1);
}
return cb_status(1);
2022-06-06 21:30:34 +00:00
}
}
var cb_timer = setInterval('cb_statusTest()', 25);
2022-06-06 21:30:34 +00:00
// 4.4
function falseBlue(id) {
$(`#blueText${id}`).css({'color': ''});
}
2022-06-06 21:30:34 +00:00
// 4.5
/**
* @param {number} id
*/
2022-06-06 21:30:34 +00:00
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});
2022-06-06 21:30:34 +00:00
}
}
//[0][1][2][3][4][5][6][7][8][9]
/*
2023-01-10 16:29:32 +00:00
0 - движение, 1 - вверх, 2 - вниз, 3 - без действия
1 - общий чат
2 - приватный чат
3 - система (личная)
4 - система (общая)
5 - клан
6 - клан (система)
7 - межгород
8 - лог боя
9 - лог боя (личный)
10 - автоочистка чата (после боя)
11 - автоочистка чата (хранить только видимые сообщения)
2022-06-06 21:30:34 +00:00
*/
// 4.6
function open_clear_work(symbId, count, className) {
if (top.document.getElementById(`${symbId}db${count}`) != null) {
top.document.getElementById(`${symbId}db${count}`).className = className;
}
if (top.document.getElementById(`canal${cb_date[count]}`) != null) {
top.document.getElementById(`canal${cb_date[count]}`).style.display = 'none';
}
2022-06-06 21:30:34 +00:00
}
function open_clear_cb() {
let i = 1;
while (i !== -1) {
if (top.document.getElementById(`cb${i}`)) {
2022-06-06 21:30:34 +00:00
open_clear_work("c", i, "zbtn1c")
if (i === 1) {
2022-06-06 21:30:34 +00:00
open_clear_work("r", i, "zbtn1r")
}
if (i === cb_id - 1) {
2022-06-06 21:30:34 +00:00
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}`);
2022-06-06 21:30:34 +00:00
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) {
2022-06-06 21:30:34 +00:00
opern_cfg(ed_select, 2);
open_cb_work(ed_select)
}
open_clear_cb();
if (top.document.getElementById(`cb${id}`)) {
2022-06-06 21:30:34 +00:00
top.document.getElementById(`cdb${id}`).className = 'zbtn2c';
if (id === 1) {
2022-06-06 21:30:34 +00:00
top.document.getElementById(`rdb${id}`).className = 'zbtn2r';
}
if (id === cb_id - 1) {
if (top.document.getElementById(`ldb${id}`)) {
2022-06-06 21:30:34 +00:00
top.document.getElementById(`ldb${id}`).className = 'zbtn2l';
}
if (top.document.getElementById(`ldb${(id - 1)}`)) {
2022-06-06 21:30:34 +00:00
top.document.getElementById(`ldb${(id - 1)}`).className = 'zbtn2r2';
}
}
if (id >= 1 && id < cb_id - 1) {
if (top.document.getElementById(`ldb${id}`)) {
2022-06-06 21:30:34 +00:00
top.document.getElementById(`ldb${id}`).className = 'zbtn2r3';
}
if (top.document.getElementById(`ldb${(id - 1)}`)) {
2022-06-06 21:30:34 +00:00
top.document.getElementById(`ldb${(id - 1)}`).className = 'zbtn2r2';
}
}
if (top.document.getElementById(`canal${cb_date[id]}`) != null) {
top.document.getElementById(`canal${cb_date[id]}`).style.display = '';
}
2022-06-06 21:30:34 +00:00
cb_select = id;
}
falseBlue(cb_select);
if (cb_date[cb_select] === 5 || cb_date[cb_select] === 4) {
2022-06-06 21:30:34 +00:00
$('#chat_list').scrollTop($('#chat_list')[0].scrollHeight);
} else {
$('#chat_list').scrollTop(0);
}
} else if (ed_select === -1) {
2022-06-06 21:30:34 +00:00
opern_cfg(ed_select, 2);
if (top.document.getElementById(`blueText${id}`)) {
let ed = top.document.getElementById(`blueText${id}`);
ed.innerHTML = `<table border="0" width="120" cellspacing="0" cellpadding="0"><tr><td><input style="height:9px; width:100px; line-height:9px;" value="${ed.innerHTML}" name="edit_name${id}" id="edit_name${id}" /></td><td><a style="height:10px; line-height:10px;" title="Настройки вкладки" href="javascript:void(0);" onClick="opern_cfg(${id},1);return false;"><img width="10" height="10" src="setmen.jpg" style="display:block;" /></a></td></tr></table>`;
2022-06-06 21:30:34 +00:00
ed_select = id;
}
} else {
opern_cfg(ed_select, 2);
if (top.document.getElementById(`blueText${ed_select}`)) {
2022-06-06 21:30:34 +00:00
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) {
2022-06-06 21:30:34 +00:00
url += `&x=${i.value}`;
if (i.value > 1) {
2023-01-10 16:29:32 +00:00
itm += ` (x${i.value})`; // тут
money *= i.value; // тут
2022-06-06 21:30:34 +00:00
}
}
2023-01-10 16:29:32 +00:00
if (confirm(`Вы хотите купить "${itm}" за ${(money)} ${prc}`)) {
2022-06-06 21:30:34 +00:00
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 = '';
2023-01-10 16:29:32 +00:00
i.innerHTML = `Кол-во: <input id="shpcolvo${id}" value="1" size="4" maxlength="3" type="text" /><br>`;
lshp = id;
2022-06-06 21:30:34 +00:00
}
}
function getUrl(f, s) {
top.frames['main'].location = s;
}
// 4.10
var game = {
2023-01-10 16:29:32 +00:00
sort1: function (i, ii) { // По возрастанию
2022-06-06 21:30:34 +00:00
if (i > ii) return 1;
else return -1;
},
2023-01-10 16:29:32 +00:00
sort2: function (i, ii) { // По убыванию
2022-06-06 21:30:34 +00:00
if (i > ii) return -1;
else return 1;
},
testCity: function (v) {
return v === 'abandonedplain' ? 'dungeon' : v;
2022-06-06 21:30:34 +00:00
}
}
2022-06-06 21:30:34 +00:00
// 4.12
function grava(id, name, money, date) {
win.add(`idgrav${id}`, `Выгравировать надпись за ${money} кр.`, `<center style="padding:5px;">Текст: <input style="width:220px;" value="" type="text" id="txtgrav${id}" name="txtgrav${id}"></center>`, {'a1': `gravas(${id});`}, 2, 1, 'width:300px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.13
function un_grava(id, name, money, date) {
win.add(`idgrav${id}`, `Изменить надпись за ${money} кр.`, `<center style="padding:5px;">Текст: <input style="width:220px;" value="" type="text" id="txtgrav${id}" name="txtgrav${id}"></center>`, {'a1': `un_gravas(${id});`}, 2, 1, 'width:300px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.14
function gravas(id) {
if (id <= 0) {
return;
2022-06-06 21:30:34 +00:00
}
getUrl('main', `main.php?r=2&grav_text=${$(`#txtgrav${id}`).val()}&grav=${id}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.15
function un_gravas(id) {
if (id <= 0) {
return;
2022-06-06 21:30:34 +00:00
}
getUrl('main', `main.php?r=2&grav_text=${$(`#txtgrav${id}`).val()}&un_grav=${id}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/*Розыгрыш предмета*/
2022-06-06 21:30:34 +00:00
// 4.17
function fartgame(id, img, name, x) {
if (id <= 0) {
return;
2022-06-06 21:30:34 +00:00
}
win.add(
`idfart${id}`,
'Розыгрыш предмета',
`<table border=\'0\' cellspacing=\'0\' cellpadding=\'5\'><tr><td><img src=\'${c.img2}/i/items/${img}\'></td><td align=\'left\'>Принять участие в розыгрыше предмета &quot;<b>${name}</b>&quot; ?</td></tr></table>`,
{
'a1': `fartok(${id});`,
'a2': `fartcancel(${id});`,
'n': ''
}, 2, 1, 'width:300px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.18
function fartok(id) {
getUrl('main', `main.php?itm_luck=${id}`);
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.19
function fartcancel(id) {
getUrl('main', `main.php?itm_unluck=${id}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Разделить предметы? */
function unstack(id, img, name, x, date, r, fdfdf) {
if (id <= 0) {
return;
2022-06-06 21:30:34 +00:00
}
win.add(`iunstack${id}`, 'Разделить предмет?', date, {
'a1': `unstackAction(${id},${r});`, 'n': `<small>
<label style="font-size:10px;" for="chiunstack${id}">Количество: </label><input size="4"type="text" value="1" style="font-size:10px;background:#eee;" name="chiunstack${id}" id="chiunstack${id}"></small>`
}, 2, 1, 'width:300px;');
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.20
function unstackAction(id, r) {
let inv1 = '';
2022-06-06 21:30:34 +00:00
if ($(`#chiunstack${id}`).val() > 0) {
inv1 += `unstackCount=${$(`#chiunstack${id}`).val()}&`;
}
if (r !== 0) inv1 += `inv&otdel=${r}&`;
2022-06-06 21:30:34 +00:00
getUrl('main', `main.php?${inv1}unstack=${id}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Выкинуть предмет */
2022-06-06 21:30:34 +00:00
// 4.21
function drop(id, img, name, x, date, r, fdfdf) {
if (id <= 0) {
return;
2022-06-06 21:30:34 +00:00
}
win.add(`idrop${id}`, 'Выбросить предмет?', date, {
'a1': `del(${id},${r});`,
'n': `<small><input type="checkbox" name="chidrop${id}" id="chidrop${id}"> <label for="chidrop${id}">Все предметы данного вида</label></small>`
}, 2, 1, 'width:300px;');
2022-06-06 21:30:34 +00:00
}
// 4.22
function del(id, r) {
let inv1 = '';
if ($(`#chidrop${id}`).attr('checked')) {
2022-06-06 21:30:34 +00:00
inv1 += 'deleteall7=1&';
}
if (r !== 0) inv1 += `inv&otdel=${r}&`;
getUrl('main', `main.php?${inv1}delete=${id}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Использование предмета */
2022-06-06 21:30:34 +00:00
// 4.23
function useiteminv(id, img, name, x, date, r, inv) {
if (id <= 0) {
return;
2022-06-06 21:30:34 +00:00
}
if (inv === 0) {
r = 0;
}
win.add(`iuse${id}`, 'Подтверждение', date, {'a1': `useitminv(${id},${r});`}, 2, 1, 'width:300px;');
2022-06-06 21:30:34 +00:00
}
// 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}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Использовать предмет в поединке */
2022-06-06 21:30:34 +00:00
// 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}`,
`Используем &quot;${name}&quot; &nbsp;`,
'<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>',
{
'a1': `useMagicGoGoBattle('${id}');`,
'usewin': `chat.inObj = $('#useMagicLoginBtl${id}');$('#useMagicLoginBtl${id}').focus()`,
'd': `<center><input style="width:96%; margin:5px;" id="useMagicLoginBtl${id}" class="inpt2" type="text" value="${onEnLogin}"></center>`
},
3,
1,
'min-width:300px;'
);
chat.inObj = $(`#useMagicLoginBtl${id}`);
} else if (type_use === 2) {
let txxt = `<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='80' valign='middle'>
<div align='center'>
<img src='${c.img2}/i/eff/${img}'>
</div>
</td>
<td valign='middle' align='left'>
&quot;<b>${name}</b>&quot;<br>Использовать сейчас?
</td>
</tr>
</table>`;
win.add(
`iusemg${id}`,
`Используем &quot;${name}&quot; &nbsp;`,
txxt,
{
'a1': `useMagicGoGoBattle('${id}'`
},
2,
1,
'width:300px;'
);
2022-06-06 21:30:34 +00:00
}
}
// 4.26
function useMagicGoGoBattle(id) {
2022-06-06 21:30:34 +00:00
top.frames['main'].useitem(id, 1, $(`#useMagicLoginBtl${id}`).val());
}
2023-01-10 16:29:32 +00:00
/* Использовать предмет на */
2022-06-06 21:30:34 +00:00
// 4.27
function useMagic(name, id, img, type, urlUse) {
win.add(`iusemg${id}`, `Используем &quot;${name}&quot; &nbsp;`, '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
'a1': `useMagicGoGo(\'${urlUse}\',\'${id}\');`,
'usewin': `chat.inObj = $(\'#useMagicLogin${id}\');$(\'#useMagicLogin${id}\').focus()`,
'd': `<center><input style="width:96%; margin:5px;" id="useMagicLogin${id}" class="inpt2" type="text" value="${c.login}"></center>`
}, 3, 1, 'min-width:300px;');
chat.inObj = $(`#useMagicLogin${id}`);
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
// 4.28
function useMagicGoGo(url, id) {
getUrl('main', `${url}&login=${$(`#useMagicLogin${id}`).val()}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Использовать предмет на предмет */
2022-06-06 21:30:34 +00:00
// 4.29
function useRune(id, name, img, urlUse) {
win.add(`iuseRN${id}`, `Используем &quot;${name}&quot; &nbsp;`, '<center>Укажите название предмета:<br><small>(предмет должен находится в инвентаре)</small></center>', {
'a1': `useRuneGoGo(\'${urlUse}\',\'${id}\');`,
'usewin': `$(\'#useRubeItem${id}\').focus()`,
'd': `<center><input style="width:96%; margin:5px;" id="useRubeItem${id}" class="inpt2" type="text" value=""></center>`
}, 3, 1, 'min-width:300px;');
2022-06-06 21:30:34 +00:00
}
// 4.30
function useRuneGoGo(url, id) {
getUrl('main', `${url}&item_rune=${$(`#useRubeItem${id}`).val()}&sd4=${sd4key}`);
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Используем смену */
2022-06-06 21:30:34 +00:00
function smena1() {
win.add('smena1_enemy', 'Смена противника &nbsp;', '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
'a1': 'smena2($(\'#useSmena1_enemy\').val())',
'usewin': 'chat.inObj = $(\'#useSmena1_enemy\');$(\'#useSmena1_enemy\').focus()',
'd': '<center><input style="width:96%; margin:5px;" id="useSmena1_enemy" class="inpt2" type="text" value=""></center>'
}, 3, 1, 'min-width:300px;');
chat.inObj = $('#useSmena1_enemy');
2022-06-06 21:30:34 +00:00
}
function smena2(login) {
top.frames['main'].smena_login = login;
top.frames['main'].reflesh();
}
2023-01-10 16:29:32 +00:00
/* Использовать прием на */
2022-06-06 21:30:34 +00:00
// 4.31
function priemOnUser(pr, id, nm, onInUser, img) {
let styleWin = 1;
if (img.substring(4, 7) === 'air') {
2022-06-06 21:30:34 +00:00
styleWin = 3;
} else if (img.substring(4, 9) === 'water') {
2022-06-06 21:30:34 +00:00
styleWin = 4;
} else if (img.substring(4, 9) === 'earth') {
2022-06-06 21:30:34 +00:00
styleWin = 5;
} else if (img.substring(4, 8) === 'fire') {
2022-06-06 21:30:34 +00:00
styleWin = 2;
}
2023-01-10 16:29:32 +00:00
win.add(`iusepr${pr}`, `Используем &quot;${nm}&quot; &nbsp;`, '<center>Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></center>', {
'a1': `usePriemNow(\'${pr}\');`,
'usewin': `chat.inObj = $(\'#usePriemLogin${pr}\');$(\'#usePriemLogin${pr}\').focus()`,
'd': `<center><input style="width:96%; margin:5px;" id="usePriemLogin${pr}" class="inpt2" type="text" onKeyPress="javascript: if (event.keyCode==13) { usePriemNow(\'${pr}\');win.closew(\'iusepr${pr}\'); } " value="${onInUser}"></center>`
}, 3, styleWin, 'min-width:300px;');
chat.inObj = $(`#usePriemLogin${pr}`);
2022-06-06 21:30:34 +00:00
$(`#usePriemLogin${pr}`).focus();
}
2022-06-06 21:30:34 +00:00
// 4.32
function usePriemNow(id) {
top.frames['main'].use_on_pers = $(`#usePriemLogin${id}`).val();
top.frames['main'].usepriem(id, 1, '');
}
2022-06-06 21:30:34 +00:00
var datas = '';
function qn_win_cls() {
$('#qsst').html('');
$('#qsst').css('display', 'none');
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
/* Поединки */
2022-06-06 21:30:34 +00:00
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')) {
2022-06-06 21:30:34 +00:00
top.frames['main'].document.getElementById('auto_battle').value = bcl[3];
}
if (top.frames['main'].document.getElementById('save_zones')) {
2022-06-06 21:30:34 +00:00
top.frames['main'].document.getElementById('save_zones').value = bcl[4];
}
if (top.frames['main'].document.getElementById('fast_battle')) {
2022-06-06 21:30:34 +00:00
top.frames['main'].document.getElementById('fast_battle').value = bcl[1];
}
}
}
function btlclearlog() {
$(top.document.getElementById('battle_logg')).html('');
$(top.document.getElementById('battle_mlogg')).html(''); //Тут новый лог
2022-06-06 21:30:34 +00:00
}
2022-06-06 21:30:34 +00:00
function r_page(a) {
top.frames['main'].location.reload();
}
const key_actions = ['', '', 1];
2022-06-06 21:30:34 +00:00
$(document).ready(function () {
$('#globalMain').click(function () {
win.addaction(2, 0);
2022-06-06 21:30:34 +00:00
});
$(document).keypress(function (e) {
if (key_actions[2] === 1) {
if (e.keyCode === 13 && key_actions[0] !== '') {
2023-01-10 16:29:32 +00:00
//нажата клавиша enter
eval(key_actions[0]);
2022-06-06 21:30:34 +00:00
}
}
});
});
// 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('<small><div class="configcbdiv"><span style="float:left;cursor:help;" title="Направление прокрутки чата">Движение:</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Сообщения адресованные Вам">Общий чат:</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Приватные сообщения адресованные Вам">Приват:</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Системные сообщения (общие)">System (1):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Системные сообщения (личные)">System (2):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Чат клана (если Вы состоите в одном из кланов)">Клан чат:</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Системные сообщения клана (если Вы состоите в одном из кланов)">System (3):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Междугороднии сообщения">Мужгород:</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Общий лог боя">Лог боя (1):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Личный лог боя (показываются только Ваши действия)">Лог боя (2):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Автоматически очищать чат после боя">Очистка (1):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;cursor:help;" title="Автоматически удалять сообщения которые пропадают из &quot;поля зрения&quot;">Очистка (2):</span><span style="float:right;">none</span></div>' +
'<div class="configcbdiv"><span style="float:left;"><hr>[+] [+] [+]</span></div></small>');
cm.style.display = '';
}
}
2022-06-06 21:30:34 +00:00
}