schiff_9_durst.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("craft");
  4. event.load("entity_click");
  5. stage = 0;
  6. all_stages = 2;
  7. quest_name = "Ich bin durstig";
  8. given = 0;
  9. @wait
  10. wait();
  11. if(!player.isQuester(player, script)) {
  12. goto("wait");
  13. }
  14. if(event == "quest_term") {
  15. entity.cleareffects(player);
  16. wait(); //Script wird von außen terminiert
  17. }
  18. if(event == "quest_start") {
  19. quest.display(player, quest_name, stage, all_stages);
  20. player.giveItem(player, read.item("minecraft:glass", 3));
  21. msg.prefix(player, "§dKumpel", "Nimm dieses Glas und crafte daraus Glasflaschen. Befülle sie mit Wasser und bringe sie mir.");
  22. goto("wait");
  23. }
  24. label = concat("stage", text.number(stage));
  25. goto(label);
  26. @stage0
  27. if(event == "craft") {
  28. if(item.getType(result) == "minecraft:glass_bottle") {
  29. stage.increase(player);
  30. }
  31. }
  32. goto("wait");
  33. @stage1
  34. if(event == "entity_click" && hand == "MAIN_HAND" && entity.getType(entity) == "human") {
  35. entity_name = entity.getName(entity);
  36. if(entity_name == "Kumpel") {
  37. item = living.getEquip(player, "hand");
  38. item_type = item.getType(item);
  39. if(item_type == "minecraft:potion") {
  40. given++;
  41. amount = item.getAmount(item);
  42. item.setAmount(item, amount - 1);
  43. if(given == 3) {
  44. msg.prefix(player, "§dKumpel", "Vielen Dank, mir geht es schon viel besser.");
  45. player.setShipProgress(player, 9);
  46. entity.cleareffects(player);
  47. msg(player, "§dQuest abgeschlossen. Belohnung: 4 Snuvis!");
  48. addMoney(player, 4);
  49. quest.finish(script, player);
  50. }
  51. } else {
  52. msg.prefix(player, "§dKumpel", "Was soll ich damit?");
  53. }
  54. }
  55. }
  56. goto("wait");