schiff_7_baumaterial.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("block_break");
  4. event.load("entity_click");
  5. stage = 0;
  6. all_stages = 2;
  7. quest_name = "Baumaterial besorgen";
  8. broken = 0;
  9. given = 0;
  10. @wait
  11. wait();
  12. if(!player.isQuester(player, script)) {
  13. goto("wait");
  14. }
  15. if(event == "quest_term") {
  16. entity.cleareffects(player);
  17. wait(); //Script wird von außen terminiert
  18. }
  19. if(event == "quest_start") {
  20. quest.display(player, quest_name, stage, all_stages);
  21. player.giveSingleItem(player, read.item("minecraft:stone_axe"), false);
  22. msg.prefix(player, "§dKumpel", "Wir brauchen ein Floß, um von der Insel hier wegzukommen.");
  23. scheduler.msgPrefix(30, player, "§dKumpel", "Sammle uns 8 Holzstämme, damit ich uns ein Floß bauen kann.");
  24. goto("wait");
  25. }
  26. label = concat("stage", text.number(stage));
  27. goto(label);
  28. @stage0
  29. if(event == "block_break") {
  30. if(block_type == "minecraft:jungle_log") {
  31. cancel = false;
  32. scheduler.setBlock(5, block_loc, block_type, false);
  33. broken++;
  34. if(broken == 8) {
  35. stage.increase(player);
  36. }
  37. }
  38. }
  39. goto("wait");
  40. @stage1
  41. if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
  42. entity_name = entity.getName(entity);
  43. if(entity_name == "Kumpel") {
  44. item = living.getEquip(player, "hand");
  45. item_type = item.getType(item);
  46. if(item_type == "minecraft:jungle_log") {
  47. given++;
  48. player.removeItem(player, read.item(item_type));
  49. if(given == 8) {
  50. msg.prefix(player, "§dKumpel", "Bald kann die Reise beginnen.");
  51. player.setShipProgress(player, 7);
  52. entity.cleareffects(player);
  53. msg(player, "§dQuest abgeschlossen. Belohnung: 4 Snuvis!");
  54. addMoney(player, 4);
  55. quest.finish(script, player);
  56. }
  57. } else {
  58. msg.prefix(player, "§dKumpel", "Was soll ich damit?");
  59. }
  60. }
  61. }
  62. goto("wait");