schiff_13_boss.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. event.load("quest_start");
  2. event.load("quest_term");
  3. event.load("block_click");
  4. event.load("block_place");
  5. event.load("living_death");
  6. event.load("living_pre_hurt");
  7. stage = 0;
  8. all_stages = 5;
  9. quest_name = "Boss";
  10. story = world.get("story");
  11. witch_loc = loc.new(story, -1628, 64, -956);
  12. zombie_loc = loc.new(story, -1618.5, 51, -966.5);
  13. wither_skeleton_loc = loc.new(story, -1618.5, 51, -978.5);
  14. evilloc = loc.new(story, -1618.5, 51, -972.5);
  15. zombie_head_loc = loc.new(story, -1619, 51, -967);
  16. wither_skeleton_head_loc = loc.new(story, -1619, 51, -979);
  17. ents = list.new();
  18. placed_set = set.new();
  19. killed = 0;
  20. enter = false;
  21. @wait
  22. wait();
  23. if(event == "living_pre_hurt") {
  24. player = player.getFromDamageSource(damage_source);
  25. if(player == null) {
  26. goto("wait");
  27. }
  28. }
  29. if(event == "living_death") {
  30. if(isPlayer(living_entity)) {
  31. entity.remove(witch_ent);
  32. for(i = 0; i < list.getSize(ents); i++) {
  33. entity.remove(list.getIndex(ents, i));
  34. }
  35. block.set(loc.new(story, -1643, 65, -972), "minecraft:grass_block");
  36. block.set(loc.new(story, -1644, 65, -972), "minecraft:grass_block");
  37. block.set(loc.new(story, -1645, 65, -972), "minecraft:grass_block");
  38. block.set(loc.new(story, -1643, 65, -971), "minecraft:grass_block");
  39. block.set(loc.new(story, -1644, 65, -971), "minecraft:grass_block");
  40. player = living_entity;
  41. msg.prefix(player, "§dQuest", "Quest termed.");
  42. quest.term(script, player);
  43. goto("wait");
  44. }
  45. player = player.getFromDamageSource(damage_source);
  46. if(player == null) {
  47. goto("wait");
  48. }
  49. }
  50. if(!player.isQuester(player, script)) {
  51. goto("wait");
  52. }
  53. if(event == "quest_term") {
  54. entity.remove(witch_ent);
  55. for(i = 0; i < list.getSize(ents); i++) {
  56. entity.remove(list.getIndex(ents, i));
  57. }
  58. block.set(loc.new(story, -1643, 65, -972), "minecraft:grass_block");
  59. block.set(loc.new(story, -1644, 65, -972), "minecraft:grass_block");
  60. block.set(loc.new(story, -1645, 65, -972), "minecraft:grass_block");
  61. block.set(loc.new(story, -1643, 65, -971), "minecraft:grass_block");
  62. block.set(loc.new(story, -1644, 65, -971), "minecraft:grass_block");
  63. wait(); //Script wird von außen terminiert
  64. }
  65. if(event == "quest_start") {
  66. quest.display(player, quest_name, stage, all_stages);
  67. player.giveSingleItem(player, read.item("minecraft:iron_sword"), false);
  68. player.giveSingleItem(player, read.item("minecraft:shield"), false);
  69. witch_ent = entity.spawn("witch", witch_loc);
  70. msg.prefix(player, "§dKumpel", "Gut, dass du hier bist. Auf der anderen Seite der Insel habe ich eine Hexe gesehen.");
  71. goto("wait");
  72. }
  73. label = concat("stage", text.number(stage));
  74. goto(label);
  75. @stage0
  76. if(event == "living_death") {
  77. entity_type = entity.getType(living_entity);
  78. if(entity_type == "witch") {
  79. stage.increase(player);
  80. player.giveSingleItem(player, read.item("km:diamond_stick", 1, "Stab der Elemente", "Achtung, Fragil!"), false);
  81. msg.prefix(player, "§dKumpel", "Hörst du das auch? Es scheint, als würden böse Kreaturen unter der Insel erwachen. Gehe besser nachschauen.");
  82. scheduler.msgPrefix(30, player, "§dKumpel", "Ich habe letztens ein kleines Loch in der Mitte der Insel gefunden. Vielleicht kommen die Geräusche von dort.");
  83. block.set(loc.new(story, -1643, 65, -972), "minecraft:air");
  84. block.set(loc.new(story, -1644, 65, -972), "minecraft:air");
  85. block.set(loc.new(story, -1645, 65, -972), "minecraft:air");
  86. block.set(loc.new(story, -1643, 65, -971), "minecraft:air");
  87. block.set(loc.new(story, -1644, 65, -971), "minecraft:air");
  88. block.set(zombie_loc, "minecraft:air");
  89. block.set(wither_skeleton_loc, "minecraft:air");
  90. for(i = 0; i < 5; i++) {
  91. list.add(ents, entity.spawn("zombie", zombie_loc));
  92. }
  93. list.add(ents, entity.spawn("wither_skeleton", wither_skeleton_loc));
  94. list.add(ents, entity.spawn("wither_skeleton", wither_skeleton_loc));
  95. }
  96. }
  97. goto("wait");
  98. @stage1
  99. if(event == "block_click") {
  100. if(block_type == "minecraft:stone_button" && !enter) {
  101. msg.prefix(player, "§dKumpel", "Ach du meine Güte. Alles voller Monster. Sie scheinen diesen magischen Ort zu bewachen.");
  102. scheduler.msgPrefix(30, player, "§dKumpel", "Was an dem wohl so besonders ist?");
  103. enter = true;
  104. stage.increase(player);
  105. }
  106. }
  107. goto("wait");
  108. @stage2
  109. if(event == "living_pre_hurt") {
  110. if(list.contains(ents, living_entity)) {
  111. item = living.getEquip(player, "hand");
  112. item_type = item.getType(item);
  113. if(item_type != "km:diamond_stick") {
  114. cancel = true;
  115. msg.prefix(player, "§dKumpel", "Diese Monster sind mit irdischen Waffen unbesiegbar.");
  116. }
  117. }
  118. goto("wait");
  119. }
  120. if(event == "living_death") {
  121. if(list.contains(ents, living_entity)) {
  122. entity_type = entity.getType(living_entity);
  123. entity_loc = entity.getLocation(living_entity);
  124. if(entity_type == "wither_skeleton") {
  125. item.drop(entity_loc, read.item("minecraft:wither_skeleton_skull"));
  126. } elseif(entity_type == "zombie") {
  127. item.drop(entity_loc, read.item("minecraft:zombie_head"));
  128. }
  129. killed++;
  130. if(killed == 7) {
  131. stage.increase(player);
  132. msg.prefix(player, "§dKumpel", "Es schaut so aus, als könnte jeweils einer dieser Köpfe hier platziert werden.");
  133. }
  134. }
  135. }
  136. goto("wait");
  137. @stage3
  138. if(event == "block_place") {
  139. if(block_loc == zombie_head_loc || block_loc == wither_skeleton_head_loc) {
  140. if(block_type == "minecraft:zombie_head" || block_type == "minecraft:wither_skeleton_skull") {
  141. if(set.contains(placed_set, block_type)) {
  142. msg.prefix(player, "§dKumpel", "Diesen Kopf hast du bereits platziert.");
  143. goto("wait");
  144. }
  145. cancel = false;
  146. set.add(placed_set, block_type);
  147. if(set.getSize(placed_set) == 2) {
  148. stage.increase(player);
  149. particle.spawn(loc.mod(evilloc, 0, 2, 0), particle.get("minecraft:explosion"));
  150. sound.spawn(evilloc, sound.get("minecraft:entity.generic.explode"), sound.getCategory("ambient"));
  151. beelzebub_ent = human.spawn(evilloc);
  152. human.setSkin(beelzebub_ent, "herobrine");
  153. human.setScale(beelzebub_ent, 1.2);
  154. entity.setName(beelzebub_ent, "§cBeelzebub");
  155. msg.prefix(player, "§cBeelzebub", "Dir werde ich das Fürchten lehren! Nie mehr wirst du vor mir Ruhe haben!");
  156. scheduler.msgPrefix(100, player, "§cBeelzebub", "Muahahaha..., nimm dies.");
  157. scheduler.spawnEntity(180, "witch", evilloc);
  158. scheduler.removeEntity(180, beelzebub_ent);
  159. scheduler.msgPrefix(180, player, "§cBeelzebub", "Bis zum nächsten Mal...");
  160. }
  161. }
  162. }
  163. }
  164. goto("wait");
  165. @stage4
  166. if(event == "living_death") {
  167. entity_type = entity.getType(living_entity);
  168. if(entity_type == "witch" || entity_type == "silverfish") {
  169. block.set(loc.new(story, -1643, 65, -972), "minecraft:grass_block");
  170. block.set(loc.new(story, -1644, 65, -972), "minecraft:grass_block");
  171. block.set(loc.new(story, -1645, 65, -972), "minecraft:grass_block");
  172. block.set(loc.new(story, -1643, 65, -971), "minecraft:grass_block");
  173. block.set(loc.new(story, -1644, 65, -971), "minecraft:grass_block");
  174. player.setShipProgress(player, 13);
  175. msg(player, "§dQuest abgeschlossen. Belohnung: 30 Snuvis!");
  176. msg(player, text.click("§r [§cclick§r] §f[§bTeleport§f] zum Story-Spawn.", "/story"));
  177. addMoney(player, 30);
  178. quest.finish(script, player);
  179. }
  180. }
  181. goto("wait");