Zeldaboy111

Wands Af ]|[ Skript #313

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