Zeldaboy111

Shaman Boss ]|[ Skript #424

Jun 13th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.30 KB | None | 0 0
  1. # Use armor stands to create skills (i.e. comet)
  2. # Stray (shaman): holds stick, summon angry wolves,
  3. # Add particles & sounds
  4.  
  5.  
  6. options:
  7. logo: &4&lBoss&8:&7
  8. bossGuiName: Bosses
  9.  
  10. # Boss health
  11. maxHealth_zombieBoss: 100
  12. maxHealth_skeletonBoss: 140
  13. maxHealth_blazeBoss: 120
  14. maxHealth_shamanBoss: 110
  15.  
  16. # The permission required to execute the command '/boss'
  17. permission: "boss.*"
  18.  
  19. on enable:
  20. set {zombieBossItem} to zombie head named "&aZombie Boss" with lore " &7Health&8: &7{@maxHealth_zombieBoss}", "&8 ", " &7Click to summon" and " &7the Zombie Boss."
  21. set {skeletonBossItem} to skeleton head named "&fSkeleton Boss" with lore " &7Health&8: &7{@maxHealth_skeletonBoss}", "&8 ", " &7Click to summon" and " &7the Skeleton Boss."
  22. set {blazeBossItem} to blaze rod named "&cBlaze Boss" with lore " &7Health&8: &7{@maxHealth_blazeBoss}", "&8 ", " &7Click to summon" and " &7the Blaze Boss."
  23. set {shamanBossItem} to stick named "&2Shaman Boss" with lore " &7Health&8: &7{@maxHealth_shamanBoss}", "&8 ", " &7Click to summon" and " &7the Shaman Boss."
  24.  
  25.  
  26.  
  27. function getNewLocation(location: Location, offset: Number, direction: Integer) :: Location:
  28. if {_direction} is 0:
  29. set {_location} to location {_offset} meters northeast of {_location}
  30. else if {_direction} is 1:
  31. set {_location} to location {_offset} meters northwest of {_location}
  32. else if {_direction} is 2:
  33. set {_location} to location {_offset} meters southwest of {_location}
  34. else if {_direction} is 3:
  35. set {_location} to location {_offset} meters southeast of {_location}
  36. return {_location}
  37.  
  38. function mustUpdateDirection(input: Number, standsWithTheSameDirection: Integer, dir: Integer) :: boolean:
  39. if {_standsWithTheSameDirection} < 1:
  40. set {_standsWithTheSameDirection} to 1
  41. while {_input} >= {_standsWithTheSameDirection}:
  42. remove {_standsWithTheSameDirection} from {_input}
  43. if {_input} is 0:
  44. return true
  45. return false
  46.  
  47. function getNewDirection(dir: Integer) :: integer:
  48. add 1 to {_dir}
  49. if {_dir} is 4:
  50. set {_dir} to 0
  51. return {_dir}
  52.  
  53. # Number MUST be a duplicate of four
  54. function circle(loc: location, radius: Integer, amount: Integer, entity: EntityType):
  55. set {_summonLocation} to location {_radius} meters north of {_loc}
  56. set {_standsWithTheSameDirection} to {_amount}/4
  57. set {_distanceBetweenStands} to {_radius}/{_standsWithTheSameDirection}
  58. set {_dir} to 2
  59. summon {_entity} at {_summonLocation}
  60. set helmet of last spawned entity to unbreakable skull of "MHF_%{_entity}%" parsed as an offline player
  61. loop {_amount} -1 times:
  62. set {_summonLocation} to getNewLocation({_summonLocation}, {_distanceBetweenStands}, {_dir})
  63. if mustUpdateDirection(loop-value, "%{_standsWithTheSameDirection}%" parsed as an integer, {_dir}) is true:
  64. set {_dir} to getNewDirection({_dir})
  65. summon {_entity} at {_summonLocation}
  66. set helmet of last spawned entity to unbreakable skull of "MHF_%{_entity}%" parsed as an offline player
  67.  
  68. command /boss:
  69. trigger:
  70. if executor is not player:
  71. send "{@logo} This command can only be executed by a player."
  72. else if player doesn't have permission {@permission}:
  73. send "{@logo} You do not have enough permissions to do this."
  74. else:
  75. open chest with 3 rows named "{@bossGuiName}" to player
  76. loop 10 times:
  77. set slot loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
  78. set slot 26 - loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
  79.  
  80. set slot 10 of player's current inventory to {zombieBossItem}
  81. set slot 11 of player's current inventory to {skeletonBossItem}
  82. set slot 12 of player's current inventory to {blazeBossItem}
  83. set slot 13 of player's current inventory to {shamanBossItem}
  84. set {boss.currentInventory.%player%} to true
  85.  
  86. #
  87. # B o s s e s
  88. #
  89.  
  90. function getRandomTarget(boss: Entity, radius: Number) :: Entity:
  91. set {_possibleTargets::*} to all players in radius {_radius} around {_boss}
  92. set {_targetsAreEntities} to false
  93. if size of {_possibleTargets::*} < 1:
  94. set {_targetsAreEntities} to true
  95. set {_possibleTargets::*} to all entities in radius {_radius} around {_boss}
  96. while {_possibleTargets::*} is not empty:
  97. set {_target} to random element out of {_possibleTargets::*}
  98. remove {_target} from {_possibleTargets::*}
  99. if {_target} is not a player:
  100. if {_target} is not {_boss}:
  101. if {_target} is not a dropped item:
  102. if {_target} is not experience orb or painting or item frame or armor stand:
  103. if "%{_target}%" does not contain "arrow":
  104. return {_target}
  105. else if gamemode of {_target} is survival or adventure:
  106. return {_target}
  107.  
  108. set {_stopLoop} to false
  109. if {_possibleTargets::*} is empty:
  110. set {_stopLoop} to true
  111. else if {_possibleTargets::*} is not set:
  112. set {_stopLoop} to true
  113. if {_stopLoop}:
  114. if {_targetsAreEntities} is false:
  115. set {_targetsAreEntities} to true
  116. set {_possibleTargets::*} to all entities in radius {_radius} around {_boss}
  117. else:
  118. return null
  119. function damageEntitiesInRadius(location: Location, radius: Number, damage: Number, ignoreEntity: Entity):
  120. loop all entities in radius {_radius} around {_location}:
  121. if loop-entity is not {_ignoreEntity}:
  122. damage loop-entity by {_damage}/(distance between location of loop-entity and {_location})
  123.  
  124. function summonBoss(entityType: EntityType, location: Location, name: String, heldItem: Item, isAdult: Boolean) :: entity:
  125. set {_boss} to {_entityType}
  126. summon {_boss} at {_location}
  127. set {_boss} to last spawned entity
  128. set display name of {_boss} to "%{_name}%"
  129. set custom name visibility of {_boss} to true
  130. if {_entityType} is stray:
  131. set helmet of {_boss} to unbreakable skull of "12345" parsed as an offline player with nbt "{SkullOwner:{Id:""644c9bad-958b-43ce-9d2f-199d85be607c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzhkZGY3NmU1NTVkZDVjNGFhOGEwYTVmYzU4NDUyMGNkNjNkNDg5YzI1M2RlOTY5ZjdmMjJmODVhOWEyZDU2In19fQ==""}]}}}"
  132. else:
  133. set helmet of {_boss} to unbreakable skull of "MHF_%{_entityType}%" parsed as an offline player with name "%{_name}% Throphy"
  134. set chestplate of {_boss} to air
  135. set leggings of {_boss} to air
  136. set boots of {_boss} to air
  137. set held item of {_boss} to air
  138. add "{ArmorDropChances:[0.0f,0.0f,0.0f,1.1f],HandDropChances:[0.0f,0.0f]}" to nbt of {_boss}
  139. set {_boss} to adult
  140. if {_isAdult} is false:
  141. set {_boss} to baby
  142. return {_boss}
  143.  
  144. function summonZombieBoss(location: Location):
  145. set {_boss} to summonBoss(zombie, {_location}, "&a&lZombie Boss", iron sword, true)
  146. set max health of {_boss} to {@maxHealth_zombieBoss}
  147. set health of {_boss} to {@maxHealth_zombieBoss}
  148. wait 20 ticks
  149. while {_boss} is alive:
  150. if {%{_boss}%.hasUsedJumpAbility} is not true:
  151. set {_rng} to random integer between 0 and 6
  152. if {_rng} is 0, 1 or 2:
  153. circle(location of {_boss}, 3, 8, zombie)
  154. else if {_rng} is 3 or 4:
  155. delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
  156. set {_target} to getRandomTarget({_boss}, 9)
  157. if {_target} is set:
  158. jump({_boss}, 5, {_target})
  159. wait 47 ticks
  160.  
  161. function jump(entity: Entity, height: Number, targetLocation: Location):
  162. set {%{_entity}%.hasUsedJumpAbility} to true
  163. push {_entity} (direction from location of {_entity} to {_targetLocation}) at speed 0.7436
  164. push {_entity} 0.9513 meters upwards
  165.  
  166.  
  167. # Skeleton boss
  168. function summonSkeletonBoss(location: Location):
  169. set {_boss} to summonBoss(skeleton, {_location}, "&f&lSkeleton Boss", bow, true)
  170. set max health of {_boss} to {@maxHealth_skeletonBoss}
  171. set health of {_boss} to {@maxHealth_skeletonBoss}
  172. wait 20 ticks
  173. while {_boss} is alive:
  174. set {_rng} to random integer between 0 and 7
  175. if {_rng} is 0, 1 or 2:
  176. circle(location of {_boss}, 3, 4, skeleton)
  177. else if {_rng} is 3 or 4:
  178. delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
  179. set {_target} to getRandomTarget({_boss}, 17)
  180. if {_target} is set:
  181. shootArrows({_boss}, random integer between 4 and 7, {_target})
  182. wait 40 ticks
  183.  
  184. function shootArrows(boss: Entity, arrowAmount: Number, target: Entity):
  185. loop {_arrowAmount} times:
  186. if {_boss} is alive:
  187. if {_target} is alive:
  188. if distance between {_boss} and {_target} <= 17:
  189. set {_v} to vector from {_boss} to location of {_target}
  190. make {_boss} shoot arrow at speed 1 {_v}
  191. wait "%random integer between 5 and 9% ticks" parsed as a timespan
  192.  
  193. # Blaze boss
  194. function summonBlazeBoss(location: Location):
  195. set {_boss} to summonBoss(blaze, {_location}, "&c&lBlaze Boss", air, true)
  196. set max health of {_boss} to {@maxHealth_blazeBoss}
  197. set health of {_boss} to {@maxHealth_blazeBoss}
  198. wait 20 ticks
  199. while {_boss} is alive:
  200. set {_rng} to random integer between 0 and 8
  201. if {_rng} is 0, 1 or 2:
  202. circle(location of {_boss}, 4, 4, blaze)
  203. else if {_rng} is 3 or 4:
  204. delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
  205. set {_target} to getRandomTarget({_boss}, 17)
  206. if {_target} is set:
  207. summonComet({_boss}, {_target})
  208. wait 40 ticks
  209.  
  210. function summonComet(boss: Entity, target: Entity):
  211. set {_cometY::*} to 0, 0, 0, 0, 0, 0.2 and -0.2
  212. set {_cometX::*} to 0, 0.2, 0, -0.2, 0, 0 and 0
  213. set {_cometZ::*} to 0.2, 0, -0.2, 0, 0, 0 and 0
  214. loop 7 times:
  215. summon armor stand at location 10+{_cometY::%loop-value%} meters above, {_cometX::%loop-value%} meters east and {_cometZ::%loop-value%} meters south of {_target}
  216. set {_stand::%loop-value%} to last spawned armor stand
  217. set metadata value "IsCometStand" of {_stand::%loop-value%} to true
  218. set helmet of {_stand::%loop-value%} to coal block
  219. add "{Invisible:1b}" to nbt of {_stand::%loop-value%}
  220. while {_stand::1} is not on ground:
  221. wait 5 ticks
  222. set {_loc} to location of {_stand::1}
  223. loop {_stand::*}:
  224. kill loop-value
  225. damageEntitiesInRadius({_loc}, 3.9, 3.9, {_boss})
  226.  
  227. # Shaman boss:
  228. # - wolves {Angry:20}
  229. # - Dirt/stone instead of meteor: get block from surrounding and remove that block, summon fallingsand of that type above the target
  230. # - Healing perk
  231.  
  232. function summonFallingBlock(boss: Entity, target: Location):
  233.  
  234.  
  235. # Head is incorrect
  236. function summonShamanBoss(location: Location):
  237. set {_boss} to summonBoss(stray, {_location}, "&2&lShaman Boss", stick, true)
  238. set metadata value "ExcemptWolfTarget" of {_boss} to true
  239. set max health of {_boss} to {@maxHealth_shamanBoss}
  240. set health of {_boss} to {@maxHealth_shamanBoss}
  241. wait 20 ticks
  242. while {_boss} is alive:
  243. set {_rng} to random integer between 0 and 7
  244. set {_rng} to 2
  245. if {_rng} is 0, 1 or 2:
  246. delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
  247. set {_target} to getRandomTarget({_boss}, 21)
  248. if {_target} is set:
  249. circle(location of {_boss}, 4, 4, skeleton)
  250. else if {_rng} is 3 or 4:
  251. delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
  252. set {_target} to getRandomTarget({_boss}, 17)
  253. if {_target} is set:
  254. summonFallingBlock({_boss}, {_target})
  255. else if {_rng} is 5:
  256. # Healing perk
  257. wait 40 ticks
  258.  
  259.  
  260. on inventory click:
  261. if inventory name of player's current inventory is "{@bossGuiName}":
  262. cancel event
  263. if clicked item is {zombieBossItem}:
  264. summonZombieBoss(location of player)
  265. close inventory of player
  266. else if clicked item is {skeletonBossItem}:
  267. summonSkeletonBoss(location of player)
  268. close inventory of player
  269. else if clicked item is {blazeBossItem}:
  270. summonBlazeBoss(location of player)
  271. close inventory of player
  272. else if clicked item is {shamanBossItem}:
  273. summonShamanBoss(location of player)
  274. close inventory of player
  275.  
  276.  
  277. on inventory close:
  278. delete {boss.currentInventory.%player%}
  279. on inventory drag:
  280. if {boss.currentInventory.%player%} is true:
  281. cancel event
  282.  
  283. on quit:
  284. delete {boss.currentInventory.%player%}
  285.  
  286. on damage:
  287. if damage cause is fall:
  288. if {%victim%.hasUsedJumpAbility} is true:
  289. delete {%victim%.hasUsedJumpAbility}
  290. damageEntitiesInRadius(location of {_victim}, 4.3, 2.6, victim)
  291.  
  292. on right click on armor stand:
  293. if metadata value "IsCometStand" of clicked entity is true:
  294. cancel event
  295.  
Advertisement
Add Comment
Please, Sign In to add comment