12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("block_break");
- event.load("entity_click");
- event.load("block_click");
- event.load("craft");
- stage = 0;
- all_stages = 3;
- quest_name = "Schiffbruch";
- stone = 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") {
- entity.addEffect(player, "nausea", 9999, 0);
- quest.display(player, quest_name, stage, all_stages);
- player.giveSingleItem(player, read.item("minecraft:stone_pickaxe"), false);
- msg.prefix(player, "§dKumpel", "Guten Morgen Kamerad! Wie du merkst, waren wir heute Nacht 'etwas' angetrunken.");
- scheduler.msgPrefix(30, player, "§dKumpel", "Leider haben wir dabei unser gutes Schiff auf Sand gesetzt.");
- scheduler.msgPrefix(60, player, "§dKumpel", "Alles was wir zum Überleben brauchen, müssen wir uns von dieser Insel holen.");
- scheduler.msgPrefix(90, player, "§dKumpel", "Diesen Ofen hier habe ich auf der Insel gefunden, er ist aber leider kaputt.");
- scheduler.msgPrefix(120, player, "§dKumpel", "Sammle 8 Bruchstein, crafte einen neuen Ofen und bring ihn mir.");
- goto("wait");
- }
- if(event == "block_click") {
- if(block_type == "minecraft:furnace") {
- cancel = true;
- msg.prefix(player, "§dKumpel", "Dieser Ofen ist leider kaputt. Deshalb besorgst du gerade einen neuen.");
- }
- goto("wait");
- }
- label = concat("stage", text.number(stage));
- goto(label);
- @stage0
- if(event == "block_break") {
- if(block_type == "minecraft:cobblestone" || block_type == "minecraft:cobblestone_slab") {
- cancel = true;
- player.safeGiveItem(player, read.item("minecraft:cobblestone"));
- stone++;
- if(stone >= 8) {
- stage.increase(player);
- }
- }
- }
- goto("wait");
- @stage1
- if(event == "craft") {
- if(item.getType(result) == "minecraft:furnace") {
- stage.increase(player);
- }
- }
- 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:furnace") {
- msg.prefix(player, "§dKumpel", "Lassen wir die Mahlzeiten brutzeln, Kamerad!");
- player.removeItem(player, item);
- player.setShipProgress(player, 1);
- entity.cleareffects(player);
- msg(player, "§dQuest abgeschlossen. Belohnung: 4 Snuvis!");
- addMoney(player, 4);
- quest.finish(script, player);
- }
- }
- }
- goto("wait");
|