ich_und_mein_holz.txt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 = "Ich und mein Holz";
  8. wood_given = 0;
  9. spruce_log = 0;
  10. @wait
  11. wait();
  12. if(!player.isQuester(player, script)) {
  13. goto("wait");
  14. }
  15. if(event == "quest_term") {
  16. //Hier Code einfügen...
  17. wait(); //Script wird von außen terminiert
  18. }
  19. if(event == "quest_start") {
  20. quest.display(player, quest_name, stage, all_stages);
  21. msg.prefix(player, "§dFörster", "Die neue Holzlieferung ist schon lange fällig...");
  22. scheduler.msgPrefix(30, player, "§dFörster", "Ich hänge also ziemlich hinterher");
  23. scheduler.msgPrefix(60, player, "§dFörster", "Ich brauche 32 Holz aus dem Wald nebenan, um dem Handwerker seine nötigen Ressourcen zu geben.");
  24. player.giveSingleItem(player, read.item("minecraft:stone_axe"), false);
  25. goto("wait");
  26. }
  27. label = concat("stage", text.number(stage));
  28. goto(label);
  29. @stage0
  30. if(event == "block_break") {
  31. if(block_type == "minecraft:spruce_log" && loc.getx(block_loc)<= -1692) {
  32. cancel = false;
  33. scheduler.setBlock(25, block_loc, "minecraft:spruce_log", false);
  34. spruce_log++;
  35. if(spruce_log == 32) {
  36. stage.increase(player);
  37. }
  38. }
  39. goto("wait");
  40. }
  41. if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
  42. entity_name = entity.getName(entity);
  43. if(entity_name == "Förster") {
  44. player.giveSingleItem(player, read.item("minecraft:stone_axe"), false);
  45. }
  46. }
  47. goto("wait");
  48. @stage1
  49. if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
  50. entity_name = entity.getName(entity);
  51. if(entity_name == "Förster") {
  52. rest_amount = human.giveItem("Förster", player, "minecraft:spruce_log", spruce_log);
  53. if(rest_amount == 0) {
  54. msg.prefix(player, "§dFörster", "Danke, ich werde es zur Verarbeitung weiterreichen");
  55. money.addBoost(player, 24);
  56. msg(player, "§dQuest abgeschlossen. Belohnung: 24 Snuvis!");
  57. quest.callShowShop(player, "foerster");
  58. quest.finish(script, player);
  59. } else {
  60. spruce_log = rest_amount;
  61. }
  62. }
  63. }
  64. goto("wait");