Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var procentHealth = (npc.getMaxHealth()/100)*80;
- var countMonsters = npc.getTempData("countMonsters");
- var time = npc.getTempData("time");
- if(npc.getHealth() < procentHealth && countMonsters < 10 && time == 0){
- npc.setTempData("time", 1);
- npc.setTempData("countMonsters", 0);
- var allNpcInRadius = npc.npc.field_70170_p.func_72872_a(npc.npc.class, npc.npc.field_70121_D.func_72314_b(10,10,10));
- for(var i = 0; i <allNpcInRadius.size(); i++){
- var npc1 = allNpcInRadius.get(i);
- if(npc1.display.name.equals("test1")){
- npc.setTempData("countMonsters", npc.getTempData("countMonsters") + 1);
- }
- }
- if(npc.getTempData("countMonsters") < 10){
- world.spawnClone(npc.getX()+Math.random(7), npc.getY(), npc.getZ()+Math.random(7), 1, "test1");
- }
- }
- if(time >= 1 && time <= 10){
- npc.setTempData("time", npc.getTempData("time") + 1);
- if(time >= 9){
- npc.setTempData("time", 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement