· 6 years ago · Nov 10, 2019, 03:32 PM
1
2(() => {
3 new class DoNotRemoveNpcs {
4 constructor() {
5 this.interface = typeof window.Engine === "object" ? "ni" : "si";
6 this.npcsOutOfView = new Array();
7 this.initAjaxParser();
8 }
9
10 get hero() {
11 return this.interface === "ni" ? window.Engine.hero.d : window.hero;
12 }
13
14 get map() {
15 return this.interface === "ni" ? window.Engine.map.d : window.map;
16 }
17
18 get npcs() {
19 return this.interface === "ni" ? this.npcsOnNewInterface : window.g.npc;
20 }
21
22 get npcsOnNewInterface() {
23 const newNpcs = new Object();
24 for (const [id, npc] of Object.entries(window.Engine.npcs.check())) {
25 newNpcs[id] = npc.d;
26 }
27
28 return newNpcs;
29 }
30
31 npcInOutOfRange(hero, {x, y}) {
32 return Math.abs(x - hero.x) > this.map.visibility || Math.abs(y - hero.y) > this.map.visibility;
33 }
34
35 initAjaxParser() {
36 const self = this;
37 const _ajax = window.$.ajax;
38
39 window.$.ajax = (...args) => {
40 if (args[0].url.indexOf("/engine?t=") > -1) {
41 const oldsucc = args[0].success;
42 args[0].success = (...arg) => {
43 const canEmit = typeof arg[0] === "object" && arg[0] !== null && arg[0].e === "ok";
44 if (canEmit) {
45 arg[0] = self.parseInput(arg[0]);
46 }
47
48 return oldsucc.apply(this, arg);
49 };
50 }
51
52 return _ajax.apply(this, args);
53 }
54 }
55
56 parseInput(data) {
57 if (this.map.visibility !== 0) {
58 if (data.hasOwnProperty("npc") && data.npc !== undefined) {
59 for (const [id, npc] of Object.entries(data.npc)) {
60 if (npc.hasOwnProperty("del") && npc.del === 1 && this.npcs[id] !== undefined) {
61 if ([2, 3].includes(this.npcs[id].type) && this.npcInOutOfRange(this.hero, this.npcs[id])) {
62 this.npcsOutOfView.push(id);
63 delete data.npc[id];
64 }
65 }
66 }
67 }
68 }
69
70 if (data.hasOwnProperty("h") && data.h.hasOwnProperty("x") && data.h.hasOwnProperty("y")) {
71 const npcsToRemove = new Array();
72
73 for (const [id, npc] of Object.entries(this.npcs)) {
74 if (this.npcsOutOfView.includes(id) && !this.npcInOutOfRange(data.h, npc)) {
75 this.npcsOutOfView.splice(this.npcsOutOfView.indexOf(id), 1);
76
77 if ((data.hasOwnProperty("npc") && data.npc[id] === undefined) || !data.hasOwnProperty("npc")) {
78 npcsToRemove.push(id);
79 }
80 }
81 }
82
83 if (npcsToRemove.length > 0) {
84 if (!data.hasOwnProperty("npc")) {
85 data.npc = new Object();
86 }
87
88 for (const id of npcsToRemove) {
89 data.npc[id] = {
90 del: 2
91 }
92 }
93 }
94 }
95
96 return data;
97 }
98 }
99})();
100!function(_parseInput) {
101 var idleTime = 0;
102 var firstTime = true;
103 parseInput = function(a, b, c) {
104 _parseInput(a, b, c);
105 if (firstTime) {
106 setInterval(function() {
107 idleTime++;
108 if (idleTime > 1) {
109 idleTime = 0;
110 document.location.reload();
111 }
112 }, 1000);
113 firstTime = false;
114 }
115 idleTime = 0;
116 }
117}(parseInput);
118setTimeout(function(){ location.reload(); }, 180000);
119window.adiwilkTestBot = new function () {
120 function b(K, L) {
121 return Math.abs(K.x - L.x) + Math.abs(K.y - L.y)
122 }
123
124 function d(K, L) {
125 return new s(map.col, map.x, map.y, {
126 x: hero.x,
127 y: hero.y
128 }, {
129 x: K,
130 y: L
131 }, g.npccol).anotherFindPath()
132 }
133
134 function e(K, L) {
135 let M = d(K, L);
136 Array.isArray(M) && (window.road = M)
137 }
138 let vik = ""
139
140 function f(K) {
141 let L = g.npc[K];
142 if (L.grp)
143 for (let M in g.npc) g.npc[M].grp != L.grp || I.includes(g.npc[M].id) || I.push(g.npc[M].id);
144 else I.includes(K) || I.push(K)
145 }
146
147 function k() {
148 for (let K in g.npc) {
149 let L = g.npc[K];
150 if ((2 == L.type || 3 == L.type) && 19 > L.wt && o(L.id) && hero.lvl + 30 >= L.lvl && 2 > Math.abs(hero.x - L.x) && 2 > Math.abs(hero.y - L.y) && q()) return _g(`fight&a=attack&ff=1&id=-${L.id}`)
151 }
152 }
153
154 function l(K) {
155 let L = "";
156 $.ajax({
157 url: vik,
158 type: "POST",
159 data: JSON.stringify({
160 content: K,
161 username: 'Mopsik Informator',
162 avatar_url: `https://avatarfiles.alphacoders.com/127/127176.jpg`
163 }),
164 contentType: "application/json; charset=utf-8",
165 dataType: "json",
166 async: !1
167 })
168 }
169
170 function m() {
171 let K = new Date,
172 L = K.getHours(),
173 M = K.getSeconds(),
174 N = K.getMinutes();
175 return 10 > L && (L = `0${L}`), 10 > N && (N = `0${N}`), 10 > M && (M = `0${M}`), `${L}:${N}:${M}`
176 }
177
178 function o(K) {
179 return g.npc[K].grp && (!p(g.npc[K].grp) || r[localStorage.getItem(`adi-bot_expowiska`)].ignore_grp && r[localStorage.getItem(`adi-bot_expowiska`)].ignore_grp.includes(g.npc[K].grp)) ? !1 : !0
180 }
181
182 function p(K) {
183 for (let L in g.npc)
184 if (g.npc[L].grp == K && 19 < g.npc[L].wt) return !1;
185 return !0
186 }
187
188 function q() {
189 return !!(70 < 100 * (hero.hp / hero.maxhp))
190 }
191 mAlert = function () {}, "undefined" == typeof g && -1 < document.location.href.indexOf("jaruna.margonem.pl") && document.location.reload();
192 let r = {
193 "Pizzeria(wszystkie levele)": {
194 map: "Podziemia - p.1, Podziemia - p.2, Odnoga kana\u0142u, Podziemia - p.1, Podziemia - p.3, Podziemia - p.1, Odnoga kana\u0142u, Podziemia - p.2"
195 },
196 Lisy: {
197 map: "Lisia Nora p.1, Lisia Nora p.2"
198 },
199 "Szczury w Ithan": {
200 map: "Archiwa, Zaplecze, Sk\u0142ady, Przej\u015Bcie p\xF3\u0142nocno-wschodnie, Wschodnie skrzyd\u0142o mur\xF3w, Przej\u015Bcie po\u0142udniowo-wschodnie, Wschodnie skrzyd\u0142o mur\xF3w, Przej\u015Bcie p\xF3\u0142nocno-wschodnie, Sk\u0142ady, Zaplecze"
201 },
202 NekropoliaUP: {
203 map: "Grobowiec Rodziny Tywelta, Grobowiec Rodziny Tywelta p.1, Grobowiec Rodziny Tywelta p.2, Grobowiec Rodziny Tywelta p.1"
204 },
205 NekropoliaDOWN: {
206 map: "Krypta Rodu Heregata, Krypta Rodu Heregata p.1, Krypta Rodu Heregata p.2 - prawe skrzyd\u0142o, Krypta Rodu Heregata p.1"
207 },
208 KopalniaIthan: {
209 map: "Kopalnia Dogoran p.2, Kopalnia Dogoran p.3"
210 },
211 Demony: {
212 map: "Podziemia Siedziby Maga p.3 - sala 1, Podziemia Siedziby Maga p.3 - sala 2"
213 },
214 "Gacki szare": {
215 map: "Siedlisko Nietoperzy p.5, Siedlisko Nietoperzy p.4, Siedlisko Nietoperzy p.3, Siedlisko Nietoperzy p.2, Siedlisko Nietoperzy p.1, Siedlisko Nietoperzy p.2, Siedlisko Nietoperzy p.3, Siedlisko Nietoperzy p.4"
216 },
217 "Mr\u00F3wki green": {
218 map: "Kopiec Mr\xF3wek, Kopiec Mr\xF3wek p.1, Kopiec Mr\xF3wek p.2, Kopiec Mr\xF3wek p.1"
219 },
220 "Mr\u00F3wki ca\u0142e": {
221 map: "Mrowisko, Mrowisko p.1, Mrowisko p.2, Kopiec Mr\u00F3wek p.2, Kopiec Mr\u00F3wek p.1, Kopiec Mr\u00F3wek, Kopiec Mr\u00F3wek p.1, Kopiec Mr\u00F3wek p.2, Mrowisko p.2, Mrowisko p.1"
222 },
223 Zulusy: {
224 map: "Tygrysia Granica, Lokum Zulus\u00F3w, Tygrysia Granica, Osada Zulus\u00F3w"
225 },
226 "Mulusy noobskie": {
227 map: "Kryjówka Dzikich Kotów, Jaskinia Dzikich Kotów"
228 },
229 "Pag\u00F3rki \u0141upie\u017Cc\u00F3w": {
230 map: "Pag\u00F3rki \u0141upie\u017Cc\u00F3w, Sk\u0142ad Grabie\u017Cc\u00F3w, Pag\u00F3rki \u0142upie\u017Cc\u00F3w, Schowek na \u0141upy, Pag\u00F3rki \u0142upie\u017Cc\u00F3w, Kamienna Kryj\u00F3wka"
231 },
232 Ghule: {
233 map: "Polana \u015Acierwojad\xF3w, Wioska Ghuli"
234 },
235 Lambo: {
236 map: "Torneg, Leśna Przełęcz, Kryjówka Dzikich Kotów, Jaskinia Dzikich Kotów, Tygrysia Polana, Kryjówka Dzikich Kotów, Osada Mulusów, Pradawne Wzgórze Przodków"
237 },
238 Stukot: {
239 map: "Stary Kupiecki Trakt, Stukot Widmowych Kół, Wertepy Rzezimieszków, Stukot Widmowych Kół"
240 },
241 Wilki: {
242 map: "Warcz\u0105ce Osuwiska, Wilcza Nora p.1, Wilcza Nora p.2, Wilcza Nora p.1",
243 mobs_id: [71698]
244 },
245 Orki: {
246 map: "Opuszczony Bastion, Podziemne Przejście p.1, Podziemne Przejście p.2, Zrujnowana Wieża, Podziemne Przejście p.2, Podziemne Przejście p.1"
247 },
248 Pająki: {
249 map: "Rachminowa Jaskinia p.5, Rachminowa Jaskinia p.6 - rozlewisko, Rachminowa Jaskinia p.7 - bezdenna g\u0142\u0119bia, Rachminowa Jaskinia p.6 - rozlewisko"
250 },
251 Koboldy: {
252 map: "Lazurytowa Grota p.1, Lazurytowa Grota p.2, Lazurytowa Grota p.3, Lazurytowa Grota p.2"
253 },
254 "Galaretki(te za pszcz\xF3\u0142kami)": {
255 map: "Prastara Kopalnia Eroch p.4 - sala 1, Jaskinia Flamdowa p.3, Prastara Kopalnia Eroch p.4 - sala 2, Jaskinia Flamdowa p.3"
256 },
257 "Szlak Thorpa": {
258 map: "Szlak Thorpa p.1, Szlak Thorpa p.2, Szlak Thorpa p.3, Szlak Thorpa p.4, Szlak Thorpa p.5, Szlak Thorpa p.6, Szlak Thorpa p.5, Szlak Thorpa p.4, Szlak Thorpa p.3, Szlak Thorpa p.2"
259 },
260 "Pok\u0105tniki za wermontami": {
261 map: "Rachminowa Jaskinia p.5, Rachminowa Jaskinia p.6 - rozlewisko, Rachminowa Jaskinia p.7 - bezdenna g\u0142\u0119bia, Rachminowa Jaskinia p.6 - rozlewisko"
262 },
263 "Bia\u0142e mr\xF3wki": {
264 map: "Szumi\u0105ca G\u0119stwina, Grota Bia\u0142ych Ko\u015Bci p.1 - sala 2, Grota Bia\u0142ych Ko\u015Bci p.2 - sala 2, Grota Bia\u0142ych Ko\u015Bci p.3 - sala 2, Grota Bia\u0142ych Ko\u015Bci p.4, Grota Bia\u0142ych Ko\u015Bci p.3 - sala 1, Grota Bia\u0142ych Ko\u015Bci p.4, Grota Bia\u0142ych Ko\u015Bci p.3 - sala 2, Grota Bia\u0142ych Ko\u015Bci p.2 - sala 2, Grota Bia\u0142ych Ko\u015Bci p.1 - sala 2"
265 },
266 Wodniki: {
267 map: "Moczary Rybiego Oka, Uroczysko Wodnika, Źródło Narumi, Uroczysko Wodnika"
268 },
269 Szkielety: {
270 map: "Trupia Przełęcz, Płaskowyż Arpan, Sucha Dolina, Dolina Pustynnych Kręgów, Sucha Dolina, Płaskowyż Arpan"
271 },
272 "Demilisze-low": {
273 map: "Rachminowa Jaskinia p.3, Rachminowa Jaskinia p.4, Rachminowa Jaskinia p.4 - przepa\u015Bcie, W\u0105ski chodnik p.4, Chodniki Erebeth p.4 - sala 1, Chodniki Erebeth p.4 - sala 2, Chodniki Erebeth p.4 - sala 1, W\u0105ski chodnik p.4, Rachminowa Jaskinia p.4 - przepa\u015Bcie, Rachminowa Jaskinia p.4"
274 },
275 "Demilisze-high": {
276 map: "Rachminowa Jaskinia p.4 - przepa\u015Bcie, W\u0105ski chodnik p.4, Chodniki Erebeth p.4 - sala 1, Chodniki Erebeth p.4 - sala 2, Kopalnia Thudul-ultok p.4 - sala 2, Kopalnia Thudul-ultok p.4 - sala 1, Kopalnia Thudul-ultok p.4 - sala 2, Chodniki Erebeth p.4 - sala 1, W\u0105ski chodnik p.4"
277 },
278 Wieczornice: {
279 map: "Mglista Polana Vesy, Wzg\u00F3rze P\u0142aczek, P\u0142acz\u0105ca Grota p.1 - sala 2, P\u0142acz\u0105ca Grota p.2, P\u0142acz\u0105ca Grota p.3, P\u0142acz\u0105ca Grota - sala Lamentu, P\u0142acz\u0105ca Grota p.3, P\u0142acz\u0105ca Grota p.2, P\u0142acz\u0105ca Grota p.1 - sala 2, Wzg\u00F3rze P\u0142aczek"
280 },
281 Minosy: {
282 map: "Labirynt Wykl\u0119tych p.2 - sala 1, Labirynt Wykl\u0119tych p.1, Labirynt Wykl\u0119tych p.2 - sala 2, Labirynt Wykl\u0119tych p.1"
283 },
284 "Erem p\xF3\u0142noc-po\u0142udnie": {
285 map: "Erem Czarnego S\u0142o\u0144ca - sala wej\u015Bciowa, Erem Czarnego S\u0142o\u0144ca p.1 s.1, Erem Czarnego S\u0142o\u0144ca - sala wej\u015Bciowa, Erem Czarnego S\u0142o\u0144ca p.2 s.1, Erem Czarnego S\u0142o\u0144ca p.2 s.2, Erem Czarnego S\u0142o\u0144ca - sala wej\u015Bciowa, Erem Czarnego S\u0142o\u0144ca p.1 s.2, Erem Czarnego S\u0142o\u0144ca - sala wej\u015Bciowa, Ska\u0142y Mro\u017Anych \u015Apiew\xF3w, Erem Czarnego S\u0142o\u0144ca - po\u0142udnie, Erem Czarnego S\u0142o\u0144ca - lochy, Erem Czarnego S\u0142o\u0144ca - p\xF3\u0142noc, Ska\u0142y Mro\u017Anych \u015Apiew\xF3w",
286 mobs_id: [34826]
287 },
288 Grexy: {
289 map: "Grota Samotnych Dusz p.1, Grota Samotnych Dusz p.2, Grota Samotnych Dusz p.3, Grota Samotnych Dusz p.4, Grota Samotnych Dusz p.5, Grota Samotnych Dusz p.4, Grota Samotnych Dusz p.3, Grota Samotnych Dusz p.2"
290 },
291 "Mi\u015Bki-low": {
292 map: "Firnowa Grota p.1, Firnowa Grota p.2, Firnowa Grota p.2 s.1, Firnowa Grota p.2, Ska\u0142y Mro\u017Anych \u015Apiew\xF3w, Lodowa Wyrwa p.2, Lodowa Wyrwa p.1 s.1, Ska\u0142y Mro\u017Anych \u015Apiew\xF3w",
293 mobs_id: [34843, 34826]
294 },
295 "Mi\u015Bki-high": {
296 map: "Firnowa Grota p.1, Firnowa Grota p.2, Firnowa Grota p.2 s.1, Firnowa Grota p.2, Ska\u0142y Mro\u017Anych \u015Apiew\xF3w, Lodowa Wyrwa p.2, Lodowa Wyrwa p.1 s.1, Lodowa Wyrwa p.1 s.2, Sala Lodowych Iglic, Lodowa Wyrwa p.1 s.2, Lodowa Wyrwa p.1 s.1, Ska\u0142y Mro\u017Anych \u015Apiew\xF3w",
297 mobs_id: [34843, 34826]
298 },
299 "Piraci - dwie jaskinie": {
300 map: "Korsarska Nora - sala 1, Korsarska Nora - sala 2, Korsarska Nora - sala 3, Korsarska Nora - sala 4, Korsarska Nora p.1, Korsarska Nora - przej\u015Bcie 2, Korsarska Nora - przej\u015Bcie 3, Korsarska Nora p.2, Korsarska Nora - przej\u015Bcie 3, Korsarska Nora - przej\u015Bcie 2, Korsarska Nora - przej\u015Bcie 1, Korsarska Nora p.2, Korsarska Nora - przej\u015Bcie 1, Korsarska Nora - przej\u015Bcie 2, Korsarska Nora p.2, Korsarska Nora - przej\u015Bcie 2, Korsarska Nora p.1, Korsarska Nora - sala 4, Korsarska Nora - sala 3, Korsarska Nora - sala 2, Korsarska Nora - sala 1, Latarniane Wybrze\u017Ce, Ukryta Grota Morskich Diab\u0142\xF3w, Ukryta Grota Morskich Diab\u0142\xF3w - arsena\u0142, Ukryta Grota Morskich Diab\u0142\xF3w, Ukryta Grota Morskich Diab\u0142\xF3w - siedziba, Ukryta Grota Morskich Diab\u0142\xF3w, Ukryta Grota Morskich Diab\u0142\xF3w - magazyn, Ukryta Grota Morskich Diab\u0142\xF3w, Ukryta Grota Morskich Diab\u0142\xF3w - skarbiec, Ukryta Grota Morskich Diab\u0142\xF3w, Latarniane Wybrze\u017Ce"
301 },
302 Mumie: {
303 map: "Oaza Siedmiu Wichr\xF3w, Ciche Rumowiska, Oaza Siedmiu Wichr\xF3w, Ruiny Pustynnych Burz"
304 },
305 "Magradit-low": {
306 map: "Magradit, Magradit - G\xF3ra Ognia, Wulkan Politraki p.4, Wulkan Politraki p.3 - sala 1, Wulkan Politraki p.3 - sala 2, Wulkan Politraki p.3 - sala 1, Wulkan Politraki p.4, Magradit - G\xF3ra Ognia"
307 },
308 "Magradit-high": {
309 map: "Magradit, Magradit - G\xF3ra Ognia, Wulkan Politraki p.4, Wulkan Politraki p.3 - sala 1, Wulkan Politraki p.3 - sala 2, Wulkan Politraki p.2, Wulkan Politraki p.1, Wulkan Politraki p.2, Wulkan Politraki p.3 - sala 2, Wulkan Politraki p.3 - sala 1, Wulkan Politraki p.4, Magradit - G\xF3ra Ognia"
310 },
311 "Ku\u017Ania Woundriela": {
312 map: "Ku\u017Ania Worundriela p.7 - sala 3, Ku\u017Ania Worundriela p.7 - sala 4"
313 },
314 Berserkerzy: {
315 map: "Grobowiec Przodk\xF3w, Cenotaf Berserker\xF3w p.1, Grobowiec Przodk\xF3w, Czarcie Oparzeliska, Pustelnia Wojownika p.2, Pustelnia Wojownika p.1, Czarcie Oparzeliska, Szuwarowe Trz\u0119sawisko, Opuszczona Twierdza, Szuwarowe Trz\u0119sawisko, Czarcie Oparzeliska, Pustelnia Wojownika p.1, Pustelnia Wojownika p.2, Czarcie Oparzeliska, Grobowiec Przodk\xF3w, Cenotaf Berserker\xF3w p.1"
316 },
317 Gobliny: {
318 map: "Przedsionek Z\u0142ych Goblin\xF3w, Gobli\u0144skie Lokum, Przedsionek Z\u0142ych Goblin\xF3w, Lokum Z\u0142ych Goblin\xF3w"
319 },
320 Kazamaty: {
321 map: "Nawiedzone Kazamaty p.1, Nawiedzone Kazamaty p.2, Nawiedzone Kazamaty p.3, Nawiedzone Kazamaty p.4, Nawiedzone Kazamaty p.5, Nawiedzone Kazamaty p.6, Nawiedzone Kazamaty p.5, Nawiedzone Kazamaty p.4, Nawiedzone Kazamaty p.3, Nawiedzone Kazamaty p.2"
322 },
323 "Duchy - dla leszczy": {
324 map: "Ruiny Tass Zhil, Przedsionek Grobowca, Ruiny Tass Zhil, B\u0142ota Sham Al",
325 ignore_grp: [18]
326 },
327 "Duchy - dla mocarzy": {
328 map: "Błota Sham Al, Ruiny Tass Zhil, Przedsionek Grobowca, Tajemne Przejście, Przeklęty Grobowiec, Tajemne Przejście, Przedsionek Grobowca, Ruiny Tass Zhill"
329 },
330 "Ingotia": {
331 map: "Wyspa Ingotia - po\0142 udnie, Jaskinia Rogog\0142 owych - aula, Sala Nici Ocalenia p.6, Sala Bia\0142 ego Byka p.5, Sala Nici Ocalenia p.6, Komnata Przekl\0119 tego Daru p.5, Jaskinia Rogog\0142 owych - aula, Sala \017B \0105 dzy p.5, Hala Odszczepie\0144 c\00F3 w p.4, Sala \017B \0105 dzy p.5, Komora Opuszczonych p.3, Jaskinia Rogog\0142 owych - aula, Komnata Wygna\0144 c\00F3 w p.3, Komora Budowniczego p.5, Komnata Wygna\0144 c\00F3 w p.3, Jaskinia Rogog\0142 owych p.2, Jaskinia Rogog\0142 owych - aula, Jaskinia Rogog\0142 owych p.1 - wyj\015B cie, Wyspa Ingotia - p\00F3 \0142 noc, Jaskinia Rogog\0142 owych p.1 - wyj\015B cie, Jaskinia Rogog\0142 owych - aula, Jaskinia Rogog\0142 owych p.2, Komnata Wygna\0144 c\00F3 w p.3, Komora Budowniczego p.5, Komnata Wygna\0144 c\00F3 w p.3, Jaskinia Rogog\0142 owych - aula, Komora Opuszczonych p.3, Sala \017B \0105 dzy p.5, Hala Odszczepie\0144 c\00F3 w p.4, Sala \017B \0105 dzy p.5, Jaskinia Rogog\0142 owych - aula, Komnata Przekl\0119 tego Daru p.5, Sala Nici Ocalenia p.6, Sala Bia\0142 ego Byka p.5, Sala Nici Ocalenia p.6, Jaskinia Rogog\0142 owych - aula"
332 },
333 Ogry: {
334 map: "Ogrza Kawerna p.1, Ogrza Kawerna p.2, Ogrza Kawerna p.3, Ogrza Kawerna p.2"
335 },
336 "Sala Kr\u00F3lewska": {
337 map: "Nawiedzone Komnaty p.1, Nawiedzone Komnaty p.2, Sala Królewska, Komnata Czarnej Perły, Sala Królewska, Nawiedzone Komnaty p.2"
338 },
339 Patrycjusze: {
340 map: "Krypty Bezsennych p .1, Krypty Bezsennych p .2, Krypty Bezsennych p .2 - przej\u015Bcie - sala 1, Krypty Bezsennych p .2 - przej\u015Bcie - sala 2, Krypty Bezsennych p .2, Krypty Bezsennych p .3, Krypty Bezsennych p .2, Krypty Bezsennych p .2 - przej\u015Bcie - sala 2, Krypty Bezsennych p .2 - przej\u015Bcie - sala 1, Krypty Bezsennych p .2"
341 },
342 Myszy: {
343 map: "Kanały Nithal, Zejście do kanałów, Kanały Nithal, Szlamowe Kanały"
344 },
345 Sekta: {
346 map: "Przedsionek Kultu, Tajemnicza Siedziba, Mroczne Komnaty, Przera\u017Caj\u0105ce Sypialnie, Mroczne Komnaty, Tajemnicza Siedziba, Sala Tysi\u0105ca \u015Awiec, Tajemnicza Siedziba, Lochy Kultu, Sale Rozdzierania, Lochy Kultu, Tajemnicza Siedziba"
347 },
348 Arachnitopia: {
349 map: "Dolina Paj\u0119czych Korytarzy, Arachnitopia p.1, Arachnitopia p.2, Arachnitopia p.3, Arachnitopia p.4, Arachnitopia p.5, Arachnitopia p.4, Arachnitopia p.3, Arachnitopia p.2, Arachnitopia p.1"
350 },
351 "Zakorzeniony Lud": {
352 map: "Urwisko Zdrewnia\u0142ych, W\u0105w\xF3z Zakorzenionych Dusz, Krzaczasta Grota p.2 - sala 2, Krzaczasta Grota p.2 - sala 3, Krzaczasta Grota p.2 - sala 1, Krzaczasta Grota p.2 - sala 3, Krzaczasta Grota p.1 - sala 3, Krzaczasta Grota p.1 - sala 2, Krzaczasta Grota p.1 - sala 1, W\u0105w\xF3z Zakorzenionych Dusz, Regiel Zab\u0142\u0105kanych, \u0179r\xF3d\u0142o Zakorzenionego Ludu, Regiel Zab\u0142\u0105kanych, W\u0105w\xF3z Zakorzenionych Dusz"
353 },
354 "Maddoki ca\u0142e": {
355 map: "Zawodz\u0105ce Kaskady, Skryty Azyl, Z\u0142ota D\u0105browa, O\u015Blizg\u0142e Przej\u015Bcie - sala 1, O\u015Blizg\u0142e Przej\u015Bcie - sala 2, Z\u0142ota D\u0105browa, Mglisty Las, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala wyj\u015Bciowa, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - przej\u015Bcie, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala boczna, Grota poro\u015Bni\u0119tych, Stalagmit\xF3w - przej\u015Bcie, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala g\u0142\xF3wna, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - przej\u015Bcie, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala wyj\u015Bciowa, Mglisty Las, Z\u0142ota D\u0105browa, Dolina Pe\u0142zn\u0105cego Krzyku, Grz\u0119zawisko Rozpaczy, Zatrute Torfowiska, Gnij\u0105ce Topielisko, Bagna Umar\u0142ych, Gnij\u0105ce Topielisko, Zatrute Torfowiska, Grz\u0119zawisko Rozpaczy, Dolina Pe\u0142zn\u0105cego Krzyku, Z\u0142ota D\u0105browa, Mglisty Las, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala wyj\u015Bciowa, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - przej\u015Bcie, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala g\u0142\xF3wna, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - przej\u015Bcie, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala boczna, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - przej\u015Bcie, Grota poro\u015Bni\u0119tych Stalagmit\xF3w - sala wyj\u015Bciowa, Mglisty Las, Z\u0142ota D\u0105browa, O\u015Blizg\u0142e Przej\u015Bcie - sala 2, O\u015Blizg\u0142e Przej\u015Bcie - sala 1, Z\u0142ota D\u0105browa, Skryty Azyl"
356 },
357 "Mahopteki dla leszczy": {
358 map: "Altepetl Mahoptekan, Niecka Xiuh Atl, Dolina Chmur, Niecka Xiuh Atl, Altepetl Mahoptekan, Dolina Chmur, Z\u0142ota G\xF3ra p.1, Z\u0142ota G\xF3ra p.2, Z\u0142ota G\xF3ra p.3, Z\u0142ota G\xF3ra p.2, Z\u0142ota G\xF3ra p.1, Dolina Chmur, Altepetl Mahoptekan, Mictlan p.1, Mictlan p.2, Mictlan p.3, Mictlan p.4, Mictlan p.5, Mictlan p.4, Mictlan p.3, Mictlan p.2, Mictlan p.1"
359 },
360 "Mahopteki-high": {
361 map: "Altepetl Mahoptekan, Niecka Xiuh Atl, Dolina Chmur, Niecka Xiuh Atl, Altepetl Mahoptekan, Dolina Chmur, Z\u0142ota G\xF3ra p.1, Z\u0142ota G\xF3ra p.2, Z\u0142ota G\xF3ra p.3, Z\u0142ota G\xF3ra p.2, Z\u0142ota G\xF3ra p.1, Dolina Chmur, Altepetl Mahoptekan, Mictlan p.1, Mictlan p.2, Mictlan p.3, Mictlan p.4, Mictlan p.5, Mictlan p.6, Mictlan p.7, Mictlan p.8, Mictlan p.7, Mictlan p.6, Mictlan p.5, Mictlan p.4, Mictlan p.3, Mictlan p.2, Mictlan p.1"
362 },
363 Katakumby: {
364 map: "Katakumby Poleg\u0142ych Legionist\u00F3w, Zachodni Tunel Ja\u017Ani, Katakumby Krwawych Wypraw, Wschodni Tunel Ja\u017Ani, Katakumby Gwa\u0142townej \u015Amierci, Korytarz Porzuconych Marze\u0144, Katakumby Op\u0119tanych Dusz, Katakumby Odnalezionych Skrytob\u00F3jc\u00F3w, Korytarz Porzuconych Nadziei, Katakumby Op\u0119tanych Dusz, Zachodni Tunel Ja\u017Ani"
365 },
366 "Pustynia Shairhoud?": {
367 map: "Pustynia Shaiharrud - wsch\xF3d, Jurta Nomadzka, Pustynia Shaiharrud - wsch\xF3d, Grota Po\u015Bwi\u0119cenia, Pustynia Shaiharrud - wsch\xF3d, Namiot Pustynnych Smok\xF3w, Pustynia Shaiharrud - wsch\xF3d, Pustynia Shaiharrud - zach\xF3d, Jaskinia Piaskowej Burzy s.1, Jaskinia Piaskowej Burzy s.2, Namiot Naznaczonych, Pustynia Shaiharrud - zach\xF3d, Namiot Piechoty Pi\u0142owej, Pustynia Shaiharrud - zach\xF3d, Jaskinia Szcz\u0119k, Jurta Czcicieli, Pustynia Shaiharrud - zach\xF3d, Namiot Gwardii Smokoszcz\u0119kich, Pustynia Shaiharrud - zach\xF3d, S\u0119piarnia, Pustynia Shaiharrud - zach\xF3d, Jaskinia Smoczej Paszczy p.1, Jaskinia Smoczej Paszczy p.2, Jaskinia Smoczej Paszczy p.1, Jurta Chaegda, Pustynia Shaiharrud - zach\xF3d, Smocze Skalisko, Jaskinia Odwagi, Smocze Skalisko, Urwisko Vapora, Smocze Skalisko, Pustynia Shaiharrud - zach\xF3d"
368 }
369 };
370 class s {
371 constructor(K, L, M, N, O, P) {
372 this.width = L, this.height = M, this.collisions = this.parseCollisions(K, L, M), this.additionalCollisions = P || {}, this.start = this.collisions[N.x][N.y], this.end = this.collisions[O.x][O.y], this.start.beginning = !0, this.start.g = 0, this.start.f = b(this.start, this.end), this.end.target = !0, this.end.g = 0, this.addNeighbours(), this.openSet = [], this.closedSet = [], this.openSet.push(this.start)
373 }
374 parseCollisions(K, L, M) {
375 const N = Array(L);
376 for (let O = 0; O < L; O++) {
377 N[O] = Array(M);
378 for (let P = 0; P < M; P++) N[O][P] = new t(O, P, "1" === K.charAt(O + P * L))
379 }
380 return N
381 }
382 addNeighbours() {
383 for (let K = 0; K < this.width; K++)
384 for (let L = 0; L < this.height; L++) this.addPointNeighbours(this.collisions[K][L])
385 }
386 addPointNeighbours(K) {
387 const L = K.x,
388 M = K.y,
389 N = [];
390 0 < L && N.push(this.collisions[L - 1][M]), 0 < M && N.push(this.collisions[L][M - 1]), L < this.width - 1 && N.push(this.collisions[L + 1][M]), M < this.height - 1 && N.push(this.collisions[L][M + 1]), K.neighbours = N
391 }
392 anotherFindPath() {
393 for (; 0 < this.openSet.length;) {
394 let K = this.getLowestF(),
395 L = this.openSet[K];
396 if (L === this.end) return this.reconstructPath();
397 this.openSet.splice(K, 1), this.closedSet.push(L);
398 for (const M of L.neighbours)
399 if (this.closedSet.includes(M)) continue;
400 else {
401 const N = L.g + 1;
402 let O = !1;
403 this.end != this.collisions[M.x][M.y] && (this.openSet.includes(M) || M.collision || this.additionalCollisions[M.x + 256 * M.y]) ? N < M.g && !M.collision && (O = !0) : (this.openSet.push(M), M.h = b(M, this.end), O = !0), O && (M.previous = L, M.g = N, M.f = M.g + M.h)
404 }
405 }
406 }
407 getLowestF() {
408 let K = 0;
409 for (let L = 0; L < this.openSet.length; L++) this.openSet[L].f < this.openSet[K].f && (K = L);
410 return K
411 }
412 reconstructPath() {
413 const K = [];
414 for (let L = this.end; L !== this.start;) K.push(L), L = L.previous;
415 return K
416 }
417 }
418 class t {
419 constructor(K, L, M) {
420 this.x = K, this.y = L, this.collision = M, this.g = 1e7, this.f = 1e7, this.neighbours = [], this.beginning = !1, this.target = !1, this.previous = void 0
421 }
422 }
423 localStorage.getItem(`adi-bot_lastmaps`) || localStorage.setItem(`adi-bot_lastmaps`, JSON.stringify([]));
424 let v = this,
425 z = !1,
426 A = !1,
427 B, C, D, E = 0,
428 F = !1,
429 G = !1;
430 g.loadQueue.push({
431 fun: () => {
432 G = !0
433 }
434 });
435 let H = !0,
436 I = [];
437 setInterval(function () {
438 B && (B = void 0)
439 }, 4e3);
440 let J;
441 this.PI = parseInput, parseInput = function (K) {
442 let L = v.PI.apply(this, arguments);
443 if (!g.battle && !g.dead && G) {
444 if (!B && !F) {
445 if (B = v.findBestMob(), !B && localStorage.getItem(`adi-bot_expowiska`)) {
446 let M, N = 9999;
447 if (r[localStorage.getItem(`adi-bot_expowiska`)].mobs_id) {
448 let O = r[localStorage.getItem(`adi-bot_expowiska`)].mobs_id;
449 for (let P in O) g.npc[O[P]] && (M = d(g.npc[O[P]].x, g.npc[O[P]].y).length, M < N && (N = M, B = O[P]))
450 }
451 }
452 A = !1, z = !1
453 }
454 if (B) {
455 let M = g.npc[B];
456 if (!M) return B = void 0, L;
457 2 > Math.abs(hero.x - M.x) && 2 > Math.abs(hero.y - M.y) && !z ? (z = !0, _g(`fight&a=attack&ff=1&id=-${M.id}`, function (N) {
458 N.alert && `Przeciwnik walczy już z kimś innym` == N.alert && (f(M.id), B = void 0)
459 }), setTimeout(function () {
460 B = void 0
461 }, 500)) : !A && !z && (e(M.x, M.y), A = !0)
462 } else 0 < document.querySelector(`#adi-bot_maps`).value.length && (J = v.findBestGw(), J && !F && (hero.x == J.x && hero.y == J.y ? _g(`walk`) : (e(J.x, J.y), F = !0, setTimeout(function () {
463 F = !1
464 }, 2e3))));
465 D == hero.y && C == C ? (E++, 4 < E && (k(), E = 0, B = void 0, J = void 0, F = !1)) : (D = hero.y, C = hero.x, E = 0)
466 }
467 if (g.dead && H && (H = !1, l(`${hero.nick} dednol na ${hero.lvl}${hero.prof} - ${m()}`), console.log("XD")), K.hasOwnProperty("f") && 1 == K.f.init && 0 < hero.clan && !Object.keys(K.f.w).some(M => 0 > M)) {
468 const M = [],
469 N = [];
470 for (let O of Object.values(K.f.w)) 1 == O.team && M.push(`${O.name} ${O.lvl}${O.prof}`) || N.push(`${O.name} ${O.lvl}${O.prof} `);
471 if (2 == K.f.myteam && -1 < document.querySelector(`#adi-bot_maps`).value.indexOf(map.name)) {
472 const O = `Zostałem zaatakowany na mapie ${map.name} o godzinie ${m()}.\n${M.join(", ")} vs ${N.join(", ")}`;
473 l(O)
474 }
475 }
476 return L
477 }, this.findBestMob = function () {
478 let K, M, L = 9999;
479 for (let N in g.npc) {
480 let P, Q, R, O = g.npc[N];
481 if (-1 < document.querySelector(`#adi-bot_mobs`).value.indexOf(`-`) && (P = document.querySelector(`#adi-bot_mobs`).value.split(`-`), Q = parseInt(P[0]), R = parseInt(P[1])), (2 == O.type || 3 == O.type) && P && O.lvl <= R && O.lvl >= Q && o(O.id) && !I.includes(O.id) && 20 > O.wt) {
482 if (K = d(O.x, O.y), void 0 == K) continue;
483 K.length < L && (L = K.length, M = O.id)
484 }
485 }
486 return M
487 }, localStorage.getItem(`alksjd`) || localStorage.setItem(`alksjd`, 0), this.findBestGw = function () {
488 let K, L = document.querySelector(`#adi-bot_maps`).value.split(`, `),
489 M = parseInt(localStorage.getItem(`alksjd`));
490 for (let N in g.townname)
491 if (L[M] == g.townname[N]) {
492 let O = g.gwIds[N].split(`.`);
493 return K = {
494 x: O[0],
495 y: O[1]
496 }, K
497 }
498 M++, M > L.length && (M = 0), localStorage.setItem(`alksjd`, parseInt(M))
499 }, this.initHTML = function () {
500 if (!localStorage.getItem(`adi-bot_position`)) {
501 localStorage.setItem(`adi-bot_position`, JSON.stringify({
502 x: 0,
503 y: 0
504 }))
505 }
506 let K = JSON.parse(localStorage.getItem(`adi-bot_position`)),
507 L = document.createElement(`div`);
508 L.id = `adi-bot_box`, L.setAttribute(`tip`, `Złap i przenieś :)`);
509 let M = document.createElement(`input`);
510 M.type = `text`, M.id = `adi-bot_mobs`, M.classList.add(`adi-bot_inputs`), M.setAttribute(`tip`, `Wprowadź lvl mobków w postaci np. '50-70'`), L.appendChild(M);
511 let N = document.createElement(`input`);
512 N.type = `text`, N.id = `adi-bot_maps`, N.classList.add(`adi-bot_inputs`), N.setAttribute(`tip`, `Wprowadź nazwy map`), L.appendChild(N);
513 let O = document.createElement(`select`);
514 O.id = `adi-bot_list`, O.classList.add(`adi-bot_inputs`), O.setAttribute(`tip`, `Wybierz expowisko, aby dodatek wpisał mapy za Ciebie`);
515 for (let S, R = 0; R < Object.keys(r).length; R++) S = document.createElement(`option`), S.setAttribute(`value`, Object.keys(r)[R]), S.text = Object.keys(r)[R], O.appendChild(S);
516 L.appendChild(O), document.body.appendChild(L);
517 let P = document.createElement(`style`);
518 P.type = `text/css`;
519 let Q = `
520#adi-bot_box {
521position: absolute;
522border: 2px solid green;
523padding: 5px;
524text-align: center;
525background: black;
526cursor: grab;
527left: ${K.x}px;
528top: ${K.y}px;
529width: auto;
530height: auto;
531z-index: 390;
532}
533.adi-bot_inputs {
534-webkit-box-sizing: content-box;
535-moz-box-sizing: content-box;
536box-sizing: content-box;
537margin: 0 auto;
538margin-bottom: 3px;
539padding: 2px;
540cursor: pointer;
541border: 2px solid green;
542-webkit-border-radius: 5px;
543border-radius: 5px;
544font: normal 16px/normal "Times New Roman", Times, serif;
545color: rgba(0,142,198,1);
546-o-text-overflow: clip;
547text-overflow: clip;
548background: rgba(234,227,227,1);
549-webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.2) inset;
550box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.2) inset;
551text-shadow: 1px 1px 0 rgba(255,255,255,0.66) ;
552display: block;
553}
554input[id=adi-bot_mobs] {
555text-align: center;
556}
557#adi-bot_blessingbox {
558border: 1px solid red;
559background: gray;
560height: 32px;
561width: 32px;
562margin: 0 auto;
563}
564`;
565 P.appendChild(document.createTextNode(Q)), document.head.appendChild(P), localStorage.getItem(`adi-bot_mobs`) && (M.value = localStorage.getItem(`adi-bot_mobs`)), localStorage.getItem(`adi-bot_maps`) && (N.value = localStorage.getItem(`adi-bot_maps`)), localStorage.getItem(`adi-bot_expowiska`) && r[localStorage.getItem(`adi-bot_expowiska`)] && (O.value = localStorage.getItem(`adi-bot_expowiska`)), M.addEventListener(`keyup`, () => {
566 localStorage.setItem(`adi-bot_mobs`, M.value)
567 }), N.addEventListener(`keyup`, () => {
568 localStorage.setItem(`adi-bot_maps`, N.value)
569 }), O.addEventListener(`change`, () => {
570 localStorage.setItem(`adi-bot_expowiska`, O.value), N.value = r[O.value].map, localStorage.setItem(`adi-bot_maps`, N.value), localStorage.setItem(`alksjd`, 0), message(`Zapisano expowisko "${O.value}"`)
571 }), $(`#adi-bot_box`).draggable({
572 stop: () => {
573 let R = {
574 x: parseInt(document.querySelector(`#adi-bot_box`).style.left),
575 y: parseInt(document.querySelector(`#adi-bot_box`).style.top)
576 };
577 localStorage.setItem(`adi-bot_position`, JSON.stringify(R)), message(`Zapisano pozycję`)
578 }
579 })
580
581 }, this.initHTML()
582};
583setInterval(function() {
584 for (k in g.item)
585 if ((g.item[k].loc == "g") && (g.item[k].stat.search("gold") > -1)) _g("moveitem&st=1&id=" + k);
586},5000);
587g.loadQueue.push({fun:function(){
588if (!localStorage.getItem(`aposx`)) {
589 let tmpobj = {
590 x: 204,
591 y: 160
592 }
593 localStorage.setItem(`aposx`, JSON.stringify(tmpobj));
594};
595const kordyx = JSON.parse(localStorage.getItem(`aposx`));
596
597var timer33;
598const divek12 = document.createElement('div');
599divek12.style.width = '45px';
600divek12.style.height = '50px';
601divek12.style.border = '2px solid green';
602divek12.style.left=`${kordyx.x}px`;
603divek12.style.top=`${kordyx.y}px`;
604divek12.tip='Szybka walka';
605
606const kruci = document.createElement('input');
607if(localStorage.getItem('aBattle') == 'on'){
608 kruci.checked=true;
609}else{
610 kruci.checked=false;
611}
612kruci.type='checkbox';
613kruci.style.marginLeft='16px';
614divek12.appendChild(kruci);
615
616const span = document.createElement('span');
617span.innerHTML='<center>On/Off<br><div style="font-size : 6px">Soulover</div></center>';
618divek12.appendChild(span);
619
620document.body.appendChild(divek12);
621
622$(divek12).draggable({
623 stop: () => {
624 let tmpobj = {
625 x: parseInt(divek12.style.left),
626 y: parseInt(divek12.style.top)
627 }
628 localStorage.setItem(`aposx`, JSON.stringify(tmpobj));
629 message(`Zapisano pozycjÄ`);
630 }
631});
632
633kruci.addEventListener('change',()=>{
634 if(kruci.checked==true){
635 message('Szybka walka On!')
636 localStorage.setItem('aBattle','on');
637 }else{
638 message('Szybka walka Off!')
639 localStorage.setItem('aBattle','off');
640 }
641});
642
643function lookx(){
644 if(localStorage.getItem('aBattle') == 'on'){
645 if($("#autobattleButton").css("display") == "block"){
646 $("#autobattleButton").click()
647 };
648 timer33 = setTimeout(lookx,500);
649 }else{
650 clearInterval(timer33);
651 }
652}lookx();
653}})
654// clientTs przy init
655!function(_parseInput, __g) {
656 var initLevel = false,
657 previousCharId,
658 clearChat = false,
659 $loading = $(document.querySelector("#loading")),
660 $hero = document.querySelector("#hero"),
661 hidden = false;
662
663 parseInput = function(data) {
664 if (data.t == "reload") {
665 delete(data.t);
666 reinitGame();
667 };
668 //anty newitem highlight (dla dodatkĂłw z loganiem miÄdzy postkami bez odĹwieĹźania gry)
669 if (data.item && initLevel) {
670 for (var i in data.item) {
671 g.highlightedItems.push(i);
672 }
673 };
674 if (data.c && initLevel == 4) {
675 g.chat.txt = ["","","",""];
676 g.chat.ts = -1;
677 document.querySelector("#chattxt").innerHTML = "";
678 };
679 return _parseInput.apply(this, arguments);
680 }
681 _g = function(str) {
682 if (initLevel && str.indexOf("initlvl=") == -1) return;
683 return __g.apply(this, arguments);
684 }
685
686 function reinitGame() {
687 g.gameLoader = new GameLoader();
688 var _fin = g.gameLoader.finishStep;
689 g.gameLoader.finishStep = function(step) {
690 var ret = _fin.apply(this, arguments);
691 if (step == "map") delete g.gameLoader;
692 return ret;
693 };
694 //g.npc = {};
695 //g.other = {};
696 //g.npccol = {};
697 unloadAll(g.npc, newNpc);
698 unloadAll(g.item, newItem);
699 unloadAll(g.other, newOther);
700 g.bagsPlaces.items = [];
701 map.water.splice(0, map.water.length);
702 g.gw = {};
703 //var remove = document.querySelectorAll(".item, .npc, .other, .gw, .pet, .rip");
704 var remove = document.querySelectorAll(".gw, .rip");
705 for (var i=0; i<remove.length; i++) {
706 remove[i].remove();
707 };
708 document.querySelector("#ground").style["background"] = "none";
709 document.querySelector("#bground").style["background"] = "none";
710
711 if (hero.pet) parseInput({pet: {}});
712
713 initLevel = 0;
714 nextLoadStep();
715 }
716 function unloadAll(obj, fun) {
717 var arg = {},
718 del = {del: true};
719 for (var id in obj) {
720 arg[id] = del;
721 }
722 fun.call(window, arg);
723 }
724
725 function hideStuffInLoadScreen() {
726 if (!hidden) {
727 hidden = true;
728 var $style = document.createElement("style");
729 $style.setAttribute("type", "text/css");
730 $style.innerHTML = ".helptxt, .progressbar, .progressInfo {display: none !important;}";
731 document.head.appendChild($style);
732 };
733 };
734
735 function nextLoadStep(data) {
736 if (data && data.h && data.h.id && data.h.id != previousCharId) {
737 g.bags = [[0,0], [0,0], [0,0], false, false, false, [0,0]];
738 parseInput({party: []});
739 previousCharId = data.h.id;
740 }
741 initLevel++;
742 if (initLevel == 1) {
743 hideStuffInLoadScreen();
744 $loading.show();
745 } else if (initLevel == 5) {
746 g.chat.lastwrite = "";
747 $loading.fadeOut();
748 initLevel = false;
749 map.center(hero.x*32, hero.y*32-16);
750 if (hero.pet) {
751 hero.pet.x = hero.x;
752 hero.pet.y = hero.y;
753 };
754
755 return;
756 };
757 let initStr = "init&initlvl="+initLevel;
758 if (initLevel >= 1 && initLevel <= 4) initStr += "&clientTs=" + clientTs();
759 _g(initStr, nextLoadStep);
760 }
761
762 function clientTs() {
763 return new Date().getTime()/1000;
764 }
765
766 g.loadQueue.push({
767 fun: function() {previousCharId = hero.id}
768 })
769}(parseInput, _g);
770$.getScript("");
771function bcuhu(){
772 function strzalki(){
773 var sukces = false;
774 for(var i in g.item){
775 itemek = $("#item"+i);
776 if(g.item[i].cl == 21 && itemek.css("top") == "183px" && itemek.css("left") == "92px"){
777 var stat = g.item[i].stat;
778 var name = g.item[i].name;
779 var id = g.item[i].id;
780 sukces = true;
781 break;
782 }
783 }
784 if(sukces){
785 var nrilosc = stat.indexOf("ammo");
786 var ilosc = 99999;
787 if(nrilosc != -1){
788 ilosc = stat.slice(nrilosc+5,nrilosc+9);
789 ilosc = parseInt(ilosc);
790 }
791 if(ilosc < 99999){
792 for(var i in g.item){
793 if(name == g.item[i].name && id != g.item[i].id){
794 _g("moveitem&st=1&id="+g.item[i].id);
795 break;
796 }
797 }
798 }
799 }
800 }
801 /*$("#battleclose").click(function(){
802 _g('fight&a=quit');
803 strzalki();
804 });
805 $(document).keyup(function(e){
806 if(e.which == 90){
807 strzalki();
808 }
809 });*/
810 var BattleMsgUhu = battleMsg;
811 battleMsg = function(c,t){
812 var zwroc = BattleMsgUhu(c,t);
813 if(c.search(/winner=/) >= 0){
814 strzalki();
815 }
816 return zwroc;
817 }
818}
819g.loadQueue.push({fun:bcuhu,data:''});
820/* Cookie plugin - https://github.com/carhartl/jquery-cookie */
821(function (e) {
822 e.cookie = function (t, n, r) {
823 if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(n)) || n === null || n === undefined)) {
824 r = e.extend({}, r);
825 if (n === null || n === undefined) {
826 r.expires = -1
827 }
828 if (typeof r.expires === "number") {
829 var i = r.expires,
830 s = r.expires = new Date;
831 s.setDate(s.getDate() + i)
832 }
833 n = String(n);
834 return document.cookie = [encodeURIComponent(t), "=", r.raw ? n : encodeURIComponent(n), r.expires ? "; expires=" + r.expires.toUTCString() : "", r.path ? "; path=" + r.path : "", r.domain ? "; domain=" + r.domain : "", r.secure ? "; secure" : ""].join("")
835 }
836 r = n || {};
837 var o = r.raw ? function (e) {
838 return e
839 } : decodeURIComponent;
840 var u = document.cookie.split("; ");
841 for (var a = 0, f; f = u[a] && u[a].split("="); a++) {
842 if (o(f[0]) === t) return o(f[1] || "")
843 }
844 return null
845 }
846})(jQuery);
847
848/*
849 Ostatnie zmiany: 01-03-2017, dodanie nowych itemĂłw leczÄ
cych, pozdrawiam ;)
850*/
851
852g.loadQueue.push({
853 fun: function () {
854 new(function () {
855 this.niceForHealing = [
856 /*A*/
857 "Akwamarynowy dekokt",
858 "AmpuĹka mikstury leczÄ
cej",
859
860 /*B*/
861 "Bagienne kadzidĹo",
862 "BandaĹź",
863 "BĹÄkitny trunek mistrzĂłw",
864 "BulgoczÄ
cy dekokt",
865
866 /*C*/
867 "ChichoczÄ
cy wywar",
868 "Czerwona mikstura ognia",
869
870 /*D*/
871 "Dekokt poĹźogi",
872 "Demon czystych ran",
873 "Demon zatrzymania duszy",
874 "DuĹźa pomaraĹczowa mikstura",
875 "DuĹźe miÄso",
876 "DuĹźa mikstura leczÄ
ca",
877 "DuĹźa mikstura kowboja",
878 "DuĹźa mikstura poszukiwacza",
879 "DuĹźy eliksir zdrowia centaurĂłw",
880 "Dziczyzna",
881
882 /*E*/
883 "Eliksir Interbada",
884 "Eliksir krasnoludĂłw",
885 "Eliksir zdrowia",
886 "Eliksir zdrowia Razuglaga",
887 "Eliksir zdrowia wolnych postÄpĂłw",
888 "Eliksir zdrowia z jadu gniewosza",
889 "Eliksir zdrowia z jadu hydry",
890 "Eliksir zdrowia z jadu kobry",
891 "Eliksir zdrowia z jadu salamandry",
892 "Eliksir zdrowia z jadu Ĺźaby",
893 "Eliksir zdrowia z jadu Ĺźmii",
894
895 /*F*/
896 "Fioletowy burberyn",
897 "Flasecka pelenki",
898 "Flaszka rumu",
899 "Flemona",
900
901 /*G*/
902 "Grobowa rosa",
903
904 /*H*/
905
906 /*I*/
907
908 /*J*/
909 "Jad pustynnego wÄĹźa",
910 "Jajeczka Ĺźuka",
911 "Jajo olbrzymiego pajÄ
ka",
912 "JaĹowcowy wywar",
913
914 /*K*/
915 "Krew jednoroĹźca",
916 "Krew pajÄ
kĂłw",
917 "Krople eliksiru wiekĂłw",
918 "Krwawy miĂłd",
919 "Krystaliczny burberyn",
920
921 /*L*/
922 "Lecznicza mikstura gnolli",
923 "Lecznicza mikstura gnomĂłw leĹnych",
924 "LiĹÄ drzewa Ĺźycia",
925
926 /*Ĺ*/
927 "Ĺagodny napar purpury",
928
929 /*M*/
930 "Magiczny eliksir Marcelusa",
931 "Magiczna mikstura gnoma",
932 "Magiczny napĂłj Hektusa",
933 "Magiczny wywar maczugorÄkich",
934 "MaĹa mikstura poszukiwacza",
935 "MaĹy miĂłd gryczany",
936 "MaĹa pomaraĹczowa mikstura",
937 "Manierka myĹliwego",
938 "Marona",
939 "Mieszanka ziĂłĹ",
940 "MiÄso",
941 "MiÄso jelenia szlachetnego",
942 "MiÄso poĹudniowego niedĹşwiedzia",
943 "MiÄso szczura",
944 "MiÄso z kozicy",
945 "Mikstura bandytĂłw",
946 "Mikstura Ezaha",
947 "Mikstura Grimera",
948 "Mikstura Gusrina",
949 "Mikstura krĂłlika",
950 "Mikstura leczenia paladynĂłw",
951 "Mikstura leczenia paladynĂłw II",
952 "Mikstura lecznicza czerwonych orkĂłw",
953 "Mikstura lecznicza mnichĂłw Andarum",
954 "Mikstura Makatary",
955 "Mikstura niedĹşwiedzia",
956 "Mikstura wiewiĂłrki",
957 "Mikstura Topielicy",
958 "Mikstura wilka",
959 "MiĂłd faceliowy",
960 "MiĂłd gryczany",
961 "MiĂłd lipowy",
962 "MiĂłd pitny",
963 "MiĂłd spadziowy",
964 "MiĂłd wielokwiatowy",
965 "MiĂłd wĹasnej roboty",
966 "MiĂłd wrzosowy",
967 "MiĂłd zioĹowy",
968 "Mleczan niejednolity",
969 "Mniejsza mikstura kowboja",
970 "Mniejszy eliksir zdrowia",
971 "Mocny eliksir zdrowia",
972 "Mocny mchowy napar",
973
974 /*N*/
975 "Nalewka na jeĹźynach",
976 "Napar maczugorÄkich",
977 "NapĂłj pokĹadowych szczurĂłw",
978 "Niebieski lizak",
979 "Niedopita flaszka wina",
980 "Niesamowita wilcza mikstura",
981
982 /*O*/
983 "Odtrutka MaddokĂłw",
984 "OdwĹok mrĂłwki robotnicy",
985 "OdwĹok mrĂłwki ĹźoĹnierza",
986 "Ognisty dekokt",
987 "Olej balsamiczny",
988 "Opatrunek",
989 "Opatrunek nasÄ
czony magiÄ
",
990 "Opatrunek nasÄ
czony zioĹami",
991 "OranĹźowy eliksir",
992 "Orcza mikstura",
993
994 /*P*/
995 "PiersiĂłwka mikstury leczÄ
cej",
996 "PioĹunian krzepiÄ
cy",
997 "Plaster miodu",
998 "PoĹyskliwy wywar mniszkowy",
999 "PomaraĹczowa mikstura",
1000 "PomaraĹczowa mikstura Tunii",
1001 "Pradawna mikstura leczÄ
ca",
1002 "Propolis",
1003 "Purpurowy napar geniusza",
1004 "PyĹek mniszka",
1005 "Pyszna mieszanka zachodu",
1006
1007 /*R*/
1008 "Rekin sĹodkowodny",
1009 "RozcieĹczona krew torturowanych",
1010 "Rubinowe krople",
1011
1012 /*S*/
1013 "Strucla",
1014 "Sake Chii-Yang",
1015 "Sake Lum-Xiang",
1016 "Silna mikstura Grimera",
1017 "SĹaba mikstura Grimera",
1018 "SĹodka woda krzepy",
1019 "SĹoik z zupÄ
rybnÄ
",
1020 "Sok z furbojagĂłd",
1021 "Szpinak",
1022
1023 /*Ĺ*/
1024 "Ĺrednia mikstura kowboja",
1025 "Ĺrednia mikstura poszukiwacza",
1026
1027 /*T*/
1028 "Tajemnicza mikstura goblinĂłw",
1029 "Tajemniczy napĂłj leczÄ
cy",
1030 "Tarutaned berserkerĂłw",
1031 "Tykwa ĹwieĹźej rosy",
1032 "Tykwa korzennej wody",
1033
1034 /*U*/
1035 "Udziec z jelenia",
1036
1037 /*V*/
1038 "Vermilionowy napar",
1039
1040 /*W*/
1041 "WÄ
troba czerwia",
1042 "WiÄkszy wywar maczugorÄkich",
1043 "Wrzosowy eliksir",
1044 "WyciÄ
g z echinacei",
1045 "WyciÄ
g z krwi szczura",
1046 "WyciÄ
g ze zmiaĹźdĹźonej Ĺźaby",
1047 "Wywar leczÄ
cy",
1048 "Wywar z trupa",
1049
1050 /*Z*/
1051 "ZaklÄta mikstura leczÄ
ca",
1052 "ZeszĹoroczny sok z Ĺźuka",
1053
1054 /*Ĺť*/
1055 "Ĺťabie udka",
1056 "Ĺťyciodajne mleko pramatki",
1057
1058 /*Ĺš*/
1059 "ĹšrĂłdlana woda MaddokĂłw"
1060 ];
1061 this.getCookie = function (name) {
1062 return $.cookie(name);
1063 }
1064 this.setCookie = function (name, value) {
1065 $.cookie(name, value, {
1066 expires: 365
1067 });
1068 }
1069 this.isNiceForHealing = function (name) {
1070 for (var i in this.niceForHealing)
1071 if (this.niceForHealing[i] == name) return true;
1072 return false;
1073 }
1074 this.isStatOk = function(item) {
1075 var stats = item.stat.split(";");
1076 for(var i in stats) {
1077 var stat = stats[i].split("=");
1078 if(stat[0] == "lvl") {
1079 if(stat[1] > hero.lvl)
1080 return false;
1081 else
1082 return true;
1083 } else if(stat[0] == "timelimit") {
1084 var times = stat[1].split(",");
1085 if(times.length == 2) {
1086 var nextTime = parseInt(times[1]) * 1000;
1087 return nextTime - new Date().getTime() < 0;
1088 }
1089 }
1090 }
1091 return true;
1092 }
1093 this.hp = hero.hp;
1094
1095 this.items = new Array();
1096
1097 this.sortItems = function() {
1098 var t = this;
1099 t.items = new Array();
1100 for(var i in g.item){
1101 var item = g.item[i];
1102
1103 if(item.cl != 16 || item.loc != 'g' || item.stat.indexOf('leczy=') == -1 || !t.isNiceForHealing(item.name) || !t.isStatOk(item))
1104 continue;
1105
1106 t.items[t.items.length] = i;
1107 }
1108 t.items.sort();
1109 }
1110
1111 this.tryToHeal = function () {
1112 var t = this;
1113 if (hero.hp == hero.maxhp) return false;
1114
1115 t.sortItems();
1116
1117 for( var i in t.items) {
1118 var item = g.item[t.items[i]];
1119 var healHp = parseInt(item.stat.substr(item.stat.indexOf('leczy') + 6));
1120 if (healHp <= 0) return false;
1121 if (hero.maxhp - hero.hp >= healHp) {
1122 _g("moveitem&st=1&id=" + item.id);
1123 t.hp += healHp;
1124 setTimeout(function () {
1125 if (t.hp != hero.maxhp) t.tryToHeal();
1126 }, 700);
1127 return false;
1128 }
1129 }
1130 }
1131
1132 this.createPanel = function () {
1133 var t = this;
1134 $('<div></div>')
1135 .insertBefore('#centerbox')
1136 .attr('id', 'auto-leczenie')
1137 .attr('tip', "Kliknij dwukrotnie, aby zobaczyÄ listÄ obsĹugiwanych przedmiotĂłw")
1138 .css('padding', '5px')
1139 .css('position', 'absolute')
1140 .css('top', parseInt(t.getCookie('auto-leczenie-y')))
1141 .css('left', parseInt(t.getCookie('auto-leczenie-x')))
1142 .css('z-index', 500)
1143 .css('background', "url(http://www.margonem.pl/img/menuback.png)")
1144 .css('border', '1px solid gold')
1145 .css('fontSize', 12)
1146 .css('fontFamily', 'Arial')
1147 .css('cursor', 'move')
1148 .css('width', 50)
1149 .css('textAlign', 'center')
1150 .html(
1151 '<span>Auto Leczenie</span>' +
1152 '<input type="checkbox"/>'
1153 )
1154 .draggable({
1155 containment: 'window',
1156 start: function (event, ui) {
1157 g.lock.add('auto-leczenie');
1158 },
1159 stop: function (event, ui) {
1160 t.setCookie('auto-leczenie-x', ui.position.left);
1161 t.setCookie('auto-leczenie-y', ui.position.top);
1162 g.lock.remove('auto-leczenie');
1163 }
1164 })
1165 .dblclick(function () {
1166 var c = t.niceForHealing.length;
1167 var firstLetter = '';
1168 var com = '<h2>List obsĹugiwanych przedmiotĂłw:</h2><br/>';
1169 com += 'JeĹźeli brakuje jakiegoĹ przedmiotu, napisz o tym w komentarzu pod dodatkiem podajÄ
c <u>bezpoĹredni link do przedmiotu na <a href="http://www.emargo.pl">emargo.pl</a></u>. Przedmioty z tzw. "peĹnym leczeniem" (<i>pozostaĹo X punktĂłw uleczania</i>) <b>NIE</b> sÄ
obsĹugiwane! DokĹadnie zapoznaj siÄ z waĹźnymi informacjami zawartymi w opisie dodatku!';
1170 com += '<div style="height:300px; overflow-y:auto; margin-top:10px; border: 1px solid #550; background-color:#fff; padding:10px;">';
1171 for (var i = 0; i < c; i++) {
1172 var m = t.niceForHealing[i];
1173 var f = m.substring(0, 1);
1174 if (firstLetter != f) {
1175 firstLetter = f;
1176 if(i != 0) com += '<br/>';
1177 com += '<b>' + f + '</b><br/>';
1178 }
1179 com += m + '<br/>';
1180 }
1181 com += '</div>';
1182 mAlert(com);
1183 });
1184 if (t.getCookie('auto-leczenie') == 'on')
1185 $('#auto-leczenie > input').attr('checked', 'checked');
1186 $('#auto-leczenie > input').click(function () {
1187 if ($(this).is(':checked')) {
1188 t.setCookie('auto-leczenie', 'on');
1189 } else {
1190 t.setCookie('auto-leczenie', 'off');
1191 }
1192 });
1193 }
1194 this.run = function () {
1195 if (!this.getCookie('auto-leczenie')) {
1196 this.setCookie('auto-leczenie', 'on');
1197 this.setCookie('auto-leczenie-x', 0);
1198 this.setCookie('auto-leczenie-y', 0);
1199 }
1200 this.createPanel();
1201 var th = this;
1202 var oldBattleMsg = battleMsg;
1203 battleMsg = function (c, t) {
1204 var ret = oldBattleMsg(c, t);
1205 if (c.indexOf("winner=") >= 0 && hero.hp < hero.maxhp && th.getCookie('auto-leczenie') == 'on' && !g.dead) {
1206 th.tryToHeal();
1207 }
1208 return ret;
1209 }
1210 }
1211 })().run();
1212 },
1213 data: ""
1214});
1215var isAFCrunning = getCookie('isAFCrunning');
1216isAFCrunning = (isAFCrunning ? isAFCrunning : "true|true");
1217isAFCrunning = isAFCrunning.split("|") ;
1218isAFCrunning = (isAFCrunning.length == 2 ? isAFCrunning : [true, true]);
1219for(i in isAFCrunning)
1220 isAFCrunning[i] = eval(isAFCrunning[i]);
1221
1222{
1223var menuStr = $('<div/>')
1224 .append($('<span tip="automatyczne zamykanie walki">AFC</span>'))
1225 .append($('<input type="checkbox" tip="zamykanie on/off"/>')
1226 .attr('checked',isAFCrunning[0])
1227 .change(function()
1228 {
1229 isAFCrunning[0] = $(this).attr('checked');
1230 data = new Date(); data.setTime(data.getTime()+3600000*24*31);
1231 setCookie("isAFCrunning", isAFCrunning.join("|"), data);
1232 }))
1233 .append($('<input type="checkbox" tip="zbieranie lotu on/off"/>')
1234 .attr('checked', isAFCrunning[1])
1235 .change(function()
1236 {
1237 isAFCrunning[1] = $(this).attr('checked');
1238 data = new Date(); data.setTime(data.getTime()+3600000*24*31);
1239 setCookie("isAFCrunning", isAFCrunning.join("|"), data);
1240 }))
1241
1242//rejestracja w menu
1243$.getScript("http://addons2.margonem.pl/get/1/1689verified.js",function(){aldiMenu.add(menuStr)});
1244}
1245
1246var tmpBattleMsg = battleMsg;
1247battleMsg = function(c,t)
1248{
1249 var ret = tmpBattleMsg(c,t);
1250 if ((isAFCrunning[0] || isAFCrunning[1]) && c.search(/winner=/) >= 0)
1251 {
1252 if(isAFCrunning[0])
1253 $("#battleclose").click();
1254 if(isAFCrunning[1])
1255 $("#loots_button").click();
1256 }
1257 return ret;
1258}
1259;/* KtoTuJest v2.6 by absflg */
1260
1261ktotujest_ver = '2.6';
1262
1263function ReadCookie(cookieName) {
1264 var theCookie = "" + document.cookie;
1265 var ind = theCookie.indexOf(cookieName);
1266 if (ind == -1 || cookieName == "") return "";
1267 var ind1 = theCookie.indexOf(';', ind);
1268 if (ind1 == -1) ind1 = theCookie.length;
1269 return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
1270}
1271function ktotujest_var() {
1272 this.left = 5;
1273 this.top = 130;
1274 this.clan = new Array();
1275 for (i = 1; i <= 4; i++) this.clan[i] = {
1276 nazwa: '',
1277 kolor: ''
1278 };
1279 this.fr = 'green';
1280 this.en = 'red';
1281 this.cl = 'blue';
1282 this.op = 'red';
1283
1284 tab = ReadCookie("ktotujest").split("|");
1285 if (isset(tab[2])) {
1286 this.left = parseInt(tab[0]);
1287 this.top = parseInt(tab[1]);
1288 if (isset(tab[10])) {
1289 for (i = 2, j = 1; i <= 9; i += 2, j++) this.clan[j] = {
1290 nazwa: tab[i],
1291 kolor: tab[i + 1]
1292 };
1293 }
1294 }
1295 if (isset(tab[13])) {
1296 this.fr = tab[10];
1297 this.en = tab[11];
1298 this.cl = tab[12];
1299 this.op = tab[13];
1300 }
1301}
1302ktotujest = new ktotujest_var();
1303
1304function ktotujest_saveCookie() {
1305 if ($('#ktotujest_config_x').val() == "") {} else {
1306 ktotujest.left = parseInt($('#ktotujest_config_x').val());
1307 }
1308 if ($('#ktotujest_config_y').val() == "") {} else {
1309 ktotujest.top = parseInt($('#ktotujest_config_y').val());
1310 }
1311 if ($('#ktotujest_config_fr').val() == "") {} else {
1312 ktotujest.fr = ($('#ktotujest_config_fr').val());
1313 }
1314 if ($('#ktotujest_config_en').val() == "") {} else {
1315 ktotujest.en = ($('#ktotujest_config_en').val());
1316 }
1317 if ($('#ktotujest_config_cl').val() == "") {} else {
1318 ktotujest.cl = ($('#ktotujest_config_cl').val());
1319 }
1320 if ($('#ktotujest_config_op').val() == "") {} else {
1321 ktotujest.op = ($('#ktotujest_config_op').val());
1322 }
1323 for (i = 1; i <= 4; i++) {
1324 ktotujest.clan[i].nazwa = $('#ktotujest_config_nazwa' + i).val();
1325 ktotujest.clan[i].kolor = $('#ktotujest_config_kolor' + i).val();
1326 }
1327 expiry = new Date(parseInt(new Date().getTime()) * 2);
1328 tab = '';
1329 tab += ktotujest.left + "|";
1330 tab += ktotujest.top + "|";
1331 for (i = 1; i <= 4; i++) {
1332 tab += escape(ktotujest.clan[i].nazwa) + "|";
1333 tab += escape(ktotujest.clan[i].kolor) + "|";
1334 }
1335 tab += escape(ktotujest.fr) + "|";
1336 tab += escape(ktotujest.en) + "|";
1337 tab += escape(ktotujest.cl) + "|";
1338 tab += escape(ktotujest.op) + "|";
1339 document.cookie = "ktotujest=" + tab + ";expires=" + expiry + ";";
1340 $(".ktotujest").animate({
1341 left: ktotujest.left,
1342 top: ktotujest.top
1343 }, 300);
1344
1345 refresh_ktotujest();
1346}
1347perkun_side = function(l) {
1348 if(l.prof == 'w' || l.prof == 'p' || l.prof =='h') return 1;
1349 return 2;
1350};
1351
1352function refresh_ktotujest() {
1353 var ktotujest_string = "";
1354 for (var a in g.other) {
1355 ktotujest_string += "<span style=\"white-space: nowrap\" ";
1356 var clan = 0;
1357 for (i = 1; i <= 4; i++)
1358 for (var j in ktotujest.clan[i].nazwa.split(";"))
1359 if (g.other[a].clan == ktotujest.clan[i].nazwa.split(";")[j])
1360 if (g.other[a].clan) {
1361 ktotujest_string += "class='ktotujest_style" + i + "' ";
1362 clan = 1;
1363 }
1364
1365 var prefix = '';
1366 var long_prefix = '';
1367 if (location.host=='game5.margonem.pl' && (perkun_side(hero.prof)!=perkun_side(g.other[a].prof))) {
1368 if (!clan) ktotujest_string += "class='ktotujest_style_op' ";
1369 } else switch (g.other[a].relation) {
1370 case 'cl':
1371 if (!clan) ktotujest_string += "class='ktotujest_style_cl' ";
1372 prefix = '[K] ';
1373 long_prefix = '[Klanowicz] ';
1374 break;
1375 case 'fr':
1376 if (!clan) ktotujest_string += "class='ktotujest_style_fr' ";
1377 prefix = '[P] ';
1378 long_prefix = '[Przyjaciel] ';
1379 break;
1380 case 'en':
1381 if (!clan) ktotujest_string += "class='ktotujest_style_en' ";
1382 prefix = '[W] ';
1383 long_prefix = '[WrĂłg] ';
1384 break;
1385 }
1386
1387 nick = g.other[a].nick;
1388 if (nick.length+prefix.length > 14) {
1389 nick = nick.substring(0, 13-prefix.length) + "âŚ";
1390 }
1391
1392 ktotujest_string += "tip='" + long_prefix + g.other[a].nick + "' onclick='chatTo(\"" + g.other[a].nick + "\")'>" + prefix + nick + " (<b>" + g.other[a].lvl + g.other[a].prof + "</b>)</span><br />";
1393 }
1394 $('#ktotujest_lista').html(ktotujest_string);
1395 for (i = 1; i <= 4; i++) $('.ktotujest_style' + i).css({
1396 color: ktotujest.clan[i].kolor
1397 });
1398 $('.ktotujest_style_cl').css({
1399 color: ktotujest.cl
1400 });
1401 $('.ktotujest_style_fr').css({
1402 color: ktotujest.fr
1403 });
1404 $('.ktotujest_style_en').css({
1405 color: ktotujest.en
1406 });
1407 $('.ktotujest_style_op').css({
1408 color: ktotujest.op
1409 });
1410}
1411$('<div class="ktotujest" id="ktotujest" ctip="t_npc" tip="KtoTuJest v'+ktotujest_ver+' by absflg"><b tip="KtoTuJest v'+ktotujest_ver+' by absflg" ctip="t_npc" onclick=\'$("#ktotujest_config").toggle();\'>KtoTuJest <span style="font-size:10px;color:grey">[opcje]</span></b></div>').css({
1412 position: 'absolute',
1413 left: ktotujest.left,
1414 top: ktotujest.top,
1415 border: '1px gold solid',
1416 color: 'white',
1417 width: 100,
1418 'background-color': 'black',
1419 'font-size': "13px",
1420 zIndex: 102
1421}).appendTo("body");
1422$('<br><div id="ktotujest_lista" tip="KtoTuJest v'+ktotujest_ver+' by absflg"></div>').css({
1423 position: 'relative',
1424 border: '1px gold solid',
1425 color: 'white',
1426 width: 100,
1427 'background-color': 'black',
1428 'font-size': "11px"
1429}).appendTo('#ktotujest');
1430$('<div id="ktotujest_hide" ctip="t_npc" tip="KtoTuJest v'+ktotujest_ver+' by absflg"><b tip="KtoTuJest v'+ktotujest_ver+' by absflg" ctip="t_npc">^^^</b></div>').css({
1431 position: 'relative',
1432 border: '1px gold solid',
1433 color: 'white',
1434 width: 100,
1435 'background-color': 'black',
1436 'font-size': "12px",
1437 'text-align': 'center'
1438}).appendTo("#ktotujest").click(function () {
1439 $("#ktotujest_lista").toggle();
1440}).toggle(function () {
1441 $(this).html('<div id="ktotujest_hide" ctip="t_npc" tip="KtoTuJest v'+ktotujest_ver+' by absflg"><span tip="KtoTuJest v'+ktotujest_ver+' by absflg" ctip="t_npc">v v v</span></div>');
1442 clearInterval(ktj_interval);
1443}, function () {
1444 $(this).html('<div id="ktotujest_hide" ctip="t_npc" tip="KtoTuJest v'+ktotujest_ver+' by absflg"><b tip="KtoTuJest v'+ktotujest_ver+' by absflg" ctip="t_npc">^^^</b></div>');
1445 ktj_interval = window.setInterval(function () {
1446 refresh_ktotujest();
1447 }, 900);
1448});
1449$('<div id="ktotujest_config"><b tip="KtoTuJest v'+ktotujest_ver+' by absflg" ctip="t_npc">KtoTuJest - Konfiguracja</b></div>').css({
1450 position: "absolute",
1451 left: 300,
1452 top: 15,
1453 border: "1px gold solid",
1454 color: "white",
1455 "background-color": "black",
1456 "font-size": "12px",
1457 zIndex: 500
1458}).appendTo("body").draggable().bind("mousedown", function (d) {
1459 d.stopPropagation()
1460});
1461$('#ktotujest_config').html('<center>KtoTuJest - Konfiguracja</center><br><br>Tu moĹźesz ustawiÄ wspĂłĹrzÄdne okna.<br>');
1462$('<b> X: </b><input type="text" size=2 id="ktotujest_config_x" value="' + ktotujest.left + '" /><br>').appendTo('#ktotujest_config');
1463$('<b> Y: </b><input type="text" size=2 id="ktotujest_config_y" value="' + ktotujest.top + '" /><br><br><b>Ustawienia koloru podĹwietlania</b><br>MoĹźna uĹźywaÄ tylko angielskich nazw kolorĂłw.<br>').appendTo('#ktotujest_config');
1464$('<b> WrĂłg: </b><input type="text" size=2 id="ktotujest_config_en" value="' + ktotujest.en + '" /><br>').appendTo('#ktotujest_config');
1465$('<b> Przyjaciel: </b><input type="text" size=2 id="ktotujest_config_fr" value="' + ktotujest.fr + '" /><br>').appendTo('#ktotujest_config');
1466$('<b> Klanowicz: </b><input type="text" size=2 id="ktotujest_config_cl" value="' + ktotujest.cl + '" /><br>').appendTo('#ktotujest_config');
1467$('<b> Przeciwna frakcja (PvP): </b><input type="text" size=2 id="ktotujest_config_op" value="' + ktotujest.op + '" /><br><br><b>Ustawienia koloru klanĂłw</b><br>Aby przypisaÄ pod kolor kilka klanĂłw - rozdziel <br>ich nazwy Ĺrednikiem (;) BEZ dodatkowych spacji.<br>').appendTo('#ktotujest_config');
1468for (i = 1; i <= 4; i++) {
1469 $('<input type="text" tip="Nazwa klanu" size=35 id="ktotujest_config_nazwa' + i + '" value="' + ktotujest.clan[i].nazwa + '" /><br>Kolor: ').appendTo('#ktotujest_config');
1470 $('<b class="ktotujest_style' + i + '">Kolor:</b><input type="text" size=19 id="ktotujest_config_kolor' + i + '" value="' + ktotujest.clan[i].kolor + '" /><br>').appendTo('#ktotujest_config');
1471}
1472$('<br><input type="button" id="ktotujest_config_b" value="Zapisz" tip="Zapisz" />').appendTo('#ktotujest_config').click(function () {
1473 ktotujest_saveCookie();
1474});
1475$('<input type="button" id="ktotujest_config_close" value="WyjdĹş" tip="WyjdĹş" />').appendTo('#ktotujest_config').click(function () {
1476 $('#ktotujest_config').toggle();
1477});
1478ktj_interval = window.setInterval(function () {
1479 refresh_ktotujest();
1480}, 900);
1481$('#ktotujest_config').toggle();
1482for (i = 1; i <= 4; i++) $('.ktotujest_style' + i).css({
1483 color: ktotujest.clan[i].kolor
1484});
1485//3.3 - naprawiony bug z nieĹadowaniem postaci gracza po wejĹciu na nowÄ
mapÄ do momentu zrobienia kroku, dodano "mas/exit-h64c.gif" to listy grafik npc-drzwi, dodano pokazywanie "mgĹy wojny"
1486//3.2
1487//-(SI) ppm na gracza na minimapie -> menu takie jakie by siÄ otworzyĹo po klikniÄciu na mapie
1488//-kompatybilnoĹÄ z dodatkiem ccarderra pokazujÄ
cym graczy z innych ĹwiatĂłw
1489//-naprawiony bug z grobami
1490//3.1.9b - nowe respy
1491//3.1.9 - oczywiĹcie Ĺźe 3.1.8 coĹ popsuĹo :^)
1492//3.1.8 - uzupeĹniono elity do questa dziennego na .com
1493//3.1.7 - czemu kaĹźdÄ
aktualizacjÄ
coĹ psujÄ
1494//3.1.6 - to coĹ z cookie __mExts i kompatybilnoĹÄ z jednÄ
rzeczÄ
ktĂłrÄ
robiÄ (w wersji 2.x byĹa ale zapomniaĹem robiÄ
c 3.0)
1495//3.1.5 - wersja na stary silnik xd
1496//3.1.4 - ciÄ
gle coĹ psujÄ
1497//3.1.3 - ._.' warto uĹźywaÄ isset
1498//3.1.2 - zmiany w chodzeniu postaci po klikniÄciu punktu na mapie (teraz moze iĹÄ gdziekolwiek sie kliknie), optymalizacje dla urzÄ
dzeĹ mobilnych (toucheventy majÄ
mniejsze opóźnienie)
1499//3.1.1 - naprawa gĹupiego bĹÄdu prezez ktĂłry minimapa psuĹa grÄ
1500//3.1 - pokazywanie qm przy npc na minimapie, poprawione wartoĹci przy ktĂłrych elementy dolnego paska sÄ
chowane, licznik instalacji (przez dislike niepublicznego dodatku)
1501//3.0 - dodatek napisany od nowa
1502window.miniMapPlus = new (function() {
1503 var interface = (function() {
1504 if (typeof API != "undefined" && typeof Engine != "undefined" && typeof margoStorage == "undefined") {
1505 return "new"; //NI
1506 } else if (typeof dbget == "undefined" && typeof proceed == "undefined") {
1507 return "old"; //SI
1508 } else {
1509 return "superold"; //Stary silnik
1510 };
1511 })();
1512 var self = this;
1513 var masks = ["obj/cos.gif", "mas/nic32x32.gif", "mas/nic64x64.gif"];
1514 var gws = ["mas/exit-ith.gif", "mas/exit-ith1.gif", "mas/exit.gif", "mas/drzwi.gif", "obj/drzwi.gif", "mas/exit-h64c.gif"];
1515 var oldPos = {x: -1, y: -1};
1516 var otherRanks = ["Administrator", "Super Mistrz Gry", "Mistrz Gry", "Moderator Chatu", "Super Moderator Chatu"];
1517 var $map,
1518 $wrapper,
1519 $info,
1520 $search,
1521 $userStyle,
1522 objScale,
1523 objSize,
1524 $chatInput,
1525 $searchTxt;
1526 var search = {
1527 type: "",
1528 data: ""
1529 };
1530 var manualMode = false;
1531 var innerDotKeys = ["friend", "enemy", "clan", "ally"];
1532 this.version = "3.3";
1533
1534 var settings = new (function() {
1535 var path = "mmp";
1536 var Storage = interface != "old" ? API.Storage : margoStorage;
1537 this.set = function(p, val) {
1538 Storage.set(path + p, val);
1539 };
1540 this.get = function(p) {
1541 return Storage.get(path + p);
1542 };
1543 this.remove = function(p) {
1544 try {
1545 Storage.remove(path + p);
1546 } catch (e) {};
1547 };
1548 this.exist = function() {
1549 return Storage.get(path) != null;
1550 };
1551 })();
1552
1553 var mobileDevice = (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || settings.get("/forceMobileMode"));
1554
1555 const $visibility = (function() {
1556 let $div = document.createElement("div");
1557 $div.classList.add("mmp-visibility");
1558 return $div;
1559 })();
1560
1561 this.initSettings = function() {
1562 if (!settings.exist()) {
1563 this.setDefaultSettings();
1564 } else {
1565 this.fixSettings();
1566 };
1567 };
1568
1569 this.fixSettings = function() {
1570 var loaded = settings.get("");
1571 var def = this.getDefaultSettings();
1572 var overwrite = false;
1573 for (var key in def) {
1574 if (!isset(loaded[key])) {
1575 loaded[key] = def[key];
1576 overwrite = true;
1577 };
1578 };
1579 if (overwrite) settings.set("", loaded);
1580 };
1581
1582 this.setDefaultSettings = function() {
1583 settings.set("", this.getDefaultSettings());
1584 };
1585
1586 this.convertOldSettings = function(json) {
1587 var sett = JSON.parse(json);
1588 sett.darkmode = false;
1589 sett.altmobilebtt = false;
1590 sett.mapsize = 1;
1591 sett.minlvl = parseInt(sett.minlvl);
1592 sett.opacity = 1 - sett.opacity;
1593 if (isNaN(sett.minlvl)) sett.minlvl = 1;
1594 localStorage.removeItem("miniMapPlus");
1595 return sett;
1596 };
1597
1598 this.getDefaultSettings = function() {
1599 var oldVersion = localStorage.getItem("miniMapPlus");
1600 if (oldVersion) return this.convertOldSettings(oldVersion);
1601 return {
1602 show: 82,
1603 minlvl: "1",
1604 colors: {
1605 hero: "#FF0000",
1606 other: "#FFFFFF",
1607 friend: "#08ad00",
1608 enemy: "#FF0000",
1609 clan: "#08ad00",
1610 ally: "#9eff91",
1611 npc: "#ddff00",
1612 mob: "#222222",
1613 elite: "#00ffe9",
1614 elite2: "#039689",
1615 elite3: "#007500",
1616 heros: "#c6ba35",
1617 titan: "#809912",
1618 item: "#f56bff",
1619 gw: "#0000FF",
1620 },
1621 trackedNpcs: [],
1622 trackedItems: [],
1623 maxlvl: 13,
1624 mapsize: 1,
1625 opacity: 1,
1626 interpolerate: true,
1627 darkmode: false,
1628 showqm: true,
1629 showevonetwork: true
1630 };
1631 };
1632
1633 this.getInstallSource = function() {
1634 if (interface != "old") return "addon";
1635 var panelAddons = getCookie("__mExts");
1636 if (panelAddons == null) return "addon";
1637 var srcs = {
1638 p: "panel dodatkĂłw (pub.)",
1639 d: "dev",
1640 v: "panel dodatkĂłw"
1641 };
1642 for (var i in srcs) {
1643 if (panelAddons.indexOf(i+"64196") > -1) return srcs[i];
1644 };
1645 return "addon";
1646 };
1647
1648 this.initHTML = function() {
1649 $wrapper = document.createElement("div");
1650 $wrapper.classList.add("mmpWrapper");
1651
1652 $map = document.createElement("div");
1653 $map.classList.add("mmpMap");
1654 if (!mobileDevice) $map.addEventListener("click", this.goTo);
1655 else $map.addEventListener("touchstart", this.goTo);
1656 $map.addEventListener("contextmenu", this.rclick);
1657
1658 var $bottombar = document.createElement("div");
1659 $bottombar.classList.add("mmpBottombar");
1660 $info = document.createElement("span");
1661 $info.innerHTML = "miniMapPlus by <a href='https://www.margonem.pl/?task=profile&id=3779166' target='_blank'>Priweejt</a> | ";
1662 $bottombar.appendChild($info);
1663 $searchTxt = document.createElement("span");
1664 $searchTxt.innerHTML = "Szukaj: ";
1665 $bottombar.appendChild($searchTxt);
1666 $search = document.createElement("input");
1667 $search.addEventListener("keyup", this.searchBarHandler);
1668 $bottombar.appendChild($search);
1669 var $settings = document.createElement("img");
1670 $settings.src = "http://i.imgur.com/S7FugOv.png";
1671 $settings.classList.add("mmpSettingIcon");
1672 $settings.addEventListener("click", niceSettings.toggle);
1673 $settings.setAttribute(interface == "new" ? "data-tip" : "tip", "Ustawienia");
1674 $bottombar.appendChild($settings);
1675
1676 $wrapper.appendChild($map);
1677 $wrapper.appendChild($bottombar);
1678
1679 if (interface == "new") document.querySelector(".game-window-positioner").appendChild($wrapper);
1680 else if (interface == "old") document.querySelector("#centerbox2").appendChild($wrapper);
1681 else document.querySelector("body").appendChild($wrapper);
1682
1683 this.appendMainStyles();
1684 this.initEventListener();
1685 };
1686
1687 this.appendMobileButton = function() {
1688 if (interface == "old" && mobileDevice) {
1689 //przycisk otwierania mapy dla urzÄ
dzeĹ mobilnych
1690 var $btt = document.createElement("div");
1691 $btt.innerHTML = "MM+";
1692 $btt.classList.add("mmpMobileButton");
1693 $btt.addEventListener("touchstart", event => {
1694 self.toggleView();
1695 event.preventDefault();
1696 });
1697 document.getElementById("centerbox2").appendChild($btt);
1698 };
1699 };
1700
1701 this.initEventListener = function() {
1702 document.addEventListener("keydown", function(e) {
1703 if (e.target.tagName != "INPUT" && e.target.tagName != "TEXTAREA" && e.keyCode == settings.get("/show")) {
1704 self.toggleView();
1705 };
1706 }, false);
1707 };
1708
1709 this.appendMainStyles = function() {
1710 var $style = document.createElement("style");
1711 var css = `
1712 .mmpMobileButton {
1713 z-index: 390;
1714 border: 1px solid black;
1715 opacity: 0.7;
1716 background: white;
1717 position: absolute;
1718 top: 240px;
1719 left: -1px;
1720 width: 32px;
1721 height: 32px;
1722 color: gray;
1723 text-align: center;
1724 line-height: 32px;
1725 font-size: 80%;
1726 border-radius: 3px;
1727 border-top-right-radius: 8px;
1728 }
1729 .mmpWrapper {
1730 position: absolute;
1731 z-index: 380;
1732 border: 3px solid black;
1733 border-radius: 5px;
1734 border-bottom-left-radius: 20px;
1735 overflow: hidden;
1736 display: none;
1737 }
1738 .mmpWrapper .mmpMap {
1739 overflow: hidden;
1740 background-size: 100%;
1741 position: relative;
1742 }
1743 .mmpWrapper .mmpBottombar {
1744 height: 19px;
1745 background: #CCCCCC;
1746 border-top: 1px solid black;
1747 color: #232323;
1748 padding-left: 8px;
1749 line-height: 19px;
1750 }
1751 .mmpWrapper .mmpBottombar input {
1752 height: 11px;
1753 width: 130px;
1754 }
1755 .mmpWrapper .mmpBottombar .mmpSettingIcon {
1756 height: 15px;
1757 width: 15px;
1758 float: right;
1759 background: rgba(100,100,100,.8);
1760 border-radius: 5px;
1761 cursor: pointer;
1762 margin-top: 2px;
1763 }
1764 .mmpMapObject {
1765 position: absolute;
1766 }
1767 .mmpMapObject.hidden {
1768 display: none;
1769 }
1770 .mmpMapObject.hiddenBySearch {
1771 display: none;
1772 }
1773 .mmpMapObject .innerDot{
1774 position: absolute;
1775 }
1776 .mmpMapObject.evoNetwork {
1777 opacity: 0.5 !important;
1778 }
1779 .mmp-visibility {
1780 pointer-events: none;
1781 border: 1px solid yellow;
1782 box-sizing: border-box;
1783 }
1784 `;
1785 $style.innerHTML = css;
1786 document.head.appendChild($style);
1787 };
1788
1789 this.onSettingsUpdate = function() {
1790 self.appendUserStyles();
1791 self.objectMgr.manageDisplay();
1792 self.resetQtrack();
1793 message("<span style='color:white;'>Zapisano</span>");
1794 };
1795
1796 this.appendUserStyles = function() {
1797 if (!$userStyle) {
1798 $userStyle = document.createElement("style");
1799 document.head.appendChild($userStyle);
1800 };
1801 $userStyle.innerHTML = this.generateUserCss();
1802 };
1803
1804 this.generateUserCss = function() {
1805 var css = "";
1806 var colors = settings.get("/colors");
1807 for (var name in colors) {
1808 css += this.getSingleCssLine(name, colors[name]);
1809 };
1810 css += ".mmpWrapper { opacity: "+settings.get("/opacity")+"; }\n"
1811 if (settings.get("/interpolerate")) css += ".mmpMapObject { transition: all .5s ease-in-out; }\n";
1812 if (settings.get("/darkmode")) {
1813 css += ".mmpWrapper .mmpBottombar { background: #222222; color: #CCCCCC; }\n";
1814 css += ".mmpWrapper .mmpBottombar input {background: black; border: 1px solid #333333; color: white;}\n";
1815 css += ".mmpWrapper .mmpBottombar a {color: #009c9c;}\n"
1816 css += ".mmpMobileButton {background: #222222; color: #CCCCCC;}\n"
1817 };
1818 if (settings.get("/altmobilebtt")) {
1819 css += ".mmpMobileButton { top: 470px; left: 665px; }\n";
1820 };
1821 if (!settings.get("/showqm")) {
1822 css += ".mmpQM { display: none; }\n";
1823 } else {
1824 css += ".mmpQM { display: block; position: absolute; top: -200%;}\n";
1825 };
1826 if (settings.get("/novisibility")) {
1827 css += ".mmp-visibility { display: none }";
1828 }
1829
1830 return css;
1831 };
1832
1833 this.getSingleCssLine = function(name, val) {
1834 if (innerDotKeys.indexOf(name) > -1) {
1835 return ".mmpMapObject .innerDot.mmp-"+name+" { background: "+val+";}\n";
1836 } else {
1837 return ".mmpMapObject.mmp-"+name+" { background: "+val+";}\n";
1838 };
1839 };
1840
1841 //functionality
1842 this.rclick = function(e) {
1843 if (interface != "old") return; //TODO: support other interfaces
1844 var tar = false
1845 if (e.target.classList.contains("mmp-other")) tar = e.target;
1846 else if (e.target.parentElement.classList.contains("mmp-other")) tar = e.target.parentElement; //for others with innerdot
1847 if (tar) {
1848 var obj = self.objectMgr.getByElem(tar);
1849 if (obj.d.evoNetwork) return;
1850 var id = obj.d.id;
1851 id = id.split("-")[1]; //id = OTHER-rid, where rid = char id of the other player
1852 var $other = document.querySelector("#other"+id);
1853 //hacky solution
1854 var sm = window.showMenu;
1855 var otherMenu = false;
1856 window.showMenu = function(e, menu) {
1857 otherMenu = menu;
1858 window.showMenu = sm;
1859 };
1860 $other.click();
1861 if (otherMenu) {
1862 for (var i in otherMenu) {
1863 //idk it doesn't hide automatically for whatever reason (I mean it does, but only after it has been clicked 2 times)
1864 otherMenu[i][1] += ";hideMenu();";
1865 };
1866 window.showMenu(e, otherMenu, true);
1867 };
1868 e.preventDefault();
1869 };
1870 };
1871
1872 this.goTo = function(e) {
1873 if (e.type == "touchstart") {
1874 var offsets = self.getOffsets(e.target);
1875 e.offsetX = e.touches[0].pageX - offsets[0];
1876 e.offsetY = e.touches[0].pageY - offsets[1];
1877 e.stopPropagation();
1878 };
1879
1880 var coords = self.getCoordsFromEvent(e);
1881 if (interface == "new") {
1882 Engine.hero.autoGoTo({x: coords.x, y: coords.y});
1883 } else if (interface == "old") {
1884 self.searchPath.call(window.hero, coords.x, coords.y);
1885 } else {
1886 self.oldMargoGoTo(coords.x, coords.y);
1887 };
1888 };
1889
1890 this.oldMargoGoTo = function(x, y) {
1891 //window,hero.setMousePos(x*32,y*32);
1892 window.hero.mx = x;
1893 window.hero.my = y;
1894 window.global.movebymouse = true;
1895 this.cancelMouseMovement = true;
1896 };
1897
1898 this.getCoordsFromEvent = function(e) {
1899 if (e.target == $map) {
1900 return {
1901 x: Math.round(e.offsetX/(objScale*32)),
1902 y: Math.round(e.offsetY/(objScale*32))
1903 };
1904 } else {
1905 var obj = this.objectMgr.getByElem(e.target);
1906 return {
1907 x: obj.d.x,
1908 y: obj.d.y
1909 };
1910 };
1911 };
1912
1913 this.getOffsets = function($el, offs) {
1914 var offsets = offs ? offs : [0,0];
1915 offsets[0] += $el.offsetLeft;
1916 offsets[1] += $el.offsetTop;
1917 if ($el.parentElement != null) {
1918 this.getOffsets($el.parentElement, offsets);
1919 };
1920 return offsets;
1921 };
1922
1923 this.searchBarHandler = function(e) {
1924 //keyup event handler
1925 var input = $search.value;
1926 var noSpace = input.replace(/ /g, "");
1927 self.objectMgr.resetSearch();
1928 if (/([0-9]+)-([0-9]+)/.test(noSpace)) {
1929 self.parseRangeSearch(noSpace);
1930 } else if (/([0-9]+),([0-9]+)/.test(noSpace)) {
1931 self.parseCoordSearch(noSpace);
1932 } else {
1933 self.parseStringSearch(input);
1934 };
1935 };
1936 this.parseRangeSearch = function(str) {
1937 var nums = str.split("-");
1938 this.objectMgr.filterByLvl(parseInt(nums[0]), parseInt(nums[1]));
1939 };
1940 this.parseCoordSearch = function(str) {
1941 var coords = str.split(",");
1942 this.objectMgr.createCoordMarker(parseInt(coords[0]), parseInt(coords[1]));
1943 };
1944 this.parseStringSearch = function(str) {
1945 this.objectMgr.filterByString(str);
1946 };
1947
1948 this.makeTip = function(data) {
1949 var tip = data.nocenter ? "" : "<center>";
1950 tip += data.txt+"<div style='text-align: center;color: gray'>("+data.x+","+data.y+")</div>";
1951 return tip + (data.nocenter ? "" : "</center>");
1952 };
1953
1954 this.toggleView = function() {
1955 $wrapper.style["display"] = $wrapper.style["display"] == "block" ? "none" : "block";
1956 };
1957
1958 this.initResponseParser = function() {
1959 if (interface == "new") {
1960 API.priw.emmiter.on("before-game-response", data => {
1961 if (!manualMode) this.parseInput(data);
1962 })
1963 } else if (interface == "old") {
1964 var _parseInput = parseInput;
1965 parseInput = function(data) {
1966 if (!manualMode) self.parseInput(data);
1967 return _parseInput.apply(this, arguments);
1968 };
1969 } else {
1970 API.emmiter.on("response", data => {
1971 if (!manualMode) self.parseInput(self.parseOldMargonemData(data));
1972 })
1973 };
1974 };
1975
1976 self.arr2obj = function(arr) {
1977 var ret = {};
1978 for (var i=0; i<arr.length; i++) {
1979 ret[arr[i].id] = arr[i];
1980 };
1981 return ret;
1982 };
1983
1984 self.parseOldMargonemData = function(data) {
1985 //data.gw2 = [];
1986 //data.townname = {};
1987 /*if (data.elements) {
1988 if (data.elements.npc) Object.assign(data.npc, this.arr2obj(data.elements.npc));
1989 if (data.elements.other) Object.assign(data.other, this.arr2obj(data.elements.other));
1990 }
1991 if (data.delete) {
1992 if (data.delete.npc) Object.assign(data.npc, this.arr2obj(data.delete.npc));
1993 if (data.delete.other) Object.assign(data.other, this.arr2obj(data.delete.other));
1994 }
1995 if (data.othermove) {
1996 Object.assign(data.other, this.arr2obj(data.othermove));
1997 console.log(data.othermove);
1998 };*/
1999 return data;
2000 };
2001
2002 this.enableManualMode = function() { //tryb w ktĂłrym ignoruje wszystkie dane z silnika gry; na potrzeby mojego dodatku klanowego
2003 manualMode = true;
2004 };
2005 this.disableManualMode = function() {
2006 manualMode = false;
2007 };
2008
2009 this.parseInput = function(data) {
2010 for (var i in data) {
2011 if (typeof this.eventHandlers[i] == "function") this.eventHandlers[i](data[i]);
2012 };
2013 if (data.townname) this.eventHandlers.gateways(data.gw2, data.townname);
2014 };
2015
2016 this.eventHandlers = {
2017 town: function(town) {
2018 self.loadMap(town);
2019 },
2020 npc: function(npc) {
2021 self.parseNpc(npc);
2022 },
2023 gateways: function(gws, townname) {
2024 self.parseGws(gws, townname);
2025 },
2026 other: function(others) {
2027 self.parseOther(others);
2028 },
2029 item: function(items) {
2030 self.parseItem(items);
2031 },
2032 rip: function(rip) {
2033 self.parseRip(rip);
2034 }
2035 };
2036
2037 this.resetQtrack = function() {
2038 qTrack.reset();
2039 var npc = settings.get("/trackedNpcs");
2040 for (var i=0; i<npc.length; i++) {
2041 qTrack.add({
2042 type: "NPC",
2043 name: npc[i]
2044 });
2045 };
2046 var item = settings.get("/trackedItems");
2047 for (i=0; i<item.length; i++) {
2048 qTrack.add({
2049 type: "ITEM",
2050 name: item[i]
2051 });
2052 };
2053 };
2054
2055 this.loadMap = function(town) {
2056 if (interface == "superold") town.file = town.img;
2057 this.resetQtrack();
2058 this.objectMgr.deleteAll();
2059 var mapsize = interface == "new" ? 700 : 440;
2060 mapsize = mapsize*settings.get("/mapsize");
2061 if (town.x > town.y) {
2062 var height = Math.floor(town.y/town.x * mapsize);
2063 var width = mapsize;
2064 } else {
2065 var width = Math.floor(town.x/town.y * mapsize);
2066 var height = mapsize;
2067 };
2068 objScale = width/(town.x*32);
2069 objSize = Math.round(objScale*32);
2070
2071 var left = 0;
2072 var top = 0;
2073 if (interface != "new") {
2074 top = -30;
2075 left = -144;
2076 };
2077
2078 Object.assign($wrapper.style, {
2079 //$map will stretch the $wrapper
2080 //width: width + "px",
2081 //height: (height+20) + "px",
2082 left: "calc(50% - "+(width/2 - left)+"px)",
2083 top: "calc(50% - "+(height/2 - top)+"px)"
2084 });
2085 Object.assign($map.style, {
2086 width: width + "px",
2087 height: height + "px",
2088 });
2089 if (width < 385) $info.style["display"] = "none";
2090 else $info.style["display"] = "inline-block";
2091 if (width < 210) $searchTxt.style["display"] = "none";
2092 else $searchTxt.style["display"] = "inline-block";
2093
2094 this.loadMapImg(town.file);
2095 if (interface != "superold") {
2096 this.addSpawnsToMap(herosDB, true, town.name, town.id);
2097 this.addSpawnsToMap(eliteDB, false, town.name, town.id);
2098 };
2099 this.updateVisibility(town.visibility, objScale);
2100 this.updateHero(true);
2101 };
2102
2103 this.updateVisibility = function(n, scale) {
2104 if (n) {
2105 let size = (n*2 + 1)*scale*32;
2106 Object.assign($visibility.style, {
2107 width: size + "px",
2108 height: size + "px",
2109 "margin-top": (size/-2) + "px",
2110 "margin-left": (size/-2) + "px",
2111 opacity: 1
2112 });
2113 } else {
2114 $visibility.style.opacity = 0;
2115 }
2116 }
2117
2118 this.loadMapImg = function(file) {
2119 $map.style["background-image"] = "";
2120 $map.style["background"] = "#444444";
2121 var miniMapImg = new Image();
2122 if (file.indexOf("http") == -1) {
2123 var mpath = interface == "old" ? g.mpath : "/obrazki/miasta/";
2124 miniMapImg.src = (interface == "superold" ? "http://oldmargonem.pl" : "") + mpath + file;
2125 } else {
2126 miniMapImg.src = file;
2127 };
2128 miniMapImg.onload = function() {
2129 $map.style["background"] = "";
2130 $map.style["background-image"] = "url("+miniMapImg.src+")";
2131 };
2132 };
2133
2134 this.parseNpc = function(npcs) {
2135 for (var id in npcs) {
2136 var npc = npcs[id];
2137 if (!npc.del) {
2138 this.addNewNpcToMap(npc, id);
2139 } else {
2140 this.objectMgr.updateObject({
2141 id: "NPC-"+id,
2142 del: 1
2143 });
2144 if (npcTrack[id]) {
2145 qTrack.remove({
2146 type: "NPC",
2147 nick: npcTrack[id].nick
2148 });
2149 delete npcTrack[id];
2150 };
2151 };
2152 };
2153 };
2154 this.addNewNpcToMap = function(npc, id) {
2155 var {type, flash} = this.getNpcType(npc, id);
2156 if (type == undefined) return;
2157 var {tip, ctip} = this.getNpcTip(npc, type, flash);
2158 var data = {
2159 id: "NPC-"+id,
2160 type: type,
2161 flash: flash,
2162 tip: tip,
2163 ctip: ctip,
2164 x: npc.x,
2165 y: npc.y,
2166 qm: npc.qm || (npc.actions && npc.actions & 128)
2167 };
2168 if (type != "npc" && type != "gw" && type != "item") {
2169 data.lvl = npc.lvl;
2170 };
2171 this.objectMgr.updateObject(data)
2172 };
2173 this.getNpcTip = function(npc, type, important) {
2174 var tip = "";
2175 var mask = false;
2176 for (var i=0; i<masks.length; i++) {
2177 if (masks[i].indexOf(npc.icon) > -1) mask = true;
2178 };
2179 if (!mask) tip += "<img src='"+this.npcIconHTML(npc.icon)+"'>";
2180 var ctip = "t_npc";
2181 if (type == "gw") {
2182 ctip = false;
2183 tip = this.makeTip({
2184 txt: npc.nick + "<br>",
2185 x: npc.x,
2186 y: npc.y
2187 })
2188 } else if (type == "item") {
2189 ctip = "t_item";
2190 tip = this.makeTip({
2191 x: npc.x,
2192 y: npc.y,
2193 txt: tip + "<br>" + npc.nick
2194 })
2195 } else {
2196 tip = this.normalNpcTip(npc, type, important, tip);
2197 };
2198 return {
2199 tip: tip,
2200 ctip: ctip
2201 }
2202 };
2203 this.npcIconHTML = function(icon) {
2204 if (icon.indexOf("://") > -1 || icon.indexOf("obrazki/") > -1) return icon; //zapomniaĹem o kompatybilnoĹci z jednÄ
rzeczÄ
ktĂłrÄ
robiÄ xd
2205 else if (interface == "superold") return "http://oldmargonem.pl/obrazki/npc/"+icon;
2206 else return (interface == "old" ? g.opath : "/obrazki/")+"npc/"+icon;
2207 };
2208 this.oldNpcTip = function(npc, type, eve) {
2209 var icon = npc.icon;
2210 npc.icon = "kappa";
2211 if (type == "elite2" && !eve) {
2212 npc.wt = 30;
2213 };
2214
2215 if (!g.tips.npc) newNpc();
2216 var tip = g.tips.npc(npc);
2217
2218 if (type == "elite2") {
2219 if (!eve) {
2220 npc.wt = 20;
2221 tip = tip.replace("elita III", "elita II");
2222 } else {
2223 tip = tip.replace("elita", "specjalna elita");
2224 };
2225 };
2226 npc.icon = icon;
2227 return typeof tip == "string" ? tip : "";
2228 };
2229 this.newNpcTip = function(npc, type, eve) {
2230 var nick = "<div><strong>"+npc.nick+"</strong></div>";
2231 switch (type) {
2232 case "titan":
2233 var type = "<i>tytan</i>";
2234 break;
2235 case "heros":
2236 var type = "<i>heros</i>";
2237 break;
2238 case "elite3":
2239 var type = "<i>elita III</i>";
2240 break;
2241 case "elite2":
2242 if (eve) {
2243 var type = "<i>specjalna elita</i>";
2244 } else {
2245 var type = "<i>elita II</i>";
2246 }
2247 break;
2248 case "elite":
2249 var type = "<i>elita</i>";
2250 break;
2251 default:
2252 var type = "";
2253 break;
2254 };
2255 var lvl = npc.lvl ? npc.lvl + " lvl" : "";
2256 var grp = npc.grp ? " grp" : "";
2257 var lvlgrp = "<span>"+lvl+grp+"</span>";
2258 return nick + type + lvlgrp;
2259 };
2260 this.oldMargoNpcTip = function(npc, type, eve) {
2261 var nick = "<b style='color:orange;'>"+npc.nick+"</b>";
2262 switch (type) {
2263 case "titan":
2264 var type = "<i>tytan</i><br>";
2265 break;
2266 case "heros":
2267 var type = "<i>heros</i><br>";
2268 break;
2269 case "elite3":
2270 var type = "<i>elita III</i><br>";
2271 break;
2272 case "elite2":
2273 if (eve) {
2274 var type = "<i>specjalna elita</i><br>";
2275 } else {
2276 var type = "<i>elita II</i><br>";
2277 }
2278 break;
2279 case "elite":
2280 var type = "<i>elita</i><br>";
2281 break;
2282 default:
2283 var type = "";
2284 break;
2285 };
2286 var lvl = npc.lvl ? "Lvl: "+npc.lvl : "";
2287 var grp = npc.grp ? " grp" : "";
2288 var lvlgrp = "<span>"+lvl+grp+"</span>";
2289 return nick + type + lvlgrp;
2290 };
2291 this.normalNpcTip = function(npc, type, important, before) {
2292 if (interface == "old") {
2293 var tip = this.oldNpcTip(npc, type, important).replace("<span ></span><br>", "").replace("<span ></span>", "");
2294 } else if (interface == "new") {
2295 var tip = this.newNpcTip(npc, type, important);
2296 } else {
2297 var tip = this.oldMargoNpcTip(npc, type, important);
2298 };
2299 if (npc.lvl > 0) tip += "<br>";
2300 return this.makeTip({
2301 txt: before+tip,
2302 x: npc.x,
2303 y: npc.y
2304 });
2305 };
2306 var npcTrack = {};
2307 this.addNpcToTrack = function(npc, id, heros) {
2308 npcTrack[id] = npc;
2309 qTrack.add({
2310 type: "NPC",
2311 name: npc.nick
2312 });
2313 if (interface != "superold") this.checkForUnknownResp(npc, heros);
2314 };
2315 this.checkForUnknownResp = function(npc, heros) {
2316 var map = interface == "new" ? Engine.map.d : window.map;
2317 var db = heros ? herosDB : eliteDB;
2318 if (db[npc.nick] && db[npc.nick].spawns) {
2319 var spawns = db[npc.nick].spawns;
2320 if (spawns[map.name] || spawns[map.id]) {
2321 var spawnsOnMap = spawns[map.name] ? spawns[map.name] : spawns[map.id];
2322 if (spawns[map.name]) this.unknownMapId(map.name, map.id, heros);
2323 if (!this.coordsExistInSpawns(spawnsOnMap, npc.x, npc.y)) this.unknownResp(npc, map, heros);
2324 };
2325 };
2326 };
2327 this.coordsExistInSpawns = function(spawns, x, y) {
2328 for (var i=0; i<spawns.length; i++) {
2329 if (spawns[i][0] == x && spawns[i][1] == y) return true;
2330 };
2331 return false;
2332 };
2333 this.unknownResp = function(npc, map, heros) {
2334 var log = interface == "new" ? API.priw.console.log : window.log;
2335 log("<hr>"+(heros ? "Heros" : "Elita")+" znajduje siÄ na respie, ktĂłry nie jest w bazie danych minimapy.",1);
2336 log("ProsiĹbym o zamieszczenie poniĹźszej informacji w <a style='color: gold' href='https://www.margonem.pl/?task=forum&show=posts&id=488564' target='_blank'>tym temacie</a><br><br>miniMap+ - Nieznany resp: "+npc.nick+", "+map.name+"(ID: "+map.id+")("+npc.x+","+npc.y+")<br><hr>");
2337 };
2338 this.unknownMapId = function(name, id, heros) {
2339 var log = interface == "new" ? API.priw.console.log : window.log;
2340 log("<hr>"+"Mapa, na ktĂłrej "+(heros ? "zrespiĹ siÄ heros" : "zrespiĹa siÄ elita")+", nie jest zapisana w bazie danych po ID.",1);
2341 log("ProsiĹbym o zamieszczenie poniĹźszej informacji w <a style='color: gold' href='https://www.margonem.pl/?task=forum&show=posts&id=488564' target='_blank'>tym temacie</a><br><br>miniMap+ - nieznane ID mapy - '"+name+"'="+id+"<br><hr>");
2342 };
2343 this.getNpcType = function(npc, id) {
2344 if (npc.type == 2 || npc.type == 3) {
2345 var flash = false;
2346 if (npc.wt > 99) {
2347 //tytan
2348 var type = "titan";
2349 } else if (npc.wt > 79) {
2350 //heros
2351 var type = "heros";
2352 this.addNpcToTrack(npc, id, true);
2353 flash = true;
2354 } else if (eliteDB[npc.nick]) {
2355 //specjalna elita
2356 var type = "elite2";
2357 this.addNpcToTrack(npc, id, false);
2358 flash = true;
2359 } else if (npc.wt > 29) {
2360 //e3
2361 var type = "elite3";
2362 } else if (npc.wt > 19) {
2363 //e2
2364 var type = "elite2";
2365 } else if (npc.wt > 9) {
2366 //e
2367 var type = "elite";
2368 } else {
2369 //nub
2370 var type = "mob";
2371 };
2372 } else if (npc.type == 0 || npc.type == 5) {
2373 if (gws.indexOf(npc.icon) == -1) {
2374 var type = "npc";
2375 } else {
2376 var type = "gw";
2377 };
2378 } else if (_l() == "en" && npc.type == 7) {
2379 var type = "item";
2380 };
2381 return {
2382 type: type,
2383 flash: flash
2384 };
2385 };
2386
2387 this.initHeroUpdating = function() {
2388 if (interface != "new") {
2389 var _run = hero.run;
2390 hero.run = function() {
2391 self.updateHero();
2392 var ret = _run.apply(this, arguments);
2393 if (interface == "superold" && self.cancelMouseMovement) {
2394 self.cancelMouseMovement = false;
2395 window.global.movebymouse = false;
2396 }
2397 return ret;
2398 };
2399 } else if (interface == "new") {
2400 var _draw = Engine.map.draw;
2401 Engine.map.draw = function() {
2402 self.updateHero();
2403 return _draw.apply(this, arguments);
2404 };
2405 };
2406 };
2407
2408 this.updateHero = function(ignore) {
2409 qTrack.update();
2410 if (interface == "new") var hero = Engine.hero.d;
2411 else var hero = window.hero;
2412 if (!ignore && oldPos.x == hero.x && oldPos.y == hero.y) return;
2413 this.objectMgr.updateObject({
2414 id: "HERO",
2415 x: hero.x,
2416 y: hero.y,
2417 tip: "Moja postaÄ",
2418 type: "hero",
2419 children: [$visibility]
2420 });
2421 oldPos.x = hero.x;
2422 oldPos.y = hero.y;
2423 };
2424
2425 this.parseGws = function(gws, townname) {
2426 for (var i=0; i<gws.length; i+=5) {
2427 var tip = townname[gws[i]];
2428 if (gws[i+3]) {
2429 if (gws[i+3] == 2) {
2430 tip += interface != "superold" ? "<br>("+_t("require_key", null , "gtw")+")" : "<br>(wymaga klucza)";
2431 };
2432 };
2433 if (gws[i+4]) {
2434 var min = (parseInt(gws[i+4]) & 65535);
2435 var max = ((parseInt(gws[i+4]) >> 16) & 65535);
2436 tip += "<br>" + _t("gateway_availavle", null , "gtw");
2437 tip += min ? _t("from_lvl %lvl%", {"%lvl%": min }, "gtw") : "";
2438 tip += max >= 1000 ? "" : _t("to_lvl %lvl%", { "%lvl%": max }, "gtw") + _t("lvl_lvl", null , "gtw");
2439 };
2440 this.objectMgr.updateObject({
2441 tip: this.makeTip({
2442 txt: tip + "<br>",
2443 x: gws[i+1],
2444 y: gws[i+2]
2445 }),
2446 type: "gw",
2447 x: gws[i+1],
2448 y: gws[i+2],
2449 id: "GW-"+gws[i]+"-"+i
2450 });
2451 };
2452 };
2453
2454 this.parseOther = function(others) {
2455 for (var id in others) {
2456 var other = others[id];
2457 if (!other.del) {
2458 if ((interface != "new" && !g.other[id]) || (interface == "new" && !Engine.others.getById(id))) {
2459 if (interface != "superold" || other.nick) this.addNewOtherToMap(other, id); //dumb fix
2460 } else {
2461 this.updateOther(other, id);
2462 };
2463 } else {
2464 this.objectMgr.updateObject({
2465 id: "OTHER-"+id,
2466 del: 1
2467 });
2468 };
2469 }
2470 };
2471 this.updateOther = function(other, id) {
2472 var evoNetwork = this.checkIfOtherFromEvoNetwork(id);
2473 var data = {};
2474 var canLoadImgFromCache = !other.icon;
2475 var previousData = interface == "new" ? Engine.others.getById(id).d : g.other[id];
2476 var other = Object.assign({}, previousData, other);
2477 if (isset(other.x)) data.x = other.x;
2478 if (isset(other.y)) data.y = other.y;
2479 var {tip, ctip} = this.getOtherTip(other, evoNetwork);
2480 if (canLoadImgFromCache && this.otherImgCache[id]) {
2481 var img = this.otherImgCache[id];
2482 tip = '<center><div style="background-image: url('+img.src+'); width: '+(img.width/4)+'px; height: '+(img.height/4)+'px"></div></center>' + tip;
2483 } else {
2484 this.loadOtherImg(other, id, tip);
2485 }
2486 data.tip = tip;
2487 data.ctip = ctip;
2488 data.id = "OTHER-"+id;
2489 this.objectMgr.updateObject(data);
2490 };
2491 this.otherImgCache = {};
2492 this.checkIfOtherFromEvoNetwork = function(id) {
2493 //rozpoznawanie postaci z innych ĹwiatĂłw dodawanych przez dodatek ccarederra
2494 return String(id).split("_")[1] == "wsync";
2495 };
2496 this.addNewOtherToMap = function(other, id) {
2497 var type;
2498 var evoNetwork = this.checkIfOtherFromEvoNetwork(id);
2499 if (evoNetwork && !settings.get("/showevonetwork")) return;
2500 switch (other.relation) {
2501 case "": //obcy
2502 type = "other";
2503 break;
2504 case "cl-fr": //sojusznik
2505 case "fr-fr": //fraction friend
2506 type = "ally";
2507 break;
2508 case "cl": //klanowicz
2509 type = "clan";
2510 break;
2511 case "fr": //znajomy
2512 type = "friend";
2513 break;
2514 case "en": //wrĂłg
2515 case "cl-en": //wrogi klan
2516 case "fr-en": //fraction enemy
2517 type = "enemy";
2518 break;
2519 default:
2520 type = "other";
2521 break;
2522 };
2523 if (evoNetwork) type = "evoNetwork";
2524 var {tip, ctip} = this.getOtherTip(other, evoNetwork);
2525 this.objectMgr.updateObject({
2526 tip: tip,
2527 ctip: ctip,
2528 type: "other",
2529 type2: type,
2530 x: other.x,
2531 y: other.y,
2532 id: "OTHER-"+id,
2533 evoNetwork: evoNetwork,
2534 click: function() {
2535 if (evoNetwork) return; //gdy ccarderr zrobi jakieĹ kanaĹy prywatne w swoim chacie to klikniÄcie gracza bÄdzie taki otwieraÄ
2536 if (interface != "old") {
2537 $chatInput.value = "@" + other.nick.replace(/ /g, "_") + " ";
2538 $chatInput.focus();
2539 if (interface == "superold") {
2540 //switch from eq to chat
2541 if (window.chat.style.display == "none") {
2542 var btt = document.querySelector("#eqbutton");
2543 btt.click();
2544 btt.style["background-position"] = "";
2545 };
2546 };
2547 } else if (interface == "old") {
2548 chatTo(other.nick);
2549 };
2550 }
2551 });
2552 this.loadOtherImg(other, id, tip);
2553 };
2554 this.loadOtherImg = function(other, id, tip) {
2555 var img = new Image();
2556 img.src = (interface == "superold" ? "http://oldmargonem.pl" : "") + "/obrazki/postacie/"+other.icon;
2557 img.onload = function() {
2558 self.otherImgCache[id] = img;
2559 tip = '<center><div style="background-image: url('+img.src+'); width: '+(img.width/4)+'px; height: '+(img.height/4)+'px"></div></center>' + tip;
2560 self.objectMgr.updateObject({
2561 tip: tip,
2562 id: "OTHER-"+id
2563 });
2564 };
2565 }
2566 this.getOtherTip = function(other, evoNetwork) {
2567 if (interface == "old") {
2568 var tip = this.oldOtherTip(other);
2569 } else if (interface == "new") {
2570 var tip = this.newOtherTip(other);
2571 } else {
2572 var tip = this.oldMargoOtherTip(other);
2573 };
2574 if (evoNetwork) {
2575 tip += "<i>PostaÄ z dodatku World Sync</i>";
2576 };
2577 return {
2578 tip: this.makeTip({
2579 txt: tip + (evoNetwork ? "" : "<br>"),
2580 x: other.x,
2581 y: other.y
2582 }),
2583 ctip: "t_other" + (other.relation != "" && interface != "new" ? " t_"+other.relation : "")
2584 };
2585 };
2586 this.oldOtherTip = function(other) {
2587 if (!g.tips.other) newOther({0:{}});newOther({0:{del:1}});
2588 var tip = g.tips.other(other);
2589 return tip.replace(/'/g, "'")
2590 };
2591 this.newOtherTip = function(other) {
2592 //pre-wrapper
2593 if (other.rights) {
2594 var rank;
2595 if (other.rights & 1) rank = 0;
2596 else if (other.rights & 16) rank = 1;
2597 else if (other.rights & 2) rank = 2;
2598 else if (other.rights & 4) rank = 4;
2599 else rank = 3;
2600 rank = "<div class='rank'>"+otherRanks[rank]+"</div>";
2601 } else {
2602 var rank = "";
2603 };
2604 var guest = isset(other.guest) ? "<div class='rank'>ZastÄpca</div>" : "";
2605 var preWrapper = rank + guest;
2606 //wrapper
2607 var nick = "<div class='nick'>" + other.nick + "</div>";
2608 var prof = "<div class='profs-icon "+other.prof+"'></div>";
2609 var bless = isset(other.ble) ? "<div class='bless'></div>" : "";
2610 var infoWrapper = "<div class='info-wrapper'>" + nick + bless + prof + "</div>";
2611 //post-wrapper
2612 var wanted = isset(other.wanted) ? "<div class='wanted'></div>" : "";
2613 var clan = (isset(other.clan) && other.clan.name != "") ? "<div class='clan-in-tip'>"+other.clan.name+"</div><div class='line'></div>" : "";
2614 var lvl = isset(other.lvl) ? "<div class='lvl'>"+other.lvl+" lvl</div>" : "";
2615 var mute = (other.attr & 1) ? "<div class='mute'></div>" : "";
2616 var postWrapper = wanted + clan + lvl + mute;
2617
2618 return preWrapper + infoWrapper + postWrapper;
2619 };
2620 this.oldMargoOtherTip = function(other) {
2621 var tip = "<b style='color:yellow'>"+other.nick+"</b>";
2622 if (other.clan) tip += "<span style='color:#fd9;'>["+g.clanname[other.clan]+"]</span><br>";
2623 tip += "Lvl: "+other.lvl+other.prof;
2624 return tip;
2625
2626 };
2627
2628 this.parseItem = function(items) {
2629 for (var id in items) {
2630 var item = items[id];
2631 if (item.loc == "m") {
2632 this.addNewItemToMap(item, id);
2633 } else {
2634 var previousData = interface == "new" ? Engine.items.getItemById(id) : g.item[id];
2635 if (interface == "new" && previousData) previousData = previousData.d;
2636 if (previousData && previousData.loc == "m") {
2637 this.objectMgr.updateObject({
2638 id: "ITEM-"+id,
2639 del: 1
2640 });
2641 };
2642 }
2643 }
2644 };
2645 this.addNewItemToMap = function(item, id) {
2646 var tip = this.getItemTip(item);
2647 this.objectMgr.updateObject({
2648 id: "ITEM-"+id,
2649 tip: tip,
2650 ctip: "t_item",
2651 x: item.x,
2652 y: item.y,
2653 type: "item"
2654 });
2655 };
2656 this.oldMargoItemTip = function(item) {
2657 return "<b>"+item.name+"</b>"+item.stats;
2658 };
2659 this.getItemTip = function(item) {
2660 var nocenter = true;
2661 var tip = interface == "new" ? MargoTipsParser.getTip(item) : (interface == "old" ? itemTip(item) : this.oldMargoItemTip(item));
2662 if (interface == "old" && tip.indexOf("tip-section") == -1) { //kompatybilnoĹÄ z moim dodatkiem na nowe tipy
2663 tip = "<img src='"+(interface == "superold" ? "http://oldmargonem.pl" : "") +"/obrazki/itemy/"+item.icon+"'>" + tip;
2664 nocenter = false;
2665 };
2666 return this.makeTip({
2667 txt: tip,
2668 x: item.x,
2669 y: item.y,
2670 nocenter: nocenter
2671 });
2672 };
2673 var ripCount = 0;
2674 this.parseRip = function(rips) {
2675 for (var i=0; i<rips.length; i+=8) {
2676 this.addNewRipToMap({
2677 nick: rips[i],
2678 lvl: rips[i+1],
2679 prof: rips[i+2],
2680 x: parseInt(rips[i+3]),
2681 y: parseInt(rips[i+4]),
2682 ts: parseInt(rips[i+5]),
2683 desc1: rips[i+6],
2684 desc2: rips[i+7]
2685 });
2686 ripCount++;
2687 };
2688 };
2689 this.addNewRipToMap = function(rip) {
2690 var isHerosRip = false;
2691 var timeToDisappear = 300 + rip.ts - unix_time();
2692 if (timeToDisappear <= 0) return;
2693 var tip = "<b>" + _t("rip_prefix") + " " + htmlspecialchars(rip.nick) + "</b>Lvl: " + rip.lvl + rip.prof + "<i>" + htmlspecialchars(rip.desc1) + "</i><i>" + htmlspecialchars(rip.desc2) + "</i>";
2694 this.objectMgr.updateObject({
2695 tip: this.makeTip({
2696 txt: tip,
2697 x: rip.x,
2698 y: rip.y
2699 }),
2700 type: "other",
2701 x: rip.x,
2702 y: rip.y,
2703 circle: true,
2704 border: true,
2705 id: "RIP-"+ripCount,
2706 ctip: "t_rip"
2707 });
2708 var id = "RIP-"+ripCount;
2709 var nick;
2710 if (nick = this.checkHerosRip(rip.desc1)) {
2711 qTrack.add({type: "COORDS", name: "GrĂłb gracza zabitego przez herosa "+nick+"<br>MoĹźliwe, Ĺźe heros tam stoi!", coords: [rip.x, rip.y] });
2712 isHerosRip = true;
2713 message("Na mapie znajduje siÄ grĂłb gracza zabitego przez herosa "+nick);
2714 };
2715 setTimeout(() => {
2716 self.objectMgr.updateObject({
2717 id: id,
2718 del: 1
2719 });
2720 if (isHerosRip) qTrack.remove({type: "COORDS", name: "GrĂłb gracza zabitego przez herosa "+nick+"<br>MoĹźliwe, Ĺźe heros tam stoi!"});
2721 }, timeToDisappear*1000);
2722 };
2723 this.checkHerosRip = function(desc) {
2724 for (var nick in herosDB) {
2725 var needle = nick + "(" + herosDB[nick].lvl + herosDB[nick].prof + ")";
2726 if (desc.indexOf(needle) > -1) {
2727 return nick;
2728 };
2729 };
2730 return false;
2731 };
2732
2733 this.objectMgr = new (function() {
2734 var self = this;
2735 var mgr = this;
2736 var objs = {};
2737 var flashables = [];
2738 function MapObject(data) {
2739 var self = this;
2740 this.d = data;
2741 var currentColor = settings.get("/colors")[this.d.type];
2742
2743 this.initHTML = function() {
2744 this.$ = document.createElement("div");
2745 this.$.classList.add("mmpMapObject", "mmp-"+data.type);
2746 if (innerDotKeys.indexOf(data.type2) != -1) {
2747 var $dot = document.createElement("div");
2748 $dot.classList.add("innerDot", "mmp-"+data.type2);
2749 Object.assign($dot.style, {
2750 left: objSize/4 + "px",
2751 top: objSize/4 + "px",
2752 width: objSize/2 + "px",
2753 height: objSize/2 + "px"
2754 });
2755 this.$.appendChild($dot);
2756 } else if (data.type2 == "evoNetwork") {
2757 this.$.classList.add("evoNetwork");
2758 };
2759 if (data.children) {
2760 // append extra children to the object
2761 for (let i=0; i<data.children.length; i++) {
2762 this.$.appendChild(data.children[i]);
2763 }
2764 }
2765 var left = data.x * objScale * 32;
2766 var top = data.y * objScale * 32;
2767 Object.assign(this.$.style, {
2768 top: top + "px",
2769 left: left + "px",
2770 width: objSize + "px",
2771 height: objSize + "px",
2772 opacity: "0"
2773 });
2774 setTimeout(() => this.$.style.opacity = "1.0", 1);
2775 if (interface != "new") {
2776 this.$.setAttribute("tip", data.tip);
2777 if (data.ctip) this.$.setAttribute("ctip", data.ctip);
2778 } else {
2779 this.$.setAttribute("data-tip", data.tip);
2780 if (data.ctip) this.$.setAttribute("data-tip-type", data.ctip);
2781 };
2782 if (data.circle) {
2783 this.$.style["border-radius"] = objScale*18 + "px";
2784 };
2785 if (data.border) {
2786 this.$.style["border"] = "1px solid black";
2787 };
2788 if (data.qm) {
2789 this.$.innerHTML = "<img class='mmpQM' width='"+objSize+"' height='"+objSize*2+"' src='http://jaruna.margonem.pl/img/quest-mark.gif'>";
2790 };
2791 $map.appendChild(this.$);
2792 };
2793
2794 this.invertColor = function() {
2795 var c = currentColor;
2796 var c1 = (255 - parseInt("0x"+c.substring(1,3))).toString(16);
2797 var c2 = (255 - parseInt("0x"+c.substring(3,5))).toString(16);
2798 var c3 = (255 - parseInt("0x"+c.substring(5,7))).toString(16);
2799 if (c1.length < 2) c1 = "0" + c1;
2800 if (c2.length < 2) c2 = "0" + c2;
2801 if (c3.length < 2) c3 = "0" + c3;
2802 currentColor = "#"+c1+c2+c3;
2803 this.$.style.background = currentColor;
2804 };
2805
2806 this.remove = function() {
2807 if (this.d.flash) flashables.splice(flashables.indexOf(this), 1);
2808 this.$.style["opacity"] = "0";
2809 if (settings.get("/interpolerate")) setTimeout(() => this.$.remove(), 500);
2810 else this.$.remove();
2811 };
2812
2813 this.update = function(data) {
2814 Object.assign(this.d, data);
2815 if (data.x) {
2816 this.$.style["left"] = data.x * objScale * 32 + "px";
2817 };
2818 if (data.y) {
2819 this.$.style["top"] = data.y * objScale * 32 + "px";
2820 };
2821 if (data.tip) {
2822 this.$.setAttribute(interface == "new" ? "data-tip" : "tip", data.tip);
2823 };
2824 if (data.invertColor) {
2825 this.invertColor();
2826 };
2827 };
2828
2829 this.initEventListener = function() {
2830 if (data.click) {
2831 var type = mobileDevice ? "touchstart" : "click";
2832 this.$.addEventListener(type, e => {
2833 data.click(e);
2834 e.stopPropagation();
2835 });
2836 };// else {
2837 //this.$.addEventListener("click", this.goTo);
2838 //}
2839 };
2840
2841 //this.goTo = function() {
2842 // if (newInterface) {
2843 // Engine.hero.autoGoTo({x :self.d.x, y: self.d.y});
2844 // } else {
2845 // self.searchPath.call(window.hero, self.d.x, self.d.y);
2846 // };
2847 //};
2848
2849 this.manageDisplay = function() {
2850 if (!this.d.flash && isset(this.d.lvl) && this.d.lvl < settings.get("/minlvl")) {
2851 this.$.classList.add("hidden");
2852 } else {
2853 this.$.classList.remove("hidden");
2854 };
2855 };
2856
2857 this.checkStringSearch = function(str) {
2858 if (this.d.tip.toLowerCase().indexOf(str) == -1 && this.d.type != "hero") {
2859 this.$.classList.add("hiddenBySearch");
2860 };
2861 };
2862
2863 this.checkRangeSearch = function(n1, n2) {
2864 if (isset(this.d.lvl)) {
2865 if (this.d.lvl < n1 || this.d.lvl > n2) {
2866 this.$.classList.add("hiddenBySearch");
2867 };
2868 };
2869 };
2870
2871 this.manageFilters = function() {
2872 if (search.type == "string" && search.data != "") {
2873 this.checkStringSearch(search.data);
2874 } else if (search.type == "lvl") {
2875 this.checkRangeSearch(search.data[0], search.data[1]);
2876 };
2877 };
2878
2879 this.init = function() {
2880 if (data.flash) flashables.push(this);
2881 this.initHTML();
2882 this.initEventListener();
2883 this.manageDisplay();
2884 this.manageFilters();
2885 };
2886 this.init();
2887 };
2888 this.getByElem = function($el) {
2889 for (var i in objs) {
2890 if (objs[i].$ == $el) return objs[i];
2891 };
2892 };
2893 this.deleteAll = function() {
2894 for (var i in objs) {
2895 objs[i].remove();
2896 delete objs[i];
2897 };
2898 };
2899 this.updateObject = function(data) {
2900 if (!objs[data.id] && !data.del) {
2901 if (!data.dontCreate) objs[data.id] = new MapObject(data);
2902 } else if (data.del) {
2903 if (objs[data.id]) {
2904 objs[data.id].remove();
2905 delete objs[data.id];
2906 };
2907 } else {
2908 objs[data.id].update(data);
2909 }
2910 };
2911 this.resetSearch = function() {
2912 this.removeCoordMarker();
2913 for (var id in objs) {
2914 objs[id].$.classList.remove("hiddenBySearch");
2915 };
2916 };
2917 this.filterByLvl = function(n1, n2) {
2918 search.type = "lvl",
2919 search.data = [n1, n2];
2920 for (var id in objs) {
2921 objs[id].checkRangeSearch(n1, n2);
2922 };
2923 };
2924 this.filterByString = function(str) {
2925 str = str.toLowerCase();
2926 search.type = "string",
2927 search.data = str;
2928 for (var id in objs) {
2929 objs[id].checkStringSearch(str);
2930 };
2931 };
2932 this.removeCoordMarker = function() {
2933 this.updateObject({
2934 id: "COORDS",
2935 del: 1
2936 });
2937 };
2938 this.createCoordMarker = function(x, y) {
2939 this.updateObject({
2940 id: "COORDS",
2941 x: x,
2942 y: y,
2943 tip: "koordy "+x+","+y,
2944 circle: true,
2945 type: "hero",
2946 flash: true
2947 })
2948 };
2949 this.manageDisplay = function() {
2950 for (var id in objs) {
2951 objs[id].manageDisplay();
2952 };
2953 };
2954 this.invertFlashables = function() {
2955 for (var i=0; i<flashables.length; i++) {
2956 flashables[i].update({
2957 invertColor: true
2958 });
2959 };
2960 };
2961 setInterval(this.invertFlashables, 500);
2962 })();
2963
2964 this.addSpawnsToMap = function(db, heros, map, mapId) {
2965 map = map.toLowerCase();
2966 var maxlvl = settings.get("/maxlvl");
2967 var hero = interface == "new" ? Engine.hero.d : window.hero;
2968 for (var i in db) {
2969 var mob = db[i];
2970 if (mob.ver && mob.ver != _l()) continue;
2971 var minlvl = Math.max(mob.lvl/2, mob.lvl-50);
2972 if ((maxlvl+mob.lvl >= hero.lvl && minlvl <= hero.lvl) || mob.lvl >= 242 || mob.lvl == -1) {
2973 for (var loc in mob.spawns) {
2974 if (loc.toLowerCase() == map || loc == mapId) {
2975 var spawns = mob.spawns[loc];
2976 for (var j=0; j<spawns.length; j++) {
2977 var x = spawns[j][0];
2978 var y = spawns[j][1];
2979 this.objectMgr.updateObject({
2980 id: "SPAWN-"+i+"-"+j,
2981 tip: this.makeTip({
2982 txt: "Resp " + (heros ? "herosa " : "elity ") + i,
2983 x: x,
2984 y: y
2985 }),
2986 x: x,
2987 y: y,
2988 type: heros ? "heros" : "elite2",
2989 circle: true
2990 });
2991 };
2992 };
2993 };
2994 };
2995 };
2996 };
2997
2998 this.init = function() {
2999 this.initSettings();
3000 this.initHTML();
3001 this.appendUserStyles();
3002 this.initResponseParser();
3003 this.initHeroUpdating();
3004 this.appendMobileButton();
3005 this.installationCounter.count();
3006 if (interface == "old") this.searchPath = function(a,t){if(this.isBlockedSearchPath())return this.blockedInfoSearchPath();for(var h=[],i=128&hero.opt?8:20,r=Math.max(0,Math.min(a,this.x)-i),s=Math.min(map.x-1,Math.max(a,this.x)+i),o=Math.max(0,Math.min(t,this.y)-i),e=Math.min(map.y-1,Math.max(t,this.y)+i),d=r-1;s+1>=d;d++){h[d]=[];for(var x=o-1;e+1>=x;x++)h[d][x]=!(d>=r&&s>=d&&x>=o&&e>=x)||isset(g.npccol[d+256*x])||map.col&&"0"!=map.col.charAt(d+x*map.x)?-2:-1}h[this.x][this.y]=0,b=-1,road=[];for(var c={x:-1,y:-1,dist:99},y=1;s-r+e-o+3>y;y++)for(var d=r;s>=d;d++)for(var x=o;e>=x;x++){if(-1!=h[d][x]||h[d][x-1]!=y-1&&h[d][x+1]!=y-1&&h[d-1][x]!=y-1&&h[d+1][x]!=y-1||(h[d][x]=y),h[a][t]>0){d=s+1;break}c.dist2=Math.abs(a-d)+Math.abs(t-x),h[d][x]==y&&c.dist2<c.dist&&(c.x=d,c.y=x,c.dist=c.dist2)}if(c.hdist=Math.abs(a-hero.x)+Math.abs(t-hero.y),h[a][t]>0||c.dist<c.hdist){h[a][t]<0&&(a>c.x?b=2:a<c.x?b=1:t>c.y?b=0:t<c.y&&(b=3),a=c.x,t=c.y),road[0]={x:a,y:t};for(var f=h[a][t]-1,l=a,m=t;f>0;f--)h[l][m-1]==f?m--:h[l][m+1]==f?m++:h[l-1][m]==f?l--:h[l+1][m]==f?l++:f=0,f&&(road[h[a][t]-f]={x:l,y:m})}road.length>1&&null==g.playerCatcher.follow&&$("#target").stop().css({left:32*a,top:32*t,display:"block",opacity:1}).fadeOut(1e3)};
3007 $chatInput = interface == "new" ? document.querySelector("[data-section='chat'] .input-wrapper input") : (interface == "superold" ? document.querySelector("#chatIn") : null);
3008 };
3009
3010 //questtrack (fuzja kodu z wersji minimapy na SI i NI wiÄc wyglÄ
da jak wyglÄ
da)
3011 var qTrack = new (function() {
3012 var self = this;
3013 var hero = interface == "new" ? Engine.hero : window.hero;
3014 var $hero = interface == "old" ? $("#hero") : (interface == "superold" ? document.querySelector("#oHero") : null);
3015 var $canvas = interface == "new" ? $("#GAME_CANVAS") : null;
3016 if (interface == "new") {
3017 this.npcs = {};
3018 API.addCallbackToEvent("newNpc", function(npc) {
3019 if (npc) self.npcs[npc.d.id] = npc.d;
3020 });
3021 API.addCallbackToEvent("removeNpc", function(npc) {
3022 if (npc) delete self.npcs[npc.d.id];
3023 });
3024 };
3025 this.getOldMargoHeroPos = function() {
3026 return {
3027 left: $hero.offsetLeft,
3028 top: $hero.offsetTop
3029 };
3030 };
3031 this.getHeroPos = function() {
3032 if (interface == "old") return $hero.position();
3033 if (interface == "superold") return this.getOldMargoHeroPos();
3034 if (!Engine.map.size) return {x: 0, y: 0};
3035 var tilesX = $canvas.width()/32;
3036 var tilesY = $canvas.height()/32;
3037 var pos = {
3038 x: Engine.hero.rx,
3039 y: Engine.hero.ry
3040 };
3041 var actualPos = {};
3042 if (pos.x < tilesX/2) {
3043 actualPos.x = pos.x*32;
3044 } else if (Engine.map.size.x - pos.x < tilesX/2) {
3045 actualPos.x = (pos.x - (Engine.map.size.x - tilesX/2) + tilesX/2)*32;
3046 } else {
3047 actualPos.x = (tilesX/2)*32;
3048 };
3049 if (pos.y < tilesY/2) {
3050 actualPos.y = pos.y*32;
3051 } else if (Engine.map.size.y - pos.y < tilesY/2) {
3052 actualPos.y = (pos.y - (Engine.map.size.y - tilesY/2) + tilesY/2)*32;
3053 } else {
3054 actualPos.y = (tilesY/2)*32;
3055 };
3056 var canvasOffset = $canvas.offset();
3057 return {
3058 left: actualPos.x + canvasOffset.left,
3059 top: actualPos.y + canvasOffset.top
3060 };
3061 };
3062 this.update = function() {
3063 for (var i=0; i<this.arrows.length; i++) {
3064 this.drawArrow(this.arrows[i]);
3065 };
3066 };
3067 this.drawArrow = function(objective) {
3068 if (objective.type == "NPC") {
3069 var nameKey = "nick";
3070 var obj = interface == "new" ? this.npcs : g.npc;
3071 var item = false;
3072 } else if (objective.type == "ITEM") { //item
3073 var nameKey = "name";
3074 if (interface == "new") {
3075 var itemArr = Engine.items.fetchLocationItems("m");
3076 var obj = {};
3077 for (var i in itemArr) {
3078 var it = itemArr[i];
3079 if (it.id) obj[it.id] = it;
3080 else obj[it.hid] = it;
3081 };
3082 } else {
3083 var obj = g.item;
3084 };
3085 var item = true;
3086 } else if (objective.type == "COORDS") { //coords
3087 var coords = objective.coords;
3088 var size = [32, 32];
3089 var x = Math.abs(hero.rx-coords[0]);
3090 var y = Math.abs(hero.ry-coords[1]);
3091 var closest = Math.sqrt(Math.pow(x,2) + Math.pow(y,2));
3092 };
3093 if (objective.type != "COORDS") {
3094 var closest = Infinity;
3095 var coords = false;
3096 var size = false;
3097 for (var i in obj) {
3098 var entity = obj[i];
3099 if (entity[nameKey] == objective.name && (!item || entity.loc == "m")) {
3100 var x = Math.abs(hero.rx-entity.x);
3101 var y = Math.abs(hero.ry-entity.y);
3102 var dist = Math.sqrt(Math.pow(x,2) + Math.pow(y,2));
3103 if (dist < closest) {
3104 closest = dist;
3105 coords = [entity.x, entity.y];
3106 size = item ? [32,32] : [entity.fw, entity.fh];
3107 };
3108 };
3109 };
3110 };
3111 if (coords) {
3112 var cos = (coords[0] - hero.rx)/closest;
3113 var sin = (coords[1] - hero.ry)/closest;
3114 var heropos = this.getHeroPos();
3115 var top = 150*sin;
3116 var left = 150*cos;
3117 var opacity = 1;
3118 if (closest < 9) {
3119 top = top*Math.pow(closest/9, 1.8);
3120 left = left*Math.pow(closest/9, 1.8);
3121 opacity = Math.pow(closest/9, 2.1);
3122 };
3123 if (interface != "new") top+=20;
3124 left+= interface == "new" ? -12 : 4;
3125 if ((cos >= 0 && sin >= 0) || (cos >= 0 && sin <= 0)) {
3126 var angle = Math.asin(sin) * 180 / Math.PI;
3127 } else {
3128 var angle = 180+Math.asin(0-sin) * 180 / Math.PI;
3129 };
3130 objective.$.css({
3131 top: top + heropos.top,
3132 left: left + heropos.left,
3133 display: opacity > 0.09 ? "block" : "none",
3134 "-ms-transform": "rotate("+angle+"deg)",
3135 "-webkit-transform": "rotate("+angle+"deg)",
3136 transform: "rotate("+angle+"deg)",
3137 opacity: opacity
3138 });
3139 if (interface == "old") {
3140 objective.$highlight.css({
3141 left: coords[0]*32 - 11,
3142 top: coords[1]*32 + 14,
3143 display: "block",
3144 opacity: 1-opacity
3145 });
3146 };
3147 } else {
3148 objective.$.hide();
3149 if (interface == "old") objective.$highlight.hide();
3150 };
3151 };
3152 this.arrows = [];
3153 this.add = function(objective) {
3154 for (var i in this.arrows) {
3155 if (objective.type == this.arrows[i].type && objective.name == this.arrows[i].name) return;
3156 };
3157 objective.$ = this.arrowTemplate.clone().appendTo(interface == "old" ? "#centerbox" : (interface == "new" ? ".game-window-positioner" : "#oMap"));
3158 objective.$.attr(interface == "new" ? "data-tip" : "tip", objective.name);
3159 if (interface == "old") objective.$highlight = this.highlightTemplate.clone().appendTo(interface == "old" ? "#ground" : "#oMap");
3160 objective.index = this.arrows.push(objective) -1;
3161 objective.remove = function() {
3162 self.arrows.splice(this.index, 1);
3163 for (var i=this.index; i<self.arrows.length; i++) {
3164 self.arrows[i].index--;
3165 };
3166 this.$.remove();
3167 if (interface == "old") this.$highlight.remove();
3168 };
3169 this.update();
3170 };
3171 this.remove = function(objective) {
3172 for (var i=0; i<this.arrows.length; i++) {
3173 if (this.arrows[i].name == objective.name && this.arrows[i].type == objective.type) this.arrows[i].remove();
3174 };
3175 };
3176 this.reset = function() {
3177 while (this.arrows.length) {
3178 this.arrows[0].remove();
3179 };
3180 };
3181 this.arrowTemplate = $("<div>").css({
3182 background: "url(http://priweejt.ct8.pl/addons/img/qt-arrow-red.gif)",
3183 width: 24,
3184 height: 24,
3185 zIndex: 250,
3186 position: "absolute"
3187 });
3188 this.highlightTemplate = $("<div>").css({
3189 background: "url(/img/glow-blue.png)",
3190 position: "absolute",
3191 width: 52,
3192 height: 24,
3193 zIndex: 1
3194 });
3195 })();
3196
3197 this.installationCounter = new (function() {
3198 var self = this;
3199 var id = 87771;
3200
3201 this.count = function() {
3202 if (interface == "superold") return;
3203 if (!settings.get("/counted")) {
3204 //extManager.toggleLike(id, 'unlike')
3205 $.ajax({
3206 url: "/tools/addons.php?task=details&id="+id,
3207 type: "POST",
3208 data: {like: "unlike"}
3209 });
3210 settings.set("/counted", true);
3211 };
3212 };
3213 this.get = function(clb) {
3214 if (interface == "superold") return clb("<span tip='NiedostÄpne dla oldmargonem'>-</span>");
3215 $.ajax({
3216 url: "/tools/addons.php?task=details&id="+id,
3217 datatype: "json",
3218 success: function(r) {
3219 clb(-r.addon.points);
3220 }
3221 });
3222 };
3223 })();
3224
3225 //databases
3226 //porzuciĹem rÄczne edytowanie tego wiÄc w jednej linii jest bo tak wypluwa skrypt
3227 var herosDB = {"Domina Ecclesiae":{"lvl":21,"prof":"b","spawns":{"3":[[53,11],[50,23]],"169":[[14,8],[8,9]],"171":[[25,26],[7,28],[15,29],[8,8],[22,9]],"175":[[12,4]],"217":[[7,35],[22,13],[37,39]],"249":[[12,5]],"251":[[11,10],[10,13]],"290":[[11,8],[16,5]],"298":[[7,10]],"300":[[7,8]],"2070":[[6,4],[10,29],[7,17]],"2071":[[42,5],[17,4],[37,9]],"2073":[[21,9]],"2546":[[44,43],[33,10],[41,14],[50,5],[25,28],[9,11]],"2710":[[6,11],[24,6],[8,15]],"2712":[[5,7],[9,7],[7,12]],"2713":[[10,6],[8,12]],"2714":[[8,5],[27,10],[7,8],[16,8]],"2715":[[24,17],[6,13],[5,18],[32,18]],"2718":[[23,8],[15,8]],"2719":[[7,35],[4,10]],"2721":[[4,5],[29,15],[20,15],[15,9]],"2722":[[8,22],[8,7]],"2879":[[12,7],[7,20],[11,13]],"2880":[[10,19]],"2885":[[38,57],[11,22],[23,56],[48,36]],"2886":[[41,57],[13,46],[12,12],[29,60],[24,12]],"PrzeklÄty Zamek p.1":[[12,4]],"StraĹźnica pĂłĹnocno-wschodnia":[[8,3]],"StraĹźnica pĂłĹnocno-zachodnia":[[8,3]],"Mury - zbrojownia - piwnica":[[12,11]],"Mury - skrzydĹo wschodnie":[[12,13]],"Mury - kwatera gĹĂłwna":[[10,11]],"Opuszczony dom":[[5,8]],"Posterunek":[[9,10]],"Posterunek - piwnica":[[11,4]],"Podziemia siedziby maga p.1 - sala 1":[[22,28],[13,9]],"Podziemia siedziby maga p.1 - sala 2":[[10,9]],"Fortyfikacja p.1":[[13,6],[7,16]],"Fortyfikacja p.5":[[9,9]],"PrzeklÄta StraĹźnica p.1":[[9,10]]}},"Mroczny Patryk":{"lvl":35,"prof":"w","spawns":{"3":[[31,58],[19,71],[11,47],[58,46],[19,21],[2,49],[14,7],[19,52],[54,71],[33,62],[57,75],[7,17],[48,79],[52,27],[28,3],[56,4],[10,84]],"4":[[45,51],[52,39],[54,66],[17,15],[35,14],[3,87],[38,59],[55,78],[25,44],[3,68],[42,18],[45,84],[59,92],[21,25],[5,27],[2,21],[6,4]],"8":[[5,40],[15,24],[58,18],[40,36],[24,54],[52,29],[26,6],[15,44],[7,10],[38,26],[54,45],[51,55],[51,5],[48,16],[42,22],[26,29],[4,56],[37,54]],"11":[[37,11],[61,22],[14,4],[52,50],[45,28],[5,75],[55,19],[56,94],[10,47],[9,30],[21,15],[37,71],[39,51],[48,83],[25,6],[55,32],[54,65],[11,17],[57,93]],"12":[[53,47],[76,17],[5,9],[21,41],[65,15],[10,31],[74,17]],"19":[[9,10]],"110":[[20,41],[52,23],[22,24],[60,23],[41,40],[36,11],[55,3],[52,77],[30,8],[39,61],[17,89],[9,8],[29,42],[46,83],[31,21],[54,51],[0,23],[27,65],[48,2],[5,85],[31,50],[19,78],[55,12],[3,4],[4,77],[31,21],[53,77],[25,39],[18,2]],"111":[[49,20],[60,3],[11,19],[9,47],[18,58],[22,28],[42,55],[30,2]],"115":[[41,43],[52,29],[21,10],[8,19],[57,48],[34,36],[38,43],[7,55],[49,43]],"634":[[26,7]],"1110":[[52,59],[32,9],[18,24],[11,13],[35,22]],"3402":[[37,24],[47,52],[5,27],[53,11]]}},"Karmazynowy MĹciciel":{"lvl":45,"prof":"m","spawns":{"121":[[47,26],[3,2],[2,54],[41,12],[48,75],[12,39],[5,65]],"128":[[3,87],[4,55],[33,18],[42,88],[52,55],[12,18],[51,19]],"132":[[11,17]],"133":[[13,18]],"134":[[8,13]],"135":[[10,11],[12,8]],"136":[[14,8]],"151":[[12,6],[26,5],[58,37],[46,60],[22,54],[37,57],[55,5],[39,13],[47,7],[19,34],[16,4],[45,52]],"182":[[8,5]],"183":[[14,9]],"198":[[53,56],[60,5],[10,44],[10,7],[57,22],[43,4],[37,2],[24,7],[14,19],[28,62],[9,6],[58,38],[9,33],[34,37],[9,45]],"226":[[13,37],[15,71],[20,90]],"227":[[10,35],[14,35]],"228":[[51,21],[50,24]],"229":[[36,82],[45,6],[8,70],[20,14]]}},"ZĹodziej":{"lvl":50,"prof":"h","spawns":{"1180":[[12,8],[11,8]],"1188":[[6,6]],"1247":[[9,9]],"1278":[[8,6]],"1280":[[8,6]],"1320":[[8,8]],"1335":[[10,8]],"1382":[[7,8]],"1407":[[8,7],[9,7]],"1423":[[8,7]],"1433":[[7,8]],"1438":[[12,6]],"1489":[[7,8]],"1493":[[7,8]],"1500":[[10,8]],"1542":[[28,6]],"1566":[[4,11]],"1567":[[7,6]],"1568":[[4,8]],"1589":[[6,8]],"1590":[[4,7],[4,6]],"1605":[[4,10]],"Chata Ficjusza":[[3,8]]}},"ZĹodziej znajduje siÄ w tym domu (parter)":{"lvl":50,"spawns":{"589":[[39,14],[40,14],[62,14],[63,14],[74,38],[52,54],[53,54]],"630":[[69,40],[44,41]],"1233":[[68,29],[75,16]],"1262":[[52,9],[53,9]]}},"ZĹodziej znajduje siÄ w tym domu (2. piÄtro)":{"lvl":50,"spawns":{"589":[[31,33],[83,36],[84,36]]}},"ZĹodziej znajduje siÄ w tej latarnii (2. piÄtro) (uwaga na kraby przy dochodzeniu tutaj)":{"lvl":50,"spawns":{"1262":[[20,54]]}},"ZĹodziej znajduje siÄ w tym domu (1. piÄtro)":{"lvl":50,"spawns":{"589":[[17,33],[33,17]],"630":[[40,27],[41,27]],"1262":[[61,17],[62,17]]}},"ZĹodziej znajduje siÄ w tym domu (piwnica)":{"lvl":50,"spawns":{"589":[[57,14],[43,54]],"630":[[78,17],[77,17],[81,28],[82,28],[88,23]],"1233":[[57,39]]}},"ZĹodziej znajduje siÄ w tym domu (pokĂłj Grety)":{"lvl":50,"spawns":{"589":[[59,29],[60,29]]}},"ZĹy Przewodnik":{"lvl":63,"prof":"w","spawns":{"116":[[5,26],[40,35],[35,3],[52,30],[10,44],[54,43],[18,8],[28,57],[37,8],[7,17],[35,3],[53,31],[39,34],[34,2],[27,56]],"122":[[35,20],[19,6],[54,18],[32,7],[54,25]],"140":[[26,54],[44,29],[56,27],[10,49],[49,2]],"150":[[57,3],[18,4],[3,34],[40,38],[89,51],[27,50],[40,37],[57,3]],"180":[[54,28],[22,20],[15,6],[14,44],[31,4],[34,17],[4,19]],"2730":[[19,13],[28,38],[12,23],[53,6],[49,15],[38,58],[6,46],[38,58]]}},"Piekielny KoĹciej":{"lvl":74,"prof":"w","spawns":{"Labirynt Margorii":[[15,38],[49,24],[57,55],[35,18],[34,46]],"Margoria Sala KrĂłlewska":[[23,61],[10,77],[51,24],[38,82],[22,30]],"Kopalnia Margorii":[[30,22],[53,62],[11,39],[50,12],[52,40],[27,38],[8,49]],"Zdradzieckie PrzejĹcie":[[21,6],[22,56],[67,38]]}},"OpÄtany Paladyn":{"lvl":85,"prof":"w","spawns":{"180":[[49,28]],"203":[[15,28],[31,9]],"204":[[18,27]],"205":[[18,27]],"210":[[84,7],[33,45],[54,11],[78,25],[15,26]],"211":[[19,38],[19,11],[45,57]],"601":[[17,41],[87,5],[25,55],[59,35],[92,54],[22,21]],"602":[[40,31],[6,58],[4,16]],"Podziemia ĹwiÄ
tyni":[[28,5],[54,32]],"Zbrojownia Andarum":[[25,59],[7,35],[7,20]]}},"Kochanka Nocy":{"lvl":100,"prof":"m","spawns":{"246":[[12,8],[28,60],[77,60]],"253":[[88,34],[77,46],[80,59],[6,34],[6,41],[34,22],[60,7],[90,20]],"268":[[83,6],[10,15],[34,47]],"330":[[6,8],[88,6],[60,24],[14,43],[45,40],[16,19]],"331":[[22,12],[5,58],[82,41],[82,8]],"332":[[77,13],[64,7],[35,19],[19,36]],"339":[[91,41],[81,1],[44,9],[39,33],[45,56],[67,59]],"3765":[[70,34],[83,51],[9,43],[29,37]],"3766":[[5,46],[11,11],[60,11],[72,52],[53,55]]}},"Perski KsiÄ
ĹźÄ":{"lvl":116,"prof":"b","spawns":{"Dolina Pustynnych KrÄgĂłw":[[11,89],[11,89],[10,21]],"Piachy Zniewolonych":[[33,23],[11,7],[75,30]],"Ruchome Piaski":[[79,54],[63,29],[15,16]],"Korsarska Nora - sala 2":[[4,22]],"Korsarska Nora - sala 4":[[10,6]],"Korsarska Nora p.2":[[11,6]],"Ukryta Grota Morskich DiabĹĂłw":[[51,32],[25,16]],"Ukryta Grota Morskich DiabĹĂłw - arsenaĹ":[[4,14]],"Ukryta Grota Morskich DiabĹĂłw - skarbiec":[[8,4]],"Oaza Siedmiu WichrĂłw":[[61,15],[42,24]],"Ruiny Pustynnych Burz":[[42,46],[9,7],[42,79]],"Dolina Suchych Ĺez":[[71,16],[41,22],[61,55]]}},"Baca Bez Ĺowiec":{"lvl":123,"prof":"h","spawns":{"WyjÄ
cy WÄ
wĂłz":[[58,30],[7,10],[58,51],[35,3],[52,72],[8,75],[58,18],[54,50],[21,41],[50,32],[50,7],[44,71],[40,87],[14,36],[23,71],[38,53]],"WyjÄ
ca Jaskinia":[[14,61],[35,28],[54,27],[23,51],[4,19],[24,19],[50,32],[10,18],[32,7],[17,60],[50,25]],"NiedĹşwiedzie Urwisko":[[20,6],[34,8],[33,23]],"Babi wzgĂłrek":[[36,43],[55,7],[40,4],[54,78],[41,2],[34,54],[41,78],[56,67],[60,36],[12,60],[19,22],[15,88],[38,25],[38,33]],"GĂłralska Pieczara p.1":[[19,17],[19,22],[25,24],[35,4],[34,12]],"GĂłralska Pieczara p.2":[[7,5],[15,20],[5,31]],"GĂłralska Pieczara p.3":[[16,28],[24,38]],"GĂłralskie przejĹcie":[[29,2],[38,46],[28,19],[48,87],[48,70],[42,64],[60,70],[3,46],[7,9],[22,39],[18,53],[56,5],[47,2],[33,27],[8,72],[6,46]],"Grota Halnego Wiatru p.1":[[4,12]],"Grota Halnego Wiatru p.2":[[26,27],[5,31],[7,5],[13,17]]}},"Lichwiarz Grauhaz":{"lvl":129,"prof":"w","spawns":{"286":[[7,16],[50,48]],"287":[[26,30]],"594":[[29,18]],"1192":[[55,48],[30,54]],"1227":[[6,43],[54,10],[51,21],[49,42]],"1228":[[8,51],[51,3],[5,18],[42,37]],"1229":[[53,9],[11,43],[8,13],[7,16],[37,40]],"1231":[[39,58],[33,47],[12,11]],"1232":[[41,14],[33,7],[58,11],[42,25]],"1234":[[21,19],[46,53],[5,39],[6,23]],"3468":[[32,32]],"3469":[[13,14]],"3470":[[18,27],[30,5],[21,31],[59,56]],"3471":[[39,6]],"3472":[[44,50]],"3473":[[36,43],[66,9]],"ĹnieĹźna Grota p.2":[[34,10]],"KrysztaĹowa Sala Smutku":[[16,7]],"PrzejĹcie magicznego mrozu":[[41,49]],"PrzejĹcie lodowatego wiatru":[[6,33]],"Szlak Thorpa p.2":[[32,32]],"Zasypane Ograbar-Dun":[[55,48],[30,54]],"PrzejĹcie zamarzniÄtych koĹci":[29,18]}},"ObĹÄ
kany Ĺowca OrkĂłw":{"lvl":144,"prof":"w","spawns":{"344":[[25,8],[61,36],[45,23],[86,4],[25,38],[45,61],[14,4],[24,40],[85,33],[19,10]],"ZĹudny Trakt":[[38,13],[58,17],[17,5],[9,51],[21,6],[7,59],[32,16],[37,9]],"Orcza WyĹźyna":[[74,47],[16,16],[52,12],[59,35],[87,7]],"Grota Orczych SzamanĂłw":[[12,19]],"Osada Czerwonych OrkĂłw":[[18,24],[19,23],[14,25],[62,42],[35,27],[41,78],[43,4],[60,47]],"Siedziba Rady OrkĂłw":[[11,25]],"Nawiedzone Kazamaty p.1":[[19,33],[45,13],[10,44],[42,39],[6,43],[45,9],[12,6],[32,16],[10,16],[25,7],[40,38],[16,16],[36,7]],"Nawiedzone Kazamaty p.3":[[27,22],[26,22]],"Nawiedzone Kazamaty p.4":[[19,36],[12,13],[48,19],[4,9],[9,9],[31,18],[7,25],[45,39],[31,19],[16,22],[34,30],[41,41],[6,45],[29,42],[48,38],[32,10],[5,30]],"Nawiedzone Kazamaty p.5":[[4,41],[26,13],[49,27],[9,33],[6,15],[31,35],[10,20],[4,43],[41,26],[8,16]],"Nawiedzone Kazamaty p.6":[[27,36]]}},"CzarujÄ
ca Atalia":{"lvl":157,"prof":"m","spawns":{"1293":[[5,5],[46,56],[10,59],[82,4],[62,50],[89,24]],"1294":[[34,11],[54,12],[27,16],[46,40],[19,51]],"1297":[[45,4],[55,11],[44,54],[75,33],[1,43]],"1298":[[7,7],[9,16]],"1299":[[17,7],[23,13],[19,6]],"1300":[[5,8]],"1301":[[6,8],[2,6]],"1303":[[15,10],[11,13]],"1308":[[4,5],[9,10]]}},"ĹwiÄty Braciszek":{"lvl":165,"prof":"b","spawns":{"Dom Rumiry i Dobromira p.1":[[5,7]],"Sklep z winem":[[5,7]],"Dom Wazira":[[6,6]],"Magazyn win p.1":[[6,5]],"Jezioro WaĹźek":[[17,11],[86,9],[7,57],[59,43]],"PachnÄ
cy GÄ
szcz":[[88,43],[26,44],[28,5]],"Las Zadumy":[[11,30],[46,47],[85,23]],"Agia Triada":[[67,38],[18,57],[34,21],[59,43]],"Grota DrÄ
ĹźÄ
cych Kropli p.1":[],"Grota DrÄ
ĹźÄ
cych Kropli p.2":[[11,8]],"Klasztor RóşanitĂłw - korytarz wejĹciowy":[[6,8],[5,8]],"Klasztor RóşanitĂłw - pomieszczenie gospodarcze":[[9,12]],"Klasztor RóşanitĂłw - klasztorny browar":[[12,6]],"Klasztor RóşanitĂłw - klasztorna piekarnia":[[2,10]],"Klasztor RóşanitĂłw - warsztat":[[12,6]],"Klasztor RóşanitĂłw - wirydarz":[[8,14]],"Klasztor RóşanitĂłw - dormitoria":[[13,15]],"Klasztor RóşanitĂłw - refektarz":[[4,22]],"Klasztor RóşanitĂłw - fraternia":[[5,15]],"Klasztor RóşanitĂłw - dzwonnica":[[11,8]],"Klasztor RóşanitĂłw - piwniczka":[[6,6]],"Klasztor RóşanitĂłw - lawaterz":[[3,10]],"Klasztor RóşanitĂłw - klatka schodowa":[[8,8],[8,12]],"Klasztor RóşanitĂłw - kapitularz":[[3,15]],"Klasztor RóşanitĂłw - ĹwiÄ
tynia":[[44,25],[8,14]],"Klasztor RóşanitĂłw - magazyn ksiÄ
g":[[11,5]],"Klasztor RóşanitĂłw - cela opata":[[10,6]],"Klasztor RóşanitĂłw - wieĹźa pĹn.-zach. p.1":[[9,12]],"Klasztor RóşanitĂłw - wieĹźa pĹn.-zach. p.2":[[10,12]],"Klasztor RóşanitĂłw - wieĹźa pĹn.-wsch. p.1":[[4,11]],"Klasztor RóşanitĂłw - strych p.1":[[20,12]],"Klasztor RóşanitĂłw - strych p.2":[[31,6],[22,20]],"Tunel pod SkaĹÄ
p.1":[[14,53],[13,54]],"Tunel pod SkaĹÄ
p.2":[[45,41]],"Tunel pod SkaĹÄ
p.3":[[10,24]],"Ogrza kawerna p.1":[[26,4]],"Ogrza kawerna p.2":[[49,18]],"Ogrza kawerna p.3":[[26,16],[52,8]]}},"Viviana Nandid":{"lvl":184,"prof":"h","spawns":{"2056":[[16,6],[85,13],[68,46],[85,51],[8,26],[8,9],[56,14],[63,5],[22,23]],"Rozlewisko Kai":[[1,8],[28,14],[41,8],[12,32],[14,14],[71,62],[21,48],[13,55],[27,53],[75,26],[46,50],[42,14]],"Ruiny Tass Zhil":[[37,5],[57,21],[21,7],[55,40],[67,18],[50,12],[80,1],[10,45],[8,10],[59,52],[5,41],[37,5],[14,58],[62,58]],"BĹota Sham Al":[[31,3],[51,11],[35,26],[5,40],[6,26],[32,38],[30,10]],"Gvar Hamryd":[[15,6],[72,5],[50,37],[63,19],[73,50],[3,27],[86,39],[6,44],[16,60],[90,27],[32,60],[25,26],[32,37],[53,35],[44,57],[77,60],[39,35]]}},"Mulher Ma":{"lvl":197,"prof":"b","spawns":{"114":[[71,4],[33,44],[25,18]],"574":[[22,3]],"575":[[14,53]],"730":[[90,9],[93,61]],"731":[[91,33],[14,4]],"865":[[11,5]],"1992":[[19,18]],"2002":[[4,17]],"2020":[[22,36],[48,41],[15,40],[76,58],[70,37],[74,58]],"2056":[[13,49],[65,38],[89,41]],"2063":[[18,48],[52,11]],"2126":[[7,6]],"2127":[[8,13]],"2163":[[6,8]],"2183":[[10,11],[18,14]],"2432":[[4,5]]}},"Demonis Pan NicoĹci":{"lvl":210,"prof":"m","spawns":{"971":[[14,15],[30,41],[30,32],[59,34],[15,34],[33,7],[15,17]],"973":[[48,33],[73,24],[89,49],[48,53],[48,14],[24,30],[23,30],[48,13],[48,34],[88,50],[73,23]],"974":[[15,27]],"975":[[18,11],[44,33],[18,12]],"976":[[32,44],[50,45],[50,46]],"977":[[47,45]]}},"Vapor Veneno":{"lvl":227,"prof":"w","spawns":{"1399":[[14,10],[63,9]],"1448":[[63,50],[63,23],[81,36],[53,7],[91,10],[40,37]],"1449":[[81,34],[86,52],[57,34],[53,51],[14,50],[32,33],[87,59],[27,35]],"1458":[[30,20],[2,25],[77,42],[51,29]],"1464":[[9,18]],"2902":[[20,23],[37,26]],"3135":[[50,57],[11,24],[29,47],[14,4],[17,45],[34,19],[58,34]],"3136":[[40,84],[47,11],[29,7],[24,74],[24,43],[12,52],[57,28],[54,76],[37,53],[43,29]],"3137":[[57,50],[49,39],[57,14],[33,29],[23,9]],"3138":[[37,83],[38,56],[18,57],[47,46],[50,87]],"3209":[[55,80],[52,60],[24,46],[39,51],[10,7],[8,78],[8,49],[31,78]]}},"DÄboroĹźec":{"lvl":242,"prof":"w","spawns":{"3594":[[28,28],[41,46],[11,21],[80,50]],"3595":[[33,28],[75,27],[85,50]],"3596":[[40,8],[58,26],[60,50]],"3597":[[31,83],[2,31]],"3598":[[34,11],[46,48]],"3610":[[39,11],[7,57],[52,45]],"3611":[[30,9]],"3612":[[19,17],[17,17]],"3613":[[21,8],[52,22]],"3614":[[11,15]],"3615":[[13,11]],"3620":[[7,13]],"3621":[[11,18]],"3622":[[36,22]],"3623":[[17,17]],"3624":[[12,19]],"3625":[[23,27]],"3626":[[9,12]],"3627":[[20,23]]}},"Tepeyollotl":{"lvl":260,"prof":"b","spawns":{"1901":[[50,11],[18,71],[45,20],[24,33],[19,49]],"1924":[[10,7],[70,22],[76,47]],"1926":[[8,76],[11,16],[12,87],[5,76]],"1963":[[9,6]],"1964":[[17,7]],"1966":[[16,27]],"1982":[[13,19]],"3029":[[8,10]],"3030":[[10,20]],"3031":[[10,13]],"3032":[[49,22],[11,15],[17,35]],"3033":[[12,40],[70,40]],"3034":[[19,19]],"3035":[[31,31]],"3036":[[13,40],[14,40],[16,19],[16,8]],"3037":[[30,26],[37,13]],"3038":[[24,6],[21,32]],"3039":[[32,72]],"3040":[[12,12]],"3041":[[17,15],[15,12]],"3042":[[21,25],[22,24]],"3043":[[22,41],[32,11],[54,9],[9,19]]}},"MĹody Smok":{"lvl":282,"prof":"m","spawns":{"Pustynia Shaiharrud - wschĂłd":[[5,2],[47,24],[24,61],[4,38],[21,76]],"Pustynia Shaiharrud - zachĂłd":[[4,19],[26,8],[52,38],[22,85]],"Urwisko Vapora":[[64,37],[83,48],[29,46],[20,58]],"Jaskinia SÄpa s.1":[[27,11]],"Jaskinia Piaskowej Burzy s.1":[[16,8]],"Jaskinia Smoczej Paszczy p.1":[[31,34]],"Jaskinia Smoczej Paszczy p.2":[[25,27]],"Jurta Nomadzka":[[3,6]],"Jaskinia Piaskowej Burzy s.2":[[5,20]],"ĹwiÄ
tynia Hebrehotha - przedsionek":[[26,12]],"SkaĹy UmarĹych":[[31,87],[54,70],[60,30],[30,31]],"Jaskinia PrĂłby":[[14,19]],"Jaskinia Odwagi":[[31,40],[29,11]],"Smocze Skalisko":[[52,50],[67,27]],"SÄpiarnia":[[7,5]],"Grota PoĹwiÄcenia":[[4,21]]}}};
3228 var eliteDB = {
3229 //elity do dziennego questa w margonem.com
3230 "Masked Blaise": {
3231 lvl: -1,
3232 ver: "en",
3233 //spawns: {196:[[8,5]]} w sumie to ich na caĹÄ
mapÄ Ĺaduje wiÄc bez sensu
3234 },
3235 "Cula Joshua": {
3236 lvl: -1,
3237 ver: "en",
3238 spawns: {}
3239 },
3240 "Mola Nito": {
3241 lvl: -1,
3242 ver: "en",
3243 spawns: {}
3244 },
3245 "Toto Acirfa": {
3246 lvl: -1,
3247 ver: "en",
3248 spawns: {}
3249 },
3250 "Masked Roman": {
3251 lvl: -1,
3252 ver: "en",
3253 spawns: {}
3254 },
3255 "Possessed Fissit": {
3256 lvl: -1,
3257 ver: "en",
3258 spawns: {}
3259 },
3260 "Soda": {
3261 lvl: -1,
3262 ver: "en",
3263 spawns: {}
3264 },
3265 "Molybdenum Matityahu": {
3266 lvl: -1,
3267 ver: "en",
3268 spawns: {}
3269 },
3270 "Hummopapa": {
3271 lvl: -1,
3272 ver: "en",
3273 spawns: {}
3274 },
3275 "Shponder":{
3276 lvl: -1,
3277 ver:"en",
3278 spawns:{}
3279 },
3280 "Mobile Jeecus":{
3281 lvl: -1,
3282 ver:"en",
3283 spawns:{}
3284 }
3285 };
3286
3287 this.getHerosDB = function() {
3288 return herosDB;
3289 };
3290
3291 var niceSettings = new (function(options) {
3292 var self = this;
3293 var {get, set, data, header, onSave} = options;
3294 var panels = {};
3295 var $currentPanel = false;
3296 var $activeLPanelEntry;
3297 var $rpanel;
3298 var $wrapper;
3299 var shown = false;
3300 this.toggle = function() {
3301 var lock = interface == "new" ? Engine.lock : (interface == "old" ? g.lock : null);
3302 if (shown) {
3303 if (lock) lock.remove("ns-"+header);
3304 else global.dontmove = false;
3305 $wrapper.style["display"] = "none";
3306 } else {
3307 if (lock) lock.add("ns-"+header);
3308 else global.dontmove = true;
3309 $wrapper.style["display"] = "block";
3310 };
3311 shown = !shown;
3312 };
3313 this.initHTML = function() {
3314 $wrapper = document.createElement("div");
3315 $wrapper.classList.add("ns-wrapper");
3316 document.body.appendChild($wrapper);
3317
3318 var $header = document.createElement("div");
3319 $header.innerHTML = header + " - ustawienia";
3320 $header.classList.add("ns-header");
3321 $wrapper.appendChild($header);
3322
3323 var $close = document.createElement("div");
3324 $close.innerHTML = "X";
3325 $close.classList.add("ns-close");
3326 $close.addEventListener("click", this.toggle);
3327 $wrapper.appendChild($close);
3328
3329 var $panels = document.createElement("div");
3330 $panels.classList.add("ns-panels");
3331 $wrapper.appendChild($panels);
3332
3333 var $lpanel = document.createElement("div");
3334 $lpanel.addEventListener("click", this.lPanelClick);
3335 $lpanel.classList.add("ns-lpanel");
3336 $panels.appendChild($lpanel);
3337
3338 $rpanel = document.createElement("div");
3339 $rpanel.classList.add("ns-rpanel");
3340 $rpanel.addEventListener("click", this.globalRpanelHandler);
3341 $panels.appendChild($rpanel);
3342
3343 $lpanel.innerHTML = this.generateLpanelHtml();
3344 this.genereteRpanels();
3345 };
3346 this.lPanelClick = function(e) {
3347 if (e.target.dataset["name"]) {
3348 self.togglePanel(e.target.dataset["name"]);
3349 if ($activeLPanelEntry) $activeLPanelEntry.classList.remove("active");
3350 $activeLPanelEntry = e.target;
3351 $activeLPanelEntry.classList.add("active");
3352 };
3353 };
3354 this.globalRpanelHandler = function(e) {
3355 var tar = e.target;
3356 if (tar.dataset["listbtt"]) {
3357 var key = tar.dataset["listbtt"];
3358 var $content = document.querySelector(".ns-list-content[data-list='"+key+"']");
3359 var $input = document.querySelector("input[data-list='"+key+"']");
3360 self.adddContentToList($content, $input);
3361 } else if (tar.dataset["listitem"]) {
3362 tar.remove();
3363 };
3364 };
3365 this.adddContentToList = function($content, $input) {
3366 var val = $input.value;
3367 if (val == "") return;
3368 $input.value = "";
3369 var items = this.getContentItems($content);
3370 if (items.indexOf(val) > -1) return
3371 var $div = document.createElement("div");
3372 $div.classList.add("ns-list-item");
3373 $div.dataset["listitem"] = "1";
3374 $div.innerText = val;
3375 $content.appendChild($div);
3376 };
3377 this.getContentItems = function($content) {
3378 var items = [];
3379 for (var i=0; i<$content.children.length; i++) {
3380 items.push($content.children[i].innerHTML);
3381 };
3382 return items;
3383 };
3384 this.togglePanel = function(name) {
3385 if ($currentPanel) $currentPanel.remove();
3386 $currentPanel = panels[name];
3387 $rpanel.appendChild($currentPanel);
3388 this.setAsyncPanelContent(name);
3389 };
3390 this.setAsyncPanelContent = function(name) {
3391 var entries = options.data[name];
3392 for (var i=0; i<entries.length; i++) {
3393 var entry = entries[i];
3394 if (entry.asyncid) {
3395 entry.fun(val => {
3396 var el = document.getElementById(entry.asyncid);
3397 if (el) el.innerHTML = val;
3398 });
3399 };
3400 };
3401 };
3402 this.genereteRpanels = function() {
3403 for (var name in data) {
3404 this.generateRpanel(name, data[name]);
3405 };
3406 };
3407 this.generateRpanel = function(name, content) {
3408 var $panel = document.createElement("div");
3409 panels[name] = $panel;
3410 var html = "";
3411 for (var i=0; i<content.length; i++) {
3412 html += this.generateRpanelEntryHtml(content[i]);
3413 };
3414 $panel.innerHTML = html;
3415 var $btt = document.createElement("div");
3416 $btt.innerHTML = "Zapisz";
3417 $btt.classList.add("ns-save-button");
3418 $btt.addEventListener("click", () => this.savePanel(name));
3419 $panel.appendChild($btt);
3420 };
3421 this.generateRpanelEntryHtml = function(entry) {
3422 var {type, special} = this.getEntryType(entry.type);
3423 if (!special) {
3424 var input = "<input data-key='"+entry.key+"' type='"+type+"' value='"+get(entry.key)+"'></input>";
3425 return this.getRpanelEntry(entry.name, input, entry.tip);
3426 } else {
3427 if (type == "range") {
3428 var input = "<input data-key='"+entry.key+"' type='"+type+"' value='"+get(entry.key)*100+"' min='"+entry.data[0]*100+"' max='"+entry.data[1]*100+"'></input>";
3429 return this.getRpanelEntry(entry.name, input, entry.tip);
3430 } else if (type == "checkbox") {
3431 var input = "<input data-key='"+entry.key+"' type='"+type+"' "+(get(entry.key) ? "checked" : "")+"></input>";
3432 return this.getRpanelEntry(entry.name, input, entry.tip);
3433 } else if (special == "char") {
3434 var input = "<input data-key='"+entry.key+"' type='"+type+"' value='"+String.fromCharCode(get(entry.key))+"' maxlength='1' style='width: 10px; text-align: center'></input>";
3435 return this.getRpanelEntry(entry.name, input, entry.tip);
3436 } else if (special == "noinput") {
3437 if (type != "async") {
3438 return this.getRpanelEntry(entry.t1, entry.t2, entry.tip);
3439 } else {
3440 var id = "NS-async-"+Math.random()*10;
3441 entry.asyncid = id;
3442 return this.getRpanelEntry(entry.t1, "<div id='"+id+"'>"+entry.placeholder+"</div>", entry.tip);
3443 };
3444 } else if (type == "list") {
3445 return this.generateListInput(entry);
3446 };
3447 };
3448 };
3449 this.generateListInput = function(entry) {
3450 var list = get(entry.key);
3451 var html;
3452 html = "<div class='ns-list-wrapper'>";
3453 html += "<div class='ns-list-header'>"+entry.name+"</div>";
3454 html += "<div class='ns-list-content' data-list='"+entry.key+"'>";
3455 for (var i=0; i<list.length; i++) {
3456 html += "<div class='ns-list-item' data-listitem='1'>"+list[i]+"</div>";
3457 };
3458 html += "</div>";
3459 html += "<div class='ns-list-bottombar'>";
3460 html += "<div class='ns-list-input'><input data-list='"+entry.key+"' type='text'></div>";
3461 html += "<div class='ns-list-addbtt' data-listbtt='"+entry.key+"'>+</div>";
3462 html += "</div>";
3463 html += "</div>";
3464 return html;
3465 };
3466 this.getRpanelEntry = function(txt, input, tip) {
3467 return "<div "+(tip ? (interface == "new" ? "data-tip" : "tip") + "='"+tip+"'" : "")+" class='ns-rpanel-entry'><div class='ns-rpanel-entry-left'>"+txt+"</div><div class='ns-rpanel-entry-right'>"+input+"</div></div>";
3468 };
3469 this.getEntryType = function(entrytype) {
3470 var special = false;
3471 switch (entrytype) {
3472 case "string":
3473 var type = "text";
3474 break;
3475 case "color":
3476 var type = "color";
3477 break;
3478 case "range":
3479 special = true;
3480 var type = "range";
3481 break;
3482 case "check":
3483 special = true;
3484 var type = "checkbox";
3485 break;
3486 case "char":
3487 special = "char";
3488 var type = "text";
3489 break;
3490 case "list":
3491 special = true;
3492 var type = "list";
3493 break;
3494 case "numstring":
3495 var type = "number";
3496 break;
3497 case "info-async":
3498 var type = "async";
3499 special = "noinput";
3500 break;
3501 default:
3502 special = "noinput";
3503 };
3504 return {
3505 type: type,
3506 special: special
3507 };
3508 }
3509 this.generateLpanelHtml = function() {
3510 var html = "";
3511 for (var name in data) {
3512 html += "<div class='ns-lpanel-entry' data-name='"+name+"'>"+name+"</div>";
3513 };
3514 return html;
3515 };
3516 this.savePanel = function(name) {
3517 var panel = data[name];
3518 for (var i=0; i<panel.length; i++) {
3519 this.savePanelEntry(panel[i]);
3520 };
3521 onSave();
3522 };
3523 this.savePanelEntry = function(entry) {
3524 var {type, special} = this.getEntryType(entry.type);
3525 if (!special) {
3526 var val = this.getEntryValue(entry.key);
3527 if (type == "number") {
3528 val = parseInt(val);
3529 if (isNaN(val)) return;
3530 };
3531 set(entry.key, val);
3532 } else {
3533 if (type == "range") {
3534 set(entry.key, this.getEntryValue(entry.key)/100);
3535 } else if (type == "checkbox") {
3536 set(entry.key, this.getCheckboxState(entry.key));
3537 } else if (special == "char") {
3538 var val = this.getEntryValue(entry.key).toUpperCase().charCodeAt(0);
3539 if (isNaN(val)) return;
3540 set(entry.key, val);
3541 } else if (type == "list") {
3542 var $content = document.querySelector(".ns-list-content[data-list='"+entry.key+"']");
3543 var items = this.getContentItems($content);
3544 set(entry.key, items);
3545 };
3546 };
3547 };
3548 this.getEntryValue = function(key) {
3549 return document.querySelector("input[data-key='"+key+"']").value;
3550 };
3551 this.getCheckboxState = function(key) {
3552 return document.querySelector("input[data-key='"+key+"']").checked;
3553 };
3554 this.initCss = function() {
3555 var css = `
3556 .ns-wrapper {
3557 width: 600px;
3558 height: 600px;
3559 background: rgba(0,0,0,.8);
3560 border: 2px solid #222222;
3561 border-radius: 20px;
3562 position: absolute;
3563 left: calc(50% - 300px);
3564 top: calc(50% - 300px);
3565 z-index: 500;
3566 color: white;
3567 display: none;
3568 ${interface == "superold" ? "transform: scale(0.8, 0.8);" : ""}
3569 }
3570 .ns-wrapper .ns-close {
3571 width: 30px;
3572 height: 30px;
3573 font-size: 20px;
3574 line-height: 30px;
3575 text-align: center;
3576 background: rgba(0,0,0,.6);
3577 transition: background .1s ease-in-out;
3578 position: absolute;
3579 right: 3px;
3580 top: 3px;
3581 cursor: pointer;
3582 }
3583 .ns-wrapper .ns-close:hover {
3584 background: rgba(0,0,0,.9);
3585 }
3586 .ns-wrapper .ns-header {
3587 border-bottom: 1px solid #333333;
3588 font-size: 26px;
3589 padding-left: 15px;
3590 color: white;
3591 height: 39px;
3592 line-height: 40px;
3593 background: rgba(50,50,50,.8);
3594 }
3595 .ns-wrapper .ns-panels {
3596 height: 560px;
3597 }
3598 .ns-wrapper .ns-panels .ns-lpanel {
3599 height: 560px;
3600 width: 200px;
3601 border-right: 1px solid #333333;
3602 float: left;
3603 }
3604 .ns-wrapper .ns-panels .ns-lpanel .ns-lpanel-entry {
3605 width: 75%;
3606 height: 30px;
3607 line-height: 30px;
3608 font-size: 19px;
3609 padding-left: 5px;
3610 background: linear-gradient(to right, rgba(100,100,100,0.45) , rgba(100,100,100,0));
3611 transition: all .15s ease-in-out;
3612 cursor: pointer;
3613 margin-bottom: 1px;
3614 }
3615 .ns-wrapper .ns-panels .ns-lpanel .ns-lpanel-entry.active {
3616 background: linear-gradient(to right, rgba(150,150,150,0.45) , rgba(150,150,150,0));
3617 width: 100%;
3618 padding-left: 13px;
3619 }
3620 .ns-wrapper .ns-panels .ns-lpanel .ns-lpanel-entry:hover {
3621 width: 100%;
3622 padding-left: 13px;
3623 }
3624 .ns-wrapper .ns-panels .ns-rpanel {
3625 height: 560px;
3626 width: 390px;
3627 float: left;
3628 }
3629 .ns-wrapper .ns-panels .ns-rpanel .ns-rpanel-entry {
3630 height: 30px;
3631 margin: 3px;
3632 line-height: 30px;
3633 background: rgba(50,50,50,0.5);
3634 }
3635 .ns-panels .ns-rpanel .ns-rpanel-entry .ns-rpanel-entry-left {
3636 float: left;
3637 height: 30px;
3638 width: 180px;
3639 padding-left: 6px;
3640 }
3641 .ns-panels .ns-rpanel .ns-rpanel-entry .ns-rpanel-entry-right {
3642 float: right;
3643 height: 30px;
3644 width: 180px;
3645 text-align: right;
3646 padding-right: 6px;
3647 }
3648 .ns-rpanel .ns-rpanel-entry .ns-rpanel-entry-right input[type='color'] {
3649 background: black;
3650 border: none;
3651 transition: background .15s ease-in-out;
3652 }
3653 .ns-rpanel .ns-rpanel-entry .ns-rpanel-entry-right input[type='color']:hover {
3654 background: #282828;
3655 }
3656 .ns-rpanel .ns-rpanel-entry .ns-rpanel-entry-right input[type='text'], .ns-rpanel .ns-rpanel-entry .ns-rpanel-entry-right input[type='number'] {
3657 background: rgba(0,0,0,0.8);
3658 border: 1px solid black;
3659 width: 80px;
3660 color: #CCCCCC;
3661 text-align: right;
3662 }
3663 .ns-rpanel .ns-save-button {
3664 position: absolute;
3665 bottom: 10px;
3666 right: 10px;
3667 height: 30px;
3668 width: 70px;
3669 font-size: 20px;
3670 line-height: 30px;
3671 text-align: center;
3672 border: 1px solid #333333;
3673 background: rgba(50,50,50,0.5);
3674 cursor: pointer;
3675 transition: background .1s ease-in-out;
3676 }
3677 .ns-rpanel .ns-save-button:hover {
3678 background: rgba(50,50,50,0.7);
3679 }
3680 .ns-list-wrapper {
3681 background: rgba(50,50,50,0.5);
3682 width: 350px;
3683 margin: 10px;
3684 border: 1px solid #333333;
3685 }
3686 .ns-list-wrapper .ns-list-header {
3687 text-align: center;
3688 height: 20px;
3689 font-size: 15px;
3690 line-height: 20px;
3691 }
3692 .ns-list-wrapper .ns-list-content {
3693 min-height: 80px;
3694 max-height: 1700px;
3695 overflow-y: auto;
3696 border-top: 1px solid #333333;
3697 border-bottom: 1px solid #333333;
3698 }
3699 .ns-list-wrapper .ns-list-content .ns-list-item {
3700 cursor: pointer;
3701 margin: 1px;
3702 background: rgba(50,50,50,0.4);
3703 text-align: center;
3704 height: 15px;
3705 line-height: 15px;
3706 font-size: 12px;
3707 }
3708 .ns-list-wrapper .ns-list-bottombar {
3709 height: 20px;
3710 }
3711 .ns-list-wrapper .ns-list-bottombar .ns-list-input {
3712 float: left;
3713 width: 270px;
3714 }
3715 .ns-list-wrapper .ns-list-bottombar .ns-list-input input {
3716 background: rgba(0,0,0,0.8);
3717 border: 1px solid black;
3718 color: #CCCCCC;
3719 width: 320px;
3720 }
3721 .ns-list-wrapper .ns-list-bottombar .ns-list-addbtt {
3722 width: 20px;
3723 float: right;
3724 text-align: center;
3725 line-height: 20px;
3726 background: rgba(50,50,50,0.6);
3727 cursor: pointer;
3728 }
3729 .ns-list-wrapper .ns-list-bottombar .ns-list-addbtt:hover {
3730 background: rgba(50,50,50,0.9);
3731 }
3732 `;
3733 var $style = document.createElement("style");
3734 $style.innerHTML = css;
3735 document.head.appendChild($style);
3736 };
3737 this.init = function() {
3738 this.initHTML();
3739 this.initCss();
3740 };
3741})({
3742 get: settings.get,
3743 set: settings.set,
3744 onSave: this.onSettingsUpdate,
3745 header: "miniMapPlus",
3746 data: {
3747 "Kolory": [
3748 {
3749 key: "/colors/hero",
3750 name: "Twoja postaÄ",
3751 type: "color"
3752 },
3753 {
3754 key: "/colors/other",
3755 name: "Inni gracze",
3756 type: "color"
3757 },
3758 {
3759 key: "/colors/friend",
3760 name: "Znajomi",
3761 type: "color"
3762 },
3763 {
3764 key: "/colors/enemy",
3765 name: "Wrogowie",
3766 type: "color"
3767 },
3768 {
3769 key: "/colors/clan",
3770 name: "Klanowicze",
3771 type: "color"
3772 },
3773 {
3774 key: "/colors/ally",
3775 name: "Sojusznicy",
3776 type: "color"
3777 },
3778 {
3779 key: "/colors/npc",
3780 name: "ZwykĹy NPC",
3781 type: "color"
3782 },
3783 {
3784 key: "/colors/mob",
3785 name: "ZwykĹy mob",
3786 type: "color"
3787 },
3788 {
3789 key: "/colors/elite",
3790 name: "Elita",
3791 type: "color"
3792 },
3793 {
3794 key: "/colors/elite2",
3795 name: "Elita II/eventowa",
3796 type: "color"
3797 },
3798 {
3799 key: "/colors/elite3",
3800 name: "Elita III",
3801 type: "color"
3802 },
3803 {
3804 key: "/colors/heros",
3805 name: "Heros",
3806 type: "color"
3807 },
3808 {
3809 key: "/colors/titan",
3810 name: "Tytan",
3811 type: "color"
3812 },
3813 {
3814 key: "/colors/item",
3815 name: "Przedmiot",
3816 type: "color"
3817 },
3818 {
3819 key: "/colors/gw",
3820 name: "PrzejĹcie",
3821 type: "color"
3822 }
3823 ],
3824 "WyglÄ
d mapy": [
3825 {
3826 key: "/mapsize",
3827 name: "Rozmiar mapy",
3828 type: "range",
3829 tip: "Zmiany widoczne po odĹwieĹźeniu gry",
3830 data: [0.6, 1.4]
3831 },
3832 {
3833 key: "/opacity",
3834 name: "WidocznoĹÄ mapy",
3835 type: "range",
3836 data: [0.5, 1]
3837 },
3838 {
3839 key: "/darkmode",
3840 name: "Motyw ciemny",
3841 type: "check"
3842 }
3843 ],
3844 "Tracking": [
3845 {
3846 type: "info",
3847 t1: "Co to jest?",
3848 t2: "",
3849 tip: "Tracking (tropienie) to alternatywna opcja wyszukiwania NPC/itemĂłw na mapie. Polega na tym, Ĺźe gdy na mapie pojawi siÄ coĹ z poniĹźszej listy, w oknie gry ukaĹźe siÄ strzaĹka, ktĂłra bÄdzie wzkazywaĹa drogÄ do tej rzeczy.<br>Dodatkowo gdy na mapie pojawia siÄ heros, automatycznie uruchamia siÄ tracking na niego, co jest przydatne np. w podchodzeniu do herosĂłw eventowych."
3850 },
3851 {
3852 key: "/trackedNpcs",
3853 name: "Tracking NPC",
3854 type: "list"
3855 },
3856 {
3857 key: "/trackedItems",
3858 name: "Tracking itemĂłw",
3859 type: "list"
3860 }
3861
3862 ],
3863 "Inne": [
3864 {
3865 key: "/minlvl",
3866 name: "Min. lvl potworkĂłw",
3867 type: "numstring"
3868 },
3869 {
3870 key: "/maxlvl",
3871 name: "Max. przewaga",
3872 tip: "Maksymalna róşnica poziomĂłw miÄdzy TobÄ
a potworkiem przy ktĂłrej nie niszczy siÄ loot na Ĺwiecie na ktĂłrym grasz. JeĹli nie wiesz co to, zostaw 13.",
3873 type: "numstring"
3874 },
3875 {
3876 key: "/show",
3877 name: "Hotkey",
3878 type: "char"
3879 },
3880 {
3881 key: "/altmobilebtt",
3882 name: "PrzesuĹ przycisk mobilny",
3883 type: "check",
3884 tip: "Przesuwa przycisk widoczny na urzÄ
dzeniach mobilnych pomiÄdzy torby"
3885 },
3886 {
3887 key: "/interpolerate",
3888 name: "Animacje na mapie",
3889 type: "check"
3890 },
3891 {
3892 key: "/showqm",
3893 name: "Zaznaczaj questy",
3894 type: "check"
3895 },
3896 {
3897 key: "/novisibility",
3898 name: "Nie pokazuj \"mgĹy wojny\"",
3899 type: "check",
3900 tip: "WyĹÄ
cza pokazywanie widzianego obszaru na czerwonych mapach.<br>Nie pozdrawiam klanu Game Over (Jaruna), ktĂłry utrudniaĹ testowanie tej funkcjonalnoĹci dedajÄ
c mnie bez powodu."
3901 }
3902 /*,
3903 {
3904 key: "/showevonetwork",
3905 name: "Pokazuj postacie z WSync",
3906 tip: "World Sync to dodatek stworzony przez CcarderRa, ktĂłry pozwala widzieÄ graczy z innych ĹwiatĂłw. Jest czÄĹciÄ
Evolution Managera, ktĂłrego moĹźna znaleĹşÄ na forum w dziale Dodatki do gry.",
3907 type: "check"
3908 }*/
3909 ],
3910 "Informacje": [
3911 {
3912 type: "info",
3913 t1: "Wersja",
3914 t2: "v"+this.version+(interface == "new" ? " NI" : (interface == "old" ? " SI" : " OM"))
3915 },
3916 {
3917 type: "info",
3918 t1: "ĹšrĂłdĹo instalacji",
3919 t2: this.getInstallSource()
3920 },
3921 {
3922 type: "info-async",
3923 t1: "Licznik instalacji",
3924 placeholder: "wczytywanie...",
3925 tip: "Liczy od wersji 3.1 minimapy",
3926 fun: this.installationCounter.get
3927 }
3928 ]
3929 }
3930});
3931 this.init();
3932 niceSettings.init();
3933})();
3934log("UĹźywasz dodatku Super Sprzedawaca ver 1 by Godfryd 0");
3935
3936var sss = window.localStorage.getItem("SuperSprzedawca");
3937if (sss != null)
3938 opt_ss = parseInt(sss);
3939else
3940 opt_ss = 8191;
3941
3942function cfgupdatess() {
3943 for (var a = 1; a <= 13; a++) {
3944 $("#optss" + a).css("backgroundPosition", (opt_ss2 & (1 << (a - 1))) ? "0 -22px" : "0 0")
3945 }
3946 }
3947
3948function optclickss(a) {
3949 x = $(a.target).attr("opt");
3950 opt_ss2 ^= 1 << (x - 1);
3951 cfgupdatess();
3952}
3953
3954function configss_show() {
3955 opt_ss2 = opt_ss;
3956 cfgupdatess();
3957 $("#configss").absCenter().fadeIn();
3958}
3959
3960function configss_cancel() {
3961 $("#configss").fadeOut();
3962}
3963
3964function configss_save() {
3965 opt_ss = opt_ss2;
3966 try {
3967 window.localStorage.setItem("SuperSprzedawca", opt_ss);
3968 } catch (e) {
3969 if (e.name == "NS_ERROR_FILE_CORRUPTED")
3970 alert("WyglÄ
da na to, Ĺźe twoja przeglÄ
darka ma zepsuty localstorage. Przeinstaluj Firefoxa, albo zainstaluj nowsza wersjÄ byÄ moĹźe to rozwiÄ
Ĺźe problem.");
3971 }
3972 $("#configss").fadeOut();
3973}
3974
3975var oofff = 'style="background: url(img/checkbox.png) no-repeat scroll left top; background-position: 0px 0px; cursor: pointer; font: 12px Georgia, serif; height: 18px; margin-bottom: 2px; padding: 4px 30px 0;">';
3976
3977$("body").append('<div id="configss">');
3978$("#configss").css({
3979 "display" : "block",
3980 "width" : "400px",
3981 "height" : "400px",
3982 "position" : "absolute",
3983 "background" : "#040 url(img/conf-back.png) no-repeat bottom center",
3984 "display" : "none",
3985 "left" : "640px",
3986 "top" : "200px",
3987 "z-index" : "600"
3988});
3989
3990$('#configss').append('<div class="conf-title"></div>');
3991$('#configss').append('<div id="optionss_help">Zaznacz jakie rodzaje towarĂłw majÄ
byÄ NIE sprzedawane!</div>');
3992$('#optionss_help').css({
3993 "margin" : "5px 15px 5px"
3994});
3995$('#configss').append('<div id="cfg_optionsss"></div>');
3996
3997$('#cfg_optionsss').css({
3998 "margin" : "5px 15px 5px"
3999});
4000
4001$('#cfg_optionsss').append('<div opt="1" id="optss1" ' + oofff + ' Mikstury</div>');
4002$('#cfg_optionsss').append('<div opt="2" id="optss2" ' + oofff + ' Questowe</div>');
4003$('#cfg_optionsss').append('<div opt="3" id="optss3" ' + oofff + ' Konsumpcyjne</div>');
4004$('#cfg_optionsss').append('<div opt="4" id="optss4" ' + oofff + ' Klucze</div>');
4005$('#cfg_optionsss').append('<div opt="5" id="optss5" ' + oofff + ' Torby</div>');
4006$('#cfg_optionsss').append('<div opt="6" id="optss6" ' + oofff + ' ZĹoto</div>');
4007$('#cfg_optionsss').append('<div opt="7" id="optss7" ' + oofff + ' Ulepszenia</div>');
4008$('#cfg_optionsss').append('<div opt="8" id="optss8" ' + oofff + ' ZwiÄ
zany z wĹaĹcicielem</div>');
4009$('#cfg_optionsss').append('<div opt="9" id="optss9" ' + oofff + ' legendarny</div>');
4010$('#cfg_optionsss').append('<div opt="10" id="optss10" ' + oofff + ' heroiczny</div>');
4011$('#cfg_optionsss').append('<div opt="11" id="optss11" ' + oofff + ' unikat</div>');
4012$('#cfg_optionsss').append('<div opt="12" id="optss12" ' + oofff + ' ulepszony</div>');
4013$('#cfg_optionsss').append('<div opt="13" id="optss13" ' + oofff + ' StrzaĹy</div>');
4014
4015$('#configss').append('<center><button onclick="configss_save()" rollover="20" class="save" id="btn1" style="background: url(img/bw_save.png) repeat scroll 0 0; background-position: 0% 0%; border: medium none; height: 20px; margin 10px; width: 68px;"></button><button onclick="configss_cancel()" rollover="20" class="cancel" id="btn2" style="background: url(img/bw_cancel.png) repeat scroll 0 0; height: 20px; width: 68px; border: medium none; margin: 0px;"></button></center>');
4016
4017$("#cfg_optionsss DIV").click(optclickss);
4018
4019var shop_close_f = shop_close;
4020shop_close = function () {
4021 shop_close_f();
4022 $("#wybtorbe").text("Wybierz torbÄ do sprzedaĹźy:");
4023 $("#torba1").text("1");
4024 $("#torba2").text("2");
4025 $("#torba3").text("3");
4026}
4027
4028var shop_accept_f = shop_accept;
4029shop_accept = function () {
4030 shop_accept_f();
4031 $("#wybtorbe").text("Wybierz torbÄ do sprzedaĹźy:");
4032 $("#torba1").text("1");
4033 $("#torba2").text("2");
4034 $("#torba3").text("3");
4035}
4036
4037function sprzedaj(i) {
4038 var granice = [
4039 [-1, 166],
4040 [197, 364],
4041 [395, 562]];
4042 var nosell = [
4043 ["Mikstury"],
4044 ["Questowe"],
4045 ["Konsumpcyjne"],
4046 ["Klucze"],
4047 ["Torby"],
4048 ["ZĹoto"],
4049 ["Ulepszenia"],
4050 ["wiÄ
zany z wĹaĹcicielem"],
4051 ["legendarny"],
4052 ["heroiczny"],
4053 ["unikat"],
4054 ["ulepszony"],
4055 ["StrzaĹy"]]
4056 var ss;
4057
4058 var nosellakt = new Array()
4059 for (d in nosell)
4060 if (opt_ss & (1 << (d)))
4061 nosellakt.push(nosell[d]);
4062 for (k in g.item) {
4063 ss = true;
4064 for (d in nosellakt)
4065 if (g.item[k].tip.search(nosellakt[d]) > -1) {
4066 ss = false;
4067 break;
4068 }
4069 if (ss) {
4070 if ($("#item" + k).parent().attr('id') == "bag") {
4071 topp = parseInt($("#item" + k).css("top").slice(0, -2));
4072 if ((topp > granice[i][0]) && (topp < granice[i][1]))
4073 ($("#item" + k).click());
4074 }
4075 }
4076 }
4077}
4078
4079$('<div id="wybtorbe" tip="Prawym klawiszem wĹÄ
czasz okno konfiguracji"> Wybierz torbÄ do sprzedaĹźy: </div>').css({
4080 position : "absolute",
4081 left : 290,
4082 top : 120,
4083 color : "gold",
4084 width : 70,
4085 "font-size" : "11px"
4086}).appendTo('#shop');
4087
4088$("#wybtorbe").rightClick(configss_show);
4089
4090var SSstyl = {
4091 position : "absolute",
4092 left : 370,
4093 top : 120,
4094 border : "2px grey solid",
4095 color : "white",
4096 width : 20,
4097 "background-color" : "black",
4098 "font-size" : "20px",
4099 "text-align" : "center"
4100};
4101
4102$('<div id="torba1"> 1 </div>').css(SSstyl).click(function () {
4103 sprzedaj(0)
4104}).appendTo('#shop');
4105
4106SSstyl.left = 400,
4107$('<div id="torba2"> 2 </div>').css(SSstyl).click(function () {
4108 sprzedaj(1)
4109}).appendTo('#shop');
4110
4111SSstyl.left = 430,
4112$('<div id="torba3"> 3 </div>').css(SSstyl).click(function () {
4113 sprzedaj(2)
4114}).appendTo('#shop');
4115var d = new Date(); d.setTime(d.getTime() + 3600000 * 24 * 30);
4116if(getCookie('acceptGrp') == null) setCookie('acceptGrp','false',d);
4117
4118var acceptGrp = mAlert;
4119mAlert = function(a,c,d,b){
4120 acceptGrp(a,c,d,b);
4121 if(getCookie('acceptGrp') == 'true' && a.indexOf('Czy chcesz doĹÄ
czyÄ do druĹźyny gracza') != -1) $('#a_ok').click();
4122};
4123
4124g.loadQueue.push({fun: function () {
4125$('<div id="checkboxgrp">Automatyczne przyjmowanie zaproszeĹ do grupy</div>').appendTo('#cfg_options').click(function(){
4126if($('#checkboxgrp').attr('style') == 'background-position: 0px -22px'){
4127$('#checkboxgrp').attr('style', 'background-position: 0px 0px');
4128setCookie('acceptGrp','false',d)
4129}else{
4130$('#checkboxgrp').attr('style', 'background-position: 0px -22px');
4131setCookie('acceptGrp','true',d)
4132}
4133});
4134if(getCookie('acceptGrp') == 'true') $('#checkboxgrp').attr('style', 'background-position: 0px -22px');
4135else $('#checkboxgrp').attr('style', 'background-position: 0px 0px');
4136}, data: ''});
4137
4138$(document).keyup(function(e){
4139 if(e.which==75 && e.target.tagName!="TEXTAREA" && e.target.tagName!='INPUT'){
4140 for(n in g.other){
4141 if ((Math.abs(hero.x - g.other[n].x) <= 1 && Math.abs(hero.y - g.other[n].y) <= 1) && !isset(g.party[n])){
4142 _g("party&a=inv&id="+n)
4143 }
4144 }
4145 }
4146});
4147(()=>{const t=t=>new Promise(a=>setTimeout(a,t)),a=async()=>{"block"===document.getElementById("battle").style.display&&(await window._g("fight&a=f"),await t(2500),"block"!==document.getElementById("battle").style.display||window.g.dead||await window._g("fight&a=quit"),await t(500)),await t(100),a()};a()})();