diff --git a/runner_functions.js b/runner_functions.js index 30baa8a..6a396b8 100644 --- a/runner_functions.js +++ b/runner_functions.js @@ -270,17 +270,18 @@ function get_nearest_monster(args) function get_nearest_hostile(args) // mainly as an example [08/02/17] { - //args: no args yet var min_d=999999,target=null; if(!args) args={}; + if(args.friendship===undefined) args.friendship=true; for(id in parent.entities) { var current=parent.entities[id]; if(current.type!="character" || current.rip || current.invincible) continue; if(current.party && character.party==current.party) continue; - if(in_arr(current.owner,parent.friends)) continue; + if(args.friendship && in_arr(current.owner,parent.friends)) continue; + if(args.exclude && in_arr(current.name,args.exclude)) continue; // get_nearest_hostile({exclude:["Wizard"]}); Thanks var c_dist=parent.distance(character,current); if(c_dist