Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // looks for phoenix in beach, arma, tunnel, poms
- // will stop when it finds phoenix and resume when it dies
- // use your own attack/targetting code
- var zone = 1;
- var phoenk = 0;
- parent.socket.emit("transport",{to:"main", s:1});
- setInterval(pf,500);
- function pf(){
- var phoen = get_nearest_monster({min_xp:90000,max_att:125});
- if (phoen) {phoenk = 1;change_target(phoen);}
- 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});}
- // beach
- if ((character.real_x == -968) && (character.real_y == -170)) {zone=1;draw_phoenixbounds();}
- if ((zone == 1) && (!phoen)) {move(character.real_x-2,character.real_y+40);}
- if ((zone == 1) && (!phoen) && (character.real_y >= 1500)) {parent.socket.emit("transport",{to:"main", s:2});}
- // arma
- if ((character.real_x == 535) && (character.real_y == 1672)) {zone=2;draw_phoenixbounds();}
- if ((zone == 2) && (!phoen) && (character.real_x == 535) && (character.real_y == 1672)) {move(character.real_x+100,character.real_y+100);}
- if ((zone == 2) && (character.real_y == 1772)) {parent.socket.emit("transport",{to:"tunnel", s:1});}
- // tunnel
- if ((character.real_x == 0) && (character.real_y == -16)) {zone=3;draw_phoenixbounds();}
- 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});}
- if ((zone == 3) && (character.real_x == 0) && (character.real_y == -16)) {move(character.real_x+220,character.real_y);}
- if ((zone == 3) && (character.real_x == 220) && (character.real_y == -16)) {move(character.real_x,character.real_y-624);}
- if ((zone == 3) && (character.real_x == 220) && (character.real_y == -640)) {move(character.real_x-220,character.real_y);}
- if ((zone == 3) && (character.real_x == 0) && (character.real_y == -640)) {move(character.real_x,character.real_y-160);}
- if ((zone == 3) && (!phoen) && (character.real_x == 0) && (character.real_y == -800)) {parent.socket.emit("transport",{to:"halloween", s:2});}
- // poms
- if ((character.real_x == 0) && (character.real_y == 0) && (character.map == "halloween")) {zone=4;draw_phoenixbounds();}
- if ((zone == 4) && (!phoen)) {move(character.real_x,character.real_y+40);}
- if ((zone == 4) && (character.real_y >= 650)) {parent.socket.emit("transport",{to:"main", s:1});}
- }
- function draw_phoenixbounds(){
- clear_drawings();
- let bounds = G.maps.main.monsters[19].boundaries;
- for(i in bounds){
- let c = bounds[i];
- if(c[0] === character.map){
- // x lines
- draw_line(c[1], c[2], c[3], c[2], 1, '0x00FF00');
- draw_line(c[1], c[4], c[3], c[4], 1, '0x00FF00');
- // y lines
- draw_line(c[1], c[2], c[1], c[4], 1, '0x00FF00');
- draw_line(c[3], c[2], c[3], c[4], 1, '0x00FF00');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement