Advertisement
ctakan

Untitled

Apr 16th, 2021
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var countMonsters = npc.getTempData("countMonsters");
  2. var time = npc.getTempData("time");
  3. var playerInRadius = npc.helper.getEntityPlayerMPList(npc.npc, 16);
  4. if(countMonsters < 10 && time == 0 && playerInRadius.size() != 0) {
  5. npc.setTempData("time", 1);
  6. npc.setTempData("countMonsters", 0);
  7. var allNpcInRadius = npc.npc.field_70170_p.func_72872_a(npc.npc.class, npc.npc.field_70121_D.func_72314_b(10,10,10));
  8. for(var i = 0; i <allNpcInRadius.size(); i++){
  9. var npc1 = allNpcInRadius.get(i);
  10. if(npc1.display.name.equals("Ядовитый плющ") || npc1.display.name.equals("Терновый плющ") || npc1.display.name.equals("Тыквоголов") || npc1.display.name.equals("Томатник")){
  11. npc.setTempData("countMonsters", npc.getTempData("countMonsters") + 1);
  12. }
  13. }
  14. if(npc.getTempData("countMonsters") < 10){
  15.   var randomInt = getRandomInt(4) + 1;
  16.   if(randomInt == 1){
  17.     world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Ядовитый плющ");
  18.   }
  19.   if(randomInt == 2){
  20.   world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Терновый плющ");
  21.   }
  22.   if(randomInt == 3){
  23.   world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Тыквоголов");
  24.   }
  25.   if(randomInt == 4){
  26.   world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Томатник");
  27.   }
  28. }
  29. }
  30. if(time >= 1 && time <= 10){
  31. npc.setTempData("time", npc.getTempData("time") + 1);
  32. if(time >= 9){
  33. npc.setTempData("time", 0);
  34. }
  35. }
  36.  
  37. var playerInRadius1 = npc.helper.getEntityPlayerMPList(npc.npc, 25);
  38. if(playerInRadius1.size() == 0){
  39.   var allNpcInRadius = npc.npc.field_70170_p.func_72872_a(npc.npc.class, npc.npc.field_70121_D.func_72314_b(30,30,30));
  40.   for(var i = 0; i <allNpcInRadius.size(); i++){
  41. var npc1 = allNpcInRadius.get(i);
  42. if(npc1.display.name.equals("Ядовитый плющ") || npc1.display.name.equals("Терновый плющ") || npc1.display.name.equals("Тыквоголов") || npc1.display.name.equals("Томатник")){
  43. npc.npc.delete();
  44. }
  45. }
  46. }
  47.  
  48. function getRandomInt(max) {
  49.   return Math.floor(Math.random() * max);
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement