schatz_von_admont.txt 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("block_click");
  4. event.load("entity_click");
  5. world = world.get("story");
  6. arrow_chest_loc = loc.new(world, -1659, 76, 50);
  7. treasure_chest_loc = loc.new(world, -1662, 75, 46);
  8. mob_loc_1 = loc.new(world, -1666.5, 76, 53.5);
  9. mob_loc_2 = loc.new(world, -1661.5, 74, 48.5);
  10. stage = 0;
  11. all_stages = 2;
  12. quest_name = "Schatz von Admont";
  13. @wait
  14. wait();
  15. if(!player.isQuester(player, script)) {
  16. goto("wait");
  17. }
  18. if(event == "quest_term") {
  19. //Hier Code einfügen...
  20. wait(); //Script wird von außen terminiert
  21. }
  22. if(event == "quest_start") {
  23. quest.display(player, quest_name, stage, all_stages);
  24. msg.prefix(player, "§dHerbert", "Hier in Admont ist seit langem ein Schatz versteckt. Niemand hat ihn je gesehen...");
  25. scheduler.msgPrefix(30, player, "§dHerbert", "Ich versuche es schon seit Ewigkeiten.");
  26. scheduler.msgPrefix(60, player, "§dHerbert", "Schau doch mal auf die Karte. Vielleicht hast du ja mehr Erfolg.");
  27. player.giveSingleItem(player, read.item("minecraft:iron_sword"), false);
  28. entity.spawn("zombie", mob_loc_1);
  29. entity.spawn("skeleton", mob_loc_1);
  30. entity.spawn("zombie", mob_loc_2);
  31. entity.spawn("skeleton", mob_loc_2);
  32. block.addItem(arrow_chest_loc, read.item("minecraft:arrow", 64));
  33. goto("wait");
  34. }
  35. label = concat("stage", text.number(stage));
  36. goto(label);
  37. @stage0
  38. if(event == "block_click") {
  39. if(block_loc == treasure_chest_loc) {
  40. stage.increase(player);
  41. msg.prefix(player, "§dHerbert", "Gut gemacht! Jetzt komm zu mir zurück.");
  42. block.addItem(treasure_chest_loc, read.item("minecraft:gold_ingot", 8));
  43. block.addItem(treasure_chest_loc, read.item("minecraft:diamond"));
  44. }
  45. }
  46. goto("wait");
  47. @stage1
  48. if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
  49. entity_name = entity.getName(entity);
  50. if(entity_name == "Herbert") {
  51. item = living.getEquip(player, "hand");
  52. item_type = item.getType(item);
  53. if(item_type == "minecraft:gold_ingot" || item_type == "minecraft:diamond") {
  54. amount = player.getItemAmount(player, false, read.item("minecraft:diamond"));
  55. if(amount == 0) {
  56. msg.prefix(player, "§dHerbert", "Du hast keinen Diamand im Inventar.");
  57. goto("wait");
  58. }
  59. event.unload("entity_click");
  60. msg.prefix(player, "§dHerbert", "Du hast es tatsächlich geschafft.");
  61. scheduler.msgPrefix(30, player, "§dHerbert", "Den Diamanten behalte ich.");
  62. scheduler.msgPrefix(60, player, "§dHerbert", "Die Goldbarren hast du dir verdient.");
  63. player.removeItem(player, read.item("minecraft:diamond"));
  64. money.addBoost(player, 24);
  65. scheduler.msg(65, player, "§dQuest abgeschlossen. Belohnung: 24 Snuvis!");
  66. scheduler.questFinish(65, script, player);
  67. } else {
  68. msg.prefix(player, "§dHerbert", "Gib mir bitte den Schatz.");
  69. }
  70. }
  71. }
  72. goto("wait");