Zeldaboy111

Ice Wand Spells ]|[ Skript #311

May 14th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.82 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 30 and 12
  14. set {wands.distanceLock.MobilityWand::*} to 17 and 0
  15. set {wands.cooldown.IceWand::*} to 0.7 and 2.4
  16. set {wands.cooldown.MobilityWand::*} to 4.2 and 6.7
  17.  
  18. function spawnFallingBlock_Ice(loc: Location, p: Player):
  19. spawn falling ice at {_loc}
  20. set {_block} to last spawned falling ice
  21. loop entities in radius 2.6 around {_loc}:
  22. set {_damage} to 5
  23. if loop-entity is not {_p}:
  24. set {_dist} to (distance between location of loop-entity and {_loc})
  25. remove {_dist} from {_damage}
  26. damage loop-entity by {_damage} hearts
  27.  
  28. wait 3 ticks
  29.  
  30. play sound "block.glass.break" with volume 4 at {_loc}
  31. if {_block} is alive:
  32. kill {_block}
  33. else:
  34. if block at {_loc} is ice:
  35. set block at {_loc} to air
  36.  
  37. function checkSpell(p: Player, wand: String, spellAmount: Number, spell: String):
  38. set {_spells::*} to {_spell} split at ", "
  39.  
  40. if {wands.%{_p}%.spellSelected::%{_wand}%} is not set:
  41. set {wands.%{_p}%.spellSelected::%{_wand}%} to 1
  42. send "{@logo} Spell &2&l%{_spells::1}% &7Selected!" to {_p}
  43.  
  44. if {wands.%{_p}%.spellSelected::%{_wand}%} < {_spellAmount}:
  45. send "{@logo} Spell &2&l%{_spells::%{wands.%{_p}%.spellSelected::%{_wand}%}%}% &7Selected!" to {_p}
  46. add 1 to {wands.%{_p}%.spellSelected::%{_wand}%}
  47. else:
  48. send "{@logo} Spell &2&l%{_spells::%{wands.%{_p}%.spellSelected::%{_wand}%}%}% &7Selected!" to {_p}
  49. set {wands.%{_p}%.spellSelected::%{_wand}%} to 1
  50.  
  51. command /wands [<text>] [<text>] [<text>] [<text>] [<text>] [<text>]:
  52. aliases: /wand
  53. trigger:
  54. if executor is not a player:
  55. send "{@logo} This command can only be executed by a player."
  56.  
  57. if player has permission "wand.*":
  58. if arg-1 is "help":
  59. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  60. send "<ttp:&7Get a guide about this Skript><sgt:/wand guide>&2/wand guide [page]"
  61. send "<ttp:&7Get a list of all wands><sgt:/wand list>&2/wand list"
  62. send "<ttp:&7Get a list of all spells><sgt:/wand spells><sgt:/wand spells>&2/wand spells [wand]"
  63. send "<ttp:&7Get a wand><sgt:/wand get >&2/wand get <wand>"
  64. send "%nl%&7Try clicking and hovering over them."
  65. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  66.  
  67. else if arg-1 is "guide":
  68. if arg-2 is "1":
  69. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  70. 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."
  71. 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."
  72. send "%nl%&7Next Page <ttp:&7Next Page><cmd:/wands guide 2>&a>>"
  73. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  74.  
  75. else if arg-2 is "2":
  76. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  77. send "&a&lGetting a Wand&8:%nl% "
  78. 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."
  79. send "%nl%&a&lUsing a Wand&8:"
  80. send "%nl%&7Every player can use a wand. The controls are as follows&8:%nl%"
  81. send "&8♦ &aLeft-Click &8|| &7Left-Clicking will execute the spell."
  82. send "&8♦ &aRight-Click &8|| &7Right-Clicking will let you cycle through all spells."
  83. send "%nl%<ttp:&7Next Page><cmd:/wands guide 1>&a<<&r &7Previous Page"
  84. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  85.  
  86. else:
  87. execute player command "/wand guide 1"
  88.  
  89. else if arg-1 is "list":
  90. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  91. send "&7These are all current wands:%nl%"
  92. 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"
  93. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  94.  
  95. else if arg-1 is "get":
  96. if arg-2 is "ice":
  97. give player iron axe named "&bIce Wand" with lore "&5&kl"
  98. else if arg-2 is "mobility":
  99. give player a feather named "&7Mobility Wand" with lore "&5&kl"
  100.  
  101. else if arg-1 is "spells":
  102. if arg-2 is "ice":
  103. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  104. send "&8♦ <ttp:&7Damages your opponent>&2&lIce Spark"
  105. send "&8♦ <ttp:&7Summon a snake to attack your opponent>&2&lIce Snake"
  106. #Freeze spell??
  107. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  108.  
  109. else if arg-2 is "mobility":
  110. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  111. send "&8♦ <ttp:&7Teleports you to a location>&2&lTeleport"
  112. send "&8♦ <ttp:&7Makes you fast and agile>&2&lAssassin"
  113. #Other player teleport
  114. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  115.  
  116. else:
  117. if arg-2 is set:
  118. send "{@logo} Invalid Wand! Do <sgt:&7Click to Execute><cmd:/wand list>&2/wand list &r&7for a full list with all wands."
  119. else:
  120. send "{@logo} Incorrect Usage! &2/wand spells <wand>&7."
  121. else:
  122. send "{@logo} Incorrect Usage! Do <ttp:&7Click to Execute><cmd:/wand help>&2/wand help&r &7for more info."
  123.  
  124.  
  125. on right click:
  126. if player is holding an iron axe named "&bIce Wand" with lore "&5&kl":
  127. checkSpell(player, "IceWand", 2, "Ice Snake, Ice Spark")
  128.  
  129. else if player is holding a feather named "&7Mobility Wand" with lore "&5&kl":
  130. checkSpell(player, "MobilityWand", 2, "Assassin, Teleport")
  131.  
  132.  
  133. on left click:
  134. if player is holding an iron axe named "&bIce Wand" with lore "&5&kl":
  135. if {wands.%player%.lastSpellUsed} is set:
  136. if difference between now and {wands.%player%.lastSpellUsed} < {wands.%player%.lastSpellCooldown}:
  137. send "{@logo} You are too tired to use this spell."
  138. stop
  139.  
  140. set {_spell} to 1
  141. if {wands.%player%.spellSelected::IceWand} is set:
  142. set {_spell} to {wands.%player%.spellSelected::IceWand}
  143.  
  144. set {_target} to location of targeted block of player
  145. if distance between location of targeted entity of player and {_target} >= {wands.distanceLock.IceWand::%{_spell}%}:
  146. set {_target} to location of block {wands.distanceLock.IceWand::%{_spell}%} meters in front of player
  147. else if block at {_target} is not set:
  148. set {_target} to location of block {wands.distanceLock.IceWand::%{_spell}%} meters in front of player
  149. else if distance between location of player and {_target} >= {wands.distanceLock.IceWand::%{_spell}%}:
  150. set {_target} to location of block {wands.distanceLock.IceWand::%{_spell}%} meters in front of player
  151.  
  152. set {wands.%player%.lastSpellUsed} to now
  153. set {wands.%player%.lastSpellCooldown} to "%{wands.cooldown.IceWand::%{_spell}%}% seconds" parsed as a timespan
  154.  
  155. if {_spell} is 1:
  156. loop entities in radius 2.1 around {_target}:
  157. set {_damage} to 3
  158. if loop-entity is not player:
  159. set {_dist} to (distance between location of loop-entity and {_target})
  160. remove {_dist} from {_damage}
  161. damage loop-entity by {_damage} hearts
  162.  
  163. else if {_spell} is 2:
  164. loop blocks from block at location 0.8 meter above player to block at {_target}:
  165. spawnFallingBlock_Ice(location of loop-block, player)
  166. wait 1 ticks
  167.  
  168. #PARTICLES
  169. #show mob spawner flames at the player
  170. #show 10 note at the player
Add Comment
Please, Sign In to add comment