Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // looks for phoenix in beach, arma, tunnel, poms
  2. // will stop when it finds phoenix and resume when it dies
  3. // use your own attack/targetting code
  4.  
  5. var zone = 1;
  6. var phoenk = 0;
  7. parent.socket.emit("transport",{to:"main", s:1});
  8.  
  9. setInterval(pf,500);
  10.  
  11. function pf(){
  12.   var phoen = get_nearest_monster({min_xp:90000,max_att:125});
  13.   if (phoen) {phoenk = 1;change_target(phoen);}
  14.   if ((!phoen) && (phoenk == 1)) {for(id in parent.chests) parent.socket.emit("open_chest", {id : id});phoenk = 0;parent.socket.emit("transport",{to:"main", s:1});}
  15.  
  16.   // beach
  17.   if ((character.real_x == -968) && (character.real_y == -170)) {zone=1;draw_phoenixbounds();}
  18.   if ((zone == 1) && (!phoen)) {move(character.real_x-2,character.real_y+40);}
  19.   if ((zone == 1) && (!phoen) && (character.real_y >= 1500)) {parent.socket.emit("transport",{to:"main", s:2});}
  20.  
  21.   // arma
  22.   if ((character.real_x == 535) && (character.real_y == 1672)) {zone=2;draw_phoenixbounds();}
  23.   if ((zone == 2) && (!phoen) && (character.real_x == 535) && (character.real_y == 1672)) {move(character.real_x+100,character.real_y+100);}
  24.   if ((zone == 2) && (character.real_y == 1772)) {parent.socket.emit("transport",{to:"tunnel", s:1});}
  25.  
  26.   // tunnel
  27.   if ((character.real_x == 0) && (character.real_y == -16)) {zone=3;draw_phoenixbounds();}
  28.   if ((zone == 3) && (character.map == "tunnel") && ((Object.values(parent.entities).filter(e => e.target == character.name).length) > 1)) {parent.socket.emit("transport",{to:"main", s:2});}
  29.   if ((zone == 3) && (character.real_x == 0) && (character.real_y == -16)) {move(character.real_x+220,character.real_y);}
  30.   if ((zone == 3) && (character.real_x == 220) && (character.real_y == -16)) {move(character.real_x,character.real_y-624);}
  31.   if ((zone == 3) && (character.real_x == 220) && (character.real_y == -640)) {move(character.real_x-220,character.real_y);}
  32.   if ((zone == 3) && (character.real_x == 0) && (character.real_y == -640)) {move(character.real_x,character.real_y-160);}
  33.   if ((zone == 3) && (!phoen) && (character.real_x == 0) && (character.real_y == -800)) {parent.socket.emit("transport",{to:"halloween", s:2});}
  34.  
  35.   // poms
  36.   if ((character.real_x == 0) && (character.real_y == 0) && (character.map == "halloween")) {zone=4;draw_phoenixbounds();}
  37.   if ((zone == 4) && (!phoen)) {move(character.real_x,character.real_y+40);}
  38.   if ((zone == 4) && (character.real_y >= 650)) {parent.socket.emit("transport",{to:"main", s:1});}
  39. }
  40.  
  41. function draw_phoenixbounds(){
  42.     clear_drawings();
  43.     let bounds = G.maps.main.monsters[19].boundaries;
  44.     for(i in bounds){
  45.         let c = bounds[i];
  46.         if(c[0] === character.map){
  47.             // x lines
  48.             draw_line(c[1], c[2], c[3], c[2], 1, '0x00FF00');
  49.             draw_line(c[1], c[4], c[3], c[4], 1, '0x00FF00');
  50.             // y lines
  51.             draw_line(c[1], c[2], c[1], c[4], 1, '0x00FF00');
  52.             draw_line(c[3], c[2], c[3], c[4], 1, '0x00FF00');
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement