Advertisement
Guest User

Dn

a guest
Jul 22nd, 2014
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.37 KB | None | 0 0
  1. options:
  2. P:<blue>[DeathNote]<white>
  3. kc:<red>[KiraChat]<italic><white>
  4. nk:You are not Kira!
  5. kh:<red>[KiraHelp]<italic><white>
  6. command /deathnote <text>:
  7. permission:skript.op
  8. trigger:
  9. if arg 1 is "enable":
  10. set {dn} to true
  11. set {dnplayer} to player
  12. execute command "/setDNnicks"
  13. delete {DNl}
  14. delete {DNkira}
  15. delete {IsKira::*}
  16. delete {IsL::*}
  17. delete {DNfailure::*}
  18. delete {DNdm::*}
  19. loop all players:
  20. set {DNcooldown::%loop-player%} to false
  21. broadcast "<orange>Death Note has been enabled!"
  22. else if arg 1 is "disable":
  23. set {dn} to false
  24. delete {dnplayer}
  25. delete {DNnick::*}
  26. delete {DNl}
  27. delete {DNkira}
  28. delete {IsKira::*}
  29. delete {IsL::*}
  30. delete {DNfailure::*}
  31. delete {DNdm::*}
  32. loop all players:
  33. set {DNcooldown::%loop-player%} to false
  34. broadcast "<orange>Death Note has been disabled!"
  35. execute command "/scoreboard objectives remove ID"
  36.  
  37. #------------------------------------------------------------------------------
  38. #METHODS FOR USE IN MAIN COMMAND
  39. #------------------------------------------------------------------------------
  40. #Sets a nick for each player that is a 7 char long integer
  41. command /setDNnicks:
  42. permission:skript.op
  43. trigger:
  44. loop all players:
  45. {dn} is true
  46. execute command "/scoreboard objectives add ID dummy"
  47. set {DNnick::%loop-player%} to a random integer from 100000 to 999999
  48. execute command "/scoreboard players set %loop-player% ID %{DNnick::%loop-player%}%"
  49. #Sets Ls and Kiras.
  50. command /setDNroles [<int=1>]:
  51. permission:skript.op
  52. trigger:
  53. {dn} is true
  54. broadcast "{@P} ID's and %arg 1% L and Kira are set per team!"
  55. execute command "/scoreboard objectives setdisplay belowName ID"
  56. loop {Teams::*}:
  57. set {roleOptions::*} to {Team.%loop-value%::*}
  58. loop arg-1 times:
  59. set {DNkira} to a random element of {roleOptions::*}
  60. remove {DNkira} from {roleOptions::*}
  61. set {HasKira::%loop-index%} to arg 1
  62. set {DNkiraPlayer} to ("%{DNkira}%" parsed as offlineplayer)
  63. set {DNkira} to "%{DNkira}%" parsed as player
  64. set {IsKira::%{DNkira}%} to true
  65. if {DNkiraPlayer} is online:
  66. send "{@P} You have become the Kira! Use /khelp to learn about being a Kira!" to {DNkiraPlayer}
  67. set {DNl} to a random element of {roleOptions::*}
  68. remove {DNl} from {roleOptions::*}
  69. set {DNlPlayer} to ("%{DNl}%" parsed as offlineplayer)
  70. set {DNl} to "%{DNl}%" parsed as player
  71. set {IsL::%{DNl}%} to true
  72. if {DNlPlayer} is online:
  73. send "{@P} You have become L! Discover the Kira and save your team from his wrath!" to {DNlPlayer}
  74. send "{@P} Hit Kira once to insta-kill him! But be warned, a poor choice will lead to your demise..." to {DNlPlayer}
  75. if arg 1 is greater than 1:
  76. loop all players:
  77. if {IsL::%loop-player%} is true:
  78. send "{@P} The L's on your team are:" to loop-player
  79. loop all players:
  80. {Teams.InTeam::%loop-player-1%} is {Teams.InTeam::%loop-player-2%}
  81. {IsL::%loop-player-2%} is true
  82. send "{@P} %loop-player-2%" to loop-player-1
  83. delete {roleOptions::*}
  84. command /llist:
  85. trigger:
  86. {dn} is true
  87. player is {dnplayer}
  88. send "{@kc} L's Alive:" to the player
  89. loop all players:
  90. if {IsL::%loop-player%} is true:
  91. send "{@P} %loop-player%" to player
  92. #------------------------------------------------------------------------------
  93. #KIRA COMMANDS
  94. #------------------------------------------------------------------------------
  95. command /kcc <text>:
  96.  
  97. trigger:
  98. {dn} is true
  99. if {IsKira::%player%} is true:
  100. loop all players:
  101. if {IsKira::%loop-player%} is true:
  102. send "{@kc} %player%: %arg 1%" to loop-player
  103. else:
  104. send "{@P} {@nk}" to player
  105. command /kcl:
  106. trigger:
  107. {dn} is true
  108. if {IsKira::%player%} is true:
  109. loop all players:
  110. if {IsKira::%loop-player%} is true:
  111. send "{@kc} %player% is at: X=%player's x coordinate%, Y=%player's y coordinate%, Z=%player's z coordinate%" to loop-player
  112. else:
  113. send "{@P} {@nk}" to player
  114. command /kcp:
  115. trigger:
  116. {dn} is true
  117. if {IsKira::%player%} is true:
  118. send "{@kc} Kiras Alive:" to the player
  119. loop all players:
  120. if {IsKira::%loop-player%} is true:
  121. send "{@kc} %loop-player%" to player
  122. else:
  123. send "{@P} {@nk}" to player
  124. player is {dnplayer}
  125. send "{@kc} Kiras Alive:" to the player
  126. loop all players:
  127. if {IsKira::%loop-player%} is true:
  128. send "{@kc} %loop-player%" to player
  129. command /khelp:
  130. trigger:
  131. {dn} is true
  132. if {IsKira::%player%} is true:
  133. send "{@kh} Each player has an ID number above their heads that can be seen from only within 10 blocks. You must discover a person's ID in order to use the Death Note to kill them." to player
  134. send "{@kh} Do /dn <ID> <fire|water|fall|mobs|explosion> to kill players. Each cause of death has special after-effects." to player
  135. wait 5 seconds
  136. send "{@kh} Use /kcc <text> to chat with other Kiras, /kcp to learn about the other Kiras, and /kcl to let other Kiras know your location." to player
  137. send "{@kh} Beware of L! If the L on your team so much as touches you, you will die!" to player
  138. else:
  139. send "{@P} {@nk}" to player
  140. #The Kiras' death note
  141. command /dn <integer> [<text>]:
  142. trigger:
  143. {dn} is true
  144. {DNcooldown::%player%} is false
  145. if {IsKira::%player%} is true:
  146. arg 1 is set
  147. loop all players:
  148. if {DNnick::%loop-player%} is arg 1:
  149. if arg 2 is set:
  150. {Teams.InTeam::%player%} is {Teams.InTeam::%loop-player%}
  151. if arg 2 is "explosion":
  152. send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
  153. wait 40 seconds
  154. loop-player is alive
  155. set {DNdm::%loop-player%} to "%loop-player% blew up"
  156. create an explosion of power 2 at loop-player
  157. kill loop-player
  158. else if arg 2 is "mobs":
  159. send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
  160. wait 40 seconds
  161. loop-player is alive
  162. set {rand} to a random integer from 1 to 5
  163. if {rand} is 1:
  164. set {DNdm::%loop-player%} to "%loop-player% was slain by Zombie"
  165. spawn a zombie at loop-player
  166. else if {rand} is 2:
  167. set {DNdm::%loop-player%} to "%loop-player% was shot by Skeleton"
  168. spawn a skeleton at loop-player
  169. else if {rand} is 3:
  170. set {DNdm::%loop-player%} to "%loop-player% was slain by Spider"
  171. spawn a spider at loop-player
  172. else if {rand} is 4:
  173. set {DNdm::%loop-player%} to "%loop-player% was slain by Silverfish"
  174. spawn 2 silverfish at loop-player
  175. else if {rand} is 5:
  176. set {DNdm::%loop-player%} to "%loop-player% was killed by Witch using magic"
  177. spawn a witch at loop-player
  178. kill loop-player
  179. else if arg 2 is "fall":
  180. send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
  181. wait 40 seconds
  182. loop-player is alive
  183. set {DNdm::%loop-player%} to "%loop-player% fell from a high place"
  184. execute command "/playsound %loop-player% damage.fallbig"
  185. loop blocks in radius 2 around loop-player:
  186. set loop-block to air
  187. kill loop-player
  188. else if arg 2 is "fire":
  189. send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
  190. wait 40 seconds
  191. loop-player is alive
  192. set {DNdm::%loop-player%} to "%loop-player% went up in flames"
  193. execute command "/playsound %loop-player% fire.fire"
  194. loop blocks in radius 3 around loop-player:
  195. chance of 25%:
  196. loop-block is air
  197. set loop-block to fire
  198. kill loop-player
  199. else if arg 2 is "water":
  200. send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
  201. wait 40 seconds
  202. loop-player is alive
  203. set {DNdm::%loop-player%} to "%loop-player% drowned"
  204. loop blocks in radius 3 around loop-player:
  205. loop-block is air
  206. set loop-block to water
  207. kill loop-player
  208. else:
  209. send "{@P} %loop-player% will die in 40 seconds!" to player
  210. wait 40 seconds
  211. loop-player is alive
  212. set {DNdm::%loop-player%} to "%loop-player% was killed by a heart attack"
  213. execute command "/playsound %loop-player% mob.ghast.scream"
  214. kill loop-player
  215. else:
  216. send "{@P} %loop-player% will die in 40 seconds!" to player
  217. wait 40 seconds
  218. loop-player is alive
  219. set {DNdm::%loop-player%} to "%loop-player% was killed by a heart attack"
  220. execute command "/playsound %loop-player% mob.ghast.scream"
  221. kill loop-player
  222. set {DNcooldown::%player%} to true
  223. send "{@P} You cannot use the Death Note again for 5 minutes!" to player
  224. wait 5 minutes
  225. set {DNcooldown::%player%} to false
  226. send "{@P} The Death Note has cooled down! You can now use it again!" to player
  227. arg 1 is not set
  228. send "{@P} Death Note types: fall, water, explosion, mobs, fire" to player
  229. else:
  230. send "{@P} {@nk}" to player
  231. #------------------------------------------------------------------------------
  232. #OTHER STUFF
  233. #------------------------------------------------------------------------------
  234. on damage of player:
  235. {dn} is true
  236. attacker is a player
  237. if {IsL::%attacker%} is true:
  238. if {Teams.InTeam::%attacker%} is {Teams.InTeam::%victim%}:
  239. attacker's tool is air
  240. if {IsKira::%victim%} is true:
  241. victim is alive
  242. set {DNfailure::%victim%} to true
  243. wait a tick
  244. kill the victim
  245. else:
  246. {HasKira::%{Teams.InTeam::%attacker%}%} is greater than 0
  247. set {DNfailure::%attacker%} to true
  248. wait a tick
  249. kill the attacker
  250. on death of player:
  251. {dn} is true
  252. if {IsKira::%victim%} is true:
  253. subtract 1 from {HasKira::%{Teams.InTeam::%victim%}%}
  254. execute command "/team leave %victim%"
  255. if {DNfailure::%victim%} is true:
  256. if {IsKira::%victim%} is true:
  257. set death message to "<white><bold>Kira <red>%victim% <white><bold>was successfully killed by L!"
  258. else if {IsL::%victim%} is true:
  259. set death message to "<white><bold>L <aqua>%victim% <white><bold>failed to kill Kira and died!"
  260. else if {DNdm::%victim%} is set:
  261. set death message to "%{DNdm::%victim%}%"
  262. set {IsKira::%victim%} to false
  263. set {IsL::%victim%} to false
  264. on join:
  265. {dn} is true
  266. if {IsKira::%player%} is true:
  267. send "{@P} You are Kira! Use /dn <ID> <cause> to kill players!" to player
  268. else if {IsL::%player%} is true:
  269. send "{@P} You are L! Save your team by eliminating the Kira!" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement