' + LTlang.level + ':');
content.css({
'margin-top': '100px',
'width': '110px',
'position': 'absolute',
});
content.append(lvlBox.getMainDiv());
new west.gui.Button(LTlang.refresh, function () {
loadbonus();
}).appendTo(content);
$(TWLT.GUI.window.getContentPane()).append(setbutton).append(content).append(scrollpane.getMainDiv());
},
openBonusSearch: function () {
TWLT.GUI.getDefault('TWLTBonusSearch');
TWLT.GUI.window.setTitle('BonusSearch');
var scrollpane = new west.gui.Scrollpane();
$(scrollpane.getMainDiv()).css({
'margin-left': '120px',
'margin-top': '10px',
'width': '578px'
});
scrollpane.appendContent('
' + LTlang.choose2 + '!
');
var sets = TWLT.LTsets,
showbonus = function (id) {
scrollpane.contentPane.empty();
scrollpane.appendContent('
' + id[0] + '
');
var type = {
},
lastBon;
for (var i = 0; i < sets.length; i++) {
for (var k in sets[i].bonus) {
for (var l = 0; l < sets[i].bonus[k].length; l++) {
var ID = sets[i].bonus[k][l],
NAM = ID.job || ID.name || ID.bonus && (ID.bonus.name || ID.bonus.type) || ID.type;
if (NAM == id[1]) {
if (!type[i])
type[i] = 0;
type[i] = (ID.value !== undefined) ? ID.value + type[i] : ID.bonus.value + type[i];
if (TWLT.SPEC.indexOf(id[1]) == - 1)
VAL = Math.round(type[i] * 100) / 100;
else {
var NUM = type[i] * 100;
if (NUM > 0.2)
VAL = Math.round(NUM);
else
VAL = NUM;
}
var DESC = (ID.desc) ? ID.desc.replace(/[0-9]|\+|\./g, '') : CharacterSkills.keyNames[NAM];
scrollpane.appendContent((sets[i] != lastBon ? '
' + sets[i].name + '' : '') + k + ' ' + LTlang.items + ': +' + VAL + (DESC.indexOf('%') != - 1 ? '% ' : ' ') + (ID.key ? set.instance_set_1.bonus[2][0].desc.match(/\(.*?\)/g) [0] : '') + '
');
lastBon = sets[i];
}
}
}
}
};
var selbox = new west.gui.Selectbox().setWidth(250);
selbox.addListener(showbonus);
var collect = set.collector_set.bonus[9],
thunder = set.set_octoberfest_gun_winner.bonus[2],
juan = set.set_valentine_2016.bonus[7],
delChar = function (list, name) {
nameNew = list[name].desc.replace(/[0-9]|\+|\.|\%/g, '');
return nameNew;
};
var search = [
[delChar(collect, 0),
'all'
],
[
delChar(collect, 1),
'speed'
],
[
delChar(collect, 2),
'luck'
],
[
delChar(collect, 3),
'regen'
],
[
delChar(collect, 4),
'pray'
],
[
delChar(collect, 5),
'offense'
],
[
delChar(collect, 6),
'defense'
],
[
delChar(collect, 7),
'damage'
],
[
delChar(thunder, 2),
'dollar'
],
[
delChar(thunder, 3),
'experience'
],
[
delChar(thunder, 4),
'resistance'
],
[
delChar(juan, 0),
'drop'
],
];
search.sort(function (a, b) {
var a = a[0].replace(/\s/g, ''),
b = b[0].replace(/\s/g, '');
a = a.toLowerCase();
b = b.toLowerCase();
return (a == b) ? 0 : (a > b) ? 1 : - 1;
});
if (sets.length == forbid.max) {
for (var i = 0; i < search.length; i++) {
selbox.addItem(search[i], '
' + search[i][0] + '
', search[i][0]);
}
} else {
scrollpane.contentPane.empty();
scrollpane.appendContent('
ERROR: There are new sets added to the game.
Please contact me so I can add the sets to the script.
');
}
var setbutton = $('
');
setbutton.click(function () {
var pos = $(setbutton).offset();
selbox.setPosition(pos.left + 35, pos.top + 50);
selbox.show();
});
$(TWLT.GUI.window.getContentPane()).append(setbutton).append(scrollpane.getMainDiv());
},
openFrame: function (iframe) {
TWLT.GUI.window.setResizeable(true).addClass('nocloseall').clearContentPane().activateTab('TWLTFrame');
TWLT.GUI.window.dontCloseAll = true;
var wnd = TWLT.GUI.window.getMainDiv();
$('.tw2gui_window_inset', wnd).css('background-image', 'url(' + TWLT.Images.backGr + ')');
$('.textart_title', wnd).css('display', 'none');
var contPan = $(TWLT.GUI.window.getContentPane());
contPan.css('margin-top', '-30px');
new west.gui.Button('QuakeNet Webchat').appendTo(contPan).click(function () {
var iframe = $('