Zeldaboy111

Circle Functie ]|[ Skript #402

Mar 28th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 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. function getNewLocation(location: Location, offset: Number, direction: Integer) :: Location:
  8. # Directions are not set up correctly
  9. if {_direction} is 0:
  10. set {_location} to location {_offset} meters north and {_offset} meters east of {_location}
  11. else if {_direction} is 1:
  12. set {_location} to location {_offset} meters south and {_offset} meters east of {_location}
  13. else if {_direction} is 2:
  14. set {_location} to location {_offset} meters south and {_offset} meters west of {_location}
  15. else if {_direction} is 3:
  16. set {_location} to location {_offset} meters west and {_offset} meters north of {_location}
  17. return {_location}
  18.  
  19. function getIntegerAsDirection(input: Integer) :: Integer:
  20. while {_input} >= 4:
  21. set {_input} to {_input}-4
  22. return {_input}
  23.  
  24. function circle(loc: location, radius: Integer, amount: Integer, entity: EntityType):
  25. set {_startLocation} to location {_radius}+1 meters north of {_loc}
  26. set {_distance} to {_radius} / {_amount} * 2 +1
  27.  
  28. loop {_amount} times:
  29. if loop-value > 1:
  30. set {_startLocation} to getNewLocation({_startLocation}, {_distance}, getIntegerAsDirection("%loop-value%" parsed as an integer))
  31. summon {_entity} at {_startLocation}
  32.  
  33. # Test commands
  34. command /circle <Integer> <Integer>:
  35. trigger:
  36. circle(location of player, argument 1, argument 2, armor stand)
  37.  
Advertisement
Add Comment
Please, Sign In to add comment