Zeldaboy111

Wands Af ]|[ Skript #313

May 21st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.05 KB | None | 0 0
  1. #- Reselling/Reuploading while claiming that it is yours or made by you is disallowed
  2. #- Do not edit it and upload it as your own
  3. #- While using it in a video, please feature everything under "Video"
  4. #
  5. #Video:
  6. #Skript made by Zeldaboy111
  7. #More content of the creator: https://forums.skunity.com/search/26443679/
  8.  
  9. options:
  10. logo: &a&lWands &8:&7
  11.  
  12. on enable:
  13. set {wands.distanceLock.IceWand::*} to 40, 12 and 39
  14. set {wands.distanceLock.MobilityWand::*} to 39, 0 and 26
  15. set {wands.cooldown.IceWand::*} to 6.9, 2.4 and 0.7
  16. set {wands.cooldown.MobilityWand::*} to 6.6, 9.3 and 3.8
  17.  
  18. function spawnFallingBlock_Ice(loc: Location, p: Player):
  19. spawn falling ice at {_loc}
  20. set {_block} to last spawned falling ice
  21. show 7 snow shovel at {_loc}
  22.  
  23. loop entities in radius 2.6 around {_loc}:
  24. set {_damage} to 5
  25. if loop-entity is not {_p}:
  26. set {_dist} to (distance between location of loop-entity and {_loc})
  27. remove {_dist} from {_damage}
  28. damage loop-entity by {_damage} hearts
  29.  
  30. wait 3 ticks
  31. play sound "block.glass.break" with volume 4 at {_loc}
  32. if {_block} is alive:
  33. kill {_block}
  34. else:
  35. if block at {_loc} is ice:
  36. set block at {_loc} to air
  37.  
  38. function checkSpell(p: Player, wand: String, spellAmount: Number, spell: String):
  39. set {_spells::*} to {_spell} split at ", "
  40.  
  41. if {wands.%{_p}%.spellSelected::%{_wand}%} is not set:
  42. set {wands.%{_p}%.spellSelected::%{_wand}%} to 1
  43. send "{@logo} Spell &2&l%{_spells::1}% &7Selected!" to {_p}
  44.  
  45. if {wands.%{_p}%.spellSelected::%{_wand}%} < {_spellAmount}:
  46. send "{@logo} Spell &2&l%{_spells::%{wands.%{_p}%.spellSelected::%{_wand}%}%}% &7Selected!" to {_p}
  47. add 1 to {wands.%{_p}%.spellSelected::%{_wand}%}
  48. else:
  49. send "{@logo} Spell &2&l%{_spells::%{wands.%{_p}%.spellSelected::%{_wand}%}%}% &7Selected!" to {_p}
  50. set {wands.%{_p}%.spellSelected::%{_wand}%} to 1
  51.  
  52. function getSpell(p: Player, wand: String) :: number:
  53. if {wands.%{_p}%.lastSpellUsed} is set:
  54. if difference between now and {wands.%{_p}%.lastSpellUsed} < {wands.%{_p}%.lastSpellCooldown}:
  55. send "{@logo} You are too tired to use this spell." to {_p}
  56. stop
  57.  
  58. set {_spell} to 1
  59. if {wands.%{_p}%.spellSelected::%{_wand}%} is set:
  60. set {_spell} to {wands.%{_p}%.spellSelected::%{_wand}%}
  61.  
  62. set {wands.%{_p}%.lastSpellUsed} to now
  63. set {wands.%{_p}%.lastSpellCooldown} to "%{wands.cooldown.%{_wand}%::%{_spell}%}% seconds" parsed as a timespan
  64.  
  65. return {_spell}
  66.  
  67. function getTarget(p: Player, wand: String, spell: number) :: location:
  68. set {_target} to location of targeted block of {_p}
  69. if distance between location of targeted entity of {_p} and {_target} >= {wands.distanceLock.%{_wand}%::%{_spell}%}:
  70. set {_target} to location of block {wands.distanceLock.%{_wand}%::%{_spell}%} meters in front of {_p}
  71. else if block at {_target} is not set:
  72. set {_target} to location of block {wands.distanceLock.%{_wand}%::%{_spell}%} meters in front of {_p}
  73. else if distance between location of {_p} and {_target} >= {wands.distanceLock.%{_wand}%::%{_spell}%}:
  74. set {_target} to location of block {wands.distanceLock.%{_wand}%::%{_spell}%} meters in front of {_p}
  75.  
  76. return {_target}
  77.  
  78. command /wands [<text>] [<text>] [<text>] [<text>] [<text>] [<text>]:
  79. aliases: /wand
  80. trigger:
  81. if executor is not a player:
  82. send "{@logo} This command can only be executed by a player."
  83.  
  84. if player has permission "wand.*":
  85. if arg-1 is "help":
  86. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  87. send "<ttp:&7Get a guide about this Skript><sgt:/wand guide>&2/wand guide [page]"
  88. send "<ttp:&7Get a list of all wands><sgt:/wand list>&2/wand list"
  89. send "<ttp:&7Get a list of all spells><sgt:/wand spells><sgt:/wand spells>&2/wand spells [wand]"
  90. send "<ttp:&7Get a wand><sgt:/wand get >&2/wand get <wand>"
  91. send "%nl%&7Try clicking and hovering over them."
  92. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  93.  
  94. else if arg-1 is "guide":
  95. if arg-2 is "1":
  96. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  97. send "&7The Wands Skript is user friendly, herefore there are added some tweaks for you to use. In this guide there will be explained how it works."
  98. send "&7Wands can be used by any player when it is given to them. The command execution has a <ttp:&7wand.*>&2permission&r&7, so not every player can get a wand by using this command."
  99. send "%nl%&7Next Page <ttp:&7Next Page><cmd:/wands guide 2>&a>>"
  100. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  101.  
  102. else if arg-2 is "2":
  103. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  104. send "&a&lGetting a Wand&8:%nl% "
  105. send "&7Getting a wand can be done in two ways, either by executing the <ttp:&7Click to Autofill><sgt:/wand get <wand>>&2get-command &r&7or by clicking the <ttp:&7Click to Autofill><sgt:/wand list>&2Wands List&7."
  106. send "%nl%&a&lUsing a Wand&8:"
  107. send "%nl%&7Every player can use a wand. The controls are as follows&8:%nl%"
  108. send "&8♦ &aLeft-Click &8|| &7Left-Clicking will cast the spell."
  109. send "&8♦ &aRight-Click &8|| &7Right-Clicking will let you cycle through all spells."
  110. send "%nl%<ttp:&7Next Page><cmd:/wands guide 1>&a<<&r &7Previous Page"
  111. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  112.  
  113. else:
  114. execute player command "/wand guide 1"
  115.  
  116. else if arg-1 is "list":
  117. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  118. send "&7These are all current wands:%nl%"
  119. send "&8♦ <ttp:&7Click to Get><cmd:/wand get ice>&2&lIce Wand &8|| <ttp:&7Click to get the Spell List><cmd:/wand spells ice>&2Spell List%nl%&8♦ <ttp:&7Click to Get><cmd:/wand get mobility>&2&lMobility Wand &8|| <ttp:&7Click to get the Spell List><cmd:/wand spells mobility>&2Spell List"
  120. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  121.  
  122. else if arg-1 is "get":
  123. if arg-2 is "ice":
  124. give player iron axe named "&bIce Wand" with lore "&5&kl"
  125. else if arg-2 is "mobility":
  126. give player a feather named "&7Mobility Wand" with lore "&5&kl"
  127.  
  128. else if arg-1 is "spells":
  129. if arg-2 is "ice":
  130. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  131. send "&8♦ <ttp:&7Damages your opponent>&2&lIce Spark"
  132. send "&8♦ <ttp:&7Summon a snake to attack your opponent>&2&lIce Snake"
  133. send "&8♦ <ttp:&7Freezes your opponent>&2&lFreeze"
  134. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  135.  
  136. else if arg-2 is "mobility":
  137. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  138. send "&8♦ <ttp:&7Teleports you to a location>&2&lTeleport"
  139. send "&8♦ <ttp:&7Makes you fast and agile>&2&lAssassin"
  140. send "&8♦ <ttp:&7Teleports your opponent>&2&lControl"
  141. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  142.  
  143. else:
  144. if arg-2 is set:
  145. send "{@logo} Invalid Wand! Do <sgt:&7Click to Execute><cmd:/wand list>&2/wand list &r&7for a full list with all wands."
  146. else:
  147. send "{@logo} Incorrect Usage! &2/wand spells <wand>&7."
  148. else:
  149. send "{@logo} Incorrect Usage! Do <ttp:&7Click to Execute><cmd:/wand help>&2/wand help&r &7for more info."
  150.  
  151.  
  152. on right click:
  153. if player is holding an iron axe named "&bIce Wand" with lore "&5&kl":
  154. checkSpell(player, "IceWand", 3, "Ice Spark, Ice Snake, Freeze")
  155.  
  156. else if player is holding a feather named "&7Mobility Wand" with lore "&5&kl":
  157. checkSpell(player, "MobilityWand", 3, "Teleport, Assassin, Control")
  158.  
  159.  
  160. on left click:
  161. if player is holding an iron axe named "&bIce Wand" with lore "&5&kl":
  162. cancel event
  163. set {_spell} to getSpell(player, "IceWand")
  164. set {_target} to getTarget(player, "IceWand", {_spell})
  165.  
  166. if {_spell} is 2:
  167. show 12 snow shovel at {_target}
  168. loop entities in radius 2.1 around {_target}:
  169. set {_damage} to 3
  170. if loop-entity is not player:
  171. set {_dist} to (distance between location of loop-entity and {_target})
  172. remove {_dist} from {_damage}
  173. damage loop-entity by {_damage} hearts
  174.  
  175. else if {_spell} is 3:
  176. loop blocks from block at location 0.8 meter above player to block at {_target}:
  177. spawnFallingBlock_Ice(location of loop-block, player)
  178. wait 1 ticks
  179.  
  180. else if {_spell} is 1:
  181. if targeted entity of player is set:
  182. if distance between block at targeted entity of player and block at player < {wands.distanceLock.IceWand::%{_spell}%}:
  183. loop 5 times:
  184. apply slowness 10 to targeted entity of player for 1 seconds
  185. loop 2 times:
  186. show 8 snow shovel at location 1 meters above targeted entity of player
  187. wait 10 ticks
  188. else:
  189. delete {wands.%{_p}%.lastSpellUsed}
  190. send "{@logo} There's no target found."
  191. else:
  192. delete {wands.%{_p}%.lastSpellUsed}
  193. send "{@logo} There's no target found."
  194.  
  195. else if player is holding a feather named "&7Mobility Wand" with lore "&5&kl":
  196. cancel event
  197. set {_spell} to getSpell(player, "MobilityWand")
  198. set {_target} to getTarget(player, "MobilityWand", {_spell})
  199.  
  200. if {_spell} is 2:
  201. show 120 nether portal at the player
  202. apply slowness 10 to player for 4 seconds
  203. wait 2 seconds
  204. play sound "entity.enderman.teleport" with volume 7 at location of targeted entity of player
  205. teleport player to location 1 meters above {_target}
  206. play sound "entity.enderman.teleport" with volume 7 at location of player
  207. show 120 nether portal at the player
  208.  
  209. else if {_spell} is 3:
  210. apply slowness 10 to player for 0.7 seconds
  211. show 200 small smoke at the player
  212.  
  213. wait 0.7 seconds
  214. apply speed 1 to player for 6 seconds
  215. apply jump boost 1 to player for 6 seconds
  216. apply invisibility 1 to player for 6 seconds
  217. loop 6 times:
  218. wait 1 second
  219. show 96 small smoke at the player
  220.  
  221. else if {_spell} is 1:
  222. if targeted entity of player is set:
  223. if distance between block at targeted entity of player and block at player < {wands.distanceLock.MobilityWand::%{_spell}%}:
  224. show 120 nether portal at the targeted entity of player
  225. apply slowness 10 to targeted entity of player for 4 seconds
  226. wait 2 seconds
  227. set {_loc} to location of targeted entity of player
  228. while {_loc} is location of targeted entity of player:
  229. set {_x} to random integer between -12 and 12
  230. set {_y} to random integer between -3 and 3
  231. set {_z} to random integer between -12 and 12
  232. set {_loc} to location at x-coordinate of targeted entity of player+{_x}, y-coordinate of targeted entity of player+{_y}, z-coordinate of targeted entity of player+{_z} in world of targeted entity of player
  233.  
  234. play sound "entity.enderman.teleport" with volume 7 at location of targeted entity of player
  235. teleport targeted entity of player to location 1 meters above {_loc}
  236. play sound "entity.enderman.teleport" with volume 7 at location of targeted entity of player
  237. show 120 nether portal at the targeted entity of player
  238. else:
  239. delete {wands.%{_p}%.lastSpellUsed}
  240. send "{@logo} There's no target found."
  241. else:
  242. delete {wands.%{_p}%.lastSpellUsed}
  243. send "{@logo} There's no target found."
Add Comment
Please, Sign In to add comment