Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Modified Kings
- # {Kings.IsKing::%player%} - team id/not set
- # {Kings.KingOfTeam::%team%} - name of player
- # {Kings.Schedule.GiveEffect::%player%} - true/not set
- # {Kings.Schedule.RemoveEffect::%player%} - true/not set
- # {Kings.Schedule.Death::%player%} - true/not set
- # /modkings set [team num] [person in team]
- # /modkings random
- # /modkings change [team num] [person in team]
- # /modkings list
- # /modkings delete
- # /modkings reapply
- options:
- P: &f[&bModifiedKings&f]&b
- command /modkings [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 is not set:
- message "/modkings set [team num] [person in team]"
- message "/modkings random"
- message "/modkings change [team num] [person in team]"
- message "/modkings list"
- message "/modkings delete"
- message "/modkings reapply"
- else if arg 1 is equal to "list":
- if {Kings.KingOfTeam::*} is not set:
- message "{@P} No Kings defined."
- else:
- loop {Kings.KingOfTeam::*}:
- message "&bKing of Team &f%loop-index%: &f&l%loop-value%"
- else if arg 1 is equal to "set":
- if command sender does not have the permission "kings.set":
- message "{@P} You do not have the permission to do this."
- else if arg 2 is not set:
- message "{@P} /modkings set [team num] [person in team]"
- else if arg 3 is not set:
- message "{@P} /modkings set [team num] [person in team]"
- else:
- set {_Team} to ("%arg 2%" parsed as integer)
- set {_te} to ("%arg-3%" parsed as offlineplayer)
- set {_Test1} to ("%arg-3%" parsed as integer)
- if {_Test1} is set:
- set {_TN} to ("%arg-3%" parsed as integer)
- else if {Teams.InTeam::%{_te}%} is set:
- set {_TN} to {Teams.InTeam::%{_te}%}
- if {_Team} is not set:
- message "{@P} Invalid Team!"
- if {_TN} is not set:
- message "{@P} Player is not on a team"
- else if {Kings.KingOfTeam::%{_Team}%} is set:
- message "{@P} Team already has a King!"
- else if {_TN} is not equal to {_Team}:
- message "{@P} %arg 3% is not in Team %arg 2%!"
- else:
- set {_NewKing} to arg 3
- set {_NewKing.Player} to ("%arg 3%" parsed as offlineplayer)
- if {_NewKing.Player} is online:
- set maximum health of {_NewKing.Player} to 20
- set health of {_NewKing.Player} to 20
- apply slowness 1 to {_NewKing.Player} for 999 days
- apply strength 1 to {_NewKing.Player} for 999 days
- apply resistance 1 to {_NewKing.Player} for 999 days
- apply haste 1 to {_NewKing.Player} for 999 days
- else:
- set {Kings.Schedule.GiveEffect::%{_NewKing}%} to true
- set {Kings.IsKing::%{_NewKing}%} to {_Team}
- set {Kings.KingOfTeam::%{_Team}%} to {_NewKing}
- broadcast "{@P} &f%command sender% &bKing of Team &f%arg 2% &bis now &f%arg 3%"
- else if arg 1 is equal to "random":
- if command sender does not have the permission "kings.set":
- message "{@P} You do not have permission to do this."
- else:
- # remove effects from previous kings
- loop {Kings.KingOfTeam::*}:
- set {_KingPlayer} to ("%loop-value%" parsed as offlineplayer)
- if {_KingPlayer} is online:
- set maximum health of {_KingPlayer} to 10
- set health of {_KingPlayer} to 10
- remove slowness from {_KingPlayer}
- remove strength from {_KingPlayer}
- remove resistance from {_KingPlayer}
- remove haste from {_KingPlayer}
- else:
- set {Kings.Schedule.RemoveEffect::%loop-value%} to true
- delete {Kings.IsKing::*}
- delete {Kings.KingOfTeam::*}
- # set new kings
- broadcast "{@P} &f%command sender%: &bSetting Kings!"
- loop {Teams::*}:
- set {_King} to (random element out of {Team.%loop-value%::*})
- broadcast "{@P} &bKing of Team &f%loop-value%: &f&l%{_King}%&f!"
- set {Kings.IsKing::%{_King}%} to loop-value
- set {Kings.KingOfTeam::%loop-value%} to {_King}
- set {_KingPlayer} to ("%{_King}%" parsed as offlineplayer)
- if {_KingPlayer} is online:
- set maximum health of {_KingPlayer} to 20
- set health of {_KingPlayer} to 20
- apply slowness 1 to {_KingPlayer} for 999 days
- apply strength 1 to {_KingPlayer} for 999 days
- apply resistance 1 to {_KingPlayer} for 999 days
- apply haste 1 to {_KingPlayer} for 999 days
- else:
- set {Kings.Schedule.GiveEffect::%{_King}%} to true
- else if arg 1 is equal to "change":
- if command sender does not have the permission "kings.change":
- message "{@P} You do not have permission to do this."
- else if arg 2 is not set:
- message "{@P} /modkings change [team num] [person in team]"
- else if arg 3 is not set:
- message "{@P} /modkings change [team num] [person in team]"
- else:
- set {_Team} to ("%arg 2%" parsed as integer)
- set {_te} to ("%arg-3%" parsed as offlineplayer)
- set {_Test1} to ("%arg-3%" parsed as integer)
- if {_Test1} is set:
- set {_TN} to ("%arg-3%" parsed as integer)
- else if {Teams.InTeam::%{_te}%} is set:
- set {_TN} to {Teams.InTeam::%{_te}%}
- if {_Team} is not set:
- message "{@P} Invalid Team!"
- else if {Kings.KingOfTeam::%{_Team}%} is not set:
- message "{@P} Team does not have a King!"
- else if {_TN} is not equal to {_Team}:
- message "{@P} %arg 3% is not in Team %arg 2%!"
- else:
- set {_PreviousKing} to {Kings.KingOfTeam::%{_Team}%}
- set {_PreviousKing.Player} to ("%{_PreviousKing}%" parsed as offlineplayer)
- if {_PreviousKing.Player} is online:
- set maximum health of {_PreviousKing.Player} to 10
- set health of {_PreviousKing.Player} to 10
- remove slowness from {_PreviousKing.Player}
- remove strength from {_PreviousKing.Player}
- remove resistance from {_PreviousKing.Player}
- remove haste from {_PreviousKing.Player}
- else:
- set {Kings.Schedule.RemoveEffect::%{_PreviousKing}%} to true
- delete {Kings.IsKing::%{_PreviousKing}%}
- set {_NewKing} to arg 3
- set {_NewKing.Player} to ("%arg 3%" parsed as offlineplayer)
- if {_NewKing.Player} is online:
- set maximum health of {_NewKing.Player} to 20
- set health of {_NewKing.Player} to 20
- apply slowness 1 to {_NewKing.Player} for 999 days
- apply strength 1 to {_NewKing.Player} for 999 days
- apply resistance 1 to {_NewKing.Player} for 999 days
- apply haste 1 to {_NewKing.Player} for 999 days
- else:
- set {Kings.Schedule.GiveEffect::%{_NewKing}%} to true
- set {Kings.IsKing::%{_NewKing}%} to {_Team}
- set {Kings.KingOfTeam::%{_Team}%} to {_NewKing}
- broadcast "{@P} &f%command sender% &bchanged King of Team &f%arg 2% &bto &f%arg 3%"
- else if arg 1 is equal to "delete" or "off" or "reset":
- if command sender does not have the permission "kings.delete":
- message "{@P} You do not have permission to do this."
- else:
- loop {Kings.KingOfTeam::*}:
- set {_ThisKing} to ("%loop-value%" parsed as offlineplayer)
- if {_ThisKing} is online:
- set maximum health of {_ThisKing} to 10
- set health of {_ThisKing} to 10
- remove slowness from {_ThisKing}
- remove strength from {_ThisKing}
- remove resistance from {_ThisKing}
- remove haste from {_ThisKing}
- else:
- set {Kings.Schedule.RemoveEffect::%loop-value%} to true
- delete {Kings.IsKing::*}
- delete {Kings.KingOfTeam::*}
- broadcast "&f[&bModified Kings] &bModified Kings &fDisabled"
- else if arg 1 is equal to "reapply":
- if command sender does not have the permission "kings.reapply":
- message "{@P} You do not have permission to do this."
- else:
- loop {Kings.KingOfTeam::*}:
- set {_ThisKing} to ("%loop-value%" parsed as offlineplayer)
- if {_ThisKing} is online:
- set maximum health of {_ThisKing} to 20
- set health of {_ThisKing} to 20
- apply slowness 1 to {_ThisKing} for 999 days
- apply strength 1 to {_ThisKing} for 999 days
- apply resistance 1 to {_ThisKing} for 999 days
- apply haste 1 to {_ThisKing} for 999 days
- else:
- set {Kings.Schedule.GiveEffect::%loop-value%} to true
- broadcast "{@P} &e%command sender% &rreapplied King effects"
- else:
- message "/modkings set [team num] [person in team]"
- message "/modkings random"
- message "/modkings change [team num] [person in team]"
- message "/modkings list"
- message "/modkings delete"
- message "/modkings reapply"
- on join:
- wait 1 tick
- if {Kings.Schedule.RemoveEffect::%player%} is true:
- delete {Kings.Schedule.RemoveEffect::%player%}
- set maximum health of player to 10
- set health of player to 10
- remove slowness from player
- remove strength from player
- remove resistance from player
- remove haste from player
- if {Kings.Schedule.GiveEffect::%player%} is true:
- delete {Kings.Schedule.GiveEffect::%player%}
- set maximum health of player to 20
- set health of player to 20
- apply slowness 1 to player for 999 days
- apply strength 1 to player for 999 days
- apply resistance 1 to player for 999 days
- apply haste 1 to player for 999 days
- if {Kings.Schedule.Death::%player%} is true:
- delete {Kings.Schedule.Death::%player%}
- apply poison 1 to player for 30 seconds
- on death of player:
- {Kings.IsKing::%player%} is set
- remove (name of player) from {Kings.KingOfTeam::*}
- delete {Kings.IsKing::%player%}
- set maximum health of player to 10
- set {_Team} to {Teams.InTeam::%player%}
- broadcast "&bThe King of Team %{_Team}% has died!"
- loop {Team.%{_Team}%::*}:
- set {_player} to ("%loop-value%" parsed as offlineplayer)
- if {_player} is online:
- apply poison 1 to {_player} for 30 seconds
- else:
- set {Kings.Schedule.Death::%loop-value%} to true
- on eat of milk bucket:
- cancel event
- remove (tool of player) from player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement