Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Use armor stands to create skills (i.e. comet)
- # Zombie boss: hordes of zombies, etc
- # Skeleton boss: archer, summon skeletons, shoot arrow with high damage
- # Blaze boss: comet/fireball, summon blazes,
- # Stray (shaman): holds stick, summon angry wolves,
- # Add particles & sounds
- options:
- logo: &4&lBoss&8:&7
- bossGuiName: Bosses
- # Boss health
- maxHealth_zombieBoss: 100
- maxHealth_skeletonBoss: 140
- maxHealth_blazeBoss: 120
- maxHealth_shamanBoss: 110
- # The permission required to execute the command '/boss'
- permission: "boss.*"
- on enable:
- set {zombieBossItem} to zombie head named "&aZombie Boss" with lore " &7Health&8: &7{@maxHealth_zombieBoss}", "&8 ", " &7Click to summon" and " &7the Zombie Boss."
- set {skeletonBossItem} to skeleton head named "&fSkeleton Boss" with lore " &7Health&8: &7{@maxHealth_skeletonBoss}", "&8 ", " &7Click to summon" and " &7the Skeleton Boss."
- set {blazeBossItem} to blaze rod named "&cBlaze Boss" with lore " &7Health&8: &7{@maxHealth_blazeBoss}", "&8 ", " &7Click to summon" and " &7the Blaze Boss."
- set {shamanBossItem} to stick named "&2Shaman Boss" with lore " &7Health&8: &7{@maxHealth_shamanBoss}", "&8 ", " &7Click to summon" and " &7the Shaman Boss."
- function getNewLocation(location: Location, offset: Number, direction: Integer) :: Location:
- if {_direction} is 0:
- set {_location} to location {_offset} meters northeast of {_location}
- else if {_direction} is 1:
- set {_location} to location {_offset} meters northwest of {_location}
- else if {_direction} is 2:
- set {_location} to location {_offset} meters southwest of {_location}
- else if {_direction} is 3:
- set {_location} to location {_offset} meters southeast of {_location}
- return {_location}
- function mustUpdateDirection(input: Number, standsWithTheSameDirection: Integer, dir: Integer) :: boolean:
- if {_standsWithTheSameDirection} < 1:
- set {_standsWithTheSameDirection} to 1
- while {_input} >= {_standsWithTheSameDirection}:
- remove {_standsWithTheSameDirection} from {_input}
- if {_input} is 0:
- return true
- return false
- function getNewDirection(dir: Integer) :: integer:
- add 1 to {_dir}
- if {_dir} is 4:
- set {_dir} to 0
- return {_dir}
- # Number MUST be a duplicate of four
- function circle(loc: location, radius: Integer, amount: Integer, entity: EntityType):
- set {_summonLocation} to location {_radius} meters north of {_loc}
- set {_standsWithTheSameDirection} to {_amount}/4
- set {_distanceBetweenStands} to {_radius}/{_standsWithTheSameDirection}
- set {_dir} to 2
- summon {_entity} at {_summonLocation}
- loop {_amount} -1 times:
- set {_summonLocation} to getNewLocation({_summonLocation}, {_distanceBetweenStands}, {_dir})
- if mustUpdateDirection(loop-value, "%{_standsWithTheSameDirection}%" parsed as an integer, {_dir}) is true:
- set {_dir} to getNewDirection({_dir})
- summon {_entity} at {_summonLocation}
- set display name of last spawned armor stand to "%loop-value%: %{_dir}%"
- command /boss:
- trigger:
- if executor is not player:
- send "{@logo} This command can only be executed by a player."
- else if player doesn't have permission {@permission}:
- send "{@logo} You do not have enough permissions to do this."
- else:
- open chest with 3 rows named "{@bossGuiName}" to player
- loop 10 times:
- set slot loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
- set slot 26 - loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
- set slot 10 of player's current inventory to {zombieBossItem}
- set slot 11 of player's current inventory to {skeletonBossItem}
- set slot 12 of player's current inventory to {blazeBossItem}
- set slot 13 of player's current inventory to {shamanBossItem}
- set {boss.currentInventory.%player%} to true
- #
- # B o s s e s
- #
- function getRandomTarget(boss: Entity, radius: Number) :: Entity:
- set {_possibleTargets::*} to all players in radius {_radius} around {_boss}
- set {_targetsAreEntities} to false
- if size of {_possibleTargets::*} < 1:
- set {_targetsAreEntities} to true
- set {_possibleTargets::*} to all entities in radius {_radius} around {_boss}
- while {_possibleTargets::*} is not empty:
- set {_target} to random element out of {_possibleTargets::*}
- remove {_target} from {_possibleTargets::*}
- if {_target} is not a player:
- if {_target} is not {_boss}:
- return {_target}
- else if gamemode of {_target} is survival or adventure:
- if {_entity} is dropped item:
- return {_target}
- set {_stopLoop} to false
- if {_possibleTargets::*} is empty:
- set {_stopLoop} to true
- else if {_possibleTargets::*} is not set:
- set {_stopLoop} to true
- if {_stopLoop}:
- if {_targetsAreEntities} is false:
- set {_targetsAreEntities} to true
- set {_possibleTargets::*} to all entities in radius {_radius} around {_boss}
- else:
- return null
- function summonBoss(entityType: EntityType, location: Location, name: String, helmet: Item, chestplate: Item, leggings: Item, boots: Item, heldItem: Item, isAdult: Boolean) :: entity:
- set {_boss} to {_entityType}
- summon {_boss} at {_location}
- set {_boss} to last spawned entity
- set display name of {_boss} to "%{_name}%"
- set custom name visibility of {_boss} to true
- set helmet of {_boss} to unbreakable {_helmet}
- set chestplate of {_boss} to unbreakable {_chestplate}
- set leggings of {_boss} to unbreakable {_leggings}
- set boots of {_boss} to unbreakable {_boots}
- set held item of {_boss} to unbreakable {_heldItem}
- set {_boss} to adult
- if {_isAdult} is false:
- set {_boss} to baby
- return {_boss}
- function summonZombieBoss(location: Location):
- set {_boss} to summonBoss(zombie, {_location}, "&a&lZombie Boss", iron helmet, iron chestplate, iron leggings, iron boots, iron sword, true)
- set max health of {_boss} to {@maxHealth_zombieBoss}
- set health of {_boss} to {@maxHealth_zombieBoss}
- wait 20 ticks
- while {_boss} is alive:
- if {%{_boss}%.hasUsedJumpAbility} is not true:
- set {_rng} to random integer between 0 and 9
- if {_rng} is 0, 1 or 2:
- circle(location of {_boss}, 3, 8, zombie)
- else if {_rng} is 3 or 4:
- set {_target} to getRandomTarget({_boss}, 9)
- if {_target} is set:
- jump({_boss}, 5, {_target})
- wait 47 ticks
- function jump(entity: Entity, height: Number, targetLocation: Location):
- set {%{_entity}%.hasUsedJumpAbility} to true
- push {_entity} (direction from location of {_entity} to {_targetLocation}) at speed 0.7436
- push {_entity} 0.9513 meters upwards
- # Skeleton boss
- function summonSkeletonBoss(location: Location):
- # Change items and heals
- set {_boss} to summonBoss(skeleton, {_location}, "&f&lSkeleton Boss", iron helmet, iron chestplate, iron leggings, iron boots, iron sword, true)
- set max health of {_boss} to {@maxHealth_skeletonBoss}
- set health of {_boss} to {@maxHealth_skeletonBoss}
- wait 20 ticks
- while {_boss} is alive:
- set {_rng} to random integer between 0 and 10
- if {_rng} is 0, 1 or 2:
- circle(location of {_boss}, 3, 4, skeleton)
- else if {_rng} is 3 or 4:
- set {_target} to getRandomTarget({_boss}, 17)
- if {_target} is set:
- shootArrows({_boss}, random integer between 4 and 7, {_target})
- wait 40 ticks
- function shootArrows(boss: Entity, arrowAmount: Number, targetLocation: Location):
- # Shoots and arrow in the direction of {_targetLocation} {_arrowAmount} times with a delay between each arrow
- on inventory click:
- if inventory name of player's current inventory is "{@bossGuiName}":
- cancel event
- if clicked item is {zombieBossItem}:
- summonZombieBoss(location of player)
- close inventory of player
- else if clicked item is {skeletonBossItem}:
- summonSkeletonBoss(location of player)
- close inventory of player
- else if clicked item is {blazeBossItem}:
- send "BLAZE"
- close inventory of player
- else if clicked item is {shamanBossItem}:
- send "SHAMAN"
- close inventory of player
- on inventory close:
- delete {boss.currentInventory.%player%}
- on inventory drag:
- if {boss.currentInventory.%player%} is true:
- cancel event
- on quit:
- delete {boss.currentInventory.%player%}
- on damage:
- if damage cause is fall:
- if {%victim%.hasUsedJumpAbility} is true:
- delete {%victim%.hasUsedJumpAbility}
- loop all entities in radius 4.6 around victim:
- if loop-entity is not victim:
- damage loop-entity by 4.6/(distance between location of loop-entity and location of victim)
- cancel event
Advertisement
Add Comment
Please, Sign In to add comment