Browse Source

schiffbruch quest

Kajetan Johannes Hammerle 3 years ago
parent
commit
e87d4a559e

+ 1 - 1
docu_minecraft.php

@@ -313,7 +313,7 @@
         </tr>
         <tr>
             <td class="bold">Variablen</td>
-            <td>living_entity<br>item<br>reuslt (result item)</td>
+            <td>living_entity<br>item<br>result (result item)</td>
         </tr>
     </table>
     <table>

+ 5 - 7
minigames/inverting/inverting.txt

@@ -38,14 +38,9 @@ if(event == "player_join") {
 	entity.setHealth(player, 20);
 	player.setHunger(player, 20);
 	player.setSaturation(player, 5);
-	display.reset(player);
 	player.clearInventory(player);
 	player.setGamemode(player, "survival");
 	player.setFly(player, true);
-	display.add(player, 0, gamename);
-	display.add(player, 1, "Swaps:");
-	clicked = 0;
-	display.add(player, 2, text.number(clicked));
 	lapis_block_type = "minecraft:lapis_block";
 	redstone_block_type = "minecraft:redstone_block";
 	gosub("newfield");
@@ -88,6 +83,11 @@ if(event == "block_click") {
 goto("wait");
 
 @newfield
+display.reset(player);
+display.add(player, 0, gamename);
+display.add(player, 1, "Swaps:");
+clicked = 0;
+display.add(player, 2, text.number(clicked));
 renewing = true;
 for(i = 0; i <= iterations; i++) {
 	centerloc = loc.new(gamesworld, math.random(x1, x2), y1, math.random(z1, z2));
@@ -162,7 +162,5 @@ if(diff != null) {
 minigame.statsLine(player, "§e", "Won games", text.number(playedgames));
 addMoney(player, money);
 
-clicked = 0;
-display.add(player, 2, text.number(clicked));
 gosub("newfield");
 goto("wait");

+ 13 - 7
minigames/jumpnrun/todesjumpnrun.txt

@@ -261,34 +261,38 @@ if(key == 9) {
 mode = tjr.getMode();
 if(mode == "whole") {
 	if(key == 1) {
-		entity.setBurning(player, 0);
+		entity.setHealth(player, 20);
 		tjr.teleportModule(player, jumpstage);
+		entity.setBurning(player, 0);
 		goto("wait");
 	}
 	if(key == 2) {
-		entity.setBurning(player, 0);
+		entity.setHealth(player, 20);
 		jumpstage = 0;
 		tjr.setStarttime();
 		tjr.setWholeTimeTemp(player, 0);
 		tjr.setWholeModuleTemp(player, 0);
 		tjr.teleportModule(player, jumpstage);
+		entity.setBurning(player, 0);
 	}
 	goto("wait");
 }
 if(mode == "fly") {
 	if(key == 1) {
-		entity.setBurning(player, 0);
+		entity.setHealth(player, 20);
 		jumpstage = 0;
 		tjr.setStarttime();
 		tjr.teleportModule(player, jumpstage);
+		entity.setBurning(player, 0);
 	}
 	goto("wait");
 } 
 if(mode == "modul") {
 	if(key == 1) {
-		entity.setBurning(player, 0);
+		entity.setHealth(player, 20);
 		tjr.setStarttime();
 		tjr.teleportModule(player, jumpstage);
+		entity.setBurning(player, 0);
 		goto("wait");
 	}
 	if(key == 8) {
@@ -341,12 +345,14 @@ damage_type = damage.getType(damage_source);
 if(damage_type == "lava") {
 	++lavacounter;
 	if(lavacounter >= 8) {
-		entity.damage(player, 100);
 		lavacounter = 0;
 		mode = tjr.getMode();
-		if(mode == "modul") {
-			tjr.setStarttime();
+		scheduler.setBurning(10, player, 0);
+		if(mode == "fly") {
+			goto("wait");
 		}
+		key = 1;
+		goto("function_key");
 	}
 	goto("wait");
 }

+ 1 - 1
minigames/shoppingchaos/shoppingchaos.txt

@@ -664,7 +664,7 @@ function showstats(player, won) { //Player player, Boolean won
 	minigame.statsLine(player, "§e", "Played games", text.number(playedgames));
 	minigame.statsLine(player, "§e", "Won games", text.number(wongames));
 	if(playedgames != 0) {
-		minigame.statsLine(player, "§e", "Win ratio", concat(text.number(math.roundComma((last_record / playedgames) * 100, 2)), "%"));
+		minigame.statsLine(player, "§e", "Win ratio", concat(text.number(math.roundComma((wongames / playedgames) * 100, 2)), "%"));
 	}
 }
 

+ 6 - 4
story/admont/core.txt

@@ -52,8 +52,9 @@ if(entity_name == "Zauberlehrling") {
 }
 if(entity_name == "Felsmagier") {
 	if(time.getMillis() - map.getOrDefault(timestamp, player.getUuid(player), 0) < 120000) { //2 Minutes
-		skill.showShop(player, "Subcutaneous Inventory", "Comeback", "Head Hunter", "Mobheads", "Fly 10min", null, null, null, null);
+		skill.showShop(player, "skill.subcu_inv", "skill.comeback", "skill.head_human", "skill.head_monster", "skill.fly10min", "skill.grow", "skill.haste", "skill.speed", "skill.jump_boost", "skill.dolphin", "skill.block_up", "skill.block_down", null, null, null, null, null, null);
 	} else {
+		skill.showShop(player, "skill.subcu_inv", "skill.comeback", "skill.head_human", "skill.head_monster", "skill.fly10min", "skill.grow", "skill.haste", "skill.speed", "skill.jump_boost", "skill.dolphin", "skill.block_up", "skill.block_down", null, null, null, null, null, null);
 		msg.prefix(player, "§dFelsmagier", "Du musst zuerst ein paar Aufgaben für mich erledigen. Finde meinen Zauberlehrling, der hilft dir weiter.");
 	}
 	goto("wait");
@@ -182,8 +183,9 @@ if(inv_name == "Skillshop") {
 		goto("wait");
 	}
 	skill_name = removeFormat(item.getName(item));
+	tech_name = skill.getTechName(skill_name);
 	if(skill.isPermanent(skill_name)) {
-		amount = skill.getAmount(player, skill.getTechName(skill_name));
+		amount = skill.getAmount(player, tech_name);
 		if(amount >= 1) {	
 			goto("wait");
 		}
@@ -194,8 +196,8 @@ if(inv_name == "Skillshop") {
 		goto("wait");
 	}
 	subMoney(player, cost);
-	skill.addAmount(player, skill.getTechName(skill_name), 1);
-	inv.setItem(inv, inv_slot, skill.getShopItem(player, skill_name));
+	skill.addAmount(player, tech_name, 1);
+	inv.setItem(inv, inv_slot, skill.getShopItem(player, tech_name));
 	inv.update(player);
 }
 goto("wait");

+ 0 - 6
story/admont/schatz_von_admont.txt

@@ -15,12 +15,6 @@ quest_name = "Schatz von Admont";
 
 @wait
 wait();
-if(event == "living_death") {
-	player = player.getFromDamageSource(damage_source);
-	if(player == null) {
-		goto("wait");
-	}
-}
 if(!player.isQuester(player, script)) {
 	goto("wait");
 }

+ 0 - 857
story/schiffbruch.txt

@@ -1,857 +0,0 @@
-setVar("gamesworldloc", read.location("games:8:4:8"));
-setVar("shipstartloc", read.location("games:1917.5:106:3880.5:180:0"));
-/*setVar("placeloc1", read.location("games:"));
-setVar("placeloc2", read.location("games:"));
-setVar("placeloc3", read.location("games:"));
-setVar("placeloc4", read.location("games:"));*/
-
-wheatlist = list.new();
-list.add($wheatlist, read.location("games:1905:108:3898"));
-list.add($wheatlist, read.location("games:1905:108:3899"));
-list.add($wheatlist, read.location("games:1905:108:3900"));
-list.add($wheatlist, read.location("games:1905:108:3901"));
-list.add($wheatlist, read.location("games:1904:108:3901"));
-list.add($wheatlist, read.location("games:1904:108:3902"));
-list.add($wheatlist, read.location("games:1903:108:3902"));
-list.add($wheatlist, read.location("games:1902:108:3902"));
-list.add($wheatlist, read.location("games:1902:108:3901"));
-list.add($wheatlist, read.location("games:1902:108:3900"));
-list.add($wheatlist, read.location("games:1902:108:3899"));
-list.add($wheatlist, read.location("games:1902:108:3898"));
-list.add($wheatlist, read.location("games:1903:108:3898"));
-list.add($wheatlist, read.location("games:1903:108:3897"));
-list.add($wheatlist, read.location("games:1904:108:3897"));
-
-goldblocks = list.new();
-list.add($goldblocks, read.location("games:1928:102:3845"));
-list.add($goldblocks, read.location("games:1922:102:3839"));
-list.add($goldblocks, read.location("games:1934:103:3840"));
-list.add($goldblocks, read.location("games:1945:103:3841"));
-
-setVar("animalloc", read.location("games:1911:108:3896"));
-setVar("guardianloc", read.location("games:1929:104:3861"));
-setVar("treeloc", read.location("games:1911:110:3885"));
-setVar("flowerloc", read.location("games:1929:107:3906"));
-setVar("truechestloc", read.location("games:1920:118:3840"));
-setVar("firechestloc", read.location("games:1949:107:3842"));
-setVar("firelogloc", read.location("games:1907:107:3885"));
-setVar("no-join", true);
-command("clear ", $player-name);
-entity.teleport($player, $shipstartloc);
-
-sb.reset($player);
-entity.setHealth($player, 20);
-player.setHunger($player, 20);
-player.setSaturation($player, 5);
-
-setVar("stage", ggv($player-name, "schiffstage"));
-if(equal($stage, null)) {
-	sgv($player-name, "schiffstage", 0);
-	setVar("stage", 0);
-}
-
-if(greater($stage, 0)) {
-	block.set(read.location(ggv($player-name, "schiffofenloc")), read.item("FURNACE"));
-}
-if(greaterequal($stage, 10)) {
-	block.set(read.location(ggv($player-name, "schiffcakeloc")), read.item("CAKE_BLOCK"));
-}
-if(less($stage, 9)) {
-	entity.addEffect($player, "confusion", 99999, 0);
-}
-
-if(equal($stage, 0)) goto("stage0");
-if(equal($stage, 1)) goto("stage1");
-if(equal($stage, 2)) goto("stage2");
-if(equal($stage, 3)) goto("stage3");
-if(equal($stage, 4)) goto("stage4");
-if(equal($stage, 5)) goto("stage5");
-if(equal($stage, 6)) goto("stage6");
-if(equal($stage, 7)) goto("stage7");
-if(equal($stage, 8)) goto("stage8");
-if(equal($stage, 9)) goto("stage9");
-if(equal($stage, 10)) goto("stage10");
-if(equal($stage, 11)) goto("stage11");
-if(equal($stage, 12)) goto("stage12");
-
-@stage0
-event.load("block-break");
-player.giveItem($player, read.item("WOOD_PICKAXE"));
-abgebaut_loc = list.new();
-abgebaut_type = list.new();
-setVar("tempstone", 0);
-player.speak($player, "§2Kumpel", "Guten Morgen Kamerad! Wie du merkst, waren wir heute Nacht 'etwas' angetrunken.");
-player.speak($player, "§2Kumpel", "Leider haben wir dabei unser gutes Schiff auf Sand gesetzt. Was wir bei uns trugen, fiel ins tiefe Wasser.");
-player.speak($player, "§2Kumpel", "Alles was wir zum Überleben brauchen, müssen wir uns von dieser Insel holen. Mit 'wir' meine ich dich, denn ich habe mir mein Bein gebrochen.");
-player.speak($player, "§2Kumpel", "Zuerst benötigen wir einen Ofen, um Mahlzeiten zubereiten zu können. Sammle 8 Bruchstein, crafte einen Ofen und platziere ihn beliebig auf der Grasfläche.");
-
-@waitstage0
-wait();
-if(equal($event, "block-break")) {
-	if(or(equal($block-type, "COBBLESTONE"), equal($block-type, "COBBLESTONE"))) {
-		setVar("cancel", false);
-		list.add($abgebaut_loc, $block-loc);
-		list.add($abgebaut_type, $block-type);
-		inc("tempstone");
-		if(greaterequal($tempstone, 8)) {
-			event.unload("block-break");
-			event.load("craft");
-		}
-	} else() {
-		setVar("cancel", true);
-	}
-}
-if(equal($event, "craft")) {
-	if(equal($item-type, "FURNACE")) {
-		event.unload("craft");
-		event.load("block-place");
-	}
-}
-if(equal($event, "block-place")) {
-	if(and(equal(block.getType(loc.mod($block-loc, 0, -1, 0)), "GRASS"), equal($block-type, "FURNACE"))) {
-		player.speak($player, "§2Kumpel", "Lass die Mahlzeiten brutzeln, Kamerad.");
-		setVar("cancel", false);
-		sgv($player-name, "schiffofenloc", text.location($block-loc));
-		setVar("i", -1);
-		while(less(inc("i"), list.getSize($abgebaut_loc))) {
-			block.set(list.getIndex($abgebaut_loc, $i), read.item(list.getIndex($abgebaut_type, $i)));
-		}
-		event.unload("block-place");
-		removeVar("tempstone");
-		inc("stage");
-		sgv($player-name, "schiffstage", $stage);
-		sgoto(40, "stage1");
-	} else() {
-		setVar("cancel", true);
-	}
-}
-goto("waitstage0");
-
-@stage1
-player.speak($player, "§2Kumpel", "Berge die vier Goldblöcke aus dem havariertem Schiff und bringe sie mir.");
-player.giveItem($player, read.item("IRON_PICKAXE"));
-event.load("block-break");
-event.load("villager-give");
-setVar("tempgiven", 0);
-
-setVar("i", -1);
-while(less(inc("i"), list.getSize($goldblocks))) {
-	block.set(list.getIndex($goldblocks, $i), read.item("GOLD_BLOCK"));
-}
-
-@waitstage1
-wait();
-if(equal($event, "block-break")) {
-	if(and(equal($block-type, "GOLD_BLOCK"), list.contains($goldblocks, $block-loc))) {
-		setVar("cancel", false);
-		list.remove($goldblocks, $block-loc);
-		if(equal(list.getSize($goldblocks), 0)) {
-			player.speak($player, "§2Kumpel", "Sehr gut, bring das Gold nun mir.");
-			event.unload("block-break");
-			goto("waitstage1");
-		}
-	} else() {
-		setVar("cancel", true);
-	}
-}
-if(equal($event, "villager-give")) {
-	if(equal($item-type, "GOLD_BLOCK")) {
-		setVar("cancel", false);
-		setVar("tempgiven", add($tempgiven, $item-amount));
-		if(greaterequal($tempgiven, 4)) {
-			player.speak($player, "§2Kumpel", "Wir haben den Schatz geborgen. Wenn wir überleben, sind wir reich!");
-			inc("stage");
-			sgv($player-name, "schiffstage", $stage);
-			sgoto(40, "stage2");
-		} else() {
-			player.speak($player, "§2Kumpel", "Ich bekomme noch ", sub(4, $tempgiven), " Goldblöcke von dir.");
-		}
-	} else() {
-		setVar("cancel", true);
-		player.speak($player, "§2Kumpel", "Was soll ich damit?");
-	}
-}
-goto("waitstage1");
-
-@stage2
-player.speak($player, "§2Kumpel", "In der Zwischenzeit habe ich eine Farm errichtet. Ernte genug Weizen, damit du uns vier Brote craften kannst."); 
-event.load("block-break");
-event.load("craft");
-setVar("playerbread1", player.getItemAmount($player, true, read.item("BREAD")));
-
-setVar("i", -1);
-while(less(inc("i"), list.getSize($wheatlist))) {
-	block.set(list.getIndex($wheatlist, $i), read.item("CROPS:7"));
-}
-
-@waitstage2
-wait();
-if(equal($event, "block-break")) {
-	if(and(equal($block-type, "CROPS"), equal($block-data, 7))) {
-		setVar("cancel", false);
-		goto("waitstage2");
-	} else() {
-		setVar("cancel", true);
-	}
-}
-if(equal($event, "craft")) {
-	if(equal($item-type, "BREAD")) {
-		sgoto(1, "checkbread");
-	}
-}
-goto("waitstage2");
-
-@checkbread
-setVar("playerbread2", player.getItemAmount($player, true, read.item("BREAD")));
-setVar("crafted", sub($playerbread2, $playerbread1));
-if(greaterequal($crafted, 4)) {
-	player.speak($player, "§2Kumpel", "Läuft doch gut!");
-	inc("stage");
-	sgv($player-name, "schiffstage", $stage);
-	sgoto(40, "stage3");
-} else() {
-	player.speak($player, "§2Kumpel", "Es fehlen noch ", sub(4, $crafted), " Brote.");
-}
-goto("waitstage2");
-
-@stage3
-player.speak($player, "§2Kumpel", "Nimm diese Angel und fang uns zum Abendessen einen Fisch.");
-player.giveItem($player, read.item("FISHING_ROD"));
-event.load("fishing");
-
-@waitstage3
-wait();
-if(equal($event, "fishing")) {
-	player.speak($player, "§2Kumpel", "Lass es dir schmecken.");
-	inc("stage");
-	sgv($player-name, "schiffstage", $stage);
-	sgoto(40, "stage4");
-}
-goto("waitstage3");
-
-@stage4
-player.speak($player, "§2Kumpel", "Letzte Nacht habe ich etwas gehört. Bitte sieh beim Schiffswrack nach, ob sich dort ein Seeungeheuer herumtreibt. Wenn du es siehst, töte es, bevor uns etwas passiert.");
-setVar("guardian", read.spawnMob($guardianloc, "{id:'GUARDIAN'}"));
-event.load("entity-kill");
-event.load("player-respawn");
-player.giveItem($player, read.item("STONE_SWORD"));
-
-@waitstage4
-wait();
-if(and(equal($event, "entity-kill"), equal($entity-type, "GUARDIAN"))) {
-	player.speak($player, "§2Kumpel", "Lang lebe die Sicherheit.");
-	inc("stage");
-	sgv($player-name, "schiffstage", $stage);
-	sgoto(40, "stage5");
-}
-if(equal($event, "player-respawn")) {
-	setVar("respawn-loc", $shipstartloc);
-}
-goto("waitstage4");
-
-@stage5
-player.speak($player, "§2Kumpel", "Fälle den Baum nahe der Feuerstelle und gib mir das Holz, dann kann ich uns ein schönes Floß bauen.");
-player.giveItem($player, read.item("STONE_AXE"));
-event.load("block-break");
-setVar("tempbroken", 0);
-
-block.set(loc.mod($treeloc, 0, -3, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, -2, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, -1, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, 0, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, 1, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, 2, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, 3, 0), read.item("LOG:3"));
-block.set(loc.mod($treeloc, 0, 4, 0), read.item("LOG:3"));
-
-block.set(loc.mod($treeloc, -2, 2, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -2, 2, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -2, 2, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 2, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 2, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 2, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 2, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 2, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 2, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 2, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 2, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 2, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 2, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 2, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 2, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 2, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 2, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 2, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 2, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 2, 1), read.item("LEAVES:3"));
-
-block.set(loc.mod($treeloc, -2, 3, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -2, 3, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -2, 3, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -2, 3, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -2, 3, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 3, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 3, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 3, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 3, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 3, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 3, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 3, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 3, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 3, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 3, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 3, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 3, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 3, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 3, 2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 3, -2), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 3, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 3, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 3, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 2, 3, 2), read.item("LEAVES:3"));
-
-block.set(loc.mod($treeloc, -1, 4, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 4, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, -1, 4, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 4, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 4, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 4, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 4, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 4, 1), read.item("LEAVES:3"));
-
-block.set(loc.mod($treeloc, -1, 5, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 5, -1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 5, 0), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 0, 5, 1), read.item("LEAVES:3"));
-block.set(loc.mod($treeloc, 1, 5, 0), read.item("LEAVES:3"));
-
-@waitstage5
-wait();
-if(equal($event, "block-break")) {
-	if(less(loc.distance($block-loc, $treeloc), 6)) {
-		if(equal($block-type, "LOG")) {
-			setVar("cancel", false);
-			inc("tempbroken");
-			if(greaterequal($tempbroken, 8)) {
-				event.load("villager-give");
-				event.unload("block-break");
-				setVar("tempgiven", 0);
-				removeVar("tempbroken");
-			}
-		}
-		if(equal($block-type, "LEAVES")) {
-			setVar("cancel", false);
-		}
-	}
-}
-if(equal($event, "villager-give")) {
-	if(and(equal($item-type, "LOG"), equal($item-data, 3))) {
-		setVar("tempgiven", add($tempgiven, $item-amount));
-		if(greaterequal($tempgiven, 8)) {
-			player.speak($player, "§2Kumpel", "Bald kann die Reise beginnen.");
-			removeVar("tempgiven");
-			inc("stage");
-			sgv($player-name, "schiffstage", $stage);
-			sgoto(40, "stage6");
-		} else() {
-			player.speak($player, "§2Kumpel", "Ich brauche noch ", sub(8, $tempgiven), " Stück Holz.");
-		}
-	} else() {
-		setVar("cancel", true);
-		player.speak($player, "§2Kumpel", "Was soll ich damit?");
-	}
-}
-goto("waitstage5");
-
-@stage6
-player.speak($player, "§2Kumpel", "Mein Schiffsaffe ist vor genau einem Jahr gestorben. Ich hab ihn damals auf dieser Insel vergraben. Bitte stelle diese Blume auf sein Grab.");
-event.load("block-place");
-player.giveItem($player, read.item("RED_ROSE:4"));
-block.set($flowerloc, read.item("AIR"));
-
-@waitstage6
-wait();
-if(and(equal($event, "block-place"), equal($block-loc, $flowerloc), equal($block-type, "RED_ROSE"), equal($block-data, 4))) {
-	player.speak($player, "§2Kumpel", "Er möge in Frieden ruhen.");
-	setVar("cancel", false);
-	inc("stage");
-	sgv($player-name, "schiffstage", $stage);
-	sgoto(40, "stage7");
-} else() {
-	setVar("cancel", true);
-}
-goto("waitstage6");
-
-@stage7
-player.speak($player, "§2Kumpel", "Nimm dieses Glas und crafte daraus Glasflaschen. Befülle sie mit Wasser und bringe sie mir.");
-event.load("craft");
-event.load("villager-give");
-player.giveItem($player, read.item("GLASS:0:3"));
-
-@waitstage7
-wait();
-if(equal($event, "craft")) {
-	if(equal($item-type, "GLASS_BOTTLE")) {
-		setVar("filled", 0);
-		event.unload("craft");
-		event.load("air-click");
-	}
-}
-if(equal($event, "air-click")) {
-	if(and(equal(item.getType(entity.getEquip($player, "hand")), "GLASS_BOTTLE"), equal($action, "RIGHT_CLICK_AIR"))) {
-		inc("filled");
-		if(greaterequal($filled, 3)) {
-			event.unload("air-click");
-			event.load("villager-give");
-			setVar("given", 0);
-		}
-	}
-}
-if(equal($event, "villager-give")) {
-	if(equal($item-type, "POTION")) {
-		setVar("given", add($given, $item-amount));
-		if(greaterequal($given, 3)) {
-			player.speak($player, "§2Kumpel", "Vielen Dank, mir geht es schon viel besser.");
-			inc("stage");
-			sgv($player-name, "schiffstage", $stage);
-			sgoto(40, "stage8");
-		} else() {
-			player.speak($player, "§2Kumpel", "Ich brauche noch ", sub(3, $given), " Wasserflaschen.");
-		}
-	} else() {
-		setVar("cancel", true);
-		player.speak($player, "§2Kumpel", "Was soll ich damit?");
-	}
-}
-goto("waitstage7");
-
-@stage8
-player.speak($player, "§2Kumpel", "Nimm dir diesen Eimer und melke eine Kuh. Trink die Milch, dann gehts dir besser.");
-event.load("entity-click");
-setVar("cow", read.spawnMob($animalloc, "{id:'COW'}"));
-player.giveItem($player, read.item("BUCKET"));
-
-@waitstage8
-wait();
-if(and(equal($event, "entity-click"), equal($entity-type, "COW"))) {
-	event.unload("entity-click");
-	event.load("consume");
-	player.removeItem($player, read.item("BUCKET"));
-	player.giveItem($player, read.item("MILK_BUCKET"));
-}
-if(and(equal($event, "consume"), equal($item-type, "MILK_BUCKET"))) {
-	player.speak($player, "§2Kumpel", "Sag ich doch. Milch hilft immer.")
-	entity.remove($cow);;
-	inc("stage");
-	sgv($player-name, "schiffstage", $stage);
-	sgoto(40, "stage9");
-}
-goto("waitstage8");
-
-@stage9
-player.speak($player, "§2Kumpel", "Jetzt, wo es uns doch so gut geht, lass uns einen Kuchen backen. Hier hast du drei Eimer. Besorge dir alle Zutaten von der Insel. Wenn du alles beisammen hast, stelle einen Kuchen her und platziere ihn auf dem Ofen.");
-player.speak($player, "§2Kumpel", "Für einen Kuchen brauchst du: 3 Eimer Milch, 2 Zucker, 1 Ei (Huhn rechtsklicken) und 3 Weizen.");
-event.load("block-break");
-event.load("entity-click");
-event.load("craft");
-setVar("milk", 0);
-setVar("canebroken", 0);
-setVar("eggsgiven", 0);
-setVar("harvested", 0);
-setVar("milkgiven", 0);
-setVar("playersugar1", player.getItemAmount($player, true, read.item("SUGAR")));
-setVar("chicken", read.spawnMob($animalloc, "{id:'CHICKEN'}"));
-setVar("cow", read.spawnMob($animalloc, "{id:'COW'}"));
-player.giveItem($player, read.item("BUCKET:0:3"));
-setVar("wheat", false);
-setVar("sugar", false);
-setVar("milk", false);
-setVar("egg", false);
-
-setVar("i", -1);
-while(less(inc("i"), list.getSize($wheatlist))) {
-	block.set(list.getIndex($wheatlist, $i), read.item("CROPS:7"));
-}
-
-block.set(read.location("games:1894:106:3879"), read.item("SUGAR_CANE_BLOCK"));
-block.set(read.location("games:1894:107:3879"), read.item("SUGAR_CANE_BLOCK"));
-block.set(read.location("games:1892:106:3880"), read.item("SUGAR_CANE_BLOCK"));
-block.set(read.location("games:1892:107:3880"), read.item("SUGAR_CANE_BLOCK"));
-block.set(read.location("games:1891:106:3882"), read.item("SUGAR_CANE_BLOCK"));
-block.set(read.location("games:1891:107:3882"), read.item("SUGAR_CANE_BLOCK"));
-
-@waitstage9
-wait();
-if(equal($event, "block-break")) {
-	if(equal($block-type, "SUGAR_CANE_BLOCK")) {
-		if(equal(block.getType(loc.mod($block-loc, 0, -1, 0)), "SUGAR_CANE_BLOCK")) {
-			setVar("cancel", false);
-			inc("canebroken");
-			if(equal(block.getType(loc.mod($block-loc, 0, 1, 0)), "SUGAR_CANE_BLOCK")) {
-				inc("canebroken");
-			}
-		} else() {
-			setVar("cancel", true);
-		}
-		goto("waitstage9");
-	}
-	if(and(equal($block-type, "CROPS"), equal($block-data, 7))) {
-		setVar("cancel", false);
-		inc("harvested");
-		if(greaterequal($harvested, 3)) {
-			setVar("wheat", true);
-			goto("checkcake");
-		}
-	}
-	goto("waitstage9");
-}
-if(equal($event, "entity-click")) {
-	if(equal($entity-type, "COW")) {
-		inc("milkgiven");
-		if(greaterequal($milkgiven, 3)) {
-			setVar("milk", true);
-			goto("checkcake");
-		}
-		goto("waitstage9");
-	}
-	if(and(equal($entity-type, "CHICKEN"), invert($egg))) {
-		player.giveItem($player, read.item("EGG"));
-		inc("eggsgiven");
-		setVar("egg", true);		
-		goto("checkcake");
-	}
-}
-if(equal($event, "craft")) {
-	if(and(equal($item-type, "SUGAR"), greater($canebroken, 1))) {
-		sgoto(1, "checksugar");
-	}
-	if(equal($item-type, "CAKE")) {
-		event.unload("craft");
-		event.load("block-place");
-	}
-	goto("waitstage9");
-}
-if(and(equal($event, "block-place"), equal(block.getType(loc.mod($block-loc, 0, -1, 0)), "FURNACE"))) {
-	if(equal($block-type, "CAKE_BLOCK")) {
-		setVar("cancel", false);
-		sgv($player-name, "schiffcakeloc", text.location($block-loc));
-		player.speak($player, "§2Kumpel", "Auf das wir noch ein langes Leben haben.");
-		entity.remove($cow);
-		entity.remove($chicken);
-		inc("stage");
-		sgv($player-name, "schiffstage", $stage);
-		sgoto(40, "stage10");
-	} else() {
-		setVar("cancel", true);
-	}
-}
-goto("waitstage9");
-
-@checksugar
-setVar("playersugar2", player.getItemAmount($player, true, read.item("SUGAR")));
-setVar("crafted", sub($playersugar2, $playersugar1));
-if(greaterequal($crafted, 2)) {
-	setVar("sugar", true);
-	goto("checkcake");
-} else() {
-	player.speak($player, "§2Kumpel", "Es fehlen noch ", sub(2, $crafted), " Stück Zucker.");
-}
-goto("waitstage9");
-
-@checkcake
-if(and($wheat, $sugar, $milk, $egg)) {
-	event.unload("entity-click");
-	event.unload("block-break");
-	setVar("allcakeitems", true);
-}
-goto("waitstage9");
-
-@stage10
-player.speak($player, "§2Kumpel", "Auf meiner Position auf dem Mast des Schiffs befindet sich ein Kompass. Er ist in einer verschlossenen Kiste aufbewahrt. Bitte suche ihn und bringe ihn zu mir. Das wird uns unsere Flucht von der Insel erleichtern. Hier hast du den Schlüssel für die Kiste.");
-event.load("block-click");
-player.giveItem($player, read.item("TRIPWIRE_HOOK", "Schlüssel"));
-setVar("temp1", false);
-setVar("temp2", false);
-
-@waitstage10
-wait();
-if(equal($event, "block-click")) {
-	if(equal($block-type, "CHEST")) {
-		setVar("cancel", true);
-		if(equal(item.getType(entity.getEquip($player, "hand")), "TRIPWIRE_HOOK")) {
-			if(equal(item.getName(entity.getEquip($player, "hand")), "Schlüssel")) {
-				if(equal($block-loc, $truechestloc)) {
-					event.load("villager-give");
-					event.unload("block-click");
-					player.giveItem($player, read.item("COMPASS"));
-					player.speak($player, "§2Kumpel", "Bitte bring mir auch den Schlüssel wieder zurück.");
-					goto("waitstage10");
-				}
-				if(notequal($block-loc, !=, $truechestloc)) {
-					player.speak($player, "§2Kumpel", "Das ist nicht die richtige Kiste.");
-					goto("waitstage10");
-				}
-			}
-		}
-	}
-	goto("waitstage10");
-}
-if(equal($event, "villager-give")) {
-	if(or(equal($item-type, "TRIPWIRE_HOOK"), equal($item-type, "COMPASS"))) {
-		if(equal($item-type, "TRIPWIRE_HOOK")) {
-			setVar("temp1", true);
-		}
-		if(equal($item-type, "COMPASS")) {
-			setVar("temp2", true);
-		}
-	} else() {
-		setVar("cancel", true);
-		player.speak($player, "§2Kumpel", "Was soll ich damit?");
-		goto("waitstage10");
-	}
-	if(and($temp1, $temp2)) {
-		removeVar("temp1");
-		removeVar("temp2");
-		player.speak($player, "§2Kumpel", "Lang lebe die Navigation, die Freiheit und die Menschlichkeit!");
-		inc("stage");
-		sgv($player-name, "schiffstage", $stage);
-		sgoto(40, "stage11");
-	}
-goto("waitstage10");
-
-@stage11
-player.speak($player, "§2Kumpel", "Hier hast du einen Holzstamm. Lege ihn auf die Feuerstelle und gehe danach zum Schiff. In der Kiste auf dem Bug des Schiffs findest du Materialien für ein Feuerzeug. Zünde damit das Holz an, damit wir unsere Kleider über dem Feuer trocknen können.");
-event.load("block-place");
-player.giveItem($player, read.item("LOG:3", "Feuerholz", "Auf der Feuerstelle platzieren"));
-block.set($firelogloc, read.item("AIR"));
-block.set(loc.mod($firelogloc, 0, 1, 0), read.item("AIR"));
-
-@waitstage11
-wait();
-if(equal($event, "block-place")) {
-	if(and(equal($block-loc, $firelogloc), equal($block-type, "LOG"))) {
-		setVar("cancel", false);
-		event.unload("block-place");
-		event.load("block-click");
-	}
-	goto("waitstage11");
-}
-if(equal($event, "block-click")) {
-	if(equal($block-type, "CHEST")) {
-		setVar("cancel", true);
-		if(equal($block-loc, $firechestloc)) {
-			event.load("craft");
-			event.unload("block-click");
-			player.giveItem($player, read.item("FLINT"));
-			player.giveItem($player, read.item("IRON_INGOT"));
-		}
-		if(notequal($block-loc, $firechestloc)) {
-			player.speak($player, "§2Kumpel", "Das ist nicht die richtige Kiste.");
-		}
-	}
-	if(equal($block-type, "LOG")) {
-		if(equal($block-loc, $firelogloc)) {
-			if(equal($action, "RIGHT_CLICK_BLOCK")) {
-				player.speak($player, "§2Kumpel", "Feuer! Es lodere wie die Wut von unzufriedenem Volke.");
-				inc("stage");
-				sgv($player-name, "schiffstage", $stage);
-				sgoto(40, "stage12");
-			}
-		}
-	}
-	goto("waitstage11");
-}
-if(equal($event, "craft")) {
-	if(equal($item-type, "FLINT_AND_STEEL")) {
-		event.unload("craft");
-		event.load("block-click");
-	}
-}
-goto("waitstage11");
-
-@stage12
-player.speak($player, "§2Kumpel", "Gut, dass du hier bist. Auf der anderen Seite der Insel habe ich eine Hexe gesehen.");
-
-placelocs = list.new();
-list.add($placelocs, $placeloc1);
-list.add($placelocs, $placeloc2);
-list.add($placelocs, $placeloc3);
-list.add($placelocs, $placeloc4);
-
-event.load("entity-kill");
-event.load("player-respawn");
-setVar("witch", read.spawnMob($spawnhexeloc, "{id:'WITCH'}"));
-block.set($placeloc1, read.item("AIR"));
-block.set($placeloc2, read.item("AIR"));
-block.set($placeloc3, read.item("AIR"));
-block.set($placeloc4, read.item("AIR"));
-block.set($witherloc, read.item("SKULL:1"));
-block.set($creeperloc, read.item("SKULL:4"));
-block.set($zombieloc, read.item("SKULL:2"));
-block.set($skelettloc, read.item("SKULL"));
-
-@waitstage12a
-wait();
-if(equal($event, "entity-kill")) {
-	if(equal($entity-type, "WITCH")) {
-		player.speak($player, "§2Kumpel", "Hörst du das auch? Es scheint, als würden böse Kreaturen unter der Insel erwachen. Gehe besser nachschauen. Ich habe letztens ein kleines Loch in der Mitte der Insel gefunden. Vielleicht kommen die Geräsuche von dort.");
-		event.load("block-click");
-		event.load("entity-hurt");
-		player.giveItem($player, read.item("STICK", "Zauberstab der Elemente", "Achtung, fragil!"));
-		player.giveItem($player, read.item("STONE_SWORD"));
-
-		setVar("i", -1);
-		while(less(inc("i"), 10)) {
-			setVar("witherskeleton", read.spawnMob($spawnwitherloc, "{id:'WITHER_SKELETON'}"));
-			setVar("skeleton", read.spawnMob($spawnskelettloc, "{id:'SKELETON'}"));
-			setVar("creeper", read.spawnMob($spawncreeperloc, "{id:'CREEPER'}"));
-			setVar("zombie", read.spawnMob($spawnzombieloc, "{id:'ZOMBIE'}"));
-		}
-		setVar("skulls", 0);
-		setVar("enter", false);
-	}
-if(equal($event, "player-respawn")) {
-	setVar("respawn-loc", $shipstartloc);
-}
-goto("waitstage12a");
-
-@waitstage12b
-wait();
-if(equal($event, "player-respawn")) {
-	setVar("respawn-loc", $shipstartloc);
-}
-if(equal($event, "block-click")) {
-	if(and(equal($block-type, "WOOD_BUTTON"), invert($enter))) {
-		player.speak($player, "§2Kumpel", "Ach du meine Güte. Alles voller Monster. Und sie scheinen diesen magischen Ort zu bewachen. Was an dem wohl so besonders ist?");
-		setVar("enter", true);
-		goto("waitstage12b");
-	}
-}
-if(equal($event, "entity-hurt")) {
-	if(equal(item.getType(entity.getEquip($player, "hand")), "STICK")) {
-		entity.damage($entity, 3);
-	} else() {
-		player.speak($player, "§2Kumpel", "Diese Monster sind mit irdischen Waffen unbesiegbar.");
-		setVar("cancel", true);
-	}
-}
-if(equal($event, "entity-kill")) {
-	if(equal($entity-type, "WITHER")) {
-		player.giveItem($player, read.item("SKULL"));
-		inc("skulls");
-		goto("checkskulls");
-	}
-	if(equal($entity-type, "ZOMBIE")) {
-		player.giveItem($player, read.item("SKULL:1"));
-		inc("skulls");
-		goto("checkskulls");
-	}
-	if(equal($entity-type, "SKELETON")) {
-		player.giveItem($player, read.item("SKULL:2"));
-		inc("skulls");
-		goto("checkskulls");
-	}
-	if(equal($entity-type, "CREEPER")) {
-		player.giveItem($player, read.item("SKULL:4"));
-		inc("skulls");
-		goto("checkskulls");
-	}
-}
-goto("waitstage12b");
-
-@checkskulls
-if(greaterequal($skulls, 4)) {
-	player.speak($player, "§2Kumpel", "Es schaut so aus, als würden diese Köpfe auf die hervorgehobenen Plätze gehören.");
-	event.load("block-place");
-	event.unload("block-click");
-	event.unload("entity-hurt");
-	event.unload("player-respawn");
-	setVar("i", 0);
-	setVar("counter", 0);
-	goto("waitstage12c");
-} else() {
-	goto("waitstage12b");
-}
-
-@waitstage12c
-wait();
-if(equal($event, "block-place")) {
-	setVar("cancel", true)
-	if(and(list.contains($placelocs, $block-loc), equal($item-type, "SKULL"))) {
-		setVar("cancel", false);
-		inc("i");
-		msg($player, "Gesetzte Köpfe: ", $i, "/4");
-		if(greaterequal($i, 4)) {
-			setVar("evil", read.spawnMob($evilloc, "{id:'VILLAGER'}"));
-			entity.setName($evil, "§cBeelzebub");
-			entity.setEquip($evil, "head", read.item("IRON_HELMET"));
-			player.speak($player, "§cBeelzebub", "Dir werde ich das fürchten lehren! Nie mehr wirst du vor mir Ruhe haben! Vielleicht weißt du jetzt, wodurch dein Schiff gesunken ist?");
-			waitFor(180);
-			player.speak($player, "§cBeelzebub", "Muahahaha..., nimm dies.");
-			setVar("witch1", read.spawnMob($evilloc, read.item("{id:'WITCH'}")));
-			setVar("witch2", read.spawnMob($evilloc, read.item("{id:'WITCH'}")));
-			setVar("witch3", read.spawnMob($evilloc, read.item("{id:'WITCH'}")));
-			setVar("fish1", read.spawnMob($evilloc, read.item("{id:'SILVERFISH'}")));
-			setVar("fish2", read.spawnMob($evilloc, read.item("{id:'SILVERFISH'}")));
-			setVar("fish3", read.spawnMob($evilloc, read.item("{id:'SILVERFISH'}")));
-			effect.playParticle($evilloc, "EXPLOSION", 5);
-			entity.remove($evil);
-			player.speak($player, "§cBeelzebub", "Bis zum nächsten Mal...");
-		}
-	}
-}
-if(equal($event, "entity-kill")) {
-	inc("counter");
-	if(greaterequal($counter, 6)) {
-		goto("giveup");
-	}
-}
-goto("waitstage12c");
-
-@giveup
-if(equal($stage, 0)) {
-	try() {
-		setVar("i", -1);
-		while(less(inc("i"), list.getSize($abgebaut_loc))) {
-			block.set(list.getIndex($abgebaut_loc, $i), read.item(list.getIndex($abgebaut_type, $i)));
-		}
-	} catch() {
-		nothing();
-	}
-}
-if(greaterequal($stage, 1)) {
-	block.set(read.location(ggv($player-name, "schiffofenloc")), read.item("AIR"));
-}
-if(equal($stage, 4)) {
-	entity.remove($guardian);
-}
-if(equal($stage, 8)) {
-	entity.remove($cow);
-}
-if(equal($stage, 9)) {
-	entity.remove($cow);
-	entity.remove($chicken);
-}
-if(greaterequal($stage, 10)) {
-	block.set(read.location(ggv($player-name, "schiffcakeloc")), read.item("AIR"));
-}
-if(equal($stage, 11)) {
-	block.set($firelogloc, read.item("AIR"));
-	block.set(loc.mod($firelogloc, 0, 1, 0), read.item("AIR"));
-}
-if(equal($stage, 12)) {
-	block.set($firelogloc, read.item("AIR"));
-	block.set(loc.mod($firelogloc, 0, 1, 0), read.item("AIR"));
-	entity.remove($zombie);
-	entity.remove($spider);
-	entity.remove($creeper);
-	entity.remove($witherskeleton);
-}
-entity.teleport($player, $gamesworldloc);
-command("clear ", $player-name);
-sb.reset($player);
-entity.setHealth($player, 20);
-player.setHunger($player, 20);
-player.setSaturation($player, 5);
-command("effect ", $player-name, " clear");
-term();

+ 3 - 3
story/schiffbruch/core.txt

@@ -32,7 +32,7 @@ if(player.hasQuest2(player)) {
 entity_name = entity.getName(entity);
 if(entity_name == "Kumpel") {
 	inv = inv.new("333333333333333333");
-	progress = story.getShipProgress(player);
+	progress = player.getShipProgress(player);
 	inv.setItem(inv, 0, read.item("minecraft:enchanted_book", 1, "§fSchiffbruch"));
 	if(progress > 0) {
 		inv.setItem(inv, 1, read.item("minecraft:enchanted_book", 1, "§fSchatz der Santa Maria"));
@@ -59,7 +59,7 @@ if(entity_name == "Kumpel") {
 		inv.setItem(inv, 8, read.item("minecraft:enchanted_book", 1, "§fNüchtern werden"));
 	}
 	if(progress > 8) {
-		inv.setItem(inv, 9, read.item("minecraft:enchanted_book", 1, "§fBacke backe Kuchen"));
+		inv.setItem(inv, 9, read.item("minecraft:enchanted_book", 1, "§fBacke Backe Kuchen"));
 	}
 	if(progress > 9) {
 		inv.setItem(inv, 10, read.item("minecraft:enchanted_book", 1, "§fVorbereitungen"));
@@ -77,7 +77,7 @@ goto("wait");
 
 @inv_click
 if(inv_name == "Quests: Kumpel") {
-	progress = story.getShipProgress(player);
+	progress = player.getShipProgress(player);
 	if(inv_slot > progress) {
 		goto("wait");
 	}

+ 132 - 95
story/schiffbruch/schiff_10_kuchen.txt

@@ -1,97 +1,134 @@
-%if %getGlobalVar $player-name schiff9; == true goto start;
-%q term;
-
-@start
-%msg all Jetzt, wo es uns doch so gut geht, lass uns einen Kuchen backen. Hier hast du drei Eimer, besorge dir alle Zutaten von der Insel. Wenn du alles zusammen hast, stelle einen Kuchen her und platziere ihn auf dem Ofen.;
-%msg all Für einen Kuchen brauchst du: 3 Eimer Milch, 2 Zucker, 1 Ei (Huhn rechtsklicken) und 3 Weizen.;
-%loadEvent block-break;
-%loadEvent entity-click;
-%loadEvent craft;
-%setVar milk 0;
-%setVar canebroken 0;
-%setVar sugarcrafted 0;
-%setVar eggsgiven 0;
-%setVar playerwheat1 %getItemAmountPlayer $player-name WHEAT:0:1;
-%spawnMob $shipstartloc CHICKEN;
-%spawnMob $shipstartloc COW;
+event.load("quest_start");
+event.load("quest_term");
+event.load("block_place");
+event.load("block_break");
+event.load("block_drop");
+event.load("entity_click");
+event.load("craft");
+
+stage = 0;
+all_stages = 7;
+quest_name = "Backe Backe Kuchen";
+
+milk = 0;
+milk_given = 0;
+cane_broken = 0;
+eggs_given = 0;
+wheat = 0;
+story = world.get("story");
+grow(loc.new(story, -1650, 66, -978), 5);
+animal_loc = loc.new(story, -1642, 66, -972);
+cake_loc = loc.new(story, -1651, 66, -989);
+harvested = false;
+egg = false;
+sugar = false;
 
 @wait
-%wait;
-%if $event == block-break && $block-type == SUGAR_CANE_BLOCK && %blockType %modLoc $block-loc 0 -1 0;; ==  SUGAR_CANE_BLOCK goto harvest;
-%if $event == craft && $item-type == SUGAR && $canebroken >= 2 goto craft;
-%if $event == entity-click && entity-type == COW goto milk;
-%if $event == entity-click && entity-type == CHICKEN goto egg;
-%if $event == block-break && $block-type == CROPS && $block-data == 7 goto harvest2;
-%goto wait;
-
-@harvest
-%setVar cancel false;
-%if %blockType %modLoc $block-loc 0 1 0;; ==  SUGAR_CANE_BLOCK goto add2;
-%setVar canebroken %add $canebroken 1;;
-%goto wait1;
-
-@add2
-%setVar canebroken %add $canebroken 2;;
-%goto wait;
-
-@craft
-%setVar sugarcrafted %add $sugarcrafted $item-amount;;
-%if $sugarcrafted >= 2 goto craft2;
-%msg all Es fehlen noch %sub 2 $sugarcrafted; Stück Zucker.;
-%goto wait;
-
-@craft2
-%setVar sugar true;
-%goto checkcake;
-
-@milk
-%setVar milk true;
-%goto checkcake;
-
-@egg
-%giveItemPlayer $player-name EGG:0:1;
-%setVar eggsgiven %add $eggsgiven 1;
-%if $eggsgiven >= 2 goto egg2;
-%goto wait;
-
-@egg2
-%setVar egg true;
-%goto checkcake;
-
-@harvest2
-%setVar cancel false;
-%setVar playerwheat2 %getItemAmountPlayer $player-name WHEAT:0:1;
-%if %sub $playerwheat2 $playerwheat1; >= 8 goto wheat;
-%goto wait1;
-
-@wheat
-%setVar wheat true;
-%goto checkcake;
-
-@checkcake
-%if $wheat == true && $sugar == true && $milk == true && $egg == true goto cake;
-%goto wait;
-
-@cake
-%unloadEvent entity-click;
-%unloadEvent block-break;
-%goto wait2;
-
-@wait2
-%if $event == craft && $item-type == CAKE goto cake;
-%goto wait2;
-
-@cake2
-%unloadEvent craft;
-%loadEvent block-place;
-
-@wait3
-%wait;
-%if $event == block-place && $block-loc == $cakeloc && $block-type == CAKE goto endQuest;
-%goto wait3;
-
-@endQuest
-%setGlobalVar $player-name schiff10 true
-%setGlobalVar $player-name schiff9 false;
-%msg all Auf das wir noch ein langes Leben haben.;
-%endQuest 8;
+wait();
+if(!player.isQuester(player, script)) {
+	goto("wait");
+}
+if(event == "quest_term") {
+	entity.remove(chicken_ent);
+	entity.remove(cow_ent);
+	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:bucket", 3));
+	chicken_ent = entity.spawn("chicken", animal_loc);
+	cow_ent = entity.spawn("cow", animal_loc);
+	block.set(cake_loc, "minecraft:air");
+	msg.prefix(player, "§dKumpel", "Jetzt, wo es uns doch so gut geht, lass uns einen Kuchen backen.");
+	scheduler.msgPrefix(30, player, "§dKumpel", "Hier hast du drei Eimer. Besorge dir alle Zutaten von der Insel.");
+	scheduler.msgPrefix(60, player, "§dKumpel", "Wenn du alles beisammen hast, crafte einen Kuchen und platziere ihn auf dem Ofen.");
+	scheduler.msgPrefix(90, player, "§dKumpel", "Für einen Kuchen brauchst du: 3 Eimer Milch, 2 Zucker, 1 Ei (Huhn rechtsklicken) und 3 Weizen.");
+	goto("wait");
+}
+if(event == "block_break") {
+	if(block_type == "minecraft:sugar_cane") {
+		cancel = true;
+		item.drop(block_loc, read.item(block_type));
+		cane_broken++;
+		if(cane_broken == 2) {
+			stage.increase(player);
+		}
+		goto("wait");
+	}
+	if(block_type == "minecraft:wheat") {
+		cancel = false;
+		scheduler.setBlock(5, block_loc, block_type, false);
+	}
+	goto("wait");
+}
+if(event == "block_drop") {
+	if(block_type == "minecraft:wheat") {
+		for(i = 0; i < list.getSize(drops); i++) {
+			drop_item = list.getIndex(drops, i);
+			if(item.getType(drop_item) == "minecraft:wheat") {
+				wheat += item.getAmount(drop_item);
+				if(wheat >= 3 && !harvested) {
+					harvested = true;
+					stage.increase(player);
+				}
+			}
+		}
+	}
+	goto("wait");
+}
+if(event == "entity_click") {
+	entity_type = entity.getType(entity);
+	if(entity_type == "cow") {
+		item = entity.getEquip(player, "hand");
+		item_type = item.getType(item);
+		if(item_type == "minecraft:bucket") {
+			milk++;
+			if(milk == 3) {
+				stage.increase(player);
+			}
+		}
+		goto("wait");
+	}
+	if(entity_type == "chicken" && !egg) {
+		egg = true;
+		player.giveItem(player, read.item("minecraft:egg"));
+		stage.increase(player);
+	}
+	goto("wait");
+}
+if(event == "craft") {
+	if(item.getType(result) == "minecraft:sugar" && !sugar) {
+		sugar = true;
+		stage.increase(player);
+	}
+}
+if(stage >= 5) {
+	label = concat("stage", text.number(stage));
+	goto(label);
+}
+goto("wait");
+
+@stage5
+if(event == "craft") {
+	if(item.getType(result) == "minecraft:cake") {
+		stage.increase(player);
+	}
+}
+goto("wait");
+
+@stage6
+if(event == "block_place") {
+	if(block_type == "minecraft:cake") {
+		if(block_loc == cake_loc) {
+			cancel = false;
+			msg.prefix(player, "§dKumpel", "Auf das wir noch ein langes Leben haben.");
+			player.setShipProgress(player, 10);
+			entity.remove(cow_ent);
+			entity.remove(chicken_ent);
+			msg(player, "§dQuest abgeschlossen. Belohnung: 10 Snuvis!");
+			addMoney(player, 10);
+			quest.finish(script, player);
+		}
+	}
+}
+goto("wait");

+ 84 - 34
story/schiffbruch/schiff_11_vorbereitungen.txt

@@ -1,40 +1,90 @@
-%if %getGlobalVar $player-name schiff10; == true goto start;
-%q term;
+event.load("quest_start");
+event.load("quest_term");
+event.load("block_click");
+event.load("entity_click");
 
-@start
-%msg all In meiner alten Kajüte auf dem Schiffswrack befindet sich ein Kompass. Er ist in einer verschlossenen Kiste aufbewahrt. Bitte suche ihn und bringe ihn zu mir. Das wird uns unsere Flucht von der Insel erleichtern. Hier hast du den Schlüssel für die Kiste.;
-%loadEvent block-click;
-%giveItemPlayer $player-name TRIPWIRE_HOOK:0:1 Schlüssel;
+stage = 0;
+all_stages = 3;
+quest_name = "Vorbereitungen";
 
-@wait
-%wait;
-%if $event == block-click && $player-item-name == TRIPWIRE_HOOK && $player-item-lore == Schlüssel && $block-loc == $truechestloc && $block-type == CHEST goto truechest;
-%if $event == block-click && $player-item-name == TRIPWIRE_HOOK && $player-item-lore == Schlüssel && $block-loc != $truechestloc && $block-type == CHEST goto falsechest;
-
-@falsechest
-%msg all Das ist nicht die richtige Kiste.;
-%goto wait;
+chest_loc = loc.new(world.get("story"), -1635, 76, -1037);
+key = read.item("minecraft:tripwire_hook", 1, "§rSchlüssel");
 
-@truechest
-%setVar cancel true;
-%loadEvent villager-give;
-%unloadEvent block-click;
-%giveItemPlayer $player-name COMPASS:0:1;
-%msg all Bitte gib mir den Schlüssel wieder zurück.;
+@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);
 
-@wait2
-%wait;
-%if $event == villager-give && $item-type == TRIPWIRE_HOOK goto checkloc;
-%goto wait2;
+@stage0
+if(event == "block_click") {
+	if(block_type == "minecraft:chest") {
+		item = entity.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");
 
-@checkloc
-%if %distance $villager-loc $shipstartloc; <= 4 goto endQuest;
-%setVar cancel true;
-%msg all Tut mir leid, ich bin nicht dein Kamerad.;
-%goto wait2;
+@stage1
+if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
+	entity_name = entity.getName(entity);
+	if(entity_name == "Kumpel") {
+		item = entity.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");
 
-@endQuest
-%setGlobalVar $player-name schiff11 true
-%setGlobalVar $player-name schiff10 false;
-%msg all Lang lebe die Koordination, die Freiheit und die Menschlichkeit!;
-%endQuest 5;
+@stage2
+if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
+	entity_name = entity.getName(entity);
+	if(entity_name == "Kumpel") {
+		item = entity.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");

+ 75 - 49
story/schiffbruch/schiff_12_feuerteufel.txt

@@ -1,56 +1,82 @@
-%if %getGlobalVar $player-name schiff11; == true goto start;
-%q term;
+event.load("quest_start");
+event.load("quest_term");
+event.load("block_place");
+event.load("block_click");
+event.load("craft");
 
-@start
-%msg all Hier hast du einen Holzstamm. Lege ihn auf die Feuerstelle und gehe zum Schiff. In der Kiste auf dem Bug findest du Materialien für ein Feuerzeug. Zünde damit das Holz an, damit wir unsere Kleider über dem Feuer trocknen können.;
-%loadEvent block-place;
-%giveItemPlayer $player-name LOG:3:1 Feuerholz %concatspace Platziere mich auf der Feuerstelle;;
-%setBlock $firelogloc AIR:0:1;
-%setBlock %modLoc $firelogloc 0 1 0; AIR:0:1;
+stage = 0;
+all_stages = 4;
+quest_name = "Feuerteufel";
 
-@wait1
-%wait;
-%if $event == block-place && $block-loc == $firelogloc && $block-type == LOG goto wood;
-%goto wait2;
+fire_loc = loc.new(world.get("story"), -1648, 65, -992);
+chest_loc = loc.new(world.get("story"), -1606, 65, -1035);
 
-@wood
-%setVar cancel false;
-%unloadEvent block-place;
-%loadEvent block-click;
+@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, read.item("minecraft:jungle_log", 1, "Auf der Feuerstelle platzieren"));
+	block.set(fire_loc, "minecraft:air");
+	msg.prefix(player, "§dKumpel", "Hier hast du einen Holzstamm. Lege ihn auf die Feuerstelle und gehe danach zum Schiff.");
+	scheduler.msgPrefix(30, player, "§dKumpel", "In der Kiste auf dem Bug des Schiffs findest du Materialien für ein Feuerzeug.");
+	scheduler.msgPrefix(60, player, "§dKumpel", "Zünde damit das Holz an, damit wir unsere Kleider über dem Feuer trocknen können.");
+	goto("wait");
+}
+label = concat("stage", text.number(stage));
+goto(label);
 
-@wait2
-%wait;
-%if $event == block-click && $block-loc == $firechestloc && $block-type == CHEST goto truechest;
-%if $event == block-click && $block-loc != $firechestloc && $block-type == CHEST goto falsechest;
-%goto wait2;
+@stage0
+if(event == "block_place") {
+	if(block_loc == fire_loc) {
+		if(block_type == "minecraft:jungle_log") {
+			cancel = false;
+			stage.increase(player);
+		}
+	}
+}
+goto("wait");
 
-@falsechest
-%msg all Das ist nicht die richtige Kiste.;
-%goto wait;
+@stage1
+if(event == "block_click") {
+	if(block_type == "minecraft:chest") {
+		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:flint"));
+		block.addItem(block_loc, read.item("minecraft:iron_ingot"));
+	}
+}
+goto("wait");
 
-@truechest
-%setVar cancel true;
-%loadEvent craft;
-%unloadEvent block-click;
-%giveItemPlayer $player-name FLINT:0:1;
-%giveItemPlayer $player-name IRON_INGOT:0:1;
+@stage2
+if(event == "craft") {
+	if(item.getType(result) == "minecraft:flint_and_steel") {
+		stage.increase(player);
+	}
+}
+goto("wait");
 
-@wait3
-%wait;
-%if $event == craft && $item-type == FLINT_AND_STEEL goto craft;
-%goto wait3;
-
-@craft
-%unloadEvent craft;
-%loadEvent block-click;
-
-@wait4
-%wait;
-%if $event == block-click && $action == RIGHT_CLICK_BLOCK && $block-loc == $firelogloc goto endQuest;
-%goto wait4;
-
-@endQuest
-%setGlobalVar $player-name schiff12 true
-%setGlobalVar $player-name schiff11 false;
-%msg all Feuer. Es lodere wie die Wut von unzufriedenem Volke.;
-%endQuest 5;
+@stage3
+if(event == "block_click") {
+	if(block_loc == fire_loc) {
+		if(block_type == "minecraft:jungle_log") {
+			block.set(fire_loc, "minecraft:campfire");
+			msg.prefix(player, "§dKumpel", "Feuer! Es lodere wie die Wut von unzufriedenen Leuten.");
+			player.setShipProgress(player, 12);
+			msg(player, "§dQuest abgeschlossen. Belohnung: 6 Snuvis!");
+			addMoney(player, 6);
+			quest.finish(script, player);
+		}
+	}
+}
+goto("wait");

+ 188 - 138
story/schiffbruch/schiff_13_boss.txt

@@ -1,138 +1,188 @@
-%msg all Gut, dass du hier bist. Auf der anderen Seite der Insel habe ich eine Hexe gesehen.;
-
-%addList placelocs;
-%addListElement placelocs $placeloc1;
-%addListElement placelocs $placeloc2;
-%addListElement placelocs $placeloc3;
-%addListElement placelocs $placeloc4;
-
-%loadEvent entity-kill;
-%loadEvent player-respawn;
-%spawnMob $spawnhexeloc WITCH;
-%setBlock $placeloc1 AIR:0:1;
-%setBlock $placeloc2 AIR:0:1;
-%setBlock $placeloc3 AIR:0:1;
-%setBlock $placeloc4 AIR:0:1;
-%setBlock $witherloc SKULL:1:1;
-%setBlock $creeperloc SKULL:4:1;
-%setBlock $zombieloc SKULL:2:1;
-%setBlock $skelettloc SKULL:0:1;
-
-@wait1
-%wait;
-%if $event == entity-kill && entity-type == WITCH goto killwitch;
-%if $event == player-respawn goto respawn1;
-%goto wait1;
-
-@respawn1
-%setVar respawn-loc $shipstartloc;
-%goto wait1;
-
-@killwitch
-%msg all Hörst du das auch? Es scheint, als würden böse Kreaturen unter der Insel erwachen. Gehe besser nachschauen. Ich habe letztens ein kleines Loch in der Mitte der Insel gefunden. Vielleicht kommen die Geräsuche von dort.;
-%loadEvent block-click;
-%giveItemPlayer $player-name STICK:0:1 %concatspace Zauberstab der Elemente; %concatspace Achtung fragil!;;
-
-%setVar i 0;
-@label
-%spawnMob $spawnwitherloc SKELETON WITHER;
-%spawnMob $spawnskelettloc SKELETON;
-%spawnMob $spawncreeperloc CREEPER;
-%spawnMob $spawnzombieloc ZOMBIE;
-%setVar i %add $i 1;
-%if $i < 10 goto label;
-
-%setVar skulls 0;
-
-@wait2
-%wait;
-%if $event == entity-kill && $enter != true goto enter;
-%if $event == player-respawn goto respawn2;
-%if $event == block-click goto click;
-%goto wait2;
-
-@enter
-%msg all Ach du meine Güte. Alles voller Monster. Und sie scheinen vier magische Blöcke zu bewachen. Was an denen wohl so wertvoll ist?;
-%setVar enter true;
-%goto wait2;
-
-@respawn2
-%setVar respawn-loc $shipstartloc;
-%goto wait2;
-
-@click
-%if $player-item-type == STICK goto click2;
-%msg all Vielleicht passiert etwas, wenn man diese Blöcke mit dem Zauberstab berührt.;
-%goto wait2;
-
-@click2
-%if $block-loc == $witherloc goto skull1;
-%if $block-loc == $zombieloc goto skull2;
-%if $block-loc == $skelettloc goto skull3;
-%if $block-loc == $creeperloc goto skull4;
-%msg all Das ist keiner der magischen Blöcke.;
-%goto wait2;
-
-@skull1
-%giveItemPlayer $player-name SKULL:0:1;
-%setVar skulls %add $skulls 1;
-%goto checkskulls;
-
-@skull2
-%giveItemPlayer $player-name SKULL:1:1;
-%setVar skulls %add $skulls 1;
-%goto checkskulls;
-
-@skull3
-%giveItemPlayer $player-name SKULL:2:1;
-%setVar skulls %add $skulls 1;
-%goto checkskulls;
-
-@skull4
-%giveItemPlayer $player-name SKULL:4:1;
-%setVar skulls %add $skulls 1;
-%goto checkskulls;
-
-@checkskulls
-%if $skulls < 4 goto wait2;
-%msg all Es schaut so aus, als würden diese Köpfe auf die hervorgehobenen Plätze gehören.;
-%loadEvent block-place;
-%unloadEvent block-click;
-%unloadEvent entity-kill;
-%unloadEvent player-respawn;
-%setVar i 0;
-
-@wait3
-%wait;
-%if $event == block-place && %checkForListElement placelocs $block-loc; == true && $item-type == SKULL goto place;
-%setVar cancel true;
-%msg all Hier gehört keiner der Köpfe hin.;
-%goto wait3;
-
-@place
-%setVar cancel false;
-%setVar i %add $i 1;;
-%msg all Gesetzte Köpfe: %concat $i /4;
-%if $i >= 4 goto evil;
-%goto wait3
-
-@evil
-%setVar evil %spawnMob $evilloc VILLAGER;;
-%nameEntity $evil %concatspace Der Gefangene;;
-%equipentity $evil IRON_HELMET:0:1 head;
-%msg all Der Gefangene: Kannst du dich noch an mich erinnern? Wie ich sagte, vor mir hast du nie Ruhe! Vielleicht weißt du jetzt, wodurch dein Schiff gesunken ist?;
-%waitfor 180;
-%msg all Der Gefangene: Muahahaha... nimm dies.;
-%spawnMob $evilloc WITCH;
-%spawnMob $evilloc WITCH;
-%spawnMob $evilloc WITCH;
-%spawnMob $evilloc SILVERFISH;
-%spawnMob $evilloc SILVERFISH;
-%spawnMob $evilloc SILVERFISH;
-%playParticle $evilloc EXPLOSION 5;
-%teleportEntity $evil %modLoc $evilloc 0 100 0;
-%damageEntity $evil 100;
-%msg all Wie immer, bis zum nächsten Mal...;
-%setGlobalVar $player-name schiff12 false;
-%setGlobalVar $player-name shipquests true;
-%teleportPlayer $player-name $shipquestloc;
+event.load("quest_start");
+event.load("quest_term");
+event.load("block_click");
+event.load("block_place");
+event.load("living_death");
+event.load("living_pre_hurt");
+
+stage = 0;
+all_stages = 5;
+quest_name = "Boss";
+
+story = world.get("story");
+witch_loc = loc.new(story, -1628, 64, -956);
+zombie_loc = loc.new(story, -1618.5, 51, -966.5);
+wither_skeleton_loc = loc.new(story, -1618.5, 51, -978.5);
+evilloc = loc.new(story, -1618.5, 51, -972.5);
+zombie_head_loc = loc.new(story, -1619, 51, -967);
+wither_skeleton_head_loc = loc.new(story, -1619, 51, -979);
+ents = list.new();
+placed_set = set.new();
+killed = 0;
+enter = false;
+
+@wait
+wait();
+if(event == "living_pre_hurt") {
+	player = player.getFromDamageSource(damage_source);
+	if(player == null) {
+		goto("wait");
+	}
+}
+if(event == "living_death") {
+	if(isPlayer(living_entity)) {
+		entity.remove(witch_ent);
+		for(i = 0; i < list.getSize(ents); i++) {
+			entity.remove(list.getIndex(ents, i));
+		}
+		block.set(loc.new(story, -1643, 65, -972), "minecraft:grass_block");
+		block.set(loc.new(story, -1644, 65, -972), "minecraft:grass_block");
+		block.set(loc.new(story, -1645, 65, -972), "minecraft:grass_block");
+		block.set(loc.new(story, -1643, 65, -971), "minecraft:grass_block");
+		block.set(loc.new(story, -1644, 65, -971), "minecraft:grass_block");
+		player = living_entity;
+		msg.prefix(player, "§dQuest", "Quest termed.");
+		quest.term(script, player);
+		goto("wait");
+	}
+	player = player.getFromDamageSource(damage_source);
+	if(player == null) {
+		goto("wait");
+	}
+}
+if(!player.isQuester(player, script)) {
+	goto("wait");
+}
+if(event == "quest_term") {
+	entity.remove(witch_ent);
+	for(i = 0; i < list.getSize(ents); i++) {
+		entity.remove(list.getIndex(ents, i));
+	}
+	block.set(loc.new(story, -1643, 65, -972), "minecraft:grass_block");
+	block.set(loc.new(story, -1644, 65, -972), "minecraft:grass_block");
+	block.set(loc.new(story, -1645, 65, -972), "minecraft:grass_block");
+	block.set(loc.new(story, -1643, 65, -971), "minecraft:grass_block");
+	block.set(loc.new(story, -1644, 65, -971), "minecraft:grass_block");
+	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:iron_sword"), false);
+	player.giveSingleItem(player, read.item("minecraft:shield"), false);
+	witch_ent = entity.spawn("witch", witch_loc);
+	msg.prefix(player, "§dKumpel", "Gut, dass du hier bist. Auf der anderen Seite der Insel habe ich eine Hexe gesehen.");
+	goto("wait");
+}
+label = concat("stage", text.number(stage));
+goto(label);
+
+@stage0
+if(event == "living_death") {
+	entity_type = entity.getType(living_entity);
+	if(entity_type == "witch") {
+		stage.increase(player);
+		player.giveSingleItem(player, read.item("km:diamond_stick", 1, "Stab der Elemente", "Achtung, Fragil!"), false);
+		msg.prefix(player, "§dKumpel", "Hörst du das auch? Es scheint, als würden böse Kreaturen unter der Insel erwachen. Gehe besser nachschauen.");
+		scheduler.msgPrefix(30, player, "§dKumpel", "Ich habe letztens ein kleines Loch in der Mitte der Insel gefunden. Vielleicht kommen die Geräusche von dort.");
+		block.set(loc.new(story, -1643, 65, -972), "minecraft:air");
+		block.set(loc.new(story, -1644, 65, -972), "minecraft:air");
+		block.set(loc.new(story, -1645, 65, -972), "minecraft:air");
+		block.set(loc.new(story, -1643, 65, -971), "minecraft:air");
+		block.set(loc.new(story, -1644, 65, -971), "minecraft:air");
+		block.set(zombie_loc, "minecraft:air");
+		block.set(wither_skeleton_loc, "minecraft:air");
+		for(i = 0; i < 5; i++) {
+			list.add(ents, entity.spawn("zombie", zombie_loc));
+		}
+		list.add(ents, entity.spawn("wither_skeleton", wither_skeleton_loc));
+		list.add(ents, entity.spawn("wither_skeleton", wither_skeleton_loc));
+	}
+}
+goto("wait");
+
+@stage1
+if(event == "block_click") {
+	if(block_type == "minecraft:stone_button" && !enter) {
+		msg.prefix(player, "§dKumpel", "Ach du meine Güte. Alles voller Monster. Sie scheinen diesen magischen Ort zu bewachen.");
+		scheduler.msgPrefix(30, player, "§dKumpel", "Was an dem wohl so besonders ist?");
+		enter = true;
+		stage.increase(player);
+	}
+}
+goto("wait");
+
+@stage2
+if(event == "living_pre_hurt") {
+	if(list.contains(ents, living_entity)) {
+		item = entity.getEquip(player, "hand");
+		item_type = item.getType(item);
+		if(item_type != "km:diamond_stick") {
+			cancel = true;
+			msg.prefix(player, "§dKumpel", "Diese Monster sind mit irdischen Waffen unbesiegbar.");
+		}
+	}
+	goto("wait");
+}
+if(event == "living_death") {
+	if(list.contains(ents, living_entity)) {
+		entity_type = entity.getType(living_entity);
+		entity_loc = entity.getLocation(living_entity);
+		if(entity_type == "wither_skeleton") {
+			item.drop(entity_loc, read.item("minecraft:wither_skeleton_skull"));
+		} elseif(entity_type == "zombie") {
+			item.drop(entity_loc, read.item("minecraft:zombie_head"));
+		}
+		killed++;
+		if(killed == 7) {
+			stage.increase(player);
+			msg.prefix(player, "§dKumpel", "Es schaut so aus, als könnte jeweils einer dieser Köpfe hier platziert werden.");
+		}
+	}
+}
+goto("wait");
+
+@stage3
+if(event == "block_place") {
+	if(block_loc == zombie_head_loc || block_loc == wither_skeleton_head_loc) {
+		if(block_type == "minecraft:zombie_head" || block_type == "minecraft:wither_skeleton_skull") {
+			if(set.contains(placed_set, block_type)) {
+				msg.prefix(player, "§dKumpel", "Diesen Kopf hast du bereits platziert.");
+				goto("wait");
+			}
+			cancel = false;
+			set.add(placed_set, block_type);
+			if(set.getSize(placed_set) == 2) {
+				stage.increase(player);
+				beelzebub_ent = human.spawn(evilloc);
+				human.setSkin(beelzebub_ent, "herobrine");
+				entity.setName(beelzebub_ent, "§cBeelzebub");
+				msg.prefix(player, "§cBeelzebub", "Dir werde ich das Fürchten lehren! Nie mehr wirst du vor mir Ruhe haben!");
+				scheduler.msgPrefix(100, player, "§cBeelzebub", "Muahahaha..., nimm dies.");
+				scheduler.spawnEntity(100, "witch", evilloc);
+				particle.spawn(loc.mod(evilloc, 0, 2, 0), particle.get("minecraft:explosion"));
+				sound.spawn(evilloc, sound.get("minecraft:entity.generic.explode"), sound.getCategory("ambient"));
+				scheduler.removeEntity(180, beelzebub_ent);
+				scheduler.msgPrefix(180, player, "§cBeelzebub", "Bis zum nächsten Mal...");
+			}
+		}
+	}
+}
+goto("wait");
+
+@stage4
+if(event == "living_death") {
+	entity_type = entity.getType(living_entity);
+	if(entity_type == "witch" || entity_type == "silverfish") {
+		block.set(loc.new(story, -1643, 65, -972), "minecraft:grass_block");
+		block.set(loc.new(story, -1644, 65, -972), "minecraft:grass_block");
+		block.set(loc.new(story, -1645, 65, -972), "minecraft:grass_block");
+		block.set(loc.new(story, -1643, 65, -971), "minecraft:grass_block");
+		block.set(loc.new(story, -1644, 65, -971), "minecraft:grass_block");
+		player.setShipProgress(player, 13);
+		msg(player, "§dQuest abgeschlossen. Belohnung: 30 Snuvis!");
+		msg(player, text.click("§r [§cclick§r] §f[§bTeleport§f] zum Story-Spawn.", "/story"));
+		addMoney(player, 30);
+		quest.finish(script, player);
+	}
+}
+goto("wait");

+ 52 - 20
story/schiffbruch/schiff_5_monster.txt

@@ -1,24 +1,56 @@
-%if %getGlobalVar $player-name schiff4; == true goto start;
-%q term;
+event.load("quest_start");
+event.load("quest_term");
+event.load("living_death");
 
-@start
-%msg all Letzte Nacht habe ich etwas gehört, bitte sieh beim Schiffswrack nach, ob sich dort wieder ein Seeungeheuer herumtreibt. Wenn du es siehst, töte es, bevor uns etwas passiert.;
-%spawnMob $guardianloc GUARDIAN;
-%loadEvent == entity-kill;
-%loadEvent == player-respawn;
+stage = 0;
+all_stages = 1;
+quest_name = "Monster besiegen";
+guardian_loc = loc.new(world.get("story"), -1623, 61, -1023);
 
 @wait
-%wait;
-%if $event == entity-kill && $entity-type == GUARDIAN goto endQuest.;
-%if $event == player-respawn goto respawn;
-%goto wait;
+wait();
+if(event == "living_death") {
+	if(isPlayer(living_entity)) {
+		player = living_entity;
+		msg.prefix(player, "§dQuest", "Quest termed.");
+		quest.term(script, player);
+		goto("wait");
+	}
+	player = player.getFromDamageSource(damage_source);
+	if(player == null) {
+		goto("wait");
+	}
+}
+if(!player.isQuester(player, script)) {
+	goto("wait");
+}
+if(event == "quest_term") {
+	entity.cleareffects(player);
+	entity.remove(guardian_ent);
+	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);
+	guardian_ent = entity.spawn("guardian", guardian_loc);
+	player.giveSingleItem(player, read.item("minecraft:stone_sword"), false);
+	msg.prefix(player, "§dKumpel", "Letzte Nacht habe ich etwas gehört. Bitte sieh beim Schiffswrack nach, ob sich dort ein Seeungeheuer herumtreibt.");
+	scheduler.msgPrefix(30, player, "§dKumpel", "Wenn du es siehst, töte es, bevor uns etwas passiert.");
+	goto("wait");
+}
+label = concat("stage", text.number(stage));
+goto(label);
 
-@respawn
-%setVar $respawn-loc $shipstartloc;
-%goto wait;
-
-@endQuest
-%setGlobalVar $player-name schiff5 true
-%setGlobalVar $player-name schiff4 false;
-%msg all Lang lebe die Sicherheit.;
-%endQuest 5;
+@stage0
+if(event == "living_death") {
+	entity_type = entity.getType(living_entity);
+	if(entity_type == "guardian") {
+		msg.prefix(player, "§dKumpel", "Lang lebe die Sicherheit.");
+		player.setShipProgress(player, 5);
+		entity.cleareffects(player);
+		msg(player, "§dQuest abgeschlossen. Belohnung: 4 Snuvis!");
+		addMoney(player, 4);
+		quest.finish(script, player);
+	}
+}
+goto("wait");

+ 63 - 119
story/schiffbruch/schiff_6_baumaterial.txt

@@ -1,123 +1,67 @@
-%if %getGlobalVar $player-name schiff5; == true goto start;
-%q term;
+event.load("quest_start");
+event.load("quest_term");
+event.load("block_break");
+event.load("entity_click");
 
-@start;
-%msg all Fälle den Baum am Strand und gib mir das Holz. Dann kann ich uns ein schönes Floß bauen.;
-%loadEvent block-break;
-%setVar broken 0;
+stage = 0;
+all_stages = 2;
+quest_name = "Baumaterial besorgen";
+broken = 0;
+given = 0;
 
-%setBlock %modLoc $treeloc 0 -3 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 -2 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 -1 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 0 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 1 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 2 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 3 0; LOG:3:1;
-%setBlock %modLoc $treeloc 0 4 0; LOG:3:1;
+@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_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);
 
-%setBlock %modLoc $treeloc -2 2 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -2 2 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc -2 2 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 2 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 2 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 2 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 2 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 2 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 2 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 2 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 2 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 2 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 2 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 2 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 2 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 2 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 2 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 2 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 2 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 2 1; LEAVES:3:1;
+@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");
 
-%setBlock %modLoc $treeloc -2 3 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc -2 3 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -2 3 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc -2 3 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -2 3 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 3 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 3 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 3 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 3 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 3 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 3 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 3 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 3 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 3 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 3 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 3 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 3 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 3 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 3 2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 3 -2; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 3 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 3 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 3 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 2 3 2; LEAVES:3:1;
-
-%setBlock %modLoc $treeloc -1 4 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 4 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc -1 4 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 4 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 4 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 4 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 4 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 4 1; LEAVES:3:1;
-
-%setBlock %modLoc $treeloc -1 5 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 5 -1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 5 0; LEAVES:3:1;
-%setBlock %modLoc $treeloc 0 5 1; LEAVES:3:1;
-%setBlock %modLoc $treeloc 1 5 0; LEAVES:3:1;
-
-@wait1
-%wait;
-%if $event == block-break && $block-type == LOG && %distance $block-loc $treeloc; <= 5 goto breaklog;
-%if $event == block-break && $block-type == LEAVES && %distance $block-loc $treeloc; <= 7 goto breakleaves;
-%goto wait1;
-
-@breaklog
-%setVar cancel false;
-%setVar broken %add $broken 1;
-%if $broken >= 8 goto give2;
-%goto wait1;
-
-@breakleaves
-%setVar cancel false;
-%goto wait1;
-
-@give2
-%loadEvent villager-give;
-%unloadEvent block-break;
-%setVar given 0;
-
-@wait2
-%wait;
-%if $event == villager-give && $item-type == LOG && $item-data == 3 goto checkloc;
-%setVar cancel true;
-%msg all Was soll ich damit?;
-%goto wait2;
-
-@checkloc
-%if %distance $villager-loc $shipstartloc; <= 4 goto give;
-%setVar cancel true;
-%msg all Tut mir leid, ich bin nicht dein Kamerad.;
-%goto wait2;
-
-@give
-%setVar given %add $given $item-amount;;
-%if $given >= 8 goto endQuest;
-%msg all Ich brauche noch %sub 8 $given; Stück Holz.;
-%goto wait2;
-
-@endQuest
-%setGlobalVar $player-name schiff6 true
-%setGlobalVar $player-name schiff5 false;
-%msg all Bald kann die Reise beginnen.;
-%endQuest 2;
+@stage1
+if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
+	entity_name = entity.getName(entity);
+	if(entity_name == "Kumpel") {
+		item = entity.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, 6);
+				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");

+ 41 - 14
story/schiffbruch/schiff_7_ehre.txt

@@ -1,18 +1,45 @@
-%if %getGlobalVar $player-name schiff6; == true goto start;
-%q term;
+event.load("quest_start");
+event.load("quest_term");
+event.load("block_place");
 
-@start;
-%msg all Mein Schiffsaffe ist vor genau einem Jahr gestorben, bitte stell diese Blume auf sein Grab.;
-%loadEvent block-place;
-%giveItemPlyer $player-name RED_FLOWER:4:1;
-%set-block $flowerloc AIR:0:1;
+stage = 0;
+all_stages = 1;
+quest_name = "Toten Ehre erweisen";
+flowerloc = loc.new(world.get("story"), -1626, 65, -971);
 
 @wait
-%wait;
-%if $event == block-place && $block-loc == $flowerloc && $item-type == RED_FLOWER && $item-data == 4 goto endQuest;
+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.giveItem(player, read.item("minecraft:red_tulip"));
+	block.set(flowerloc, "minecraft:air");
+	msg.prefix(player, "§dKumpel", "Mein Schiffsaffe ist vor genau einem Jahr gestorben. Ich hab ihn damals auf dieser Insel vergraben.");
+	scheduler.msgPrefix(30, player, "§dKumpel", "Bitte stelle diese Blume auf sein Grab.");
+	goto("wait");
+}
+label = concat("stage", text.number(stage));
+goto(label);
 
-@endQuest
-%setGlobalVar $player-name schiff7 true
-%setGlobalVar $player-name schiff6 false;
-%msg all Er möge in Frieden ruhen.;
-%endQuest 2;
+@stage0
+if(event == "block_place") {
+	if(block_type == "minecraft:red_tulip") {
+		if(block_loc == flowerloc) {
+			cancel = false;
+			msg.prefix(player, "§dKumpel", "Er möge in Frieden ruhen");
+			player.setShipProgress(player, 7);
+			entity.cleareffects(player);
+			msg(player, "§dQuest abgeschlossen. Belohnung: 2 Snuvis!");
+			addMoney(player, 2);
+			quest.finish(script, player);
+		}
+	}
+}
+goto("wait");

+ 61 - 57
story/schiffbruch/schiff_8_durst.txt

@@ -1,57 +1,61 @@
-%if %getGlobalVar $player-name schiff7; == true goto start;
-%q term;
-
-@start
-%msg all Nimm diese 3 Glas und crafte daraus 3 Glasflaschen. Bitte befülle sie mit Wasser und bringe sie mir.;
-%loadEvent craft;
-%giveItemPlayer $player-name GLASS:0:3;
-
-@wait1
-%wait;
-%if $event == craft && $item-type == GLASS_BOTTLE goto craft;
-%goto wait1;
-
-@craft
-%setVar filled 0;
-%unloadEvent craft;
-%loadEvent block-click;
-
-@wait2
-%wait;
-%if $event == block-click && $player-item == GLASS_BOTTLE && $action == RIGHT_CLICK_BLOCK goto fill;
-%goto wait2;
-
-@fill
-%setVar filled %add $filled 1;
-%if $filled >= 3 goto startgive;
-%goto wait2;
-
-@startgive
-%unloadEvent block-click;
-%loadEvent villager-give;
-%setVar given 0;
-
-@wait3
-%wait;
-%if $event == villager-give && $item-type == POTION goto checkloc;
-%setVar cancel true;
-%msg all Was soll ich damit?;
-%goto wait3;
-
-@checkloc
-%if %distance $villager-loc $shipstartloc; <= 4 goto give;
-%setVar cancel true;
-%msg all Tut mir leid, ich bin nicht dein Kamerad.;
-%goto wait3;
-
-@give
-%setVar given %add $given $item-amount;;
-%if $given >= 3 goto endQuest;
-%msg all Ich brauche noch %sub 3 $given; Wasserflaschen.;
-%goto wait3;
-
-@endQuest
-%setGlobalVar $player-name schiff8 true
-%setGlobalVar $player-name schiff7 false;
-%msg all Vielen Dank, mir geht es schon viel besser.;
-%endQuest 4;
+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") {
+	entity.addEffect(player, "nausea", 9999, 0);
+	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 = entity.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, 8);
+				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");

+ 54 - 23
story/schiffbruch/schiff_9_nuechtern.txt

@@ -1,27 +1,58 @@
-%if %getGlobalVar $player-name schiff8; == true goto start;
-%q term;
+event.load("quest_start");
+event.load("quest_term");
+event.load("entity_click");
+event.load("item_use_finish");
 
-@start
-%msg all Nimm dir diesen Eimer und melke eine Kuh. Trink die Milch, dann gehts dir besser.;
-%loadEvent entity-click;
-%spawnMob $shipstartloc cow;
+stage = 0;
+all_stages = 2;
+quest_name = "Nüchtern werden";
+cow_loc = loc.new(world.get("story"), -1642, 66, -972);
 
-@wait1
-%wait;
-%if $event == entity-click && entity-type == COW goto milk;
-%goto wait1;
+@wait
+wait();
+if(!player.isQuester(player, script)) {
+	goto("wait");
+}
+if(event == "quest_term") {
+	entity.cleareffects(player);
+	entity.remove(cow_ent);
+	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:bucket"), false);
+	cow_ent = entity.spawn("cow", cow_loc);
+	msg.prefix(player, "§dKumpel", "Nimm dir diesen Eimer und melke eine Kuh. Trink die Milch, dann gehts dir besser.");
+	goto("wait");
+}
+label = concat("stage", text.number(stage));
+goto(label);
 
-@milk
-%unloadEvent entity-click;
-%loadEvent consume;
+@stage0
+if(event == "entity_click" && entity.getType(entity) == "cow") {
+	item = entity.getEquip(player, "hand");
+	item_type = item.getType(item);
+	if(item_type == "minecraft:bucket") {
+		stage.increase(player);
+	}
+}
+goto("wait");
 
-@wait2
-%wait;
-%if $event == consume && $item-type == MILK_BUCKET goto endQuest;
-%goto wait2;
-
-@endQuest
-%setGlobalVar $player-name schiff9 true
-%setGlobalVar $player-name schiff8 false;
-%msg all Sag ich doch. Milch hilft immer.;
-%endQuest 4;
+@stage1
+if(event == "item_use_finish") {
+	if(!isPlayer(living_entity)) {
+		goto("wait");
+	}
+	player = living_entity;
+	item_type = item.getType(item);
+	if(item_type == "minecraft:milk_bucket") {
+		msg.prefix(player, "§dKumpel", "Sag ich doch. Milch hilft immer.");
+		player.setShipProgress(player, 9);
+		entity.remove(cow_ent);
+		msg(player, "§dQuest abgeschlossen. Belohnung: 3 Snuvis!");
+		addMoney(player, 3);
+		quest.finish(script, player);
+	}
+}
+goto("wait");

+ 5 - 3
system/commands.txt

@@ -162,6 +162,7 @@ command.registerAlias("fuckit", "giveup");
 command.registerAlias("ram", "memory");
 command.registerAlias("thor", "lightning");
 
+composter_par = particle.get("composter");
 beds_tag = block.getTag("minecraft:beds");
 chest_tag = block.getTag("forge:chests");
 sign_tag = block.getTag("minecraft:signs");
@@ -688,7 +689,7 @@ if(event == "inv_click") {
 			} else {
 				skill.setActivated(player, tech_name, true);
 			}
-			inv.setItem(inv, inv_slot, skill.getShopItem(player, skill_name));
+			inv.setItem(inv, inv_slot, skill.getShopItem(player, tech_name));
 			inv.update(player);
 			goto("wait");
 		}
@@ -721,6 +722,7 @@ if(event == "inv_click") {
 				amount = skill.getAmount(player, "skill.grow");
 				if(amount > 0) {
 					grow(player_loc, 5);
+					particle.spawnCircle(loc.mod(entity.getLocation(player), 0, 0.8, 0), composter_par, 50, 5, 1, 0, 0, 0.2, 0);
 					new_amount = amount - 1;
 					skill.setAmount(player, "skill.grow", new_amount);
 					msg.prefix(player, prefix_skill, concat("Used Grow. New amount: ", text.number(new_amount)));
@@ -750,7 +752,7 @@ if(event == "inv_click") {
 			if(tech_name == "skill.jump_boost") {
 				amount = skill.getAmount(player, "skill.jump_boost");
 				if(amount > 0) {
-					entity.addEffect(player, "jump_boost", 2400, 0);
+					entity.addEffect(player, "jump_boost", 2400, 1);
 					new_amount = amount - 1;
 					skill.setAmount(player, "skill.jump_boost", new_amount);
 					msg.prefix(player, prefix_skill, concat("Used Jump Boost. New amount: ", text.number(new_amount)));
@@ -910,7 +912,7 @@ goto("wait");
 
 @infopoint8
 msg(player, getSpacer());
-msg.prefix(player, "§eQuests", "§aYou are nice and helpful? There are a lot of tasks to do in the villages.");
+msg.prefix(player, "§eQuests", "§aYou are nice and helpful? There are lots of tasks to do in the villages.");
 goto("wait");
 
 @infopoint9

+ 3 - 1
system/gamecenter.txt

@@ -147,7 +147,9 @@ if(item.getType(item) == "km:cross_red") {
 if(item.getType(item) == "minecraft:compass") {
 	player_loc = entity.getLocation(player);
 	if(loc.isInGamesWorld(player_loc)) {
-		inv.open(games_inv, player, "Minigames");
+		if(!player.hasMinigame(player)) {
+			inv.open(games_inv, player, "Minigames");
+		}
 	}
 }
 goto("wait");

+ 1 - 1
system/ranklist.txt

@@ -28,7 +28,7 @@ ranking.add("§c", "Knockfight", "knock", "knockranks", "All Kills", "DESC", nul
 ranking.add("§9", "Leapfrog", "lf", "leapfrogranks", "Points Record", "DESC", null);
 ranking.add("§6", "Parcour", null, "parcourranks1", "Time", "ASC", null);
 ranking.add("§e", "Halma", "halma", "halmaranks", "Wins", "DESC", null);
-ranking.add("§e", "ShoppingChaos", "sc", "shoppingranks", "Wins", "DESC", null);
+ranking.add("§e", "ShoppingChaos", "sc", "shoppingranks", "Max Items", "DESC", null);
 ranking.add("§e", "MengerRun", "mr", "mrranks", "Wins", "DESC", null);
 
 ranking.register("invertranks5x5");

+ 17 - 0
system/scheduler.txt

@@ -42,6 +42,23 @@ while(hasNext(iter)) {
 			player = a[3];
 			quest.finish(script, player);
 		}
+		//setBurning
+		if(action == 5) {
+			entity = a[2];
+			seconds = a[3];
+			entity.setBurning(entity, seconds);
+		}
+		//spawnEntity
+		if(action == 6) {
+			type = a[2];
+			location = a[3];
+			entity.spawn(type, location);
+		}
+		//removeEntity
+		if(action == 7) {
+			entity = a[2];
+			entity.remove(entity);
+		}
 		remove(iter);
 	}
 }

+ 34 - 10
system/story.txt

@@ -1,4 +1,5 @@
 event.load("block_click");
+event.load("inv_click");
 event.load("player_move");
 event.load("player_pre_respawn");
 event.load("player_post_respawn");
@@ -9,10 +10,16 @@ story_respawn = set.new();
 age_prop_3 = block.getProperty("age_0_3");
 
 bread_loc = loc.new(story_world, -1568, 67, -66);
+transit_loc = loc.new(story_world, -1522, 64, -18);
+schiff_spawn = loc.new(story_world, -1636, 63, -999, 50, 0.0001);
 bread = read.item("minecraft:bread");
 times = map.new();
 bread_wait_time = 3; //seconds
 
+transit_inv = inv.new("333333333");
+inv.setItem(transit_inv, 0, read.item("minecraft:cake", 1, "§fAdmont"));
+inv.setItem(transit_inv, 1, read.item("minecraft:sand", 1, "§fSchiffbruch"));
+
 msg("dev", "§bStory §rloaded.");
 @wait
 wait();
@@ -20,13 +27,21 @@ ignoreGoto(event);
 goto("wait");
 
 @block_click
+if(block_type == "minecraft:sweet_berry_bush") {
+	scheduler.setBlock(5, block_loc, concat("minecraft:sweet_berry_bush[age=3]"), false);
+	goto("wait");
+}
+if(hand == "OFF_HAND") {
+	goto("wait");
+}
+if(action == "left") {
+	goto("wait");
+}
+if(block_loc == transit_loc) {
+	inv.open(transit_inv, player, "Überfahrt");
+	goto("wait");
+}
 if(block_loc == bread_loc) {
-	if(hand == "OFF_HAND") {
-		goto("wait");
-	}
-	if(action == "left") {
-		goto("wait");
-	}
     player_uuid = player.getUuid(player);
 	now_time = time.getMillis();
 	time = map.getOrDefault(times, player_uuid, 0);
@@ -37,11 +52,20 @@ if(block_loc == bread_loc) {
 	} else {
 		msg.prefix(player, "§6FoodGiver", concat("Please wait for ", text.number(math.round(bread_wait_time - diff_time)), " seconds."));
 	}
-	goto("wait");
 }
-if(block_type == "minecraft:sweet_berry_bush") {
-	scheduler.setBlock(5, block_loc, concat("minecraft:sweet_berry_bush[age=3]"), false);
-	goto("wait");
+goto("wait");
+
+@inv_click
+if(inv_name == "Überfahrt") {
+	if(item.getType(item) == "minecraft:air") {
+		goto("wait");
+	}
+	if(inv_slot == 0) {
+		entity.teleport(player, world.getStorySpawn());
+	} elseif(inv_slot == 1) {
+		entity.teleport(player, schiff_spawn);
+	}
+	inv.close(player);
 }
 goto("wait");
 

+ 18 - 11
system/survival.txt

@@ -13,15 +13,15 @@ event.load("pre_explosion");
 event.load("mob_griefing");
 
 setScriptVar("skills", list.new());
-skill.add("Subcutaneous Inventory", "skill.subcu_inv", "minecraft:chest", "Keeps the inventory on death", 40, false, false, true);
+skill.add("Keep Inventory", "skill.subcu_inv", "minecraft:chest", "Keeps the inventory on death", 40, false, false, true);
 skill.add("Comeback", "skill.comeback", "km:skill55", "Respawn at your death location", 40, false, false, true);
-skill.add("Head Hunter", "skill.head_human", "minecraft:player_head", "Drops a player's head with a 20% chance if you kill a player (5% if a teamler is killed)", 400, true, false, false);
+skill.add("Head Hunter", "skill.head_human", "minecraft:player_head", "Drops a player's head with a 20% chance if you kill a player (5% if a staff member is killed)", 400, true, false, false);
 skill.add("Mobheads", "skill.head_monster", "minecraft:zombie_head", "Drops a mobs's head with a 20% chance (zombie / skeleton / creeper)", 200, true, false, false);
 skill.add("Fly 10min", "skill.fly10min", "minecraft:elytra", "You can fly for 10 minutes", 300, false, true, false);
 skill.add("Grow", "skill.grow", "minecraft:farmland", "Grow seeds in radius 5", 32, false, true, false);
 skill.add("Haste", "skill.haste", "minecraft:iron_pickaxe", "Haste for 2 minutes", 32, false, true, false);
 skill.add("Speed", "skill.speed", "minecraft:iron_boots", "Speed for 2 minutes", 32, false, true, false);
-skill.add("Jump Boost", "skill.jump_boost", "minecraft:rabbit_foot", "JumpBoost for 2 minutes", 32, false, true, false);
+skill.add("Jump Boost", "skill.jump_boost", "minecraft:rabbit_foot", "JumpBoost Lvl.2 for 2 minutes", 32, false, true, false);
 skill.add("Dolphin", "skill.dolphin", "minecraft:fire_coral", "Swim like a dolphin for a minute", 32, false, true, false);
 skill.add("Block Up", "skill.block_up", "minecraft:diamond_pickaxe", "Break a block and the block above for a minute", 32, false, true, false);
 skill.add("Block Down", "skill.block_down", "minecraft:diamond_pickaxe", "Break a block and the block below for a minute", 32, false, true, false);
@@ -591,6 +591,10 @@ goto("wait");
 duration = data.getTimer(player, "block_down");
 if(duration > 0) {
 	loc = loc.mod(block_loc, 0, -1, 0);
+	b_type = block.getType(loc);
+	if(b_type == "minecraft:bedrock" || b_type == "minecraft:end_portal_frame") {
+		goto("wait");
+	}
 	item = block.toStack(loc);
 	item.drop(loc, item);
 	block.set(loc, "minecraft:air");
@@ -598,6 +602,10 @@ if(duration > 0) {
 duration = data.getTimer(player, "block_up");
 if(duration > 0) {
 	loc = loc.mod(block_loc, 0, 1, 0);
+	b_type = block.getType(loc);
+	if(b_type == "minecraft:bedrock" || b_type == "minecraft:end_portal_frame") {
+		goto("wait");
+	}
 	item = block.toStack(loc);
 	item.drop(loc, item);
 	block.set(loc, "minecraft:air");
@@ -883,8 +891,7 @@ if(block_type == "minecraft:chest") {
 					y--;
 				}					
 				tp_loc = loc.mod(tp_loc, 0, 1, 0);
-				wall_type = "minecraft:lime_stained_glass";
-				setWalls(block_loc, wall_type);
+				setTpWallX(block_loc, "minecraft:lime_stained_glass");
 				sound.spawn(block_loc, piston_sound, sound_category_ambient);
 				array = array.new(4);
 				array[0] = player.getUuid(player);
@@ -930,8 +937,7 @@ if(block_type == "minecraft:chest") {
 		}
 		loc.add(tp_loc, 0.5, -3, 0.5);
 		
-		wall_type = "minecraft:lime_stained_glass";
-		setWalls(block_loc, wall_type);
+		setTpWallX(block_loc, "minecraft:lime_stained_glass");
 		sound.spawn(block_loc, piston_sound, sound_category_ambient);
 		array = array.new(4);
 		array[0] = player.getUuid(player);
@@ -1056,6 +1062,7 @@ array = list.getIndex(tp_list, 0);
 list.removeIndex(tp_list, 0);
 block_loc = array[1];
 list.add(tp_list, array);
+setTpWallFull(block_loc, "minecraft:lime_stained_glass");
 sound.spawn(block_loc, piston_sound, sound_category_ambient);
 sgoto(30, "tp_final");
 goto("wait");
@@ -1066,23 +1073,23 @@ list.removeIndex(tp_list, 0);
 player_uuid = array[0];
 block_loc = array[1];
 tp_loc = array[2];
-bool = array[3];
+adventure = array[3];
 sound.spawn(block_loc, piston_sound, sound_category_ambient);
-setWalls(block_loc, "minecraft:air");
+setTpWallFull(block_loc, "minecraft:air");
 player = player.get(player_uuid);
 if(player == null) {
 	goto("wait");
 }
 player.teleport(player, tp_loc, false);
 sound.spawn(tp_loc, adv_tp_sound, sound_category_ambient);
-if(bool) {
+if(adventure) {
 	player.setAdventure(player, true);
 	player.setAdventureStart(player, tp_loc);
 	addAdventureDisplay(player, adventure_aim_loc);
 	title.reset(player);
 	title.setSub(player, "Have fun!");
 	title.send(player, "§cAdventure");
-	msg.prefix(player, "§5Adventure", "§rTo complete your adventure, walk to the survival spawn. You cannot teleport. If you die, you start again!");
+	msg.prefix(player, "§5Adventure", "§rTo complete your adventure, go to the survival spawn. You cannot teleport. If you die, you start again!");
 }
 goto("wait");
 

+ 37 - 0
test.txt

@@ -0,0 +1,37 @@
+cloth_code_map = map.new();
+map.add(cloth_code_map, "dark_gray", 4673362);
+map.add(cloth_code_map, "cyan", 1481884);
+map.add(cloth_code_map, "red", 11546150);
+map.add(cloth_code_map, "blue", 3949738);
+map.add(cloth_code_map, "orange", 16351261);
+map.add(cloth_code_map, "green", 6192150);
+map.add(cloth_code_map, "gray", 10329495);
+map.add(cloth_code_map, "white", 16383998);
+map.add(cloth_code_map, "pink", 15961002);
+map.add(cloth_code_map, "purple", 8991416);
+map.add(cloth_code_map, "yellow", 16701501);
+map.add(cloth_code_map, "lime", 8439583);
+
+player = read.player("marvinius");
+loc = entity.getLocation(player);
+ent = entity.spawn("zombie", loc, "{IsBaby:0}");
+living.removeAi(ent);
+entity.setName(ent, "");
+entity.setSilent(ent, true);
+amongus.forceEquip(ent, "blue");
+
+function amongus.forceEquip(entity, color) {
+	color_code = map.get($cloth_code_map, color);
+	item = read.item(concat("{id:\"minecraft:leather_helmet\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
+	item.hide(item, "attributes");
+	entity.setEquip(entity, "head", item);
+	item = read.item(concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
+	item.hide(item, "attributes");
+	entity.setEquip(entity, "chest", item);
+	item = read.item(concat("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
+	item.hide(item, "attributes");
+	entity.setEquip(entity, "legs", item);
+	item = read.item(concat("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
+	item.hide(item, "attributes");
+	entity.setEquip(entity, "feet", item);
+}

+ 111 - 21
utils/u_general.txt

@@ -576,6 +576,9 @@ function quest.addCounter(player, amount) {
 function quest.finish(script, player) {
 	quest.addCounter(player, 1);
 	quest.term(script, player);
+	sound = sound.get("entity.experience_orb.pickup");
+	category = sound.getCategory("master");
+	sound.spawnForPlayer(player, sound, category);
 }
 
 function quest.term(script, player) {
@@ -1142,7 +1145,48 @@ function isATpReceiver(chest_loc) {
 	return true;
 }
 
-function setWalls(chest_loc, item_type) {
+function setTpWallX(chest_loc, item_type) {
+	block.set(loc.mod(chest_loc, 2, -1, -1), item_type);
+	//block.set(loc.mod(chest_loc, 2, -1, 0), item_type);
+	block.set(loc.mod(chest_loc, 2, -1, 1), item_type);
+	block.set(loc.mod(chest_loc, -2, -1, -1), item_type);
+	//block.set(loc.mod(chest_loc, -2, -1, 0), item_type);
+	block.set(loc.mod(chest_loc, -2, -1, 1), item_type);
+	block.set(loc.mod(chest_loc, -1, -1, 2), item_type);
+	//block.set(loc.mod(chest_loc, 0, -1, 2), item_type);
+	block.set(loc.mod(chest_loc, 1, -1, 2), item_type);
+	block.set(loc.mod(chest_loc, -1, -1, -2), item_type);
+	//block.set(loc.mod(chest_loc, 0, -1, -2), item_type);
+	block.set(loc.mod(chest_loc, 1, -1, -2), item_type);
+	
+	//block.set(loc.mod(chest_loc, 2, -2, -1), item_type);
+	block.set(loc.mod(chest_loc, 2, -2, 0), item_type);
+	//block.set(loc.mod(chest_loc, 2, -2, 1), item_type);
+	//block.set(loc.mod(chest_loc, -2, -2, -1), item_type);
+	block.set(loc.mod(chest_loc, -2, -2, 0), item_type);
+	//block.set(loc.mod(chest_loc, -2, -2, 1), item_type);
+	//block.set(loc.mod(chest_loc, -1, -2, 2), item_type);
+	block.set(loc.mod(chest_loc, 0, -2, 2), item_type);
+	//block.set(loc.mod(chest_loc, 1, -2, 2), item_type);
+	//block.set(loc.mod(chest_loc, -1, -2, -2), item_type);
+	block.set(loc.mod(chest_loc, 0, -2, -2), item_type);
+	//block.set(loc.mod(chest_loc, 1, -2, -2), item_type);
+	
+	block.set(loc.mod(chest_loc, 2, -3, -1), item_type);
+	//block.set(loc.mod(chest_loc, 2, -3, 0), item_type);
+	block.set(loc.mod(chest_loc, 2, -3, 1), item_type);
+	block.set(loc.mod(chest_loc, -2, -3, -1), item_type);
+	//block.set(loc.mod(chest_loc, -2, -3, 0), item_type);
+	block.set(loc.mod(chest_loc, -2, -3, 1), item_type);
+	block.set(loc.mod(chest_loc, -1, -3, 2), item_type);
+	//block.set(loc.mod(chest_loc, 0, -3, 2), item_type);
+	block.set(loc.mod(chest_loc, 1, -3, 2), item_type);
+	block.set(loc.mod(chest_loc, -1, -3, -2), item_type);
+	//block.set(loc.mod(chest_loc, 0, -3, -2), item_type);
+	block.set(loc.mod(chest_loc, 1, -3, -2), item_type);
+}
+
+function setTpWallFull(chest_loc, item_type) {
 	block.set(loc.mod(chest_loc, 2, -1, -1), item_type);
 	block.set(loc.mod(chest_loc, 2, -1, 0), item_type);
 	block.set(loc.mod(chest_loc, 2, -1, 1), item_type);
@@ -2501,23 +2545,22 @@ function skill.add(skill_name, tech_name, item, description, cost, permanent, ac
 	list.add(getScriptVar("skills"), skill);
 }
 
-function skill.get(skill_name) {
+function skill.get(tech_name) {
 	skill_list = getScriptVar("skills");
 	for(i = 0; i < list.getSize(skill_list); i++) {
 		array = list.getIndex(skill_list, i);
-		temp_skill_name = array[0];
-		if(temp_skill_name == skill_name) {
+		temp_tech_name = array[1];
+		if(temp_tech_name == tech_name) {
 			return array;
 		}
 	}
 }
 
-function skill.getShopItem(player, skill_name) {
-	if(skill_name == null) {
+function skill.getShopItem(player, tech_name) {
+	if(tech_name == null) {
 		return read.item("minecraft:air");
 	}
-	skill = skill.get(skill_name);
-	tech_name = skill[1];
+	skill = skill.get(tech_name);
 	amount = skill.getAmount(player, tech_name);
 	permanent = skill[5];
 	if(permanent) {
@@ -2545,10 +2588,22 @@ function skill.getShopItem(player, skill_name) {
 	} else {
 		tog = "§fNot toggleable";
 	}
+	skill_name = skill.getName(tech_name);
 	item = read.item(skill[2], 1, concat("§e§o", skill_name), concat("§fCost: §e", text.number(skill[4])), skill[3], type, tog, text_property);
 	return item;
 }
 
+function skill.getName(tech_name) {
+	skill_list = getScriptVar("skills");
+	for(i = 0; i < list.getSize(skill_list); i++) {
+		array = list.getIndex(skill_list, i);
+		temp_tech_name = array[1];
+		if(temp_tech_name == tech_name) {
+			return array[0];
+		}
+	}
+}
+
 function skill.getTechName(skill_name) {
 	skill_list = getScriptVar("skills");
 	for(i = 0; i < list.getSize(skill_list); i++) {
@@ -2626,17 +2681,26 @@ function skill.isToggleable(skill_name) {
 	}
 }
 
-function skill.showShop(player, skill_name1, skill_name2, skill_name3, skill_name4, skill_name5, skill_name6, skill_name7, skill_name8, skill_name9) {
-	inv = inv.new("333333333");
-	inv.setItem(inv, 0, skill.getShopItem(player, skill_name1));
-	inv.setItem(inv, 1, skill.getShopItem(player, skill_name2));
-	inv.setItem(inv, 2, skill.getShopItem(player, skill_name3));
-	inv.setItem(inv, 3, skill.getShopItem(player, skill_name4));
-	inv.setItem(inv, 4, skill.getShopItem(player, skill_name5));
-	inv.setItem(inv, 5, skill.getShopItem(player, skill_name6));
-	inv.setItem(inv, 6, skill.getShopItem(player, skill_name7));
-	inv.setItem(inv, 7, skill.getShopItem(player, skill_name8));
-	inv.setItem(inv, 8, skill.getShopItem(player, skill_name9));
+function skill.showShop(player, tech_name1, tech_name2, tech_name3, tech_name4, tech_name5, tech_name6, tech_name7, tech_name8, tech_name9, tech_name10, tech_name11, tech_name12, tech_name13, tech_name14, tech_name15, tech_name16, tech_name17, tech_name18) {
+	inv = inv.new("333333333333333333");
+	inv.setItem(inv, 0, skill.getShopItem(player, tech_name1));
+	inv.setItem(inv, 1, skill.getShopItem(player, tech_name2));
+	inv.setItem(inv, 2, skill.getShopItem(player, tech_name3));
+	inv.setItem(inv, 3, skill.getShopItem(player, tech_name4));
+	inv.setItem(inv, 4, skill.getShopItem(player, tech_name5));
+	inv.setItem(inv, 5, skill.getShopItem(player, tech_name6));
+	inv.setItem(inv, 6, skill.getShopItem(player, tech_name7));
+	inv.setItem(inv, 7, skill.getShopItem(player, tech_name8));
+	inv.setItem(inv, 8, skill.getShopItem(player, tech_name9));
+	inv.setItem(inv, 9, skill.getShopItem(player, tech_name10));
+	inv.setItem(inv, 10, skill.getShopItem(player, tech_name11));
+	inv.setItem(inv, 11, skill.getShopItem(player, tech_name12));
+	inv.setItem(inv, 12, skill.getShopItem(player, tech_name13));
+	inv.setItem(inv, 13, skill.getShopItem(player, tech_name14));
+	inv.setItem(inv, 14, skill.getShopItem(player, tech_name15));
+	inv.setItem(inv, 15, skill.getShopItem(player, tech_name16));
+	inv.setItem(inv, 16, skill.getShopItem(player, tech_name17));
+	inv.setItem(inv, 17, skill.getShopItem(player, tech_name18));
 	inv.open(inv, player, "Skillshop");
 }
 
@@ -2645,8 +2709,8 @@ function skill.showAll(player) {
 	skill_list = getScriptVar("skills");
 	for(i = 0; i < list.getSize(skill_list); i++) {
 		a = list.getIndex(skill_list, i);
-		skill_name = a[0];
-		inv.setItem(inv, i, skill.getShopItem(player, skill_name));
+		tech_name = a[1];
+		inv.setItem(inv, i, skill.getShopItem(player, tech_name));
 	}
 	inv.open(inv, player, "Skills");
 }
@@ -3562,4 +3626,30 @@ function scheduler.questFinish(ticks, script, player) {
 	a[2] = script;
 	a[3] = player;
 	scheduler.add(a);
+}
+
+function scheduler.setBurning(ticks, entity, seconds) {
+	a = array.new(4);
+	a[0] = 5;
+	a[1] = ticks;
+	a[2] = entity;
+	a[3] = seconds;
+	scheduler.add(a);
+}
+
+function scheduler.spawnEntity(ticks, type, location) {
+	a = array.new(4);
+	a[0] = 6;
+	a[1] = ticks;
+	a[2] = type;
+	a[3] = location;
+	scheduler.add(a);
+}
+
+function scheduler.removeEntity(ticks, entity) {
+	a = array.new(3);
+	a[0] = 7;
+	a[1] = ticks;
+	a[2] = entity;
+	scheduler.add(a);
 }

+ 6 - 3
utils/u_quest.txt

@@ -19,13 +19,16 @@ function quest.start(player, path) {
 	inv.close(player);
 }
 
-function story.getShipProgress(player_or_id) {
+function player.getShipProgress(player_or_id) {
 	config = playerdata.getStory(player_or_id);
 	return config.getDouble(config, "ship.progress", 0);
 }
 
 function player.setShipProgress(player_or_id, progress) {
 	config = playerdata.getStory(player_or_id);
-	config.set(config, "ship.progress", progress);
-	config.saveAsync(config);
+	old_progress = config.getDouble(config, "ship.progress", 0);
+	if(progress > old_progress) {
+		config.set(config, "ship.progress", progress);
+		config.saveAsync(config);
+	}
 }