Files
maces.sk
Code
1 164
maces.sk
Place this file in plugins/Skript/scripts/
# Requires Skript and an addon supporting custom model data, vectors, and dust particles.
# Reload with: /sk reload maces
options:
prefix: &6[Maces]&r
on load:
set {mace::item::weaving} to mace named "&fWeaving Mace" with lore "&4Passive" and "&7- &cNo Passive" and " " and "&f&lPowers:" and "&7- &f&lRemoves All Webs In Radius(5)" with custom model data 1
set {mace::item::melee} to mace named "&4&lMelee Mace" with lore "&4Passive" and "&7- &cStrength 1" and "&7- &c1.5x Damage" and " " and "&f&lPowers:" and "&4No Powers" with custom model data 2
set {mace::item::wings} to mace named "&f&lWingsMace" with lore "&4Passive" and "&cNo Passive" and " " and "&f&lPowers:" and "&7- &fFlight" with custom model data 3
send "{@prefix} &aLoaded successfully!" to console
command /mace <text>:
permission: op
executable by: players
trigger:# Mace abilities script
#
if arg-1 is "Weaving":
give 1 of {mace::item::weaving} to player
else if arg-1 is "Melee":
give 1 of {mace::item::melee} to player
else if arg-1 is "Wings":
give 1 of {mace::item::wings} to player
else:
send "{@prefix} &cUsage: /mace <Weaving|Melee|Wings>" to player
command /cooldown [<player>]:
permission: op
trigger:
if arg-1 is set:
resetMaceCooldowns(arg-1)
send "{@prefix} &aCooldowns reset for &e%arg-1%&a." to sender
else:
if sender is console:
send "{@prefix} &cUsage: /cooldown [player]" to sender
stop
resetMaceCooldowns(player)
send "{@prefix} &aYour mace cooldowns have been reset." to player
on tab complete for "/cooldown":
set tab completions for position 1 to all players
on tab complete for "/mace":
set tab completions for position 1 to "Weaving" and "Melee" and "Wings"
every 1 second:
loop all players:
updateMaceCooldowns(loop-player)
showMaceActionbar(loop-player)
every 1 tick:
loop all players:
if {mace::flying::%loop-player's uuid%} is set:
if block below loop-player is air:
set gliding of loop-player to true
draw 2 of cloud at loop-player with extra 0
else:
set gliding of loop-player to false
set {mace::cooldown::wings::%loop-player's uuid%} to 45
delete {mace::flying::%loop-player's uuid%}
on join:
initializeMaceCooldowns(player)
on quit:
delete {mace::flying::%player's uuid%}
on damage:
if attacker is a player:
if maceType(attacker's held item) is "melee":
set damage to damage * 1.5
on right click:
if isMace(player's held item) is true:
initializeMaceCooldowns(player)
if maceType(player's held item) is "weaving":
if {mace::cooldown::weaving::%player's uuid%} is not "&aReady!":
send "&cYour weaving mace is on cooldown for %{mace::cooldown::weaving::%player's uuid%}% seconds." to player
else:
set {mace::cooldown::weaving::%player's uuid%} to 45
loop all blocks in radius 5 around player:
if loop-block is cobweb:
set {_location} to location of loop-block
set block at loop-block to air
weavingParticles(0.5, {_location})
else if maceType(player's held item) is "wings":
if {mace::cooldown::wings::%player's uuid%} is not "&aReady!":
send "&cYour wings mace is on cooldown for %{mace::cooldown::wings::%player's uuid%}% seconds." to player
else:
set {mace::flying::%player's uuid%} to true
set {mace::cooldown::wings::%player's uuid%} to "&cActive.."
push player up at speed 2.5
push player forward at speed 1
function isMace(i: item) :: boolean:
if {_i} is air:
return false
if lore of {_i} contains "&7- &f&lRemoves All Webs In Radius(5)":
return true
if lore of {_i} contains "&7- &cStrength 1":
return true
if lore of {_i} contains "&7- &f Flight":
return true
return false
function maceType(i: item) :: string:
if {_i} is air:
return "none"
if name of {_i} contains "&fWeaving Mace":
return "weaving"
if name of {_i} contains "&4&lMelee Mace":
return "melee"
if name of {_i} contains "&f&lWingsMace":
return "wings"
return "none"
function initializeMaceCooldowns(p: player):
if {mace::cooldown::weaving::%{_p}'s uuid%} is not set:
set {mace::cooldown::weaving::%{_p}'s uuid%} to "&aReady!"
if {mace::cooldown::wings::%{_p}'s uuid%} is not set:
set {mace::cooldown::wings::%{_p}'s uuid%} to "&aReady!"
function resetMaceCooldowns(p: player):
set {mace::cooldown::weaving::%{_p}'s uuid%} to "&aReady!"
set {mace::cooldown::wings::%{_p}'s uuid%} to "&aReady!"
function updateMaceCooldowns(p: player):
initializeMaceCooldowns({_p})
set {_weavingCooldown} to {mace::cooldown::weaving::%{_p}'s uuid%}
if {_weavingCooldown} is a number:
remove 1 from {mace::cooldown::weaving::%{_p}'s uuid%}
if {mace::cooldown::weaving::%{_p}'s uuid%} is less than or equal to 0:
set {mace::cooldown::weaving::%{_p}'s uuid%} to "&aReady!"
set {_wingsCooldown} to {mace::cooldown::wings::%{_p}'s uuid%}
if {_wingsCooldown} is a number:
remove 1 from {mace::cooldown::wings::%{_p}'s uuid%}
if {mace::cooldown::wings::%{_p}'s uuid%} is less than or equal to 0:
set {mace::cooldown::wings::%{_p}'s uuid%} to "&aReady!"
function showMaceActionbar(p: player):
if isMace({_p}'s held item) is true:
if maceType({_p}'s held item) is "weaving":
send action bar "&7--- &bᴡᴇᴀᴠɪɴɢ &f| %{mace::cooldown::weaving::%{_p}'s uuid%}% &7---" to {_p}
else if maceType({_p}'s held item) is "wings":
send action bar "&7--- &bᴡɪɴɢꜱ &f| %{mace::cooldown::wings::%{_p}'s uuid%}% &7---" to {_p}
function weavingParticles(s: number, p: location):
set {_spacing} to 0.1
set {_circumference} to 2 * pi * {_s}
set {_particleCount} to floor({_circumference} / {_spacing})
loop {_particleCount} times:
set {_angle} to loop-value * 360 / {_particleCount}
set {_vector} to spherical vector with radius {_s}, yaw {_angle} and pitch 0
make 1 of dust using dustOption(rgb(241, 210, 227), 2) at {_p} ~ {_vector}