Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import:
- com.nisovin.magicspells.MagicSpells
- com.nisovin.magicspells.Spell
- com.nisovin.magicspells.mana.ManaChangeReason
- com.nisovin.magicspells.mana.ManaHandler
- com.nisovin.magicspells.mana.ManaSystem
- function setMaxMana(user: player, quantity: text) :: boolean:
- set {_handler} to MagicSpells.getManaHandler()
- set {_quantity} to {_quantity} parsed as integer
- {_handler}.setMaxMana({_user}, {_quantity})
- #{_handler}.addMana({_user}, {_quantity}, ManaChangeReason.OTHER)
- return true
- function addMana(user: player, quantity: text) :: boolean:
- set {_handler} to MagicSpells.getManaHandler()
- set {_quantity} to {_quantity} parsed as integer
- set {_changed} to {_handler}.addMana({_user}, {_quantity}, ManaChangeReason.OTHER)
- if {_changed} is true:
- return true
- else:
- return false
- on quit:
- set {PlayerConectado.%player%} to false
- on join:
- set {PlayerConectado.%player%} to true
- wait 10 seconds
- set {_x} to {chakra::%player%} + {vigor::%player%}
- if {Sancionado::%player%} is true:
- set {_sancion} to {NChakra::%player%} * 5
- subtract {_sancion} from {_x}
- wait 7 seconds
- setMaxMana(player, "%{_x}%")
- set {cdrchakra::%player%} to 60 - ({con::%player%} * 2)
- while {PlayerConectado.%player%} is true:
- if {cdrchakra::%player%} is greater than 0:
- wait 1 second
- subtract 1 from {cdrchakra::%player%}
- if {cdrchakra::%player%} is 1:
- addMana(player, "1")
- set {cdrchakra::%player%} to 60 - ({con::%player%} * 2)
- send action bar "&a+1 &fde &9Chakra" to player
- command /Chakra [<text>] [<offline player>] [<number>]:
- permission: Staff
- trigger:
- if arg 1 is "adjust":
- set {_x} to {chakra::%player%} + {vigor::%player%}
- setMaxMana(player, "%{_x}%")
- if arg 1 is "set":
- #setMaxMana(player, 35)
- set {chakra::%arg-2%} to arg-3
- setMaxMana(arg-2, "%{chakra::%arg-2%}%")
- set {_query3} to "UPDATE usuarios SET chakra = ""%{chakra::%arg-2%}%"" WHERE uuid = ""%arg-2's uuid%"""
- execute unsafe {_query3} in {-sql}
- send "&7[&bSistema&7] &fEl chakra de &b%arg-2% &fahora es &d%arg-2%" to player
- send "&7[&bSistema&7] &fTu chakra ahora es&d %arg-3%" to arg-2
- if arg 1 is "add":
- add arg-3 to {chakra::%arg-2%}
- setMaxMana(arg-2, "%{chakra::%arg-2%}%")
- set {_query3} to "UPDATE usuarios SET chakra = ""%{chakra::%arg-2%}%"" WHERE uuid = ""%arg-2's uuid%"""
- execute unsafe {_query3} in {-sql}
- send "&7[&bSistema&7] &fEl chakra de &b%arg-2% &fahora es &d%arg-2%" to player
- send "&7[&bSistema&7] &fTu chakra ahora es&d %arg-3%" to arg-2
- if arg 1 is "Remove":
- subtract arg-3 from {chakra::%arg-2%}
- setMaxMana(arg-2, "%{chakra::%arg-2%}%")
- set {_query3} to "UPDATE usuarios SET chakra = ""%{chakra::%arg-2%}%"" WHERE uuid = ""%arg-2's uuid%"""
- execute unsafe {_query3} in {-sql}
- send "&7[&bSistema&7] &fEl chakra de &b%arg-2% &fahora es &d%arg-2%" to player
- send "&7[&bSistema&7] &fTu chakra ahora es&d %arg-3%" to arg-2
- if arg 1 is "ver":
- set {_f} to MagicSpells.getManaHandler().getMaxMana(arg-2)
- send "&9Chakra Maximo de &d%arg-2%: &f%{_f}%" to player
- function getMaxMana(user: player) :: number:
- set {_handler} to MagicSpells.getManaHandler()
- return {_handler}.getMaxMana({_user})
- function setCooldown(p: player, spell: string, cooldown: integer):
- MagicSpells.getSpellByInternalName({_spell}).setCooldown({_p}, {_cooldown})
- #
- on region enter:
- if "%event-region%" contains "Spawn":
- set {nopotions.%player%} to true
- send "&a¡Entrando en una Zona Segura!"
- make player run command "/nopotions" as op
- command /nopotions:
- permission: Staff
- trigger:
- while {nopotions.%player%} is true:
- remove Blindness from the player
- remove Slowness from the player
- wait 10 seconds
- on region leave:
- if "%event-region%" contains "Spawn":
- set {nopotions.%player%} to false
- send "&c¡Saliendo de una Zona Segura!"
- function cd(p: player, spell: string,):
- MagicSpells.getSpellByInternalName({_spell}).onCooldown({_p}) is true:
- set {_x} to MagicSpells.getSpellByInternalName({_spell}).getCooldown({_p})
- send "&cHabilidad en Enfriamiento &7(&b%{_x}% s&7)" to {_p}
- else:
- send "&aHabilidad &7(%{_spell}%) &aDisponible" to {_p}
- command /cd [<text>]:
- trigger:
- if arg 1 isn't set:
- send "&fColoca el nombre de un Cast para ver si esta en CD o No"
- else:
- cd(player, "%arg-1%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement