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,
- function getNewLocation(location: Location, offset: Number, direction: Integer) :: Location:
- if {_direction} is 2:
- set {_location} to location {_offset} meters northeast of {_location}
- else if {_direction} is 3:
- set {_location} to location {_offset} meters northwest of {_location}
- else if {_direction} is 0:
- set {_location} to location {_offset} meters southwest of {_location}
- else if {_direction} is 1:
- set {_location} to location {_offset} meters southeast of {_location}
- return {_location}
- function getIntegerAsDirection(input: Integer, standAmount: Integer) :: Number:
- # Location incorrect with a different number than four stands
- set {_value} to {_input} / ({_standAmount}/4)
- while {_value} >= 4:
- remove 4 from {_value}
- return {_value}
- function circle1(loc: location, radius: Integer, amount: Integer, entity: EntityType):
- set {_distance} to {_radius} / {_amount} * 2 + 1
- #broadcast "%{_distance}%"
- set {_startLocation} to location {_distance} meters north of {_loc}
- if {_amount} > 4:
- set {_startLocation} to location {_distance} meters northwest of {_loc}
- set {_sameDir} to {_amount}/4
- set {_dir} to -1
- loop 4 times:
- add 1 to {_dir}
- loop {_sameDir} times:
- # Or-statement would not work for some reason.
- if loop-value-2 > 1:
- set {_startLocation} to getNewLocation({_startLocation}, {_distance}, {_dir})
- else if {_dir} > 0:
- set {_startLocation} to getNewLocation({_startLocation}, {_distance}, {_dir})
- summon {_entity} at {_startLocation}
- #loop {_amount} times:
- # if loop-value > 1:
- # set {_i} to getIntegerAsDirection("%loop-value%" parsed as an integer, {_amount})
- # broadcast "%{_i}%"
- # set {_startLocation} to getNewLocation({_startLocation}, {_distance}, getIntegerAsDirection(("%loop-value%" parsed as an integer), {_amount}))
- # summon {_entity} at {_startLocation}
- function mustUpdateDirection(input: Number, standsWithTheSameDirection: Number) :: boolean:
- while {_input} >= {_standsWithTheSameDirection}:
- remove {_standsWithTheSameDirection} from {_input}
- if {_input} is 0:
- return true
- return false
- 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 {_distance}/{_standsWithTheSameDirection}
- set {_dir} to 0
- loop {_amount} times:
- if mustUpdateDirection(loop-value, {_standsWithTheSameDirection}) is true:
- add 1 to {_dir}
- if {_amount} > 1:
- set {_summonLocation} to getNewLocation({_summonLocation}, {_distanceBetweenStands}, {_dir})
- summon {_entity} at {_summonLocation}
- # Test commands
- command /circle <Integer> <Integer>:
- trigger:
- circle(location of player, argument 1, argument 2, armor stand)
Advertisement
Add Comment
Please, Sign In to add comment