Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.42 KB | None | 0 0
  1. # such variables, woooow!
  2.  
  3. # {Kings.IsKing::%player%} - team id/not set
  4. # {Kings.KingOfTeam::%team%} - name of player
  5.  
  6. # {Kings.Schedule.GiveEffect::%player%} - true/not set
  7. # {Kings.Schedule.RemoveEffect::%player%} - true/not set
  8. # {Kings.Schedule.Death::%player%} - true/not set
  9.  
  10.  
  11. # /modkings set [team num] [person in team]
  12. # /modkings random
  13. # /modkings change [team num] [person in team]
  14. # /modkings list
  15. # /modkings delete
  16. # /modkings reapply
  17.  
  18.  
  19. options:
  20. P: &f[&bModifiedKings&f]&b
  21.  
  22. command /modkings [<text>] [<text>] [<text>] [<text>]:
  23. trigger:
  24. if arg 1 is not set:
  25. message "/modkings set [team num] [person in team]"
  26. message "/modkings random"
  27. message "/modkings change [team num] [person in team]"
  28. message "/modkings list"
  29. message "/modkings delete"
  30. message "/modkings reapply"
  31.  
  32. else if arg 1 is equal to "list":
  33. if {Kings.KingOfTeam::*} is not set:
  34. message "{@P} No Kings defined."
  35. else:
  36. loop {Kings.KingOfTeam::*}:
  37. message "&bKing of Team &f%loop-index%: &f&l%loop-value%"
  38.  
  39. else if arg 1 is equal to "set":
  40. if command sender does not have the permission "kings.set":
  41. message "{@P} You do not have the permission to do this."
  42. else if arg 2 is not set:
  43. message "{@P} /modkings set [team num] [person in team]"
  44. else if arg 3 is not set:
  45. message "{@P} /modkings set [team num] [person in team]"
  46. else:
  47. set {_Team} to ("%arg 2%" parsed as integer)
  48. set {_te} to ("%arg-3%" parsed as offlineplayer)
  49. set {_Test1} to ("%arg-3%" parsed as integer)
  50. if {_Test1} is set:
  51. set {_TN} to ("%arg-3%" parsed as integer)
  52. else if {Teams.InTeam::%{_te}%} is set:
  53. set {_TN} to {Teams.InTeam::%{_te}%}
  54. message "{@P} %{_TN}%"
  55. if {_Team} is not set:
  56. message "{@P} Invalid Team!"
  57. if {_TN} is not set:
  58. message "{@P} Player is not on a team"
  59. else if {Kings.KingOfTeam::%{_Team}%} is set:
  60. message "{@P} Team already has a King!"
  61. else if {_TN} is not equal to {_Team}:
  62. message "{@P} %arg 3% is not in Team %arg 2%!"
  63. else:
  64. set {_NewKing} to arg 3
  65. set {_NewKing.Player} to ("%arg 3%" parsed as offlineplayer)
  66. if {_NewKing.Player} is online:
  67. set maximum health of {_NewKing.Player} to 20
  68. set health of {_NewKing.Player} to 20
  69. apply slowness 1 to {_NewKing.Player} for 999 days
  70. apply strength 1 to {_NewKing.Player} for 999 days
  71. apply resistance 1 to {_NewKing.Player} for 999 days
  72. apply haste 1 to {_NewKing.Player} for 999 days
  73. else:
  74. set {Kings.Schedule.GiveEffect::%{_NewKing}%} to true
  75.  
  76. set {Kings.IsKing::%{_NewKing}%} to {_Team}
  77. set {Kings.KingOfTeam::%{_Team}%} to {_NewKing}
  78.  
  79. broadcast "{@P} &f%command sender% &bKing of Team &f%arg 2% &bis now &f%arg 3%"
  80.  
  81. else if arg 1 is equal to "random":
  82. if command sender does not have the permission "kings.set":
  83. message "{@P} You do not have permission to do this."
  84. else:
  85. # remove effects from previous kings
  86. loop {Kings.KingOfTeam::*}:
  87. set {_KingPlayer} to ("%loop-value%" parsed as offlineplayer)
  88. if {_KingPlayer} is online:
  89. set maximum health of {_KingPlayer} to 10
  90. set health of {_KingPlayer} to 10
  91. remove slowness from {_KingPlayer}
  92. remove strength from {_KingPlayer}
  93. remove resistance from {_KingPlayer}
  94. remove haste from {_KingPlayer}
  95. else:
  96. set {Kings.Schedule.RemoveEffect::%loop-value%} to true
  97.  
  98. delete {Kings.IsKing::*}
  99. delete {Kings.KingOfTeam::*}
  100.  
  101. # set new kings
  102. broadcast "{@P} &f%command sender%: &bSetting Kings!"
  103. loop {Teams::*}:
  104. set {_King} to (random element out of {Team.%loop-value%::*})
  105. broadcast "{@P} &bKing of Team &f%loop-value%: &f&l%{_King}%&f!"
  106. set {Kings.IsKing::%{_King}%} to loop-value
  107. set {Kings.KingOfTeam::%loop-value%} to {_King}
  108.  
  109. set {_KingPlayer} to ("%{_King}%" parsed as offlineplayer)
  110. if {_KingPlayer} is online:
  111. set maximum health of {_KingPlayer} to 20
  112. set health of {_KingPlayer} to 20
  113. apply slowness 1 to {_KingPlayer} for 999 days
  114. apply strength 1 to {_KingPlayer} for 999 days
  115. apply resistance 1 to {_KingPlayer} for 999 days
  116. apply haste 1 to {_KingPlayer} for 999 days
  117. else:
  118. set {Kings.Schedule.GiveEffect::%{_King}%} to true
  119.  
  120. else if arg 1 is equal to "change":
  121. if command sender does not have the permission "kings.change":
  122. message "{@P} You do not have permission to do this."
  123. else if arg 2 is not set:
  124. message "{@P} /modkings change [team num] [person in team]"
  125. else if arg 3 is not set:
  126. message "{@P} /modkings change [team num] [person in team]"
  127. else:
  128. set {_Team} to ("%arg 2%" parsed as integer)
  129. if {_Team} is not set:
  130. message "{@P} Invalid Team!"
  131. else if {Kings.KingOfTeam::%{_Team}%} is not set:
  132. message "{@P} Team does not have a King!"
  133. else if {Team.%{TeamNumber::%arg-3%}%} is not equal to {_Team}:
  134. message "{@P} %arg 3% is not in Team %arg 2%!"
  135. else:
  136. set {_PreviousKing} to {Kings.KingOfTeam::%{_Team}%}
  137. set {_PreviousKing.Player} to ("%{_PreviousKing}%" parsed as offlineplayer)
  138. if {_PreviousKing.Player} is online:
  139. set maximum health of {_PreviousKing.Player} to 10
  140. set health of {_PreviousKing.Player} to 10
  141. remove slowness from {_PreviousKing.Player}
  142. remove strength from {_PreviousKing.Player}
  143. remove resistance from {_PreviousKing.Player}
  144. remove haste from {_PreviousKing.Player}
  145. else:
  146. set {Kings.Schedule.RemoveEffect::%{_PreviousKing}%} to true
  147.  
  148. delete {Kings.IsKing::%{_PreviousKing}%}
  149.  
  150. set {_NewKing} to arg 3
  151. set {_NewKing.Player} to ("%arg 3%" parsed as offlineplayer)
  152. if {_NewKing.Player} is online:
  153. set maximum health of {_NewKing.Player} to 20
  154. set health of {_NewKing.Player} to 20
  155. apply slowness 1 to {_NewKing.Player} for 999 days
  156. apply strength 1 to {_NewKing.Player} for 999 days
  157. apply resistance 1 to {_NewKing.Player} for 999 days
  158. apply haste 1 to {_NewKing.Player} for 999 days
  159. else:
  160. set {Kings.Schedule.GiveEffect::%{_NewKing}%} to true
  161.  
  162. set {Kings.IsKing::%{_NewKing}%} to {_Team}
  163. set {Kings.KingOfTeam::%{_Team}%} to {_NewKing}
  164.  
  165. broadcast "{@P} &f%command sender% &bchanged King of Team &f%arg 2% &bto &f%arg 3%"
  166.  
  167. else if arg 1 is equal to "delete" or "off":
  168. if command sender does not have the permission "kings.delete":
  169. message "{@P} You do not have permission to do this."
  170. else:
  171. loop {Kings.KingOfTeam::*}:
  172. set {_ThisKing} to ("%loop-value%" parsed as offlineplayer)
  173. if {_ThisKing} is online:
  174. set maximum health of {_ThisKing} to 10
  175. set health of {_ThisKing} to 10
  176. remove slowness from {_ThisKing}
  177. remove strength from {_ThisKing}
  178. remove resistance from {_ThisKing}
  179. remove haste from {_ThisKing}
  180. else:
  181. set {Kings.Schedule.RemoveEffect::%loop-value%} to true
  182.  
  183. delete {Kings.IsKing::*}
  184. delete {Kings.KingOfTeam::*}
  185.  
  186. broadcast "&f[&bModified Kings] &bModified Kings &fDisabled"
  187.  
  188. else if arg 1 is equal to "reapply":
  189. if command sender does not have the permission "kings.reapply":
  190. message "{@P} You do not have permission to do this."
  191. else:
  192. loop {Kings.KingOfTeam::*}:
  193. set {_ThisKing} to ("%loop-value%" parsed as offlineplayer)
  194. if {_ThisKing} is online:
  195. set maximum health of {_ThisKing} to 20
  196. set health of {_ThisKing} to 20
  197. apply slowness 1 to {_ThisKing} for 999 days
  198. apply strength 1 to {_ThisKing} for 999 days
  199. apply resistance 1 to {_ThisKing} for 999 days
  200. apply haste 1 to {_ThisKing} for 999 days
  201. else:
  202. set {Kings.Schedule.GiveEffect::%loop-value%} to true
  203.  
  204. broadcast "{@P} &e%command sender% &rreapplied King effects"
  205.  
  206. else:
  207. message "/modkings set [team num] [person in team]"
  208. message "/modkings random"
  209. message "/modkings change [team num] [person in team]"
  210. message "/modkings list"
  211. message "/modkings delete"
  212. message "/modkings reapply"
  213.  
  214.  
  215. on join:
  216. wait 1 tick
  217. if {Kings.Schedule.RemoveEffect::%player%} is true:
  218. delete {Kings.Schedule.RemoveEffect::%player%}
  219. set maximum health of player to 10
  220. set health of player to 10
  221. remove slowness from player
  222. remove strength from player
  223. remove resistance from player
  224. remove haste from player
  225. if {Kings.Schedule.GiveEffect::%player%} is true:
  226. delete {Kings.Schedule.GiveEffect::%player%}
  227. set maximum health of player to 20
  228. set health of player to 20
  229. apply slowness 1 to player for 999 days
  230. apply strength 1 to player for 999 days
  231. apply resistance 1 to player for 999 days
  232. apply haste 1 to player for 999 days
  233. if {Kings.Schedule.Death::%player%} is true:
  234. delete {Kings.Schedule.Death::%player%}
  235. apply poison 1 to player for 30 seconds
  236.  
  237. on death of player:
  238. {Kings.IsKing::%player%} is set
  239. remove (name of player) from {Kings.KingOfTeam::*}
  240. delete {Kings.IsKing::%player%}
  241. set maximum health of player to 10
  242. set {_Team} to {Teams.InTeam::%player%}
  243. broadcast "&bThe King of Team %{_Team}% has died!"
  244. loop {Team.%{_Team}%::*}:
  245. set {_player} to ("%loop-value%" parsed as offlineplayer)
  246. if {_player} is online:
  247. apply poison 1 to {_player} for 30 seconds
  248. else:
  249. set {Kings.Schedule.Death::%loop-value%} to true
  250.  
  251. on eat of milk bucket:
  252. cancel event
  253. remove (tool of player) from player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement