albtraum.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("custom_command");
  4. event.load("living_death");
  5. event.load("living_pre_hurt");
  6. world = world.getStory();
  7. mob_loc_1 = loc.new(world, -1633.5, 70, -80.5);
  8. mob_loc_2 = loc.new(world, -1635.5, 70, -82.5);
  9. zombie_count = 0;
  10. stage = 0;
  11. all_stages = 2;
  12. quest_name = "Albtraum";
  13. @wait
  14. wait();
  15. if(event == "living_pre_hurt") {
  16. player = player.getFromDamageSource(damage_source);
  17. if(player == null) {
  18. goto("wait");
  19. }
  20. }
  21. if(event == "living_death") {
  22. if(isPlayer(living_entity)) {
  23. if(zombie == 0) {
  24. entity.remove(zombie1);
  25. entity.remove(zombie2);
  26. entity.remove(zombie3);
  27. entity.remove(zombie4);
  28. entity.remove(zombie5);
  29. }
  30. player = living_entity;
  31. msg.prefix(player, "§dQuest", "Quest terminiert.");
  32. quest.term(script, player);
  33. goto("wait");
  34. }
  35. player = player.getFromDamageSource(damage_source);
  36. if(player == null) {
  37. goto("wait");
  38. }
  39. }
  40. if(!player.isQuester(player, script)) {
  41. goto("wait");
  42. }
  43. if(event == "quest_term") {
  44. entity.remove(zombie1);
  45. entity.remove(zombie2);
  46. entity.remove(zombie3);
  47. entity.remove(zombie4);
  48. entity.remove(zombie5);
  49. wait(); //Script wird von außen terminiert
  50. }
  51. if(event == "quest_start") {
  52. quest.display(player, quest_name, stage, all_stages);
  53. msg.prefix(player, "§dHerbert", "MONSTER! GANZ VIELE MONSTER");
  54. scheduler.msgPrefix(30, player, "§dHerbert", "ICH HABE SIE MIT MEINEN EIGENEN AUGEN GESEHEN!");
  55. scheduler.msg(60, player, "§dAntwortmöglichkeiten:");
  56. scheduler.msg(60, player, text.click("[§dA§r] §eJetzt mal ruhig, was ist denn los?", "/questanswer A"));
  57. scheduler.msg(60, player, text.click("[§dB§r] §eWie? Wo? Was?", "/questanswer B"));
  58. goto("wait");
  59. }
  60. label = concat("stage", text.number(stage));
  61. goto(label);
  62. @stage0
  63. if(event == "custom_command" && command == "questanswer") {
  64. option = list.getIndex(args, 0);
  65. if(option == "A") {
  66. stage.increase(player);
  67. msg.prefix(player, "§dHerbert", "Oh `tschuldigung, ich wollte nicht schreien. Ich bin so schnell ich konnte weggerannt. Vor…vor den M…Monstern.");
  68. scheduler.msgprefix(30, player, "§dHerbert", "Sie waren in der Windmühle, bitte unternimm etwas!");
  69. }
  70. if(option == "B") {
  71. stage.increase(player);
  72. msg.prefix(player, "§dHerbert", "GRUSELIG! IN DER WINDMÜHLE! MONSTER! HILFE!");
  73. }
  74. if(option == "A" || option == "B"){
  75. player.giveSingleItem(player, read.item("minecraft:stone_sword"), false);
  76. zombie1 = entity.spawn("zombie", mob_loc_1);
  77. zombie2 = entity.spawn("zombie", mob_loc_1);
  78. zombie3 = entity.spawn("zombie", mob_loc_2);
  79. zombie4 = entity.spawn("zombie", mob_loc_2);
  80. zombie5 = entity.spawn("zombie", mob_loc_2);
  81. }
  82. }
  83. goto("wait");
  84. @stage1
  85. if(event == "living_death"){
  86. entity_type = entity.getType(living_entity);
  87. if(entity_type == "zombie") {
  88. zombie_count++;
  89. if(zombie_count == 5) {
  90. msg.prefix(player, "§dHerbert", "Du bist meine Rettung.");
  91. msg(player, "§dQuest abgeschlossen. Belohnung: 22 Snuvis!");
  92. money.addBoost(player, 22);
  93. quest.finish(script, player);
  94. }
  95. }
  96. }
  97. goto("wait");