Zeldaboy111

Ice Wand Spells ]|[ Skript #311

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