# - nom des sorts (si tu changes le nom, faut aussi le changer de le on rightclick (sans couleur), et durée des cooldowns
options:
cooldownTime: 60, 90, 135, 120, 240, 300
nameSorts: &5Sort de &lSOIN, &4Degat, &1Vitesse, &2Lenteur, &3Coeur bonus, &aPrison
# - Give baguette
command /givesort:
permission: blabla
trigger:
give 1 blaze rod named "&5Baguette" with lore "&6Sort actif:" and "&5Sort de &lSOIN" to the player
# - Utilisation de la baguette
on rightclick with blaze rod:
if name of player's tool is "&5Baguette":
set {_time} to "{@cooldownTime}"
set {_time::*} to {_time} split at ", "
set {_sort} to "{@nameSorts}"
set {_sort::*} to {_sort} split at ", "
loop {_sort::*}:
if uncolored loop-value is uncolored line 2 of lore of player's tool:
set {_cooldown} to "%{_time::%loop-index%}% seconds" parsed as timespan
set {_waited} to difference between {cooldown::%uncolored line 2 of lore of player's tool%::%player%} and now
if {_waited} < {_cooldown}:
message "&cVous devez attendre avant de réutiliser ce sort: &6%uncolored line 2 of lore of player's tool%"
stop
# - Sort soin
if uncolored line 2 of lore of player's tool is "Sort de SOIN":
heal player by 4 hearts
message "&aVous avez été heal" to the player
# - Sort degat
if uncolored line 2 of lore of player's tool is "Degat":
loop all players in radius 10 around the player:
if loop-player is targeted entity:
damage targeted entity by 6 hearts
message "&aLa cible a été touché ! (Degat)" to the player
stop
message "&cVous avez loupé votre cible ! (Degat)" to the player
# - Sort vitesse
if uncolored line 2 of lore of player's tool is "Vitesse":
apply speed 2 to player for 30 seconds
message "&aVous avez reçu un boost de vitesse" to the player
# - Sort lenteur
if uncolored line 2 of lore of player's tool is "Lenteur":
loop all players in radius 10 around the player:
if loop-player is targeted entity:
apply slowness 1 to targeted entity for 5 seconds
message "&aLa cible a été touché ! (Lenteur)" to the player
stop
message "&cVous avez loupé votre cible ! (Lenteur)" to the player
# - Sort coeur bonus
if uncolored line 2 of lore of player's tool is "Coeur bonus":
apply absorption 10 to player for 90 seconds
message "&aVous avez reçu un boost de vie" to the player
# - Sort prison
if uncolored line 2 of lore of player's tool is "Prison":
loop all players in radius 10 around the player:
if loop-player is targeted entity:
set {_p} to targeted player's location
set {_pos1} to location at x-coord of {_p} + 1, y-coord of {_p}, z-coord of {_p} + 1
set {_pos2} to location at x-coord of {_p} - 1, y-coord of {_p}, z-coord of {_p} - 1
loop blocks within {_pos1} to {_pos2}:
if block at loop-block's location is air:
add loop-block's location to {_location::*}
set block at loop-block's location to stone slab
set {_pos1} to location at x-coord of {_p} + 1, y-coord of {_p} +2, z-coord of {_p} + 1
set {_pos2} to location at x-coord of {_p} - 1, y-coord of {_p} +2, z-coord of {_p} - 1
loop blocks within {_pos1} to {_pos2}:
if block at loop-block's location is air:
add loop-block's location to {_location::*}
set block at loop-block's location to stone slab
set block at {_p} to air
message "&aLa cible a été touché ! (Prison)" to the player
set {_decompte} to 0
while {_decompte} < 5:
add 1 to {_decompte}
wait 1 second
loop {_location::*}:
set block at {_location::%loop-index%} to air
stop
message "&cVous avez loupé votre cible ! (Prison)" to the player
set {cooldown::%uncolored line 2 of lore of player's tool%::%player%} to now
# - Changement de sort
on leftclick with blaze rod:
if name of player's tool is "&5Baguette":
set {_sort} to "{@nameSorts}"
set {_sort::*} to {_sort} split at ", "
loop {_sort::*}:
if uncolored loop-value is uncolored line 2 of lore of player's tool:
set {_nb} to loop-index parsed as number +1
if loop-index parsed as number = 6:
set {_nb} to 1
set line 2 of lore of player's tool to "&1%{_sort::%{_nb}%}%"
message "&6Le sort %{_sort::%{_nb}%}% &6est actif" to the player
stop