123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("custom_command");
- event.load("living_death");
- event.load("living_pre_hurt");
- world = world.getStory();
- mob_loc_1 = loc.new(world, -1633.5, 70, -80.5);
- mob_loc_2 = loc.new(world, -1635.5, 70, -82.5);
- zombie_count = 0;
- stage = 0;
- all_stages = 2;
- quest_name = "Albtraum";
- @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)) {
- if(zombie == 0) {
- entity.remove(zombie1);
- entity.remove(zombie2);
- entity.remove(zombie3);
- entity.remove(zombie4);
- entity.remove(zombie5);
- }
- player = living_entity;
- msg.prefix(player, "§dQuest", "Quest terminiert.");
- 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(zombie1);
- entity.remove(zombie2);
- entity.remove(zombie3);
- entity.remove(zombie4);
- entity.remove(zombie5);
- wait(); //Script wird von außen terminiert
- }
- if(event == "quest_start") {
- quest.display(player, quest_name, stage, all_stages);
- msg.prefix(player, "§dHerbert", "MONSTER! GANZ VIELE MONSTER");
- scheduler.msgPrefix(30, player, "§dHerbert", "ICH HABE SIE MIT MEINEN EIGENEN AUGEN GESEHEN!");
- scheduler.msg(60, player, "§dAntwortmöglichkeiten:");
- scheduler.msg(60, player, text.click("[§dA§r] §eJetzt mal ruhig, was ist denn los?", "/questanswer A"));
- scheduler.msg(60, player, text.click("[§dB§r] §eWie? Wo? Was?", "/questanswer B"));
- goto("wait");
- }
- label = concat("stage", text.number(stage));
- goto(label);
- @stage0
- if(event == "custom_command" && command == "questanswer") {
- option = list.getIndex(args, 0);
- if(option == "A") {
- stage.increase(player);
- msg.prefix(player, "§dHerbert", "Oh `tschuldigung, ich wollte nicht schreien. Ich bin so schnell ich konnte weggerannt. Vor…vor den M…Monstern.");
- scheduler.msgprefix(30, player, "§dHerbert", "Sie waren in der Windmühle, bitte unternimm etwas!");
- }
- if(option == "B") {
- stage.increase(player);
- msg.prefix(player, "§dHerbert", "GRUSELIG! IN DER WINDMÜHLE! MONSTER! HILFE!");
- }
- if(option == "A" || option == "B"){
- player.giveSingleItem(player, read.item("minecraft:stone_sword"), false);
- zombie1 = entity.spawn("zombie", mob_loc_1);
- zombie2 = entity.spawn("zombie", mob_loc_1);
- zombie3 = entity.spawn("zombie", mob_loc_2);
- zombie4 = entity.spawn("zombie", mob_loc_2);
- zombie5 = entity.spawn("zombie", mob_loc_2);
- }
- }
- goto("wait");
- @stage1
- if(event == "living_death"){
- entity_type = entity.getType(living_entity);
- if(entity_type == "zombie") {
- zombie_count++;
- if(zombie_count == 5) {
- msg.prefix(player, "§dHerbert", "Du bist meine Rettung.");
- msg(player, "§dQuest abgeschlossen. Belohnung: 22 Snuvis!");
- money.addBoost(player, 22);
- quest.finish(script, player);
- }
- }
- }
- goto("wait");
|