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, leap
- # Skeleton boss: 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}:
- if {_target} is not a dropped item:
- if {_target} is not experience orb or painting or item frame or armor stand:
- if "%{_target}%" does not contain "arrow":
- return {_target}
- else if gamemode of {_target} is survival or adventure:
- 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, 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 skull of "MHF_%{_entityType}%" parsed as an offline player with name "%{_name}% Throphy"
- set chestplate of {_boss} to air
- set leggings of {_boss} to air
- set boots of {_boss} to air
- set held item of {_boss} to air
- add "{ArmorDropChances:[0.0f,0.0f,0.0f,1.1f],HandDropChances:[0.0f,0.0f]}" to nbt of {_boss}
- 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 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 6
- 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):
- set {_boss} to summonBoss(skeleton, {_location}, "&f&lSkeleton Boss", bow, 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 7
- 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, target: Entity):
- loop {_arrowAmount} times:
- if {_boss} is alive:
- if {_target} is alive:
- if distance between {_boss} and {_target} <= 17:
- set {_v} to vector from {_boss} to location of {_target}
- make {_boss} shoot arrow at speed 1 {_v}
- wait "%random integer between 5 and 9% ticks" parsed as a timespan
- # Blaze boss
- function summonBlazeBoss(location: Location):
- set {_boss} to summonBoss(blaze, {_location}, "&c&lBlaze Boss", air, true)
- set max health of {_boss} to {@maxHealth_blazeBoss}
- set health of {_boss} to {@maxHealth_blazeBoss}
- wait 20 ticks
- while {_boss} is alive:
- set {_rng} to random integer between 0 and 8
- set {_rng} to 3
- if {_rng} is 0, 1 or 2:
- circle(location of {_boss}, 4, 4, blaze)
- else if {_rng} is 3 or 4:
- set {_target} to getRandomTarget({_boss}, 17)
- if {_target} is set:
- summonComet({_boss}, {_target})
- wait 40 ticks
- command /comet:
- trigger:
- summonComet(player, player)
- function summonComet(boss: Entity, target: Entity):
- set {_cometY::*} to 0, 0, 0, 0 and 0.2
- set {_cometX::*} to 0, 0.2, 0, -0.2 and 0
- set {_cometZ::*} to 0.2, 0, -0.2, 0 and 0
- loop 5 times:
- summon armor stand at location 10+{_cometY::%loop-value%} meters above, {_cometX::%loop-value%} meters east and {_cometZ::%loop-value%} meters south of {_target}
- set {_stand::%loop-value%} to last spawned armor stand
- set metadata value "IsCometStand" of {_stand::%loop-value%} to true
- set helmet of {_stand::%loop-value%} to coal block
- #set visibility of target entity to false
- 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}:
- summonBlazeBoss(location of player)
- 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.3 around victim:
- if loop-entity is not victim:
- damage loop-entity by 4.3/(distance between location of loop-entity and location of victim)
- cancel event
- on right click on armor stand:
- if metadata value "IsCometStand" of clicked entity is true:
- cancel event
Advertisement
Add Comment
Please, Sign In to add comment