123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("craft");
- event.load("entity_click");
- stage = 0;
- all_stages = 2;
- quest_name = "Ich bin durstig";
- 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.giveItem(player, read.item("minecraft:glass", 3));
- msg.prefix(player, "§dKumpel", "Nimm dieses Glas und crafte daraus Glasflaschen. Befülle sie mit Wasser und bringe sie mir.");
- goto("wait");
- }
- label = concat("stage", text.number(stage));
- goto(label);
- @stage0
- if(event == "craft") {
- if(item.getType(result) == "minecraft:glass_bottle") {
- 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:potion") {
- given++;
- amount = item.getAmount(item);
- item.setAmount(item, amount - 1);
- if(given == 3) {
- msg.prefix(player, "§dKumpel", "Vielen Dank, mir geht es schon viel besser.");
- player.setShipProgress(player, 9);
- 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");
|