Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.02 KB | None | 0 0
  1. var mfr = {
  2. sm: 'http://submissions.flashkit.com/uploadedfiles/soundfx/Cartoon/Ricoche/Ricochet-Texavery-8993_hifi.mp3',
  3. tab: ['Dotyk', 'Kl', 'CBK',],
  4. get: function (i, d) {
  5. if (i == 'p') {
  6. if (localStorage.getItem('mfrp') == null) {
  7. return (d != 2 ? 0 : 'inline')
  8. };
  9. return localStorage.getItem('mfrp').split('|')[d];
  10. };
  11. if (localStorage.getItem('mfr') == null) {
  12. return (d != 1 ? 1 : this.sm)
  13. };
  14. return localStorage.getItem('mfr').split('|')[i].split(',')[d];
  15. },
  16. start: function () {
  17. 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) + '">';
  18. for (i in this.tab) {
  19. if (i != 9) {
  20. 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>';
  21. } else {
  22. d += '<div><input tip="Chat" id="mfr' + i + '" type="checkbox" ' + (this.get(i, 0) == 1 ? 'checked="checked"' : '') + ' onclick="mfr.change()" /> ' + this.tab[i] + '</div>';
  23. }
  24. };
  25. d += '<span style="dplay: none" id="mfrm">Odznacz jedno</span></span></div>';
  26. $(d).appendTo('body').dblclick(function () {
  27. if($('#mfr .mfr').css('display')=='inline'){
  28. $('#mfr .mfr').hide();
  29. }else{
  30. $('#mfr .mfr').show();
  31. }; mfr.change()
  32.  
  33. }).draggable({
  34. start: function () {
  35. g.lock.add('blokada');
  36. }
  37. }, {
  38. stop: function () {
  39. g.lock.remove('blokada');
  40. mfr.change();
  41. }
  42. })
  43. },
  44. changes: function (i) {
  45. $('#mfrm' + i + 'a,#mfrm' + i + 'b,#mfrm' + i + 'c').toggle();
  46. $('#mfrm').show();
  47. },
  48. change: function () {
  49. d = '';
  50. for (i in this.tab) {
  51. 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') + '|';
  52. };
  53. localStorage.setItem('mfr', d);
  54. localStorage.setItem('mfrp', $('#mfr').position().left + '|' + $('#mfr').position().top + '|' + $('#mfr .mfr').css('display'));
  55. },
  56. setTitle: function (te, ti) {
  57. document.title = te;
  58. //soundManager.createSound({ id: Math.random(), url: 'http://api.naturalreaders.com/v2/tts/?t=%22'+te+'%22&r=5&s=1&requesttoken=492b41d5b74712561aefbfc85be89d44' }).play();
  59. setTimeout(function () {
  60. if (document.title == te) {
  61. document.title = 'Margonem MMORPG'
  62. }
  63. }, ti)
  64. },
  65. newNpc: newNpc,
  66. newNpcC: function (b) {
  67. for (var i in b) {
  68. if (b[i].wt > 19) {
  69. if (mfr.get(1, 0) == 1) {
  70. soundManager.createSound({
  71. id: "mfr_e2",
  72. url: mfr.get(1, 1)
  73. }).play();
  74. };
  75. if (mfr.get(1, 2) == 1) {
  76. mfr.setTitle('[e2]' + b[i].nick, 5000)
  77. };
  78. }
  79. }
  80. },
  81.  
  82. newOther: newOther,
  83. newOtherC: function (b) {
  84. for (var i in b) {
  85. 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) {
  86. if (mfr.get(8, 0) == 1) {
  87. soundManager.createSound({
  88. id: "mfr_enemy",
  89. url: mfr.get(7, 1)
  90. }).play()
  91. };
  92. if (mfr.get(8, 2) == 1) {
  93. mfr.setTitle('[enemy]' + b[i].nick, 5000);
  94. }
  95. }
  96. }
  97. }, perkun: function(prof){ if(prof=="w"||prof=="p"||prof=="h")return 1; return 2 },
  98. fight: fight,
  99. fightC: function (f) {
  100. if (isset(f.move)) {
  101. if (f.move > 0) {
  102. if (f.move == 10 && mfr.get(2, 0) == 1) {
  103. soundManager.createSound({
  104. id: "mfr_move",
  105. url: mfr.get(2, 1)
  106. }).play()
  107. };
  108. if (mfr.get(2, 2) == 1) {
  109. enemy = '';
  110. for (i in g.battle.f) {
  111. if (g.battle.f[i].team == 2) {
  112. enemy += g.battle.f[i].name + ','
  113. }
  114. };
  115. mfr.setTitle('[fight]' + enemy.substr(0, enemy.length - 1), 1500)
  116. }
  117. };
  118. }
  119. },
  120. lootItem: lootItem,
  121. lootItemC: function (i) {
  122. if (g.party != 0) {
  123. if (mfr.get(3, 0) == 1) {
  124. soundManager.createSound({
  125. id: "mfr_loot",
  126. url: mfr.get(3, 1)
  127. }).play()
  128. };
  129. if (mfr.get(3, 2) == 1) {
  130. mfr.setTitle('[loot]' + i.name, 5000)
  131. }
  132. };
  133. },
  134. mAlert: mAlert,
  135. mAlertC: function (a) {
  136. if (a.indexOf('Czy chcesz handlować') != -1) {
  137. tit = 'trade';
  138. tite = a.replace('Czy chcesz handlować z graczem ', '').replace('?', '')
  139. } else if (a.indexOf('Czy chcesz dołączyć do klanu') != -1) {
  140. tit = 'clan';
  141. tite = a.replace('Czy chcesz dołączyć do klanu ', '').replace('?', '')
  142. } else if (a.indexOf('zaprasza cię do swoich przyjaciół.') != -1) {
  143. tit = 'friend';
  144. tite = a.replace('Gracz ', '').replace(' zaprasza cię do swoich przyjaciół.', '')
  145. } else if (a.indexOf('zaprasza cię do drużyny.') != -1) {
  146. tit = 'grp';
  147. tite = a.replace('Gracz ', '').replace(' zaprasza cię do drużyny.', '')
  148. } else if (a.indexOf('chce rzucić na Ciebie Karmazynowe Błogosławieństwo. Akceptujesz?') != -1) {
  149. tit = 'kb';
  150. tite = a.replace('Gracz ', '').replace(' chce rzucić na Ciebie Karmazynowe Błogosławieństwo. Akceptujesz?', '')
  151. } else {
  152. tit = '';
  153. }; if (tit != '') {
  154. if (mfr.get(4, 0) == 1) {
  155. soundManager.createSound({
  156. id: "mfr_grp",
  157. url: mfr.get(4, 1)
  158. }).play()
  159. };
  160. if (mfr.get(4, 2) == 1) {
  161. mfr.setTitle('[' + tit + ']' + tite, 5000);
  162. };
  163. };
  164. },
  165. battleMsg: battleMsg,
  166. parseInput: parseInput,
  167. };
  168. mfr.start();
  169. g.chat.parsers.push(function (ch) {
  170. if (ch.k == 3 && ch.n != 'System' && ch.n != hero.nick && unix_time() - parseInt(ch.ts) < 2) {
  171. if (mfr.get(0, 0) == 1) {
  172. soundManager.createSound({
  173. id: "mfr_priv",
  174. url: mfr.get(0, 1)
  175. }).play();
  176. };
  177. if (mfr.get(0, 2) == 1) {
  178. mfr.setTitle('[priv]' + ch.n, 5000)
  179. };
  180. };
  181. if (ch.s == 'sys_info' && ch.t.indexOf('dołączył do gry') != -1 && unix_time() - parseInt(ch.ts) < 2) {
  182. if (mfr.get(5, 0) == 1) {
  183. soundManager.createSound({
  184. id: "mfr_cland",
  185. url: mfr.get(5, 1)
  186. }).play();
  187. };
  188. if (mfr.get(5, 2) == 1) {
  189. mfr.setTitle('[clan+]' + ch.t.replace(' dołączył do gry', ''), 5000)
  190. };
  191. };
  192. }); /* RESP E2+*/
  193. newNpc = function (b) {
  194. mfr.newNpc(b);
  195. mfr.newNpcC(b);
  196. };
  197. fight = function (f) {
  198. mfr.fight(f);
  199. mfr.fightC(f);
  200. };
  201. lootItem = function (i) {
  202. mfr.lootItem(i);
  203. mfr.lootItemC(i);
  204. };
  205. mAlert = function (a, c, d, b) {
  206. mfr.mAlert(a, c, d, b);
  207. mfr.mAlertC(a);
  208. }; /* część kodu z dodatku Uhutafa - uzupełnij strzały */
  209. var arrows = {
  210. get: function () {
  211. itemek = $('div[style*="left: 92px; top: 183px;"]');
  212. if (hero.prof == 't' || hero.prof == 'h') {
  213. var ilosc = 0;
  214. } else {
  215. var ilosc = 51;
  216. }; if (itemek.attr('id') != undefined) {
  217. i = parseInt(itemek.attr('id').replace('item', ''));
  218. if (g.item[i].cl == 21 && itemek.css("top") == "183px" && itemek.css("left") == "92px") {
  219. var stat = g.item[i].stat;
  220. var nrilosc = stat.indexOf("ammo");
  221. if (nrilosc != -1) {
  222. ilosc = stat.slice(nrilosc + 5, nrilosc + 9);
  223. ilosc = parseInt(ilosc);
  224. }
  225. };
  226. };
  227. return ilosc
  228. },
  229. check: function () {
  230. arrow = arrows.get();
  231. if (arrow <= 50) {
  232. if (mfr.get(6, 0) == 1) {
  233. soundManager.createSound({
  234. id: "mfr_arrows",
  235. url: mfr.get(6, 1)
  236. }).play()
  237. };
  238. if (mfr.get(6, 2) == 1) {
  239. mfr.setTitle('[arrows]' + arrow, 5000);
  240. }
  241. }
  242. },
  243. hp: function () {
  244. myphp = Math.ceil(hero.hp / hero.maxhp * 100);
  245. if (myphp <= 10 && !g.dead) {
  246. if (mfr.get(7, 0) == 1) {
  247. soundManager.createSound({
  248. id: "mfr_hp",
  249. url: mfr.get(7, 1)
  250. }).play()
  251. };
  252. if (mfr.get(7, 2) == 1) {
  253. mfr.setTitle('[hp]' + myphp + '%', 5000);
  254. }
  255. }
  256. }
  257. };
  258. g.loadQueue.push({
  259. fun: function () {
  260. setTimeout(function () {
  261. arrows.check();
  262. arrows.hp();
  263. }, 750);
  264. },
  265. data: ''
  266. });
  267. newOther = function (b) {
  268. mfr.newOther(b);
  269. mfr.newOtherC(b);
  270. };
  271.  
  272. var fronline = {
  273. tab: [],
  274. newtab: [],
  275. first: true,
  276. chatadd: function (i) {
  277. $('#chattxt').append('<div style="color: lime">«SE -> ' + hero.nick + '» ' + i + ' dołączył do gry.</div>').scrollTop($("#chattxt").scrollTop() + 15);
  278. },
  279. get: function () {
  280. if (!g.engineStopped) { hide_fr = true; if($('#friends').css('display')=='block'){ hide_fr = false; };
  281. _g("friends&a=show", function () { if(hide_fr==true){$('#friends').hide(); g.lock.remove('friends');};
  282. if (isset(g.friends)) {
  283. fronline.newtab = [];
  284. for (x = 8; x < g.friends.length; x += 10) {
  285. if (g.friends[x] == "online" || g.friends[x] == "online, nieprzytomny") {
  286. searchfr = false;
  287. for (i in fronline.tab) {
  288. if (fronline.tab[i] == g.friends[x - 7]) {
  289. searchfr = true;
  290. }
  291. };
  292. if (searchfr == false && fronline.first == false) {
  293. if (mfr.get(9, 0) == 1) {
  294. fronline.chatadd(g.friends[x - 7])
  295. };
  296. if (mfr.get(5, 0) == 1) {
  297. soundManager.createSound({
  298. id: "mfr_fr",
  299. url: mfr.get(5, 1)
  300. }).play()
  301. };
  302. if (mfr.get(5, 2) == 1) {
  303. mfr.setTitle('[friend+]' + g.friends[x - 7], 5000);
  304. }
  305. }
  306. fronline.newtab.push(g.friends[x - 7]);
  307. }
  308. };
  309. fronline.tab = fronline.newtab;
  310. fronline.first = false;
  311. }
  312. })
  313. }
  314. }
  315. };
  316. setInterval(function () {
  317. if (mfr.get(9, 0) == 1 || mfr.get(5, 0) == 1 || mfr.get(5, 2) == 1) {
  318. fronline.get()
  319. }
  320. }, 5000);
  321.  
  322. battleMsg = function (c, t) {
  323. var retass = mfr.battleMsg(c, t);
  324. if (c.search(/winner=/) >= 0) {
  325. setTimeout(function () {
  326. arrows.check();
  327. arrows.hp();
  328. }, 750);
  329. };
  330. return retass
  331. };
  332.  
  333. parseInput = function (d, callback, xhr) {
  334. mfr.parseInput(d, callback, xhr);
  335. if(isset(d['friends'])) { g.friends = d['friends']; };
  336. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement