Advertisement
Nolifeq

Kolizje na agresywnych mobach

Sep 15th, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Kolizje na agresywnych mobach
  3. // @namespace http://tampermonkey.net/
  4. // @description dodaje kolizje wokół mobów z przewagą lvlową na wybranych mapach.
  5. // @author Czogi
  6. // @match *://*.margonem.pl/
  7. // @exclude https://www.margonem.pl/
  8. // ==/UserScript==
  9.  
  10. const config = {
  11. radius: 1,
  12. lvl: 1,
  13. maps: [180]
  14. }
  15.  
  16. function setNpcCol(npc,radius){
  17. var col = map.col.split("");
  18. for(let i = 0;i<=radius;i++){
  19. col[((npc.x+i) + (npc.y+radius) * map.x)] = 1
  20. col[((npc.x-i) + (npc.y+radius) * map.x)] = 1
  21. col[((npc.x+i) + (npc.y-radius) * map.x)] = 1
  22. col[((npc.x-i) + (npc.y-radius) * map.x)] = 1
  23. col[((npc.x+radius) + (npc.y+i) * map.x)] = 1
  24. col[((npc.x+radius) + (npc.y-i) * map.x)] = 1
  25. col[((npc.x-radius) + (npc.y+i) * map.x)] = 1
  26. col[((npc.x-radius) + (npc.y-i) * map.x)] = 1
  27. }
  28. map.col = col.join("")
  29. }
  30.  
  31. var oNN = newNpc
  32. newNpc = function(a){
  33. for(let i in a){
  34. let n = a[i];
  35. if(n.lvl >= (hero.lvl - config.lvl) && config.maps.includes(map.id)) setNpcCol(n, config.radius);
  36. }
  37. oNN(a)
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement