Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. hero.sP= hero.searchPath;
  2. var czyprawdziwy=0;
  3. var axaax=0;
  4. var odswiezyc=0;
  5. var moznabic=0;
  6. var herosdodatek = newNpc;
  7. newNpc = function(a){
  8. herosdodatek(a);
  9.  
  10.  
  11. for (var h in a){
  12.  
  13. if (a[h].nick=="Świerszcz")
  14. {
  15. var cxaax = document.createElement("canvas").getContext("2d"),
  16. exaax = new Image;
  17.  
  18. var bxaax = "http://" + document.location.hostname + a[h].icon;
  19.  
  20. if (a[h].nick==Świerszcz"){
  21. exaax.onload = function()
  22. {
  23. cxaax.width = this.width, cxaax.height = this.height, cxaax.drawImage(exaax, 0, 0)
  24. var axaax = cxaax.getImageData(Math.floor(cxaax.width / 2), 0, 1, cxaax.height).data;
  25.  
  26. for (var dxaax = 0; dxaax < axaax.length; dxaax += 1)
  27. {
  28. if (axaax[dxaax] > 0)
  29. {
  30. if(czyprawdziwy===0)
  31. czyprawdziwy=1;
  32. break;
  33. }
  34. if(dxaax+4>axaax.length)
  35. {
  36. czyprawdziwy=0;
  37. break;
  38. }
  39. }
  40. if(czyprawdziwy){
  41. var xarzar=(Math.floor(Math.random() * 7) * 300)+300;
  42. setTimeout(function() {
  43. hero.sP(a[h].x,a[h].y);
  44. odswiezyc=1;
  45. moznabic=1;
  46. czyprawdziwy=0;
  47. }, xarzar);
  48. }
  49.  
  50.  
  51. }, exaax.src = bxaax
  52.  
  53.  
  54. }
  55. }
  56. else
  57. {
  58. continue;
  59. }
  60.  
  61.  
  62.  
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement