Advertisement
CREAMPAN0408

Untitled

Feb 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 97.03 KB | None | 0 0
  1. #-----------------------------------------------------------------#
  2. # #
  3. # By _JustDylan_ #
  4. # #
  5. # Depends on: Skript, SkQuery, skript-mirror, SkDragon. #
  6. # #
  7. # Be aware that this skript is made for 1.12.2 and requires #
  8. # the latest version of the plugins above, that are coded for #
  9. # 1.12.2 #
  10. # #
  11. # Please don't edit anyting down below #
  12. # When you do you might break the script #
  13. # #
  14. #-----------------------------------------------------------------#
  15.  
  16. #---Main---#
  17. options:
  18. version: "2.0.0"
  19.  
  20. #wand converter for older versions
  21. on click:
  22. if line 2 of lore of player's tool is "&k®®":
  23. set line 2 of lore of player's tool to "&k&c&e"
  24. #variable cleanup
  25. on load:
  26. clear {wands::tool::*}
  27. clear {wands::loopedentity::*}
  28. on break:
  29. if {wands::OutOfUse} isn't true:
  30. if line 2 of lore of player's tool is "&k&c&e":
  31. cancel event
  32.  
  33. on death:
  34. if {wands::dropondeath} is false:
  35. loop drops:
  36. if line 2 of lore of loop-item contains "&k&c&e":
  37. remove loop-item from drops
  38.  
  39. expression invisable value of %number%:
  40. get:
  41. set {_text} to "%expr-1%"
  42. set {_length} to {_text}.length() * 2
  43. replace all "" in {_text} with "&"
  44. set {_text} to {_text}.substring(0, {_length})
  45. return colored {_text}
  46.  
  47. expression visable value of %text%:
  48. get:
  49. set {_lore} to expr-1
  50. replace all "ยง" in {_lore} with ""
  51. return {_lore} parsed as number
  52.  
  53. on drop:
  54. line 2 of lore of event-item contains "&k&c&e"
  55. player has 1 of event-item
  56. set {_item} to event-item
  57. set {_lore} to line 1 of {_item}'s lore
  58. add 1 to {wands::amount}
  59. set {wands::savedwands::&k%{wands::amount}%::spellIndex} to {wands::savedwands::%{_lore}%::spellIndex}
  60. set {wands::savedwands::&k%{wands::amount}%::savedSpells::*} to {wands::savedwands::%{_lore}%::savedSpells::*}
  61. set {wands::savedwands::&k%{wands::amount}%::modifiable} to {wands::savedwands::%{_lore}%::modifiable}
  62. set {wands::savedwands::&k%{wands::amount}%::particles} to {wands::savedwands::%{_lore}%::particles}
  63. set line 1 of {_item}'s lore to "&k%{wands::amount}%"
  64.  
  65. import:
  66. net.md_5.bungee.api.ChatMessageType
  67. net.md_5.bungee.api.chat.TextComponent
  68.  
  69. effect display actionbar %string% to %player%:
  70. trigger:
  71. set {_component} to new TextComponent()
  72. {_component}.setText(expr-1)
  73. expr-2.spigot().sendMessage[net.md_5.bungee.api.ChatMessageType, net.md_5.bungee.api.chat.BaseComponent](ChatMessageType.ACTION_BAR!, {_component})
  74.  
  75. function PlS(s: string, v: number, p: number, l: location, f: players):
  76. loop {_f::*}:
  77. if loop-value's world isn't {_l}'s world:
  78. remove loop-value from {_f::*}
  79. play sound {_s} with volume {_v} and pitch {_p} at {_l} for {_f::*}
  80.  
  81. function spellLocation(p: player, range: number = 30) :: location:
  82. if distance between location of targeted entity of {_p} and location of {_p} is less than {_range} where [targeted entity of {_p} is alive]:
  83. set {_loc} to location of block at target entity of {_p}
  84. else:
  85. loop blocks from the block above {_p} to the block {_range} in front of {_p}:
  86. set {_loc} to location of block above loop-block
  87. if loop-block is solid:
  88. stop loop
  89. return {_loc}
  90.  
  91. function invailidLocation(p: player):
  92. display actionbar "&c&lNo living entity selected!" to {_p}
  93. if distance between location of targeted block of {_p} and location of {_p} is more than 10:
  94. drawDot count 6, particle fireworkspark, speed 0.3, XYZ 0.3, 0.3, 0.3, center location of block above block 10 in front of {_p}, visibleRange 320
  95. else if targeted block of {_p} is set:
  96. drawDot count 6, particle fireworkspark, speed 0.3, XYZ 0.3, 0.3, 0.3, center location of block above targeted block of {_p}, visibleRange 320
  97. else:
  98. drawDot count 6, particle fireworkspark, speed 0.3, XYZ 0.3, 0.3, 0.3, center location of block above block 10 in front of {_p}, visibleRange 320
  99.  
  100. function damageEffect(n: number, a: living entity, v: living entity, i: item):
  101. set {_l} to {_a}'s tool
  102. set {_a}'s tool to {_i}
  103. make {_a} damage {_v} by {_n} * 2
  104. delete velocity of {_v}
  105. set {_a}'s tool to {_l}
  106.  
  107. #---Commands---#
  108. on command "/sk reload magicwands":
  109. set {_now} to now
  110. wait a tick
  111. message "&8&l[&6&lWands&8&l]&r reloaded in &6%difference between 1 tick and difference between {_now} and now%" to all players where [player input has permission "skript.admin"]
  112.  
  113. function contains(l: objects, v: object) :: boolean:
  114. loop {_l::*}:
  115. if loop-value is {_v}:
  116. return true
  117. return false
  118.  
  119. function createCustomWand(p: player):
  120. set line 2 of lore of {_p}'s tool to "&k&c&e"
  121. set {wands::amount} to {wands::amount} + 1
  122. set {_index} to invisable value of {wands::amount}
  123. set line 1 of lore of {_p}'s tool to "%{_index}%"
  124. set {wands::savedwands::%{_index}%::spellIndex} to 1
  125.  
  126. function clearWand(p: player):
  127. set {_lore} to line 1 of lore of {_p}'s tool
  128. clear {wands::savedwands::%{_lore}%::*}
  129. set lore of {_p}'s tool to ""
  130.  
  131. function getArtifact(p: player, n: text, l: text, i: item):
  132. if {_l} is "-1":
  133. give unbreakable bow of power 2 and infinity 1 named "&cEmpire Bow" with lore "&k-1||&k&c&e" to {_p}
  134. else:
  135. give {_p} {_i} named {_n} with lore "&k%{_l}%||&k&c&e"
  136. set {wands::savedwands::&k%{wands::amount}%::modifiable} to false
  137.  
  138. function getDefaultWand(p: player, i: item):
  139. set {wands::amount} to {wands::amount} + 1
  140. set {_index} to invisable value of {wands::amount}
  141. set {_n} to {_i}'s name
  142. give {_p} {_i} named {_n} with lore "%{_index}%||&k&c&e"
  143. if {_n} is "&cEmpire Wand":
  144. add integers from 1 to 6 to {wands::savedwands::%{_index}%::savedSpells::*}
  145. set {wands::savedwands::%{_index}%::particles} to "empire"
  146. if {_n} is "&cBlood Wand":
  147. add integers from 7 to 11 to {wands::savedwands::%{_index}%::savedSpells::*}
  148. set {wands::savedwands::%{_index}%::particles} to "blood"
  149. if {_n} is "&cRafg Wand":
  150. add integers from 12 to 17 and 5 to {wands::savedwands::%{_index}%::savedSpells::*}
  151. set {wands::savedwands::%{_index}%::particles} to "rafg"
  152. if {_n} is "&6Celcrius Wand":
  153. add integers from 18 to 21, 35 and 36 to {wands::savedwands::%{_index}%::savedSpells::*}
  154. set {wands::savedwands::%{_index}%::particles} to "celcrius"
  155. if {_n} is "&8Dark Wand":
  156. add integers from 22 to 25 to {wands::savedwands::%{_index}%::savedSpells::*}
  157. set {wands::savedwands::%{_index}%::particles} to "dark"
  158. if {_n} is "&rKaj Wand":
  159. add integers from 26 to 29 and 37 to {wands::savedwands::%{_index}%::savedSpells::*}
  160. set {wands::savedwands::%{_index}%::particles} to "kaj"
  161. if {_n} is "&2Mephi Wand":
  162. add integers from 30 to 34 and 5 to {wands::savedwands::%{_index}%::savedSpells::*}
  163. set {wands::savedwands::%{_index}%::particles} to "mephi"
  164. set {wands::savedwands::%{_index}%::spellIndex} to 1
  165. set {wands::savedwands::%{_index}%::modifiable} to false
  166.  
  167. function WandsCreatorGUI(p: player):
  168. open chest inventory named " &8&l[&6&lWands&8&l] creator menu" to {_p}
  169. if {_p}'s tool isn't a bow:
  170. set slot 11 of {_p}'s current inventory to a blaze rod named "&dCreate a custom wand" with lore "This type of magic item||allowes you to bind spells||to your custom wand"
  171. set slot 13 of {_p}'s current inventory to a golden sword named "&dCreate a custom dagger" with lore "This type of magic item||gives you the abilities||that you'd normally have||with the theros dagger"
  172. set slot 15 of {_p}'s current inventory to iron bars block named "&cLocked" with lore "You need to hold a bow||in order to do this"
  173. else:
  174. set slot 11 of {_p}'s current inventory to iron bars block named "&cLocked" with lore "You need to hold something||else than a bow in||order to do this"
  175. set slot 13 of {_p}'s current inventory to iron bars block named "&cLocked" with lore "You need to hold something||else than a bow in||order to do this"
  176. set slot 15 of {_p}'s current inventory to a bow named "&cCreate a custom bow" with lore "This type of magic item||allowes you to shoot||cursed arrows"
  177.  
  178. on inventory click:
  179. event-item isn't air
  180. if clicked inventory's display name is " &8&l[&6&lWands&8&l]":
  181. cancel event
  182. name of event-item isn't " "
  183. PlS("ui.button.click", 1, 1, player, player)
  184. if event-item's name is "&cEmpire Bow":
  185. getArtifact(player, "&cEmpire Bow", "-1", bow)
  186. else if event-item's name is "&8Theros Dagger":
  187. getArtifact(player, "&8Theros Dagger", "-2", mall music disc)
  188. else:
  189. getDefaultWand(player, event-item)
  190. else if clicked inventory's display name is " &8&l[&6&lWands&8&l] creator menu":
  191. cancel event
  192. if event-item's name isn't "&cLocked":
  193. PlS("ui.button.click", 1, 1, player, player)
  194. if event-item's name is "&dCreate a custom wand":
  195. createCustomWand(player)
  196. if event-item's name is "&dCreate a custom dagger":
  197. set lore of player's tool to "&k-2||&k&c&e"
  198. if event-item's name is "&cCreate a custom bow":
  199. set lore of player's tool to "&k-1||&k&c&e"
  200. close player's inventory
  201. else if clicked inventory's display name is " &8&l[&6&lWands&8&l] unregister wand?":
  202. cancel event
  203. PlS("ui.button.click", 1, 1, player, player)
  204. if event-item's name is "&aYes":
  205. if line 1 of lore of player's tool is "&k-1" or "&k-2":
  206. set lore of player's tool to ""
  207. else:
  208. clearWand(player)
  209. WandsCreatorGUI(player)
  210. else:
  211. close player's inventory
  212.  
  213. command /wands [<text>] [<text>] [<text>] [<text>]:
  214. usage: &6wands [<arguments>]
  215. description: &6The main command for the Wands skript
  216. trigger:
  217. if arg 1 isn't set:
  218. if player has permission "wands.get":
  219. open chest inventory named " &8&l[&6&lWands&8&l]" to player
  220. loop integers from 6 to 8:
  221. set slot loop-number of player's current inventory to iron bars block named " "
  222. loop integers from 9 to 17:
  223. set slot loop-number of player's current inventory to gray glass named " "
  224. loop integers from 20 to 26:
  225. set slot loop-number of player's current inventory to iron bars block named " "
  226. set slot 0 of player's current inventory to blaze rod named "&cEmpire Wand" with lore "click to obtain"
  227. set slot 1 of player's current inventory to nether wart item named "&cBlood Wand" with lore "click to obtain"
  228. set slot 2 of player's current inventory to stick named "&cRafg Wand" with lore "click to obtain"
  229. set slot 3 of player's current inventory to blaze powder named "&6Celcrius Wand" with lore "click to obtain"
  230. set slot 4 of player's current inventory to stick named "&8Dark Wand" with lore "click to obtain"
  231. set slot 5 of player's current inventory to blaze rod named "&rKaj Wand" with lore "click to obtain"
  232. set slot 6 of player's current inventory to iron hoe named "&2Mephi Wand" with lore "click to obtain"
  233. set slot 18 of player's current inventory to unbreakable bow of power 2 and infinity 1 named "&cEmpire Bow" with lore "click to obtain"
  234. set slot 19 of player's current inventory to mall music disc named "&8Theros Dagger" with lore "click to obtain"
  235. else:
  236. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.get&c to do that!"
  237. else if arg 1 is "set":
  238. if arg 2 is "cooldown" or "particles" or "customcooldown":
  239. if arg-2 is "cooldown":
  240. if sender has permission "wands.configure":
  241. if arg-3 is "all":
  242. if arg-4 parsed as a number is set:
  243. set {_seconds} to round(arg-4 parsed as number)
  244. set {wands::cooldown::&cEmpire Wand} to "%{_seconds}% seconds" parsed as an timespan
  245. set {wands::cooldown::&cEmpire Bow} to "%{_seconds}% seconds" parsed as an timespan
  246. set {wands::cooldown::&cBlood Wand} to "%{_seconds}% seconds" parsed as an timespan
  247. set {wands::cooldown::&cRafg Wand} to "%{_seconds}% seconds" parsed as an timespan
  248. set {wands::cooldown::&6Celcrius Wand} to "%{_seconds}% seconds" parsed as an timespan
  249. set {wands::cooldown::&8Dark Wand} to "%{_seconds}% seconds" parsed as an timespan
  250. set {wands::cooldown::&rKaj Wand} to "%{_seconds}% seconds" parsed as an timespan
  251. set {wands::cooldown::&8Theros Dagger} to "%{_seconds}% seconds" parsed as an timespan
  252. set {wands::cooldown::&2Mephi Wand} to "%{_seconds}% seconds" parsed as an timespan
  253. message "&8&l[&6&lWands&8&l]&r all the cooldowns of the default wands are set to &a%{_seconds}%&r."
  254. else:
  255. message "&8&l[&6&lWands&8&l]&c your fourth argument must be a number!"
  256. else if arg-3 is "hand":
  257. if arg-4 parsed as number is set:
  258. if arg 4 doesn't contain ".":
  259. set {wands::cooldown::%name of player's tool%} to "%arg 4% seconds" parsed as an timespan
  260. message "&8&l[&6&lWands&8&l]&r Cooldown of %name of player's tool%&8: &d%arg 4% second(s)"
  261. else:
  262. message "&8&l[&6&lWands&8&l]&c your fourth argument can't contain decimals!"
  263. else:
  264. message "&8&l[&6&lWands&8&l]&c your fourth argument must be a number!"
  265. else:
  266. message "&8&l[&6&lWands&8&l]&c Invailid argument!"
  267. else:
  268. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.configure&c to do that!"
  269. if arg-2 is "customcooldown":
  270. if sender has permission "wands.customize":
  271. if arg 3 is set:
  272. if modifiable(player) is true:
  273. if registered(player) is true:
  274. message "&8&l[&6&lWands&8&l]&r Cooldown is set to &a%arg 3% seconds"
  275. set {wands::cooldown::%name of player's tool%} to "%arg 3% seconds" parsed as timespan
  276. else:
  277. message "&8&l[&6&lWands&8&l]&c Invailid number!"
  278. else:
  279. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.customize&c to do that!"
  280. if arg-2 is "particles":
  281. if sender has permission "wands.customize":
  282. if modifiable(player) is true:
  283. if registered(player) is true:
  284. if typeID(player) is "wand":
  285. if arg 3 is "empire" or "blood" or "rafg" or "celcrius" or "dark" or "kaj" or "mephi":
  286. set {wands::savedwands::%line 1 of lore of player's tool%::particles} to arg 3
  287. message "&8&l[&6&lWands&8&l]&r particles are set to &a%{wands::savedwands::%line 1 of lore of player's tool%::particles}%"
  288. else:
  289. message "&8&l[&6&lWands&8&l]&c Invailid particle type"
  290. else:
  291. message "&8&l[&6&lWands&8&l]&c Particles can only be set for custom wands!"
  292. else:
  293. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.customize&c to do that!"
  294. else:
  295. message "&8&l[&6&lWands&8&l]&c This cannot be set!"
  296. else if arg 1 is "disable":
  297. if sender has permission "wands.configure":
  298. set {wands::OutOfUse} to true
  299. message "&8&l[&6&lWands&8&l]&r Status: &cdisabled"
  300. else:
  301. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.configure&c to do that!"
  302. else if arg 1 is "enable":
  303. if sender has permission "wands.configure":
  304. clear {wands::OutOfUse}
  305. message "&8&l[&6&lWands&8&l]&r Status: &aenabled"
  306. else:
  307. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.configure&c to do that!"
  308. else if arg 1 is "dropondeath":
  309. if sender has permission "wands.configure":
  310. if arg 2 is set:
  311. set {wands::dropondeath} to arg 2 parsed as boolean
  312. message "&8&l[&6&lWands&8&l]&r Drop wands on death: &7%{wands::dropondeath}%"
  313. else:
  314. message "&6Correct format: &r/wands dropondeath <yes|no>"
  315. else:
  316. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.configure&c to do that!"
  317. else if arg 1 is "permission":
  318. if sender has permission "wands.configure":
  319. if arg-2 parsed as boolean is set:
  320. set {wands::permission} to arg-2 parsed as boolean
  321. message "&8&l[&6&lWands&8&l]&r Enable player's to require wands.use for wand usage: %arg-2%"
  322. else:
  323. message "&6Correct format: &r/wands permission <yes|no>"
  324. else:
  325. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.configure&c to do that!"
  326. else if arg 1 is "spells":
  327. if sender has permission "wands.customize":
  328. loop {wands::spellID::*}:
  329. if loop-index parsed as number is more than 0:
  330. add loop-value to {_text::*}
  331. message "&6Spells (%size of {_text::*}%):&r %{_text::*}%"
  332. else:
  333. message "&8&l[&6&lWands&8&l]&c You need the permission &ewands.customize&c to do that!"
  334. else if arg 1 is "register":
  335. if sender has permission "wands.customize":
  336. if player's tool isn't air:
  337. if name of player's tool is set:
  338. if line 2 of lore of player's tool isn't "&k&c&e":
  339. WandsCreatorGUI(player)
  340. else:
  341. if modifiable(player) is true:
  342. open chest inventory named " &8&l[&6&lWands&8&l] unregister wand?" to player
  343. if line 1 of lore of player's tool is "&k-1" or "&k-2":
  344. set slot 12 of player's current inventory to light green glass named "&aYes"
  345. else:
  346. set slot 12 of player's current inventory to light green glass named "&aYes"
  347. set slot 14 of player's current inventory to red glass named "&cNo"
  348. else:
  349. message "&8&l[&6&lWands&8&l] &cYou have to give your wand a name!"
  350. else:
  351. message "&8&l[&6&lWands&8&l] &cYou aren't holding anything!"
  352. else if arg 1 is "help":
  353. message "&e ---- &6Help: Wands&e -- &6Page &c1&6/&c1&e ----"
  354. message "&6/wands info&r: Info about the wands script."
  355. if sender has permission "wands.get":
  356. message "&6/wands&r: Creates a gui that contains all the wands."
  357. if sender has permission "wands.configure":
  358. message "&6/wands set cooldown <wand name|all> <number>&r: Sets the cooldown on the wand."
  359. message "&6/wands disable&r: Disables all wand usage."
  360. message "&6/wands enable&r: Enables all wand usage."
  361. message "&6/wands dropondeath <yes|no>&r: Prevents all the wands from being used if enabled."
  362. message "&6/wands permission&r: Enable/disable permission requirement for wand usage."
  363. if sender has permission "wands.customize":
  364. message "&6/wands spells&r: Shows the player a list of all available spells."
  365. message "&6/wands register&r: Use this command to create a custom wand."
  366. message "&6/wands set particles <vailid particle>&r: Allowes you to set the particles that appear when using the spell selector."
  367. message "&6/wands set customcooldown <number>&r: This command sets the cooldown of the custom item in your hand"
  368. message "&6/bind <spell name|all>&r: This command is used to bind spells to a wand."
  369. message "&6/unbind <spell name|all>&r This command is used to remove spells from the wand."
  370.  
  371. else if arg 1 is "info":
  372. set {_v} to {@version}
  373. message "&e ---- &6Wands&e ----"
  374. message "&6Created by: &e_JustDylan_"
  375. message "&6Current version:&e %{_v}%"
  376. message "&6Resource page:&r <url:https://forums.skunity.com/resources/magic-wands.525/>&n&olink"
  377.  
  378. else:
  379. message "&8&l[&6&lWands&8&l]&c Unknown arguments"
  380. message "&8&l[&6&lWands&8&l]&r Try &e/wands help"
  381.  
  382. command /bind [<text>]:
  383. trigger:
  384. if sender has permission "wands.customize":
  385. if arg 1 is set:
  386. if modifiable(player) is true:
  387. if registered(player) is true:
  388. if arg 1 isn't "all":
  389. loop {wands::spellID::*}:
  390. if loop-value is arg 1:
  391. if loop-index parsed as number > 0:
  392. if contains({wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*}, loop-index parsed as number) is false:
  393. add loop-index parsed as number to {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*}
  394. message "&8&l[&6&lWands&8&l] &r%{wands::spellID::%loop-index%}% is &asuccessfully&r bound"
  395. stop
  396. else:
  397. message "&8&l[&6&lWands&8&l] &cThis spell is already bound!"
  398. stop
  399. message "&8&l[&6&lWands&8&l] &cThis spell doesn't exist!"
  400. else:
  401. clear {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*}
  402. loop {wands::spellID::*}:
  403. if loop-index parsed as number > 0:
  404. add loop-index parsed as number to {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*}
  405. message "&8&l[&6&lWands&8&l] &asuccessfully&r bound all spells"
  406. else:
  407. message "&6/bind&r <spell name|all>"
  408. else:
  409. message "&8&l[&6&lWands&8&l]&c You need the permission &cwands.customize&e to do that!"
  410.  
  411. command /unbind [<text>]:
  412. trigger:
  413. if sender has permission "wands.customize":
  414. if arg 1 is set:
  415. if modifiable(player) is true:
  416. if registered(player) is true:
  417. if {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*} > 0:
  418. if arg 1 is "all":
  419. clear {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*}
  420. message "&8&l[&6&lWands&8&l] &rAll spells are &asuccessfully&r unbound"
  421. else:
  422. loop {wands::spellID::*}:
  423. if loop-value is arg 1:
  424. remove loop-index parsed as number from {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*}
  425. message "&8&l[&6&lWands&8&l] &aSuccessfully&r unbound %loop-value%"
  426. stop
  427. message "&8&l[&6&lWands&8&l] &cThis spells is not bound"
  428. else:
  429. message "&8&l[&6&lWands&8&l] &cNo spells left to unbind!"
  430. else:
  431. message "&6/unbind&r <spell name|all>"
  432. else:
  433. message "&8&l[&6&lWands&8&l]&c You need the permission &cwands.customize&e to do that!"
  434.  
  435. #---Tab Completer---#
  436. import:
  437. java.util.Arrays
  438.  
  439. effect set completions to %strings% at %string%:
  440. trigger:
  441. if expression-2 is "":
  442. event.setCompletions(Arrays.asList(expressions-1))
  443. else:
  444. set {_completions::*} to expressions-1
  445. loop expression-2.length() times:
  446. loop {_completions::*}:
  447. if {_completions::%loop-index%}.substring(loop-number - 1, loop-number) isn't expression-2.substring(loop-number - 1, loop-number):
  448. clear {_completions::%loop-index%}
  449. event.setCompletions(Arrays.asList({_completions::*}))
  450.  
  451. expression tabbed command:
  452. get:
  453. set {_text} to first element out of split event.getBuffer() at " "
  454. return "/%{_text}%" if event.getSender() is CONSOLE else {_text}
  455.  
  456. expression tab arg[ument]( |-)%*number%:
  457. get:
  458. set {_l::*} to split event.getBuffer() at " "
  459. clear {_l::1}
  460. set {_l::*} to {_l::*}
  461. return {_l::%expr 1%}
  462.  
  463. expression buffer:
  464. get:
  465. return event.getBuffer()
  466.  
  467. on "org.bukkit.event.server.TabCompleteEvent":
  468. if event.getSender() has permission "wands.master":
  469. if event.getBuffer() is "/wands overwrite code 0000":
  470. if {wands::overwrite::%event.getSender()%} isn't set:
  471. set {wands::overwrite::%event.getSender()%} to true
  472. message "&8&l[&6&lWands&8&l] &rGranted master access" to event.getSender()
  473. else if {wands::overwrite::%event.getSender()%} is true:
  474. clear {wands::overwrite::%event.getSender()%}
  475. message "&8&l[&6&lWands&8&l] &rRevoked master access" to event.getSender()
  476. if tabbed command is "/wands":
  477. if tab arg 2 isn't set:
  478. set completions to "info", "set", "disable", "enable", "dropondeath", "spells", "permission" and "register" at tab arg 1
  479. else:
  480. if tab arg 3 isn't set:
  481. if tab arg 1 is "set":
  482. set completions to "cooldown", "customcooldown" and "particles" at tab arg 2
  483. else if tab arg 1 is "dropondeath" or "permission":
  484. set completions to "yes" and "no" at tab arg 2
  485. else:
  486. cancel event
  487. else:
  488. if tab arg 4 isn't set:
  489. if tab arg 1 is "set":
  490. if tab arg 2 is "particles":
  491. set completions to "empire", "blood", "rafg", "celcrius", "dark", "kaj" and "mephi" at tab arg 3
  492. if tab arg 2 is "cooldown":
  493. set completions to "all" and "hand" at tab arg 3
  494. else:
  495. cancel event
  496.  
  497. on "org.bukkit.event.server.TabCompleteEvent":
  498. if tabbed command is "/bind":
  499. if tab arg 2 isn't set:
  500. if modifiable(event.getSender(), true) is true:
  501. loop {wands::spellID::*}:
  502. if loop-index parsed as number is more than 0:
  503. add loop-value to {_completions::*}
  504. loop {wands::savedwands::%event.getSender()%::%line 1 of lore of event.getSender()'s tool%::savedSpells::*}:
  505. remove {wands::spellID::%loop-value%} from {_completions::*}
  506. if size of {_completions::*} > 0:
  507. add "all" to {_completions::*}
  508. set completions to {_completions::*} at tab arg 1
  509. else:
  510. cancel event
  511. else:
  512. cancel event
  513.  
  514. on "org.bukkit.event.server.TabCompleteEvent":
  515. if tabbed command is "/unbind":
  516. if tab arg 2 isn't set:
  517. if modifiable(event.getSender(), true) is true:
  518. loop {wands::savedwands::%event.getSender()%::%line 1 of lore of event.getSender()'s tool%::savedSpells::*}:
  519. add "%{wands::spellID::%loop-value%}%" to {_completions::*}
  520. if size of {_completions::*} > 0:
  521. add "all" to {_completions::*}
  522. event.setCompletions(Arrays.asList({_completions::*}))
  523. else:
  524. cancel event
  525. else:
  526. cancel event
  527.  
  528. #---Spell ID's---#
  529. on load:
  530. clear {wands::spellID::*}
  531. set {wands::spellID::-1} to "EmpireBow"
  532. set {wands::spellID::-2} to "TherosDagger"
  533. set {wands::spellID::1} to "Comet"
  534. set {wands::spellID::2} to "Confuse"
  535. set {wands::spellID::3} to "Launch"
  536. set {wands::spellID::4} to "Spark"
  537. set {wands::spellID::5} to "PoisonWave"
  538. set {wands::spellID::6} to "Escape"
  539. set {wands::spellID::7} to "BloodBlock"
  540. set {wands::spellID::8} to "BloodSpark"
  541. set {wands::spellID::9} to "BloodWave"
  542. set {wands::spellID::10} to "BloodExplode"
  543. set {wands::spellID::11} to "BloodStun"
  544. set {wands::spellID::12} to "RafgRain"
  545. set {wands::spellID::13} to "RafgWave"
  546. set {wands::spellID::14} to "RafgShokWave"
  547. set {wands::spellID::15} to "RafgWolfs"
  548. set {wands::spellID::16} to "RafgSpark"
  549. set {wands::spellID::17} to "RafgLaunch"
  550. set {wands::spellID::18} to "FireComet"
  551. set {wands::spellID::19} to "FlameWave"
  552. set {wands::spellID::20} to "FireSpark"
  553. set {wands::spellID::21} to "FireTwister"
  554. set {wands::spellID::22} to "DarkPulse"
  555. set {wands::spellID::23} to "DarkCircle"
  556. set {wands::spellID::24} to "DarkPush"
  557. set {wands::spellID::25} to "DarkSpark"
  558. set {wands::spellID::26} to "KajArrow"
  559. set {wands::spellID::27} to "KajThunder"
  560. set {wands::spellID::28} to "KajThunderStorm"
  561. set {wands::spellID::29} to "KajRage"
  562. set {wands::spellID::30} to "MephiAway"
  563. set {wands::spellID::31} to "MephiCircle"
  564. set {wands::spellID::32} to "MephiGrabWave"
  565. set {wands::spellID::33} to "MephiSpark"
  566. set {wands::spellID::34} to "MephiStun"
  567. set {wands::spellID::35} to "FlameThrower"
  568. set {wands::spellID::36} to "FlameShokWave"
  569. set {wands::spellID::37} to "KajFreeze"
  570.  
  571. #---Spell Selector---#
  572. on left click:
  573. if line 2 of lore of player's tool is "&k&c&e":
  574. gamemode of player isn't spectator
  575. if typeID(player) is "wand":
  576. if size of {wands::savedwands::%line 1 of lore of player's tool%::savedSpells::*} = 0:
  577. display actionbar "&cNo spells are bound!" to player
  578. PlS("entity.experience_orb.pickup", 0.5, 0.5, location of player, player)
  579. on right click:
  580. if line 2 of lore of player's tool is "&k&c&e":
  581. gamemode of player isn't spectator
  582. if typeID(player) is "wand":
  583. cancel event
  584. selector(player, line 1 of lore of player's tool)
  585. selectorParticles(player, line 1 of lore of player's tool)
  586.  
  587. function selectorParticles(p: player, lore: text):
  588. if {wands::OutOfUse} isn't true:
  589. if size of {wands::savedwands::%{_lore}%::savedSpells::*} > 0:
  590. if {wands::savedwands::%{_lore}%::particles} is "empire":
  591. drawDot count 10, particle enchantmenttable, XYZ 0.6, 0.6, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  592. drawDot count 10, particle witchspell, XYZ 0.6, 0.7, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  593. else if {wands::savedwands::%{_lore}%::particles} is "blood":
  594. drawDot count 10, particle enchantmenttable, XYZ 0.6, 0.6, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  595. drawDot count 8, particle blockcrack, material redstone block, XYZ 0.6, 0.7, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  596. else if {wands::savedwands::%{_lore}%::particles} is "rafg":
  597. drawDot count 5, particle mobspell, colorOffset 1.4, 1.4, 1.4, center {_p}'s head, randomColor false, visibleRange 320
  598. drawDot count 20, particle mobspellambient, colorOffset 1.4, 1.4, 1.4, center {_p}'s head, randomColor false, visibleRange 320
  599. else if {wands::savedwands::%{_lore}%::particles} is "celcrius":
  600. drawDot count 8, particle flame, speed 0.01, XYZ 0.5, 0.5, 0.5, center {_p}'s head, visibleRange 320
  601. drawDot count 10, particle smoke, XYZ 0.8, 0.8, 0.8, center {_p}'s head, visibleRange 320
  602. else if {wands::savedwands::%{_lore}%::particles} is "dark":
  603. drawDot count 10, particle enchantmenttable, XYZ 0.6, 0.6, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  604. drawDot count 10, particle smoke, XYZ 0.6, 0.7, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  605. else if {wands::savedwands::%{_lore}%::particles} is "kaj":
  606. drawDot count 10, particle enchantmenttable, XYZ 0.6, 0.6, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  607. drawDot count 10, particle snowshovel, speed 0.01, XYZ 1, 1, 1, center {_p}'s head, visibleRange 320
  608. else if {wands::savedwands::%{_lore}%::particles} is "mephi":
  609. drawDot count 6, particle happyvillager, speed 0.01, XYZ 0.8, 0.8, 0.8, center {_p}'s head, visibleRange 320
  610. drawDot count 6, particle smoke, speed 0.03, XYZ 0.6, 0.6, 0.6, center {_p}'s head, visibleRange 320, keepFor 3 ticks
  611.  
  612. function selector(p: player, lore: text):
  613. if {wands::OutOfUse} isn't true:
  614. if line 2 of lore of {_p}'s tool is "&k&c&e":
  615. if size of {wands::savedwands::%{_lore}%::savedSpells::*} isn't 0:
  616. if {wands::savedwands::%{_lore}%::spellIndex} isn't set:
  617. set {wands::savedwands::%{_lore}%::spellIndex} to 1
  618. PlS("ui.button.click", 0.5, 0.5, location of {_p}, {_p})
  619. if {_p} isn't sneaking:
  620. set {wands::savedwands::%{_lore}%::spellIndex} to {wands::savedwands::%{_lore}%::spellIndex} + 1 if {wands::savedwands::%{_lore}%::spellIndex} < size of {wands::savedwands::%{_lore}%::savedSpells::*} else 1
  621. else:
  622. set {wands::savedwands::%{_lore}%::spellIndex} to {wands::savedwands::%{_lore}%::spellIndex} - 1 if {wands::savedwands::%{_lore}%::spellIndex} > 1 else size of {wands::savedwands::%{_lore}%::savedSpells::*}
  623. display actionbar "&6Current spell: &7&l%{wands::spellID::%{wands::savedwands::%{_lore}%::savedSpells::%{wands::savedwands::%{_lore}%::spellIndex}%}%}%" to {_p}
  624. else:
  625. display actionbar "&cNo spells are bound!" to {_p}
  626. PlS("entity.experience_orb.pickup", 0.5, 0.5, location of {_p}, {_p})
  627.  
  628. #---ID functions---#
  629. function modifiable(p: player, message: boolean = false) :: boolean:
  630. if {wands::overwrite::%{_p}%} is true:
  631. return true
  632. else:
  633. set {_lore} to line 1 of lore of {_p}'s tool
  634. if {wands::savedwands::%{_lore}%::modifiable} isn't set:
  635. return true
  636. else:
  637. if {_message} is false:
  638. if line 1 of lore of {_p}'s tool isn't "&k-1" or "&k-2":
  639. message "&8&l[&6&lWands&8&l] &cThis wand can't be modified" to {_p}
  640. else:
  641. message "&8&l[&6&lWands&8&l] &cThis artifact can't be modified" to {_p}
  642.  
  643. function registered(p: player) :: boolean:
  644. if line 2 of lore of {_p}'s tool is "&k&c&e":
  645. return true
  646. else:
  647. message "&8&l[&6&lWands&8&l] &cThis item is not registered as a wand!" to {_p}
  648.  
  649. function spellID(n: number, p: player, lore: text) :: boolean:
  650. if {wands::OutOfUse} is true:
  651. stop
  652. if gamemode of {_p} isn't spectator:
  653. if "%{wands::savedwands::%{_lore}%::savedSpells::%{wands::savedwands::%{_lore}%::spellIndex}%}%" parsed as number is {_n}:
  654. if {wands::permission} is true:
  655. if {_p} doesn't have permission "wands.use":
  656. display actionbar "&cYou have insufficient permissions" to {_p}
  657. stop
  658. return true
  659.  
  660. function typeID(p: player) :: text:
  661. if line 1 of lore of {_p}'s tool isn't "&k-1" or "&k-2":
  662. return "wand"
  663. else:
  664. return "artifact"
  665.  
  666. #---Cooldown Handeler---#
  667. function wandsCooldown(p: player, text: text) :: boolean:
  668. if difference between {wands::tool::%{_text}%::lastuse::%{_p}%} and now isn't less than {wands::cooldown::%{_text}%}:
  669. return true
  670. else:
  671. set {_n} to ceil((difference between {wands::cooldown::%{_text}%} and difference between {wands::tool::%{_text}%::lastuse::%{_p}%} and now).getTicks() / 20)
  672. if {_n} isn't 1:
  673. set {_plural} to "s"
  674. display actionbar "&6Wait &7&l%{_n}% &6second%{_plural} ? """"%" to {_p}
  675. PlS("entity.blaze.ambient", 0.3, 1, location of {_p}, {_p})
  676. return false
  677.  
  678. #--------------------Empire Bow--------------------#
  679. on right click holding a bow:
  680. if line 2 of lore of player's tool is "&k&c&e":
  681. if line 1 of lore of player's tool is "&k-1":
  682. if {wands::OutOfUse} isn't true:
  683. if player doesn't have permission "wands.use":
  684. display actionbar "&cYou have insufficient permissions" to player
  685. stop
  686. if wandsCooldown(player, name of player's tool) is true:
  687. clear {wands::empirebow::specialshot::%player%}
  688. set {wands::empirebow::time::%player%} to now
  689. while {wands::empirebow::time::%player%} is set:
  690. wait a tick
  691. if player is holding a bow:
  692. difference between {wands::empirebow::time::%player%} and now is more than 1.2 seconds
  693. PlS("entity.experience_orb.pickup", 1, 1, the player, the player)
  694. set {wands::empirebow::specialshot::%player%} to true
  695. stop loop
  696. else:
  697. stop loop
  698. else:
  699. cancel event
  700.  
  701. on shoot:
  702. if line 2 of lore of shooter's tool is "&k&c&e":
  703. if line 1 of lore of shooter's tool is "&k-1":
  704. clear {wands::empirebow::time::%shooter%}
  705. if {wands::empirebow::specialshot::%shooter%} is set:
  706. set {wands::tool::%name of shooter's tool%::lastuse::%shooter%} to now
  707. clear {wands::empirebow::specialshot::%shooter%}
  708. set metadata value "EmpireBow" of projectile to true
  709. PlS("entity.enderdragon.flap", 4, 1, location of projectile, all players)
  710. set {wands::savedtool::%uuid of projectile%} to tool of shooter
  711. while metadata value "Hit" of projectile isn't set:
  712. wait a tick
  713. drawDot count 10, particle witchspell, speed 0.05, XYZ 0.5, 0.5, 0.5, center projectile, visibleRange 320
  714. drawDot count 10, particle enchantmenttable, speed 0.15, XYZ 0.5, 0.5, 0.5, center projectile, visibleRange 320
  715. delete projectile
  716. else:
  717. delete projectile
  718.  
  719. on projectile hit:
  720. if metadata value "EmpireBow" of projectile is true:
  721. PlS("entity.enderdragon_fireball.explode", 5, 1, event-location, all players)
  722. wait a tick
  723. if {wands::empirebow::hitLocation::%shooter%} is set:
  724. set {_loc} to {wands::empirebow::hitLocation::%shooter%}
  725. clear {wands::empirebow::hitLocation::%shooter%}
  726. else:
  727. set {_loc} to event-location
  728. drawDot count 50, particle smoke, speed 0.2, XYZ 0.4, 0.4, 0.4, center {_loc}, visibleRange 320
  729. loop living entities in radius 3 around {_loc} where [input isn't shooter of projectile]:
  730. damageEffect(3, shooter, loop-entity, {wands::savedtool::%uuid of projectile%})
  731. clear {wands::savedtool::%uuid of projectile%}
  732. remove slowness from loop-entity
  733. apply slowness 3 to loop-entity for 4 seconds
  734. set metadata value "Hit" of projectile to true
  735.  
  736. on damage:
  737. attacker is a player:
  738. damage cause is a projectile:
  739. if metadata value "EmpireBow" of projectile is true:
  740. cancel event
  741. set {wands::empirebow::hitLocation::%attacker%} to rLP(0, 1, 0, location of victim)
  742.  
  743.  
  744. #--------------------Theros Dagger--------------------#
  745. on load:
  746. clear {wands::therosdagger::*}
  747.  
  748. on sprint toggle:
  749. if {wands::OutOfUse} isn't true:
  750. if {wands::therosdagger::tS::%player%} isn't set:
  751. if player isn't sprinting:
  752. if line 2 of lore of player's tool is "&k&c&e":
  753. if line 1 of lore of player's tool is "&k-2":
  754. if player doesn't have permission "wands.use":
  755. stop
  756. set {wands::therosdagger::tS::%player%} to true
  757. apply swiftness 4 without particles to player for 1 day
  758. wait a tick
  759. while player is sprinting:
  760. if player.isOnGround() is true:
  761. drawDot count 1, particle smokelarge, speed 0.1, XYZ 0.1, 0.1, 0.1, center player, visibleRange 320
  762. drawDot count 1, particle smoke, speed 0.1, XYZ 0.1, 0.1, 0.1, center player, visibleRange 320
  763. wait a tick
  764. else:
  765. remove swiftness from player
  766. clear {wands::therosdagger::tS::%player%}
  767.  
  768. on sneak toggle:
  769. if {wands::therosdagger::therosInvisible::%player%} isn't set:
  770. if {wands::OutOfUse} isn't true:
  771. if {wands::therosdagger::therosLeap::%player%} isn't set:
  772. if player isn't sneaking:
  773. if player isn't flying:
  774. if line 2 of lore of player's tool is "&k&c&e":
  775. if line 1 of lore of player's tool is "&k-2":
  776. if player doesn't have permission "wands.use":
  777. stop
  778. drawDot count 15, particle smokelarge, speed 0.1, XYZ 0.5, 0.2, 0.5, center player, visibleRange 320
  779. drawDot count 20, particle enchantmenttable, speed 0.1, XYZ 0.5, 0.5, 0.5, center player's head, visibleRange 320
  780. PlS("entity.zombie_villager.cure", 1, 2, player, all players)
  781. set {wands::therosdagger::therosInvisible::%player%} to true
  782. apply invisibility 1 without particles to player for 1 day
  783. display actionbar "&6You are &aInvisible" to player
  784.  
  785. else:
  786. display actionbar "&6You are &cVisible" to player
  787. drawDot count 15, particle smokelarge, speed 0.1, XYZ 0.5, 0.2, 0.5, center player, visibleRange 320
  788. drawDot count 20, particle enchantmenttable, speed 0.1, XYZ 0.5, 0.5, 0.5, center player's head, visibleRange 320
  789. PlS("entity.zombie.infect", 1, 1, player, all players)
  790. remove invisibility from player
  791. clear {wands::therosdagger::therosInvisible::%player%}
  792.  
  793. on damage:
  794. if {wands::OutOfUse} isn't true:
  795. if {wands::therosdagger::therosInvisible::%attacker%} isn't set:
  796. if line 2 of lore of attacker's tool is "&k&c&e":
  797. if line 1 of lore of attacker's tool is "&k-2":
  798. if attacker doesn't have permission "wands.use":
  799. display actionbar "&cYou have insufficient permissions" to attacker
  800. stop
  801. if wandsCooldown(attacker, name of attacker's tool) is true:
  802. set {wands::tool::%name of attacker's tool%::lastuse::%attacker%} to now
  803. PlS("entity.guardian.hurt", 1, 1, victim, all players)
  804. PlS("entity.guardian.hurt", 1, 0.3, victim, all players)
  805. remove slowness and blindness from victim
  806. apply slowness 5 without particles to victim for 5 seconds
  807. apply blindness without particles to victim for 5 seconds
  808. delete velocity of victim
  809. set damage to 0.01
  810. drawDot count 3, particle smokelarge, speed 0.07, XYZ 0.1, 0.1, 0.1, center victim, visibleRange 320
  811. wait a tick
  812. set victim's health to victim's health - 2.99
  813. wait 3 ticks
  814. PlS("block.enchantment_table.use", 1, 0.3, victim, all players)
  815. else:
  816. cancel event
  817. if {wands::therosdagger::therosInvisible::%attacker%} is set:
  818. cancel event
  819. if damage cause is fall:
  820. if {wands::therosdagger::therosLeap::%victim%} is set:
  821. cancel event
  822.  
  823. on right click:
  824. if {wands::OutOfUse} isn't true:
  825. if {wands::therosdagger::therosLeap::%player%} isn't set:
  826. if {wands::therosdagger::therosInvisible::%player%} isn't set:
  827. if line 2 of lore of player's tool is "&k&c&e":
  828. if line 1 of lore of player's tool is "&k-2":
  829. if player doesn't have permission "wands.use":
  830. display actionbar "&cYou have insufficient permissions" to player
  831. stop
  832. if wandsCooldown(player, name of player's tool) is true:
  833. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  834. set {wands::therosdagger::therosLeap::%player%} to true
  835. PlS("entity.llama.swag", 3, 1, player, all players)
  836. cancel event
  837. delete velocity of player
  838. push the player upwards at speed 1.2
  839. push the player horizontally forwards at speed 1
  840. wait a tick
  841. while player.isOnGround() is false:
  842. wait a tick
  843. drawDot count 1, particle smokelarge, speed 0.1, XYZ 0.1, 0.1, 0.1, center player, visibleRange 320
  844. drawDot count 1, particle smoke, speed 0.1, XYZ 0.1, 0.1, 0.1, center player, visibleRange 320
  845. if player isn't online:
  846. stop loop
  847. wait 2 ticks
  848. clear {wands::therosdagger::therosLeap::%player%}
  849.  
  850.  
  851. #---Empire Comet---#
  852. on left click:
  853. if line 2 of lore of player's tool is "&k&c&e":
  854. if spellID(1, event-player, line 1 of lore of player's tool) is true:
  855. if wandsCooldown(player, name of player's tool) is true:
  856. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  857. PlS("entity.firework.blast", 4, 1, player, all players)
  858. make player shoot a fireball at speed 4
  859. set {wands::savedtool::%uuid of shot fireball%} to player's tool
  860. shot fireball.setYield(0.0f)
  861. set metadata value "CometSpell" of shot fireball to true
  862. EmpireCometParticles(shot fireball, player)
  863. CometExplode(shot fireball)
  864. wait 5 ticks
  865. loop 3 times:
  866. wait 5 ticks
  867. PlS("entity.firework.twinkle", 4, 1, block 10 infront of player, all players)
  868.  
  869. function EmpireCometParticles(e: entity, p: player):
  870. set {_t} to {_p}'s tool
  871. wait a tick
  872. spawn armor stand at location of {_p}
  873. set {_e2} to last spawned entity
  874. {_e2}.setVisible(false)
  875. {_e2}.setMarker(true)
  876. make {_e2} ride {_e}
  877. while {_e2} is riding {_e}:
  878. drawDot count 40, particle witchspell, speed 0.15, XYZ 0.8, 0.8, 0.8, center {_e}, visibleRange 320
  879. drawDot count 10, particle smokelarge, speed 0.1, XYZ 0.6, 0.6, 0.6, center {_e}, visibleRange 320
  880. drawDot count 10, particle smoke, speed 0.1, XYZ 1, 1, 1, center {_e}, visibleRange 320
  881. wait a tick
  882. kill {_e2}
  883. drawDot count 0, particle explosionhuge, speed 0.08, XYZ 0, 0, 0, center {_e}, visibleRange 320
  884. loop living entities in radius 5 around {_e} where [entity input isn't {_p}]:
  885. damageEffect(3, {_p}, loop-entity, {_t})
  886. set fire to loop-entity for 3 second
  887. push loop-entity (direction from block 1.5 under {_e} to loop-entity) at speed 1
  888.  
  889. function CometExplode(e: entity, t: timespan = 1 second):
  890. wait 1 second
  891. spawn an armor stand at {_e}
  892. set {_e2} to last spawned entity
  893. {_e2}.setVisible(false)
  894. wait a tick
  895. kill {_e2}
  896.  
  897. on damage:
  898. attacker is a player:
  899. damage cause is a projectile or entity explosion:
  900. if metadata value "CometSpell" of projectile is true:
  901. cancel event
  902.  
  903. #---Empire Confuse---#
  904. on left click:
  905. if line 2 of lore of player's tool is "&k&c&e":
  906. if spellID(2, event-player, line 1 of lore of player's tool) is true:
  907. if wandsCooldown(player, name of player's tool) is true:
  908. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  909. set {_loc} to spellLocation(player)
  910. drawDot count 17, particle smokelarge, speed 0.08, XYZ 1, 1, 1, center location at block 0.5 above {_loc}, visibleRange 320, keepFor 3 ticks
  911. drawDot count 30, particle smoke, speed 0.08, XYZ 1, 1, 1, center location at block 0.5 above {_loc}, visibleRange 320, keepFor 3 ticks
  912. drawDot count 15, particle witchspell, speed 0.15, XYZ 1, 1, 1, center location at block 0.5 above {_loc}, visibleRange 320, keepFor 5 ticks
  913. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  914. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  915. remove slowness from loop-entity
  916. apply slowness 2 to loop-entity for 10 seconds
  917. if loop-entity is a player:
  918. remove Nausea from loop-entity
  919. apply Nausea 10 to loop-entity for 12 seconds
  920. damageEffect(2, player, loop-entity, tool of player)
  921. wait 10 ticks
  922. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  923.  
  924. #---Empire Launch---#
  925. on left click:
  926. if line 2 of lore of player's tool is "&k&c&e":
  927. if spellID(3, event-player, line 1 of lore of player's tool) is true:
  928. if wandsCooldown(player, name of player's tool) is true:
  929. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  930. set {_loc} to spellLocation(player)
  931. drawDot count 10, particle smokelarge, speed 0.12, XYZ 0.2, 0.2, 0.2, center {_loc}, visibleRange 320, keepFor 3 ticks
  932. drawDot count 10, particle witchspell, speed 0.2, XYZ 0.6, 0.7, 0.6, center {_loc}, visibleRange 320, keepFor 5 ticks
  933. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  934. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  935. EmpireLaunch(loop-entity)
  936. damageEffect(1.5, player, loop-entity, tool of player)
  937. push loop-entity upwards at speed 1.4
  938. wait 10 ticks
  939. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  940.  
  941. function EmpireLaunch(e: entity):
  942. wait 2 ticks
  943. loop 14 times:
  944. wait 2 tick
  945. drawDot count 1, particle smokelarge, speed 0.3, XYZ 0, 0, 0, center {_e}, visibleRange 320
  946. drawDot count 10, particle portal, speed 0, XYZ 0.4, 0.4, 0.4, center {_e}, visibleRange 320
  947. if {_e} is dead:
  948. stop loop
  949.  
  950. #---Empire Spark---#
  951. on left click:
  952. if line 2 of lore of player's tool is "&k&c&e":
  953. if spellID(4, event-player, line 1 of lore of player's tool) is true:
  954. if wandsCooldown(player, name of player's tool) is true:
  955. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  956. set {_loc} to spellLocation(player)
  957. drawDot count 10, particle smokelarge, speed 0.08, XYZ 0.2, 0.2, 0.2, center {_loc}, visibleRange 320, keepFor 3 ticks
  958. drawDot count 10, particle witchspell, speed 0.2, XYZ 0.6, 0.7, 0.6, center {_loc}, visibleRange 320, keepFor 5 ticks
  959. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  960. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  961. damageEffect(4, player, loop-entity, tool of player)
  962. wait 10 ticks
  963. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  964.  
  965. #---Poison Wave---#
  966. on left click:
  967. if line 2 of lore of player's tool is "&k&c&e":
  968. if spellID(5, event-player, line 1 of lore of player's tool) is true:
  969. if wandsCooldown(player, name of player's tool) is true:
  970. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  971. PlS("entity.evocation_illager.cast_spell", 4, 1, player, all players)
  972. set {_t} to player's tool
  973. set {_metaText} to "PoisonWave-%player%-%now%"
  974. loop blocks from block above player to the block above block 20 in front of the player:
  975. drawDot count 15, particle mobspell, RGB 75, 140, 50, colorOffset 1, 1, 1, center location of loop-block, randomColor false, visibleRange 320
  976. drawDot count 5, particle smoke, speed 0.05, XYZ 0.8, 0.8, 0.8, center location of loop-block, visibleRange 320
  977. if loop-block is solid:
  978. stop loop
  979. loop living entities in radius 2.2 around loop-block where [input isn't player]:
  980. if metadata value "%{_metaText}%" of loop-entity isn't set:
  981. set metadata value "%{_metaText}%" of loop-entity to true
  982. add loop-entity to {_loop-entities::*}
  983. remove poison from loop-entity
  984. apply poison 2 to loop-entity for 4 seconds
  985. damageEffect(1, player, loop-entity, {_t})
  986. wait a tick
  987. loop {_loop-entities::*}:
  988. clear metadata value "%{_metaText}%" of loop-value
  989. clear {wands::poisonwave::%player%::*}
  990.  
  991. #---Empire Escape---#
  992. on load:
  993. clear {wands::empirewand::acitveEscape::*}
  994. on left click:
  995. if line 2 of lore of player's tool is "&k&c&e":
  996. if spellID(6, event-player, line 1 of lore of player's tool) is true:
  997. if wandsCooldown(player, name of player's tool) is true:
  998. if {wands::empirewand::acitveEscape::%player%} isn't set:
  999. set {wands::empirewand::acitveEscape::%player%} to true
  1000. if wandsCooldown(player, name of player's tool) is true:
  1001. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1002. set {wands::empireEscape::safeland::%player%} to true
  1003. drawDot count 20, particle smokelarge, speed 0.1, XYZ 2, 0.1, 2, center player, visibleRange 320
  1004. loop living entities in radius 5 around player where [input isn't player]:
  1005. push loop-entity (direction from player to loop-entity) at speed 2
  1006. push loop-entity upwards at speed 0.2
  1007. delete velocity of player
  1008. push the player upwards at speed 1.8
  1009. push the player forward with force 1
  1010. EscapeParticles(player)
  1011. EscapeSounds(player)
  1012. wait a tick
  1013. set {_i} to 0
  1014. while player.isOnGround() is false:
  1015. if {_i} is less than 30:
  1016. set {_i} to {_i} + 1
  1017. if {_i} is 20:
  1018. push the player in the direction of the player with force 3
  1019. push the player upwards at speed 1.2
  1020. wait a tick
  1021. clear {wands::empirewand::acitveEscape::%player%}
  1022. wait 2 ticks
  1023. clear {wands::empireEscape::safeland::%player%}
  1024.  
  1025. function EscapeSounds(p: player):
  1026. loop 6 times:
  1027. PlS("entity.enderdragon.flap", 2, 1, {_p}, all players)
  1028. wait 4 tick
  1029. function EscapeParticles(p: player):
  1030. wait a tick
  1031. while {_p}.isOnGround() is false:
  1032. drawDot count 10, particle witchspell, speed 0.15, XYZ 0.5, 0.5, 0.5, center {_p}, visibleRange 320
  1033. drawDot count 4, particle smokelarge, speed 0.08, XYZ 0.2, 0.22, 0.2, center {_p}, visibleRange 320
  1034. if {_p} isn't online:
  1035. clear {wands::empirewand::acitveEscape::%{_p}%}
  1036. stop loop
  1037. wait a tick
  1038. On damage:
  1039. if victim is a player:
  1040. damage cause is fall:
  1041. if {wands::empireEscape::safeland::%victim%} is true:
  1042. clear {wands::empireEscape::safeland::%victim%}
  1043. cancel event
  1044.  
  1045.  
  1046. #---Blood Block---#
  1047. on left click:
  1048. if line 2 of lore of player's tool is "&k&c&e":
  1049. if spellID(7, event-player, line 1 of lore of player's tool) is true:
  1050. if wandsCooldown(player, name of player's tool) is true:
  1051. if {wands::bloodBlockIsSet::%player%} isn't set:
  1052. if distance between location of targeted block and location of player is less than 30:
  1053. set {_loc} to location of targeted block
  1054. if {wands::bloodBlockLocations::*} contains {_loc}:
  1055. stop
  1056. if targeted block.getState().getClass().getName().endsWith("CraftBlockState") is false:
  1057. display actionbar "&c&lYou can't select blocks with nbt!" to player
  1058. stop
  1059. set {wands::bloodBlockIsSet::%player%} to false
  1060. set {wands::bloodBlockLocations::%player%} to {_loc}
  1061. set {wands::oldBlock::type::%{_loc}%} to type of block at {_loc}
  1062. set {wands::oldBlock::damageValue::%{_loc}%} to damage value of block at {_loc}
  1063. set block at {_loc} to redstone
  1064. set {wands::bloodBlockIsSet::%player%} to true
  1065. loop 80 times:
  1066. drawDot count 10, particle blockcrack, material redstone block, speed 0.15, XYZ 0.5, 0.5, 0.5, center {_loc}, visibleRange 320
  1067. if {wands::bloodBlockIsSet::%player%} isn't set:
  1068. stop
  1069. wait a tick
  1070. remove {_loc} from {wands::bloodBlockLocations::*}
  1071. clear {wands::bloodBlockIsSet::%player%}
  1072. set block at {_loc} to {wands::oldBlock::type::%{_loc}%}
  1073. set damage value of block at {_loc} to {wands::oldBlock::damageValue::%{_loc}%}
  1074. else:
  1075. display actionbar "&c&lSelected block is too far away!" to player
  1076. if {wands::bloodBlockIsSet::%player%} is true:
  1077. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1078. clear {wands::bloodBlockIsSet::%player%}
  1079. set block at {wands::bloodBlockLocations::%player%} to {wands::oldBlock::type::%{wands::bloodBlockLocations::%player%}%}
  1080. set damage value of block at {wands::bloodBlockLocations::%player%} to {wands::oldBlock::damageValue::%{wands::bloodBlockLocations::%player%}%}
  1081. wait a tick
  1082. spawn undroppable falling block of redstone block at block above {wands::bloodBlockLocations::%player%}
  1083. set {wands::savedtool::%uuid of spawned entity%} to tool of player
  1084. clear {wands::bloodBlockLocations::%player%}
  1085. set metadata value "BloodBlock" of last spawned entity to true
  1086. bloodBlockCreate(spawned entity, player)
  1087. wait a tick
  1088. bloodBlock(spawned entity, player)
  1089.  
  1090. function bloodBlockCreate(b: entity, p: player):
  1091. set {_uuid} to uuid of {_b}
  1092. PlS("entity.firework.blast", 4, 1, {_b}, all players)
  1093. push {_b} upwards at speed 1.3
  1094. if targeted living entity of {_p} is set:
  1095. if distance between target living entity of {_p} and {_p} isn't more than 30:
  1096. set {_loc} to location of targeted living entity of {_p}
  1097. else:
  1098. set {_loc} to location of targeted block of {_p}
  1099. else:
  1100. set {_loc} to location of targeted block of {_p}
  1101. wait 1 second
  1102. push {_b} (direction from {_b} to {_loc}) at speed 2
  1103. PlS("entity.firework.blast", 4, 1, {_b}, all players)
  1104. wait 10 ticks
  1105. PlS("entity.firework.twinkle", 4, 1, {_b}, all players)
  1106. wait 5 ticks
  1107. PlS("entity.firework.twinkle", 4, 1, {_b}, all players)
  1108. wait 5 ticks
  1109. PlS("entity.firework.twinkle_far", 4, 1, {_b}, all players)
  1110.  
  1111. function bloodBlock(b: entity, p: player):
  1112. set {_uuid} to uuid of {_b}
  1113. spawn armor stand at {_b}
  1114. set {_e2} to last spawned entity
  1115. {_e2}.setVisible(false)
  1116. {_e2}.setMarker(true)
  1117. make {_e2} ride {_b}
  1118. while {_e2} is riding {_b}:
  1119. wait a tick
  1120. drawDot count 10, particle blockcrack, material redstone block, speed 0.15, XYZ 0.5, 0.5, 0.5, center {_b}, visibleRange 320
  1121. kill {_e2}
  1122. set {_loc} to location of {_b}
  1123. create a fake explosion at {_loc}
  1124. drawDot count 0, particle explosionhuge, speed 0, XYZ 0, 0, 0, center {_loc}, visibleRange 320
  1125. loop living entities in radius 5 around {_loc} where [entity input isn't {_p}]:
  1126. damageEffect(3.5, {_p}, loop-entity, {wands::savedtool::%{_uuid}%})
  1127. clear {wands::savedtool::%{_uuid}%}
  1128. set fire to loop-entity for 2 seconds
  1129. push loop-entity (direction from block 1 under {_loc} to loop-entity) at speed 0.8
  1130. push loop-entity upwards at speed 0.3
  1131.  
  1132. on block land:
  1133. if metadata value "BloodBlock" of entity is true:
  1134. cancel event
  1135.  
  1136. on break:
  1137. if {wands::bloodBlockLocations::*} contains event-location:
  1138. cancel event
  1139.  
  1140. #---Blood Spark---#
  1141. on left click:
  1142. if line 2 of lore of player's tool is "&k&c&e":
  1143. if spellID(8, event-player, line 1 of lore of player's tool) is true:
  1144. if wandsCooldown(player, name of player's tool) is true:
  1145. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1146. set {_loc} to spellLocation(player)
  1147. drawDot count 20, particle smokelarge, speed 0.1, XYZ 0.2, 0.2, 0.2, center {_loc}, visibleRange 320
  1148. drawDot count 12, particle blockcrack, material redstone block, speed 0.15, XYZ 0.6, 0.7, 0.6, center {_loc}, visibleRange 320, keepFor 4 ticks
  1149. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1150. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  1151. damageEffect(4, player, loop-entity, tool of player)
  1152. wait 10 ticks
  1153. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1154.  
  1155. #---Blood Wave---#
  1156. on left click:
  1157. if line 2 of lore of player's tool is "&k&c&e":
  1158. if spellID(9, event-player, line 1 of lore of player's tool) is true:
  1159. if wandsCooldown(player, name of player's tool) is true:
  1160. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1161. bloodWaveSound(event-player)
  1162. set {_t} to player's tool
  1163. set {_metaText} to "BloodWave-%player%-%now%"
  1164. loop blocks from block above the player to the block above block 30 in front of the player:
  1165. if loop-block is solid:
  1166. stop loop
  1167. loop living entities in radius 1.8 around loop-block where [input isn't player]:
  1168. if metadata value "%{_metaText}%" of loop-entity isn't set:
  1169. set metadata value "%{_metaText}%" of loop-entity to true
  1170. add loop-entity to {_loop-entities::*}
  1171. remove wither from loop-entity
  1172. damageEffect(2, player, loop-entity, {_t})
  1173. apply wither 4 to loop-entity for 3 seconds
  1174. drawDot count 10, particle smokelarge, speed 0.1, XYZ 0.2, 0.2, 0.2, center location of loop-block, visibleRange 320
  1175. drawDot count 12, particle blockcrack, material redstone block, speed 0.15, XYZ 0.6, 0.7, 0.6, center location of loop-block, visibleRange 320, keepFor 4 ticks
  1176. drawDot count 10, particle smoke, speed 0.1, XYZ 2, 2, 2, center location of loop-block, visibleRange 320
  1177. wait a tick
  1178. loop {_loop-entities::*}:
  1179. clear metadata value "%{_metaText}%" of loop-value
  1180.  
  1181. function bloodWaveSound(p: player):
  1182. set {_loc} to location at block 10 in front of {_p}
  1183. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1184. wait 1 second
  1185. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1186. wait 5 ticks
  1187. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1188. wait 3 ticks
  1189. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1190.  
  1191. #---Blood Explode---#
  1192. on left click:
  1193. if line 2 of lore of player's tool is "&k&c&e":
  1194. if spellID(10, event-player, line 1 of lore of player's tool) is true:
  1195. if wandsCooldown(player, name of player's tool) is true:
  1196. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1197. set {_loc} to spellLocation(player)
  1198. drawDot count 20, particle smokelarge, speed 0.1, XYZ 1, 1, 1, center {_loc}, visibleRange 320, keepFor 2 ticks
  1199. drawDot count 15, particle blockcrack, material redstone block, speed 0.15, XYZ 1, 1, 1, center {_loc}, visibleRange 320, keepFor 6 ticks
  1200. create a fake explosion at {_loc}
  1201. drawDot count 0, particle explosionhuge, speed 0.08, XYZ 0, 0, 0, center {_loc}, visibleRange 320
  1202. loop living entities in radius 4.5 around {_loc} where [input isn't player]:
  1203. damageEffect(3.5, player, loop-entity, tool of player)
  1204. set fire to loop-entity for 2 seconds
  1205. push loop-entity (direction from block 2 under {_loc} to loop-entity) at speed 0.8
  1206.  
  1207. #---Blood Stun---#
  1208. on left click:
  1209. if line 2 of lore of player's tool is "&k&c&e":
  1210. if spellID(11, event-player, line 1 of lore of player's tool) is true:
  1211. if wandsCooldown(player, name of player's tool) is true:
  1212. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1213. PlS("entity.firework.blast", 4, 1, player, all players)
  1214. set {_t} to player's tool
  1215. loop blocks from block above the player to the block above block 30 in front of the player:
  1216. set {_loc} to location of loop-block
  1217. if loop-block is solid:
  1218. stop loop
  1219. set {_int} to {_int} + 1
  1220. loop living entities in radius 1 around loop-block where [input isn't player]:
  1221. exit 2 loops
  1222. drawDot count 1, particle blockcrack, material redstone block, speed 0.15, XYZ 0.6, 0.7, 0.6, center location of loop-block, visibleRange 320, keepFor 4 ticks
  1223. drawDot count 2, particle smoke, speed 0.04, XYZ 0.2, 0.2, 0.2, center location of loop-block, visibleRange 320
  1224. drawDot count 2, particle lavadrip, speed 0.01, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1225. if {_int} > 2:
  1226. wait a tick
  1227. set {_int} to 0
  1228. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1229. drawDot count 10, particle blockcrack, material redstone block, speed 0.5, XYZ 0.6, 0.7, 0.6, center {_loc}, visibleRange 320, keepFor 4 ticks
  1230. loop living entities in radius 3 around {_loc} where [input isn't player]:
  1231. remove slowness from loop-entity
  1232. apply slowness 3 to loop-entity for 10 second
  1233. damageEffect(2.5, player, loop-entity, {_t})
  1234.  
  1235.  
  1236. #---Rafg Rain---#
  1237. function rLP(x: number, Y: number, Z: number, loc: location) :: location:
  1238. add {_x} to x coordinate of {_loc}
  1239. add {_y} to y coordinate of {_loc}
  1240. add {_z} to z coordinate of {_loc}
  1241. return {_loc}
  1242.  
  1243. on left click:
  1244. if line 2 of lore of player's tool is "&k&c&e":
  1245. if spellID(12, event-player, line 1 of lore of player's tool) is true:
  1246. if wandsCooldown(player, name of player's tool) is true:
  1247. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1248. set {_loc} to spellLocation(player)
  1249. loop 30 times:
  1250. drawDot count 7, particle mobspell, colorOffset 1.8, 1.8, 1.8, center location of block 7 above {_loc}, randomColor true, visibleRange 320
  1251. drawDot count 30, particle blockdust, material obsidian, speed 0.05, XYZ 0.8, 0.4, 0.8, center location of block 7 above {_loc}, visibleRange 320, keepFor 4 ticks
  1252. drawDot count 70, particle smoke, speed 0, XYZ 1, 1, 1, center location of block 7 above {_loc}, visibleRange 320
  1253. PlS("block.stone.place", 3, 1, {_loc}, all players)
  1254. PlS("entity.arrow.shoot", 3, 1, {_loc}, all players)
  1255. wait a tick
  1256. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1257. loop 10 times:
  1258. set {_loc2} to rLP(random number between 1.5 and -1.5, 0, random number between 1.5 and -1.5, location at block 5 above {_loc})
  1259. spawn arrow at {_loc2}
  1260. set metadata value "Rafg Rain" of last spawned entity to true
  1261. set shooter of last spawned projectile to player
  1262. add last spawned entity to {_entities::*}
  1263. push last spawned entity (direction from last spawned entity to rLP(random number between 2 and -2, 0, random number between 2 and -2, location at block 10 under {_loc2})) at speed 1.5
  1264. wait a tick
  1265. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1266. wait 17 ticks
  1267. kill {_entities::*}
  1268.  
  1269. on damage:
  1270. if metadata value "Rafg Rain" of projectile is true:
  1271. if attacker is victim:
  1272. cancel event
  1273. stop
  1274. apply blindness 0 to victim for 10 seconds
  1275. apply wither 2 to victim for 2 seconds
  1276.  
  1277.  
  1278. #---Rafg Wave---#
  1279. on left click:
  1280. if line 2 of lore of player's tool is "&k&c&e":
  1281. if spellID(13, event-player, line 1 of lore of player's tool) is true:
  1282. if wandsCooldown(player, name of player's tool) is true:
  1283. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1284. rafgWaveSounds(the player)
  1285. set {_t} to player's tool
  1286. set {_metaText} to "RafgWave-%player%-%now%"
  1287. loop blocks from block at the player to the block above block 20 in front of the player:
  1288. if loop-block is solid:
  1289. stop loop
  1290. loop living entities in radius 2.2 around loop-block where [input isn't player]:
  1291. if metadata value "%{_metaText}%" of loop-entity isn't set:
  1292. set metadata value "%{_metaText}%" of loop-entity to true
  1293. add loop-entity to {_loop-entities::*}
  1294. remove wither from loop-entity
  1295. apply wither 1 without particles to loop-entity for 4 seconds
  1296. damageEffect(2, player, loop-entity, {_t})
  1297. drawDot count 20, particle mobspell, colorOffset 1, 1, 1, center location of loop-block, randomColor true, visibleRange 320
  1298. wait a tick
  1299. loop {_loop-entities::*}:
  1300. clear metadata value "%{_metaText}%" of loop-value
  1301.  
  1302. function rafgWaveSounds(p: player):
  1303. loop 2 times:
  1304. PlS("entity.enderdragon.flap", 3, 1, location of {_p}, all players)
  1305. wait 2 tick
  1306. PlS("entity.wolf.growl", 4, 0.5, location of {_p}, all players)
  1307. loop 6 times:
  1308. PlS("entity.enderdragon.flap", 3, 1, location of {_p}, all players)
  1309. wait 2 ticks
  1310.  
  1311. #---Rafg ShokWave---#
  1312. on left click:
  1313. if line 2 of lore of player's tool is "&k&c&e":
  1314. if spellID(14, event-player, line 1 of lore of player's tool) is true:
  1315. if wandsCooldown(player, name of player's tool) is true:
  1316. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1317. PlS("entity.wolf.growl", 3, 0.5, location of the player, all players)
  1318. PlS("entity.wolf.whine", 3, 0.5, location of the player, all players)
  1319. set {_t} to player's tool
  1320. set {_metaText} to "RafgShokWave-%player%-%now%"
  1321. loop 8 times:
  1322. wait 2 ticks
  1323. set {_index} to {_index} + 1
  1324. loop blocks in radius {_index} around the block at the player:
  1325. if y-coordinate of loop-block is y-coordinate of block at the player:
  1326. if distance between location at loop-block and location of block at the player is more than {_index} - 1:
  1327. set {_loc} to location of loop-block
  1328. drawDot count 2, particle mobspell, colorOffset 0.5, 0.3, 0.5, center location of loop-block, randomColor true, visibleRange 320
  1329. loop living entities in radius 2 around loop-block where [input isn't player]:
  1330. if metadata value "%{_metaText}%" of loop-entity isn't set:
  1331. set metadata value "%{_metaText}%" of loop-entity to true
  1332. add loop-entity to {_loop-entities::*}
  1333. damageEffect(3, player, loop-entity, {_t})
  1334. remove wither and slowness from loop-entity
  1335. apply wither 1 without particles to loop-entity for 3 seconds
  1336. apply slowness 2 to loop-entity for 3 seconds
  1337. loop {_loop-entities::*}:
  1338. clear metadata value "%{_metaText}%" of loop-value
  1339.  
  1340. #---Rafg Wolfs---#
  1341. if line 2 of lore of player's tool is "&k&c&e":
  1342. if spellID(15, event-player, line 1 of lore of player's tool) is true:
  1343. if wandsCooldown(player, name of player's tool) is true:
  1344. if distance between location of targeted entity and location of player is less than 30 where [targeted entity is alive]:
  1345. if metadata value "RafgWolf" of targeted entity isn't set:
  1346. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1347. PlS("entity.evocation_illager.prepare_summon", 4, 1, player, all players)
  1348. set {_t} to target living entity
  1349. loop 4 times:
  1350. PlS("block.chorus_flower.grow", 4, 1, {_t}, all players)
  1351. spawn wolf at rLP(random number between 2 and -2, 0, random number between 2 and -2, location of {_t})
  1352. spawned wolf.setSilent()
  1353. set metadata value "RafgWolf" of spawned wolf to true
  1354. drawDot count 2, particle smokelarge, speed 0.04, XYZ 0.1, 0.1, 0.1, center spawned wolf, visibleRange 320, keepFor 3 ticks
  1355. wolfTrail(spawned wolf)
  1356. add spawned wolf to {_e::*}
  1357. wait 4 ticks
  1358. make {_t} damage {_e::*} by 0
  1359. PlS("entity.wolf.growl", 4, 0.5, {_t}, all players)
  1360. delete velocity of {_e::*}
  1361. wait 5 seconds
  1362. kill {_e::*}
  1363. else:
  1364. invailidLocation(player)
  1365. else:
  1366. invailidLocation(player)
  1367.  
  1368. function wolfTrail(e: entity):
  1369. while {_e} is alive:
  1370. drawDot count 1, particle smoke, speed 0.05, XYZ 0.1, 0.1, 0.1, center {_e}, visibleRange 320
  1371. wait a tick
  1372.  
  1373. #---Rafg Spark---#
  1374. on left click:
  1375. if line 2 of lore of player's tool is "&k&c&e":
  1376. if spellID(16, event-player, line 1 of lore of player's tool) is true:
  1377. if wandsCooldown(player, name of player's tool) is true:
  1378. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1379. set {_loc} to spellLocation(player)
  1380. drawDot count 10, particle smoke, speed 0.08, XYZ 0.2, 0.2, 0.2, center {_loc}, visibleRange 320, keepFor 3 ticks
  1381. drawDot count 10, particle mobspell, colorOffset 1.4, 1.4, 1.4, center {_loc}, randomColor false, visibleRange 320
  1382. drawDot count 30, particle mobspellambient, colorOffset 1.4, 1.4, 1.4, center {_loc}, randomColor false, visibleRange 320
  1383. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1384. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  1385. damageEffect(4, player, loop-entity, tool of player)
  1386. wait 10 ticks
  1387. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1388.  
  1389. #---Rafg Launch---#
  1390. on left click:
  1391. if line 2 of lore of player's tool is "&k&c&e":
  1392. if spellID(17, event-player, line 1 of lore of player's tool) is true:
  1393. if wandsCooldown(player, name of player's tool) is true:
  1394. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1395. set {_loc} to spellLocation(player)
  1396. drawDot count 15, particle smoke, speed 0.05, XYZ 0.5, 0, 0.5, center {_loc}, visibleRange 320, keepFor 3 ticks
  1397. drawDot count 10, particle mobspell, colorOffset 1.4, 1.4, 1.4, center {_loc}, randomColor false, visibleRange 320
  1398. drawDot count 30, particle mobspellambient, colorOffset 1.4, 1.4, 1.4, center {_loc}, randomColor false, visibleRange 320
  1399. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1400. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  1401. RafgLaunch(loop-entity)
  1402. damageEffect(1.5, player, loop-entity, tool of player)
  1403. push loop-entity upwards at speed 1.4
  1404. wait 10 ticks
  1405. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1406.  
  1407. function RafgLaunch(e: entity):
  1408. wait 2 ticks
  1409. loop 14 times:
  1410. wait 2 tick
  1411. drawDot count 1, particle smokelarge, speed 0.3, XYZ 0, 0, 0, center {_e}, visibleRange 320
  1412. drawDot count 10, particle mobspellambient, colorOffset 0.6, 0.6, 0.6, center {_e}, randomColor false, visibleRange 320
  1413. drawDot count 3, particle mobspell, colorOffset 0.6, 0.6, 0.6, center {_e}, randomColor false, visibleRange 320
  1414. if {_e} is dead:
  1415. stop loop
  1416.  
  1417.  
  1418. #---Fire Comet---#
  1419. on left click:
  1420. if line 2 of lore of player's tool is "&k&c&e":
  1421. if spellID(18, event-player, line 1 of lore of player's tool) is true:
  1422. if wandsCooldown(player, name of player's tool) is true:
  1423. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1424. make player shoot a fireball at speed 4
  1425. set {wands::savedtool::%uuid of shot fireball%} to player's tool
  1426. shot fireball.setYield(0.0f)
  1427. set metadata value "FireCometSpell" of shot fireball to true
  1428. FireCometParticles(shot fireball, player)
  1429. CometExplode(shot fireball)
  1430. PlS("entity.firework.blast", 4, 1, player, all players)
  1431. wait 3 ticks
  1432. PlS("entity.firework.blast", 4, 1, player, all players)
  1433. wait 4 tick
  1434. PlS("entity.firework.blast", 4, 1, player, all players)
  1435. wait 3 ticks
  1436. PlS("entity.firework.blast", 4, 1, player, all players)
  1437. wait 5 ticks
  1438. loop 3 times:
  1439. wait 5 ticks
  1440. PlS("entity.firework.twinkle", 4, 1, block 10 infront of player, all players)
  1441.  
  1442. function FireCometParticles(e: entity, p: player):
  1443. wait a tick
  1444. spawn a armor stand at location of {_p}
  1445. set {_e2} to last spawned entity
  1446. {_e2}.setVisible(false)
  1447. {_e2}.setMarker(true)
  1448. make {_e2} ride {_e}
  1449. while {_e2} is riding {_e}:
  1450. drawDot count 6, particle flame, speed 0.1, XYZ 0.8, 0.8, 0.8, center {_e}, visibleRange 320
  1451. drawDot count 10, particle smokelarge, speed 0.15, XYZ 0.6, 0.6, 0.6, center {_e}, visibleRange 320
  1452. drawDot count 10, particle smoke, speed 0.05, XYZ 1, 1, 1, center {_e}, visibleRange 320
  1453. drawDot count 5, particle lava, speed 0, XYZ 1, 1, 1, center {_e}, visibleRange 320
  1454. wait a tick
  1455. kill {_e2}
  1456. drawDot count 0, particle explosionhuge, speed 0.08, XYZ 0, 0, 0, center {_e}, visibleRange 320
  1457. loop living entities in radius 5 around {_e} where [entity input isn't {_p}]:
  1458. damageEffect(3, {_p}, loop-entity, {_t})
  1459. set fire to loop-entity for 5 second
  1460. push loop-entity (direction from block 1.5 under {_e} to loop-entity) at speed 1
  1461.  
  1462. on damage:
  1463. attacker is a player:
  1464. damage cause is a projectile or entity explosion:
  1465. if metadata value "FireCometSpell" of projectile is true:
  1466. cancel event
  1467.  
  1468. #---Flame Wave---#
  1469. on left click:
  1470. if line 2 of lore of player's tool is "&k&c&e":
  1471. if spellID(19, event-player, line 1 of lore of player's tool) is true:
  1472. if wandsCooldown(player, name of player's tool) is true:
  1473. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1474. flameWaveSounds(the player)
  1475. set {_t} to player's tool
  1476. set {_metaText} to "FlameWave-%player%-%now%"
  1477. loop blocks from block above the player to the block above block 30 in front of the player:
  1478. if loop-block is solid:
  1479. stop loop
  1480. set {_int} to {_int} + 1
  1481. loop living entities in radius 3 around loop-block where [input isn't player]:
  1482. if metadata value "%{_metaText}%" of loop-entity isn't set:
  1483. set metadata value "%{_metaText}%" of loop-entity to true
  1484. add loop-entity to {_loop-entities::*}
  1485. set fire to loop-entity for 7 second
  1486. damageEffect(2, player, loop-entity, {_t})
  1487. drawDot count 10, particle flame, speed 0.1, XYZ 0.8, 0.8, 0.8, center location of loop-block, visibleRange 320
  1488. drawDot count 1, particle lava, speed 0.2, XYZ 0.8, 0.8, 0.8, center location of loop-block, visibleRange 320
  1489. drawDot count 7, particle smokelarge, speed 0.1, XYZ 0.6, 0.6, 0.6, center location of loop-block, visibleRange 320
  1490. drawDot count 7, particle smoke, speed 0.05, XYZ 1, 1, 1, center location of loop-block, visibleRange 320
  1491. if {_int} > 1:
  1492. wait a tick
  1493. set {_int} to 0
  1494. loop {_loop-entities::*}:
  1495. clear metadata value "%{_metaText}%" of loop-value
  1496.  
  1497. function flameWaveSounds(p: player):
  1498. PlS("entity.blaze.shoot", 4, 1, location of {_p}, all players)
  1499. loop 8 times:
  1500. PlS("entity.enderdragon.flap", 4, 1, location of {_p}, all players)
  1501. wait 2 ticks
  1502.  
  1503. #---Fire Spark---#
  1504. on left click:
  1505. if line 2 of lore of player's tool is "&k&c&e":
  1506. if spellID(20, event-player, line 1 of lore of player's tool) is true:
  1507. if wandsCooldown(player, name of player's tool) is true:
  1508. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1509. set {_loc} to spellLocation(player)
  1510. drawDot count 10, particle smokelarge, speed 0.08, XYZ 0.3, 0.3, 0.3, center {_loc}, visibleRange 320, keepFor 3 ticks
  1511. drawDot count 10, particle smoke, speed 0.08, XYZ 0.2, 0.2, 0.2, center {_loc}, visibleRange 320, keepFor 3 ticks
  1512. drawDot count 10, particle flame, speed 0.1, XYZ 0.8, 0.8, 0.8, center {_loc}, visibleRange 320
  1513. drawDot count 10, particle lava, speed 0.2, XYZ 0.8, 0.8, 0.8, center {_loc}, visibleRange 320
  1514. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1515. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  1516. damageEffect(2.5, player, loop-entity, tool of player)
  1517. set fire to loop-entity for 5 second
  1518. wait 10 ticks
  1519. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1520.  
  1521. #---Fire Twister---#
  1522. on left click:
  1523. if line 2 of lore of player's tool is "&k&c&e":
  1524. if spellID(21, event-player, line 1 of lore of player's tool) is true:
  1525. if wandsCooldown(player, name of player's tool) is true:
  1526. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1527. set {_loc} to spellLocation(player)
  1528. PlS("entity.blaze.shoot", 3, 1, {_loc}, all players)
  1529. set {_t} to player's tool
  1530. loop living entities in radius 3 around {_loc} where [input isn't player]:
  1531. PlS("entity.bat.ambient", 2, 1, loop-entity, all players)
  1532. add loop-entity to {_effectLater::*}
  1533. loop blocks in radius 3 around {_loc}:
  1534. if y-coordinate of loop-block is y-coordinate of {_loc}:
  1535. if distance between location at loop-block and {_loc} is more than 2:
  1536. drawDot count 5, particle smokelarge, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1537. drawDot count 2, particle flame, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1538. drawDot count 2, particle lava, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1539. wait a tick
  1540. loop {_effectLater::*}:
  1541. damageEffect(2.5, player, loop-value, {_t})
  1542. set fire to loop-value for 3 second
  1543. create a fake explosion at loop-value
  1544. push loop-value upwards at speed 1
  1545.  
  1546.  
  1547.  
  1548. #---Dark Pulse---#
  1549. on left click:
  1550. if line 2 of lore of player's tool is "&k&c&e":
  1551. if spellID(22, event-player, line 1 of lore of player's tool) is true:
  1552. if wandsCooldown(player, name of player's tool) is true:
  1553. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1554. darkPulseSounds(player)
  1555. set {_t} to player's tool
  1556. loop blocks from block above the player to the block above block 30 in front of the player:
  1557. set {_loc} to location of loop-block
  1558. if loop-block is solid:
  1559. stop loop
  1560. set {_int} to {_int} + 1
  1561. loop living entities in radius 2.2 around loop-block where [input isn't player]:
  1562. exit 2 loops
  1563. drawDot count 3, particle smokelarge, speed 0, XYZ 0.4, 0.4, 0.4, center location of loop-block, visibleRange 320
  1564. drawDot count 13, particle smoke, speed 0.1, XYZ 0.8, 0.8, 0.8, center location of loop-block, visibleRange 320
  1565. if {_int} > 2:
  1566. wait a tick
  1567. set {_int} to 0
  1568. PlS("entity.wither.hurt", 4, 1, {_loc}, all players)
  1569. create a fake explosion at {_loc}
  1570. drawDot count 0, particle explosionhuge, speed 0, XYZ 0, 0, 0, center {_loc}, visibleRange 320
  1571. loop living entities in radius 3 around {_loc} where [input isn't player]:
  1572. remove slowness and blindness from loop-entity
  1573. apply blindness 1 to loop-entity for 3 second
  1574. apply slowness 2 to loop-entity for 2 second
  1575. damageEffect(3.4, player, loop-entity, {_t})
  1576. push loop-entity (direction from block 2 under {_loc} to loop-entity) at speed 0.8
  1577.  
  1578. function darkPulseSounds(p: player):
  1579. loop 8 times:
  1580. PlS("entity.enderdragon.flap", 4, 1, location of {_p}, all players)
  1581. wait 2 ticks
  1582.  
  1583. #---Dark Circle---#
  1584. on left click:
  1585. if line 2 of lore of player's tool is "&k&c&e":
  1586. if spellID(23, event-player, line 1 of lore of player's tool) is true:
  1587. if wandsCooldown(player, name of player's tool) is true:
  1588. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1589. set {_index} to 7
  1590. set {_loc} to location of block at the player
  1591. set {_t} to player's tool
  1592. loop living entities in radius 7 around {_loc} where [input isn't player]:
  1593. PlS("entity.bat.ambient", 2, 1, loop-entity, all players)
  1594. add loop-entity to {_effectLater::*}
  1595. loop {_index} times:
  1596. PlS("entity.enderdragon.flap", 4, 1, {_loc}, all players)
  1597. set {_index} to {_index} - 1
  1598. loop blocks in radius {_index} around {_loc}:
  1599. if y-coordinate of loop-block is y-coordinate of {_loc}:
  1600. if distance between location at loop-block and location of {_loc} is more than {_index} - 1:
  1601. drawDot count 6, particle smokelarge, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1602. drawDot count 8, particle enchantmenttable, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1603. wait 2 ticks
  1604. loop {_effectLater::*}:
  1605. set {_loc2} to location(loop-value's x-coordinate, player's y-coordinate, loop-value's z-coordinate, player's world)
  1606. damageEffect(3, player, loop-value, {_t})
  1607. create a fake explosion at loop-value
  1608. push loop-value (direction from {_loc} to loop-value) at speed 1
  1609. push loop-value upwards at speed 0.5
  1610.  
  1611.  
  1612. #---Dark Push---#
  1613. on left click:
  1614. if line 2 of lore of player's tool is "&k&c&e":
  1615. if spellID(24, event-player, line 1 of lore of player's tool) is true:
  1616. if wandsCooldown(player, name of player's tool) is true:
  1617. if targeted living entity is set:
  1618. if distance between location of targeted living entity and location of player is less than 30 where [targeted entity is alive]:
  1619. if metadata value "DarkPush" of targeted living entity isn't set:
  1620. set metadata value "DarkPush" of targeted living entity to true
  1621. set {_t} to player's tool
  1622. set {_e} to targeted living entity
  1623. set {wands::darkpush::%player%::%uuid of targeted entity%} to true
  1624. set {_e} to targeted entity
  1625. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1626. damageEffect(2, player, targeted entity, {_t})
  1627. PlS("entity.wither.shoot", 3, 1, {_e}, all players)
  1628. push {_e} upwards at speed 0.8
  1629. push {_e} in the horizontal direction of the player at speed 1.4
  1630. wait 2 ticks
  1631. while {_e}.isOnGround() is false:
  1632. if {_e} is dead:
  1633. stop loop
  1634. drawDot count 5, particle smokelarge, speed 0.04, XYZ 0.3, 0.3, 0.3, center {_e}, visibleRange 320
  1635. wait a tick
  1636. clear {wands::darkpush::%player%::%{_uuid}%}
  1637. clear metadata value "DarkPush" of {_e}
  1638. {_e} is alive
  1639. drawDot count 15, particle smokelarge, speed 0.08, XYZ 2, 0.2, 2, center {_e}, visibleRange 320
  1640. loop living entities in radius 3 around {_e} where [input isn't player]:
  1641. damageEffect(2, player, loop-entity, {_t})
  1642. create a fake explosion at loop-entity
  1643. loop-entity isn't {_e}
  1644. push loop-entity (direction from block 1 under {_e} to loop-entity) at speed 0.8
  1645. else:
  1646. invailidLocation(player)
  1647. else:
  1648. invailidLocation(player)
  1649.  
  1650. #---Dark Spark---#
  1651. on left click:
  1652. if line 2 of lore of player's tool is "&k&c&e":
  1653. if spellID(25, event-player, line 1 of lore of player's tool) is true:
  1654. if wandsCooldown(player, name of player's tool) is true:
  1655. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1656. set {_loc} to spellLocation(player)
  1657. drawDot count 10, particle smokelarge, speed 0.08, XYZ 0.2, 0.2, 0.2, center {_loc}, visibleRange 320, keepFor 3 ticks
  1658. drawDot count 10, particle smoke, speed 0.1, XYZ 0.6, 0.7, 0.6, center {_loc}, visibleRange 320, keepFor 5 ticks
  1659. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1660. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  1661. damageEffect(4, player, loop-entity, tool of player)
  1662. wait 10 ticks
  1663. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1664.  
  1665. #---Kaj Arrow---#
  1666. on left click:
  1667. if line 2 of lore of player's tool is "&k&c&e":
  1668. if spellID(26, event-player, line 1 of lore of player's tool) is true:
  1669. if wandsCooldown(player, name of player's tool) is true:
  1670. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1671. PlS("entity.wither.shoot", 4, 1, player, all players)
  1672. make the player shoot an arrow at speed 3
  1673. set {wands::savedtool::%uuid of last shot projectile%} to player's tool
  1674. set metadata value "KajArrow" of last shot projectile to true
  1675. KajArrow(last shot projectile)
  1676.  
  1677. function KajArrow(e: entity):
  1678. while metadata value "Hit" of {_e} isn't set:
  1679. drawDot count 20, particle cloud, speed 0.1, XYZ 0.2, 0.2, 0.2, center {_e}, visibleRange 320
  1680. drawDot count 20, particle enchantmenttable, speed 1, XYZ 0.5, 0.5, 0.5, center {_e}, visibleRange 320
  1681. wait a tick
  1682.  
  1683. on projectile hit:
  1684. if metadata value "KajArrow" of event-entity is true:
  1685. strike lightning effect at projectile
  1686. drawDot count 40, particle cloud, speed 0.3, XYZ 0.2, 0.2, 0.2, center event-entity, visibleRange 320
  1687. loop living entities in radius 5 around event-location where [input isn't shooter of projectile]:
  1688. damageEffect(3, shooter of the projectile, loop-entity, {wands::savedtool::%uuid of projectile%})
  1689. clear {wands::savedtool::%uuid of projectile%}
  1690. set fire to loop-entity for 4 seconds
  1691. set metadata value "Hit" of projectile to true
  1692. delete projectile
  1693. loop 2 times:
  1694. wait a tick
  1695. strike lightning effect at rLP(random number between 3 and -3, 0, random number between 3 and -3, event-location)
  1696.  
  1697. on damage:
  1698. damage was caused by projectile:
  1699. if metadata value "KajArrow" of projectile is true:
  1700. cancel event
  1701.  
  1702. #---Kaj Thunder---#
  1703. on left click:
  1704. if line 2 of lore of player's tool is "&k&c&e":
  1705. if spellID(27, event-player, line 1 of lore of player's tool) is true:
  1706. if wandsCooldown(player, name of player's tool) is true:
  1707. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1708. PlS("entity.wither.shoot", 4, 1, player, all players)
  1709. set {_loc} to spellLocation(player)
  1710. drawDot count 40, particle cloud, speed 0.2, XYZ 2, 2, 2, center {_loc}, visibleRange 320
  1711. create a fake explosion at {_loc}
  1712. drawDot count 0, particle explosionhuge, speed 0.08, XYZ 0, 0, 0, center {_loc}, visibleRange 320
  1713. strike lightning effect at {_loc}
  1714. loop living entities in radius 5 around {_loc} where [input isn't player]:
  1715. push loop-entity (direction from block 2 under {_loc} to loop-entity) at speed 0.8
  1716. damageEffect(3, player, loop-entity, tool of player)
  1717. set fire to loop-entity for 6 seconds
  1718. loop 2 times:
  1719. wait a tick
  1720. strike lightning effect at rLP(random number between 3 and -3, 0, random number between 3 and -3, {_loc})
  1721.  
  1722. #---Kaj Thunder Storm---#
  1723. on left click:
  1724. if line 2 of lore of player's tool is "&k&c&e":
  1725. if spellID(28, event-player, line 1 of lore of player's tool) is true:
  1726. if wandsCooldown(player, name of player's tool) is true:
  1727. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1728. set {_loc} to location of block 10 above the player
  1729. set {_ploc} to location of the player
  1730. set {_t} to player's tool
  1731. PlS("entity.wither.ambient", 4, 1, {_loc}, all players)
  1732. loop blocks in radius 14 around {_loc}:
  1733. if y-coordinate of loop-block is y-coordinate of {_loc}:
  1734. if distance between location at loop-block and {_loc} is more than 13:
  1735. drawDot count 20, particle cloud, speed 0.1, XYZ 0.2, 0.2, 0.2, center location of loop-block, visibleRange 320
  1736. set {_int} to {_int} + 1
  1737. if {_int} > 3:
  1738. wait a tick
  1739. set {_int} to 0
  1740. loop living entities in radius 15 around {_ploc} where [input isn't player]:
  1741. strike lightning effect at loop-entity
  1742. damageEffect(3, player, loop-entity, {_t})
  1743. set fire to loop-entity for 3 seconds
  1744. wait a tick
  1745.  
  1746. #---Kaj Rage---#
  1747. on left click:
  1748. if line 2 of lore of player's tool is "&k&c&e":
  1749. if spellID(29, event-player, line 1 of lore of player's tool) is true:
  1750. if wandsCooldown(player, name of player's tool) is true:
  1751. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1752. set {_loc} to location of the player
  1753. PlS("item.totem.use", 4, 1, {_loc}, all players)
  1754. set {_t} to tool of player
  1755. drawDot count 6, particle cloud, speed 0.15, XYZ 0.2, 0.2, 0.2, center rLP(0, 1, 0, location of player), visibleRange 320, keepFor 10 ticks
  1756. drawDot count 2, particle smokelarge, speed 0.1, XYZ 0.2, 0, 0.2, center rLP(0, 1, 0, location of player), visibleRange 320, keepFor 10 ticks
  1757. drawDot count 2, particle flame, speed 0.1, XYZ 0.2, 0.2, 0.2, center rLP(0, 1, 0, location of player), visibleRange 320, keepFor 10 ticks
  1758. drawDot count 2, particle smoke, speed 0.1, XYZ 0.2, 0.2, 0.2, center rLP(0, 1, 0, location of player), visibleRange 320, keepFor 10 ticks
  1759. loop living entities in radius 15 around {_loc} where [input isn't player]:
  1760. drawDot count 10, particle cloud, speed 0.15, XYZ 0.2, 0.2, 0.2, center loop-entity, visibleRange 320
  1761. drawDot count 10, particle flame, speed 0.1, XYZ 0.2, 0.2, 0.2, center loop-entity, visibleRange 320
  1762. LightningEffect(loop-entity)
  1763. damageEffect(2, player, loop-entity, {_t})
  1764. set fire to loop-entity for 3 seconds
  1765. remove wither and slowness from loop-entity
  1766. apply wither 1 without particles to loop-entity for 4 seconds
  1767. apply slowness 3 without particles to loop-entity for 4 seconds
  1768. wait a tick
  1769. function LightningEffect(entity: entity):
  1770. loop 4 times:
  1771. strike lightning effect at {_entity}
  1772. wait 3 tick
  1773.  
  1774. #---Mephi Away---#
  1775. on left click:
  1776. if line 2 of lore of player's tool is "&k&c&e":
  1777. if spellID(30, event-player, line 1 of lore of player's tool) is true:
  1778. if wandsCooldown(player, name of player's tool) is true:
  1779. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1780. set {_loc} to location of block at the player
  1781. PlS("entity.enderdragon.flap", 3, 1, {_loc}, all players)
  1782. set {_t} to tool of player
  1783. loop living entities in radius 4.5 around {_loc} where [input isn't player]:
  1784. PlS("entity.bat.ambient", 2, 1, loop-entity, all players)
  1785. add loop-entity to {_effectLater::*}
  1786. loop blocks in radius 5 around {_loc}:
  1787. if y-coordinate of loop-block is y-coordinate of {_loc}:
  1788. if distance between location at loop-block and {_loc} is more than 4:
  1789. drawDot count 2, particle smoke, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320, keepFor 10 ticks
  1790. drawDot count 3, particle smokelarge, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1791. drawDot count 2, particle happyvillager, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1792. set {_c} to {_c} + 1
  1793. if {_c} > 3:
  1794. set {_c} to 1
  1795. wait a tick
  1796. loop {_effectLater::*}:
  1797. damageEffect(3, player, loop-value, {_t})
  1798. create a fake explosion at loop-value
  1799. delete velocity of loop-value
  1800. push loop-value (direction from {_loc} to loop-value) at speed 2
  1801. push loop-value upwards at speed 0.8
  1802.  
  1803. #---Mephi Circle---#
  1804. on left click:
  1805. if line 2 of lore of player's tool is "&k&c&e":
  1806. if spellID(31, event-player, line 1 of lore of player's tool) is true:
  1807. if wandsCooldown(player, name of player's tool) is true:
  1808. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1809. set {_loc} to location of block above block at the player
  1810. set {_t} to player's tool
  1811. PlS("entity.illusion_illager.prepare_blindness", 3, 1, {_loc}, all players)
  1812. loop living entities in radius 13.5 around {_loc} where [input isn't player]:
  1813. PlS("entity.bat.ambient", 2, 1, loop-entity, all players)
  1814. add loop-entity to {_effectLater::*}
  1815. loop blocks in radius 13 around {_loc}:
  1816. if y-coordinate of loop-block is y-coordinate of {_loc}:
  1817. if distance between location at loop-block and {_loc} is more than 12:
  1818. drawDot count 2, particle smoke, speed 0.08, XYZ 0.3, 0.6, 0.3, center location of loop-block, visibleRange 320, keepFor 10 ticks
  1819. drawDot count 5, particle smokelarge, speed 0.08, XYZ 0.3, 1, 0.3, center location of loop-block, visibleRange 320
  1820. drawDot count 4, particle happyvillager, speed 0.08, XYZ 0.5, 0.5, 0.5, center location of loop-block, visibleRange 320
  1821. set {_c} to {_c} + 1
  1822. if {_c} > 3:
  1823. set {_c} to 1
  1824. wait a tick
  1825. loop {_effectLater::*}:
  1826. damageEffect(2, player, loop-value, {_t})
  1827. push loop-value upwards at speed 0.6
  1828. apply blindness 1 to loop-value for 3 second
  1829. apply slowness 2 to loop-value for 2 second
  1830. drawDot count 5, particle smokelarge, speed 0.08, XYZ 0.3, 0.3, 0.3, center loop-value, visibleRange 320
  1831.  
  1832. #---Mephi Grab Wave---#
  1833. on left click:
  1834. if line 2 of lore of player's tool is "&k&c&e":
  1835. if spellID(32, event-player, line 1 of lore of player's tool) is true:
  1836. if wandsCooldown(player, name of player's tool) is true:
  1837. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1838. set {_t} to player's tool
  1839. PlS("entity.evocation_illager.cast_spell", 4, 1, player, all players)
  1840. loop blocks from block above the player to the block above block 30 in front of the player:
  1841. set {_loc} to location of loop-block
  1842. loop living entities in radius 2.2 around loop-block where [input isn't player]:
  1843. exit 2 loops
  1844. if loop-block is solid:
  1845. stop loop
  1846. set {_int} to {_int} + 1
  1847. loop living entities in radius 1.5 around loop-block where [entity input isn't player]:
  1848. exit 2 loops
  1849. drawDot count 4, particle happyvillager, speed 0.1, XYZ 0.4, 0.4, 0.4, center location of loop-block, visibleRange 320
  1850. drawDot count 4, particle smokelarge, speed 0.1, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1851. drawDot count 4, particle smoke, speed 0.05, XYZ 1, 1, 1, center location of loop-block, visibleRange 320
  1852. if {_int} > 2:
  1853. wait a tick
  1854. set {_int} to 0
  1855. drawDot count 6, particle happyvillager, speed 0.4, XYZ 3, 3, 3, center {_loc}, visibleRange 320
  1856. drawDot count 6, particle smokelarge, speed 0.2, XYZ 0.3, 0.3, 0.3, center {_loc}, visibleRange 320
  1857. PlS("entity.illusion_illager.mirror_move", 4, 1, {_loc}, all players)
  1858. loop living entities in radius 3 around {_loc} where [input isn't player]:
  1859. remove slowness from loop-entity
  1860. apply slowness 2 to loop-entity for 3 second
  1861. damageEffect(3, player, loop-entity, {_t})
  1862. set {_loc2} to location of player
  1863. set y coordinate of {_loc2} to y coordinate of loop-entity
  1864. push loop-entity (direction from loop-entity to {_loc2}) at speed 1.8
  1865. push loop-entity (direction from loop-entity to player) at speed 1
  1866. push loop-entity upwards at speed 0.3
  1867. stop
  1868.  
  1869. #---Mephi Spark---#
  1870. on left click:
  1871. if line 2 of lore of player's tool is "&k&c&e":
  1872. if spellID(33, event-player, line 1 of lore of player's tool) is true:
  1873. if wandsCooldown(player, name of player's tool) is true:
  1874. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1875. set {_loc} to spellLocation(player)
  1876. drawDot count 3, particle smokelarge, speed 0.04, XYZ 0.4, 0.4, 0.4, center {_loc}, visibleRange 320, keepFor 3 ticks
  1877. drawDot count 5, particle happyvillager, speed 0.08, XYZ 0.7, 0.7, 0.7, center {_loc}, visibleRange 320, keepFor 3 ticks
  1878. drawDot count 5, particle smoke, speed 0.05, XYZ 0.6, 0.6, 0.6, center {_loc}, visibleRange 320, keepFor 5 ticks
  1879. PlS("entity.firework.blast", 4, 1, {_loc}, all players)
  1880. loop living entities in radius 3.2 around {_loc} where [input isn't player]:
  1881. damageEffect(4, player, loop-entity, tool of player)
  1882. wait 10 ticks
  1883. PlS("entity.firework.twinkle", 4, 1, {_loc}, all players)
  1884.  
  1885. #---Mephi Stun---#
  1886. on left click:
  1887. if line 2 of lore of player's tool is "&k&c&e":
  1888. if spellID(34, event-player, line 1 of lore of player's tool) is true:
  1889. if wandsCooldown(player, name of player's tool) is true:
  1890. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1891. set {_t} to player's tool
  1892. PlS("entity.firework.blast", 4, 1, player, all players)
  1893. loop blocks from block above the player to the block above block 30 in front of the player:
  1894. set {_loc} to location of loop-block
  1895. if loop-block is solid:
  1896. stop loop
  1897. set {_int} to {_int} + 1
  1898. loop living entities in radius 2.2 around loop-block where [input isn't player]:
  1899. exit 2 loops
  1900. drawDot count 2, particle smokelarge, speed 0.04, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1901. drawDot count 5, particle happyvillager, speed 0.08, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1902. drawDot count 3, particle smoke, speed 0.05, XYZ 0.5, 0.5, 0.5, center location of loop-block, visibleRange 320
  1903. if {_int} > 2:
  1904. wait a tick
  1905. set {_int} to 0
  1906. PlS("block.anvil.land", 4, 1, {_loc}, all players)
  1907. loop living entities in radius 3 around {_loc} where [input isn't player]:
  1908. remove slowness from loop-entity
  1909. apply slowness 3 to loop-entity for 10 second
  1910. damageEffect(2.5, player, loop-entity, {_t})
  1911.  
  1912. #---Flame Thrower---#
  1913. on left click:
  1914. if line 2 of lore of player's tool is "&k&c&e":
  1915. if spellID(35, event-player, line 1 of lore of player's tool) is true:
  1916. if wandsCooldown(player, name of player's tool) is true:
  1917. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1918. loop 8 times:
  1919. PlS("entity.blaze.shoot", 4, 1, location of player, all players)
  1920. spawn undroppable falling block of fire at player's eyes
  1921. push last spawned entity in direction of the player at speed 2
  1922. set metadata value "FlameThrower" of last spawned entity to true
  1923. flameThrowerTrail(last spawned entity, player)
  1924. wait 3 ticks
  1925.  
  1926. on block land:
  1927. if metadata value "FlameThrower" of entity is true:
  1928. cancel event
  1929.  
  1930. function flameThrowerTrail(e: entity, p: player):
  1931. spawn armor stand at {_e}
  1932. set {_e2} to last spawned entity
  1933. {_e2}.setVisible(false)
  1934. {_e2}.setMarker(true)
  1935. make {_e2} ride {_e}
  1936. while {_e2} is riding {_e}:
  1937. drawDot count 2, particle flame, speed 0.1, XYZ 0.8, 0.8, 0.8, center {_e}, visibleRange 320
  1938. drawDot count 1, particle smokelarge, speed 0.1, XYZ 0.3, 0.3, 0.3, center {_e}, visibleRange 320
  1939. set fire to living entities in radius 3 around {_e} where [entity input != {_p}] for 5 seconds
  1940. wait a tick
  1941. kill {_e2}
  1942.  
  1943. #---Fire Shoke Wave---#
  1944. on left click:
  1945. if line 2 of lore of player's tool is "&k&c&e":
  1946. if spellID(36, event-player, line 1 of lore of player's tool) is true:
  1947. if wandsCooldown(player, name of player's tool) is true:
  1948. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1949. set fire to living entities in radius 14 around player where [entity input != player] for 6 seconds
  1950. PlS("entity.blaze.shoot", 1, 1, location of player, all players)
  1951. set {_loc} to the block above player
  1952. loop 10 times:
  1953. wait 2 tick
  1954. loop blocks in radius loop-number around the block at {_loc}:
  1955. if y-coordinate of loop-block is y-coordinate of {_loc}:
  1956. if distance between location at loop-block and {_loc} is more than loop-number - 1:
  1957. drawDot count 1, particle lava, speed 0, XYZ 1, 1, 1, center location of loop-block, visibleRange 320
  1958. drawDot count 1, particle flame, speed 0.1, XYZ 1, 1, 1, center location of loop-block, visibleRange 320
  1959.  
  1960. #---Kaj Freeze---#
  1961. on left click:
  1962. if line 2 of lore of player's tool is "&k&c&e":
  1963. if spellID(37, event-player, line 1 of lore of player's tool) is true:
  1964. if wandsCooldown(player, name of player's tool) is true:
  1965. set {wands::tool::%name of player's tool%::lastuse::%player%} to now
  1966. set {_t} to player's tool
  1967. set {_e} to player #this should prevent type warns
  1968. PlS("entity.llama.swag", 4, 1, player, all players)
  1969. loop blocks from block above the player to the block above block 30 in front of the player:
  1970. add 1 to {_i}
  1971. set {_loc} to location of loop-block
  1972. loop living entities in radius 2.2 around loop-block where [entity input isn't player]:
  1973. exit 2 loops
  1974. if loop-block is solid:
  1975. stop loop
  1976. drawDot count 8, particle cloud, speed 0.02, XYZ 0.1, 0.1, 0.1, center location of loop-block, visibleRange 320
  1977. drawDot count 10, particle enchantmenttable, speed 0.1, XYZ 0.3, 0.3, 0.3, center location of loop-block, visibleRange 320
  1978. if mod({_i}, 2) = 0:
  1979. wait 1 tick
  1980. loop living entities in radius 2.2 around {_loc} where [entity input isn't player]:
  1981. remove slowness from loop-entity
  1982. apply slowness 4 to loop-entity for 6 seconds
  1983. damageEffect(3, player, loop-entity, {_t})
  1984. loop 60 times:
  1985. if loop-entity isn't alive:
  1986. stop loop
  1987. drawDot count 6, particle snowshovel, speed 0.01, XYZ 0.5, 0.5, 0.5, center location of block 3 above loop-entity, visibleRange 320
  1988. drawDot count 6, particle cloud, speed 0, XYZ 0.4, 0.3, 0.4, center location of block 4 above loop-entity, visibleRange 320
  1989. wait 2 ticks
  1990. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement