Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var countMonsters = npc.getTempData("countMonsters");
- var time = npc.getTempData("time");
- var playerInRadius = npc.helper.getEntityPlayerMPList(npc.npc, 16);
- if(countMonsters < 10 && time == 0 && playerInRadius.size() != 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("Ядовитый плющ") || npc1.display.name.equals("Терновый плющ") || npc1.display.name.equals("Тыквоголов") || npc1.display.name.equals("Томатник")){
- npc.setTempData("countMonsters", npc.getTempData("countMonsters") + 1);
- }
- }
- if(npc.getTempData("countMonsters") < 10){
- var randomInt = getRandomInt(4) + 1;
- if(randomInt == 1){
- world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Ядовитый плющ");
- }
- if(randomInt == 2){
- world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Терновый плющ");
- }
- if(randomInt == 3){
- world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Тыквоголов");
- }
- if(randomInt == 4){
- world.spawnClone(npc.getX()+getRandomInt(4) + 1, npc.getY(), npc.getZ() + getRandomInt(4) + 1, 1, "Томатник");
- }
- }
- }
- if(time >= 1 && time <= 10){
- npc.setTempData("time", npc.getTempData("time") + 1);
- if(time >= 9){
- npc.setTempData("time", 0);
- }
- }
- var playerInRadius1 = npc.helper.getEntityPlayerMPList(npc.npc, 25);
- if(playerInRadius1.size() == 0){
- var allNpcInRadius = npc.npc.field_70170_p.func_72872_a(npc.npc.class, npc.npc.field_70121_D.func_72314_b(30,30,30));
- for(var i = 0; i <allNpcInRadius.size(); i++){
- var npc1 = allNpcInRadius.get(i);
- if(npc1.display.name.equals("Ядовитый плющ") || npc1.display.name.equals("Терновый плющ") || npc1.display.name.equals("Тыквоголов") || npc1.display.name.equals("Томатник")){
- npc.npc.delete();
- }
- }
- }
- function getRandomInt(max) {
- return Math.floor(Math.random() * max);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement