reinigung.txt 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("block_click");
  4. event.load("entity_click");
  5. event.load("custom_command");
  6. stage = 0;
  7. all_stages = 3;
  8. quest_name = "Reinigung";
  9. clean = 0;
  10. @wait
  11. wait();
  12. if(event == "living_death") {
  13. player = player.getFromDamageSource(damage_source);
  14. if(player == null) {
  15. goto("wait");
  16. }
  17. }
  18. if(!player.isQuester(player, script)) {
  19. goto("wait");
  20. }
  21. if(event == "quest_term") {
  22. //Hier Code einfügen...
  23. wait(); //Script wird von außen terminiert
  24. }
  25. if(event == "quest_start") {
  26. quest.display(player, quest_name, stage, all_stages);
  27. msg.prefix(player, "§dOlaf", "Nach langen Reisen sieht das Schiff immer sehr mitgenommen aus… Ich brauche dringend eine Putzhilfe.");
  28. scheduler.msgPrefix(30, player, concat("§5", player.getName(player)), "Gerne! Was soll ich machen?");
  29. scheduler.msgPrefix(60, player, "§dOlaf", "Am Bug und Heck des Schiffes kleben viele Muscheln, entferne sie bitte.");
  30. story_world = world.getStory();
  31. block.set(loc.new(story_world, -1523, 63, -24), "minecraft:polished_blackstone_button[facing=north]");
  32. block.set(loc.new(story_world, -1521, 63, -13), "minecraft:polished_blackstone_button[facing=east]");
  33. block.set(loc.new(story_world, -1522, 63, -11), "minecraft:polished_blackstone_button[facing=east]");
  34. block.set(loc.new(story_world, -1525, 63, -13), "minecraft:polished_blackstone_button[facing=west]");
  35. block.set(loc.new(story_world, -1524, 63, -11), "minecraft:polished_blackstone_button[facing=west]");
  36. goto("wait");
  37. }
  38. label = concat("stage", text.number(stage));
  39. goto(label);
  40. @stage0
  41. if(event == "block_click") {
  42. if(block_type == "minecraft:polished_blackstone_button") {
  43. cancel = true;
  44. block.set(block_loc, "minecraft:air");
  45. clean++;
  46. if(clean == 5) {
  47. stage.increase(player);
  48. player.safeGiveItem(player, read.item("minecraft:nautilus_shell"));
  49. msg.prefix(player, "§dOlaf", "Ist das etwa eine Nautilusschale?");
  50. scheduler.msgPrefix(30, player, "§dOlaf", "Wow, sie glänzt und schimmert, wie wunderbar! Ich brauche sie unbedingt für meine Sammlung.");
  51. scheduler.msgPrefix(60, player, "§dOlaf", "Würde es dir etwas ausmachen, sie mir zu überreichen? Ich werde sie gut aufbewahren!");
  52. scheduler.msg(60, player, "§dAntwortmöglichkeiten:");
  53. scheduler.msg(60, player, text.click("[§dA§r] §eKein Problem.", "/questanswer A"));
  54. scheduler.msg(60, player, text.click("[§dB§r] §eNein, ich behalte sie.", "/questanswer B"));
  55. } else {
  56. player.safeGiveItem(player, read.item("km:shell"));
  57. }
  58. }
  59. }
  60. goto("wait");
  61. @stage1
  62. if(event == "custom_command" && command == "questanswer") {
  63. option = list.getIndex(args, 0);
  64. if(option == "A") {
  65. stage.increase(player);
  66. msg.prefix(player, "§dOlaf", "Danke, danke, danke!!!");
  67. goto("wait");
  68. }
  69. if(option == "B") {
  70. msg.prefix(player, "§dOlaf", "Das ist zwar schade, aber du hast sie ja auch gefunden. Viel Spaß damit.");
  71. msg(player, "§dQuest abgeschlossen. Belohnung: 6 Snuvis!");
  72. money.addBoost(player, 6);
  73. quest.finish(script, player);
  74. }
  75. }
  76. goto("wait");
  77. @stage2
  78. if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
  79. entity_name = entity.getName(entity);
  80. if(entity_name == "Olaf") {
  81. rest_amount = human.giveItem(entity_name, player, "minecraft:nautilus_shell", 1);
  82. if(rest_amount == 0) {
  83. msg(player, "§dQuest abgeschlossen. Belohnung: 12 Snuvis!");
  84. money.addBoost(player, 12);
  85. quest.finish(script, player);
  86. }
  87. }
  88. }
  89. goto("wait");