Advertisement
ctakan

Untitled

Apr 14th, 2021
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var procentHealth = (npc.getMaxHealth()/100)*80;
  2. var countMonsters = npc.getTempData("countMonsters");
  3. var time = npc.getTempData("time");
  4. if(npc.getHealth() < procentHealth && countMonsters < 10 && time == 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("test1")){
  11. npc.setTempData("countMonsters", npc.getTempData("countMonsters") + 1);
  12. }
  13. }
  14. if(npc.getTempData("countMonsters") < 10){
  15. world.spawnClone(npc.getX()+Math.random(7), npc.getY(), npc.getZ()+Math.random(7), 1, "test1");
  16. }
  17. }
  18. if(time >= 1 && time <= 10){
  19. npc.setTempData("time", npc.getTempData("time") + 1);
  20. if(time >= 9){
  21. npc.setTempData("time", 0);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement