123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- event.load("block_click");
- event.load("player_logout");
- event.load("entity_death");
- event.load("entity_click");
- event.load("inv_click");
- silvercoin = read.item("km:coin_silver");
- icespawn = loc.new(world.get("iceworld"), 1071, 65, 2046, -90, 0);
- icespawntpsign = loc.new(world.get("games"), -412, 88, 110);
- map.new(progress);
- map.new(mobtype);
- map.new(allmobs);
- map.add(allmobs, "EntityZombie", "Zombies");
- map.add(allmobs, "EntitySpider", "Spinnen");
- map.add(allmobs, "EntityCreeper", "Creeper");
- map.add(allmobs, "EntitySkeleton", "Skelette");
- inv.newDynamic(xmasinv1, "222200022", "XMAS");
- inv.setItem(xmasinv1, 0, read.item("minecraft:rotten_flesh", 1, 0, "§r5 Zombies töten"));
- inv.setItem(xmasinv1, 1, read.item("minecraft:string", 1, 0, "§r5 Spinnen töten"));
- inv.setItem(xmasinv1, 2, read.item("minecraft:gunpowder", 1, 0, "§r5 Creeper töten"));
- inv.setItem(xmasinv1, 3, read.item("minecraft:bow", 1, 0, "§r5 Skelette töten"));
- inv.setItem(xmasinv1, 4, read.item("km:check_green", 1, 0, "§rQuest abgeben"));
- inv.setItem(xmasinv1, 5, read.item("minecraft:iron_bars", 1, 0, "§rQuest aufgeben"));
- inv.newDynamic(xmasinv2, "222200022", "XMAS");
- inv.setItem(xmasinv2, 0, read.item("minecraft:rotten_flesh", 1, 0, "§r5 Zombies töten"));
- inv.setItem(xmasinv2, 1, read.item("minecraft:string", 1, 0, "§r5 Spinnen töten"));
- inv.setItem(xmasinv2, 2, read.item("minecraft:gunpowder", 1, 0, "§r5 Creeper töten"));
- inv.setItem(xmasinv2, 3, read.item("minecraft:bow", 1, 0, "§r5 Skelette töten"));
- inv.setItem(xmasinv2, 4, read.item("km:cross_red", 1, 0, "§rQuest abgeben"));
- inv.setItem(xmasinv2, 5, read.item("minecraft:iron_bars", 1, 0, "§rQuest aufgeben"));
- msg("dev", "§bxmas §rwurde geladen");
- @wait
- wait();
- if(event == "block_click") {
- if(block_loc == icespawntpsign) {
- entity.teleport(player, icespawn);
- player.giveItem(player, read.item("km:iron_battleaxe"));
- player.giveItem(player, read.item("minecraft:bow"));
- player.giveItem(player, read.item("minecraft:arrow", 64));
- player.giveItem(player, read.item("km:bronze_helmet"));
- player.giveItem(player, read.item("km:bronze_chestplate"));
- player.giveItem(player, read.item("km:bronze_leggings"));
- player.giveItem(player, read.item("km:bronze_boots"));
- player.giveItem(player, read.item("km:mushroom_stick_cooked", 64));
- player.giveItem(player, read.item("km:camp_fire"));
- player.giveItem(player, read.item("km:bronze_pickaxe"));
- player.giveItem(player, read.item("km:bronze_axe"));
- player.giveItem(player, read.item("km:bronze_shovel"));
- player.giveItem(player, read.item("km:lantern", 5));
- }
- goto("wait");
- }
- if(event == "player_logout") {
- map.remove(progress, player_name);
- map.remove(mobtype, player_name);
- goto("wait");
- }
- if(event == "inv_click") {
- if(inv_slot < 4) {
- if(map.contains(progress, player_name)) {
- player.speak($player, "§dXMAS", "Du hast bereits eine Quest.");
- goto("wait");
- }
- }
- if(inv_slot == 0) {
- mob = "EntityZombie";
- } elseif(inv_slot == 1) {
- mob = "EntitySpider";
- } elseif(inv_slot == 2) {
- mob = "EntityCreeper";
- } elseif(inv_slot == 3) {
- mob = "EntitySkeleton";
- } elseif(inv_slot == 4) {
- if(!map.contains(progress, player_name)) {
- player.speak(player, "§dXMAS", "Du hast keine Quest.");
- goto("wait");
- }
- points = map.get(progress, player_name);
- if(points >= 5) {
- player.giveItem(player, silvercoin);
- map.remove(progress, player_name);
- map.remove(mobtype, player_name);
- player.speak(player, "§dXMAS", "Quest geschafft.");
- display.remove(player, 0);
- inv.open(xmasinv2, player);
- goto("wait");
- }
- player.speak(player, "§dXMAS", "Quest noch nicht geschafft.");
- goto("wait");
- } elseif(inv_slot == 5) {
- if(!map.contains(progress, player_name)) {
- player.speak(player, "§dXMAS", "Du hast keine Quest.");
- goto("wait");
- }
- map.remove(progress, player_name);
- map.remove(mobtype, player_name);
- player.speak(player, "§dXMAS", "Quest wurde aufgegeben.");
- display.remove(player, 0);
- goto("wait");
- }
- mobname = map.get(allmobs, mob);
- player.speak(player, "§dXMAS", concat("Töte 5 ", mobname));
- display.add(player, 0, concat("§6", mobname, " §r", 0, "/5"));
- map.add(progress, player_name, 0);
- map.add(mobtype, player_name, mob);
- inv.close(player);
- goto("wait");
- }
- if(event == "entity_click") {
- if(entity.getName(entity) == "Questgeber") {
- if(map.contains(progress, player_name)) {
- if(map.get(progress, player_name) >= 5) {
- inv.open(xmasinv1, player);
- goto("wait");
- }
- }
- inv.open(xmasinv2, player);
- }
- goto("wait");
- }
- if(event == "entity_death") {
- if(player_involved) {
- if(map.contains(allmobs, text.class(entity))) {
- if(map.contains(progress, player_name)) {
- pointsnew = map.get(progress, player_name) + 1;
- if(pointsnew < 6) {
- map.add(progress, player_name, pointsnew);
- display.add(player, 0, concat("§6", mobname, " §r", text.number(pointsnew), "/5"));
- }
- }
- }
- }
- goto("wait");
- }
- goto("wait");
|