12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("living_death");
- stage = 0;
- all_stages = 1;
- quest_name = "Monster besiegen";
- guardian_loc = loc.new(world.get("story"), -1623, 61, -1023);
- @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") {
- 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);
- @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, 6);
- entity.cleareffects(player);
- msg(player, "§dQuest abgeschlossen. Belohnung: 4 Snuvis!");
- addMoney(player, 4);
- quest.finish(script, player);
- }
- }
- goto("wait");
|