Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function theMap() {
  2.     var i = 0,
  3.         o = 0,
  4.         a = 16,
  5.         n = 16,
  6.         t = document.getElementById("objects"),
  7.         e = document.createElement("DIV");
  8.     this.id = -1, e.setAttribute("id", "oMap"), t.appendChild(e), this.loadMap = function(t) {
  9.         t = t.split(";");
  10.         var e = global.path;
  11.         if (this.img = e.server + e.maps + "/" + t[2], this.name = t[3], this.pvp = parseInt(t[4]), this.battleground = t[5], this.id = t[6], a = Math.max(t[0], 16), n = Math.max(t[1], 16), this.loading(), 1 < t[7].length) {
  12.             this.water = new Array, w = t[7].split("|");
  13.             for (var i = 0; i < w.length; i++) {
  14.                 ww = w[i].split(",");
  15.                 for (var o = ww[0] - 1; o <= ww[1]; o++) this.water[o + 256 * ww[2]] = ww[3]
  16.             }
  17.         } else this.water = !1
  18.     }, this.loading = function() {
  19.         il.nLoaded + il.nErrors == il.imgList.length ? (document.getElementById("loading").innerHTML = "<span>Ładowanie mapy (ok. 1MB)<br>Jeśli ładowanie się zatrzymało naciśnij F5.</span>", log("Loading: " + this.img), il.preload(this.img, "onload", this)) : setTimeout("map.loading()", 100)
  20.     }, this.left = function() {
  21.         return i
  22.     }, this.top = function() {
  23.         return o
  24.     }, this.width = function() {
  25.         return a
  26.     }, this.height = function() {
  27.         return n
  28.     }, this.onload = function(t) {
  29.         if (hide("loading", !0), 583 != this.id && 1061 != this.id && 1063 != this.id || 1 != hero.lvl || show("oHelp", !1), iefix(), t) log("Can't load map image: '" + this.img + "'", 2);
  30.         else {
  31.             log("Map loaded"), document.getElementById("oMap").style.backgroundImage = "url(" + this.img + ")", this.center(hero.x, hero.y), hero.fixwater();
  32.             var e = 0;
  33.             switch (this.pvp) {
  34.                 case 0:
  35.                     e = 3, this.pvpstr = "Brak PvP";
  36.                     break;
  37.                 case 1:
  38.                     e = 2, this.pvpstr = "PvP na życzenie";
  39.                     break;
  40.                 case 2:
  41.                     e = 0, this.pvpstr = "PvP";
  42.                     break;
  43.                 case 3:
  44.                     e = 3, this.pvpstr = "Brak PvP";
  45.                     break;
  46.                 case 4:
  47.                     e = 1, this.pvpstr = "Arena"
  48.             }
  49.             document.getElementById("pvpmode").style.backgroundPosition = "0 -" + 17 * e + "px", addEvent(document.getElementById("pvpmode"), "mouseover", function(t) {
  50.                 if (!t) t = window.event;
  51.                 tip.show(t.clientX, t.clientY, "", map.pvpstr)
  52.             }), addEvent(document.getElementById("pvpmode"), "mouseout", function(t) {
  53.                 tip.hide()
  54.             })
  55.         }
  56.     }, this.redraw = function() {
  57.         document.getElementById("oMap").style.backgroundPosition = 32 * -i + "px " + 32 * -o + "px"
  58.     };
  59.     var s = function(t, e, i) {
  60.         return t < e ? e : i < t ? i : t
  61.     };
  62.     this.center = function(t, e) {
  63.         i = s(t - 8, 0, a - 16), o = s(e - 8, 0, n - 16), this.redraw()
  64.     }, this.moveto = function(t, e) {
  65.         t < i + 4 && (i = Math.max(t - 4, 0)), i + a - 4 < t && (i = Math.min(t + 4, a)), e < o + 4 && (o = Math.max(e - 4, 0)), o + n - 4 < e && (o = Math.min(t + 4, n)), this.redraw()
  66.     }
  67. }
  68.  
  69. function ObjectLoader() {
  70.     this.objList = new Array, this.oRoot = "objects"
  71. }
  72.  
  73. function oDiv(t, e) {
  74.     for (this.src = e, this.inuse = !0, this.loaded = !1, this.rt = t, this.isimg = !(2 < arguments.length) || arguments[2]; this.uid = "UID_" + Math.round(16777215 * Math.random()).toString(16), document.getElementById(this.uid););
  75.     var i = document.createElement("DIV");
  76.     document.getElementById(t).appendChild(i), this.isimg ? i.innerHTML = "<IMG id=" + this.uid + " class=cItem>" : i.innerHTML = "<DIV id=" + this.uid + " class=cItem></DIV>", il.preload(this.src, "onload", this)
  77. }
  78.  
  79. function player(t) {
  80.     this.pid = getCookie("mchar_id"), this.pid < 1 && (this.pid = getCookie("user_id")), this.hash = getCookie("chash"), this.hash && (this.hash = this.hash.substr(0, 10)), this.x = -1, this.y = -1, this.rx = -1, this.ry = -1, this.mx = -1, this.my = -1, this.kier = 0, this.framew = 32, this.frameh = 48, this.nosize = !0, this.dazed = !1, this.dazedleft = 0, this.cmap = "", this.opt2 = 0, this.mana = 0, this.energy = 0, this.maxhp = 1e4;
  81.     var h, c = t,
  82.         a = "",
  83.         r = new Array,
  84.         d = 0,
  85.         n = new Array;
  86.     this.setup = function(t) {
  87.         for (var e in t = t.split(";")) t[e] = t[e].split("="), "x" == t[e][0] || "y" == t[e][0] ? this[t[e][0]] = parseInt(t[e][1]) : this[t[e][0]] = t[e][1];
  88.         var i = global.path;
  89.         if (1 < this.mpath.length && (0 <= this.mpath.indexOf("http:") ? i.server = this.mpath : i.server = "file:///" + this.mpath.slice(0, -1)), this.img = i.characters + this.img, il.preload(this.img, "onload", this), this.lvl = parseInt(this.lvl), 80 < this.lvl) {
  90.             var o = new Date;
  91.             o.setTime(o.getTime() + 2592e4), setCookie("premCounter", 99, o, "/", "margonem.pl")
  92.         }
  93.         document.getElementById("lp_nick").innerHTML = this.nick + " (" + this.lvl + ")", document.getElementById("lp_nick").setAttribute("tip", this.prof), this.nextexp = Math.round(Math.pow(this.lvl, 4) + 10);
  94.         var a = Math.round(Math.pow(this.lvl - 1, 4) + 10);
  95.         1 == this.lvl && (a = 0);
  96.         var n = Math.min(1, Math.max((this.exp - a) / (this.nextexp - a), .001));
  97.         document.getElementById("exp2").style.width = Math.round(document.getElementById("exp1").offsetWidth * n) + "px", addEvent(document.getElementById("exp1"), "mouseover", function(t) {
  98.             if (!t) t = window.event;
  99.             tip.show(t.clientX, t.clientY, "", "<B>Doświadczenie:</B>" + round(hero.exp, 2) + "/" + round(hero.nextexp, 2) + "<B>Do " + (parseInt(hero.lvl) + 1) + " poziomu:</B>" + round(hero.nextexp - hero.exp, 3))
  100.         }), addEvent(document.getElementById("exp1"), "mouseout", function(t) {
  101.             tip.hide()
  102.         }), addEvent(document.getElementById("exp1"), "mousemove", function(t) {
  103.             if (!t) t = window.event;
  104.             tip.move(t.clientX, t.clientY)
  105.         }), addEvent(document.getElementById("stat2but"), "click", function(t) {
  106.             if (!t) t = window.event;
  107.             var e = Math.min(Math.floor((t.clientX - 660) / 23), 4);
  108.             e != d && (d = e, document.getElementById("stat2in").innerHTML = r[d], document.getElementById("stat2").style.backgroundPosition = "0 " + -98 * e + "px")
  109.         }), this.rx = this.x, this.ry = this.y, this.rz = 0, this.step = 0, h = !0, this.nosize = !0
  110.     }, this.stats = function(t) {
  111.         for (var e in t = t.split(";")) t[e] = t[e].split("="), this[t[e][0]] = t[e][1];
  112.         document.getElementById("newlvl").style.display = 0 < this.ap ? "block" : "none", 0 < this.ap ? document.getElementById("abpoints").innerHTML = "Wybierz na co przeznaczasz punkty zdolności.<br>Pozostało punktów: " + this.ap : document.getElementById("abpoints").innerHTML = "<br>Nie masz wolnych punktów zdolności", document.getElementById("ab11").style.display = 0 < this.ap ? "block" : "none", document.getElementById("ab12").style.display = 0 < this.ap ? "block" : "none", document.getElementById("ab13").style.display = 0 < this.ap ? "block" : "none", document.getElementById("ab51").style.display = 4 < this.ap ? "block" : "none", document.getElementById("ab52").style.display = 4 < this.ap ? "block" : "none", document.getElementById("ab53").style.display = 4 < this.ap ? "block" : "none", this.lvl = parseInt(this.lvl), this.nextexp = Math.round(Math.pow(this.lvl, 4) + 10);
  113.         var i = Math.round(Math.pow(this.lvl - 1, 4) + 10);
  114.         1 == this.lvl && (i = 0);
  115.         var o = Math.min(Math.max((this.exp - i) / (this.nextexp - i), .001), 1);
  116.         document.getElementById("exp2").style.width = Math.round(1 + 106 * o) + "px", document.getElementById("gold").innerHTML = " " + round(this.gold, 3), document.getElementById("lp_nick").innerHTML = this.nick + " (" + this.lvl + ")";
  117.         var a = parseFloat(this.hp) / parseFloat(this.maxhp);
  118.         document.getElementById("life2").style.width = Math.round(1 + 106 * a) + "px", addEvent(document.getElementById("life1"), "mouseover", function(t) {
  119.             if (!t) t = window.event;
  120.             tip.show(t.clientX, t.clientY, "", "<B>Punkty życia:</B>" + hero.hp + "/" + hero.maxhp)
  121.         }), addEvent(document.getElementById("life1"), "mouseout", function(t) {
  122.             tip.hide()
  123.         }), document.getElementById("base3").innerHTML = this.st + "<br>" + this.ag + "<br>" + this.it, addEvent(document.getElementById("base3"), "mouseover", function(t) {
  124.             if (!t) t = window.event;
  125.             tip.show(t.clientX, t.clientY, "", "<B>Bazowe statystyki:</B>" + hero.bstr + "/" + hero.bagi + "/" + hero.bint)
  126.         }), addEvent(document.getElementById("base3"), "mouseout", function(t) {
  127.             tip.hide()
  128.         });
  129.         var n = Math.round((parseInt(this.mina) + parseInt(this.maxa)) / 2);
  130.         r[0] = n + " &plusmn;" + Math.round(n - this.mina) + "<br>~" + this.maga + "<br>" + this.sa + "<br>" + this.ac + "<BR>" + this.acm + "<br>", r[1] = this.honor + "<br>" + this.credits + '<br><span tip="' + this.protickets + '">' + Math.max(0, this.timetickets) + "</span>", document.getElementById("exp2").style.backgroundImage = "url(http://oldmargonem.pl/obrazki/interface/" + (0 < this.timetickets ? "exp.png)" : "noexp.png)");
  131.         var s = " (" + Math.min(50, Math.round(40 * this.evade / this.lvl)) + "%)",
  132.             l = " (" + Math.round(20 * this.block / this.lvl) + "%)";
  133.         r[2] = this.crit + "%<br>x" + this.critval + "<br>x" + this.critmval + "<br>" + this.evade + s + "<br>" + this.block + l, r[3] = this.act + "<br>" + this.absorb + "<br>" + this.absorbm + "<br>" + this.heal, r[4] = "", document.getElementById("stat2in").innerHTML = r[d], this.pvp = parseInt(this.pvp), this.pvp ? (global.r.pvpbutton = 0, document.getElementById("pvpbutton").style.backgroundPosition = "0 0") : (global.r.pvpbutton = -44, document.getElementById("pvpbutton").style.backgroundPosition = "0 -44px"), setih("mana", this.mana), setih("energy", this.energy), setih("mailnotifier", this.mails)
  134.     }, this.pvpclick = function() {
  135.         this.pvp ? dbget("setpvp", "mode=0") : dbget("setpvp", "mode=1")
  136.     }, this.fixwater = function() {
  137.         map.water ? ((ww = map.water[Math.round(this.rx) + 256 * Math.round(this.ry)]) && (this.rz = 4 * parseInt(ww)), this.update = !0) : setTimeout("hero.fixwater()", 300)
  138.     }, this.checkSize = function() {
  139.         if (il && il.getsize) {
  140.             var t = il.getsize(hero.img);
  141.             t && 1 < t[0] + t[1] && (this.framew = Math.round(t[0] / 4), this.frameh = Math.round(t[1] / 4), document.getElementById("oHero").style.width = this.framew + "px", document.getElementById("oHero").style.height = this.frameh + "px", this.nosize = !1)
  142.         }
  143.     };
  144.     var e = document.getElementById("objects"),
  145.         o = document.createElement("DIV");
  146.     o.setAttribute("id", "oHero"), e.appendChild(o), o.onclick = function(t) {
  147.         if (!t) t = window.event;
  148.         var e = document.getElementById("menu"),
  149.             i = "";
  150.         i = "<BUTTON onclick=\"hide('menu',true);dbget('takeitem','bag='+global.bag);\">Podnieś</BUTTON>", i += "<BUTTON onclick=dbget('walk')>Przejdź</BUTTON>", 0 < hero.fight_gr && (i += "<BUTTON onclick=\"hide('menu',true);dbget('fight','leavegroup=1')\">Opuść grupę</BUTTON>"), document.getElementById("menuin").innerHTML = i, e.style.left = Math.max(0, t.clientX - 60) + "px";
  151.         var o = 502 - 20 * i.split("<BUTTON ").length;
  152.         e.style.top = Math.min(o, Math.max(0, t.clientY - 20)) + "px", show("menu", !0)
  153.     }, this.onload = function(t) {
  154.         t ? log("Can't load player image: '" + this.img + "'", 2) : (document.getElementById("oHero").style.backgroundImage = "url(" + this.img + ")", document.getElementById("oHero").style.display = "block")
  155.     }, this.go = function(t) {
  156.         this.x = parseInt(t[0]), this.y = parseInt(t[1]), this.kier = parseInt(t[2]), a = "", h = !!1
  157.     }, this.move = function(t) {
  158.         if (!(8 < a.split(";").length)) {
  159.             var e = this.x,
  160.                 i = this.y;
  161.             "W" == t && (1 == this.kier ? this.x-- : this.kier = 1), "E" == t && (2 == this.kier ? this.x++ : this.kier = 2), "N" == t && (3 == this.kier ? this.y-- : this.kier = 3), "S" == t && (0 == this.kier ? this.y++ : this.kier = 0);
  162.             var o = 256 * this.y + parseInt(this.x);
  163.             if (0 <= this.cmap.indexOf(";" + o + ";") || this.x < 0 || this.y < 0 || this.x >= map.width() || this.y >= map.height() || el.collision(this.x, this.y)) return this.x = e, void(this.y = i);
  164.             this.x == e && this.y == i || ("" != a && (a += ";"), a += this.x + "," + this.y), h = !0
  165.         }
  166.     }, this.synchMove = function(t) {
  167.         if (n = t.split(","), 0 < map.id && n[2] != map.id && document.location.reload(), "" == a) {
  168.             if (n[0] == this.x && n[1] == this.y) return;
  169.             return log("Coords out of sync[0]: xy=" + t + "; hero=" + this.x + "," + this.y + "; ml=" + a), this.x = parseInt(n[0]), this.y = parseInt(n[1]), void(h = !0)
  170.         }
  171.         for (var e = a.split(";"), i = -1, o = 0; o < e.length; o++) ml1 = e[o].split(","), dx = Math.abs(ml1[0] - n[0]) + Math.abs(ml1[1] - n[1]), dx < 2 && (i = o, dx);
  172.         if (0 <= i)
  173.             if (0 == dx && e.length - 1 == i) a = "";
  174.             else {
  175.                 ml2 = new Array;
  176.                 for (o = i; o < e.length; o++) ml2[o - i] = e[o];
  177.                 a = ml2.join(";")
  178.             }
  179.         else log("Coords out of sync[1]: xy=" + t + "; hero=" + this.x + "," + this.y + "; ml=" + a), this.x = parseInt(n[0]), this.y = parseInt(n[1]), h = !0, a = ""
  180.     }, this.forceMove = function(t, e) {
  181.         8 < a.split(";") || (this.x = t, this.y = e, h = !0, "" != a && (a += ";"), a += this.x + "," + this.y, !0)
  182.     }, this.doMove = function() {
  183.         return 0 != a.length && (dbget("go", "dir=" + this.kier + "&ml=" + a), !!1)
  184.     }, this.run = function() {
  185.         this.nosize && this.checkSize();
  186.         var t = document.getElementById("oHero");
  187.         if (!global.battle.now && !global.battle.agrnow && Math.abs(this.rx - this.x) < 1.5 && Math.abs(this.ry - this.y) < 1.5) {
  188.             for (k[c + 0] && this.move("W"), k[c + 1] && this.move("E"), k[c + 2] && this.move("N"), k[c + 3] && this.move("S"), i = 0; i < 4; i++) k[c + i] = !1;
  189.             if (h && (this.mx = -1, this.my = -1), 0 <= this.mx && 0 <= this.my && this.rx == this.x && this.ry == this.y) {
  190.                 var e = this.x - this.mx,
  191.                     o = this.y - this.my,
  192.                     a = this.kier;
  193.                 Math.abs(e) >= Math.abs(o) && 0 < Math.abs(e) && (0 < e ? (this.kier = 1, this.move("W")) : (this.kier = 2, this.move("E"))), (Math.abs(o) > Math.abs(e) || !h) && 0 < Math.abs(o) && (0 < o ? (this.kier = 3, this.move("N")) : (this.kier = 0, this.move("S"))), Math.abs(e) < Math.abs(o) && !h && 0 < Math.abs(e) && (0 < e ? (this.kier = 1, this.move("W")) : (this.kier = 2, this.move("E"))), h || (this.mx = -1, this.my = -1), a != this.kier && (h = !0)
  194.             }
  195.         }
  196.         var n = this.rx,
  197.             s = this.ry;
  198.         this.rx + 2 < this.x ? this.rx = parseFloat(this.x) - 2 : this.ry + 2 < this.y ? this.ry = parseFloat(this.y) - 2 : this.rx - 2 > this.x ? this.rx = parseFloat(this.x) + 2 : this.ry - 2 > this.y && (this.ry = parseFloat(this.y) + 2);
  199.         var l = .25,
  200.             r = .25;
  201.         if (1 < Math.abs(this.rx - this.x) && (l = .5), 1 < Math.abs(this.ry - this.y) && (r = .5), this.rx > this.x && (this.rx -= l), this.ry > this.y && (this.ry -= r), this.rx < this.x && (this.rx += l), this.ry < this.y && (this.ry += r), n == this.rx && s == this.ry || (h = !0), this.rx - this.x != 0 || this.ry - this.y != 0 ? this.step = this.step + 1 & 3 : this.step = 0, h) {
  202.             if (map.center(this.rx, this.ry), ww = map.water[Math.round(this.rx) + 256 * Math.round(this.ry)]) {
  203.                 var d = 4 * parseInt(ww);
  204.                 d > this.rz && this.rz++, d < this.rz && this.rz--, d > this.rz + 2 && (this.rz += 2), d < this.rz - 2 && (this.rz -= 2), t.style.height != this.frameh - this.rz && (t.style.height = this.frameh - this.rz)
  205.             } else t.style.height != this.frameh + "px" && (t.style.height = this.frameh, this.rz = 0);
  206.             t.style.left = 32 * (this.rx - map.left()) - (this.framew - 32) / 2, t.style.top = 32 * (this.ry - map.top()) - (this.frameh - this.rz - 32), t.style.backgroundPosition = this.step * this.framew + "px " + -this.kier * this.frameh + "px", t.style.zIndex = 2 + parseInt(this.y), h = !1
  207.         }
  208.     };
  209.     var l = "";
  210.     this.talker = "", this.talkerid = 0, this.initTalk = function(t, e) {
  211.         show("dialog", !0);
  212.         document.getElementById("dialog");
  213.         var i = (l = e.split("\n"))[0].split(" ")[0];
  214.         this.talkerid = t, this.runTalk(i)
  215.     }, this.addTalk = function(t, e) {
  216.         l = e.split("\n"), this.runTalk(t)
  217.     };
  218.     var u = function(t) {
  219.         return "." != t.charAt(t.length - 1) ? t + "." : t
  220.     };
  221.     this.runTalk = function(t) {
  222.         if ("END" != (t = t.toString())) {
  223.             t = u(t);
  224.             for (var e = 0; u(l[e].split(" ")[0]) != t;)
  225.                 if (++e >= l.length) return void this.endTalk();
  226.             var i = document.getElementById("dialog"),
  227.                 o = l[e].split("->");
  228.             if (o[0] = o[0].substr(t.length), 2 == o.length) {
  229.                 var a = "<B class=title>" + this.talker + ":</B>" + o[0] + "<DIV class=dbut onclick=";
  230.                 0 <= o[1].indexOf("END") ? a += '"hero.endTalk();">koniec</DIV>' : (o[1] = "'lp=" + parseInt(o[1]) + "&zkim=" + this.talkerid + "'", a += "\"dbget('dialog'," + o[1] + ')">dalej</DIV>'), i.innerHTML = a
  231.             } else {
  232.                 a = "";
  233.                 for (var n = 1; e + n < l.length && 0 <= l[e + n].split(" ")[0].indexOf(t);) {
  234.                     var s = l[e + n].split("->");
  235.                     s[0] = s[0].substr(s[0].indexOf(" ")), s[1] = "'lp=" + parseInt(s[1]) + "&zkim=" + this.talkerid + "'", a += "<DIV class=dbut onclick=\"dbget('dialog'," + s[1], a += ')">' + s[0] + "</DIV>", n++
  236.                 }
  237.                 i.innerHTML = "<B class=title>" + this.talker + ":</B>" + o[0] + a
  238.             }
  239.         } else this.endTalk()
  240.     }, this.endTalk = function(t, e) {
  241.         hide("dialog", !0)
  242.     }, this.countDazed = function() {
  243.         if (60 < this.dazedleft) var t = Math.round(this.dazedleft / 60) + " minut";
  244.         else t = this.dazedleft + " sekund";
  245.         document.getElementById("dazedleft").innerHTML = t, 1 < this.dazedleft ? setTimeout("hero.countDazed()", 1e3) : (hide("dazed", !0), this.dazed = !1)
  246.     }, this.checkReqs = function(t) {
  247.         function e(t, e, i) {
  248.             return req = t.split("<B class=att>" + e), 1 < req.length && (r2 = req[1].split("</B>"), 1 < r2.length && parseInt(r2[0]) > i && (t = req.join("<B class=att2>" + e))), t
  249.         }
  250.         var i, o;
  251.         return t = e(t = e(t = e(t = e(t, "Wymagana siła: ", this.bstr), "Wymagany intelekt: ", this.bint), "Wymagana zręczność: ", this.bagi), "Wymagany poziom: ", this.lvl), i = t, o = "Wymagana profesja", req = i.split("<B class=att>" + o), 1 < req.length && (r2 = req[1].split("</B>"), 1 < r2.length && r2[0].indexOf(hero.prof) < 0 && (i = req.join("<B class=att2>" + o))), t = i
  252.     }, this.setMousePos = function(t, e) {
  253.         this.mx = Math.round(map.left() + Math.ceil(t / 32) - 1), this.my = Math.round(map.top() + Math.ceil(e / 32) - 1)
  254.     }, this.resetMouse = function() {
  255.         this.mx = -1, this.my = -1, global.movebymouse = !1
  256.     }
  257. }
  258.  
  259. function stack() {
  260.     this.data = new Array, this.begin = 0, this.end = 0, this.nullvalue = "", arguments[0] ? this.limit = arguments[0] : this.limit = !1
  261. }
  262.  
  263. function tips(t) {
  264.     this.onscreen = !1, this.uid = t, this.on = !1, this.marginleft = 10, this.margintop = 10
  265. }
  266.  
  267. function advAJAX() {
  268.     var _1 = new Object;
  269.     return _1.url = window.location.href, _1.method = "GET", _1.async = !0, _1.mimeType = "text/xml", _1.username = null, _1.password = null, _1.parameters = new Object, _1.headers = new Object, _1.form = null, _1.disableForm = !0, _1.unique = !0, _1.uniqueParameter = "a", _1.requestDone = !1, _1.queryString = "", _1.responseText = null, _1.responseXML = null, _1.status = null, _1.statusText = null, _1.aborted = !1, _1.timeout = 0, _1.retryCount = 0, _1.retryDelay = 1e3, _1.tag = null, _1.group = null, _1.xmlHttpRequest = null, _1.onInitialization = null, _1.onFinalization = null, _1.onLoading = null, _1.onLoaded = null, _1.onInteractive = null, _1.onComplete = null, _1.onSuccess = null, _1.onFatalError = null, _1.onError = null, _1.onTimeout = null, _1.onRetryDelay = null, _1.onRetry = null, _1.onGroupEnter = null, _1.onGroupLeave = null, _1.createXmlHttpRequest = function() {
  270.         if ("undefined" != typeof XMLHttpRequest) return new XMLHttpRequest;
  271.         try {
  272.             return new ActiveXObject("Msxml2.XMLHTTP")
  273.         } catch (t) {
  274.             try {
  275.                 return new ActiveXObject("Microsoft.XMLHTTP")
  276.             } catch (t) {
  277.                 return "function" == typeof _1.onFatalError && _1.onFatalError(t), null
  278.             }
  279.             "function" == typeof _1.onFatalError && _1.onFatalError(t)
  280.         }
  281.         return null
  282.     }, _1._onInitializationHandled = !1, _1._initObject = function() {
  283.         if (null != _1.xmlHttpRequest && (delete _1.xmlHttpRequest.onreadystatechange, _1.xmlHttpRequest = null), null == (_1.xmlHttpRequest = _1.createXmlHttpRequest())) return "function" == typeof _1.onFatalError && _1.onFatalError(null), null;
  284.         void 0 !== _1.xmlHttpRequest.overrideMimeType && _1.xmlHttpRequest.overrideMimeType(_1.mimeType), _1.xmlHttpRequest.onreadystatechange = function() {
  285.             if (null != _1 && null != _1.xmlHttpRequest) switch (_1.xmlHttpRequest.readyState) {
  286.                 case 1:
  287.                     _1._onLoading(_1);
  288.                     break;
  289.                 case 2:
  290.                     _1._onLoaded(_1);
  291.                     break;
  292.                 case 3:
  293.                     _1._onInteractive(_1);
  294.                     break;
  295.                 case 4:
  296.                     _1._onComplete(_1)
  297.             }
  298.         }, _1._onLoadingHandled = !1, _1._onLoadedHandled = !1, _1._onInteractiveHandled = !1, _1._onCompleteHandled = !1
  299.     }, _1._onLoading = function() {
  300.         _1._onLoadingHandled || (_1._retry || null == _1.group || (void 0 === advAJAX._groupData[_1.group] && (advAJAX._groupData[_1.group] = 0), advAJAX._groupData[_1.group]++, "function" == typeof _1.onGroupEnter && 1 == advAJAX._groupData[_1.group] && _1.onGroupEnter(_1)), "function" == typeof _1.onLoading && _1.onLoading(_1), _1._onLoadingHandled = !0)
  301.     }, _1._onLoaded = function() {
  302.         _1._onLoadedHandled || ("function" == typeof _1.onLoaded && _1.onLoaded(_1), _1._onLoadedHandled = !0)
  303.     }, _1._onInteractive = function() {
  304.         _1._onInteractiveHandled || ("function" == typeof _1.onInteractive && _1.onInteractive(_1), _1._onInteractiveHandled = !0)
  305.     }, _1._onComplete = function() {
  306.         if (!_1._onCompleteHandled && !_1.aborted) {
  307.             with(_1.requestDone = !0, _1.xmlHttpRequest) _1.responseText = responseText, _1.responseXML = responseXML, "undefined" != typeof status && (_1.status = status), "undefined" != typeof statusText && (_1.statusText = statusText);
  308.             "function" == typeof _1.onComplete && _1.onComplete(_1), _1._onCompleteHandled = !0, 200 == _1.status && "function" == typeof _1.onSuccess ? _1.onSuccess(_1) : "function" == typeof _1.onError && _1.onError(_1), delete _1.xmlHttpRequest.onreadystatechange, _1.xmlHttpRequest = null, _1.disableForm && _1.switchForm(!0), _1._groupLeave(), "function" == typeof _1.onFinalization && _1.onFinalization(_1)
  309.         }
  310.     }, _1._groupLeave = function() {
  311.         null != _1.group && (advAJAX._groupData[_1.group]--, "function" == typeof _1.onGroupLeave && 0 == advAJAX._groupData[_1.group] && _1.onGroupLeave(_1))
  312.     }, _1._retry = !1, _1._retryNo = 0, _1._onTimeout = function() {
  313.         if (null != _1 && null != _1.xmlHttpRequest && !_1._onCompleteHandled)
  314.             if (_1.aborted = !0, _1.xmlHttpRequest.abort(), "function" == typeof _1.onTimeout && _1.onTimeout(_1), _1._retry = !0, _1._retryNo != _1.retryCount) {
  315.                 if (_1._initObject(), 0 < _1.retryDelay)
  316.                     for ("function" == typeof _1.onRetryDelay && _1.onRetryDelay(_1), startTime = (new Date).getTime();
  317.                         (new Date).getTime() - startTime < _1.retryDelay;);
  318.                 _1._retryNo++, "function" == typeof _1.onRetry && _1.onRetry(_1, _1._retryNo), _1.run()
  319.             } else delete _1.xmlHttpRequest.onreadystatechange, _1.xmlHttpRequest = null, _1.disableForm && _1.switchForm(!0), _1._groupLeave(), "function" == typeof _1.onFinalization && _1.onFinalization(_1)
  320.     }, _1.run = function() {
  321.         if (_1._initObject(), null == _1.xmlHttpRequest) return !1;
  322.         if (_1.aborted = !1, "GET" == _1.method && _1.unique && (_1.parameters[encodeURIComponent(_1.uniqueParameter)] = (new Date).getTime().toString().substr(5) + Math.floor(100 * Math.random()).toString()), !_1._retry) {
  323.             for (var t in _1.parameters) 0 < _1.queryString.length && (_1.queryString += "&"), _1.queryString += encodeURIComponent(t) + "=" + encodeURIComponent(_1.parameters[t]);
  324.             "GET" == _1.method && 0 < _1.queryString.length && (_1.url += (-1 != _1.url.indexOf("?") ? "&" : "?") + _1.queryString)
  325.         }
  326.         "function" != typeof _1.onInitialization || _1._onInitializationHandled || (_1.onInitialization(_1), _1._onInitializationHandled = !0), _1.disableForm && _1.switchForm(!1);
  327.         try {
  328.             _1.xmlHttpRequest.open(_1.method, _1.url, _1.async, _1.username, _1.password)
  329.         } catch (t) {
  330.             return void("function" == typeof _1.onFatalError && _1.onFatalError(t))
  331.         }
  332.         if (0 < _1.timeout && setTimeout(_1._onTimeout, _1.timeout), void 0 !== _1.xmlHttpRequest.setRequestHeader)
  333.             for (var t in _1.headers) _1.xmlHttpRequest.setRequestHeader(encodeURIComponent(t), encodeURIComponent(_1.headers[t]));
  334.         "POST" == _1.method && void 0 !== _1.xmlHttpRequest.setRequestHeader ? (_1.xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), _1.xmlHttpRequest.send(_1.queryString)) : "GET" == _1.method && _1.xmlHttpRequest.send(null)
  335.     }, _1.handleArguments = function(t) {
  336.         for (a in "object" == typeof t.form && null != t.form && (_1.form = t.form, _1.appendForm()), t)
  337.             if (void 0 === _1[a]) _1.parameters[a] = t[a];
  338.             else if ("parameters" != a && "headers" != a) _1[a] = t[a];
  339.         else
  340.             for (b in t[a]) _1[a][b] = t[a][b];
  341.         _1.method = _1.method.toUpperCase()
  342.     }, _1.switchForm = function(_4) {
  343.         if ("object" == typeof _1.form && null != _1.form) with(_1.form) for (var nr = 0; nr < elements.length; nr++) _4 ? void 0 === elements[nr].advajax_disabled && elements[nr].removeAttribute("disabled") : elements[nr].disabled ? elements[nr].advajax_disabled = !0 : elements[nr].disabled = "disabled"
  344.     }, _1.appendForm = function() {
  345.         with(_1.form) {
  346.             _1.method = method.toUpperCase(), _1.url = action;
  347.             for (var nr = 0; nr < elements.length; nr++) {
  348.                 var e = elements[nr];
  349.                 if (!e.disabled) switch (e.type) {
  350.                     case "text":
  351.                     case "password":
  352.                     case "hidden":
  353.                     case "textarea":
  354.                         _1.addParameter(e.name, e.value);
  355.                         break;
  356.                     case "select-one":
  357.                         0 <= e.selectedIndex && _1.addParameter(e.name, e.options[e.selectedIndex].value);
  358.                         break;
  359.                     case "select-multiple":
  360.                         for (var _7 = 0; _7 < e.options.length; _7++) e.options[_7].selected && _1.addParameter(e.name, e.options[_7].value);
  361.                         break;
  362.                     case "checkbox":
  363.                     case "radio":
  364.                         e.checked && _1.addParameter(e.name, e.value)
  365.                 }
  366.             }
  367.         }
  368.     }, _1.addParameter = function(t, e) {
  369.         _1.parameters[t] = e
  370.     }, _1.delParameter = function(t) {
  371.         delete _1.parameters[t]
  372.     }, void 0 !== advAJAX._defaultParameters && _1.handleArguments(advAJAX._defaultParameters), _1
  373. }
  374.  
  375. function lead0(t) {
  376.     return t.toString().length < 2 ? "0" + t : t
  377. }
  378.  
  379. function timeNow() {
  380.     var t = new Date;
  381.     return lead0(t.getHours()) + ":" + lead0(t.getMinutes()) + ":" + lead0(t.getSeconds())
  382. }
  383.  
  384. function log() {
  385.     var t = "",
  386.         e = "[" + timeNow() + "] ",
  387.         i = !1;
  388.     if (1 < arguments.length) switch (parseInt(arguments[1])) {
  389.         case 1:
  390.             t = e + "Warning: ";
  391.             break;
  392.         case 2:
  393.             t = e + "Error: ";
  394.             break;
  395.         case 3:
  396.             i = !0, t = e + "Fatal error: ";
  397.             break;
  398.         default:
  399.             t = e + "Unknow: "
  400.     }
  401.     document.getElementById("consoleTxt").innerHTML += "<DIV" + (1 < arguments.length ? " class=loglvl_" + arguments[1] : "") + ">" + t + arguments[0] + (i ? "<br>----------------------------<br>Jeśli nie możesz sobie poradzić z tym błędem czytaj FAQ.<br>----------------------------" : "") + "</DIV>";
  402.     var o = document.getElementById("con1");
  403.     o.scrollTop = o.scrollHeight
  404. }
  405.  
  406. function consoleParse(cmd) {
  407.     switch (cmd = cmd.split(" "), cmd[0]) {
  408.         case "help":
  409.             log("Available commands: about, cls, cuser, debug, delete, dump, dup, equip, eval, glock, help, hide, locate, online, noclip, quests, send, show, teleport, ver");
  410.             break;
  411.         case "ver":
  412.             log("Margonem MMORPG ver 1.0");
  413.             break;
  414.         case "about":
  415.             log("Margonem MMORPG (c) by Thinker 2005-2008 [www.margonem.pl, oanemizguel@gmail.com]");
  416.             break;
  417.         case "cls":
  418.             document.getElementById("consoleTxt").innerHTML = "";
  419.             break;
  420.         case "cuser":
  421.             log("UserID: " + hero.pid + ", hash: " + hero.hash);
  422.             break;
  423.         case "send":
  424.             dbget(cmd[1]);
  425.             break;
  426.         case "loc":
  427.         case "locate":
  428.             dbget("locate", "who=" + cmd[1]);
  429.             break;
  430.         case "nloc":
  431.         case "nlocate":
  432.             dbget("nlocate", "who=" + cmd[1]);
  433.             break;
  434.         case "kick":
  435.             dbget("kick", "who=" + cmd[1]);
  436.             break;
  437.         case "delete":
  438.             dbget("idel", "iname=" + cmd[1]);
  439.             break;
  440.         case "tp":
  441.         case "teleport":
  442.             dbget("teleport", "nloc=" + cmd[1]);
  443.             break;
  444.         case "eval":
  445.             eval(cmd.join(" ").slice(5));
  446.             break;
  447.         case "dump":
  448.             log("Dumping variable " + cmd[1] + "<BR>" + dump(eval(cmd[1])));
  449.             break;
  450.         case "show":
  451.             show(cmd[1], !1);
  452.             break;
  453.         case "hide":
  454.             hide(cmd[1], !1);
  455.             break;
  456.         case "glock":
  457.             dbget("glock");
  458.             break;
  459.         case "debug":
  460.             "on" == cmd[1] ? global.debug = !0 : global.debug = !1;
  461.             break;
  462.         case "dup":
  463.             dbget("moveitem", "stan=-3&iid=" + cmd[1]);
  464.             break;
  465.         case "equip":
  466.             el.list("equip");
  467.             break;
  468.         case "online":
  469.             dbget("online");
  470.             break;
  471.         case "noclip":
  472.             global.gm ? hero.cmap = "" : log("Go away bastard!", 2);
  473.             break;
  474.         case "quests":
  475.             dbget("getquests", "completed=1");
  476.             break;
  477.         case "":
  478.             break;
  479.         default:
  480.             log("Unknow command '" + cmd + "'", 2)
  481.     }
  482. }
  483.  
  484. function onConsoleWrite(t) {
  485.     if (!t) t = window.event;
  486.     if (13 == t.keyCode) {
  487.         var e = document.getElementById("consoleIn");
  488.         consoleParse(e.value), e.value = ""
  489.     }
  490. }
  491.  
  492. function dump(t, e) {
  493.     var i = "";
  494.     if (e || (e = 0), 3 < e) return "";
  495.     for (var o = "", a = 0; a < e + 1; a++) o += "&nbsp;&nbsp;";
  496.     if ("object" == typeof t)
  497.         for (var n in t) {
  498.             var s = t[n];
  499.             "object" == typeof s ? (i += o + "'" + n + "' :<BR>", i += dump(s, e + 1)) : i += o + "'" + n + "' => \"" + s + '"<BR>'
  500.         } else i = "===>" + t + "<===(" + typeof t + ")";
  501.     return i
  502. }
  503.  
  504. function setCookie(t, e, i, o, a, n) {
  505.     var s = t + "=" + escape(e) + (i ? "; expires=" + i.toGMTString() : "") + (o ? "; path=" + o : "") + (a ? "; domain=" + a : "") + (n ? "; secure" : "");
  506.     document.cookie = s
  507. }
  508.  
  509. function getCookie(t) {
  510.     var e = document.cookie,
  511.         i = t + "=",
  512.         o = e.indexOf("; " + i);
  513.     if (-1 == o) {
  514.         if (0 != (o = e.indexOf(i))) return null
  515.     } else o += 2;
  516.     var a = document.cookie.indexOf(";", o);
  517.     return -1 == a && (a = e.length), unescape(e.substring(o + i.length, a))
  518. }
  519.  
  520. function deleteCookie(t, e, i) {
  521.     getCookie(t) && (document.cookie = t + "=" + (e ? "; path=" + e : "") + (i ? "; domain=" + i : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT")
  522. }
  523.  
  524. function addEvent(t, e, i) {
  525.     t.attachEvent ? t.attachEvent("on" + e, i) : t.addEventListener && t.addEventListener(e, i, !1)
  526. }
  527.  
  528. function delEvent(t, e, i) {
  529.     t.detachEvent ? t.detachEvent("on" + e, i) : t.removeEventListener && t.removeEventListener(e, i, !1)
  530. }
  531.  
  532. function elements() {
  533.     this.eList = new Array
  534. }
  535.  
  536. function eBase() {}
  537.  
  538. function eOther(t) {
  539.     this.init(t, global.path.characters), this.rx = this.x, this.ry = this.y, this.rz = 0, this.step = 0, this.nosize = !0, this.framew = 32, this.frameh = 48
  540. }
  541.  
  542. function eNPC(t) {
  543.     this.init(t, global.path.npc), 0 < this.questmark && (this.quid = ol.assign("http://oldmargonem.pl/obrazki/inne/quest_mark.gif", !0))
  544. }
  545.  
  546. function eTroop(t) {
  547.     for (var e in t = t.split(";")) {
  548.         t[e] = t[e].split("=");
  549.         var i = t[e][0];
  550.         t[e][0] = "", this[i] = t[e].join("=").slice(1)
  551.     }
  552.     this.isnpc = this.id < 0 ? 1 : 0, this.isnpc ? path = global.path.npc + "/" : path = global.path.characters, this.icon = path + this.icon, ol.oRoot = "battleplace", this.nosize = !0, this.framew = 32, this.frameh = 48, 0 < global.battle.posx[this.posy] ? (this.posx = global.battle.posx[this.posy], global.battle.posx[this.posy]++, global.battle.width[this.posy][this.posx] = this.framew) : (this.posx = 0, global.battle.posx[this.posy] = 1, global.battle.width[this.posy] = new Array, global.battle.width[this.posy][0] = this.framew), this.uid = ol.assign(this.icon, 1 == this.isnpc);
  553.     var o = document.getElementById(this.uid);
  554.     this.id == hero.pid && (global.battle.myteam = this.team), 0 == global.battle.selected && this.team != global.battle.myteam && (global.battle.selected = this.id), this.id != global.battle.selected ? o.style.border = "none" : document.getElementById(this.uid).style.border = "1px solid " + (this.team == global.battle.myteam ? "yellow" : "red"), addEvent(o, "click", function(t) {
  555.         if (!t) t = window.event;
  556.         el.lookfor(t, "onclick")
  557.     }), addEvent(o, "mouseover", function(t) {
  558.         if (!t) t = window.event;
  559.         el.lookfor(t, "onover")
  560.     }), addEvent(o, "mouseout", function(t) {
  561.         if (!t) t = window.event;
  562.         el.lookfor(t, "onout")
  563.     }), addEvent(o, "mousemove", function(t) {
  564.         if (!t) t = window.event;
  565.         el.lookfor(t, "onmove")
  566.     })
  567. }
  568.  
  569. function eItem(t) {
  570.     this.init(t, global.path.items), this.stats = hero.checkReqs(this.stats)
  571. }
  572.  
  573. function initEqGlobals() {
  574.     e1 = new Object, e1.x = document.getElementById("equip").offsetLeft, e1.y = document.getElementById("equip").offsetTop, e1.w = document.getElementById("equip").offsetWidth, e1.h = document.getElementById("equip").offsetHeight, e1.posx = new Array(37, 0, 37, 74, 0, 37, 74, 37, 0), e1.posy = new Array(0, 35, 35, 35, 71, 71, 71, 106, 106), b1 = new Object, b1.x = 535, b1.y = 270, b1.w = 225, b1.h = 233, s1 = new Object, s1.x = 130, s1.y = 75, s1.w = 260, s1.h = 384, t1 = new Object, t1.x = 312, t1.y = 0, t1.w = 200, t1.h = 260, t2 = new Object, t2.x = 413, t2.y = 63, t2.w = 97, t2.h = 33
  575. }
  576.  
  577. function blinkDrop(t, e) {
  578.     document.getElementById(e).style.backgroundColor = 1 & t ? "transparent" : "#fc0", --t && setTimeout("blinkDrop(" + t + ',"' + e + '")', 500)
  579. }
  580.  
  581. function eEquip(t) {
  582.     for (var e in t = t.split(";")) {
  583.         t[e] = t[e].split("=");
  584.         var i = t[e][0];
  585.         t[e][0] = "", this[i] = t[e].join("=").slice(1)
  586.     }
  587.     0 < this.state && this.state < 20 ? ol.oRoot = "equip" : ol.oRoot = "bag", this.icon = global.path.items + this.icon, this.uid = ol.assign(this.icon, !1);
  588.     var o = document.getElementById(this.uid);
  589.     o.className = "cequip", this.bag = -1, 20 <= this.state ? (this.orgx = 33 * (this.state - 20), this.orgy = 201, o.style.top = this.orgy + "px", o.style.left = this.orgx + "px", this.ox = b1.x, this.oy = b1.y, this.inbag = !0) : 0 < this.state ? (this.orgy = e1.posy[this.state - 1], this.orgx = e1.posx[this.state - 1], o.style.top = this.orgy + "px", o.style.left = this.orgx + "px", this.ox = e1.x, this.oy = e1.y, this.inbag = !1, 9 == this.state && this.id != global.lastdrop && (blinkDrop(6, this.uid), global.lastdrop = this.id)) : (this.orgx = 33 * this.x, this.bag = Math.floor(this.y / 6), this.orgy = this.y % 6 * 33, global.bag != this.bag ? o.style.display = "none" : o.style.display = "block", o.style.top = this.orgy + "px", o.style.left = this.orgx + "px", this.ox = b1.x, this.oy = b1.y, this.inbag = !0), this.drag = !1, this.heal = 0 <= this.stats.indexOf("Leczy"), 0 <= this.stats.indexOf("Strzał:") ? (s = this.stats.split("Strzał: "), strz = parseInt(s[1]), strz < 51 ? o.style.backgroundColor = "#a00" : o.style.backgroundColor = "transparent") : 0 <= this.stats.indexOf("<b class=expires>") ? o.style.backgroundColor = "#da0" : o.style.backgroundColor = "transparent", this.stats = hero.checkReqs(this.stats), addEvent(o, "click", function(t) {
  590.         if (!t) t = window.event;
  591.         el.lookfor(t, "onclick")
  592.     }), addEvent(o, "mouseover", function(t) {
  593.         if (!t) t = window.event;
  594.         el.lookfor(t, "onover")
  595.     }), addEvent(o, "mouseout", function(t) {
  596.         if (!t) t = window.event;
  597.         el.lookfor(t, "onout")
  598.     }), addEvent(o, "mousedown", function(t) {
  599.         if (!t) t = window.event;
  600.         el.lookfor(t, "ondown")
  601.     })
  602. }
  603.  
  604. function eTrade(t) {
  605.     for (var e in t = t.split(";")) {
  606.         t[e] = t[e].split("=");
  607.         var i = t[e][0];
  608.         t[e][0] = "", this[i] = t[e].join("=").slice(1)
  609.     }
  610.     2 < this.x ? this.y2 = t2.y + 51 : this.y2 = t2.y, hero.pid == this.y ? (this.x2 = 102, this.drag = !0) : (this.x2 = 2, this.drag = !1), this.icon = global.path.items + this.icon, this.uid = ol.assign(this.icon, !1);
  611.     var o = document.getElementById(this.uid);
  612.     o.className = "cequip", this.stats = hero.checkReqs(this.stats), this.ox = 0, this.oy = 0, this.orgx = 312 + this.x2 + 32 * (2 < this.x ? 1 : this.x), this.orgy = this.y2, o.style.top = this.orgy + "px", o.style.left = this.orgx + "px", o.style.zIndex = 306, this.inbag = !0, addEvent(o, "click", function(t) {
  613.         if (!t) t = window.event;
  614.         el.lookfor(t, "onclick")
  615.     }), addEvent(o, "mouseover", function(t) {
  616.         if (!t) t = window.event;
  617.         el.lookfor(t, "onover")
  618.     }), addEvent(o, "mouseout", function(t) {
  619.         if (!t) t = window.event;
  620.         el.lookfor(t, "onout")
  621.     }), addEvent(o, "mousedown", function(t) {
  622.         if (!t) t = window.event;
  623.         el.lookfor(t, "ondown")
  624.     })
  625. }
  626.  
  627. function eGateway(t) {
  628.     this.icon = global.path.wwwserver + "/obrazki/inne/exit.png", this.init(t), this.name = global.towns[parseInt(this.id)];
  629.     var e = document.getElementById(this.uid);
  630.     ie6 && (e.style.background = "", e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.icon + "', sizingMethod='scale')"), e.style.height = "32px", e.style.zIndex = 1
  631. }
  632.  
  633. function eShop(t) {
  634.     for (var e in t = t.split(";")) {
  635.         t[e] = t[e].split("=");
  636.         var i = t[e][0];
  637.         t[e][0] = "", this[i] = t[e].join("=").slice(1), this[t[e][0]] = t[e][1]
  638.     }
  639.     this.icon = global.path.items + this.icon, ol.oRoot = "shopin", this.uid = ol.assign(this.icon, !1);
  640.     var o = document.getElementById(this.uid);
  641.     o.className = "cequip", this.orgx = (ie6 ? 0 : 7) + 32 * this.x, this.orgy = (ie6 ? 0 : 7) + 32 * this.y, o.style.top = this.orgy + "px", o.style.left = this.orgx + "px", this.ox = s1.x, this.oy = s1.y, this.drag = !1, this.stats = hero.checkReqs(this.stats), addEvent(o, "click", function(t) {
  642.         if (!t) t = window.event;
  643.         el.lookfor(t, "onclick")
  644.     }), addEvent(o, "mouseover", function(t) {
  645.         if (!t) t = window.event;
  646.         el.lookfor(t, "onover")
  647.     }), addEvent(o, "mouseout", function(t) {
  648.         if (!t) t = window.event;
  649.         el.lookfor(t, "onout")
  650.     }), addEvent(o, "mousedown", function(t) {
  651.         if (!t) t = window.event;
  652.         el.lookfor(t, "ondown")
  653.     })
  654. }
  655.  
  656. function init() {
  657.     log("Engine started."), k_add(KTILDE, 37, 39, 38, 40, 81, 106, 13, 90), alts[1] = 65, alts[2] = 68, alts[3] = 87, alts[4] = 83, global = new Object, global.console = new Object, global.console.keylog = !1, global.towns = new Array, global.initlvl = 1, global.path = new Object, global.path.server = "http://oldmargonem.pl", global.path.wwwserver = "http://oldmargonem.pl", global.serverno = 1, window.location.href.indexOf("http://game.") < 0 && window.location.href.indexOf("http://dev.") < 0 ? (tmp = window.location.href.split("."), www = tmp[0], t2 = window.location.href.split("."), t3 = t2[0].split("game"), global.serverno = t3[1]) : www = "http://www", global.path.characters = www + ".oldmargonem.pl/obrazki/postacie", global.path.npc = www + ".oldmargonem.pl/obrazki/npc", global.path.items = www + ".oldmargonem.pl/obrazki/itemy", global.path.maps = "/obrazki/miasta", global.ajax = new Object, global.ajax.busy = !1, global.ajax.queue = new stack(3), global.ajax.t0 = 0, global.ping = !1, global.msg = new stack, global.refresh = 0, global.dontmove = !1, global.movebymouse = !1, global.chatFocus = !1, global.chatFocus2 = !1, global.chatIdx = 0, global.clChatIdx = 0, global.chreply = "", global.chatBan = 0, global.eventseq = 0, global.drag = !1, global.debug = !1, global.battle = new Object, global.battle.now = !1, global.battle.id = 0, global.battle.agrnow = !1, global.battle.places = new Array, global.battle.selected = 0, global.battle.seq = 0, global.battle.posx = new Array, global.battle.width = new Array, global.lastchat = "", global.clans = new Array, global.trader = 0, global.bag = 0, global.bagon = !1, global.attitem = 0, global.confirmdel = !1, global.r = new Object, global.r.closebattle = -38, global.r.pvpbutton = -44, global.r.eqbutton = 0, global.rpg = !1, global.pvp = !1, global.gm = !1, global.lastdrop = 0, global.myau = !0, global.aulv1 = 0, global.aulv2 = 0, global.aup1 = 0, global.aup2 = 0, global.atype = 0, global.auname = "", global.sakwa = 0, global.logoff = 0, initEqGlobals(), il = new ImageLoader, setih("objects", ""), setih("chatTxt", ""), hide("menu", !0), ol = new ObjectLoader, el = new elements, map = new theMap, hero = new player(1), tip = new tips("oTip"), document.getElementById("consoleIn").onkeyup = onConsoleWrite, document.getElementById("chatIn").onkeyup = onChatWrite, document.getElementById("tradegold").onkeyup = onGoldWrite, window.focus();
  658.     var t = navigator.userAgent.toLowerCase();
  659.     ie6 = -1 != t.indexOf("msie 6."), -1 < navigator.userAgent.indexOf("Opera") && (log("Opera detected. It is NOT supported browser.", 1), ie6 = !1), ie6 && (ge("menu").style.background = "", ge("dialog").style.background = "", ge("mailnotifier").style.background = ""), setTimeout("dbget('init','initlvl=1&build=1007')", 500), document.onmousemove = mousemove, document.onclick = mouseclick, document.onmouseup = mouseup, document.onmousedown = mousedown, document.onmouseover = mouseover, document.onmouseout = mouseout, log("init() complete"), log(navigator.userAgent), hide("bagback", !1), addEvent(document.getElementById("lagometer"), "mouseover", function(t) {
  660.         if (!t) t = window.event;
  661.         global.ping = !0, tip.show(t.clientX, t.clientY, "", "<B>Ping:</B>" + global.ajax.t1 + "ms")
  662.     }), addEvent(document.getElementById("lagometer"), "mouseout", function(t) {
  663.         tip.hide(), global.ping = !1
  664.     }), addEvent(document.getElementById("eqbutton"), "click", togglechat)
  665. }
  666.  
  667. function togglechat(t) {
  668.     global.bagon ? (show("chat", !1), show("chatIn", !1), hide("bag", !1), hide("bagback", !1), global.r.eqbutton = 0, k[5] ? document.getElementById("eqbutton").style.backgroundPosition = "0 -0px" : document.getElementById("eqbutton").style.backgroundPosition = "0 -20px", global.bagon = !1) : (hide("chat", !1), hide("chatIn", !1), show("bag", !1), show("bagback", !1), global.r.eqbutton = -40, k[5] ? document.getElementById("eqbutton").style.backgroundPosition = "0 -40px" : document.getElementById("eqbutton").style.backgroundPosition = "0 -60px", global.bagon = !0)
  669. }
  670.  
  671. function iefix() {
  672.     document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule && ie6 && (document.styleSheets[0].addRule("IMG.fixit", "behavior: url(iepngfix.htc)"), log("IE6 PNG fix loaded"))
  673. }
  674.  
  675. function loaderror(t, e, i) {
  676.     document.getElementById("loading").innerHTML = "<span>Wystąpił błąd podczas ładowania gry</span>", log(navigator.userAgent), log("'" + t + "' in " + e + " at line: " + i, 3), document.getElementById("console").style.display = "block"
  677. }
  678.  
  679. function mousemove(t) {
  680.     if (!t) t = window.event;
  681.     if (tip.on && tip.move(t.clientX, t.clientY), global.logoff = 0, global.drag) {
  682.         var e = global.drag,
  683.             i = document.getElementById("oDrag");
  684.         return i.style.left = e.ox + e.orgx - (e.x - t.clientX) + "px", i.style.top = e.oy + e.orgy - (e.y - t.clientY) + "px", !1
  685.     }
  686.     global.movebymouse && hero.setMousePos(t.clientX, t.clientY)
  687. }
  688.  
  689. function mouseup(t) {
  690.     if (!t) t = window.event;
  691.     global.drag && global.drag.onup(t), global.movebymouse = !1
  692. }
  693.  
  694. function mousedown(t) {
  695.     if (!t) t = window.event;
  696.     if (t.target ? targ = t.target : t.srcElement && (targ = t.srcElement), 64 & hero.opt || global.battle.now || "oMap" != targ.id && "cItem" != targ.className || (hero.setMousePos(t.clientX, t.clientY), global.movebymouse = !0), "IMAGE" == targ.tagName) return !1
  697. }
  698.  
  699. function mouseclick(t) {
  700.     if (!t) t = window.event;
  701.     if (t.target ? targ = t.target : t.srcElement && (targ = t.srcElement), 3 == targ.id.length && "rr" == targ.id.substr(0, 2)) {
  702.         var e = document.getElementById("oldrid").value;
  703.         if ("rr1" != targ.id && 0 < e && e < 100) {
  704.             for (targ.innerHTML = "0" == targ.innerHTML ? "1" : "0", rr = 0, i = 1, b = 1; i < 8; i++, b <<= 1) parseInt(document.getElementById("rr" + i).innerHTML) & 0 < b && (rr += b);
  705.             document.getElementById("rankr").value = rr
  706.         }
  707.     }
  708. }
  709.  
  710. function mouseout(t) {
  711.     if (!t) t = window.event;
  712.     t.target ? targ = t.target : t.srcElement && (targ = t.srcElement), tip.on && tip.hide(), targ.getAttribute("rollover") && ((dy = global.r[targ.id]) ? targ.style.backgroundPosition = "0 " + dy + "px" : targ.style.backgroundPosition = "0 0")
  713. }
  714.  
  715. function mouseover(t) {
  716.     var e;
  717.     if (!t) t = window.event;
  718.     t.target ? e = t.target : t.srcElement && (e = t.srcElement), e.getAttribute("tip") && tip.show(t.clientX + document.body.scrollLeft, t.clientY + document.body.scrollTop, e.getAttribute("tipcl"), e.getAttribute("tip")), (dy = e.getAttribute("rollover")) && ((dy2 = global.r[e.id]) ? e.style.backgroundPosition = "0 " + (parseInt(dy2) - dy) + "px" : e.style.backgroundPosition = "0 -" + dy + "px")
  719. }
  720.  
  721. function error() {
  722.     alert(arguments[0])
  723. }
  724.  
  725. function message(t) {
  726.     global.msg.push(t), 1 == global.msg.size() && show("msg", !1), t = global.msg.data.join("<BR>"), document.getElementById("msg").innerHTML = t, setTimeout("delmsg()", 1e3 + 1e3 * global.msg.size())
  727. }
  728.  
  729. function delmsg() {
  730.     if (global.msg.pop(), global.msg.size() <= 0) hide("msg", !1);
  731.     else {
  732.         var t = global.msg.data.join("<BR>");
  733.         document.getElementById("msg").innerHTML = t
  734.     }
  735. }
  736.  
  737. function logout() {
  738.     setCookie("chash", "", 0, "/", "oldmargonem.pl"), setCookie("user_id", "", 0, "/", "oldmargonem.pl"), top.location.href = "http://www.oldmargonem.pl"
  739. }
  740.  
  741. function ge(t) {
  742.     return document.getElementById(t)
  743. }
  744.  
  745. function setih(t, e) {
  746.     document.getElementById(t).innerHTML = e
  747. }
  748.  
  749. function dbget() {
  750.     var t = arguments.length,
  751.         e = 0 < t ? arguments[0] : "",
  752.         i = 1 < t ? arguments[1] : "";
  753.     if (global.ajax.busy) "_" != e && "go" != e && global.ajax.queue.push(arguments);
  754.     else {
  755.         global.ajax.busy = !0, global.ajax.t0 = nowms();
  756.         var o = "init" == e ? 1e4 : 2e3;
  757.         advAJAX.get({
  758.             url: "db.php",
  759.             timeout: o,
  760.             queryString: i,
  761.             parameters: {
  762.                 task: e,
  763.                 pid: hero.pid,
  764.                 ev: global.eventseq,
  765.                 lastch: global.chatIdx,
  766.                 lastcch: global.clChatIdx,
  767.                 bseq: global.battle.seq,
  768.                 pdir: hero.kier
  769.             },
  770.             onError: function(t) {
  771.                 log("ajax: " + t.status, 2)
  772.             },
  773.             onFatalError: function(t) {
  774.                 log("ajax: " + t.status, 3)
  775.             },
  776.             onSuccess: function(t) {
  777.                 proceed(t.responseText)
  778.             },
  779.             onTimeout: function(t) {
  780.                 global.ajax.t1 = 9999
  781.             },
  782.             onFinalization: function(t) {
  783.                 global.ajax.busy = !1, global.ajax.t1 = nowms() - global.ajax.t0, global.ajax.t1 < 0 && (global.ajax.t1 += 6e4), global.ping && tip.update("<B>Ping:</B>" + global.ajax.t1 + "ms")
  784.             }
  785.         }), global.refresh = 0
  786.     }
  787. }
  788.  
  789. function forceget() {
  790.     var t = arguments.length,
  791.         e = 0 < t ? arguments[0] : "",
  792.         i = 1 < t ? arguments[1] : "";
  793.     advAJAX.get({
  794.         url: "db.php",
  795.         timeout: 2500,
  796.         queryString: i,
  797.         parameters: {
  798.             task: e,
  799.             pid: hero.pid,
  800.             ev: 99999999,
  801.             lastch: 99999999,
  802.             lastcch: 99999999
  803.         },
  804.         onError: function(t) {
  805.             log("ajax: " + t.status, 2)
  806.         },
  807.         onFatalError: function(t) {
  808.             log("ajax: " + t.status, 3)
  809.         },
  810.         onSuccess: function(t) {
  811.             proceed(t.responseText)
  812.         }
  813.     }), global.refresh = 0
  814. }
  815.  
  816. function advget(t, e) {
  817.     var o = arguments.length,
  818.         a = "";
  819.     for (i = 2; i < o; i++) a += "&" + arguments[i] + "=" + escape(document.getElementById(arguments[i]).value);
  820.     dbget(t, e + a), "clan" == t && tip.hide()
  821. }
  822.  
  823. function advgeti(t, e, i) {
  824.     dbget(t, e + "&" + i + "=" + escape(document.getElementById(i).innerHTML))
  825. }
  826.  
  827. function proceed(t) {
  828.     enstate = new Array("niedawno aktywny(a)", "był(a) kilka dni temu", "od dawna nieaktywny(a)"), enstcol = new Array("#6f6", "#888", "#000"), t = t.split("<eol>");
  829.     var e = "",
  830.         i = "",
  831.         o = !1,
  832.         a = !1;
  833.     for (key in t) {
  834.         var n = t[key].split(":"),
  835.             s = n[0];
  836.         switch (n = t[key].substr(s.length + 1), s) {
  837.             case "hero":
  838.                 hero.setup(n);
  839.                 break;
  840.             case "rpg":
  841.                 global.rpg = !0;
  842.                 break;
  843.             case "pvp":
  844.                 global.pvp = !0;
  845.                 break;
  846.             case "gm":
  847.                 global.gm = !0, show("constat");
  848.                 break;
  849.             case "move":
  850.                 hero.go(n.split(","));
  851.                 break;
  852.             case "xy":
  853.                 hero.synchMove(n);
  854.                 break;
  855.             case "collisions":
  856.                 hero.cmap = n;
  857.                 break;
  858.             case "stats":
  859.                 hero.stats(n);
  860.                 break;
  861.             case "dazed":
  862.                 if (hero.dazedleft = parseInt(n), hero.dazed) break;
  863.                 show("dazed", !0), hero.dazed = !0, hero.countDazed();
  864.                 break;
  865.             case "dontblock":
  866.                 global.battle.agrnow = !1, 0 < n && el.del(parseInt(n), "npc");
  867.                 break;
  868.             case "battleend":
  869.                 hide("battle", !0), global.battle.selected = 0, el.delall("troop"), global.battle.now = !1;
  870.                 break;
  871.             case "battlenow":
  872.                 global.battle.now && global.battle.id == n || (global.battle.seq = 0, global.battle.id = n, global.battle.agrnow = !1, document.getElementById("battlein").innerHTML = "", el.delall("troop"), show("battle", !0), dbget("fight", "action=refresh"), global.battle.now = !0, tip.hide());
  873.                 break;
  874.             case "battleref":
  875.                 el.delall("troop"), global.dontmove = !0, global.battle.posx = new Array, global.battle.width = new Array, document.getElementById("battleplace").style.backgroundImage = "url(http://oldmargonem.pl/obrazki/battle/" + n + ")";
  876.                 break;
  877.             case "battlemsg":
  878.                 var l;
  879.                 n = n.split(";;"), global.battle.seq = parseInt(n[0]), document.getElementById("battlein").innerHTML += "<P class=battr" + n[1] + ">" + n[2] + "</P>", (l = document.getElementById("battlein")).scrollTop = l.scrollHeight;
  880.                 break;
  881.             case "battleinfo":
  882.                 setih("battletime", n);
  883.                 break;
  884.             case "spells":
  885.                 if (sp = n.split(";"), (document.getElementById("spell").options.length = 0) < n.length)
  886.                     for (r = 0; r < sp.length; r++) ss = sp[r].split(","), document.getElementById("spell").options[r] = new Option(ss[1], "" + ss[0]);
  887.                 break;
  888.             case "othermove":
  889.                 for (var r in n = n.split(","), el.eList) "other" == el.eList[r].type && el.eList[r].id == n[0] && el.eList[r].handler(n[1]);
  890.                 break;
  891.             case "lastevent":
  892.                 global.eventseq = n;
  893.                 break;
  894.             case "cleareq":
  895.                 el.delall("equip");
  896.                 break;
  897.             case "element":
  898.                 el.add(n);
  899.                 break;
  900.             case "delete":
  901.                 n = n.split(","), el.del(n[0], n[1]);
  902.                 break;
  903.             case "newshop":
  904.                 el.delall("shop"), "" != (n = n.split(";"))[0] && " " != n[0] || (n[0] = "nic"), 0 == parseInt(n[2]) && (n[2] = "brak limitu"), "ph" == n[4] ? setih("shopinfo", "Sprzedaż za <b>Punkty Honoru</b>") : "sl" == n[4] ? setih("shopinfo", "Sprzedaż za <b>Smocze Łzy</b>") : setih("shopinfo", "<b>Ceny:</b> " + n[3] + "<br><b>Skupuje:</b> " + ("nic" == n[0] ? "nic" : n[0] + "<br><b>Płaci </b> " + n[1] + "% wartości,  <b>maksymalnie:</b> " + n[2]));
  905.                 break;
  906.             case "shop":
  907.                 show("shop", !0);
  908.                 break;
  909.             case "tradestart":
  910.                 show("trade", !0), global.trader = n;
  911.                 break;
  912.             case "tradeinit":
  913.                 if (0 == global.trader) break;
  914.                 n = n.split(","), o1 = 0, o2 = 0, hero.nick == n[0] ? o1 = 1 : o2 = 1, setih("tradername1", n[o1]), setih("tradername2", n[o2]), setih("gold1", n[4 + o1]), setih("gold2", n[4 + o2]), document.getElementById("tradeaccept1").style.backgroundPosition = parseInt(n[2 + o1]) ? "0 0" : "0 20px", document.getElementById("tradeaccept2").style.backgroundPosition = parseInt(n[2 + o2]) ? "0 20px" : "0 0", el.delall("trade");
  915.                 break;
  916.             case "tradeend":
  917.                 hide("trade", !0), el.delall("trade");
  918.                 break;
  919.             case "dialogi":
  920.                 n = n.split(","), hero.initTalk(n[0], n[1].split("~").join(","));
  921.                 break;
  922.             case "dialog":
  923.                 0 < n.indexOf("<sakwa>") && (global.sakwa = 30), n = n.split(","), hero.addTalk(n[0], n[1].split("~").join(","));
  924.                 break;
  925.             case "koniecdialogu":
  926.                 hero.endTalk();
  927.                 break;
  928.             case "maxchat":
  929.                 global.chatIdx = n;
  930.                 break;
  931.             case "maxcchat":
  932.                 global.clChatIdx = n;
  933.                 break;
  934.             case "chat":
  935.                 var d = new RegExp(hero.nick, "i");
  936.                 0 == (n = unescape(n)).indexOf("<span class=chpriv>") && 0 < n.indexOf("od: ") ? (v1 = n.split("» "), global.chreply = v1[0].substr(v1[0].indexOf("od: ") + 4).split(" ").join("_"), e = n + "<br>" + e) : e = 0 != n.indexOf("<span ") ? (n = n.replace(d, "<b class=yourname>" + hero.nick + "</b>")).replace(/«(.*?)»/, "<span style='color:#ff7'>«$1»</span>") + "<br>" + e : n + "<br>" + e, "none" == document.getElementById("chat").style.display && (global.r.eqbutton = -80, document.getElementById("eqbutton").style.backgroundPosition = "0 -80px");
  937.                 break;
  938.             case "town":
  939.                 o = !0, map.loadMap(n), map.center(hero.x, hero.y);
  940.                 break;
  941.             case "townname":
  942.                 n = n.split(";"), global.towns[parseInt(n[0])] = n[1];
  943.                 break;
  944.             case "createclan":
  945.                 setTimeout("createClan(" + n + ")", 30);
  946.                 break;
  947.             case "claninvite":
  948.                 setTimeout("inviteClan('" + n + "')", 30);
  949.                 break;
  950.             case "clan":
  951.                 document.getElementById("clancontent").innerHTML = n;
  952.                 break;
  953.             case "clanlogo":
  954.                 document.getElementById("clanlogo").style.backgroundImage = "url(" + n + ")";
  955.                 break;
  956.             case "clanname":
  957.                 n = n.split(","), global.clans[n[0]] = n[1];
  958.                 break;
  959.             case "friends":
  960.                 for (list = n.split(";"), fr = "", en = "", r = 0; r < list.length; r++)
  961.                     if (3 < list[r].length)
  962.                         if (x = list[r].split(","), "e" == x[0]) en += '<div class=frbox><div class=frchar style="background-image:url(' + global.path.characters + x[3] + ')"></div><div class=delen rollover=22 onclick=dbget("friends","proc=delen&id=' + x[4] + '")></div>' + x[1] + "(" + x[2] + ')<br><small style="color:' + enstcol[parseInt(x[5])] + '">(' + enstate[parseInt(x[5])] + ")</small></div>";
  963.                         else {
  964.                             var h = parseInt(x[5]),
  965.                                 c = parseInt(x[9]),
  966.                                 u = "#999";
  967.                             0 == h ? (frstate = "online", u = "#6f6") : 1 < h && c < 1 ? (frstate = "online, nieprzytomny", u = "#09f") : (frstate = "offline od ", frstate += c < 110 ? c + " min" : c < 1440 ? Math.round(c / 60) + " h" : Math.round(c / 1440) + " dni"), fr += '<div class=frbox><div class=frchar style="background-image:url(' + global.path.characters + x[3] + ')"></div><div class=delfr rollover=22 onclick=dbget("friends","proc=delfr&id=' + x[4] + '")></div><div class=chatfr rollover=22 onclick=\'chatfr("' + x[1] + "\")'></div><b>" + x[1] + "(" + x[2] + ')</b><br><small style="color:' + u + '">(' + frstate + ")</small><br><span class=frloc>" + x[6] + "(" + x[7] + "," + x[8] + ")</span></div>"
  968.                         } setih("myfriends", fr), setih("myenemies", en), ge("enname").value = "", show("friends", !(ge("frname").value = ""));
  969.                 break;
  970.             case "friendship":
  971.                 setTimeout("friendship('" + n + "')", 30);
  972.                 break;
  973.             case "refreshfriends":
  974.                 "block" == document.getElementById("friends").style.display && setTimeout("dbget('friends')", 30);
  975.                 break;
  976.             case "newmails":
  977.                 show("mails", !0), ge("inbox").innerHTML = "<br clear=all>", hero.mails = 0, hide("newmail", !1), global.attitem = 0, ge("attitem").innerHTML = "";
  978.                 break;
  979.             case "mail":
  980.                 m = n.split("||"), att = "", 0 < m[2] && (att += " Złoto: " + m[2]), 0 < m[3] && (att += " SŁ: " + m[3]), "" != m[4] && (att += m[4]), mail = "<div class=mail>", "" != att ? mail += '<div class=mailattdel rollover=22 tip="Pobierz i usuń" onclick=\'dbget("mails","proc=del&from=' + escape(m[1]) + "&ts=" + m[5] + '&bag="+global.bag)\'></div><div class=mailatt rollover=22 tip="Pobierz załącznik" onclick=\'dbget("mails","proc=get&from=' + escape(m[1]) + "&ts=" + m[5] + '&bag="+global.bag)\'></div><div class=mailrep rollover=22 tip="Odpowiedz" onclick=mailreply("' + escape(m[1]) + '")></div>Od: <b>' + m[1] + "</b> " + m[0] + "<br><b>Załączniki:</b>" + att : mail += '<div class=maildel rollover=22 tip="Usuń wiadomość" onclick=dbget("mails","proc=del&from=' + escape(m[1]) + "&ts=" + m[5] + '")></div><div class=mailrep rollover=22 tip="Odpowiedz" onclick=mailreply("' + escape(m[1]) + '")></div>Od: <b>' + m[1] + "</b> " + m[0], mail += "<br>" + m[6] + "</div>", i += mail;
  981.                 break;
  982.             case "sentdone":
  983.                 ge("mailmsg").value = "", ge("mailgold").value = "", ge("receiver").value = "", hide("newmail", !1), global.attitem = 0, ge("attitem").innerHTML = "", alert("Wiadomość wysłana.");
  984.                 break;
  985.             case "auctions":
  986.                 myauctions("");
  987.                 break;
  988.             case "aubrowse":
  989.                 aubrowse(n.split(",")), ge("ahpanel").scrollTop = 0;
  990.                 break;
  991.             case "auctionsend":
  992.                 myauctions("Aukcja wystawiona. Możesz wystawić następną.");
  993.                 break;
  994.             case "ahitem":
  995.                 ahitem(n.split("||"));
  996.                 break;
  997.             case "quests":
  998.                 document.getElementById("questsTxt").innerHTML = n;
  999.                 break;
  1000.             case "walka":
  1001.                 tip.on && tip.hide(), document.getElementById("battlein").innerHTML = n, show("battle", !0);
  1002.                 break;
  1003.             case "blokok":
  1004.                 log("Gateway (un)blocked.");
  1005.                 break;
  1006.             case "motel":
  1007.                 show("motel", !0), setih("moteltxt", n);
  1008.                 break;
  1009.             case "skills":
  1010.                 showskills(n);
  1011.                 break;
  1012.             case "skillshop":
  1013.                 skillshop(n);
  1014.                 break;
  1015.             case "alert":
  1016.                 alert(n);
  1017.                 break;
  1018.             case "reload":
  1019.                 return document.location.reload(), void clearInterval(thread1);
  1020.             case "msg":
  1021.                 message(n);
  1022.                 break;
  1023.             case "log":
  1024.                 log(n);
  1025.                 break;
  1026.             case "error":
  1027.                 log(n, 2);
  1028.                 break;
  1029.             case "ferror":
  1030.                 log(n, 3), document.getElementById("console").style.display = "block";
  1031.                 break;
  1032.             case "toomany":
  1033.                 toomany(n);
  1034.                 break;
  1035.             case "banned":
  1036.                 alert("Twoje IP jest zablokowane."), clearInterval(thread1);
  1037.                 break;
  1038.             case "sqltime":
  1039.                 document.getElementById("servstat").innerHTML = n;
  1040.                 break;
  1041.             case "stop":
  1042.                 clearInterval(thread1);
  1043.                 break;
  1044.             case "end":
  1045.                 a = !0
  1046.         }
  1047.     }("" != i && (ge("inbox").innerHTML = i), "" != e) && (ge("chatTxt").innerHTML += e, (l = ge("chat")).scrollTop = l.scrollHeight);
  1048.     o && (thread1 = setInterval(gameThread, 100)), global.initlvl < 4 && (a || document.location.reload(), global.initlvl++, dbget("init", "initlvl=" + global.initlvl))
  1049. }
  1050.  
  1051. function gameThread() {
  1052.     if (!global.ajax.busy && 0 < global.ajax.queue.size()) {
  1053.         var t = global.ajax.queue.pop();
  1054.         0 == t.length && dbget(), 1 == t.length && dbget(t[0]), 2 == t.length && dbget(t[0], t[1])
  1055.     }
  1056.     var e;
  1057.     !k[7] || global.chatFocus || global.dontmove || "block" != (e = document.getElementById("console")).style.display && (global.chatFocus = !0, document.getElementById("chatIn").focus(), k[7] = !1);
  1058.     (k[8] && doFight("quit"), 0 < global.sakwa && (1 & Math.ceil(global.sakwa / 5) ? hide("sakwa", !1) : show("sakwa", !1), global.sakwa--), global.logoff++, global.logoff > (global.gm ? 9e3 : 3e3) && (clearInterval(thread1), ge("dazed").innerHTML = 'Zostałeś wylogowany z powodu braku aktywności.<br><br><button onclick="document.location.reload()">Wejdź do gry</button>', show("dazed", !0)), 0 < global.chatBan && global.chatBan--, k[0]) && (k[0] = !1, "block" == (e = document.getElementById("console")).style.display ? (e.style.display = "none", global.dontmove = !1) : (e.style.display = "block", document.getElementById("consoleIn").value = "", document.getElementById("consoleIn").focus(), global.dontmove = !0));
  1059.     if (!(global.initlvl < 4)) {
  1060.         "block" != document.getElementById("console").style.display && k[5] && (log("k5"), togglechat(), k[5] = !1), mntop = parseInt(ge("mailnotifier").style.top), 0 < hero.mails && 485 < mntop ? ge("mailnotifier").style.top = mntop - 1 + "px" : 0 == hero.mails && mntop < 512 && (ge("mailnotifier").style.top = "512px");
  1061.         var i = document.getElementById("imgloaded");
  1062.         il.imgList.length > il.nLoaded + il.nErrors ? (i.style.display = "block", i.innerHTML = "Ładuję obrazki (" + (il.nLoaded + il.nErrors) + "/" + il.imgList.length + ")") : "none" != i.style.display && (i.style.display = "none"), global.refresh++, 10 < global.refresh && (hero.doMove() || dbget("_")), global.dontmove || hero.run(), el.draw();
  1063.         var o = global.ajax;
  1064.         0 < o.t1 && o.t1 < 2e3 && (tmp = map.name + " (" + hero.x + "," + hero.y + ")", document.getElementById("status").innerHTML != tmp && setih("status", tmp), o.t1 < 80 ? lagY = 0 : o.t1 < 130 ? lagY = 1 : o.t1 < 180 ? lagY = 2 : o.t1 < 250 ? lagY = 3 : o.t1 < 350 ? lagY = 4 : lagY = 5, document.getElementById("lagometer").style.backgroundPosition = "0 -" + 32 * lagY + "px"), el.checkAgressive(hero.x, hero.y)
  1065.     }
  1066. }
  1067.  
  1068. function onChatWrite(t) {
  1069.     if (!t) t = window.event;
  1070.     var e = t.keyCode,
  1071.         i = document.getElementById("chatIn");
  1072.     if ("/r" == i.value && (i.value = "@" + global.chreply + " "), 13 == e) {
  1073.         if ("" != i.value) {
  1074.             if (9 < global.chatBan) alert("Pisz wolniej! Nikt nie lubi spamu/floodu na czacie.\nOdczekaj teraz 5 sekund."), global.chatBan = 50;
  1075.             else if (global.lastchat != i.value) {
  1076.                 var o = encodeURI(i.value);
  1077.                 dbget("chat", "tekst=" + (o = o.replace(/[+]/g, "%2B"))), global.chatBan += 10
  1078.             } else alert("Wystarczy napisać raz. \nZa floodowanie/spamowanie można co najwyżej dostać kicka od MG.");
  1079.             global.lastchat = i.value, i.value = ""
  1080.         }
  1081.         global.chatFocus && global.chatFocus2 && (document.body.focus(), k[7] = !1, global.chatFocus = !1, global.chatFocus2 = !1)
  1082.     } else global.chatFocus2 = !0
  1083. }
  1084.  
  1085. function show(t, e) {
  1086.     document.getElementById(t).style.display = "block", e && (global.dontmove = !0), global.initlvl < 4 || hero.resetMouse()
  1087. }
  1088.  
  1089. function hide(t, e) {
  1090.     document.getElementById(t).style.display = "none", e && (global.dontmove = !1), global.initlvl < 4 || hero.resetMouse()
  1091. }
  1092.  
  1093. function round(t, e, i) {
  1094.     if (t = parseFloat(t), 3 == e) {
  1095.         t = t.toString();
  1096.         var o = "";
  1097.         if (!i) i = " ";
  1098.         for (; 3 < t.length;) {
  1099.             var a = t.substr(t.length - 3, 3);
  1100.             t = t.substring(0, t.length - 3), o = i + a + o
  1101.         }
  1102.         return t + o
  1103.     }
  1104.     return 2 == e ? t < 1e3 ? t : t < 1e6 ? Math.round(t / 100) / 10 + "k" : t < 1e9 ? Math.round(t / 1e5) / 10 + "m" : t < 1e10 ? Math.round(t / 1e8) / 10 + "g" : Math.round(t / 1e9) + "g" : 1 == e ? t < 1e4 ? t : t < 1e5 ? Math.round(t / 100) / 10 + "k" : t < 1e7 ? Math.round(t / 1e3) + "k" : t < 1e8 ? Math.round(t / 1e5) / 10 + "m" : t < 1e9 ? Math.round(t / 1e6) + "m" : t < 1e10 ? Math.round(t / 1e8) / 10 + "g" : Math.round(t / 1e10) + "g" : t < 1e3 ? t : t < 1e6 ? Math.round(t / 1e3) + "k" : t < 1e9 ? Math.round(t / 1e6) + "m" : Math.round(t / 1e9) + "g"
  1105. }
  1106.  
  1107. function nowms() {
  1108.     var t = new Date;
  1109.     return 1e3 * t.getSeconds() + t.getMilliseconds()
  1110. }
  1111.  
  1112. function doFight(t) {
  1113.     switch (t) {
  1114.         case "attack":
  1115.             dbget("fight", "action=attack&who=" + global.battle.selected);
  1116.             break;
  1117.         case "move":
  1118.             dbget("fight", "action=move");
  1119.             break;
  1120.         case "spell":
  1121.             spl = document.getElementById("spell"), -1 < spl.selectedIndex && dbget("fight", "action=spell&who=" + global.battle.selected + "&spell=" + spl.options[spl.selectedIndex].value);
  1122.             break;
  1123.         case "quit":
  1124.             dbget("fight", "action=quit")
  1125.     }
  1126. }
  1127.  
  1128. function toomany(t) {
  1129.     log("Too many users online, limit=" + t, 2), alert("Przekroczono limit graczy online.\n"), clearInterval(thread1), hide("loading")
  1130. }
  1131.  
  1132. function createClan(t) {
  1133.     str = prompt("Podaj nazwę swego klanu:"), str && dbget("clan", "proc=create&clanname=" + str + "&npcid=" + t)
  1134. }
  1135.  
  1136. function inviteClan(t) {
  1137.     t = t.split(","), confirm("Czy chcesz dołączyć do klanu " + t[1]) && dbget("clan", "proc=join&ticket=" + t[0])
  1138. }
  1139.  
  1140. function cancelTrade() {
  1141.     dbget("trade", "tt=2&who=" + global.trader), global.trader = 0, el.delall("trade"), hide("trade", !0)
  1142. }
  1143.  
  1144. function acceptTrade() {
  1145.     dbget("trade", "tt=7&who=" + global.trader)
  1146. }
  1147.  
  1148. function setGold() {
  1149.     var t = document.getElementById("tradegold");
  1150.     dbget("trade", "tt=6&who=" + global.trader + "&gold=" + t.value), t.value = ""
  1151. }
  1152.  
  1153. function onGoldWrite(t) {
  1154.     if (!t) t = window.event;
  1155.     13 == t.keyCode && setGold()
  1156. }
  1157.  
  1158. function cfgupdate() {
  1159.     document.getElementById("opt1").style.backgroundPosition = 1 & hero.opt2 ? "0 -22px" : "0 0", document.getElementById("opt2").style.backgroundPosition = 2 & hero.opt2 ? "0 -22px" : "0 0", document.getElementById("opt3").style.backgroundPosition = 4 & hero.opt2 ? "0 -22px" : "0 0", document.getElementById("opt4").style.backgroundPosition = 8 & hero.opt2 ? "0 -22px" : "0 0", document.getElementById("opt5").style.backgroundPosition = 16 & hero.opt2 ? "0 -22px" : "0 0", document.getElementById("opt6").style.backgroundPosition = 32 & hero.opt2 ? "0 -22px" : "0 0", document.getElementById("opt7").style.backgroundPosition = 64 & hero.opt2 ? "0 -22px" : "0 0"
  1160. }
  1161.  
  1162. function config_show() {
  1163.     hero.opt2 = hero.opt, cfgupdate(), show("config", !0)
  1164. }
  1165.  
  1166. function optclick(t) {
  1167.     hero.opt2 ^= 1 << t - 1, cfgupdate()
  1168. }
  1169.  
  1170. function config_save() {
  1171.     dbget("config", "opt=" + hero.opt2), hide("config", !0)
  1172. }
  1173.  
  1174. function loadrank(t, e, i) {
  1175.     document.getElementById("rankid").disabled = 100 == t || 0 == t, document.getElementById("oldrid").value = t, document.getElementById("rankid").value = t, document.getElementById("rankname").value = e, document.getElementById("rankr").value = i;
  1176.     for (var o = 1, a = 1; o < 8; o++, a *= 2) document.getElementById("rr" + o).innerHTML = 0 < (i & a) ? 1 : 0
  1177. }
  1178.  
  1179. function clearrank() {
  1180.     for (document.getElementById("oldrid").value = -1, document.getElementById("rankid").disabled = !1, document.getElementById("rankid").value = 1, document.getElementById("rankname").value = "", document.getElementById("rankr").value = 0, i = 1; i < 8; i++) document.getElementById("rr" + i).innerHTML = 0
  1181. }
  1182.  
  1183. function showskills(t) {
  1184.     for (sl = t.split(";"), str = "", i = 0; i < sl.length; i++) sl1 = sl[i].split("|"), 1 < sl1.length && ("grp" == sl1[1] ? str += "<h2 class=sbranch>" + sl1[0] + "</h2>" : str += (0 < parseInt(sl1[4]) ? '<div class=skillUse style="background-position:0 ' + 22 * (sl1[4] - 1) + 'px" onclick=dbget("skills","stask=su&sid=' + sl1[5] + '")></div>' : "") + "<p><b class=sname>" + sl1[0] + " (" + sl1[2] + "/" + sl1[3] + ")</b><br><small>" + sl1[1] + "</small><br>" + (sl1[6] ? "<b class=sstats>" + sl1[6] + "</b></p>" : ""));
  1185.     setih("skillslist", str), show("skills", !0)
  1186. }
  1187.  
  1188. function skillshop(t) {
  1189.     for (sl = t.split(";"), str = "", i = 0; i < sl.length; i++) sl1 = sl[i].split("|"), 1 < sl1.length && ("zl" == sl1[4] && (sl1[4] = "złota"), "grp" == sl1[1] ? str += "<h2 class=sbranch>" + sl1[0] + "</h2>" : str += (0 < parseInt(sl1[1]) ? '<div rollover=19 class=skillLearn onclick=dbget("skills","stask=ss&learn=' + sl1[1] + '")></div>' : "") + "<p><b class=sname>" + sl1[0] + "</b><br><small>" + sl1[5] + "</small><br><b class=sgold>Poziom " + sl1[2] + ": " + sl1[3] + " " + sl1[4] + "</b><br><b class=sstats>" + sl1[6] + "</b><i class=sreq>" + sl1[7] + "</i></p>");
  1190.     setih("skillshoplist", str), show("skillshop", !0)
  1191. }
  1192.  
  1193. function friendship(t) {
  1194.     t = t.split(","), confirm("Czy chcesz dodać " + t[1] + " do swojej listy przyjaciół?") ? dbget("friends", "proc=fraccept&id=" + t[0]) : dbget("friends", "proc=frdiscard&id=" + t[0])
  1195. }
  1196.  
  1197. function chatfr(t) {
  1198.     document.getElementById("chatIn").value = "@" + t.split(" ").join("_") + " ", global.chatFocus = !0, document.getElementById("chatIn").focus()
  1199. }
  1200.  
  1201. function newmail() {
  1202.     hero.gold < 100 ? alert("Koszt wysłania 1 wiadomości to 100 złota,\na Ty tyle nie masz.") : (ge("attitem").innerHTML = "", global.attitem = 0, show("newmail", !1))
  1203. }
  1204.  
  1205. function sendmail() {
  1206.     var t = ge("receiver").value,
  1207.         e = ge("mailgold").value,
  1208.         i = ge("mailmsg").value;
  1209.     "" == t ? alert("Brak adresata wiadomości!") : "" == i ? alert("Brak treści wiadomości!") : dbget("mails", "proc=sendmail&receiver=" + escape(t) + "&gold=" + e + "&item=" + global.attitem + "&msg=" + escape(i))
  1210. }
  1211.  
  1212. function mailreply(t) {
  1213.     hero.gold < 100 ? alert("Koszt wysłania 1 wiadomości to 100 złota,\na Ty tyle nie masz.") : (ge("mailmsg").value = "", ge("mailgold").value = "", ge("receiver").value = unescape(t), ge("attitem").innerHTML = "", global.attitem = 0, show("newmail", !1), ge("mailmsg").focus(), ge("mailmsg").scrollTop = 0)
  1214. }
  1215.  
  1216. function delatt() {
  1217.     ge("attitem").innerHTML = "", global.attitem = 0
  1218. }
  1219.  
  1220. function myauctions(t) {
  1221.     "" == t && (t = "Aby dodać nową aukcję przeciągnij na ten panel przedmiot ze swojego ekwipunku.");
  1222.     var e = "<h2>Nowa aukcja</h2><p id=newaitem>" + t + "</p><h2>Moje aukcje</h2><table id=ahtable><tr><th colspan=2>Przedmiot<th>Cena<th>Kup teraz<th>Koniec licytacji</table>";
  1223.     ge("ahpanel").innerHTML = e, show("auctions", !0), global.myau = !0
  1224. }
  1225.  
  1226. function newauction(t, e, i) {
  1227.     var o = "<table><tr><td>" + e + "<td>";
  1228.     o += i ? '<td>Cena kup teraz:<br>Od 10 do 32SŁ zależnie od jakości i poziomu przedmiotu.<td>Czas aukcji:<br><input size=2 id=itemtime value=48><td><button onclick="sendauction(' + t + ',1)">Wystaw<br>przedmiot<button></table><small>Cena przedmiotu to 12SŁ + 1/10 poziomu przedmiotu, +20% za unikat, +40% za heroik, +60% za legendarny.Jakkolwiek gracz otrzymuje 10% tej sumy, reszta to koszty odwiązania.</small>' : 'Cena wyjściowa:<br><input size=5 id=itemprice maxlength=9><td>Cena kup teraz:<br><input size=5 id=itemboprice maxlength=9><td>Czas aukcji:<br><input size=2 id=itemtime value=24><td><button onclick="sendauction(' + t + ',0)">Wystaw<br>przedmiot<button></table><small>Cena przedmiotu może być również zapisana jako np. 5k (5&nbsp;tysięcy) lub 1m (1&nbsp;milion).Czas aukcji w godzinach, od 2 do 48. Koszt wystawienia przedmiotu to 10% jego wartości, 100 złota, 2% z ceny początkowej lub kup teraz - brana jest pod uwagę największa z tych liczb.</small>', ge("newaitem").innerHTML = o
  1229. }
  1230.  
  1231. function ahitem(t) {
  1232.     newRow = ge("ahtable").insertRow(-1);
  1233.     var e = t[5].split(",");
  1234.     if (t[5] = "<b>" + e[0] + "</b><br><small>" + e[1] + "<br>" + e[2] + "</small>", 0 == t[3] ? t[3] = "-" : global.myau || (t[3] = "<input value=" + t[3] + " size=4 id=ai" + t[0] + "><br><button onclick=aubid(" + t[0] + ',"' + t[3] + '","' + t[4] + '")>Licytuj</button>'), 0 == t[4]) t[4] = "-";
  1235.     else {
  1236.         var i = "";
  1237.         global.myau || (i = "<br><button onclick=buyout(" + t[0] + ',"' + escape(t[2]) + '","' + t[4] + '",' + t[8] + ")>Kup teraz</button>"), "1" == t[8] && (t[4] = "<span class=ausl>" + t[4] + " SŁ</span>"), t[4] += i
  1238.     }
  1239.     for (var o = 1; o < 6; o++) newCell = newRow.insertCell(-1), 2 == o ? (newCell.innerHTML = t[o] + (0 < t[7] ? "<br>(lvl:" + t[7] + ")" : ""), newCell.className = "itemtype" + t[6]) : newCell.innerHTML = t[o]
  1240. }
  1241.  
  1242. function parsePrice(t) {
  1243.     return "m" == (t = t.split(",").join(".")).slice(-1) ? Math.round(1e6 * parseFloat(t)) : "k" == t.slice(-1) ? Math.round(1e3 * parseFloat(t)) : parseInt(t)
  1244. }
  1245.  
  1246. function sendauction(t, e) {
  1247.     if (e) {
  1248.         (a = parseInt(ge("itemtime").value)) < 2 ? alert("Czas aukcji to minimum 2h") : 48 < a ? alert("Czas aukcji nie może być większy niż 48h") : dbget("auctions", "proc=newauction&itemid=" + t + "&p1=1&p2=2&time=" + a)
  1249.     } else {
  1250.         var i = parsePrice(ge("itemprice").value),
  1251.             o = parsePrice(ge("itemboprice").value),
  1252.             a = parseInt(ge("itemtime").value);
  1253.         !i & !o ? alert("Brak ceny!") : i && i < 1e3 ? alert("Minimalna cena to 1000 złota") : o && o < 1e3 ? alert("Minimalna cena kup teraz to 1000 złota") : o && o < i ? alert("Cena kup teraz nie może być mniejsza od wywoławczej!") : a < 2 ? alert("Czas aukcji to minimum 2h") : 48 < a ? alert("Czas aukcji nie może być większy niż 48h") : dbget("auctions", "proc=newauction&itemid=" + t + "&p1=" + i + "&p2=" + o + "&time=" + a)
  1254.     }
  1255. }
  1256.  
  1257. function aubrowse(t) {
  1258.     global.aucat = t[0];
  1259.     for (var e = new Array("zwykłe", "unikaty", "heroiczne", "legendarne"), i = "", o = 0; o < 4; o++) i += "<option value=" + o + (global.atype == o ? " selected" : "") + ">" + e[o];
  1260.     var a = "<h2>" + t[1] + "</h2><div id=aufilter>Lvl od <input size=3 value=" + global.aulv1 + " id=alvlmin class=nr3> do <input size=3 value=" + global.aulv2 + " id=alvlmax class=nr3> Nie gorsze niż:<select id=aitype>" + i + '</select><br>Nazwa zawiera: <input style="width:200px" id=auname value="' + global.auname + '"><br>Cena od <input size=3 value=' + round(global.aup1) + " id=aprmin class=nr5> do <input size=3 value=" + round(global.aup2) + " id=aprmax class=nr5> <button onclick=aapply()>Zastosuj</button></div><table id=ahtable><tr><th colspan=2>Przedmiot<th>Cena<th>Kup teraz<th>Koniec licytacji</table><center>";
  1261.     0 < global.austart && (a += "<button onclick=auprev()>wstecz</button>"), global.austart + 20 < t[2] && (a += "<button onclick=aunext()>dalej</button>"), ge("ahpanel").innerHTML = a + "</center>", global.myau = !1
  1262. }
  1263.  
  1264. function auview(t) {
  1265.     dbget("auctions", "proc=filter&cat=" + t + "&start=" + global.austart + "&fltr=" + global.aulv1 + "!" + global.aulv2 + "!" + global.aup1 + "!" + global.aup2 + "!" + global.atype + "!" + global.auname)
  1266. }
  1267.  
  1268. function aapply() {
  1269.     global.aulv1 = parseInt(ge("alvlmin").value), global.aulv2 = parseInt(ge("alvlmax").value), global.aup1 = parsePrice(ge("aprmin").value), global.aup2 = parsePrice(ge("aprmax").value), global.atype = parseInt(ge("aitype").value), global.auname = ge("auname").value, global.austart = 0, auview(global.aucat)
  1270. }
  1271.  
  1272. function ahselect(t) {
  1273.     global.austart = 0, auview(t)
  1274. }
  1275.  
  1276. function auprev() {
  1277.     global.austart = Math.max(0, global.austart - 20), auview(global.aucat)
  1278. }
  1279.  
  1280. function aunext() {
  1281.     global.austart += 20, auview(global.aucat)
  1282. }
  1283.  
  1284. function buyout(t, e, i, o) {
  1285.     confirm("Czy na pewno chcesz kupić: \n" + unescape(e) + "\nza " + i + (o ? " Smoczych Łez?" : " złota?")) && dbget("auctions", "proc=buyout&iid=" + t + "&bag=" + global.bag + "&start=" + global.austart + "&fltr=" + global.aulv1 + "!" + global.aulv2 + "!" + global.aup1 + "!" + global.aup2 + "!" + global.atype + "!" + global.auname)
  1286. }
  1287.  
  1288. function aubid(t, e, i) {
  1289.     var o = parsePrice(ge("ai" + t).value);
  1290.     e = parsePrice(e), (i = parsePrice(i)) && i < o ? alert('Licytowanie wyższej kwoty niż "Kup Teraz" nie ma sensu.') : o < 1.1 * e ? alert("Musisz podbić cenę o co najmniej 10%.") : o > 1 * hero.gold ? alert("Nie masz tyle złota.") : dbget("auctions", "proc=bid&iid=" + t + "&bid=" + o + "&start=" + global.austart + "&fltr=" + global.aulv1 + "!" + global.aulv2 + "!" + global.aup1 + "!" + global.aup2 + "!" + global.atype + "!" + global.auname)
  1291. }
  1292.  
  1293. function pvpfr(t) {
  1294.     switch (t) {
  1295.         case "w":
  1296.         case "p":
  1297.         case "h":
  1298.             return 0;
  1299.         default:
  1300.             return 1
  1301.     }
  1302. }
  1303.  
  1304. function youtube(t) {
  1305.     var e = "<DIV class=mapClose onclick=\"hide('customdiv',true); ge('customdiv').innerHTML=''\" rollover=22></DIV>" + '<center style="margin-top:60px"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/' + t + '&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + t + '&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></center>';
  1306.     ge("customdiv").innerHTML = e, show("customdiv")
  1307. }
  1308.  
  1309. function ImageLoader() {
  1310.     this.imgList = new Array, this.nLoaded = 0, this.nErrors = 0
  1311. }
  1312.  
  1313. function k_down(t) {
  1314.     if (global.logoff = 0, !t) t = window.event;
  1315.     var e = t.keyCode;
  1316.     if (t.target ? targ = t.target : t.srcElement && (targ = t.srcElement), ("consoleIn" == targ.id || "INPUT" != targ.tagName) && "TEXTAREA" != targ.tagName) {
  1317.         for (i = 0; i < keys.length; i++) e != keys[i] && e != alts[i] || (k[i] = !0);
  1318.         "INPUT" != targ.tagName && 192 != e && global.console.keylog && log("KeyCode: " + e)
  1319.     }
  1320. }
  1321.  
  1322. function k_up(t) {
  1323.     if (!t) t = window.event;
  1324.     var e = t.keyCode;
  1325.     for (i = 0; i < keys.length; i++) e != keys[i] && e != alts[i] || (k[i] = !1)
  1326. }
  1327.  
  1328. function k_add() {
  1329.     for (i = 0; i < arguments.length; i++) keys[keys.length] = arguments[i], alts[keys.length] = -1;
  1330.     document.onkeydown = k_down, document.onkeyup = k_up
  1331. }
  1332. ObjectLoader.prototype.assign = function(t, e) {
  1333.     for (var i in this.objList)
  1334.         if (!this.objList[i].inuse && this.objList[i].src == t && this.oRoot == this.objList[i].rt) return this.objList[i].inuse = !0, show(this.objList[i].uid, !1), document.getElementById(this.objList[i].uid).style.visibility = "visible", this.oRoot = "objects", this.objList[i].uid;
  1335.     var o = new oDiv(this.oRoot, t, e);
  1336.     return this.oRoot = "objects", (this.objList[this.objList.length] = o).uid
  1337. }, ObjectLoader.prototype.free = function(t) {
  1338.     for (var e in this.objList) this.objList[e].uid == t && (this.objList[e].inuse = !1, document.getElementById(this.objList[e].uid).style.visibility = "hidden", document.getElementById(this.objList[e].uid).style.display = "none")
  1339. }, oDiv.prototype.onload = function(t) {
  1340.     t ? log("Can't load file '" + this.src + "'", 2) : (this.loaded = !0, this.isimg ? document.getElementById(this.uid).src = this.src : document.getElementById(this.uid).style.backgroundImage = "url(" + this.src + ")")
  1341. }, stack.prototype.push = function(t) {
  1342.     this.limit && this.limit <= this.size() || (this.data[this.end] = t, this.end++)
  1343. }, stack.prototype.pop = function() {
  1344.     if (this.begin >= this.end) return this.nullvalue;
  1345.     this.begin++;
  1346.     var t = this.data[this.begin - 1];
  1347.     return delete this.data[this.begin - 1], this.begin == this.end && (this.begin = 0, this.end = 0), t
  1348. }, stack.prototype.size = function() {
  1349.     return this.end - this.begin
  1350. }, tips.prototype.show = function(t, e, i, o) {
  1351.     if (!global.drag) {
  1352.         var a = document.getElementById(this.uid);
  1353.         a.className = "ctip tip_" + i, a.innerHTML = o, a.style.display = "block", this.marginleft = 780 < t + a.offsetWidth ? -(a.offsetWidth + 5) : 10, this.margintop = 500 < e + a.offsetHeight ? -(a.offsetHeight + 5) : 10, a.style.top = e + this.margintop + "px", a.style.left = t + this.marginleft + "px", this.on = !0
  1354.     }
  1355. }, tips.prototype.update = function(t) {
  1356.     document.getElementById(this.uid).innerHTML = t
  1357. }, tips.prototype.hide = function() {
  1358.     this.on = !1, document.getElementById(this.uid).style.display = "none"
  1359. }, tips.prototype.move = function(t, e) {
  1360.     if (this.on) {
  1361.         var i = document.getElementById(this.uid);
  1362.         i.style.left = t + this.marginleft + "px", i.style.top = e + this.margintop + "px"
  1363.     }
  1364. }, advAJAX.get = function(t) {
  1365.     return advAJAX.handleRequest("GET", t)
  1366. }, advAJAX.post = function(t) {
  1367.     return advAJAX.handleRequest("POST", t)
  1368. }, advAJAX.head = function(t) {
  1369.     return advAJAX.handleRequest("HEAD", t)
  1370. }, advAJAX.submit = function(t, e) {
  1371.     if (void 0 === e || null == e) return -1;
  1372.     if ("object" != typeof t || null == t) return -2;
  1373.     var i = new advAJAX;
  1374.     return e.form = t, i.handleArguments(e), i.run()
  1375. }, advAJAX.assign = function(t, e) {
  1376.     return void 0 === e || null == e ? -1 : "object" != typeof t || null == t ? -2 : ("function" == typeof t.onsubmit && (t.advajax_onsubmit = t.onsubmit), t.advajax_args = e, t.onsubmit = function() {
  1377.         return void 0 !== this.advajax_onsubmit && this.advajax_onsubmit(), 0 == advAJAX.submit(this, this.advajax_args)
  1378.     }, !0)
  1379. }, advAJAX.handleRequest = function(t, e) {
  1380.     if (void 0 === e || null == e) return -1;
  1381.     var i = new advAJAX;
  1382.     return i.method = t, i.handleArguments(e), i.run()
  1383. }, advAJAX._defaultParameters = new Object, advAJAX.setDefaultParameters = function(t) {
  1384.     for (a in advAJAX._defaultParameters = new Object, t) advAJAX._defaultParameters[a] = t[a]
  1385. }, advAJAX._groupData = new Object, elements.prototype.add = function(t) {
  1386.     var e = t.split(";");
  1387.     "type=other" == e[0] && e[1] != "id=" + hero.pid && (this.eList[this.eList.length] = new eOther(t)), "type=npc" == e[0] && (this.eList[this.eList.length] = new eNPC(t)), "type=item" == e[0] && (this.eList[this.eList.length] = new eItem(t)), "type=equip" == e[0] && (this.eList[this.eList.length] = new eEquip(t)), "type=trade" == e[0] && (this.eList[this.eList.length] = new eTrade(t)), "type=gateway" == e[0] && (this.eList[this.eList.length] = new eGateway(t)), "type=shop" == e[0] && (this.eList[this.eList.length] = new eShop(t)), "type=troop" == e[0] && (this.eList[this.eList.length] = new eTroop(t))
  1388. }, elements.prototype.del = function(t, e) {
  1389.     for (var i in this.eList) this.eList[i].id == t && this.eList[i].type == e && (ol.free(this.eList[i].uid), delete this.eList[i])
  1390. }, elements.prototype.delall = function(t) {
  1391.     for (var e in this.eList) this.eList[e].type == t && (ol.free(this.eList[e].uid), delete this.eList[e])
  1392. }, elements.prototype.draw = function() {
  1393.     for (var t in this.eList) this.eList[t].draw()
  1394. }, elements.prototype.lookfor = function(t, e) {
  1395.     if (t.target) var i = t.target;
  1396.     else if (t.srcElement) i = t.srcElement;
  1397.     for (var o in this.eList) this.eList[o].uid == i.id && this.eList[o][e](t)
  1398. }, elements.prototype.list = function(t) {
  1399.     for (var e in this.eList) this.eList[e].type == t && log(this.eList[e].name + " ITEM#" + this.eList[e].id + "." + global.serverno)
  1400. }, elements.prototype.collision = function(t, e) {
  1401.     for (var i in this.eList)
  1402.         if ("npc" == this.eList[i].type && 4 != this.eList[i].attack && this.eList[i].x == t && this.eList[i].y == e) return !0;
  1403.     return !1
  1404. }, elements.prototype.checkAgressive = function(t, e) {
  1405.     if (!global.battle.now && !global.battle.agrnow)
  1406.         for (var i in this.eList)
  1407.             if ("npc" == this.eList[i].type && 3 == this.eList[i].attack && hero.lvl < parseInt(this.eList[i].lvl) + 2 && Math.abs(this.eList[i].x - t) < 2 && Math.abs(this.eList[i].y - e) < 2) return global.battle.agrnow = !0, hero.doMove(), battlespeed = !1, 8 & hero.opt && (battlespeed = confirm("Naciśnij OK aby zawalczyć turowo, lub Anuluj dla szybkiej walki")), void dbget("fight", "attack=" + this.eList[i].id + "&auto=" + (battlespeed ? "0" : "1"))
  1408. }, elements.prototype.callHandler = function(t, e) {
  1409.     for (var i in this.eList) this.eList[i].type == t && this.eList[i].handler(e)
  1410. }, eBase.prototype.init = function(t, e) {
  1411.     for (var i in t = t.split(";")) {
  1412.         t[i] = t[i].split("=");
  1413.         var o = t[i][0];
  1414.         t[i][0] = "", this[o] = t[i].join("=").slice(1)
  1415.     }
  1416.     e && (this.icon = e + this.icon), this.uid = ol.assign(this.icon, "other" != this.type && "gateway" != this.type);
  1417.     var a = document.getElementById(this.uid);
  1418.     addEvent(a, "click", function(t) {
  1419.         if (!t) t = window.event;
  1420.         el.lookfor(t, "onclick")
  1421.     }), addEvent(a, "mouseover", function(t) {
  1422.         if (!t) t = window.event;
  1423.         el.lookfor(t, "onover")
  1424.     }), addEvent(a, "mouseout", function(t) {
  1425.         if (!t) t = window.event;
  1426.         el.lookfor(t, "onout")
  1427.     }), addEvent(a, "mousemove", function(t) {
  1428.         if (!t) t = window.event;
  1429.         el.lookfor(t, "onmove")
  1430.     })
  1431. }, eBase.prototype.draw = function() {}, eBase.prototype.handler = function() {}, eBase.prototype.onclick = function(t) {}, eBase.prototype.onover = function(t) {}, eBase.prototype.onout = function(t) {
  1432.     tip.hide()
  1433. }, eBase.prototype.onmove = function(t) {}, eOther.prototype = new eBase, eOther.prototype.checkSize = function() {
  1434.     if (il && il.getsize) {
  1435.         var t = il.getsize(this.icon);
  1436.         t && 1 < t[0] + t[1] && (this.framew = Math.round(t[0] / 4), this.frameh = Math.round(t[1] / 4), document.getElementById(this.uid).style.width = this.framew + "px", document.getElementById(this.uid).style.height = this.frameh + "px", this.nosize = !1)
  1437.     }
  1438. }, eOther.prototype.draw = function() {
  1439.     this.nosize && this.checkSize();
  1440.     var t = document.getElementById(this.uid);
  1441.     this.rx, this.ry;
  1442.     this.rx + 2 < this.x && (this.rx = parseFloat(this.x) - 2), this.ry + 2 < this.y && (this.ry = parseFloat(this.y) - 2), this.rx - 2 > this.x && (this.rx = parseFloat(this.x) + 2), this.ry - 2 > this.y && (this.ry = parseFloat(this.y) + 2);
  1443.     var e = .25,
  1444.         i = .25;
  1445.     1 < Math.abs(this.rx - this.x) && (e = .5), 1 < Math.abs(this.ry - this.y) && (i = .5), this.rx > this.x && (this.rx -= e), this.ry > this.y && (this.ry -= i), this.rx < this.x && (this.rx += e), this.ry < this.y && (this.ry += i), this.rx - this.x != 0 || this.ry - this.y != 0 ? this.step = this.step + 1 & 3 : this.step = 0;
  1446.     var o = 32 * (this.rx - map.left()) - (this.framew - 32) / 2,
  1447.         a = 32 * (this.ry - map.top()) - (this.frameh - 32);
  1448.     if (-32 < o && o < 513 && -32 < a && a < 513) {
  1449.         if (ww = map.water[Math.round(this.rx) + 256 * Math.round(this.ry)]) {
  1450.             var n = 4 * parseInt(ww);
  1451.             n > this.rz && this.rz++, n < this.rz && this.rz--, n > this.rz + 3 && (this.rz = n), n < this.rz - 3 && (this.rz = n), t.style.height != this.frameh - this.rz && (t.style.height = this.frameh - this.rz)
  1452.         } else t.style.height != this.frameh + "px" && (t.style.height = this.frameh, this.rz = 0);
  1453.         t.style.left = o, t.style.top = a + this.rz, t.style.backgroundPosition = this.step * this.framew + "px " + -this.direction * this.frameh + "px", t.style.zIndex = 2 + parseInt(this.y), t.style.display = "block"
  1454.     } else t.style.display = "none"
  1455. }, eOther.prototype.handler = function(t) {
  1456.     for (var e in t = t.split(";")) t[e] = t[e].split("="), this[t[e][0]] = t[e][1]
  1457. }, eOther.prototype.onover = function(t) {
  1458.     var e = "<B>" + this.nick + "</B>";
  1459.     0 < this.clan && (e += "<i>[" + global.clans[this.clan] + "]</i>");
  1460.     var i = this.rights;
  1461.     0 < i ? 1 & i ? e += "Admin" : 16 & i ? e += "Super MG" : 2 & i ? e += "MG" : global.rpg ? e += "Członek Rady<BR>Lvl: " + this.lvl : e += "Pomocnik<BR>Lvl: " + this.lvl : e += "Lvl: " + this.lvl, global.pvp && pvpfr(hero.prof0) != pvpfr(this.prof) ? tip.show(t.clientX, t.clientY, "other2", e) : tip.show(t.clientX, t.clientY, "other", e)
  1462. }, eOther.prototype.onclick = function(t) {
  1463.     if (!(1 < Math.abs(this.x - hero.x) + Math.abs(this.y - hero.y))) {
  1464.         var e = document.getElementById("menu"),
  1465.             i = document.getElementById("menuin"),
  1466.             o = "";
  1467.         o += "<BUTTON onclick=\"hide('menu',true);dbget('fight','attackpvp=" + this.id + "');\">Atakuj</BUTTON>", o += "<BUTTON onclick=\"hide('menu',true);dbget('trade','tt=1&who=" + this.id + "');\">Handluj</BUTTON>", this.x == hero.x && this.y == hero.y && (o += "<BUTTON onclick=\"hide('menu',true);dbget('takeitem');\">Podnieś</BUTTON>", o += "<BUTTON onclick=dbget('walk')>Przejdź</BUTTON>"), o += "<BUTTON onclick=\"hide('menu',true);dbget('fight','joingroup=" + this.id + "');\">Grupuj</BUTTON>", i.innerHTML = o, e.style.left = t.clientX - 60 + "px";
  1468.         var a = 502 - 20 * o.split("<BUTTON ").length;
  1469.         e.style.top = Math.min(a, Math.max(0, t.clientY - 20)) + "px", show("menu", !0)
  1470.     }
  1471. }, eNPC.prototype = new eBase, eNPC.prototype.draw = function() {
  1472.     var t = document.getElementById(this.uid);
  1473.     if (0 < this.questmark) var e = document.getElementById(this.quid);
  1474.     var i = 32 * (this.x - map.left()),
  1475.         o = 32 * (this.y - map.top());
  1476.     if (-32 < i && i < 513 && -32 < o && o < 513) {
  1477.         var a = Math.max(0, t.offsetWidth / 2 - 16);
  1478.         4 != this.attack && 5 != this.attack || Math.round(t.offsetWidth / 64) != t.offsetWidth / 64 || (a += 16);
  1479.         var n = Math.max(0, t.offsetHeight - 32);
  1480.         t.style.left = i - a, t.style.top = o - n, t.style.zIndex = 2 + parseInt(this.y) + (4 == this.attack ? parseInt(this.wtype) : 0), t.style.display = "block", 0 < this.questmark && (e.style.left = i + 13, e.style.top = o - n - 13, e.style.zIndex = 2 + parseInt(this.y), e.style.display = "block")
  1481.     } else t.style.display = "none", 0 < this.questmark && (e.style.display = "none")
  1482. }, eNPC.prototype.onover = function(t) {
  1483.     if (0 != this.lvl || 4 != this.attack) {
  1484.         var e = "<B>" + this.nick + "</B>";
  1485.         if (4 != this.attack) {
  1486.             if (0 < this.lvl) {
  1487.                 var i = "";
  1488.                 2 != this.attack && 3 != this.attack || (13 < hero.lvl - this.lvl ? i = "style='color:#888'" : 19 < this.lvl - hero.lvl ? i = "style='color:#f50'" : 9 < this.lvl - hero.lvl && (i = "style='color:#ff0'"));
  1489.                 var o = "Lvl: " + this.lvl;
  1490.                 2 != this.attack && 3 != this.attack || !global.rpg || (o = 13 < hero.lvl - this.lvl ? "Niewarty uwagi" : 19 < this.lvl - hero.lvl ? "Potężny przeciwnik" : 9 < this.lvl - hero.lvl ? "Poważny rywal" : "Zwykły przeciwnik"), e += "<span " + i + ">" + o + (0 < this.fight_gr ? " (grp)" : "") + "</span>"
  1491.             }
  1492.             79 < this.wtype ? e += "<I>heros</I>" : 29 < this.wtype ? e += "<I>elita III</I>" : 19 < this.wtype ? e += "<I>elita II</I>" : 9 < this.wtype && (e += "<I>elita</I>")
  1493.         }
  1494.         tip.show(t.clientX, t.clientY, "npc", e)
  1495.     }
  1496. }, eNPC.prototype.onclick = function(t) {
  1497.     if (!(1 < Math.abs(this.x - hero.x) || 1 < Math.abs(this.y - hero.y))) {
  1498.         var e = document.getElementById("menu"),
  1499.             i = document.getElementById("menuin"),
  1500.             o = "";
  1501.         0 == this.attack && (o = "<BUTTON onclick=\"hide('menu',true);dbget('dialog','zkim=" + this.id + "');hero.talker='" + this.nick + "'\">Rozmawiaj</BUTTON>"), 2 != this.attack && 3 != this.attack || (o = "<BUTTON onclick=\"hide('menu',true);dbget('fight','auto=1&attack=" + this.id + "');\">Szybka walka</BUTTON><BUTTON onclick=\"hide('menu',true);dbget('fight','auto=0&attack=" + this.id + "');\">Walka turowa</BUTTON>"), 5 == this.attack && (1 == this.wtype ? but_name = "Uruchom" : but_name = "Obejrzyj", o = "<BUTTON onclick=\"hide('menu',true);dbget('dialog','zkim=" + this.id + "');hero.talker='" + this.nick + "'\">" + but_name + "</BUTTON>"), 4 != this.attack && (i.innerHTML = o, e.style.left = t.clientX - 60 + "px", e.style.top = t.clientY - 20 + "px", show("menu", !0))
  1502.     }
  1503. }, eTroop.prototype = new eBase, eTroop.prototype.checkSize = function() {
  1504.     if (il && il.getsize) {
  1505.         var t = il.getsize(this.icon);
  1506.         t && 1 < t[0] + t[1] && (this.isnpc ? (nw = t[0], nh = t[1]) : (nw = Math.round(t[0] / 4), nh = Math.round(t[1] / 4)), this.framew = nw, this.frameh = nh, global.battle.width[this.posy][this.posx] = this.framew, this.nosize = !1)
  1507.     }
  1508. }, eTroop.prototype.draw = function() {
  1509.     this.nosize && this.checkSize();
  1510.     var t = document.getElementById(this.uid);
  1511.     if (0 < this.hpp) {
  1512.         Math.max(0, t.offsetWidth / 2 - 16);
  1513.         var e = Math.max(0, t.offsetHeight - 32),
  1514.             o = -8,
  1515.             a = 0;
  1516.         for (i = 0; i < global.battle.width[this.posy].length; i++) i < this.posx && (a += global.battle.width[this.posy][i] + 8), o += global.battle.width[this.posy][i] + 8;
  1517.         t.style.left = Math.round(256 - o / 2) + a + "px", t.style.top = 160 - 20 * this.posy - e + "px", this.isnpc || (t.style.backgroundPosition = 1 == this.team ? "0px " + this.frameh + "px" : "0px 0px"), t.style.zIndex = 375 - parseInt(this.posy), t.style.display = "block"
  1518.     } else t.style.display = "none"
  1519. }, eTroop.prototype.handler = function(t) {
  1520.     for (var e in t = t.split(";")) "selection=off" == t[e] && (document.getElementById(this.uid).style.border = "none")
  1521. }, eTroop.prototype.onover = function(t) {
  1522.     if (this.id == hero.pid) var e = "Moja postać<br>Życie: " + this.hpp + "%";
  1523.     else e = "<B>" + this.nick + "</B>Lvl: " + this.lvl + "<BR>Życie: " + this.hpp + "%";
  1524.     tip.show(t.clientX, t.clientY, "other", e)
  1525. }, eTroop.prototype.onclick = function(t) {
  1526.     el.callHandler("troop", "selection=off"), document.getElementById(this.uid).style.border = "1px solid " + (this.team == global.battle.myteam ? "yellow" : "red"), global.battle.selected = this.id
  1527. }, eItem.prototype = new eBase, eItem.prototype.draw = function() {
  1528.     var t = document.getElementById(this.uid),
  1529.         e = 32 * (this.x - map.left()),
  1530.         i = 32 * (this.y - map.top()); - 32 < e && e < 513 && -32 < i && i < 513 ? (t.style.left = e, t.style.top = i, t.style.zIndex = 1 + parseInt(this.y), t.style.display = "block") : t.style.display = "none"
  1531. }, eItem.prototype.onclick = function(t) {}, eItem.prototype.onover = function(t) {
  1532.     var e = "<B>" + this.name + "</B>" + this.stats;
  1533.     global.debug && (e += "<BR>#" + this.id), tip.show(t.clientX, t.clientY, "item", e)
  1534. }, eEquip.prototype = new eBase, eEquip.prototype.handler = function(t) {
  1535.     if ("ask9" == t && 9 == this.state && (global.confirmdel = !0), "bag" == t && this.inbag && this.state < 20) {
  1536.         var e = document.getElementById(this.uid);
  1537.         global.bag != this.bag ? e.style.display = "none" : e.style.display = "block"
  1538.     }
  1539. }, eEquip.prototype.onover = function(t) {
  1540.     var e = "<B>" + this.name + "</B>" + this.stats;
  1541.     0 < this.price && (e += "Wartość: " + this.price), global.debug && (e += "<BR>#" + this.id), tip.show(t.clientX, t.clientY, "item", e)
  1542. }, eEquip.prototype.ondown = function(t) {
  1543.     this.x = t.clientX, this.y = t.clientY;
  1544.     var e = document.getElementById(this.uid),
  1545.         i = document.getElementById("oDrag").style;
  1546.     i.backgroundImage = e.style.backgroundImage, (global.drag = this).mdown = nowms(), tip.hide(), e.style.opacity = .5, e.style.filter = "alpha(opacity=50)", ie6 && (t.cancelBubble = !0), i.display = "block", mousemove(t)
  1547. }, eEquip.prototype.onup = function(t) {
  1548.     var e = document.getElementById(this.uid);
  1549.     global.drag = !1, e.style.opacity = 1, e.style.filter = "", document.getElementById("oDrag").style.display = "none", ie6 && (t.cancelBubble = !0);
  1550.     var i = t.clientX,
  1551.         o = t.clientY;
  1552.     if (i > e1.x && i < e1.x + e1.w && o > e1.y && o < e1.y + e1.h) i > e1.x && i < e1.x + 32 && o > e1.y + 106 && o < e1.y + 138 ? (global.confirmdel = !1, el.callHandler("equip", "ask9"), (!global.confirmdel || "block" != ge("dialog").style.display && confirm("Na pewno zniszczyć przedmiot?")) && dbget("moveitem", "stan=-2&iid=" + this.id)) : 0 <= this.stats.indexOf("Leczy") || 16 == this.itemclass || 0 <= this.stats.indexOf("Zawiera ") ? dbget("moveitem", "stan=-4&iid=" + this.id) : dbget("moveitem", "stan=1&iid=" + this.id);
  1553.     else if (i > b1.x && i < b1.x + b1.w && o > b1.y && o < b1.y + b1.h) {
  1554.         var a = Math.round((i - b1.x - 16) / 33),
  1555.             n = Math.round((o - b1.y - 16) / 33),
  1556.             s = nowms() - this.mdown;
  1557.         s < 0 && (s += 6e4), 24 == this.itemclass && s < 300 && a < 3 ? (global.bag = a, el.callHandler("equip", "bag")) : (6 == n ? 24 == this.itemclass ? dbget("moveitem", "stan=1&iid=" + this.id + "&dx=" + a) : dbget("moveitem", "stan=2&iid=" + this.id + "&bag=" + a) : dbget("moveitem", "stan=0&iid=" + this.id + "&dx=" + a + "&dy=" + n + "&bag=" + global.bag), this.inbag && (this.orgx = 33 * a, this.orgy = 33 * n))
  1558.     } else i > s1.x && i < s1.x + s1.w && o > s1.y && o < s1.y + s1.h && "block" == document.getElementById("shop").style.display ? dbget("shop", "kto=" + hero.talkerid + "&sprzedaj=" + this.id) : i > t1.x && i < t1.x + t1.w && o > t1.y && o < t1.y + t1.h && "block" == document.getElementById("trade").style.display ? i > t2.x && i < t2.x + t2.w && o > t2.y && o < t2.y + t2.h ? dbget("trade", "who=" + global.trader + "&tt=3&it=" + this.id + "&tx=" + Math.min(2, Math.round((i - t2.x) / 33))) : dbget("trade", "who=" + global.trader + "&tt=3&it=" + this.id + "&tx=3") : "block" == ge("mails").style.display && i < 512 && o < 256 ? 0 <= this.stats.indexOf("Związany z właścicielem") ? alert("Przedmiotów związanych nie można wysyłać!") : (global.attitem = this.id, ge("attitem").innerHTML = '<img src="' + this.icon + '" tip="<b>' + this.name + "</B>" + this.stats + '">') : "block" == ge("auctions").style.display && i < 512 ? 0 <= this.stats.indexOf("Związany z właścicielem") ? confirm("Czy na pewno chcesz wystawić przedmiot związany?\nPrzedmiot nie zostanie zwrócony jeśli się nie sprzeda,\njednak możesz zarobić Smocze Łzy jeśli ktoś go kupi.") && newauction(this.id, '<img src="' + this.icon + '" tip="<b>' + this.name + "</B>" + this.stats + '">', 1) : newauction(this.id, '<img src="' + this.icon + '" tip="<b>' + this.name + "</B>" + this.stats + '">', 0) : i < 512 && confirm("Na pewno wyrzucić przedmiot?" + (hero.lvl < 20 ? "\nMożesz zniszczyć przedmiot wkładając go w pole pod mieczem.\nKiedy zaatakujesz potwora, to pole jest automatycznie czyszczone." : "")) && dbget("moveitem", "stan=-1&iid=" + this.id);
  1559.     e.style.left = this.orgx + "px", e.style.top = this.orgy + "px"
  1560. }, eTrade.prototype = new eBase, eTrade.prototype.onover = function(t) {
  1561.     var e = "<B>" + this.name + "</B>" + this.stats;
  1562.     0 < this.price && (e += "Wartość: " + this.price), global.debug && (e += "<BR>#" + this.id), tip.show(t.clientX, t.clientY, "item", e)
  1563. }, eTrade.prototype.ondown = function(t) {
  1564.     if (ie6 && (t.cancelBubble = !0), this.drag) {
  1565.         this.x = t.clientX, this.y = t.clientY;
  1566.         var e = document.getElementById(this.uid),
  1567.             i = document.getElementById("oDrag").style;
  1568.         i.backgroundImage = e.style.backgroundImage, global.drag = this, tip.hide(), e.style.opacity = .5, e.style.filter = "alpha(opacity=50)", i.display = "block", mousemove(t)
  1569.     }
  1570. }, eTrade.prototype.onup = function(t) {
  1571.     if (ie6 && (t.cancelBubble = !0), this.drag) {
  1572.         var e = document.getElementById(this.uid);
  1573.         global.drag = !1, e.style.opacity = 1, e.style.filter = "", document.getElementById("oDrag").style.display = "none";
  1574.         var i = t.clientX,
  1575.             o = t.clientY;
  1576.         i > t1.x && i < t1.x + t1.w && o > t1.y && o < t1.y + t1.h && "block" == document.getElementById("trade").style.display ? i > t2.x && i < t2.x + t2.w && o > t2.y && o < t2.y + t2.h ? dbget("trade", "who=" + global.trader + "&tt=4&it=" + this.id + "&tx=" + Math.min(2, i - t2.x >> 5)) : dbget("trade", "who=" + global.trader + "&tt=4&it=" + this.id + "&tx=3") : dbget("trade", "who=" + global.trader + "&tt=5&it=" + this.id)
  1577.     }
  1578. }, eGateway.prototype = new eBase, eGateway.prototype.draw = function() {
  1579.     var t = document.getElementById(this.uid),
  1580.         e = 32 * (this.x - map.left()),
  1581.         i = 32 * (this.y - map.top()); - 32 < e && e < 513 && -32 < i && i < 513 ? (t.style.left = e, t.style.top = i, t.style.display = "block", ie6 && "" != t.style.background && (t.style.background = "")) : t.style.display = "none"
  1582. }, eGateway.prototype.onover = function(t) {
  1583.     var e = "<B>" + this.name + "</B>";
  1584.     0 < this.lock && (e += "(wymaga klucza)"), tip.show(t.clientX, t.clientY, "gateway", e)
  1585. }, eShop.prototype = new eBase, eShop.prototype.onover = function(t) {
  1586.     var e = "<B>" + this.name + "</B>" + this.stats;
  1587.     e = (e += "<BR>Cena: " + round(this.price, 2)).split("Związany z właścicielem").join("Wiąże po kupieniu"), tip.show(t.clientX, t.clientY, "item", e)
  1588. }, eShop.prototype.ondown = function(t) {
  1589.     this.x = t.clientX, this.y = t.clientY;
  1590.     var e = document.getElementById(this.uid),
  1591.         i = document.getElementById("oDrag").style;
  1592.     i.backgroundImage = e.style.backgroundImage, global.drag = this, tip.hide(), e.style.opacity = .5, e.style.filter = "alpha(opacity=50)", ie6 && (t.cancelBubble = !0), i.display = "block", mousemove(t)
  1593. }, eShop.prototype.onup = function(t) {
  1594.     var e = document.getElementById(this.uid);
  1595.     global.drag = !1, e.style.opacity = 1, e.style.filter = "", document.getElementById("oDrag").style.display = "none", ie6 && (t.cancelBubble = !0);
  1596.     var i = t.clientX,
  1597.         o = t.clientY;
  1598.     i > b1.x && i < b1.x + b1.w && o > b1.y && o < b1.y + b1.h && dbget("shop", "kto=" + hero.talkerid + "&kup=" + this.id + "&bag=" + global.bag), e.style.left = this.orgx + "px", e.style.top = this.orgy + "px"
  1599. }, window.onload = init, window.onerror = loaderror, ImageLoader.prototype.preload = function(t, e, i) {
  1600.     var o = new Image;
  1601.     (this.imgList[this.imgList.length] = o).onload = ImageLoader.prototype.onload, o.onerror = ImageLoader.prototype.onerror, o.onabort = ImageLoader.prototype.onabort, o.callBack = function(t) {
  1602.         return i[e](t)
  1603.     }, o.oImageLoader = this, o.bLoaded = !1, o.src = t
  1604. }, ImageLoader.prototype.onload = function() {
  1605.     this.oImageLoader.nLoaded++, this.callBack(0), this.callBack = function() {}
  1606. }, ImageLoader.prototype.onerror = function() {
  1607.     this.oImageLoader.nErrors++, log(this.src, 2), this.callBack(1)
  1608. }, ImageLoader.prototype.onabort = function() {
  1609.     this.oImageLoader.nErrors++, log(this.src, 2), this.callBack(2)
  1610. }, ImageLoader.prototype.getsize = function(t) {
  1611.     for (var e in this.imgList)
  1612.         if (this.imgList[e].src == t) return new Array(this.imgList[e].width, this.imgList[e].height);
  1613.     return !1
  1614. }, KTILDE = 192, k = new Array, keys = new Array, alts = new Array;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement