schiff_2_nuechtern.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("entity_click");
  4. event.load("item_use_finish");
  5. stage = 0;
  6. all_stages = 2;
  7. quest_name = "Nüchtern werden";
  8. cow_loc = loc.new(world.get("story"), -1642, 66, -972);
  9. @wait
  10. wait();
  11. if(!player.isQuester(player, script)) {
  12. goto("wait");
  13. }
  14. if(event == "quest_term") {
  15. entity.cleareffects(player);
  16. entity.remove(cow_ent);
  17. wait(); //Script wird von außen terminiert
  18. }
  19. if(event == "quest_start") {
  20. entity.addEffect(player, "nausea", 9999, 0);
  21. quest.display(player, quest_name, stage, all_stages);
  22. player.giveSingleItem(player, read.item("minecraft:bucket"), false);
  23. cow_ent = entity.spawn("cow", cow_loc);
  24. msg.prefix(player, "§dKumpel", "Nimm dir diesen Eimer und melke eine Kuh. Trink die Milch, dann gehts dir besser.");
  25. goto("wait");
  26. }
  27. label = concat("stage", text.number(stage));
  28. goto(label);
  29. @stage0
  30. if(event == "entity_click" && entity.getType(entity) == "cow") {
  31. item = living.getEquip(player, "hand");
  32. item_type = item.getType(item);
  33. if(item_type == "minecraft:bucket") {
  34. stage.increase(player);
  35. }
  36. }
  37. goto("wait");
  38. @stage1
  39. if(event == "item_use_finish") {
  40. if(!isPlayer(living_entity)) {
  41. goto("wait");
  42. }
  43. player = living_entity;
  44. item_type = item.getType(item);
  45. if(item_type == "minecraft:milk_bucket") {
  46. msg.prefix(player, "§dKumpel", "Sag ich doch. Milch hilft immer.");
  47. player.setShipProgress(player, 2);
  48. entity.remove(cow_ent);
  49. msg(player, "§dQuest abgeschlossen. Belohnung: 3 Snuvis!");
  50. addMoney(player, 3);
  51. quest.finish(script, player);
  52. }
  53. }
  54. goto("wait");