Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.44 KB | None | 0 0
  1. options:
  2. P: &8[&2Duels&8]&r
  3.  
  4. command /resetduels:
  5. permission: skript.op
  6. trigger:
  7. delete {queue::*}
  8. delete {arenas::*}
  9. delete {isDueling::*}
  10. wait 1 tick
  11. add "arena1" to {arenas::*}
  12. add "arena2" to {arenas::*}
  13. add "arena3" to {arenas::*}
  14. add "arena4" to {arenas::*}
  15. add "arena5" to {arenas::*}
  16. add "arena6" to {arenas::*}
  17. add "arena7" to {arenas::*}
  18. add "arena8" to {arenas::*}
  19. add "arena9" to {arenas::*}
  20. message "{@P} Duels have been reset!"
  21.  
  22. command /listarenas:
  23. permission: skript.op
  24. trigger:
  25. message "{@P} %{arenas::*}%"
  26.  
  27.  
  28.  
  29. command /duel:
  30. trigger:
  31. set {_p1} to the command sender
  32. if {queue::*} contains {_p1}:
  33. message "{@P} You are already in the queue!"
  34. stop trigger
  35. if {isDueling::*} contains {_p1}:
  36. message "{@P} You are already in a duel!"
  37. stop trigger
  38. if command sender is in "pvparena":
  39. message "{@P} You can't join the duels queue while in the arena!"
  40. stop trigger
  41. if (size of {queue::*}) is less than 1:
  42. message "{@P} Added to the duels queue!"
  43. add {_p1} to {queue::*}
  44. wait 2 seconds
  45. message "{@P} The queue is empty! Waiting for someone to join..."
  46. stop trigger
  47.  
  48.  
  49. else:
  50. # Other Stuff
  51. remove {_p1} from {isDueling::*}
  52. add {_p1} to {queue::*}
  53. message "{@P} Added to the duels queue!"
  54. wait 2 seconds
  55.  
  56. # Picks an opponent
  57. set {_p2} to a random element of {queue::*}
  58. while {_p2} is equal to {_p1}:
  59. set {_p2} to a random element of {queue::*}
  60. remove {_p2} from {queue::*}
  61. remove {_p1} from {queue::*}
  62.  
  63. # Picks a random arena
  64. delete {arena.%{_p1}%}
  65. delete {arena.%{_p2}%}
  66. set {arena.%{_p1}%} to a random element of {arenas::*}
  67. remove {arena.%{_p1}%} from {arenas::*}
  68. if {arenas::*} is empty:
  69. message "{@P} All the duel arenas are full! Try again another time!" to {_p1} and {_p2}
  70. stop trigger
  71.  
  72. # Initiates the duel
  73. send "{@P} Your duel with &a%{_p1}% &fwill start in 3..." to {_p2}
  74. send "{@P} Your duel with &a%{_p2}% &fwill start in 3..." to {_p1}
  75. command "/playsound random.orb %{_p1}% ~ ~ ~ 5 5 5"
  76. command "/playsound random.orb %{_p2}% ~ ~ ~ 5 5 5"
  77. wait 1 second
  78. send "{@P} Your duel with &a%{_p1}% &fwill start in 2..." to {_p2}
  79. send "{@P} Your duel with &a%{_p2}% &fwill start in 2..." to {_p1}
  80. command "/playsound random.orb %{_p1}% ~ ~ ~ 5 5 5"
  81. command "/playsound random.orb %{_p2}% ~ ~ ~ 5 5 5"
  82. wait 1 second
  83. send "{@P} Your duel with &a%{_p1}% &fwill start in 1..." to {_p2}
  84. send "{@P} Your duel with &a%{_p2}% &fwill start in 1..." to {_p1}
  85. command "/playsound random.orb %{_p1}% ~ ~ ~ 5 5 5"
  86. command "/playsound random.orb %{_p2}% ~ ~ ~ 5 5 5"
  87. wait 1 second
  88. command "/warp %{arena.%{_p1}%}%:1 %{_p1}%"
  89. command "/warp %{arena.%{_p1}%}%:2 %{_p2}%"
  90. send "{@P} You are now dueling with &a%{_p1}%" to {_p2}
  91. send "{@P} You are now dueling with &a%{_p2}%" to {_p1}
  92. command "/playsound mob.wither.spawn %{_p1}% ~ ~ ~ 4 4 4"
  93. command "/playsound mob.wither.spawn %{_p2}% ~ ~ ~ 4 4 4"
  94. remove {_p1} from {queue::*}
  95. remove {_p2} from {queue::*}
  96. add {_p1} to {isDueling::*}
  97. add {_p2} to {isDueling::*}
  98.  
  99. # Give items to the player
  100. clear the inventory of {_p1} and {_p2}
  101. give an iron sword to {_p1}
  102. give an iron sword to {_p2}
  103. give a bow of infinity 1 to {_p1}
  104. give a bow of infinity 1 to {_p2}
  105. give 2 golden apples to {_p1}
  106. give 2 golden apples to {_p2}
  107. give an arrow to {_p1}
  108. give an arrow to {_p2}
  109. set helmet of {_p1} and {_p2} to iron helmet
  110. set chestplate of {_p1} and {_p2} to iron chestplate
  111. set leggings of {_p1} and {_p2} to iron leggings
  112. set boots of {_p1} and {_p2} to iron boots
  113.  
  114. on death of player:
  115. victim and attacker are in "spawn":
  116. damage was caused by attack or projectile:
  117. add {arena.%victim%} to {arenas::*}
  118. add {arena.%attacker%} to {arenas::*}
  119. remove the attacker and the victim from {isDueling::*}
  120. wait 3 ticks
  121. clear the inventory of the victim and the attacker
  122. command "/spawn %attacker%"
  123. message "{@P} You won the duel against %victim%!" to the attacker
  124. message "{@P} You lost the duel agains %attacker%!" to the victim
  125. command "/playsound random.orb %victim% ~ ~ ~ 5 5 5"
  126. command "/playsound random.orb %attacker% ~ ~ ~ 5 5 5"
  127. heal the attacker
  128.  
  129. on hunger meter change:
  130. player is in "spawn":
  131. cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement