123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("block_click");
- event.load("entity_click");
- stage = 0;
- all_stages = 3;
- quest_name = "Vorbereitungen";
- chest_loc = loc.new(world.get("story"), -1635, 76, -1037);
- key = read.item("minecraft:tripwire_hook", 1, "§rSchlüssel");
- @wait
- wait();
- if(!player.isQuester(player, script)) {
- goto("wait");
- }
- if(event == "quest_term") {
- //Hier Code einfügen...
- wait(); //Script wird von außen terminiert
- }
- if(event == "quest_start") {
- quest.display(player, quest_name, stage, all_stages);
- player.giveItem(player, key);
- msg.prefix(player, "§dKumpel", "Auf meiner Position auf dem Mast des Schiffs befindet sich ein Kompass. Er ist in einer verschlossenen Kiste aufbewahrt.");
- scheduler.msgPrefix(30, player, "§dKumpel", "Bitte suche ihn und bringe ihn zu mir. Das wird unsere Flucht von der Insel erleichtern.");
- scheduler.msgPrefix(60, player, "§dKumpel", "Hier hast du den Schlüssel für die Kiste.");
- goto("wait");
- }
- label = concat("stage", text.number(stage));
- goto(label);
- @stage0
- if(event == "block_click") {
- if(block_type == "minecraft:chest") {
- item = living.getEquip(player, "hand");
- item_type = item.getType(item);
- if(item_type != "minecraft:tripwire_hook") {
- cancel = true;
- msg.prefix(player, "§dKumpel", "Diese Kiste ist verschlossen.");
- goto("wait");
- }
- if(block_loc != chest_loc) {
- cancel = true;
- msg.prefix(player, "§dKumpel", "Das ist nicht die richtige Kiste.");
- goto("wait");
- }
- stage.increase(player);
- block.addItem(block_loc, read.item("minecraft:compass"));
- }
- }
- 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:compass") {
- stage.increase(player);
- player.removeItem(player, read.item(item_type));
- msg.prefix(player, "§dKumpel", "Bitte bring mir auch den Schlüssel wieder zurück.");
- } else {
- msg.prefix(player, "§dKumpel", "Was soll ich damit?");
- }
- }
- }
- goto("wait");
- @stage2
- 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:tripwire_hook") {
- amount = item.getAmount(item);
- item.setAmount(item, amount - 1);
- msg.prefix(player, "§dKumpel", "Lang lebe die Navigation, die Freiheit und die Menschlichkeit!");
- player.setShipProgress(player, 11);
- msg(player, "§dQuest abgeschlossen. Belohnung: 6 Snuvis!");
- addMoney(player, 6);
- quest.finish(script, player);
- } else {
- msg.prefix(player, "§dKumpel", "Was soll ich damit?");
- }
- }
- }
- goto("wait");
|