Advertisement
arwi74

Robie sobie bota ziomek

Feb 27th, 2020
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Taki bocik Elo
  3. // @version      0.5
  4. // @description  bot na szybko działa na si i ni dodatkowo tylko e2 elo
  5. // @author       arwi74
  6. // @match        http://*.margonem.pl/
  7. // @match        https://*.margonem.pl/
  8. // @grant        none
  9. // ==/UserScript==
  10. (() => {
  11.  
  12.  
  13.     function _instanceof(left, right) {
  14.       if (
  15.         right != null &&
  16.         typeof Symbol !== "undefined" &&
  17.         right[Symbol.hasInstance]
  18.       ) {
  19.         return right[Symbol.hasInstance](left);
  20.       } else {
  21.         return left instanceof right;
  22.       }
  23.     }
  24.  
  25.     function _slicedToArray(arr, i) {
  26.       return (
  27.         _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
  28.       );
  29.     }
  30.  
  31.     function _nonIterableRest() {
  32.       throw new TypeError("Invalid attempt to destructure non-iterable instance");
  33.     }
  34.  
  35.     function _iterableToArrayLimit(arr, i) {
  36.       var _arr = [];
  37.       var _n = true;
  38.       var _d = false;
  39.       var _e = undefined;
  40.       try {
  41.         for (
  42.           var _i = arr[Symbol.iterator](), _s;
  43.           !(_n = (_s = _i.next()).done);
  44.           _n = true
  45.         ) {
  46.           _arr.push(_s.value);
  47.           if (i && _arr.length === i) break;
  48.         }
  49.       } catch (err) {
  50.         _d = true;
  51.         _e = err;
  52.       } finally {
  53.         try {
  54.           if (!_n && _i["return"] != null) _i["return"]();
  55.         } finally {
  56.           if (_d) throw _e;
  57.         }
  58.       }
  59.       return _arr;
  60.     }
  61.  
  62.     function _arrayWithHoles(arr) {
  63.       if (Array.isArray(arr)) return arr;
  64.     }
  65.  
  66.     function _typeof(obj) {
  67.       if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  68.         _typeof = function _typeof(obj) {
  69.           return typeof obj;
  70.         };
  71.       } else {
  72.         _typeof = function _typeof(obj) {
  73.           return obj &&
  74.             typeof Symbol === "function" &&
  75.             obj.constructor === Symbol &&
  76.             obj !== Symbol.prototype
  77.             ? "symbol"
  78.             : typeof obj;
  79.         };
  80.       }
  81.       return _typeof(obj);
  82.     }
  83.  
  84.     function _classCallCheck(instance, Constructor) {
  85.       if (!_instanceof(instance, Constructor)) {
  86.         throw new TypeError("Cannot call a class as a function");
  87.       }
  88.     }
  89.  
  90.     function _defineProperties(target, props) {
  91.       for (var i = 0; i < props.length; i++) {
  92.         var descriptor = props[i];
  93.         descriptor.enumerable = descriptor.enumerable || false;
  94.         descriptor.configurable = true;
  95.         if ("value" in descriptor) descriptor.writable = true;
  96.         Object.defineProperty(target, descriptor.key, descriptor);
  97.       }
  98.     }
  99.  
  100.     function _createClass(Constructor, protoProps, staticProps) {
  101.       if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  102.       if (staticProps) _defineProperties(Constructor, staticProps);
  103.       return Constructor;
  104.     }
  105.  
  106.     (function() {
  107.       var a =
  108.         /*#__PURE__*/
  109.         (function() {
  110.           "use strict";
  111.  
  112.           function a(_a, b, c, d, e, f) {
  113.             _classCallCheck(this, a);
  114.  
  115.             (this.width = b),
  116.               (this.height = c),
  117.               (this.collisions = this.parseCollisions(_a, b, c)),
  118.               (this.additionalCollisions = f || {}),
  119.               (this.start = this.collisions[d.x][d.y]),
  120.               (this.end = this.collisions[e.x][e.y]),
  121.               (this.start.beginning = !0),
  122.               (this.start.g = 0),
  123.               (this.start.f = this.heuristic(this.start, this.end)),
  124.               (this.end.target = !0),
  125.               (this.end.g = 0),
  126.               this.addNeighbours(),
  127.               (this.openSet = []),
  128.               (this.closedSet = []),
  129.               this.openSet.push(this.start);
  130.           }
  131.  
  132.           _createClass(a, [
  133.             {
  134.               key: "parseCollisions",
  135.               value: function parseCollisions(a, c, d) {
  136.                 var e = Array(c);
  137.  
  138.                 for (var f = 0; f < c; f++) {
  139.                   e[f] = Array(d);
  140.  
  141.                   for (var g = 0; g < d; g++) {
  142.                     e[f][g] = new b(f, g, "0" !== a.charAt(f + g * c));
  143.                   }
  144.                 }
  145.  
  146.                 return e;
  147.               }
  148.             },
  149.             {
  150.               key: "addNeighbours",
  151.               value: function addNeighbours() {
  152.                 for (var _a2 = 0; _a2 < this.width; _a2++) {
  153.                   for (var _b = 0; _b < this.height; _b++) {
  154.                     this.addPointNeighbours(this.collisions[_a2][_b]);
  155.                   }
  156.                 }
  157.               }
  158.             },
  159.             {
  160.               key: "addPointNeighbours",
  161.               value: function addPointNeighbours(a) {
  162.                 var _ref = [a.x, a.y],
  163.                   b = _ref[0],
  164.                   c = _ref[1],
  165.                   d = [];
  166.                 0 < b && d.push(this.collisions[b - 1][c]),
  167.                   0 < c && d.push(this.collisions[b][c - 1]),
  168.                   b < this.width - 1 && d.push(this.collisions[b + 1][c]),
  169.                   c < this.height - 1 && d.push(this.collisions[b][c + 1]),
  170.                   (a.neighbours = d);
  171.               }
  172.             },
  173.             {
  174.               key: "anotherFindPath",
  175.               value: function anotherFindPath() {
  176.                 for (; 0 < this.openSet.length; ) {
  177.                   var _a3 = this.getLowestF(),
  178.                     _b2 = this.openSet[_a3];
  179.  
  180.                   if (_b2 === this.end) return this.reconstructPath();
  181.                   this.openSet.splice(_a3, 1), this.closedSet.push(_b2);
  182.                   var _iteratorNormalCompletion = true;
  183.                   var _didIteratorError = false;
  184.                   var _iteratorError = undefined;
  185.  
  186.                   try {
  187.                     for (
  188.                       var _iterator = _b2.neighbours[Symbol.iterator](), _step;
  189.                       !(_iteratorNormalCompletion = (_step = _iterator.next())
  190.                         .done);
  191.                       _iteratorNormalCompletion = true
  192.                     ) {
  193.                       var _a4 = _step.value;
  194.                       if (this.closedSet.includes(_a4)) continue;
  195.                       else {
  196.                         var c = _b2.g + 1;
  197.                         var d = !1;
  198.                         this.end != this.collisions[_a4.x][_a4.y] &&
  199.                         (this.openSet.includes(_a4) ||
  200.                           _a4.collision ||
  201.                           this.additionalCollisions[_a4.x + 256 * _a4.y])
  202.                           ? c < _a4.g && !_a4.collision && (d = !0)
  203.                           : (this.openSet.push(_a4),
  204.                             (_a4.h = this.heuristic(_a4, this.end)),
  205.                             (d = !0)),
  206.                           d &&
  207.                             ((_a4.previous = _b2),
  208.                             (_a4.g = c),
  209.                             (_a4.f = _a4.g + _a4.h));
  210.                       }
  211.                     }
  212.                   } catch (err) {
  213.                     _didIteratorError = true;
  214.                     _iteratorError = err;
  215.                   } finally {
  216.                     try {
  217.                       if (!_iteratorNormalCompletion && _iterator.return != null) {
  218.                         _iterator.return();
  219.                       }
  220.                     } finally {
  221.                       if (_didIteratorError) {
  222.                         throw _iteratorError;
  223.                       }
  224.                     }
  225.                   }
  226.                 }
  227.               }
  228.             },
  229.             {
  230.               key: "getLowestF",
  231.               value: function getLowestF() {
  232.                 var a = 0;
  233.  
  234.                 for (var _b3 = 0; _b3 < this.openSet.length; _b3++) {
  235.                   this.openSet[_b3].f < this.openSet[a].f && (a = _b3);
  236.                 }
  237.  
  238.                 return a;
  239.               }
  240.             },
  241.             {
  242.               key: "reconstructPath",
  243.               value: function reconstructPath() {
  244.                 var a = [];
  245.  
  246.                 for (var _b4 = this.end; _b4 !== this.start; ) {
  247.                   a.push(_b4), (_b4 = _b4.previous);
  248.                 }
  249.  
  250.                 return a;
  251.               }
  252.             },
  253.             {
  254.               key: "heuristic",
  255.               value: function heuristic(a, b) {
  256.                 return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
  257.               }
  258.             }
  259.           ]);
  260.  
  261.           return a;
  262.         })();
  263.  
  264.       var b = function b(a, _b5, c) {
  265.         "use strict";
  266.  
  267.         _classCallCheck(this, b);
  268.  
  269.         (this.x = a),
  270.           (this.y = _b5),
  271.           (this.collision = c),
  272.           (this.g = 1e7),
  273.           (this.f = 1e7),
  274.           (this.neighbours = []),
  275.           (this.beginning = !1),
  276.           (this.target = !1),
  277.           (this.previous = void 0);
  278.       };
  279.  
  280.       new /*#__PURE__*/
  281.       ((function() {
  282.         "use strict";
  283.  
  284.         function _class() {
  285.           _classCallCheck(this, _class);
  286.  
  287.           (this.storage = JSON.parse(localStorage.getItem("arwi-bot-storage")) || {
  288.             x: 0,
  289.             y: 0,
  290.             name: "",
  291.             minimalized: !1
  292.           }),
  293.             (this.interface =
  294.               "object" == _typeof(window.Engine)
  295.                 ? "ni"
  296.                 : "object" == _typeof(window.g)
  297.                   ? "si"
  298.                   : "none"),
  299.             (this.lootfilterSettings = JSON.parse(
  300.               localStorage.getItem("arwi-bot-lootfilterSettings")
  301.             ) || {
  302.               stat: {
  303.               },
  304.               names: []
  305.             }),
  306.             (this.QuickGroupSettings = JSON.parse(
  307.               localStorage.getItem("arwi-bot-QuickGroupSettings12")
  308.             ) || {
  309.               adding: {
  310.                 translation: "Automatycznie dodawaj do grupy znaj/klan",
  311.                 active: 0
  312.               },
  313.               accepting: {
  314.                 translation: "Automatycznie przyjmuj zaproszenia do grupy",
  315.                 active: 0
  316.               },
  317.               reSendingMessage: {
  318.                 translation: "Automatycznie odpisuj innym graczom",
  319.                 active: 0
  320.               }
  321.             }),
  322.             (this.npcToKillId = void 0),
  323.             (this.lastAttackTimestamp = this.timeStamp),
  324.             (this.timerData = JSON.parse(this.getCookie("arwi-bot-timer")) || {}),
  325.             (this.refreshTime = [3, 6]),
  326.             (this.delayToRelog = 40),
  327.             (this.waitForNpcRespawn = 120),
  328.             (this.randomAnswers = [
  329.  
  330.             ]),
  331.             (this.answersBeforeAddingToEnemies = [
  332.  
  333.             ]),
  334.             (this.messagesInc =
  335.               JSON.parse(localStorage.getItem("arwi-bot-messages")) || {}),
  336.             (this.isHealing = !1),
  337.             (this.isActuallySendingMessage = !1),
  338.             (this.startInctementingLagRefresher = !1),
  339.             (this.incrementValue = 0),
  340.             this.init();
  341.         }
  342.         _createClass(_class, [
  343.           {
  344.             key: "getNpcColsNI",
  345.             value: function getNpcColsNI() {
  346.               var a = {};
  347.  
  348.               var _arr = Object.values(this.npcs);
  349.  
  350.               for (var _i = 0; _i < _arr.length; _i++) {
  351.                 var _arr$_i = _arr[_i],
  352.                   _b6 = _arr$_i.x,
  353.                   c = _arr$_i.y;
  354.                 a[_b6 + 256 * c] = !0;
  355.               }
  356.  
  357.               return a;
  358.             }
  359.           },
  360.           {
  361.             key: "chatParser",
  362.             value: function chatParser() {
  363.               var _this = this;
  364.  
  365.               "ni" === this.interface &&
  366.                 window.API.addCallbackToEvent("newMsg", function(_ref2) {
  367.                   var _ref3 = _slicedToArray(_ref2, 2),
  368.                     a = _ref3[0],
  369.                     b = _ref3[1];
  370.  
  371.                   _this.chatFilter(b);
  372.                 }),
  373.                 "si" === this.interface &&
  374.                   window.g.chat.parsers.push(function(a) {
  375.                     _this.chatFilter(a);
  376.                   });
  377.             }
  378.           },
  379.           {
  380.             key: "chatFilter",
  381.             value: function chatFilter(a) {
  382.               var b = a.n,
  383.                 c = a.t,
  384.                 d = a.ts,
  385.                 e = a.k;
  386.  
  387.               if (
  388.                 "" !== b &&
  389.                 b !== this.hero.nick &&
  390.                 "System" !== b &&
  391.                 !1 !== this.QuickGroupSettings.reSendingMessage.active &&
  392.                 5 >= window.unix_time(!0) - d &&
  393.                 !this.isActuallySendingMessage
  394.               ) {
  395.                 if (
  396.                   void 0 !== this.messagesInc[b + this.world] &&
  397.                   3 < this.messagesInc[b + this.world]
  398.                 )
  399.                   return;
  400.                 c.toLowerCase().includes(this.hero.nick.toLowerCase()) &&
  401.                   0 === e &&
  402.                   this.sendMessage(b, e),
  403.                   3 === e && this.sendMessage(b, e);
  404.               }
  405.             }
  406.           },
  407.           {
  408.             key: "sendMessage",
  409.             value: function sendMessage(a, b) {
  410.             }
  411.           },
  412.           {
  413.             key: "Sleep",
  414.             value: function Sleep(a) {
  415.               return new Promise(function(b) {
  416.                 setTimeout(function() {
  417.                   b(null);
  418.                 }, a);
  419.               });
  420.             }
  421.           },
  422.           {
  423.             key: "saveMessages",
  424.             value: function saveMessages() {
  425.             }
  426.           },
  427.           {
  428.             key: "addToEnemy",
  429.             value: function addToEnemy(a) {
  430.               window._g("friends&a=eadd&nick=".concat(a));
  431.             }
  432.           },
  433.           {
  434.             key: "getWay",
  435.             value: function getWay(b, c) {
  436.               return new a(
  437.                 this.collisions,
  438.                 this.map.x,
  439.                 this.map.y,
  440.                 {
  441.                   x: this.hero.x,
  442.                   y: this.hero.y
  443.                 },
  444.                 {
  445.                   x: b,
  446.                   y: c
  447.                 },
  448.                 this.npccol
  449.               ).anotherFindPath();
  450.             }
  451.           },
  452.           {
  453.             key: "goTo",
  454.             value: function goTo(a, b) {
  455.               var c = this.getWay(a, b);
  456.               Array.isArray(c) &&
  457.                 ("ni" === this.interface
  458.                   ? (window.Engine.hero.autoPath = c)
  459.                   : (window.road = c));
  460.             }
  461.           },
  462.           {
  463.             key: "getDistanceToNpc",
  464.             value: function getDistanceToNpc(a, b) {
  465.               var c = this.getWay(a, b);
  466.               return Array.isArray(c) ? c.length : void 0;
  467.             }
  468.           },
  469.           {
  470.             key: "updateCollisions",
  471.             value: function updateCollisions() {
  472.               var a = [],
  473.                 _this$map = this.map,
  474.                 b = _this$map.x,
  475.                 c = _this$map.y;
  476.  
  477.               for (var d = 0; d < c; d++) {
  478.                 for (var _c = 0; _c < b; _c++) {
  479.                   a.push(window.Engine.map.col.check(_c, d));
  480.                 }
  481.               }
  482.  
  483.               return a.join("");
  484.             }
  485.           },
  486.           {
  487.             key: "initBox",
  488.             value: function initBox() {
  489.               var _this3 = this;
  490.  
  491.               var a = document.createElement("div");
  492.               a.classList.add("arwi-bot-box"),
  493.                 this.appendText(a, "Podaj nazwe e2");
  494.               var b = document.createElement("input");
  495.               (b.type = "text"),
  496.                 b.classList.add("arwi-bot-input-text"),
  497.                 (b.value = this.storage.name),
  498.                 b.addEventListener("keyup", function() {
  499.                   (_this3.storage.name = b.value), _this3.saveStorage();
  500.                 }),
  501.                 a.appendChild(b)
  502.  
  503.  
  504.  
  505.               this.makeBoxDraggable(a, function() {
  506.                 (_this3.storage.x = parseInt(a.style.left)),
  507.                   (_this3.storage.y = parseInt(a.style.top)),
  508.                   _this3.saveStorage(),
  509.                   window.message(
  510.                     '<span style="color: red">Zapisano pozycj\u0119 okna</span>'
  511.                   );
  512.               }),
  513.                 this.storage.hasOwnProperty("minimalized") ||
  514.                   ((this.storage.minimalized = !1), this.saveStorage()),
  515.                 a.addEventListener("dblclick", function(_ref4) {
  516.                   var b = _ref4.x,
  517.                     c = _ref4.y;
  518.                   !1 === _this3.storage.minimalized
  519.                     ? ((a.style.width = "10px"),
  520.                       (a.style.height = "10px"),
  521.                       (_this3.storage.minimalized = !0),
  522.                       _this3.changeVisibility(a, !0))
  523.                     : ((a.style.width = "160px"),
  524.                       (a.style.height = "190px"),
  525.                       (_this3.storage.minimalized = !1),
  526.                       _this3.changeVisibility(a, !1)),
  527.                     (a.style.left = b - parseInt(a.style.width) / 2 + "px"),
  528.                     (a.style.top = c - parseInt(a.style.height) / 2 + "px"),
  529.                     (_this3.storage.x = parseInt(a.style.left)),
  530.                     (_this3.storage.y = parseInt(a.style.top)),
  531.                     _this3.saveStorage();
  532.                 }),
  533.                 "ni" === this.interface
  534.                   ? document.querySelector(".game-window-positioner").appendChild(a)
  535.                   : document.body.appendChild(a),
  536.                 this.initStyle(),
  537.                 !0 === this.storage.minimalized &&
  538.                   ((a.style.width = "10px"),
  539.                   (a.style.height = "10px"),
  540.                   this.changeVisibility(a, !0));
  541.             }
  542.           },
  543.           {
  544.             key: "changeVisibility",
  545.             value: function changeVisibility(a, b) {
  546.               var _iteratorNormalCompletion2 = true;
  547.               var _didIteratorError2 = false;
  548.               var _iteratorError2 = undefined;
  549.  
  550.               try {
  551.                 for (
  552.                   var _iterator2 = a.childNodes[Symbol.iterator](), _step2;
  553.                   !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done);
  554.                   _iteratorNormalCompletion2 = true
  555.                 ) {
  556.                   var c = _step2.value;
  557.                   c.style.display = !0 === b ? "none" : "";
  558.                 }
  559.               } catch (err) {
  560.                 _didIteratorError2 = true;
  561.                 _iteratorError2 = err;
  562.               } finally {
  563.                 try {
  564.                   if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  565.                     _iterator2.return();
  566.                   }
  567.                 } finally {
  568.                   if (_didIteratorError2) {
  569.                     throw _iteratorError2;
  570.                   }
  571.                 }
  572.               }
  573.             }
  574.           },
  575.           {
  576.             key: "appendText",
  577.             value: function appendText(a, b) {
  578.               var c = document.createElement("div");
  579.               c.appendChild(document.createTextNode(b)), a.appendChild(c);
  580.             }
  581.           },
  582.           {
  583.             key: "createCheckBox",
  584.             value: function createCheckBox(a, b, c, d) {
  585.               var e = document.createElement("div"),
  586.                 f = document.createElement("input");
  587.               (f.type = "checkbox"),
  588.                 (f.name = b + "arwi-bot"),
  589.                 (f.id = b + "arwi-bot"),
  590.                 (f.checked = c),
  591.                 e.appendChild(f);
  592.               var g = document.createElement("label");
  593.               g.setAttribute("for", b + "arwi-bot"),
  594.                 (g.innerHTML = b),
  595.                 f.addEventListener("change", function() {
  596.                   d(f.checked);
  597.                 }),
  598.                 e.appendChild(g),
  599.                 a.appendChild(e);
  600.             }
  601.           },
  602.           {
  603.             key: "makeBoxDraggable",
  604.             value: function makeBoxDraggable(a, b) {
  605.               $(a).draggable({
  606.                 containment: "window",
  607.                 stop: b
  608.               });
  609.             }
  610.           },
  611.           {
  612.             key: "saveStorage",
  613.             value: function saveStorage() {
  614.               localStorage.setItem("arwi-bot-storage", JSON.stringify(this.storage));
  615.             }
  616.           },
  617.           {
  618.             key: "initStyle",
  619.             value: function initStyle() {
  620.               var a = document.createElement("style"),
  621.                 b = "\n            .arwi-bot-box {\n                position: absolute;\n                text-align: center;\n                padding: 10px;\n                height: 40px;\n                width: 200px;\n                left: "
  622.                   .concat(this.storage.x, "px;\n                top: ")
  623.                   .concat(
  624.                     this.storage.y,
  625.                     "px;\n                background: #253952;\n                border: 1px solid white;\n                border-rarwius: 5px;\n                color: white;\n                z-index: 999;\n            }\n            .arwi-bot-input-text {\n                text-align: center;\n                border: 2px solid lightblue;\n                border-rarwius: 3px;\n                color: black;\n                cursor: text;\n            }\n            "
  626.                   );
  627.               (a.type = "text/css"),
  628.                 a.appendChild(document.createTextNode(b)),
  629.                 document.head.appendChild(a);
  630.             }
  631.           },
  632.           {
  633.             key: "initNewNpc",
  634.             value: function initNewNpc() {
  635.               var _this4 = this;
  636.  
  637.               if (
  638.                 ("ni" === this.interface &&
  639.                   (window.API.addCallbackToEvent("newNpc", function(a) {
  640.                     void 0 !== a && _this4.addNpcs(a.d);
  641.                   }),
  642.                   window.API.addCallbackToEvent("removeNpc", function(a) {
  643.                     void 0 !== a && _this4.removeNpcs(a.d);
  644.                   })),
  645.                 "si" === this.interface)
  646.               ) {
  647.                 var _a5 = window.newNpc;
  648.  
  649.                 window.newNpc = function(b) {
  650.                   if (void 0 !== b) {
  651.                     var _arr4 = Object.entries(b);
  652.  
  653.                     for (var _i4 = 0; _i4 < _arr4.length; _i4++) {
  654.                       var _arr4$_i = _slicedToArray(_arr4[_i4], 2),
  655.                         _a6 = _arr4$_i[0],
  656.                         c = _arr4$_i[1];
  657.  
  658.                       void 0 !== c.del && void 0 !== window.g.npc[_a6]
  659.                         ? _this4.removeNpcs(window.g.npc[_a6], _a6)
  660.                         : void 0 !== c && _this4.addNpcs(c, _a6);
  661.                     }
  662.                   }
  663.  
  664.                   _a5(b);
  665.                 };
  666.               }
  667.             }
  668.           },
  669.           {
  670.             key: "initNewOther",
  671.             value: function initNewOther() {
  672.               var _this5 = this;
  673.  
  674.               if (
  675.                 ("ni" === this.interface &&
  676.                   (this.makeParty(),
  677.                   window.API.addCallbackToEvent("newOther", function(a) {
  678.                     _this5.filterOther(a.d);
  679.                   })),
  680.                 "si" === this.interface)
  681.               ) {
  682.                 this.makeParty();
  683.                 var _a7 = window.newOther;
  684.  
  685.                 window.newOther = function(b) {
  686.                   if ((_a7(b), void 0 !== b)) {
  687.                     var _arr5 = Object.values(b);
  688.  
  689.                     for (var _i5 = 0; _i5 < _arr5.length; _i5++) {
  690.                       var _a8 = _arr5[_i5];
  691.  
  692.                       _this5.filterOther(_a8);
  693.                     }
  694.                   }
  695.                 };
  696.               }
  697.             }
  698.           },
  699.           {
  700.             key: "filterOther",
  701.             value: function filterOther(a) {
  702.               if (a !== void 0) {
  703.                 var _b8 = a.relation,
  704.                   c = a.id;
  705.                 !0 === this.canHeroTryToAttack() &&
  706.                   ["cl", "fr"].includes(_b8) &&
  707.                   !0 === this.QuickGroupSettings.adding.active &&
  708.                   this.sendInviteToParty(c);
  709.               }
  710.             }
  711.           },
  712.           {
  713.             key: "makeParty",
  714.             value: function makeParty() {
  715.               if ("object" != _typeof(this.party)) return this.sendInvites();
  716.               var a =
  717.                 "ni" === this.interface
  718.                   ? this.party.getLeaderId() === this.hero.id
  719.                   : 1 === this.party[this.hero.id].r;
  720.               !0 == a && this.sendInvites();
  721.             }
  722.           },
  723.           {
  724.             key: "sendInvites",
  725.             value: function sendInvites() {
  726.               if (this.others !== void 0) {
  727.                 var _arr6 = Object.values(this.others);
  728.  
  729.                 for (var _i6 = 0; _i6 < _arr6.length; _i6++) {
  730.                   var _a9 = _arr6[_i6];
  731.                   this.filterOther(_a9);
  732.                 }
  733.               }
  734.             }
  735.           },
  736.           {
  737.             key: "sendInviteToParty",
  738.             value: function sendInviteToParty(a) {
  739.               window._g("party&a=inv&id=".concat(a));
  740.             }
  741.           },
  742.           {
  743.             key: "initChecker",
  744.             value: function initChecker() {
  745.               var _this6 = this;
  746.  
  747.               if (
  748.                 (setTimeout(function() {
  749.                   _this6.initChecker();
  750.                 }, 500),
  751.                 !0 === this.dead &&
  752.                   (this.removeNpcsFromThisCharId(this.hero.id), this.logout()),
  753.                 !0 === this.canHeroTryToAttack())
  754.               )
  755.                 try {
  756.                   if (void 0 !== this.npcToKillId) {
  757.                     var _this$npcs$this$npcTo = this.npcs[this.npcToKillId],
  758.                       _a10 = _this$npcs$this$npcTo.x,
  759.                       _b9 = _this$npcs$this$npcTo.y;
  760.                     1 >= Math.abs(this.hero.x - _a10) &&
  761.                     1 >= Math.abs(this.hero.y - _b9)
  762.                       ? 0 < this.timeStamp - this.lastAttackTimestamp &&
  763.                         window._g(
  764.                           "fight&a=attack&ff=1&id=-".concat(this.npcToKillId),
  765.                           function(a) {
  766.                             return a.hasOwnProperty("alert") &&
  767.                               a.alert.includes(
  768.                                 "Przeciwnik walczy ju\u017C z kim\u015B innym"
  769.                               )
  770.                               ? void (_this6.lastAttackTimestamp =
  771.                                   _this6.timeStamp + 2)
  772.                               : void (_this6.lastAttackTimestamp =
  773.                                   _this6.timeStamp + 1);
  774.                           }
  775.                         )
  776.                       : this.goTo(_a10, _b9);
  777.                   } else this.reFindNpcs();
  778.                 } catch (a) {
  779.                   this.npcToKillId = void 0;
  780.                 }
  781.             }
  782.           },
  783.           {
  784.             key: "canHeroTryToAttack",
  785.             value: function canHeroTryToAttack() {
  786.               return !(this.battle || this.dead);
  787.             }
  788.           },
  789.           {
  790.             key: "removeNpcs",
  791.             value: function removeNpcs(a) {
  792.               var b = a.x,
  793.                 c = a.y,
  794.                 d = a.nick,
  795.                 e = a.lvl;
  796.               "ni" === this.interface
  797.                 ? window.Engine.map.col.unset(
  798.                     b,
  799.                     c,
  800.                     window.Engine.map.col.check(b, c)
  801.                   )
  802.                 : window.map.nodes.changeCollision(b, c, 0),
  803.                 this.storage.name !== void 0 &&
  804.                   this.storage.name.toLowerCase().includes(d.toLowerCase()) &&
  805.                   (this.addNpcToTimer(d, e),
  806.                   (this.npcToKillId = void 0),
  807.                   this.reFindNpcs());
  808.             }
  809.           },
  810.           {
  811.             key: "findEilteIIName",
  812.             value: function findEilteIIName(a) {
  813.               var _arr7 = Object.values(this.npcs);
  814.  
  815.               for (var _i7 = 0; _i7 < _arr7.length; _i7++) {
  816.                 var _b10 = _arr7[_i7];
  817.                 var c = _b10.nick,
  818.                   d = _b10.lvl,
  819.                   e = _b10.grp,
  820.                   f = _b10.wt;
  821.                 if (e === a && 19 < f) return [c, d];
  822.               }
  823.             }
  824.           },
  825.           {
  826.             key: "addNpcs",
  827.             value: function addNpcs(a, b) {
  828.               "ni" === this.interface && (b = a.id), this.filterNpc(a, b);
  829.             }
  830.           },
  831.           {
  832.             key: "isNpcFake",
  833.             value: function isNpcFake(a, b) {
  834.               var c = new Image(),
  835.                 d = document.createElement("canvas").getContext("2d"),
  836.                 e = function e() {
  837.                   var a = d.getImageData(Math.floor(d.width / 2), 0, 1, d.height)
  838.                     .data;
  839.  
  840.                   for (var _c2 = 3; _c2 < a.length; _c2 += 4) {
  841.                     if (0 < a[_c2]) return b(!1);
  842.                   }
  843.  
  844.                   return b(!0);
  845.                 };
  846.  
  847.               (c.onload = function() {
  848.                 (d.width = this.width),
  849.                   (d.height = this.height),
  850.                   d.drawImage(c, 0, 0),
  851.                   e();
  852.               }),
  853.                 (c.src = a);
  854.             }
  855.           },
  856.           {
  857.             key: "filterNpc",
  858.             value: function filterNpc(a, b) {
  859.               var _this7 = this;
  860.  
  861.               var c = a.nick,
  862.                 d = a.icon,
  863.                 e = a.type,
  864.                 f = a.wt,
  865.                 g = a.grp;
  866.  
  867.               if (
  868.                 !((2 !== e && 3 !== e) || 10 > f || void 0 === c) &&
  869.                 void 0 === this.npcToKillId &&
  870.                 this.storage.name.toLowerCase().includes(c.toLowerCase()) &&
  871.                 "" !== this.storage.name &&
  872.                 null !== this.storage.name
  873.               ) {
  874.                 var _a11 = d.includes("/obrazki/npc/")
  875.                   ? d
  876.                   : "/obrazki/npc/".concat(d);
  877.  
  878.                 this.isNpcFake(_a11, function(a) {
  879.                   !1 === a &&
  880.                     ((_this7.npcToKillId =
  881.                       0 === g
  882.                         ? parseInt(b)
  883.                         : parseInt(_this7.findBestNpcFromGrp(g))),
  884.                     _this7.makeParty());
  885.                 });
  886.               }
  887.             }
  888.           },
  889.           {
  890.             key: "findBestNpcFromGrp",
  891.             value: function findBestNpcFromGrp(a) {
  892.               var b,
  893.                 c = 999999;
  894.  
  895.               var _arr8 = Object.entries(this.npcs);
  896.  
  897.               for (var _i8 = 0; _i8 < _arr8.length; _i8++) {
  898.                 var _arr8$_i = _slicedToArray(_arr8[_i8], 2),
  899.                   d = _arr8$_i[0],
  900.                   e = _arr8$_i[1];
  901.  
  902.                 var f = e.x,
  903.                   g = e.y,
  904.                   h = e.grp;
  905.  
  906.                 if (a === h) {
  907.                   var _a12 = this.getDistanceToNpc(f, g);
  908.  
  909.                   _a12 < c && ((b = d), (c = _a12));
  910.                 }
  911.               }
  912.  
  913.               return b;
  914.             }
  915.           },
  916.           {
  917.             key: "reFindNpcs",
  918.             value: function reFindNpcs() {
  919.               var _arr9 = Object.entries(this.npcs);
  920.  
  921.               for (var _i9 = 0; _i9 < _arr9.length; _i9++) {
  922.                 var _arr9$_i = _slicedToArray(_arr9[_i9], 2),
  923.                   _a13 = _arr9$_i[0],
  924.                   _b11 = _arr9$_i[1];
  925.  
  926.                 this.filterNpc(_b11, _a13);
  927.               }
  928.             }
  929.           },
  930.           {
  931.             key: "logout",
  932.             value: function logout() {
  933.             }
  934.           },
  935.           {
  936.             key: "logIn",
  937.             value: function logIn(a, b) {
  938.             }
  939.           },
  940.           {
  941.             key: "getNewRespawnTime",
  942.             value: function getNewRespawnTime(a) {
  943.               return Math.round(
  944.                 (1 *
  945.                   (60 *
  946.                     (200 < a
  947.                       ? 18
  948.                       : Math.min(18, 0.7 + 0.18 * a - 45e-5 * a * a)))) /
  949.                   parseInt(this.serverTimerSpeed)
  950.               );
  951.             }
  952.           },
  953.           {
  954.             key: "addNpcToTimer",
  955.             value: function addNpcToTimer(a, b) {
  956.               var c = this.mapName;
  957.               (this.timerData[a + this.world] = {
  958.                 name: a,
  959.                 lvl: b,
  960.                 mapName: c,
  961.                 nextRespawn: this.timeStamp + this.getNewRespawnTime(b),
  962.                 charId: this.hero.id,
  963.                 world: this.world
  964.               }),
  965.                 this.saveTimersCookies();
  966.             }
  967.           },
  968.           {
  969.             key: "deleteNpcFromTimer",
  970.             value: function deleteNpcFromTimer(a) {
  971.               this.timerData[a] !== void 0 &&
  972.                 (delete this.timerData[a], this.saveTimersCookies());
  973.             }
  974.           },
  975.           {
  976.             key: "removeNpcsFromThisCharId",
  977.             value: function removeNpcsFromThisCharId(a) {
  978.               if (void 0 !== a) {
  979.                 var _arr10 = Object.entries(this.timerData);
  980.  
  981.                 for (var _i10 = 0; _i10 < _arr10.length; _i10++) {
  982.                   var _arr10$_i = _slicedToArray(_arr10[_i10], 2),
  983.                     _b12 = _arr10$_i[0],
  984.                     c = _arr10$_i[1];
  985.  
  986.                   c.charId == a && this.deleteNpcFromTimer(_b12);
  987.                 }
  988.               }
  989.             }
  990.           },
  991.           {
  992.             key: "checkTimers",
  993.             value: function checkTimers() {
  994.               var _arr11 = Object.entries(this.timerData);
  995.  
  996.               for (var _i11 = 0; _i11 < _arr11.length; _i11++) {
  997.                 var _arr11$_i = _slicedToArray(_arr11[_i11], 2),
  998.                   _a14 = _arr11$_i[0],
  999.                   _b13 = _arr11$_i[1];
  1000.  
  1001.                 _b13.nextRespawn + this.waitForNpcRespawn < this.timeStamp &&
  1002.                   this.createNewRespawnTime(_a14);
  1003.               }
  1004.             }
  1005.           },
  1006.           {
  1007.             key: "createNewRespawnTime",
  1008.             value: function createNewRespawnTime(a) {
  1009.               var _this8 = this;
  1010.  
  1011.               if (
  1012.                 !(
  1013.                   Object.values(this.npcs).some(function(b) {
  1014.                     return b.nick == _this8.timerData[a].name;
  1015.                   }) || this.timerData[a].charId !== this.hero.id
  1016.                 )
  1017.               ) {
  1018.                 for (; this.timeStamp > this.timerData[a].nextRespawn; ) {
  1019.                   this.timerData[a].nextRespawn += this.getNewRespawnTime(
  1020.                     this.timerData[a].lvl
  1021.                   );
  1022.                 }
  1023.  
  1024.                 this.saveTimersCookies();
  1025.               }
  1026.             }
  1027.           },
  1028.           {
  1029.             key: "isThisHeroIssetInTimer",
  1030.             value: function isThisHeroIssetInTimer(b) {
  1031.               return (
  1032.                 void 0 !== b &&
  1033.                 Object.values(this.timerData).some(function(c) {
  1034.                   return c.charId == b;
  1035.                 })
  1036.               );
  1037.             }
  1038.           },
  1039.           {
  1040.             key: "isntTimersInRange",
  1041.             value: function isntTimersInRange() {
  1042.               var _this9 = this;
  1043.  
  1044.               return Object.values(this.timerData).every(function(b) {
  1045.                 return b.nextRespawn - _this9.timeStamp > _this9.delayToRelog;
  1046.               });
  1047.             }
  1048.           },
  1049.           {
  1050.             key: "checkHeroOnGoodMap",
  1051.             value: function checkHeroOnGoodMap(a) {
  1052.               var _arr12 = Object.entries(this.timerData);
  1053.  
  1054.               for (var _i12 = 0; _i12 < _arr12.length; _i12++) {
  1055.                 var _arr12$_i = _slicedToArray(_arr12[_i12], 2),
  1056.                   _b14 = _arr12$_i[0],
  1057.                   c = _arr12$_i[1];
  1058.  
  1059.                 var d = c.mapName,
  1060.                   e = c.charId;
  1061.                 e == a &&
  1062.                   this.mapName !== void 0 &&
  1063.                   d !== void 0 &&
  1064.                   d !== this.mapName &&
  1065.                   this.deleteNpcFromTimer(_b14);
  1066.               }
  1067.             }
  1068.           },
  1069.           {
  1070.             key: "initTimer",
  1071.             value: function initTimer() {
  1072.               var _this10 = this;
  1073.  
  1074.               if (0 < Object.keys(this.timerData).length)
  1075.                 if ("none" === this.interface) {
  1076.                   if (
  1077.                     Object.values(this.timerData).some(function(b) {
  1078.                       return (
  1079.                         b.nextRespawn - _this10.timeStamp <= _this10.delayToRelog
  1080.                       );
  1081.                     })
  1082.                   ) {
  1083.                     var _Object$values$reduce = Object.values(
  1084.                         this.timerData
  1085.                       ).reduce(function(c, a) {
  1086.                         return c.nextRespawn <= a.nextRespawn ? c : a;
  1087.                       }),
  1088.                       _a15 = _Object$values$reduce.world,
  1089.                       _b15 = _Object$values$reduce.charId;
  1090.  
  1091.                     void 0 !== _b15 && this.logIn(_b15, _a15);
  1092.                   }
  1093.                 } else if (
  1094.                   this.isntTimersInRange() &&
  1095.                   this.isThisHeroIssetInTimer(this.hero.id)
  1096.                 )
  1097.                   this.logout();
  1098.                 else {
  1099.                   this.checkHeroOnGoodMap(this.hero.id);
  1100.  
  1101.                   var _a16 = Object.values(this.timerData).filter(function(b) {
  1102.                     return (
  1103.                       b.nextRespawn - _this10.timeStamp <= _this10.delayToRelog
  1104.                     );
  1105.                   });
  1106.  
  1107.                   if (0 < _a16.length) {
  1108.                     var _a16$reduce = _a16.reduce(function(c, a) {
  1109.                         return c.nextRespawn <= a.nextRespawn ? c : a;
  1110.                       }),
  1111.                       _b16 = _a16$reduce.charId,
  1112.                       c = _a16$reduce.world;
  1113.  
  1114.                     void 0 !== this.hero.id &&
  1115.                       parseInt(_b16) !== this.hero.id &&
  1116.                       this.logIn(_b16, c);
  1117.                   }
  1118.                 }
  1119.               this.checkTimers(),
  1120.                 setTimeout(function() {
  1121.                   _this10.initTimer();
  1122.                 }, 500);
  1123.             }
  1124.           },
  1125.           {
  1126.             key: "saveTimersCookies",
  1127.             value: function saveTimersCookies() {
  1128.               var a = new Date();
  1129.               a.setMonth(a.getMonth() + 1),
  1130.                 this.setCookie(
  1131.                   "arwi-bot-timer",
  1132.                   JSON.stringify(this.timerData),
  1133.                   a,
  1134.                   "/",
  1135.                   "margonem.pl"
  1136.                 );
  1137.             }
  1138.           },
  1139.           {
  1140.             key: "randomSeconds",
  1141.             value: function randomSeconds(a, b) {
  1142.               return (
  1143.                 (a *= 60), (b *= 60), Math.floor(Math.random() * (b - a + 1)) + a
  1144.               );
  1145.             }
  1146.           },
  1147.           {
  1148.             key: "randomRefresh",
  1149.             value: function randomRefresh() {
  1150.               var _this$refreshTime = _slicedToArray(this.refreshTime, 2),
  1151.                 a = _this$refreshTime[0],
  1152.                 b = _this$refreshTime[1];
  1153.  
  1154.               setTimeout(function() {
  1155.                 location.href = location.href;
  1156.               }, 1e3 * this.randomSeconds(a, b));
  1157.             }
  1158.           },
  1159.           {
  1160.             key: "getCookie",
  1161.             value: function getCookie(a) {
  1162.               var b = document.cookie,
  1163.                 c = a + "=";
  1164.               var d = b.indexOf("; " + c);
  1165.               if (-1 != d) d += 2;
  1166.               else if (((d = b.indexOf(c)), 0 != d)) return null;
  1167.               var e = document.cookie.indexOf(";", d);
  1168.               return (
  1169.                 -1 == e && (e = b.length), unescape(b.substring(d + c.length, e))
  1170.               );
  1171.             }
  1172.           },
  1173.           {
  1174.             key: "setCookie",
  1175.             value: function setCookie(a, b, c, d, e, f) {
  1176.               var g =
  1177.                 a +
  1178.                 "=" +
  1179.                 escape(b) +
  1180.                 (c ? "; expires=" + c.toGMTString() : "") +
  1181.                 (d ? "; path=" + d : "") +
  1182.                 (e ? "; domain=" + e : "") +
  1183.                 (f ? "; secure" : "");
  1184.               document.cookie = g;
  1185.             }
  1186.           },
  1187.           {
  1188.             key: "createTimerOnMainPage",
  1189.             value: function createTimerOnMainPage() {
  1190.             }
  1191.           },
  1192.           {
  1193.             key: "addNpcsToTimerBox",
  1194.             value: function addNpcsToTimerBox(a) {
  1195.             }
  1196.           },
  1197.           {
  1198.             key: "capitalizeWorld",
  1199.             value: function capitalizeWorld(a) {
  1200.               return a.charAt(0).toUpperCase() + a.slice(1) + ":";
  1201.             }
  1202.           },
  1203.           {
  1204.             key: "getTimeToRespawn",
  1205.             value: function getTimeToRespawn(a, b) {
  1206.               var c = b - this.timeStamp,
  1207.                 d =
  1208.                   10 > parseInt(c / 60)
  1209.                     ? "0".concat(parseInt(c / 60))
  1210.                     : parseInt(c / 60),
  1211.                 e = 10 > c % 60 ? "0".concat(c % 60) : c % 60;
  1212.               return ""
  1213.                 .concat(a, ": ")
  1214.                 .concat(d, ":")
  1215.                 .concat(e);
  1216.             }
  1217.           },
  1218.           {
  1219.             key: "removeLockAdding",
  1220.             value: function removeLockAdding() {
  1221.               "ni" === this.interface &&
  1222.                 (window.Engine.lock.add = Function.prototype),
  1223.                 "si" === this.interface && (window.g.lock.add = Function.prototype),
  1224.                 (window.mAlert = Function.prototype);
  1225.             }
  1226.           },
  1227.           {
  1228.             key: "parseAjaxData",
  1229.             value: function parseAjaxData(a) {
  1230.               if (
  1231.                 (((a.hasOwnProperty("d") && "stop" === a.d) ||
  1232.                   (a.hasOwnProperty("t") && "stop" === a.t)) &&
  1233.                   this.Sleep(2500).then(function() {
  1234.                     location.href = location.href;
  1235.                   }),
  1236.                 (this.incrementValue = 0),
  1237.                 a.hasOwnProperty("loot") &&
  1238.                   a.hasOwnProperty("item") &&
  1239.                   a.loot.hasOwnProperty("init") &&
  1240.                   a.loot.hasOwnProperty("source") &&
  1241.                   0 < a.loot.init &&
  1242.                   "fight" === a.loot.source)
  1243.               ) {
  1244.                 var _b20 = [],
  1245.                   c = [];
  1246.  
  1247.                 var _arr15 = Object.entries(a.item);
  1248.  
  1249.                 for (var _i15 = 0; _i15 < _arr15.length; _i15++) {
  1250.                   var _arr15$_i = _slicedToArray(_arr15[_i15], 2),
  1251.                     d = _arr15$_i[0],
  1252.                     e = _arr15$_i[1];
  1253.  
  1254.                   var _a19 = e.stat,
  1255.                     f = e.name;
  1256.                   !0 === this.isGoodItem(_a19, f) ? _b20.push(d) : c.push(d);
  1257.                 }
  1258.  
  1259.                 this.sendLoots(_b20, c);
  1260.               }
  1261.  
  1262.               a.hasOwnProperty("f") &&
  1263.                 a.f.hasOwnProperty("move") &&
  1264.                 a.f.hasOwnProperty("current") &&
  1265.                 0 === a.f.current &&
  1266.                 -1 === a.f.move &&
  1267.                 (this.closeBattle(), a.f.hasOwnProperty("w") && this.autoHeal()),
  1268.                 a.hasOwnProperty("event_done") && this.autoHeal(),
  1269.                 a.hasOwnProperty("ask") &&
  1270.                   a.ask.hasOwnProperty("re") &&
  1271.                   "party&a=accept&answer=" === a.ask.re &&
  1272.                   !0 === this.QuickGroupSettings.accepting.active &&
  1273.                   window._g("party&a=accept&answer=1");
  1274.             }
  1275.           },
  1276.           {
  1277.             key: "closeBattle",
  1278.             value: function closeBattle() {
  1279.               window._g("fight&a=quit"),
  1280.                 "si" === this.interface &&
  1281.                   (document.querySelector("#battle").style.display = "none");
  1282.             }
  1283.           },
  1284.           {
  1285.             key: "parseItemStat",
  1286.             value: function parseItemStat(a) {
  1287.               var b = {},
  1288.                 c = a.split(";");
  1289.               var _iteratorNormalCompletion6 = true;
  1290.               var _didIteratorError6 = false;
  1291.               var _iteratorError6 = undefined;
  1292.  
  1293.               try {
  1294.                 for (
  1295.                   var _iterator6 = c[Symbol.iterator](), _step6;
  1296.                   !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done);
  1297.                   _iteratorNormalCompletion6 = true
  1298.                 ) {
  1299.                   var d = _step6.value;
  1300.  
  1301.                   var _d$split = d.split("="),
  1302.                     _d$split2 = _slicedToArray(_d$split, 2),
  1303.                     _a21 = _d$split2[0],
  1304.                     _c6 = _d$split2[1];
  1305.  
  1306.                   b[_a21] = _c6;
  1307.                 }
  1308.               } catch (err) {
  1309.                 _didIteratorError6 = true;
  1310.                 _iteratorError6 = err;
  1311.               } finally {
  1312.                 try {
  1313.                   if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
  1314.                     _iterator6.return();
  1315.                   }
  1316.                 } finally {
  1317.                   if (_didIteratorError6) {
  1318.                     throw _iteratorError6;
  1319.                   }
  1320.                 }
  1321.               }
  1322.  
  1323.               return b;
  1324.             }
  1325.           },
  1326.           {
  1327.             key: "useItem",
  1328.             value: function useItem(a, b) {
  1329.               window._g("moveitem&id=".concat(a, "&st=1"), b);
  1330.             }
  1331.           },
  1332.           {
  1333.             key: "init",
  1334.             value: function init() {
  1335.               if ((this.initTimer(), "none" === this.interface))
  1336.                 return this.createTimerOnMainPage();
  1337.  
  1338.               if ("ni" === this.interface) {
  1339.                 var _a22 = window.Storage.prototype.setItem;
  1340.  
  1341.                 window.Storage.prototype.setItem = function(b, c) {
  1342.                   if ("Margonem" === b) {
  1343.                     var _a23 = JSON.parse(c);
  1344.  
  1345.                     (_a23.f = 0), (c = JSON.stringify(_a23));
  1346.                   }
  1347.  
  1348.                   _a22.apply(this, [b, c]);
  1349.                 };
  1350.               } else window.bB = Function.prototype;
  1351.  
  1352.               this.initBox(),
  1353.                 this.initNewNpc(),
  1354.                 this.initNewOther(),
  1355.                 this.removeLockAdding(),
  1356.                 this.initChecker()
  1357.             }
  1358.           },
  1359.           {
  1360.             key: "collisions",
  1361.             get: function get() {
  1362.               return "ni" === this.interface
  1363.                 ? this.updateCollisions()
  1364.                 : window.map.col;
  1365.             }
  1366.           },
  1367.           {
  1368.             key: "npccol",
  1369.             get: function get() {
  1370.               return "ni" === this.interface
  1371.                 ? this.getNpcColsNI()
  1372.                 : window.g.npccol;
  1373.             }
  1374.           },
  1375.           {
  1376.             key: "timeStamp",
  1377.             get: function get() {
  1378.               return Math.floor(new Date().getTime() / 1e3);
  1379.             }
  1380.           },
  1381.           {
  1382.             key: "hero",
  1383.             get: function get() {
  1384.               return "ni" === this.interface ? window.Engine.hero.d : window.hero;
  1385.             }
  1386.           },
  1387.           {
  1388.             key: "map",
  1389.             get: function get() {
  1390.               return "ni" === this.interface ? window.Engine.map.size : window.map;
  1391.             }
  1392.           },
  1393.           {
  1394.             key: "mapName",
  1395.             get: function get() {
  1396.               return "ni" === this.interface
  1397.                 ? window.Engine.map.d.name
  1398.                 : window.map.name;
  1399.             }
  1400.           },
  1401.           {
  1402.             key: "npcs",
  1403.             get: function get() {
  1404.               return "ni" === this.interface
  1405.                 ? this.npcsOnNewInterface
  1406.                 : window.g.npc;
  1407.             }
  1408.           },
  1409.           {
  1410.             key: "others",
  1411.             get: function get() {
  1412.               return "ni" === this.interface
  1413.                 ? this.othersOnNewInterface
  1414.                 : window.g.other;
  1415.             }
  1416.           },
  1417.           {
  1418.             key: "world",
  1419.             get: function get() {
  1420.               return "ni" === this.interface
  1421.                 ? window.Engine.worldName
  1422.                 : window.g.worldname;
  1423.             }
  1424.           },
  1425.           {
  1426.             key: "serverTimerSpeed",
  1427.             get: function get() {
  1428.               return "none" !== this.interface &&
  1429.                 [
  1430.                   "nerthus",
  1431.                   "aldous",
  1432.                   "berufs",
  1433.                   "brutal",
  1434.                   "classic",
  1435.                   "gefion",
  1436.                   "hutena",
  1437.                   "jaruna",
  1438.                   "katahha",
  1439.                   "lelwani",
  1440.                   "majuna",
  1441.                   "nomada",
  1442.                   "perkun",
  1443.                   "tarhuna",
  1444.                   "telawel",
  1445.                   "tempest",
  1446.                   "zemyna",
  1447.                   "zorza"
  1448.                 ].includes(this.world.toLowerCase())
  1449.                 ? 1
  1450.                 : "none" !== this.interface &&
  1451.                   "syberia" === this.world.toLowerCase()
  1452.                   ? 2
  1453.                   : 3;
  1454.             }
  1455.           },
  1456.           {
  1457.             key: "battle",
  1458.             get: function get() {
  1459.               return "ni" === this.interface
  1460.                 ? !!window.Engine.battle && !window.Engine.battle.endBattle
  1461.                 : window.g.battle;
  1462.             }
  1463.           },
  1464.           {
  1465.             key: "dead",
  1466.             get: function get() {
  1467.               return "ni" === this.interface ? window.Engine.dead : window.g.dead;
  1468.             }
  1469.           },
  1470.           {
  1471.             key: "party",
  1472.             get: function get() {
  1473.               return "ni" === this.interface ? Engine.party : window.g.party;
  1474.             }
  1475.           },
  1476.           {
  1477.             key: "loots",
  1478.             get: function get() {
  1479.               return "ni" === this.interface
  1480.                 ? window.Engine.loots !== void 0 &&
  1481.                     !!(0 < Object.keys(window.Engine.loots.items).length)
  1482.                 : !1 !== window.g.loots;
  1483.             }
  1484.           },
  1485.           {
  1486.             key: "issetMyNpcOnMap",
  1487.             get: function get() {
  1488.               var _this15 = this;
  1489.  
  1490.               return Object.values(this.npcs).some(function(a) {
  1491.                 return _this15.storage.name
  1492.                   .toLowerCase()
  1493.                   .includes(a.nick.toLowerCase());
  1494.               });
  1495.             }
  1496.           },
  1497.           {
  1498.             key: "items",
  1499.             get: function get() {
  1500.               return "ni" === this.interface
  1501.                 ? window.Engine.items.fetchLocationItems("g")
  1502.                 : Object.values(window.g.item);
  1503.             }
  1504.           },
  1505.           {
  1506.             key: "npcsOnNewInterface",
  1507.             get: function get() {
  1508.               var a = window.Engine.npcs.check(),
  1509.                 b = {};
  1510.  
  1511.               var _arr17 = Object.entries(a);
  1512.  
  1513.               for (var _i18 = 0; _i18 < _arr17.length; _i18++) {
  1514.                 var _arr17$_i = _slicedToArray(_arr17[_i18], 2),
  1515.                   c = _arr17$_i[0],
  1516.                   d = _arr17$_i[1];
  1517.  
  1518.                 b[c] = d.d;
  1519.               }
  1520.  
  1521.               return b;
  1522.             }
  1523.           },
  1524.           {
  1525.             key: "othersOnNewInterface",
  1526.             get: function get() {
  1527.               var a = window.Engine.others.check(),
  1528.                 b = {};
  1529.  
  1530.               var _arr18 = Object.entries(a);
  1531.  
  1532.               for (var _i19 = 0; _i19 < _arr18.length; _i19++) {
  1533.                 var _arr18$_i = _slicedToArray(_arr18[_i19], 2),
  1534.                   c = _arr18$_i[0],
  1535.                   d = _arr18$_i[1];
  1536.  
  1537.                 b[c] = d.d;
  1538.               }
  1539.  
  1540.               return b;
  1541.             }
  1542.           }
  1543.         ]);
  1544.  
  1545.         return _class;
  1546.       })())();
  1547.     })();
  1548.   })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement