123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("block_break");
- event.load("entity_click");
- stage = 0;
- all_stages = 2;
- quest_name = "Baumaterial besorgen";
- broken = 0;
- given = 0;
- @wait
- wait();
- if(!player.isQuester(player, script)) {
- goto("wait");
- }
- if(event == "quest_term") {
- entity.cleareffects(player);
- wait(); //Script wird von außen terminiert
- }
- if(event == "quest_start") {
- quest.display(player, quest_name, stage, all_stages);
- player.giveSingleItem(player, read.item("minecraft:stone_axe"), false);
- msg.prefix(player, "§dKumpel", "Wir brauchen ein Floß, um von der Insel hier wegzukommen.");
- scheduler.msgPrefix(30, player, "§dKumpel", "Sammle uns 8 Holzstämme, damit ich uns ein Floß bauen kann.");
- goto("wait");
- }
- label = concat("stage", text.number(stage));
- goto(label);
- @stage0
- if(event == "block_break") {
- if(block_type == "minecraft:jungle_log") {
- cancel = false;
- scheduler.setBlock(5, block_loc, block_type, false);
- broken++;
- if(broken == 8) {
- stage.increase(player);
- }
- }
- }
- goto("wait");
- @stage1
- if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
- entity_name = entity.getName(entity);
- if(entity_name == "Kumpel") {
- item = living.getEquip(player, "hand");
- item_type = item.getType(item);
- if(item_type == "minecraft:jungle_log") {
- given++;
- player.removeItem(player, read.item(item_type));
- if(given == 8) {
- msg.prefix(player, "§dKumpel", "Bald kann die Reise beginnen.");
- player.setShipProgress(player, 7);
- entity.cleareffects(player);
- msg(player, "§dQuest abgeschlossen. Belohnung: 4 Snuvis!");
- addMoney(player, 4);
- quest.finish(script, player);
- }
- } else {
- msg.prefix(player, "§dKumpel", "Was soll ich damit?");
- }
- }
- }
- goto("wait");
|