Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mfr = {
- sm: 'http://submissions.flashkit.com/uploadedfiles/soundfx/Cartoon/Ricoche/Ricochet-Texavery-8993_hifi.mp3',
- tab: ['Dotyk', 'Kl', 'CBK',],
- get: function (i, d) {
- if (i == 'p') {
- if (localStorage.getItem('mfrp') == null) {
- return (d != 2 ? 0 : 'inline')
- };
- return localStorage.getItem('mfrp').split('|')[d];
- };
- if (localStorage.getItem('mfr') == null) {
- return (d != 1 ? 1 : this.sm)
- };
- return localStorage.getItem('mfr').split('|')[i].split(',')[d];
- },
- start: function () {
- d = '<div id="mfr" style="border:1px solid red; background:black; color:white; position:absolute; z-index:500; top:' + this.get('p', 1) + 'px; left:' + this.get('p', 0) + 'px"><center><b>Redukcja Bonusu</b></center><span class="mfr" style="display:' + this.get('p', 2) + '">';
- for (i in this.tab) {
- if (i != 9) {
- d += '<div><input tip="Redukuj o 25%" id="mfr' + i + '" type="checkbox" ' + (this.get(i, 0) == 1 ? 'checked="checked"' : '') + ' onclick="mfr.change()" /> <input tip="Redukuj o 50%" id="mfrt' + i + '" type="checkbox" ' + (this.get(i, 2) == 1 ? 'checked="checked"' : '') + ' onclick="mfr.change()" /> <span id="mfrm' + i + 'a" onclick="mfr.changes(' + i + ')">Bon: </span><input style="display:none" id="mfrm' + i + 'b" type="text" value="' + this.get(i, 1) + '"/><span style="display:none" onclick="mfr.test(' + i + ')" tip="Bon set lower." id="mfrm' + i + 'c">Bon: </span> ' + this.tab[i] + '</div>';
- } else {
- d += '<div><input tip="Chat" id="mfr' + i + '" type="checkbox" ' + (this.get(i, 0) == 1 ? 'checked="checked"' : '') + ' onclick="mfr.change()" /> ' + this.tab[i] + '</div>';
- }
- };
- d += '<span style="dplay: none" id="mfrm">Odznacz jedno</span></span></div>';
- $(d).appendTo('body').dblclick(function () {
- if($('#mfr .mfr').css('display')=='inline'){
- $('#mfr .mfr').hide();
- }else{
- $('#mfr .mfr').show();
- }; mfr.change()
- }).draggable({
- start: function () {
- g.lock.add('blokada');
- }
- }, {
- stop: function () {
- g.lock.remove('blokada');
- mfr.change();
- }
- })
- },
- changes: function (i) {
- $('#mfrm' + i + 'a,#mfrm' + i + 'b,#mfrm' + i + 'c').toggle();
- $('#mfrm').show();
- },
- change: function () {
- d = '';
- for (i in this.tab) {
- d += ($('#mfr' + i).attr('checked') == true ? '1' : '0') + ',' + ($('#mfrm' + i + 'b').val() == 'undefined' ? this.sm : $('#mfrm' + i + 'b').val()) + ',' + ($('#mfrt' + i).attr('checked') == true ? '1' : '0') + '|';
- };
- localStorage.setItem('mfr', d);
- localStorage.setItem('mfrp', $('#mfr').position().left + '|' + $('#mfr').position().top + '|' + $('#mfr .mfr').css('display'));
- },
- setTitle: function (te, ti) {
- document.title = te;
- //soundManager.createSound({ id: Math.random(), url: 'http://api.naturalreaders.com/v2/tts/?t=%22'+te+'%22&r=5&s=1&requesttoken=492b41d5b74712561aefbfc85be89d44' }).play();
- setTimeout(function () {
- if (document.title == te) {
- document.title = 'Margonem MMORPG'
- }
- }, ti)
- },
- newNpc: newNpc,
- newNpcC: function (b) {
- for (var i in b) {
- if (b[i].wt > 19) {
- if (mfr.get(1, 0) == 1) {
- soundManager.createSound({
- id: "mfr_e2",
- url: mfr.get(1, 1)
- }).play();
- };
- if (mfr.get(1, 2) == 1) {
- mfr.setTitle('[e2]' + b[i].nick, 5000)
- };
- }
- }
- },
- newOther: newOther,
- newOtherC: function (b) {
- for (var i in b) {
- if ((b[i].relation == 'en' || b[i].relation == 'cl-en' || (location.host=="game5.margonem.pl" && mfr.prof(hero.prof)!=mfr.prof(b[i].prof) ) ) && map.pvp == 2) {
- if (mfr.get(8, 0) == 1) {
- soundManager.createSound({
- id: "mfr_enemy",
- url: mfr.get(7, 1)
- }).play()
- };
- if (mfr.get(8, 2) == 1) {
- mfr.setTitle('[enemy]' + b[i].nick, 5000);
- }
- }
- }
- }, perkun: function(prof){ if(prof=="w"||prof=="p"||prof=="h")return 1; return 2 },
- fight: fight,
- fightC: function (f) {
- if (isset(f.move)) {
- if (f.move > 0) {
- if (f.move == 10 && mfr.get(2, 0) == 1) {
- soundManager.createSound({
- id: "mfr_move",
- url: mfr.get(2, 1)
- }).play()
- };
- if (mfr.get(2, 2) == 1) {
- enemy = '';
- for (i in g.battle.f) {
- if (g.battle.f[i].team == 2) {
- enemy += g.battle.f[i].name + ','
- }
- };
- mfr.setTitle('[fight]' + enemy.substr(0, enemy.length - 1), 1500)
- }
- };
- }
- },
- lootItem: lootItem,
- lootItemC: function (i) {
- if (g.party != 0) {
- if (mfr.get(3, 0) == 1) {
- soundManager.createSound({
- id: "mfr_loot",
- url: mfr.get(3, 1)
- }).play()
- };
- if (mfr.get(3, 2) == 1) {
- mfr.setTitle('[loot]' + i.name, 5000)
- }
- };
- },
- mAlert: mAlert,
- mAlertC: function (a) {
- if (a.indexOf('Czy chcesz handlować') != -1) {
- tit = 'trade';
- tite = a.replace('Czy chcesz handlować z graczem ', '').replace('?', '')
- } else if (a.indexOf('Czy chcesz dołączyć do klanu') != -1) {
- tit = 'clan';
- tite = a.replace('Czy chcesz dołączyć do klanu ', '').replace('?', '')
- } else if (a.indexOf('zaprasza cię do swoich przyjaciół.') != -1) {
- tit = 'friend';
- tite = a.replace('Gracz ', '').replace(' zaprasza cię do swoich przyjaciół.', '')
- } else if (a.indexOf('zaprasza cię do drużyny.') != -1) {
- tit = 'grp';
- tite = a.replace('Gracz ', '').replace(' zaprasza cię do drużyny.', '')
- } else if (a.indexOf('chce rzucić na Ciebie Karmazynowe Błogosławieństwo. Akceptujesz?') != -1) {
- tit = 'kb';
- tite = a.replace('Gracz ', '').replace(' chce rzucić na Ciebie Karmazynowe Błogosławieństwo. Akceptujesz?', '')
- } else {
- tit = '';
- }; if (tit != '') {
- if (mfr.get(4, 0) == 1) {
- soundManager.createSound({
- id: "mfr_grp",
- url: mfr.get(4, 1)
- }).play()
- };
- if (mfr.get(4, 2) == 1) {
- mfr.setTitle('[' + tit + ']' + tite, 5000);
- };
- };
- },
- battleMsg: battleMsg,
- parseInput: parseInput,
- };
- mfr.start();
- g.chat.parsers.push(function (ch) {
- if (ch.k == 3 && ch.n != 'System' && ch.n != hero.nick && unix_time() - parseInt(ch.ts) < 2) {
- if (mfr.get(0, 0) == 1) {
- soundManager.createSound({
- id: "mfr_priv",
- url: mfr.get(0, 1)
- }).play();
- };
- if (mfr.get(0, 2) == 1) {
- mfr.setTitle('[priv]' + ch.n, 5000)
- };
- };
- if (ch.s == 'sys_info' && ch.t.indexOf('dołączył do gry') != -1 && unix_time() - parseInt(ch.ts) < 2) {
- if (mfr.get(5, 0) == 1) {
- soundManager.createSound({
- id: "mfr_cland",
- url: mfr.get(5, 1)
- }).play();
- };
- if (mfr.get(5, 2) == 1) {
- mfr.setTitle('[clan+]' + ch.t.replace(' dołączył do gry', ''), 5000)
- };
- };
- }); /* RESP E2+*/
- newNpc = function (b) {
- mfr.newNpc(b);
- mfr.newNpcC(b);
- };
- fight = function (f) {
- mfr.fight(f);
- mfr.fightC(f);
- };
- lootItem = function (i) {
- mfr.lootItem(i);
- mfr.lootItemC(i);
- };
- mAlert = function (a, c, d, b) {
- mfr.mAlert(a, c, d, b);
- mfr.mAlertC(a);
- }; /* część kodu z dodatku Uhutafa - uzupełnij strzały */
- var arrows = {
- get: function () {
- itemek = $('div[style*="left: 92px; top: 183px;"]');
- if (hero.prof == 't' || hero.prof == 'h') {
- var ilosc = 0;
- } else {
- var ilosc = 51;
- }; if (itemek.attr('id') != undefined) {
- i = parseInt(itemek.attr('id').replace('item', ''));
- if (g.item[i].cl == 21 && itemek.css("top") == "183px" && itemek.css("left") == "92px") {
- var stat = g.item[i].stat;
- var nrilosc = stat.indexOf("ammo");
- if (nrilosc != -1) {
- ilosc = stat.slice(nrilosc + 5, nrilosc + 9);
- ilosc = parseInt(ilosc);
- }
- };
- };
- return ilosc
- },
- check: function () {
- arrow = arrows.get();
- if (arrow <= 50) {
- if (mfr.get(6, 0) == 1) {
- soundManager.createSound({
- id: "mfr_arrows",
- url: mfr.get(6, 1)
- }).play()
- };
- if (mfr.get(6, 2) == 1) {
- mfr.setTitle('[arrows]' + arrow, 5000);
- }
- }
- },
- hp: function () {
- myphp = Math.ceil(hero.hp / hero.maxhp * 100);
- if (myphp <= 10 && !g.dead) {
- if (mfr.get(7, 0) == 1) {
- soundManager.createSound({
- id: "mfr_hp",
- url: mfr.get(7, 1)
- }).play()
- };
- if (mfr.get(7, 2) == 1) {
- mfr.setTitle('[hp]' + myphp + '%', 5000);
- }
- }
- }
- };
- g.loadQueue.push({
- fun: function () {
- setTimeout(function () {
- arrows.check();
- arrows.hp();
- }, 750);
- },
- data: ''
- });
- newOther = function (b) {
- mfr.newOther(b);
- mfr.newOtherC(b);
- };
- var fronline = {
- tab: [],
- newtab: [],
- first: true,
- chatadd: function (i) {
- $('#chattxt').append('<div style="color: lime">«SE -> ' + hero.nick + '» ' + i + ' dołączył do gry.</div>').scrollTop($("#chattxt").scrollTop() + 15);
- },
- get: function () {
- if (!g.engineStopped) { hide_fr = true; if($('#friends').css('display')=='block'){ hide_fr = false; };
- _g("friends&a=show", function () { if(hide_fr==true){$('#friends').hide(); g.lock.remove('friends');};
- if (isset(g.friends)) {
- fronline.newtab = [];
- for (x = 8; x < g.friends.length; x += 10) {
- if (g.friends[x] == "online" || g.friends[x] == "online, nieprzytomny") {
- searchfr = false;
- for (i in fronline.tab) {
- if (fronline.tab[i] == g.friends[x - 7]) {
- searchfr = true;
- }
- };
- if (searchfr == false && fronline.first == false) {
- if (mfr.get(9, 0) == 1) {
- fronline.chatadd(g.friends[x - 7])
- };
- if (mfr.get(5, 0) == 1) {
- soundManager.createSound({
- id: "mfr_fr",
- url: mfr.get(5, 1)
- }).play()
- };
- if (mfr.get(5, 2) == 1) {
- mfr.setTitle('[friend+]' + g.friends[x - 7], 5000);
- }
- }
- fronline.newtab.push(g.friends[x - 7]);
- }
- };
- fronline.tab = fronline.newtab;
- fronline.first = false;
- }
- })
- }
- }
- };
- setInterval(function () {
- if (mfr.get(9, 0) == 1 || mfr.get(5, 0) == 1 || mfr.get(5, 2) == 1) {
- fronline.get()
- }
- }, 5000);
- battleMsg = function (c, t) {
- var retass = mfr.battleMsg(c, t);
- if (c.search(/winner=/) >= 0) {
- setTimeout(function () {
- arrows.check();
- arrows.hp();
- }, 750);
- };
- return retass
- };
- parseInput = function (d, callback, xhr) {
- mfr.parseInput(d, callback, xhr);
- if(isset(d['friends'])) { g.friends = d['friends']; };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement