Advertisement
Guest User

Untitled

a guest
Jul 10th, 2018
1,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.36 KB | None | 0 0
  1. class mBot {
  2. constructor(mMobs, mMaps, mRoad, mVisited, mE, mTpMap, mTp) {
  3. this.mMaps = mMaps.split(";");
  4. this.mMobs = mMobs.split(";");
  5. this.mRoad = mRoad.split(";");
  6. this.mE = mE;
  7. this.mTpMap = mTpMap;
  8. this.mTp = mTp;
  9. this.mSumMaps = this.mMaps.concat(this.mRoad);
  10. this.mMobToKill = false;
  11. this.mVisited = JSON.parse(mVisited);
  12. this.mProperMobs = [];
  13. this.mTime = false;
  14. this.mCommonGw = [];
  15. this.mIgnored = [];
  16. if (localStorage.getItem('mMode') == "true" && this.mE[this.mMobs[0]]) {
  17. this.mImg = new Image();
  18. this.mImg.src = "/obrazki/npc/" + this.mE[this.mMobs[0]];
  19. }
  20. document.getElementById("battleclose").addEventListener("click", () => {
  21. setTimeout(() => {
  22. this.mIgnored = [];
  23. this.mMobToKill = false;
  24. return this.mMain();
  25. }, 500);
  26. })
  27. }
  28.  
  29. mMain() {
  30. document.getElementById("base").click();
  31. this.findMobs();
  32. if (g.dead) {
  33. setTimeout(() => { return this.mMain(); }, 100)
  34. }
  35. else if (this.mProperMobs.length == 0) {
  36. if (g.init == 5 && !this.mMobToKill) {
  37. if (this.mCommonGw.length == 0) {
  38. if (map.id.toString() == this.mTpMap) {
  39. for (let i in g.item) {
  40. if (g.item[i].name == this.mTp && g.item[i].readyToAction && g.item[i].loc == "g") {
  41. return $(`#item${g.item[i].id}`).dblclick()
  42. }
  43. }
  44.  
  45. }
  46. if (this.mMaps.indexOf(map.id.toString()) == -1) {
  47. Object.keys(g.gwIds).forEach((e) => {
  48. if (this.mSumMaps.indexOf(e) != -1) {
  49. this.mCommonGw.push(e);
  50. }
  51. });
  52. } else {
  53. Object.keys(g.gwIds).forEach((e) => {
  54. if (this.mSumMaps.indexOf(e) != -1 && this.mRoad.indexOf(e) == -1) {
  55. this.mCommonGw.push(e);
  56. }
  57. });
  58. this.mVisited[map.id] = true;
  59. this.mCommonGw.forEach((e, i) => {
  60. if (this.mVisited[e]) {
  61. this.mCommonGw[i] = null;
  62. }
  63.  
  64. })
  65. if (this.mCommonGw.filter((e) => { return e != null }).length == 0) {
  66. this.mCommonGw = [];
  67. Object.keys(g.gwIds).forEach((e) => {
  68. if (this.mSumMaps.indexOf(e) != -1 && this.mRoad.indexOf(e) == -1) {
  69. this.mCommonGw.push(e);
  70. }
  71. });
  72. this.mCommonGw.forEach((e) => {
  73. this.mVisited[e] = false;
  74. })
  75. }
  76. localStorage.setItem('mMapsVisited', JSON.stringify(this.mVisited));
  77. }
  78. }
  79.  
  80.  
  81. for (let i = 0; i < this.mCommonGw.length; ++i) {
  82. if (g.gwIds[this.mCommonGw[i]] && (g.gwIds[this.mCommonGw[i]] != hero.x + "." + hero.y || this.mCommonGw.length == 1) && hero.isMoving == 4) {
  83. let idm = g.gwIds[this.mCommonGw[i]];
  84. idm = idm.split(".");
  85. if (hero.x == idm[0] && hero.y == idm[1]) {
  86. return _g("walk")
  87. }
  88. for (let a = 0; a < g.npc.length; ++a) {
  89. 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) {
  90. return _g("fight&a=attack&ff=1&id=-" + g.npc[a].id);
  91. }
  92. }
  93. if (!g.battle) {
  94. hero.mSearchPath(parseInt(idm[0]), parseInt(idm[1]));
  95. }
  96.  
  97. }
  98. else if (g.gwIds[this.mCommonGw[i]] == hero.x + "." + hero.y && this.mCommonGw.length > 1 && hero.isMoving == 4) {
  99. this.mCommonGw[i] = null;
  100. }
  101.  
  102. }
  103. setTimeout(() => {
  104. return this.mMain();
  105. }, 500);
  106. } else if (!this.mMobToKill) {
  107. setTimeout(() => {
  108. return this.mMain();
  109. }, 500);
  110. }
  111.  
  112. } else {
  113. this.findMob();
  114. }
  115. }
  116.  
  117. findMobs() {
  118. this.mClosestMob = false;
  119. this.mProperMobs = [];
  120. this.mProperMobs = g.npc.filter((e) => {
  121. if (this.mMobs.indexOf(e.nick) != -1 && this.mIgnored.indexOf(e) == -1 && (e.type == 2 || e.type == 3)) {
  122. if (localStorage.getItem('mMode') == "true") {
  123. let mImgT = new Image();
  124. mImgT.src = e.icon;
  125. if (mBot.getBase64Image(this.mImg) == mBot.getBase64Image(mImgT)) {
  126. this.mClosestMob = e;
  127. return e;
  128. }
  129. } else {
  130. if (!this.mClosestMob || hero.mSearchPathClosest(e.x, e.y) < hero.mSearchPathClosest(this.mClosestMob.x, this.mClosestMob.y)) {
  131. this.mClosestMob = e;
  132. }
  133. return e;
  134. }
  135. }
  136. })
  137. }
  138.  
  139. findMob() {
  140. this.mMobToKill = this.mClosestMob;
  141. this.mTime = Date.now();
  142. hero.mSearchPath(this.mMobToKill.x, this.mMobToKill.y)
  143. return this.attackMob();
  144. }
  145.  
  146. attackMob() {
  147. if (hero.x == this.mMobToKill.x && hero.y == this.mMobToKill.y) {
  148. return this.mMain();
  149. }
  150. else if (Math.abs(hero.x - this.mMobToKill.x) <= 1 && Math.abs(hero.y - this.mMobToKill.y) <= 1 && hero.isMoving == 4) {
  151. setTimeout(() => {
  152. if (hero.isMoving == 4 && !g.battle) {
  153. this.mMobToKill = false;
  154. return this.mMain();
  155. }
  156. }, 1000)
  157. return _g("fight&a=attack&ff=1&id=-" + this.mMobToKill.id);
  158. }
  159. else if (Date.now() - this.mTime > 2000 && hero.isMoving == 4) {
  160. for (let i = 0; i < g.npc.length; ++i) {
  161. 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) {
  162. return _g("fight&a=attack&ff=1&id=-" + g.npc[i].id);
  163. } else if (i == g.npc.length - 1) {
  164. this.mIgnored.push(this.mMobToKill);
  165. this.mMobToKill = false;
  166. return this.mMain();
  167. }
  168. }
  169. }
  170. else {
  171. requestAnimationFrame(this.attackMob.bind(this));
  172. }
  173. }
  174.  
  175. static getBase64Image(img) {
  176. let canvas = document.createElement("canvas");
  177. canvas.width = img.width;
  178. canvas.height = img.height;
  179. let ctx = canvas.getContext("2d");
  180. ctx.drawImage(img, 0, 0);
  181. let dataURL = canvas.toDataURL("image/png");
  182. return dataURL;
  183. }
  184. }
  185. const mMapId = document.createElement("DIV");
  186. mMapId.setAttribute("id", "m-map-id");
  187. mMapId.style.color = 'black';
  188. mMapId.style.backgroundColor = 'white';
  189. mMapId.style.width = "200px";
  190. mMapId.style.position = 'absolute';
  191. mMapId.style.left = "calc(50% - 100px)";
  192. mMapId.style.bottom = "50px";
  193. mMapId.style.padding = "2px";
  194. mMapId.style.textAlign = "center";
  195. mMapId.innerText = 'Kliknij, aby pozyskać id mapy.';
  196. mMapId.addEventListener('mousedown', () => {
  197. mMapId.innerText = map.id;
  198. })
  199. document.body.appendChild(mMapId);
  200.  
  201. hero.mSearchPathBlocked = function (y, w) {
  202. if (this.isBlockedSearchPath()) { return this.blockedInfoSearchPath() }
  203. const x = []
  204.  
  205. for (let q = 0; q < map.y; q++) {
  206. x[q] = [];
  207. for (let p = 0; p < map.x; p++) {
  208. x[q][p] = (!isset(g.npccol[p + q * 256]) && (!map.col || map.col.charAt(p + q * map.x) == "0")) ? -1 : -2;
  209. }
  210. }
  211. const end = { x: y, y: w };
  212. var isMob = false;
  213. x[hero.y][hero.x] = 'S';
  214. if (x[end.y][end.x] == -2) {
  215. x[end.y][end.x] = -1;
  216. isMob = true;
  217. }
  218.  
  219. g.npc.forEach((e) => {
  220. if (e.type == 2 || e.type == 3) {
  221. x[e.y][e.x] = -1;
  222. }
  223. });
  224.  
  225. class sP {
  226. constructor(a, b, n) {
  227. this.a = a;
  228. this.b = b;
  229. this.n = n;
  230. this.r = [];
  231. this.r.push({ x: this.b, y: this.a });
  232. }
  233. nP() {
  234. let tempR = [];
  235. for (let i in this.r) {
  236. 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) {
  237. x[this.r[i].y - 1][this.r[i].x] = this.n;
  238. tempR.push({ x: this.r[i].x, y: this.r[i].y - 1 });
  239. if (this.r[i].y - 1 == end.y && this.r[i].x == end.x) {
  240. this.r = [{ x: this.r[i].x, y: this.r[i].y - 1 }];
  241. return this.gP(this.n - 1);
  242. }
  243. }
  244. 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) {
  245. x[this.r[i].y][this.r[i].x + 1] = this.n;
  246. tempR.push({ x: this.r[i].x + 1, y: this.r[i].y });
  247. if (this.r[i].y == end.y && this.r[i].x + 1 == end.x) {
  248. this.r = [{ x: this.r[i].x + 1, y: this.r[i].y }];
  249. return this.gP(this.n - 1);
  250. }
  251. }
  252. 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) {
  253. x[this.r[i].y + 1][this.r[i].x] = this.n;
  254. tempR.push({ x: this.r[i].x, y: this.r[i].y + 1 });
  255. if (this.r[i].y + 1 == end.y && this.r[i].x == end.x) {
  256. this.r = [{ x: this.r[i].x, y: this.r[i].y + 1 }];
  257. return this.gP(this.n - 1);
  258. }
  259. }
  260. 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) {
  261. x[this.r[i].y][this.r[i].x - 1] = this.n;
  262. tempR.push({ x: this.r[i].x - 1, y: this.r[i].y });
  263. if (this.r[i].y == end.y && this.r[i].x - 1 == end.x) {
  264. this.r = [{ x: this.r[i].x - 1, y: this.r[i].y }];
  265. return this.gP(this.n - 1);
  266. }
  267. }
  268. }
  269. if (tempR.length == 0) {
  270. return false;
  271. }
  272. this.n += 1;
  273. this.r = tempR;
  274. return this.nP();
  275. }
  276. gP(n) {
  277. let wX = this.r[this.r.length - 1].x;
  278. let wY = this.r[this.r.length - 1].y;
  279. if (n > 0) {
  280. if (x[wY - 1] && x[wY - 1][wX] && x[wY - 1][wX] == n) {
  281. this.r.push({ x: wX, y: wY - 1 });
  282. }
  283. else if (x[wY] && x[wY][wX + 1] && x[wY][wX + 1] == n) {
  284. this.r.push({ x: wX + 1, y: wY });
  285. }
  286. else if (x[wY + 1] && x[wY + 1][wX] && x[wY + 1][wX] == n) {
  287. this.r.push({ x: wX, y: wY + 1 });
  288. }
  289. else if (x[wY] && x[wY][wX - 1] && x[wY][wX - 1] == n) {
  290. this.r.push({ x: wX - 1, y: wY });
  291. }
  292.  
  293. if (g.npccol[this.r[this.r.length - 1].x + this.r[this.r.length - 1].y * 256]) {
  294. return hero.mSearchPath(this.r[this.r.length - 1].x, this.r[this.r.length - 1].y);
  295. }
  296. return this.gP(n - 1);
  297. } else {
  298. road = [];
  299. if (isMob) {
  300. this.r.shift();
  301. }
  302. return road = this.r;
  303. }
  304. }
  305. }
  306. return new sP(hero.y, hero.x, 1).nP();
  307. }
  308. hero.mSearchPath = function (y, w) {
  309. if (this.isBlockedSearchPath()) { return this.blockedInfoSearchPath() }
  310. const x = []
  311. for (let q = 0; q < map.y; q++) {
  312. x[q] = [];
  313. for (let p = 0; p < map.x; p++) {
  314. x[q][p] = (!isset(g.npccol[p + q * 256]) && (!map.col || map.col.charAt(p + q * map.x) == "0")) ? -1 : -2;
  315. }
  316. }
  317. const end = { x: y, y: w };
  318. var isMob = false;
  319. x[hero.y][hero.x] = 'S';
  320. if (x[end.y][end.x] == -2) {
  321. x[end.y][end.x] = -1;
  322. isMob = true;
  323. }
  324.  
  325. class sP {
  326. constructor(a, b, n) {
  327. this.a = a;
  328. this.b = b;
  329. this.n = n;
  330. this.r = [];
  331. this.r.push({ x: this.b, y: this.a });
  332. }
  333. nP() {
  334. let tempR = [];
  335. for (let i in this.r) {
  336. 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) {
  337. x[this.r[i].y - 1][this.r[i].x] = this.n;
  338. tempR.push({ x: this.r[i].x, y: this.r[i].y - 1 });
  339. if (this.r[i].y - 1 == end.y && this.r[i].x == end.x) {
  340. this.r = [{ x: this.r[i].x, y: this.r[i].y - 1 }];
  341. return this.gP(this.n - 1);
  342. }
  343. }
  344. 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) {
  345. x[this.r[i].y][this.r[i].x + 1] = this.n;
  346. tempR.push({ x: this.r[i].x + 1, y: this.r[i].y });
  347. if (this.r[i].y == end.y && this.r[i].x + 1 == end.x) {
  348. this.r = [{ x: this.r[i].x + 1, y: this.r[i].y }];
  349. return this.gP(this.n - 1);
  350. }
  351. }
  352. 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) {
  353. x[this.r[i].y + 1][this.r[i].x] = this.n;
  354. tempR.push({ x: this.r[i].x, y: this.r[i].y + 1 });
  355. if (this.r[i].y + 1 == end.y && this.r[i].x == end.x) {
  356. this.r = [{ x: this.r[i].x, y: this.r[i].y + 1 }];
  357. return this.gP(this.n - 1);
  358. }
  359. }
  360. 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) {
  361. x[this.r[i].y][this.r[i].x - 1] = this.n;
  362. tempR.push({ x: this.r[i].x - 1, y: this.r[i].y });
  363. if (this.r[i].y == end.y && this.r[i].x - 1 == end.x) {
  364. this.r = [{ x: this.r[i].x - 1, y: this.r[i].y }];
  365. return this.gP(this.n - 1);
  366. }
  367. }
  368. }
  369. if (tempR.length == 0) {
  370. return hero.mSearchPathBlocked(end.x, end.y);
  371. }
  372. this.n += 1;
  373. this.r = tempR;
  374. return this.nP();
  375. }
  376. gP(n) {
  377. let wX = this.r[this.r.length - 1].x;
  378. let wY = this.r[this.r.length - 1].y;
  379. if (n > 0) {
  380. if (x[wY - 1] && x[wY - 1][wX] && x[wY - 1][wX] == n) {
  381. this.r.push({ x: wX, y: wY - 1 });
  382. return this.gP(n - 1);
  383. }
  384. else if (x[wY] && x[wY][wX + 1] && x[wY][wX + 1] == n) {
  385. this.r.push({ x: wX + 1, y: wY });
  386. return this.gP(n - 1);
  387. }
  388. else if (x[wY + 1] && x[wY + 1][wX] && x[wY + 1][wX] == n) {
  389. this.r.push({ x: wX, y: wY + 1 });
  390. return this.gP(n - 1);
  391. }
  392. else if (x[wY] && x[wY][wX - 1] && x[wY][wX - 1] == n) {
  393. this.r.push({ x: wX - 1, y: wY });
  394. return this.gP(n - 1);
  395. }
  396. } else {
  397. road = [];
  398. if (isMob) {
  399. this.r.shift();
  400. }
  401. road = this.r;
  402. }
  403. }
  404. }
  405. new sP(hero.y, hero.x, 1).nP();
  406. }
  407.  
  408.  
  409. hero.mSearchPathClosest = function (y, w) {
  410. if (this.isBlockedSearchPath()) { return this.blockedInfoSearchPath() }
  411. const x = []
  412. for (let q = 0; q < map.y; q++) {
  413. x[q] = [];
  414. for (let p = 0; p < map.x; p++) {
  415. x[q][p] = (!isset(g.npccol[p + q * 256]) && (!map.col || map.col.charAt(p + q * map.x) == "0")) ? -1 : -2;
  416. }
  417. }
  418. const end = { x: y, y: w };
  419. var isMob = false;
  420. x[hero.y][hero.x] = 'S';
  421. if (x[end.y][end.x] == -2) {
  422. x[end.y][end.x] = -1;
  423. isMob = true;
  424. }
  425.  
  426. class sP {
  427. constructor(a, b, n) {
  428. this.a = a;
  429. this.b = b;
  430. this.n = n;
  431. this.r = [];
  432. this.r.push({ x: this.b, y: this.a });
  433. }
  434. nP() {
  435. let tempR = [];
  436. for (let i in this.r) {
  437. 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) {
  438. x[this.r[i].y - 1][this.r[i].x] = this.n;
  439. tempR.push({ x: this.r[i].x, y: this.r[i].y - 1 });
  440. if (this.r[i].y - 1 == end.y && this.r[i].x == end.x) {
  441. this.r = [{ x: this.r[i].x, y: this.r[i].y - 1 }];
  442. return this.gP(this.n - 1);
  443. }
  444. }
  445. 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) {
  446. x[this.r[i].y][this.r[i].x + 1] = this.n;
  447. tempR.push({ x: this.r[i].x + 1, y: this.r[i].y });
  448. if (this.r[i].y == end.y && this.r[i].x + 1 == end.x) {
  449. this.r = [{ x: this.r[i].x + 1, y: this.r[i].y }];
  450. return this.gP(this.n - 1);
  451. }
  452. }
  453. 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) {
  454. x[this.r[i].y + 1][this.r[i].x] = this.n;
  455. tempR.push({ x: this.r[i].x, y: this.r[i].y + 1 });
  456. if (this.r[i].y + 1 == end.y && this.r[i].x == end.x) {
  457. this.r = [{ x: this.r[i].x, y: this.r[i].y + 1 }];
  458. return this.gP(this.n - 1);
  459. }
  460. }
  461. 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) {
  462. x[this.r[i].y][this.r[i].x - 1] = this.n;
  463. tempR.push({ x: this.r[i].x - 1, y: this.r[i].y });
  464. if (this.r[i].y == end.y && this.r[i].x - 1 == end.x) {
  465. this.r = [{ x: this.r[i].x - 1, y: this.r[i].y }];
  466. return this.gP(this.n - 1);
  467. }
  468. }
  469. }
  470. if (tempR.length == 0) {
  471. return hero.mSearchPathBlocked(end.x, end.y);
  472. }
  473. this.n += 1;
  474. this.r = tempR;
  475. return this.nP();
  476. }
  477. gP(n) {
  478. let wX = this.r[this.r.length - 1].x;
  479. let wY = this.r[this.r.length - 1].y;
  480. if (n > 0) {
  481. if (x[wY - 1] && x[wY - 1][wX] && x[wY - 1][wX] == n) {
  482. this.r.push({ x: wX, y: wY - 1 });
  483. return this.gP(n - 1);
  484. }
  485. else if (x[wY] && x[wY][wX + 1] && x[wY][wX + 1] == n) {
  486. this.r.push({ x: wX + 1, y: wY });
  487. return this.gP(n - 1);
  488. }
  489. else if (x[wY + 1] && x[wY + 1][wX] && x[wY + 1][wX] == n) {
  490. this.r.push({ x: wX, y: wY + 1 });
  491. return this.gP(n - 1);
  492. }
  493. else if (x[wY] && x[wY][wX - 1] && x[wY][wX - 1] == n) {
  494. this.r.push({ x: wX - 1, y: wY });
  495. return this.gP(n - 1);
  496. }
  497. } else {
  498. if (isMob) {
  499. this.r.shift();
  500. }
  501. return this.r.length;
  502. }
  503. }
  504. }
  505. return new sP(hero.y, hero.x, 1).nP();
  506. }
  507.  
  508. const mE = {
  509. 'Ranna Mushita': 'pot/st-puma.gif',
  510. 'Mushita': 'pot/st-puma.gif',
  511. 'Shae Phu': 'pot/demonszef.gif',
  512. 'Władca rzek': 'hum/gobmag2.gif',
  513. 'Gobbos': 'hum/gobsamurai.gif',
  514. 'Szczęt alias Gładki': 'woj/rozb04.gif',
  515. 'Razuglag Oklash': 'hum/praork_mag.gif',
  516. 'Tarmus Wuden': 'hum/klan_tarmus.gif',
  517. 'Foverk Turrim': 'hum/kobold07.gif',
  518. 'Vari Kruger': 'hum/gnoll11.gif',
  519. 'Furruk Kozug': 'hum/gnoll12.gif',
  520. 'Tollok Atamatu': 'hum/tollok-c-boss.gif',
  521. 'Tollok Utumutu': 'hum/tollok-c-boss.gif',
  522. 'Goplana': 'hum/rusalka.gif',
  523. 'Wyznawca ciemnych mocy': 'hum/mnich04.gif',
  524. 'Mazurnik Przybrzeżny': 'hum/wodnik03.gif',
  525. 'Łowca czaszek': 'hum/umarlak4.gif',
  526. 'Grabarz świątynny': 'hum/magaz-grabarz.gif',
  527. 'Podły zbrojmistrz': 'hum/magaz-zbrojmistrz.gif',
  528. 'Szkielet władcy żywiołów': 'pot/szkiel05.gif',
  529. 'Nieumarły krzyżowiec': 'pot/el_szkielet.gif',
  530. 'Morthen': 'hum/krasnolud_boss.gif',
  531. 'Żelazoręki Ohydziarz': 'pot/ugrape2.gif',
  532. 'Miłośnik rycerzy': 'hum/ogr2.gif',
  533. 'Miłośnik łowców': 'hum/ogr3.gif',
  534. 'Miłośnik magii': 'hum/ogr1.gif',
  535. 'Młody Jack Truciciel': 'woj/pirat01.gif',
  536. 'Wójt Fistuła': 'woj/goral05.gif',
  537. 'Królowa Śniegu': 'hum/ice_queen.gif',
  538. 'Krab pustelnik': 'pot/krab_big3.gif',
  539. 'Teściowa Rumcajsa': 'woj/goral08.gif',
  540. 'Pogromca Gryfów': 'hum/zagajnik01.gif',
  541. 'Pogromczyni Mantikor': 'hum/zagajnik03.gif',
  542. 'Poskramiacz Hydr': 'hum/zagajnik02.gif',
  543. 'Burkog Lorulk': 'hum/orkczd.gif',
  544. 'Jertek Moxos': 'hum/molochelita02n.gif',
  545. 'Berserker Amuno': 'hum/amuno.gif',
  546. 'Stworzyciel': 'pot/stworzyciel.gif',
  547. 'Fodug Zolash': 'hum/fodug_zolash.gif',
  548. 'Mistrz Worundriel': 'hum/worundriel02.gif',
  549. 'Goons Asterus': 'hum/mechgoblin4.gif',
  550. 'Adariel': 'kob/tri-adariel.gif',
  551. 'Duch Władcy Klanów': 'hum/praork_duch1.gif',
  552. 'Ogr Stalowy Pazur': 'pot/ogr_drapak.gif',
  553. 'Fursharag pożeracz umysłów': 'hum/praork_mag_elita.gif',
  554. 'Ziuggrael strażnik królowej': 'hum/praork_woj_elita.gif',
  555. 'Bragarth myśliwy dusz': 'hum/praork_low_elita.gif',
  556. 'Lusgrathera Królowa Pramatka': 'hum/prakrolowa.gif',
  557. 'Borgoros Garamir III': 'hum/minotaur-elita.gif',
  558. 'Chryzoprenia': 'hum/driada04.gif',
  559. 'Czempion Furboli': 'hum/forbol03.gif',
  560. 'Torunia Ankelwald': 'hum/thuz-patr01.gif',
  561. 'Breheret Żelazny Łeb': 'hum/barbarzynca06.gif',
  562. 'Mysiur Myświórowy Król': 'hum/krolszczur.gif',
  563. 'Sadolia Nadzorczyni Hurys': 'hum/dziewica_nadzor.gif',
  564. 'Bergermona Krwawa Hrabina': 'hum/sekta_m_tortur_e2.gif',
  565. 'Annaniel Wysysacz Marzeń': 'hum/sekta_mag_e2.gif',
  566. 'Sataniel Skrytobójca': 'hum/sekta_zabojca_e2.gif',
  567. 'Gothardus Kolekcjoner głów': 'hum/sekta_pal_e2.gif',
  568. 'Marlloth Malignitas': 'pot/marlloth.gif',
  569. 'Zufulus Smakosz Serc': 'hum/sekta_wyr_serc.gif',
  570. 'Arachniregina Colosseus': 'pot/regina-e2.gif',
  571. 'Mocny Maddoks': 'hum/maddok5.gif',
  572. 'Pancerny Maddok': 'pot/maddok_roz.gif',
  573. 'Silvanasus': 'pot/silvanasus.gif',
  574. 'Dendroculus': 'pot/dendroculus.gif',
  575. 'Cuaitl Citlalin': 'hum/mahop04.gif',
  576. 'Quetzalcoatl': 'pot/quetzalcoatl.gif',
  577. 'Neferkar Set': 'pot/szkiel_set.gif',
  578. 'Vaenra Charkhaam': 'hum/bar_smoczyca.gif',
  579. 'Chaegd Agnrakh': 'hum/bar_smokoszef.gif',
  580. 'Nymphemonia': 'hum/driada5.gif',
  581. 'Furion': 'pot/wl-mrozu02.gif',
  582. 'Zorin': 'pot/wl-mrozu01.gif',
  583. 'Artenius': 'pot/wl-mrozu03.gif',
  584. }
  585. 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, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;") + "</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 += "&nbsp;&nbsp;" } 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, "&lt;") + '"<BR>' } } } } else { f = "===>" + a + "<===(" + typeof (a) + ")" } return f };
  586.  
  587. const tmpMAlert = mAlert;
  588. mAlert = function (a, c, d, b) {
  589. if (localStorage.getItem('mState') != "true") {
  590. return tmpMAlert(a, c, d, b);
  591. }
  592. }
  593.  
  594. const tmpBattleMsg = battleMsg;
  595. battleMsg = function (c, t) {
  596. const ret = tmpBattleMsg(c, t);
  597. if (c.search(/winner=/) >= 0 && localStorage.getItem('mState') == "true") {
  598. $("#battleclose").click();
  599. }
  600. else if (c.search(/Rozpoczęła się walka pomiędzy/) >= 0 && localStorage.getItem('mState') == "true") {
  601. $("#autobattleButton").click();
  602. }
  603. return ret;
  604. }
  605. if (!localStorage.getItem('mDisable2.7')) {
  606. localStorage.setItem('mDisable2.7', Date.now());
  607. }
  608. if (localStorage.getItem('mDisable2.7') && localStorage.getItem('mState') == "true") {
  609. if (Date.now() - parseInt(localStorage.getItem('mDisable2.7')) >= 43200000) {
  610. hero.mSearchPath = function (x, y) {
  611.  
  612. }
  613. alert('Koniec wersji demo.');
  614. } else {
  615.  
  616. const mBotObj = new mBot(localStorage.getItem('mMobs'), localStorage.getItem('mMaps'), localStorage.getItem('mRoad'), localStorage.getItem('mMapsVisited'), mE, localStorage.getItem('mTpMap'), localStorage.getItem('mTp'));
  617. mBotObj.mMain();
  618. }
  619. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement