Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Zestaw młodego setupopisarza
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @author Czogi
- // @match http://*.margonem.pl/
- // @grant none
- // ==/UserScript==
- //Przejścia
- newGateway = a=>{
- var b = [];
- for (var e = 0; e < a.length; e += 5) {
- var c = "gw" + (a[e + 2] * 256 + a[e + 1]);
- var l = htmlspecialchars(g.townname[a[e]]) + (a[e + 3] ? "<br>(" + _t("require_key", null, "gtw") + ")" : "");
- var h = {
- min: (parseInt(a[e + 4]) & 65535),
- max: ((parseInt(a[e + 4]) >> 16) & 65535)
- };
- var d = true;
- if (a[e + 4] != 0) {
- if (h.min != h.max) {
- l += "<br>" + _t("gateway_availavle", null, "gtw") + (h.min != 0 ? _t("from_lvl %lvl%", {
- "%lvl%": h.min
- }, "gtw") : "") + (h.max >= 1000 ? "" : _t("to_lvl %lvl%", {
- "%lvl%": h.max
- }, "gtw")) + _t("lvl_lvl", null, "gtw");
- if (h.min != 0 && h.min > hero.lvl) {
- d = false
- } else {
- if (h.max < 1000 && h.max < hero.lvl) {
- d = false
- }
- }
- } else {
- l += "<br>" + _t("gateway_availavle_for %lvl%", {
- "%lvl%": h.max
- }, "gtw");
- if (h.max != hero.lvl) {
- d = false
- }
- }
- }
- $('<div class="gw gwmap' + a[e] + '" id=' + c + " style='top:" + (a[e + 2] * 32) + "px; left:" + (a[e + 1] * 32) + "px' tip='" + l + "<br><center>"+a[e]+"</center>'><br><br><strong><center style='color:red'>"+a[e]+"</strong></div>").click(function(i) {
- hero.mClick(i)
- }).appendTo("#base");
- g.gw[a[e + 1] + "." + a[e + 2]] = d;
- g.gwIds[a[e]] = a[e + 1] + "." + a[e + 2]
- }
- if (isset(g.gw[hero.x + "." + hero.y])) {
- hero.autoWalkLock = true
- }
- for (var j in g.gw) {
- var f = j.split(".");
- questTrack.removePlaceholder([1, f[0], f[1]]);
- for (var j in g.gwIds) {
- questTrack.checkGwAndHighlight(j)
- }
- }
- }
- //Mapa
- $('#inmap2 IMG').mousemove(function(e){
- var $in2=$('#inmap2'), mx=e.clientX-g.left, my=e.clientY-g.top, o=map.overmap, top=false;
- if(my>350) top=true;
- mx+=$in2.scrollLeft();
- my+=$in2.scrollTop();
- if(o && mx>=o.x && mx<=o.x+o.width && my>=o.y && my<=o.y+o.width) return;
- for(var k in map.maplist)
- {
- o=map.maplist[k];
- if(mx>=o.x+20 && mx<=o.x+o.width+20 && my>=o.y+5 && my<=o.y+o.height+5)
- {
- map.overmap=o;
- var mt=$('#maptip');
- mt.html(o.name+"<br><center>"+k+"</center>").css({
- left:o.x
- });
- mt.css({
- top:top?(o.y-mt.outerHeight()):(o.y+o.height)
- }).show();
- return;
- }
- }
- map.overmap=false;
- $('#maptip').hide();
- });
- //minimapPlus
- g.loadQueue.push({fun:()=>{
- if(typeof miniMapPlus == 'object'){
- for(i in document.getElementsByClassName('mmp-gw')){
- let gw = document.getElementsByClassName('mmp-gw')[i]
- if(typeof gw.setAttribute !== 'undefined')gw.setAttribute('tip',gw.getAttribute('tip')+'<br><center style="color:red">'+Object.keys(g.townname).find(x=>{return gw.getAttribute('tip').includes(g.townname[x]);}))
- }}
- }})
Add Comment
Please, Sign In to add comment