presents.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. %loadEvent block-place;
  2. %loadEvent block-break;
  3. %loadEvent player-hurt;
  4. %loadEvent block-click;
  5. %loadEvent player-leave;
  6. %setVar mode 1;
  7. %setVar no-join true;
  8. %setVar no-quest-msg true;
  9. %setVars %getQuestLeader;;
  10. %setVar p $player-name;
  11. %setVar mapname %concat %getPlayerUUID $p; presents;;
  12. %getGlobalMap $mapname $mapname;
  13. %getGlobalMap allpresents allpresents;
  14. %sbadd $p 3 §r;
  15. %sbadd $p 2 §aPresents;
  16. %sbadd $p 1 §e%getMapSize $mapname;/%getMapSize allpresents;;
  17. %command title $p times 20 60 0;
  18. %command title $p clear;
  19. %command title $p title {"text":"Presents","color":"green"};
  20. %speak $p §aPresents §eFinde alle auf der Map vertgeilten Geschenksköpfe. Um zu pausieren oder etwas anderes zu machen, verwende einfach /leave oder kurz /l. Fröhliche Weihnachten!;
  21. %setHealth $p 20;
  22. %setHunger $p 20;
  23. %setSaturation $p 5;
  24. %teleportPlayer $p $spawnloc;
  25. %command clear $p;
  26. %sgoto 100 loop;
  27. @wait
  28. %wait;
  29. %if $event == block-click && $mode == 1 && $block-type == SKULL then goto foundskull;
  30. %if $event == block-place && $mode == 0 && %getItemInMainHand $player-name; == $presentitem then goto setskull;
  31. %if $event == block-break || $event == block-place || $event == player-hurt then setVar cancel true;
  32. %if $event == player-leave then goto leavegame;
  33. %goto wait;
  34. @loop
  35. %setHunger $player-name 20;
  36. %setSaturation $player-name 5;
  37. %sgoto 100 loop;
  38. %goto wait;
  39. @setskull
  40. %addGlobalMapElement allpresents $block-loc true;
  41. %getGlobalMap allpresents allpresents;
  42. %msg $player-name Kopf %getMapSize allpresents; wurde gesetzt.;
  43. %goto wait;
  44. @foundskull
  45. %setVar mapname %concat %getPlayerUUID $player-name; presents;;
  46. %getGlobalMap $mapname $mapname;
  47. %getGlobalMap allpresents allpresents;
  48. %if %checkForMapKey $mapname $block-loc; == true then goto alreadyfound;
  49. %addGlobalMapElement $mapname $block-loc true;
  50. %addMapElement $mapname $block-loc true;
  51. %speak $player-name §aPresents §eDu hast Geschenk §b%getMapSize $mapname; §evon §b%getMapSize allpresents; §egefunden.;
  52. %sbadd $p 1 §e%getMapSize $mapname;/%getMapSize allpresents;;
  53. %if %getMapSize allpresents; == %getMapSize $mapname; then goto foundall;
  54. %goto wait;
  55. @alreadyfound
  56. %speak $player-name §aPresents §eDu hast dieses Geschenk bereits gefunden.;
  57. %goto wait;
  58. @foundall
  59. %speak $player-name §aPresents §eHerzlichen Glückwunsch, du hast alle Geschenke gefunden.;
  60. %addGlobalMapElement presentwinners %getPlayerUUID $player-name; %getMapSize presentwinners;;
  61. %getGlobalMap presentwinners presentwinners;
  62. %speak $player-name §aPresents §eAnzahl der Spieler, die alle Geschenke gefunden haben: %getMapSize presentwinners;;
  63. %goto wait;
  64. @giveup
  65. %teleportPlayer $player-name $gamesworldloc;
  66. @leavegame
  67. %setVar p $player-name;
  68. %sbreset $p;
  69. %setHealth $p 20;
  70. %setHunger $p 20;
  71. %setSaturation $p 5;
  72. %term;