Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hero.sP= hero.searchPath;
- var czyprawdziwy=0;
- var axaax=0;
- var odswiezyc=0;
- var moznabic=0;
- var herosdodatek = newNpc;
- newNpc = function(a){
- herosdodatek(a);
- for (var h in a){
- if (a[h].nick=="Świerszcz")
- {
- var cxaax = document.createElement("canvas").getContext("2d"),
- exaax = new Image;
- var bxaax = "http://" + document.location.hostname + a[h].icon;
- if (a[h].nick==Świerszcz"){
- exaax.onload = function()
- {
- cxaax.width = this.width, cxaax.height = this.height, cxaax.drawImage(exaax, 0, 0)
- var axaax = cxaax.getImageData(Math.floor(cxaax.width / 2), 0, 1, cxaax.height).data;
- for (var dxaax = 0; dxaax < axaax.length; dxaax += 1)
- {
- if (axaax[dxaax] > 0)
- {
- if(czyprawdziwy===0)
- czyprawdziwy=1;
- break;
- }
- if(dxaax+4>axaax.length)
- {
- czyprawdziwy=0;
- break;
- }
- }
- if(czyprawdziwy){
- var xarzar=(Math.floor(Math.random() * 7) * 300)+300;
- setTimeout(function() {
- hero.sP(a[h].x,a[h].y);
- odswiezyc=1;
- moznabic=1;
- czyprawdziwy=0;
- }, xarzar);
- }
- }, exaax.src = bxaax
- }
- }
- else
- {
- continue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement