Guest User

Untitled

a guest
Feb 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. function NTC_AllQuestersInOrOut(which, area) { // which: In, Out. area: areaid, nothing is me.areaid
  2.  
  3. var whosInMyParty = [];
  4.  
  5. var partyPlayer = GetPlayerUnit();
  6. var myPartyId = partyPlayer.partyid;
  7.  
  8. if(arguments.length < 2) { area = me.areaid; }
  9.  
  10. if(!partyPlayer) { // if no partyPlayer in game return false.
  11. return false;
  12. }
  13.  
  14. if(partyPlayer) {
  15. do {
  16.  
  17. if(partyPlayer.name == me.name) { continue; } // if the partyPlayer is me don't add to the array
  18.  
  19. if(myPartyId == partyPlayer.partyid) { // if the partyPlayer is in my part.
  20. whosInMyParty.push(partyPlayer.name); // push it into the array.
  21. }
  22.  
  23. NTC_Delay(100);
  24.  
  25. } while(partyPlayer.GetNext());
  26. }
  27.  
  28. if(which == In) { // all In
  29. for(var i = 0; i < 75 && whosInMyParty.length > 0; i++) { // allow aprox 15 seconds max for all paryPlayers to get in
  30. for(var j = 0; j < whosInMyParty.length; j++) { // check if each partyPlayer is in area
  31. if(whosInMyParty[j].areaid == area) { // if they are remove them from array
  32. whosInMyParty.splice(j, 1);
  33. }
  34. }
  35. Delay(200);
  36. }
  37. } else { // all Out
  38. for(var i = 0; i < 75 && whosInMyParty.length > 0; i++) { // allow aprox 15 seconds max for all paryPlayers to get back to town
  39. for(var j = 0; j < whosInMyParty.length; j++) { // check if each partyPlayer is in town
  40. if(whosInMyParty[j].areaid != area) { // if they are remove them from array
  41. whosInMyParty.splice(j, 1);
  42. }
  43. }
  44. Delay(200);
  45. }
  46. }
  47.  
  48. return whosInMyParty.length;
  49. }
Add Comment
Please, Sign In to add comment