Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class mBot {
- constructor(mMobs, mMaps, mRoad, mVisited, mE, mTpMap, mTp) {
- this.mMaps = mMaps.split(";");
- this.mMobs = mMobs.split(";");
- this.mRoad = mRoad.split(";");
- this.mE = mE;
- this.mTpMap = mTpMap;
- this.mTp = mTp;
- this.mSumMaps = this.mMaps.concat(this.mRoad);
- this.mMobToKill = false;
- this.mVisited = JSON.parse(mVisited);
- this.mProperMobs = [];
- this.mTime = false;
- this.mCommonGw = [];
- this.mIgnored = [];
- if (localStorage.getItem('mMode') == "true" && this.mE[this.mMobs[0]]) {
- this.mImg = new Image();
- this.mImg.src = "/obrazki/npc/" + this.mE[this.mMobs[0]];
- }
- document.getElementById("battleclose").addEventListener("click", () => {
- setTimeout(() => {
- this.mIgnored = [];
- this.mMobToKill = false;
- return this.mMain();
- }, 500);
- })
- }
- mMain() {
- document.getElementById("base").click();
- this.findMobs();
- if (g.dead) {
- setTimeout(() => { return this.mMain(); }, 100)
- }
- else if (this.mProperMobs.length == 0) {
- if (g.init == 5 && !this.mMobToKill) {
- if (this.mCommonGw.length == 0) {
- if (map.id.toString() == this.mTpMap) {
- for (let i in g.item) {
- if (g.item[i].name == this.mTp && g.item[i].readyToAction && g.item[i].loc == "g") {
- return $(`#item${g.item[i].id}`).dblclick()
- }
- }
- }
- if (this.mMaps.indexOf(map.id.toString()) == -1) {
- Object.keys(g.gwIds).forEach((e) => {
- if (this.mSumMaps.indexOf(e) != -1) {
- this.mCommonGw.push(e);
- }
- });
- } else {
- Object.keys(g.gwIds).forEach((e) => {
- if (this.mSumMaps.indexOf(e) != -1 && this.mRoad.indexOf(e) == -1) {
- this.mCommonGw.push(e);
- }
- });
- this.mVisited[map.id] = true;
- this.mCommonGw.forEach((e, i) => {
- if (this.mVisited[e]) {
- this.mCommonGw[i] = null;
- }
- })
- if (this.mCommonGw.filter((e) => { return e != null }).length == 0) {
- this.mCommonGw = [];
- Object.keys(g.gwIds).forEach((e) => {
- if (this.mSumMaps.indexOf(e) != -1 && this.mRoad.indexOf(e) == -1) {
- this.mCommonGw.push(e);
- }
- });
- this.mCommonGw.forEach((e) => {
- this.mVisited[e] = false;
- })
- }
- localStorage.setItem('mMapsVisited', JSON.stringify(this.mVisited));
- }
- }
- for (let i = 0; i < this.mCommonGw.length; ++i) {
- if (g.gwIds[this.mCommonGw[i]] && (g.gwIds[this.mCommonGw[i]] != hero.x + "." + hero.y || this.mCommonGw.length == 1) && hero.isMoving == 4) {
- let idm = g.gwIds[this.mCommonGw[i]];
- idm = idm.split(".");
- if (hero.x == idm[0] && hero.y == idm[1]) {
- return _g("walk")
- }
- for (let a = 0; a < g.npc.length; ++a) {
- if (g.npc[a] && Math.abs(hero.x - g.npc[a].x) <= 1 && Math.abs(hero.y - g.npc[a].y) <= 1 && (g.npc[a].type == 2 || g.npc[a].type == 3) && !g.battle && hero.isMoving == 4) {
- return _g("fight&a=attack&ff=1&id=-" + g.npc[a].id);
- }
- }
- if (!g.battle) {
- hero.mSearchPath(parseInt(idm[0]), parseInt(idm[1]));
- }
- }
- else if (g.gwIds[this.mCommonGw[i]] == hero.x + "." + hero.y && this.mCommonGw.length > 1 && hero.isMoving == 4) {
- this.mCommonGw[i] = null;
- }
- }
- setTimeout(() => {
- return this.mMain();
- }, 500);
- } else if (!this.mMobToKill) {
- setTimeout(() => {
- return this.mMain();
- }, 500);
- }
- } else {
- this.findMob();
- }
- }
- findMobs() {
- this.mClosestMob = false;
- this.mProperMobs = [];
- this.mProperMobs = g.npc.filter((e) => {
- if (this.mMobs.indexOf(e.nick) != -1 && this.mIgnored.indexOf(e) == -1 && (e.type == 2 || e.type == 3)) {
- if (localStorage.getItem('mMode') == "true") {
- let mImgT = new Image();
- mImgT.src = e.icon;
- if (mBot.getBase64Image(this.mImg) == mBot.getBase64Image(mImgT)) {
- this.mClosestMob = e;
- return e;
- }
- } else {
- if (!this.mClosestMob || hero.mSearchPathClosest(e.x, e.y) < hero.mSearchPathClosest(this.mClosestMob.x, this.mClosestMob.y)) {
- this.mClosestMob = e;
- }
- return e;
- }
- }
- })
- }
- findMob() {
- this.mMobToKill = this.mClosestMob;
- this.mTime = Date.now();
- hero.mSearchPath(this.mMobToKill.x, this.mMobToKill.y)
- return this.attackMob();
- }
- attackMob() {
- if (hero.x == this.mMobToKill.x && hero.y == this.mMobToKill.y) {
- return this.mMain();
- }
- else if (Math.abs(hero.x - this.mMobToKill.x) <= 1 && Math.abs(hero.y - this.mMobToKill.y) <= 1 && hero.isMoving == 4) {
- setTimeout(() => {
- if (hero.isMoving == 4 && !g.battle) {
- this.mMobToKill = false;
- return this.mMain();
- }
- }, 1000)
- return _g("fight&a=attack&ff=1&id=-" + this.mMobToKill.id);
- }
- else if (Date.now() - this.mTime > 2000 && hero.isMoving == 4) {
- for (let i = 0; i < g.npc.length; ++i) {
- if (g.npc[i] && Math.abs(hero.x - g.npc[i].x) <= 1 && Math.abs(hero.y - g.npc[i].y) <= 1 && (g.npc[i].type == 2 || g.npc[i].type == 3) && !g.battle && hero.isMoving == 4) {
- return _g("fight&a=attack&ff=1&id=-" + g.npc[i].id);
- } else if (i == g.npc.length - 1) {
- this.mIgnored.push(this.mMobToKill);
- this.mMobToKill = false;
- return this.mMain();
- }
- }
- }
- else {
- requestAnimationFrame(this.attackMob.bind(this));
- }
- }
- static getBase64Image(img) {
- let canvas = document.createElement("canvas");
- canvas.width = img.width;
- canvas.height = img.height;
- let ctx = canvas.getContext("2d");
- ctx.drawImage(img, 0, 0);
- let dataURL = canvas.toDataURL("image/png");
- return dataURL;
- }
- }
- const mMapId = document.createElement("DIV");
- mMapId.setAttribute("id", "m-map-id");
- mMapId.style.color = 'black';
- mMapId.style.backgroundColor = 'white';
- mMapId.style.width = "200px";
- mMapId.style.position = 'absolute';
- mMapId.style.left = "calc(50% - 100px)";
- mMapId.style.bottom = "50px";
- mMapId.style.padding = "2px";
- mMapId.style.textAlign = "center";
- mMapId.innerText = 'Kliknij, aby pozyskać id mapy.';
- mMapId.addEventListener('mousedown', () => {
- mMapId.innerText = map.id;
- })
- document.body.appendChild(mMapId);
- hero.mSearchPathBlocked = function (y, w) {
- if (this.isBlockedSearchPath()) { return this.blockedInfoSearchPath() }
- const x = []
- for (let q = 0; q < map.y; q++) {
- x[q] = [];
- for (let p = 0; p < map.x; p++) {
- x[q][p] = (!isset(g.npccol[p + q * 256]) && (!map.col || map.col.charAt(p + q * map.x) == "0")) ? -1 : -2;
- }
- }
- const end = { x: y, y: w };
- var isMob = false;
- x[hero.y][hero.x] = 'S';
- if (x[end.y][end.x] == -2) {
- x[end.y][end.x] = -1;
- isMob = true;
- }
- g.npc.forEach((e) => {
- if (e.type == 2 || e.type == 3) {
- x[e.y][e.x] = -1;
- }
- });
- class sP {
- constructor(a, b, n) {
- this.a = a;
- this.b = b;
- this.n = n;
- this.r = [];
- this.r.push({ x: this.b, y: this.a });
- }
- nP() {
- let tempR = [];
- for (let i in this.r) {
- if (x[this.r[i].y - 1] && x[this.r[i].y - 1][this.r[i].x] && x[this.r[i].y - 1][this.r[i].x] == -1) {
- x[this.r[i].y - 1][this.r[i].x] = this.n;
- tempR.push({ x: this.r[i].x, y: this.r[i].y - 1 });
- if (this.r[i].y - 1 == end.y && this.r[i].x == end.x) {
- this.r = [{ x: this.r[i].x, y: this.r[i].y - 1 }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y] && x[this.r[i].y][this.r[i].x + 1] && x[this.r[i].y][this.r[i].x + 1] == -1) {
- x[this.r[i].y][this.r[i].x + 1] = this.n;
- tempR.push({ x: this.r[i].x + 1, y: this.r[i].y });
- if (this.r[i].y == end.y && this.r[i].x + 1 == end.x) {
- this.r = [{ x: this.r[i].x + 1, y: this.r[i].y }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y + 1] && x[this.r[i].y + 1][this.r[i].x] && x[this.r[i].y + 1][this.r[i].x] == -1) {
- x[this.r[i].y + 1][this.r[i].x] = this.n;
- tempR.push({ x: this.r[i].x, y: this.r[i].y + 1 });
- if (this.r[i].y + 1 == end.y && this.r[i].x == end.x) {
- this.r = [{ x: this.r[i].x, y: this.r[i].y + 1 }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y] && x[this.r[i].y][this.r[i].x - 1] && x[this.r[i].y][this.r[i].x - 1] == -1) {
- x[this.r[i].y][this.r[i].x - 1] = this.n;
- tempR.push({ x: this.r[i].x - 1, y: this.r[i].y });
- if (this.r[i].y == end.y && this.r[i].x - 1 == end.x) {
- this.r = [{ x: this.r[i].x - 1, y: this.r[i].y }];
- return this.gP(this.n - 1);
- }
- }
- }
- if (tempR.length == 0) {
- return false;
- }
- this.n += 1;
- this.r = tempR;
- return this.nP();
- }
- gP(n) {
- let wX = this.r[this.r.length - 1].x;
- let wY = this.r[this.r.length - 1].y;
- if (n > 0) {
- if (x[wY - 1] && x[wY - 1][wX] && x[wY - 1][wX] == n) {
- this.r.push({ x: wX, y: wY - 1 });
- }
- else if (x[wY] && x[wY][wX + 1] && x[wY][wX + 1] == n) {
- this.r.push({ x: wX + 1, y: wY });
- }
- else if (x[wY + 1] && x[wY + 1][wX] && x[wY + 1][wX] == n) {
- this.r.push({ x: wX, y: wY + 1 });
- }
- else if (x[wY] && x[wY][wX - 1] && x[wY][wX - 1] == n) {
- this.r.push({ x: wX - 1, y: wY });
- }
- if (g.npccol[this.r[this.r.length - 1].x + this.r[this.r.length - 1].y * 256]) {
- return hero.mSearchPath(this.r[this.r.length - 1].x, this.r[this.r.length - 1].y);
- }
- return this.gP(n - 1);
- } else {
- road = [];
- if (isMob) {
- this.r.shift();
- }
- return road = this.r;
- }
- }
- }
- return new sP(hero.y, hero.x, 1).nP();
- }
- hero.mSearchPath = function (y, w) {
- if (this.isBlockedSearchPath()) { return this.blockedInfoSearchPath() }
- const x = []
- for (let q = 0; q < map.y; q++) {
- x[q] = [];
- for (let p = 0; p < map.x; p++) {
- x[q][p] = (!isset(g.npccol[p + q * 256]) && (!map.col || map.col.charAt(p + q * map.x) == "0")) ? -1 : -2;
- }
- }
- const end = { x: y, y: w };
- var isMob = false;
- x[hero.y][hero.x] = 'S';
- if (x[end.y][end.x] == -2) {
- x[end.y][end.x] = -1;
- isMob = true;
- }
- class sP {
- constructor(a, b, n) {
- this.a = a;
- this.b = b;
- this.n = n;
- this.r = [];
- this.r.push({ x: this.b, y: this.a });
- }
- nP() {
- let tempR = [];
- for (let i in this.r) {
- if (x[this.r[i].y - 1] && x[this.r[i].y - 1][this.r[i].x] && x[this.r[i].y - 1][this.r[i].x] == -1) {
- x[this.r[i].y - 1][this.r[i].x] = this.n;
- tempR.push({ x: this.r[i].x, y: this.r[i].y - 1 });
- if (this.r[i].y - 1 == end.y && this.r[i].x == end.x) {
- this.r = [{ x: this.r[i].x, y: this.r[i].y - 1 }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y] && x[this.r[i].y][this.r[i].x + 1] && x[this.r[i].y][this.r[i].x + 1] == -1) {
- x[this.r[i].y][this.r[i].x + 1] = this.n;
- tempR.push({ x: this.r[i].x + 1, y: this.r[i].y });
- if (this.r[i].y == end.y && this.r[i].x + 1 == end.x) {
- this.r = [{ x: this.r[i].x + 1, y: this.r[i].y }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y + 1] && x[this.r[i].y + 1][this.r[i].x] && x[this.r[i].y + 1][this.r[i].x] == -1) {
- x[this.r[i].y + 1][this.r[i].x] = this.n;
- tempR.push({ x: this.r[i].x, y: this.r[i].y + 1 });
- if (this.r[i].y + 1 == end.y && this.r[i].x == end.x) {
- this.r = [{ x: this.r[i].x, y: this.r[i].y + 1 }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y] && x[this.r[i].y][this.r[i].x - 1] && x[this.r[i].y][this.r[i].x - 1] == -1) {
- x[this.r[i].y][this.r[i].x - 1] = this.n;
- tempR.push({ x: this.r[i].x - 1, y: this.r[i].y });
- if (this.r[i].y == end.y && this.r[i].x - 1 == end.x) {
- this.r = [{ x: this.r[i].x - 1, y: this.r[i].y }];
- return this.gP(this.n - 1);
- }
- }
- }
- if (tempR.length == 0) {
- return hero.mSearchPathBlocked(end.x, end.y);
- }
- this.n += 1;
- this.r = tempR;
- return this.nP();
- }
- gP(n) {
- let wX = this.r[this.r.length - 1].x;
- let wY = this.r[this.r.length - 1].y;
- if (n > 0) {
- if (x[wY - 1] && x[wY - 1][wX] && x[wY - 1][wX] == n) {
- this.r.push({ x: wX, y: wY - 1 });
- return this.gP(n - 1);
- }
- else if (x[wY] && x[wY][wX + 1] && x[wY][wX + 1] == n) {
- this.r.push({ x: wX + 1, y: wY });
- return this.gP(n - 1);
- }
- else if (x[wY + 1] && x[wY + 1][wX] && x[wY + 1][wX] == n) {
- this.r.push({ x: wX, y: wY + 1 });
- return this.gP(n - 1);
- }
- else if (x[wY] && x[wY][wX - 1] && x[wY][wX - 1] == n) {
- this.r.push({ x: wX - 1, y: wY });
- return this.gP(n - 1);
- }
- } else {
- road = [];
- if (isMob) {
- this.r.shift();
- }
- road = this.r;
- }
- }
- }
- new sP(hero.y, hero.x, 1).nP();
- }
- hero.mSearchPathClosest = function (y, w) {
- if (this.isBlockedSearchPath()) { return this.blockedInfoSearchPath() }
- const x = []
- for (let q = 0; q < map.y; q++) {
- x[q] = [];
- for (let p = 0; p < map.x; p++) {
- x[q][p] = (!isset(g.npccol[p + q * 256]) && (!map.col || map.col.charAt(p + q * map.x) == "0")) ? -1 : -2;
- }
- }
- const end = { x: y, y: w };
- var isMob = false;
- x[hero.y][hero.x] = 'S';
- if (x[end.y][end.x] == -2) {
- x[end.y][end.x] = -1;
- isMob = true;
- }
- class sP {
- constructor(a, b, n) {
- this.a = a;
- this.b = b;
- this.n = n;
- this.r = [];
- this.r.push({ x: this.b, y: this.a });
- }
- nP() {
- let tempR = [];
- for (let i in this.r) {
- if (x[this.r[i].y - 1] && x[this.r[i].y - 1][this.r[i].x] && x[this.r[i].y - 1][this.r[i].x] == -1) {
- x[this.r[i].y - 1][this.r[i].x] = this.n;
- tempR.push({ x: this.r[i].x, y: this.r[i].y - 1 });
- if (this.r[i].y - 1 == end.y && this.r[i].x == end.x) {
- this.r = [{ x: this.r[i].x, y: this.r[i].y - 1 }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y] && x[this.r[i].y][this.r[i].x + 1] && x[this.r[i].y][this.r[i].x + 1] == -1) {
- x[this.r[i].y][this.r[i].x + 1] = this.n;
- tempR.push({ x: this.r[i].x + 1, y: this.r[i].y });
- if (this.r[i].y == end.y && this.r[i].x + 1 == end.x) {
- this.r = [{ x: this.r[i].x + 1, y: this.r[i].y }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y + 1] && x[this.r[i].y + 1][this.r[i].x] && x[this.r[i].y + 1][this.r[i].x] == -1) {
- x[this.r[i].y + 1][this.r[i].x] = this.n;
- tempR.push({ x: this.r[i].x, y: this.r[i].y + 1 });
- if (this.r[i].y + 1 == end.y && this.r[i].x == end.x) {
- this.r = [{ x: this.r[i].x, y: this.r[i].y + 1 }];
- return this.gP(this.n - 1);
- }
- }
- if (x[this.r[i].y] && x[this.r[i].y][this.r[i].x - 1] && x[this.r[i].y][this.r[i].x - 1] == -1) {
- x[this.r[i].y][this.r[i].x - 1] = this.n;
- tempR.push({ x: this.r[i].x - 1, y: this.r[i].y });
- if (this.r[i].y == end.y && this.r[i].x - 1 == end.x) {
- this.r = [{ x: this.r[i].x - 1, y: this.r[i].y }];
- return this.gP(this.n - 1);
- }
- }
- }
- if (tempR.length == 0) {
- return hero.mSearchPathBlocked(end.x, end.y);
- }
- this.n += 1;
- this.r = tempR;
- return this.nP();
- }
- gP(n) {
- let wX = this.r[this.r.length - 1].x;
- let wY = this.r[this.r.length - 1].y;
- if (n > 0) {
- if (x[wY - 1] && x[wY - 1][wX] && x[wY - 1][wX] == n) {
- this.r.push({ x: wX, y: wY - 1 });
- return this.gP(n - 1);
- }
- else if (x[wY] && x[wY][wX + 1] && x[wY][wX + 1] == n) {
- this.r.push({ x: wX + 1, y: wY });
- return this.gP(n - 1);
- }
- else if (x[wY + 1] && x[wY + 1][wX] && x[wY + 1][wX] == n) {
- this.r.push({ x: wX, y: wY + 1 });
- return this.gP(n - 1);
- }
- else if (x[wY] && x[wY][wX - 1] && x[wY][wX - 1] == n) {
- this.r.push({ x: wX - 1, y: wY });
- return this.gP(n - 1);
- }
- } else {
- if (isMob) {
- this.r.shift();
- }
- return this.r.length;
- }
- }
- }
- return new sP(hero.y, hero.x, 1).nP();
- }
- const mE = {
- 'Ranna Mushita': 'pot/st-puma.gif',
- 'Mushita': 'pot/st-puma.gif',
- 'Shae Phu': 'pot/demonszef.gif',
- 'Władca rzek': 'hum/gobmag2.gif',
- 'Gobbos': 'hum/gobsamurai.gif',
- 'Szczęt alias Gładki': 'woj/rozb04.gif',
- 'Razuglag Oklash': 'hum/praork_mag.gif',
- 'Tarmus Wuden': 'hum/klan_tarmus.gif',
- 'Foverk Turrim': 'hum/kobold07.gif',
- 'Vari Kruger': 'hum/gnoll11.gif',
- 'Furruk Kozug': 'hum/gnoll12.gif',
- 'Tollok Atamatu': 'hum/tollok-c-boss.gif',
- 'Tollok Utumutu': 'hum/tollok-c-boss.gif',
- 'Goplana': 'hum/rusalka.gif',
- 'Wyznawca ciemnych mocy': 'hum/mnich04.gif',
- 'Mazurnik Przybrzeżny': 'hum/wodnik03.gif',
- 'Łowca czaszek': 'hum/umarlak4.gif',
- 'Grabarz świątynny': 'hum/magaz-grabarz.gif',
- 'Podły zbrojmistrz': 'hum/magaz-zbrojmistrz.gif',
- 'Szkielet władcy żywiołów': 'pot/szkiel05.gif',
- 'Nieumarły krzyżowiec': 'pot/el_szkielet.gif',
- 'Morthen': 'hum/krasnolud_boss.gif',
- 'Żelazoręki Ohydziarz': 'pot/ugrape2.gif',
- 'Miłośnik rycerzy': 'hum/ogr2.gif',
- 'Miłośnik łowców': 'hum/ogr3.gif',
- 'Miłośnik magii': 'hum/ogr1.gif',
- 'Młody Jack Truciciel': 'woj/pirat01.gif',
- 'Wójt Fistuła': 'woj/goral05.gif',
- 'Królowa Śniegu': 'hum/ice_queen.gif',
- 'Krab pustelnik': 'pot/krab_big3.gif',
- 'Teściowa Rumcajsa': 'woj/goral08.gif',
- 'Pogromca Gryfów': 'hum/zagajnik01.gif',
- 'Pogromczyni Mantikor': 'hum/zagajnik03.gif',
- 'Poskramiacz Hydr': 'hum/zagajnik02.gif',
- 'Burkog Lorulk': 'hum/orkczd.gif',
- 'Jertek Moxos': 'hum/molochelita02n.gif',
- 'Berserker Amuno': 'hum/amuno.gif',
- 'Stworzyciel': 'pot/stworzyciel.gif',
- 'Fodug Zolash': 'hum/fodug_zolash.gif',
- 'Mistrz Worundriel': 'hum/worundriel02.gif',
- 'Goons Asterus': 'hum/mechgoblin4.gif',
- 'Adariel': 'kob/tri-adariel.gif',
- 'Duch Władcy Klanów': 'hum/praork_duch1.gif',
- 'Ogr Stalowy Pazur': 'pot/ogr_drapak.gif',
- 'Fursharag pożeracz umysłów': 'hum/praork_mag_elita.gif',
- 'Ziuggrael strażnik królowej': 'hum/praork_woj_elita.gif',
- 'Bragarth myśliwy dusz': 'hum/praork_low_elita.gif',
- 'Lusgrathera Królowa Pramatka': 'hum/prakrolowa.gif',
- 'Borgoros Garamir III': 'hum/minotaur-elita.gif',
- 'Chryzoprenia': 'hum/driada04.gif',
- 'Czempion Furboli': 'hum/forbol03.gif',
- 'Torunia Ankelwald': 'hum/thuz-patr01.gif',
- 'Breheret Żelazny Łeb': 'hum/barbarzynca06.gif',
- 'Mysiur Myświórowy Król': 'hum/krolszczur.gif',
- 'Sadolia Nadzorczyni Hurys': 'hum/dziewica_nadzor.gif',
- 'Bergermona Krwawa Hrabina': 'hum/sekta_m_tortur_e2.gif',
- 'Annaniel Wysysacz Marzeń': 'hum/sekta_mag_e2.gif',
- 'Sataniel Skrytobójca': 'hum/sekta_zabojca_e2.gif',
- 'Gothardus Kolekcjoner głów': 'hum/sekta_pal_e2.gif',
- 'Marlloth Malignitas': 'pot/marlloth.gif',
- 'Zufulus Smakosz Serc': 'hum/sekta_wyr_serc.gif',
- 'Arachniregina Colosseus': 'pot/regina-e2.gif',
- 'Mocny Maddoks': 'hum/maddok5.gif',
- 'Pancerny Maddok': 'pot/maddok_roz.gif',
- 'Silvanasus': 'pot/silvanasus.gif',
- 'Dendroculus': 'pot/dendroculus.gif',
- 'Cuaitl Citlalin': 'hum/mahop04.gif',
- 'Quetzalcoatl': 'pot/quetzalcoatl.gif',
- 'Neferkar Set': 'pot/szkiel_set.gif',
- 'Vaenra Charkhaam': 'hum/bar_smoczyca.gif',
- 'Chaegd Agnrakh': 'hum/bar_smokoszef.gif',
- 'Nymphemonia': 'hum/driada5.gif',
- 'Furion': 'pot/wl-mrozu02.gif',
- 'Zorin': 'pot/wl-mrozu01.gif',
- 'Artenius': 'pot/wl-mrozu03.gif',
- }
- function log() { var b = ""; var a = false; if (arguments.length > 1) { location.reload(); switch (parseInt(arguments[1])) { case 1: b = "Warning: "; if (hero.uprawnienia == 0 && arguments[0].match(/Pakiet odrzucony, poprzednie/)) { a = true } break; case 2: b = "Error: "; break; case 3: a = true; b = "Fatal error: "; $("#console").show(); break; default: b = "Unknow: " } } if (arguments.length > 2 && arguments[2]) { b = "" } $("#contxt").append("<DIV" + (arguments.length > 1 ? (" class=loglvl_" + arguments[1]) : "") + ">" + b + arguments[0] + "</DIV>").scrollTop(999999); if (b != "" && !a) { $("#warn").fadeIn() } } function consoleParse(cmnd) { if (cmnd.substr(0, 1) == ".") { return _g("console&custom=" + cmnd) } var c = cmnd.split(" "); cmd = c[0]; c[0] = ""; var par = c.join(" ").substr(1); var gm_cmd = ["tp", "loc", "nloc", "noclip"]; switch (cmd) { case "ver": log("Margonem MMORPG ver 2.0"); break; case "about": log("Margonem MMORPG (c) by Thinker 2005-2009 [www.margonem.pl, [email protected]]"); break; case "cls": $("#contxt").empty(); break; case "dump": log("<b>Dumping variable " + par + "</b><br>" + dump(eval(par))); break; case "show": $("#" + par).show(); if (par == "battle") { g.lock.add("battle") } break; case "hide": $("#" + par).hide(); break; case "stop": stopEngine(); break; case "ff": _g("fight&a=f"); break; case "fb": _g("fight&a=break"); break; case "group": log(sound.manager.getActiveGroup()); break; case "equip": var l = location.host.split("."), w = l[0]; if (w.indexOf("game") == 0) { w = w.substr(4) } if (isset(g.worldname)) { w = g.worldname } for (var k in g.item) { if (g.item[k].loc == "g") { log(g.item[k].name + " ITEM#" + g.item[k].hid + "." + w) } } break; case "addon": if (par.length < 5) { break } if (!par.match(/^https?:\/\/.+\..+/)) { log('Wrong addon url, missing "http://" prefix', 1); break } par = par.replace(/\s/g, ""); if (g.addons.indexOf(par) >= 0) { log("This addon is installed already"); break } g.addons.push(par); var d = new Date(); d.setTime(d.getTime() + 3600000 * 24 * 30); setCookie("addons", g.addons.join(" "), d); log("Script " + par + " added succesfully."); break; case "adreset": g.addons = []; setCookie("addons", "", 0); setCookie("__mExts", "", 0); log("Addons cleared."); break; case "gadblock": var d = new Date(); var val = par == "off" ? 0 : 1; d.setTime(d.getTime() + 3600000 * 24 * 30); setCookie("__nga", val, d); if (val == 1) { log("Global addon blocked ('gadblock off' to unblock)") } else { log("Global addon unblocked ('gadblock on' to block)") } break; case "tp": _g("gm&a=teleport&target=" + par); break; case "loc": _g("gm&a=locate&who=" + par); break; case "nloc": _g("gm&a=npclocate&who=" + par); break; case "noclip": g.npccol = []; map.col = ""; break; case "outfit": var _img = new Image(); par = (par.indexOf("http:") < 0 && par.indexOf("file:///") < 0 ? ("file:///" + par.replace(/\\/g, "/")) : par); _img.src = par; log("outfit " + par); _img.onload = function () { hero.fw = this.width / 4; hero.fh = this.height / 4; $("#hero").css("background-image", "url(" + par + ")"); log("Outfit loaded") }; _img.onerror = function () { log("Error while loading outfit file.", 2) }; break; case "respnpc": _g("gm&a=respnpc"); break; case "": break; default: log("<i>> " + cmnd.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """) + "</i>"); try { eval(cmnd) } catch (e) { log(e, 2, true) } break } } function dump(a, h) { var f = ""; if (!h) { h = 0 } if (h > 3) { return "" } var e = ""; for (var b = 0; b < h + 1; b++) { e += " " } if (typeof (a) == "object") { for (var c in a) { var d = a[c]; if (typeof (d) == "object") { f += e + "'" + c + "' :<BR>"; f += dump(d, h + 1) } else { if (typeof (d) == "undefined") { f += e + "'" + c + '\' => "undefinied"<BR>' } else { f += e + "'" + c + "' => \"" + d.toString().replace(/</g, "<") + '"<BR>' } } } } else { f = "===>" + a + "<===(" + typeof (a) + ")" } return f };
- const tmpMAlert = mAlert;
- mAlert = function (a, c, d, b) {
- if (localStorage.getItem('mState') != "true") {
- return tmpMAlert(a, c, d, b);
- }
- }
- const tmpBattleMsg = battleMsg;
- battleMsg = function (c, t) {
- const ret = tmpBattleMsg(c, t);
- if (c.search(/winner=/) >= 0 && localStorage.getItem('mState') == "true") {
- $("#battleclose").click();
- }
- else if (c.search(/Rozpoczęła się walka pomiędzy/) >= 0 && localStorage.getItem('mState') == "true") {
- $("#autobattleButton").click();
- }
- return ret;
- }
- if (!localStorage.getItem('mDisable2.7')) {
- localStorage.setItem('mDisable2.7', Date.now());
- }
- if (localStorage.getItem('mDisable2.7') && localStorage.getItem('mState') == "true") {
- if (Date.now() - parseInt(localStorage.getItem('mDisable2.7')) >= 43200000) {
- hero.mSearchPath = function (x, y) {
- }
- alert('Koniec wersji demo.');
- } else {
- const mBotObj = new mBot(localStorage.getItem('mMobs'), localStorage.getItem('mMaps'), localStorage.getItem('mRoad'), localStorage.getItem('mMapsVisited'), mE, localStorage.getItem('mTpMap'), localStorage.getItem('mTp'));
- mBotObj.mMain();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement