Advertisement
Guest User

Untitled

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