Zeldaboy111

Zombie Boss! ]|[ Skript #410

Apr 25th, 2021
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. # Use armor stands to create skills (i.e. comet)
  2. # Zombie boss: hordes of zombies, etc
  3. # Skeleton boss: archer, summon skeletons, shoot arrow with high damage
  4. # Blaze boss: comet/fireball, summon blazes,
  5. # Stray (shaman): holds stick, summon angry wolves,
  6.  
  7. options:
  8. logo: &4&lBoss&8:&7
  9. bossGuiName: Bosses
  10. zombieBossItem: zombie head named "&aZombie Boss" with lore "&8", " &7Click to summon" and " &7the Zombie Boss."
  11. skeletonBossItem: skeleton head named "&fSkeleton Boss" with lore "&8", " &7Click to summon" and " &7the Skeleton Boss."
  12. blazeBossItem: blaze rod named "&cSkeleton Boss" with lore "&8", " &7Click to summon" and " &7the Blaze Boss."
  13. shamanBossItem: stick named "&2Skeleton Boss" with lore "&8", " &7Click to summon" and " &7the Shaman Boss."
  14. permission: "boss.*"
  15.  
  16. function getNewLocation(location: Location, offset: Number, direction: Integer) :: Location:
  17. if {_direction} is 0:
  18. set {_location} to location {_offset} meters northeast of {_location}
  19. else if {_direction} is 1:
  20. set {_location} to location {_offset} meters northwest of {_location}
  21. else if {_direction} is 2:
  22. set {_location} to location {_offset} meters southwest of {_location}
  23. else if {_direction} is 3:
  24. set {_location} to location {_offset} meters southeast of {_location}
  25. return {_location}
  26.  
  27. function mustUpdateDirection(input: Number, standsWithTheSameDirection: Integer, dir: Integer) :: boolean:
  28. if {_standsWithTheSameDirection} < 1:
  29. set {_standsWithTheSameDirection} to 1
  30. while {_input} >= {_standsWithTheSameDirection}:
  31. remove {_standsWithTheSameDirection} from {_input}
  32. if {_input} is 0:
  33. return true
  34. return false
  35.  
  36. function getNewDirection(dir: Integer) :: integer:
  37. add 1 to {_dir}
  38. if {_dir} is 4:
  39. set {_dir} to 0
  40. return {_dir}
  41.  
  42. # Number MUST be a duplicate of four
  43. function circle(loc: location, radius: Integer, amount: Integer, entity: EntityType):
  44. set {_summonLocation} to location {_radius} meters north of {_loc}
  45. set {_standsWithTheSameDirection} to {_amount}/4
  46. set {_distanceBetweenStands} to {_radius}/{_standsWithTheSameDirection}
  47. set {_dir} to 2
  48. summon {_entity} at {_summonLocation}
  49. loop {_amount} -1 times:
  50. set {_summonLocation} to getNewLocation({_summonLocation}, {_distanceBetweenStands}, {_dir})
  51. if mustUpdateDirection(loop-value, "%{_standsWithTheSameDirection}%" parsed as an integer, {_dir}) is true:
  52. set {_dir} to getNewDirection({_dir})
  53. summon {_entity} at {_summonLocation}
  54. set display name of last spawned armor stand to "%loop-value%: %{_dir}%"
  55.  
  56. command /boss:
  57. trigger:
  58. if executor is not player:
  59. send "{@logo} This command can only be executed by a player."
  60. else if player doesn't have permission {@permission}:
  61. send "{@logo} You do not have enough permissions to do this."
  62. else:
  63. open chest with 3 rows named "{@bossGuiName}" to player
  64. loop 10 times:
  65. set slot loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
  66. set slot 26 - loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
  67.  
  68. set slot 10 of player's current inventory to {@zombieBossItem}
  69. set slot 11 of player's current inventory to {@skeletonBossItem}
  70. set slot 12 of player's current inventory to {@blazeBossItem}
  71. set slot 13 of player's current inventory to {@shamanBossItem}
  72. set {boss.currentInventory.%player%} to true
  73.  
  74. #
  75. # B o s s e s
  76. #
  77.  
  78. function summonZombieBoss(location: Location):
  79. set {_zombie} to zombie
  80. summon {_zombie} at {_location}
  81. set {_zombie} to last spawned zombie
  82. set display name of {_zombie} to "&a&lZombie Boss"
  83. set custom name visibility of {_zombie} to true
  84. wait 20 ticks
  85. while {_zombie} is alive:
  86. set {_rng} to random integer between 0 and 10
  87. broadcast "RNG: %{_rng}%"
  88. if {_rng} is 0, 1 or 2:
  89. circle(location of {_zombie}, 3, 8, zombie)
  90. wait 40 ticks
  91.  
  92. on inventory click:
  93. if inventory name of player's current inventory is "{@bossGuiName}":
  94. cancel event
  95. if clicked item is {@zombieBossItem}:
  96. summonZombieBoss(location of player)
  97. close inventory of player
  98. else if clicked item is {@skeletonBossItem}:
  99. send "SKELETON"
  100. close inventory of player
  101. else if clicked item is {@blazeBossItem}:
  102. send "BLAZE"
  103. close inventory of player
  104. else if clicked item is {@shamanBossItem}:
  105. send "SHAMAN"
  106. close inventory of player
  107.  
  108.  
  109. on inventory close:
  110. delete {boss.currentInventory.%player%}
  111. on inventory drag:
  112. if {boss.currentInventory.%player%} is true:
  113. cancel event
  114.  
  115. on quit:
  116. delete {boss.currentInventory.%player%}
  117.  
Advertisement
Add Comment
Please, Sign In to add comment