Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.07 KB | None | 0 0
  1. #=============#
  2. # Duels #
  3. #=============#
  4.  
  5. #Options:
  6.  
  7. options:
  8. C: 7 #Duel Command Cooldown
  9. T: &c<bold>Choose the Duel Type! #Description of the Chest Inventory
  10. S: 3 #Time to start the duel Seconds
  11. EC: true #Ender Pearl Cooldown (True or False)
  12. ECT: 15 #Ender Pearl Cooldown Time Seconds
  13. I: iron sword #item to open the match types
  14. IN: &6Match Queue #Name of the item to open the match types
  15. Q: glowstone dust #Item to leave queue
  16. QN: &6Leave Queue #Name of item to leave queue
  17.  
  18. #Commands:
  19. command /duel <player> [<text>]:
  20. permission: duel.duel
  21. permission message: &cYou don't have permission for that.
  22. trigger:
  23.  
  24. if {PlayerInTeam::%player%} is set:
  25.  
  26. message "&7You are in a team."
  27. stop
  28.  
  29. if {PlayerInTeam::%player%} is not set:
  30.  
  31. if {PlayerInTeam::%player argument%} is set:
  32.  
  33. message "&7That player is in a team."
  34. stop
  35.  
  36. if {PlayerInTeam::%player argument%} is not set:
  37.  
  38. if {intour.%player%.true} is true:
  39. message "&7You cannot do that if you are in a tournament!"
  40. stop
  41.  
  42. else:
  43.  
  44. if {intour.%player argument%.true} is true:
  45. message "&7That player is in a tournament!"
  46. stop
  47.  
  48. else:
  49.  
  50. clear {wanted.%player%}
  51. wait 1 tick
  52. set {wanted.%player%} to player argument
  53.  
  54. if arg-2 is not set:
  55.  
  56. if {duel.%player argument%.ingame} is true:
  57. send "&b%player argument% &7<bold>is in a duel" to player
  58. stop
  59.  
  60. if {duel.%player argument%.ingame} is false:
  61. if {duel.%player%.ingame} is true:
  62. send "&7You are in a duel" to player
  63. stop
  64.  
  65. if {duel.%player%.ingame} is false:
  66.  
  67. if player argument is player:
  68. send "&7You cannot duel yourself" to player
  69. stop
  70.  
  71. if player argument is not player:
  72.  
  73. set {_type.0} to 0
  74. set {_type.1} to 1
  75. set {_type.2} to 2
  76. set {_type.3} to 3
  77. set {_type.4} to 4
  78. set {_type.5} to 5
  79. set {_type.6} to 6
  80. set {_type.7} to 7
  81. set {_type.8} to 8
  82.  
  83. open chest with 1 row named "{@T}" to player
  84. if {typeset::%{_type.0}%} is set:
  85. format slot {_type.0} of player with {slot.%{_type.0}%.item} named "&7<bold>%{slot.%{_type.0}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.0}%.name}%"]
  86. if {typeset::%{_type.0}%} is not set:
  87. format slot {_type.0} of player with air named "" to be unstealable
  88. if {typeset::%{_type.1}%} is set:
  89. format slot {_type.1} of player with {slot.%{_type.1}%.item} named "&7<bold>%{slot.%{_type.1}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.1}%.name}%"]
  90. if {typeset::%{_type.1}%} is not set:
  91. format slot {_type.1} of player with air named "" to be unstealable
  92. if {typeset::%{_type.2}%} is set:
  93. format slot {_type.2} of player with {slot.%{_type.2}%.item} named "&7<bold>%{slot.%{_type.2}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.2}%.name}%"]
  94. if {typeset::%{_type.2}%} is not set:
  95. format slot {_type.2} of player with air named "" to be unstealable
  96. if {typeset::%{_type.3}%} is set:
  97. format slot {_type.3} of player with {slot.%{_type.3}%.item} named "&7<bold>%{slot.%{_type.3}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.3}%.name}%"]
  98. if {typeset::%{_type.3}%} is not set:
  99. format slot {_type.3} of player with air named "" to be unstealable
  100. if {typeset::%{_type.4}%} is set:
  101. format slot {_type.4} of player with {slot.%{_type.4}%.item} named "&7<bold>%{slot.%{_type.4}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.4}%.name}%"]
  102. if {typeset::%{_type.4}%} is not set:
  103. format slot {_type.4} of player with air named "" to be unstealable
  104. if {typeset::%{_type.5}%} is set:
  105. format slot {_type.5} of player with {slot.%{_type.5}%.item} named "&7<bold>%{slot.%{_type.5}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.5}%.name}%"]
  106. if {typeset::%{_type.5}%} is not set:
  107. format slot {_type.5} of player with air named "" to be unstealable
  108. if {typeset::%{_type.6}%} is set:
  109. format slot {_type.6} of player with {slot.%{_type.6}%.item} named "&7<bold>%{slot.%{_type.6}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.6}%.name}%"]
  110. if {typeset::%{_type.6}%} is not set:
  111. format slot {_type.6} of player with air named "" to be unstealable
  112. if {typeset::%{_type.7}%} is set:
  113. format slot {_type.7} of player with {slot.%{_type.7}%.item} named "&7<bold>%{slot.%{_type.7}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.7}%.name}%"]
  114. if {typeset::%{_type.7}%} is not set:
  115. format slot {_type.7} of player with air named "" to be unstealable
  116. if {typeset::%{_type.8}%} is set:
  117. format slot {_type.8} of player with {slot.%{_type.8}%.item} named "&7<bold>%{slot.%{_type.8}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.8}%.name}%"]
  118. if {typeset::%{_type.8}%} is not set:
  119. format slot {_type.8} of player with air named "" to be unstealable
  120.  
  121. if arg-2 is set:
  122.  
  123. if {dueltype::%arg-2%} is set:
  124.  
  125. if {duel.%player argument%.ingame} is true:
  126. send "&b%player argument% &7<bold>is in a duel" to player
  127. stop
  128.  
  129. if {duel.%player argument%.ingame} is false:
  130. if {duel.%player%.ingame} is true:
  131. send "&7You are in a duel" to player
  132. stop
  133.  
  134. if {duel.%player%.ingame} is false:
  135.  
  136. if player argument is player:
  137. send "&7You cannot duel yourself" to player
  138. stop
  139.  
  140. if player argument is not player:
  141.  
  142. set {_cooldown} to difference between {duel.%player%.lastused} and now
  143. if {_cooldown} is less than {@C} seconds:
  144. set {_cooldown} to difference between {_cooldown} and {@C} seconds
  145. wait 1 tick
  146. message "&b%{_cooldown}% &7<bold>seconds left" to player
  147. stop trigger
  148.  
  149. else:
  150. set {duel.%player%.lastused} to now
  151. delete {reqs.%player argument%::%player%}
  152. clear {reqs.%player argument%::%player%::*}
  153. wait 2 tick
  154. set {reqs.%player argument%::%player%} to player
  155. set {reqs.%player argument%::%player%::%arg-2%} to arg-2
  156. set {duel.%player argument%.req} to true
  157. send "&7You challenged &b%player argument% &7to a duel" to player
  158. send "&b%player% &7challenged you to a duel with type &b%arg-2%" to player argument
  159. send "&7Type &b/accept %player% &7to accept the duel" to player argument
  160. stop
  161.  
  162. if {dueltype::%arg-2%} is not set:
  163.  
  164. message "&7<bold>That duel type does not exist."
  165.  
  166. command /accept <player>:
  167. permission: duel.accept
  168. permission message: &cYou don't have permission for that.
  169. trigger:
  170.  
  171. if {PlayerInTeam::%player%} is set:
  172.  
  173. message "&7You are in a team."
  174. stop
  175.  
  176. if {PlayerInTeam::%player%} is not set:
  177.  
  178. if {PlayerInTeam::%player argument%} is set:
  179.  
  180. message "&7That player is in a team."
  181. stop
  182.  
  183. if {PlayerInTeam::%player argument%} is not set:
  184.  
  185.  
  186. if {intour.%player%.true} is true:
  187. message "&7You cannot do that if you are in a tournament!"
  188. stop
  189.  
  190. else:
  191.  
  192. if {intour.%player argument%.true} is true:
  193. message "&7That player is in a tournament!"
  194. stop
  195.  
  196. else:
  197.  
  198. if {duel.%player argument%.ingame} is true:
  199. message "&b%player argument% is in a duel"
  200. stop
  201.  
  202. if {duel.%player%.ingame} is false:
  203. if player argument is player:
  204. send "&7You cannot accept yourself" to player
  205. stop
  206.  
  207. if player argument is not player:
  208. if {duel.%player%.req} is false:
  209. send "&7You do not have any pending requests" to player
  210. stop
  211.  
  212. if {duel.%player%.req} is true:
  213. if {reqs.%player%::%player argument%} is not set:
  214. message "&b%player argument% &7hasn't sent you a duel request."
  215. stop
  216.  
  217. if {reqs.%player%::%player argument%} is set:
  218.  
  219. if size of {arenas::*} = 0: #thisline
  220. message "&7<bold>No arenas have been created."
  221. stop
  222.  
  223. if size of {arenas::*} > 0:
  224.  
  225. set {_used} to 0
  226. set {_ar} to size of {arenas::*}
  227. loop {arenas::*}:
  228. set {_arena} to loop-value
  229. set {_arenas::%{_arena}%} to {_arena}
  230.  
  231. loop {_ar} times:
  232.  
  233. set {option.%player%} to random element of {_arenas::*}
  234.  
  235. if {arena.%{option.%player%}%.option} is false:
  236.  
  237. send "&b%player% &7has accepted your duel request" to player argument
  238. send "&7You have accepted &b%player argument% &7duel" to player
  239. loop {reqs.%player%::%player argument%::*}:
  240. set {_type} to loop-value-2
  241. loop {dueltype::*}:
  242. remove player from {match.%loop-value-2%::*}
  243. remove player argument from {match.%loop-value-2%::*}
  244. set {duel.%player%.ingame} to true
  245. set {duel.%player argument%.ingame} to true
  246. add player to {duel.%player%::*}
  247. add player argument to {duel.%player%::*}
  248. add player argument to {duel.%player argument%::*}
  249. add player to {duel.%player argument%::*}
  250. add player to {stopbackup::*}
  251. add player argument to {stopbackup::*}
  252. set {_player1} to player
  253. set {_player2} to player argument
  254. clear {reqs.%{_player1}%::*}
  255. clear {reqs.%{_player2}%::*}
  256. set {arena.%{option.%player%}%.option} to true
  257. set {lastloc.%{_player1}%} to location of {_player1}
  258. set {lastloc.%{_player2}%} to location of {_player2}
  259. set {message.%{_player1}%} to true
  260. set {message.%{_player2}%} to true
  261. set {ender.%{_player1}%} to {@EC}
  262. set {ender.%{_player2}%} to {@EC}
  263. teleport {_player1} to {arena.%{option.%player%}%.spawn.1}
  264. teleport {_player2} to {arena.%{option.%player%}%.spawn.2}
  265. clear {_player1}'s inventory
  266. clear {_player2}'s inventory
  267. heal {_player1}
  268. heal {_player2}
  269. cure {_player1} from poison
  270. cure {_player2} from poison
  271. set {_player1}'s game mode to survival
  272. set {_player2}'s game mode to survival
  273. set {_effects.%{_player1}%::*} to all of the active potion effects on {_player1}
  274. loop {_effects.%{_player1}%::*}:
  275. remove loop-value-2 from {_player1}
  276. set {_effects.%{_player2}%::*} to all of the active potion effects on {_player2}
  277. loop {_effects.%{_player2}%::*}:
  278. remove loop-value-2 from {_player2}
  279.  
  280.  
  281.  
  282. if {inv.%{_type}%::%{_player1}%} is set:
  283. set {_slload.%{_player1}%} to 0
  284. restore inventory of {_player1} from {custom.%{_type}%.%{_player1}%}
  285. equip {_player1} with {boots.%{_type}%.%{_player1}%}
  286. equip {_player1} with {chest.%{_type}%.%{_player1}%}
  287. equip {_player1} with {legs.%{_type}%.%{_player1}%}
  288. equip {_player1} with {helm.%{_type}%.%{_player1}%}
  289. clear {_slload.%{_player1}%}
  290.  
  291. if {inv.%{_type}%::%{_player1}%} is not set:
  292. set {_slload.%{_player1}%} to 0
  293. restore inventory of {_player1} from {default.%{_type}%}
  294. equip {_player1} with {bootsdefault.%{_type}%}
  295. equip {_player1} with {chestdefault.%{_type}%}
  296. equip {_player1} with {legsdefault.%{_type}%}
  297. equip {_player1} with {helmdefault.%{_type}%}
  298. clear {_slload.%{_player1}%}
  299.  
  300. if {inv.%{_type}%::%{_player2}%} is set:
  301. set {_slload.%{_player2}%} to 0
  302. restore inventory of {_player2} from {custom.%{_type}%.%{_player2}%}
  303. equip {_player2} with {boots.%{_type}%.%{_player2}%}
  304. equip {_player2} with {chest.%{_type}%.%{_player2}%}
  305. equip {_player2} with {legs.%{_type}%.%{_player2}%}
  306. equip {_player2} with {helm.%{_type}%.%{_player2}%}
  307. clear {_slload.%{_player2}%}
  308.  
  309. if {inv.%{_type}%::%{_player2}%} is not set:
  310. set {_slload.%{_player2}%} to 0
  311. restore inventory of {_player2} from {default.%{_type}%}
  312. equip {_player2} with {bootsdefault.%{_type}%}
  313. equip {_player2} with {chestdefault.%{_type}%}
  314. equip {_player2} with {legsdefault.%{_type}%}
  315. equip {_player2} with {helmdefault.%{_type}%}
  316. clear {_slload.%{_player2}%}
  317.  
  318. if {@S} > 0:
  319.  
  320. set {_rn} to {@S}
  321. apply slowness tier 10 to {_player1} for {@S} seconds
  322. apply slowness tier 10 to {_player2} for {@S} seconds
  323. apply jump boost tier -10 to {_player1} for {@S} seconds
  324. apply jump boost tier -10 to {_player2} for {@S} seconds
  325. loop {_rn} times:
  326. message "&7<bold>Duel Starting in &b%{_rn}% &7<bold>seconds" to {_player1} and {_player2}
  327. send {_player1} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
  328. send {_player2} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
  329. remove 1 from {_rn}
  330. play "NOTE_PLING" specifically to {_player1} with pitch 5 and volume 1000
  331. play "NOTE_PLING" specifically to {_player2} with pitch 5 and volume 1000
  332. wait 1 second
  333. send {_player1} title "&bGo!" with subtitle "" for 1 seconds
  334. send {_player2} title "&bGo!" with subtitle "" for 1 seconds
  335. play "NOTE_PLING" specifically to {_player2} with pitch 1 and volume 1000
  336. remove slowness from {_player1}
  337. remove slowness from {_player2}
  338. remove jump boost from {_player1}
  339. remove jump boost from {_player2}
  340. delete {_rn}
  341.  
  342. stop
  343.  
  344. if {@S} <= 0:
  345.  
  346. stop
  347.  
  348. if {arena.%{option.%player%}%.option} is true:
  349.  
  350. remove {option.%player%} from {_arenas::*}
  351. add 1 to {_used}
  352. if {_used} = {_ar}:
  353. message "&7All arenas are being used. Try later"
  354.  
  355.  
  356. command /match [<text>]:
  357. permission: duel.match
  358. permission message: &cYou don't have permission for that.
  359. trigger:
  360.  
  361. if {PlayerInTeam::%player%} is set:
  362.  
  363. message "&7You are in a team."
  364. stop
  365.  
  366. if {PlayerInTeam::%player%} is not set:
  367.  
  368. if {intour.%player%.true} is true:
  369. message "&7You cannot do that if you are in a tournament!"
  370. stop
  371.  
  372. else:
  373.  
  374. if {duel.%player%.ingame} is true:
  375.  
  376. message "&7You are in a duel."
  377.  
  378. if {duel.%player%.ingame} is false:
  379.  
  380. if arg-1 is not set:
  381. set {_type.0} to 0
  382. set {_type.1} to 1
  383. set {_type.2} to 2
  384. set {_type.3} to 3
  385. set {_type.4} to 4
  386. set {_type.5} to 5
  387. set {_type.6} to 6
  388. set {_type.7} to 7
  389. set {_type.8} to 8
  390.  
  391. open chest with 1 row named "{@T}" to player
  392. if {typeset::%{_type.0}%} is set:
  393. format slot {_type.0} of player with {slot.%{_type.0}%.item} named "&7<bold>%{slot.%{_type.0}%.name}%" to close then run [make player execute command "match %{slot.%{_type.0}%.name}%"]
  394. if {typeset::%{_type.0}%} is not set:
  395. format slot {_type.0} of player with air named "" to be unstealable
  396. if {typeset::%{_type.1}%} is set:
  397. format slot {_type.1} of player with {slot.%{_type.1}%.item} named "&7<bold>%{slot.%{_type.1}%.name}%" to close then run [make player execute command "match %{slot.%{_type.1}%.name}%"]
  398. if {typeset::%{_type.1}%} is not set:
  399. format slot {_type.1} of player with air named "" to be unstealable
  400. if {typeset::%{_type.2}%} is set:
  401. format slot {_type.2} of player with {slot.%{_type.2}%.item} named "&7<bold>%{slot.%{_type.2}%.name}%" to close then run [make player execute command "match %{slot.%{_type.2}%.name}%"]
  402. if {typeset::%{_type.2}%} is not set:
  403. format slot {_type.2} of player with air named "" to be unstealable
  404. if {typeset::%{_type.3}%} is set:
  405. format slot {_type.3} of player with {slot.%{_type.3}%.item} named "&7<bold>%{slot.%{_type.3}%.name}%" to close then run [make player execute command "match %{slot.%{_type.3}%.name}%"]
  406. if {typeset::%{_type.3}%} is not set:
  407. format slot {_type.3} of player with air named "" to be unstealable
  408. if {typeset::%{_type.4}%} is set:
  409. format slot {_type.4} of player with {slot.%{_type.4}%.item} named "&7<bold>%{slot.%{_type.4}%.name}%" to close then run [make player execute command "match %{slot.%{_type.4}%.name}%"]
  410. if {typeset::%{_type.4}%} is not set:
  411. format slot {_type.4} of player with air named "" to be unstealable
  412. if {typeset::%{_type.5}%} is set:
  413. format slot {_type.5} of player with {slot.%{_type.5}%.item} named "&7<bold>%{slot.%{_type.5}%.name}%" to close then run [make player execute command "match %{slot.%{_type.5}%.name}%"]
  414. if {typeset::%{_type.5}%} is not set:
  415. format slot {_type.5} of player with air named "" to be unstealable
  416. if {typeset::%{_type.6}%} is set:
  417. format slot {_type.6} of player with {slot.%{_type.6}%.item} named "&7<bold>%{slot.%{_type.6}%.name}%" to close then run [make player execute command "match %{slot.%{_type.6}%.name}%"]
  418. if {typeset::%{_type.6}%} is not set:
  419. format slot {_type.6} of player with air named "" to be unstealable
  420. if {typeset::%{_type.7}%} is set:
  421. format slot {_type.7} of player with {slot.%{_type.7}%.item} named "&7<bold>%{slot.%{_type.7}%.name}%" to close then run [make player execute command "match %{slot.%{_type.7}%.name}%"]
  422. if {typeset::%{_type.7}%} is not set:
  423. format slot {_type.7} of player with air named "" to be unstealable
  424. if {typeset::%{_type.8}%} is set:
  425. format slot {_type.8} of player with {slot.%{_type.8}%.item} named "&7<bold>%{slot.%{_type.8}%.name}%" to close then run [make player execute command "match %{slot.%{_type.8}%.name}%"]
  426. if {typeset::%{_type.8}%} is not set:
  427. format slot {_type.8} of player with air named "" to be unstealable
  428.  
  429. if arg-1 is set:
  430.  
  431. set {_type} to arg-1
  432. if command sender is a player:
  433.  
  434. if {queue.%player%} is true:
  435.  
  436. message "&7You are currently in a queue."
  437. message "&7Type &b/leave &7to leave the queue."
  438. stop
  439.  
  440. if {queue.%player%} is false:
  441.  
  442. add player to {match.%{_type}%::*}
  443.  
  444. wait 0.2 ticks
  445. set {_size} to size of {match.%{_type}%::*}
  446.  
  447. if {_size} = 1:
  448. set {queue.%player%} to true
  449. message "&7You have been added to the &b%{_type}% &7queue." to player
  450. set slot 0 of player to {@Q} named "{@QN}"
  451. stop
  452.  
  453. if {_size} = 2:
  454.  
  455. if size of {arenas::*} = 0:
  456. message "&7<bold>No arenas have been created."
  457. stop
  458.  
  459. if size of {arenas::*} > 0:
  460.  
  461. if {_size} = 2:
  462.  
  463. set {_used} to 0
  464. set {_ar} to size of {arenas::*}
  465. loop {arenas::*}:
  466. set {_arena} to loop-value
  467. set {_arenas::%{_arena}%} to {_arena}
  468.  
  469. loop {_ar} times:
  470.  
  471. set {option.%player%} to random element of {_arenas::*}
  472.  
  473. if {arena.%{option.%player%}%.option} is false:
  474.  
  475. if {_size} = 2:
  476. send "&7You have been added to the &b%{_type}% &7queue." to player
  477. set {_player1} to random element of {match.%{_type}%::*}
  478. remove {_player1} from {match.%{_type}%::*}
  479. set {_player2} to random element of {match.%{_type}%::*}
  480. remove {_player2} from {match.%{_type}%::*}
  481. if {_player1} is not a player:
  482. stop
  483. if {_player1} is a player:
  484. if {_player2} is not a player:
  485. stop
  486. if {_player2} is a player:
  487. send "&7You are in a match against &b%{_player2}%" to {_player1}
  488. send "&7You are in a match against &b%{_player1}%" to {_player2}
  489. set {queue.%{_player1}%} to false
  490. set {queue.%{_player2}%} to false
  491. clear {match.%{_type}%::*}
  492. set {duel.%{_player1}%.ingame} to true
  493. set {duel.%{_player2}%.ingame} to true
  494. add {_player1} to {duel.%{_player1}%::*}
  495. add {_player2} to {duel.%{_player1}%::*}
  496. add {_player2} to {duel.%{_player2}%::*}
  497. add {_player1} to {duel.%{_player2}%::*}
  498. add {_player1} to {stopbackup::*}
  499. add {_player2} to {stopbackup::*}
  500. clear {reqs.%{_player1}%::*}
  501. clear {reqs.%{_player2}%::*}
  502. set {arena.%{option.%player%}%.option} to true
  503. set {lastloc.%{_player1}%} to location of {_player1}
  504. set {lastloc.%{_player2}%} to location of {_player2}
  505. set {message.%{_player1}%} to true
  506. set {message.%{_player2}%} to true
  507. set {ender.%{_player1}%} to {@EC}
  508. set {ender.%{_player2}%} to {@EC}
  509. teleport {_player1} to {arena.%{option.%player%}%.spawn.1}
  510. teleport {_player2} to {arena.%{option.%player%}%.spawn.2}
  511. clear {_player1}'s inventory
  512. clear {_player2}'s inventory
  513. heal {_player1}
  514. heal {_player2}
  515. cure {_player1} from poison
  516. cure {_player2} from poison
  517. set {_player1}'s game mode to survival
  518. set {_player2}'s game mode to survival
  519. set {_effects.%{_player1}%::*} to all of the active potion effects on {_player1}
  520. loop {_effects.%{_player1}%::*}:
  521. remove loop-value-2 from {_player1}
  522. set {_effects.%{_player2}%::*} to all of the active potion effects on {_player2}
  523. loop {_effects.%{_player2}%::*}:
  524. remove loop-value-2 from {_player2}
  525.  
  526.  
  527. if {inv.%{_type}%::%{_player1}%} is set:
  528. set {_slload.%{_player1}%} to 0
  529. restore inventory of {_player1} from {custom.%{_type}%.%{_player1}%}
  530. equip {_player1} with {boots.%{_type}%.%{_player1}%}
  531. equip {_player1} with {chest.%{_type}%.%{_player1}%}
  532. equip {_player1} with {legs.%{_type}%.%{_player1}%}
  533. equip {_player1} with {helm.%{_type}%.%{_player1}%}
  534. clear {_slload.%{_player1}%}
  535.  
  536. if {inv.%{_type}%::%{_player1}%} is not set:
  537. set {_slload.%{_player1}%} to 0
  538. restore inventory of {_player1} from {default.%{_type}%}
  539. equip {_player1} with {bootsdefault.%{_type}%}
  540. equip {_player1} with {chestdefault.%{_type}%}
  541. equip {_player1} with {legsdefault.%{_type}%}
  542. equip {_player1} with {helmdefault.%{_type}%}
  543. clear {_slload.%{_player1}%}
  544.  
  545. if {inv.%{_type}%::%{_player2}%} is set:
  546. set {_slload.%{_player2}%} to 0
  547. restore inventory of {_player2} from {custom.%{_type}%.%{_player2}%}
  548. equip {_player2} with {boots.%{_type}%.%{_player2}%}
  549. equip {_player2} with {chest.%{_type}%.%{_player2}%}
  550. equip {_player2} with {legs.%{_type}%.%{_player2}%}
  551. equip {_player2} with {helm.%{_type}%.%{_player2}%}
  552. clear {_slload.%{_player2}%}
  553.  
  554. if {inv.%{_type}%::%{_player2}%} is not set:
  555. set {_slload.%{_player2}%} to 0
  556. restore inventory of {_player2} from {default.%{_type}%}
  557. equip {_player2} with {bootsdefault.%{_type}%}
  558. equip {_player2} with {chestdefault.%{_type}%}
  559. equip {_player2} with {legsdefault.%{_type}%}
  560. equip {_player2} with {helmdefault.%{_type}%}
  561. clear {_slload.%{_player2}%}
  562.  
  563. if {@S} > 0:
  564.  
  565. set {_rn} to {@S}
  566. apply slowness tier 10 to {_player1} for {@S} seconds
  567. apply slowness tier 10 to {_player2} for {@S} seconds
  568. apply jump boost tier -10 to {_player1} for {@S} seconds
  569. apply jump boost tier -10 to {_player2} for {@S} seconds
  570. loop {_rn} times:
  571. message "&7<bold>Duel Starting in &b%{_rn}% &7<bold>seconds" to {_player1} and {_player2}
  572. play "NOTE_PLING" specifically to {_player1} with pitch 5 and volume 1000
  573. play "NOTE_PLING" specifically to {_player2} with pitch 5 and volume 1000
  574. send {_player1} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
  575. send {_player2} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
  576. remove 1 from {_rn}
  577. wait 1 second
  578. send {_player1} title "&bGo!" with subtitle "" for 1 seconds
  579. send {_player2} title "&bGo!" with subtitle "" for 1 seconds
  580. play "NOTE_PLING" specifically to {_player2} with pitch 1 and volume 1000
  581. remove slowness from {_player1}
  582. remove slowness from {_player2}
  583. remove jump boost from {_player1}
  584. remove jump boost from {_player2}
  585. delete {_rn}
  586.  
  587. stop
  588.  
  589. if {@S} <= 0:
  590.  
  591. stop
  592.  
  593. if {arena.%{option.%player%}%.option} is true:
  594.  
  595. remove {option.%player%} from {_arenas::*}
  596. add 1 to {_used}
  597. if {_used} = {_ar}:
  598. message "&7All arenas are being used. Try later"
  599.  
  600.  
  601. if {_size} = 1:
  602. set {queue.%player%} to true
  603. message "&7You have been added to the &b%{_type}% &7queue." to player
  604. set slot 0 of player to {@Q} named "{@QN}"
  605. stop
  606.  
  607.  
  608.  
  609. command /matchstatus:
  610. permission: duel.match.status
  611. permission message: &cYou don't have permission for that.
  612. trigger:
  613. loop {dueltype::*}:
  614. loop {match.%loop-value-1%::*}:
  615. message "%loop-value-1% - %loop-value-2%"
  616.  
  617. command /leave:
  618. permission: duel.leave
  619. permission message: &cYou don't have permission for that.
  620. trigger:
  621. if {queue.%player%} is true:
  622. set {queue.%player%} to false
  623. loop {dueltype::*}:
  624. remove player from {match.%loop-value%::*}
  625. message "&7You left the queue."
  626. set slot 0 of player to air
  627. stop
  628. if {queue.%player%} is false:
  629. message "&7You are not in a queue."
  630. stop
  631.  
  632. on right click:
  633. if player's tool is {@Q}:
  634. if name of player's tool is "{@QN}":
  635. make player execute command "/leave"
  636.  
  637.  
  638. on death of a player:
  639. if {duel.%player%.ingame} is true:
  640. set {respawn.lobby} to true
  641. set the death message to ""
  642. set {_looser} to player
  643. loop {duel.%{_looser}%::*}:
  644. remove {_looser} from {duel.%{_looser}%::*}
  645. wait 1 tick
  646. loop {duel.%{_looser}%::*}:
  647. set {_winnerd} to loop-value
  648. set {duel.%{_looser}%.ingame} to true
  649. set {duel.%{_looser}%.req} to true
  650. set {duel.%{_winnerd}%.ingame} to true
  651. set {duel.%{_winnerd}%.req} to true
  652. set {after.%{_winnerd}%} to true
  653. if {message.%{_winnerd}%} is true:
  654. broadcast "&b%{_winnerd}%&7 defeated &b%{_looser}%&7 in a duel"
  655. set {message.%{_winnerd}%} to false
  656. set {message.%{_looser}%} to false
  657. wait 5 seconds
  658. delete {ender.%{_winnerd}%}
  659. delete {ender.%{_looser}%}
  660. set {_effects.%{_winnerd}%::*} to all of the active potion effects on {_winnerd}
  661. loop {_effects.%{_winnerd}%::*}:
  662. remove loop-value from {_winnerd}
  663. set {_effects.%{_looser}%::*} to all of the active potion effects on {_looser}
  664. loop {_effects.%{_looser}%::*}:
  665. remove loop-value from {_looser}
  666. if {_winnerd} is dead:
  667. force respawn {_winnerd}
  668. if {_looser} is dead:
  669. force respawn {_looser}
  670. set {respawn.lobby} to false
  671. heal {_winnerd}
  672. heal {_looser}
  673. cure {_winnerd} from poison
  674. cure {_looser} from poison
  675. clear {_winnerd}'s inventory
  676. clear {_looser}'s inventory
  677. set {duel.%{_looser}%.ingame} to false
  678. set {duel.%{_looser}%.req} to false
  679. set {duel.%{_winnerd}%.ingame} to false
  680. set {duel.%{_winnerd}%.req} to false
  681. set {message.%{_winnerd}%} to true
  682. remove {_winnerd} from {stopbackup::*}
  683. remove {_looser} from {stopbackup::*}
  684. clear {duel.%{_winnerd}%::*}
  685. clear {duel.%{_looser}%::*}
  686. set {after.%{_winnerd}%} to false
  687. set {arena.%{option.%{_winnerd}%}%.option} to false
  688. set {arena.%{option.%{_looser}%}%.option} to false
  689. if {lobby.arena} is set:
  690. teleport {_winnerd} to {lobby.arena}
  691. teleport {_looser} to {lobby.arena}
  692. if {lobby.arena} is not set:
  693. teleport {_winnerd} to {lastloc.%{_winnerd}%}
  694. teleport {_looser} to {lastloc.%{_looser}%}
  695. wait 1 tick
  696. clear {lastloc.%{_winnerd}%}
  697. clear {lastloc.%{_looser}%}
  698. stop
  699.  
  700. on quit:
  701. if {duel.%player%.ingame} is true:
  702. set {_looser} to player
  703. loop {duel.%{_looser}%::*}:
  704. remove {_looser} from {duel.%{_looser}%::*}
  705. wait 1 tick
  706. loop {duel.%{_looser}%::*}:
  707. set {_winnerd} to loop-value
  708. set {duel.%{_looser}%.ingame} to true
  709. set {duel.%{_looser}%.req} to true
  710. set {duel.%{_winnerd}%.ingame} to true
  711. set {duel.%{_winnerd}%.req} to true
  712. set {after.%{_winnerd}%} to true
  713. if {message.%{_winnerd}%} is true:
  714. broadcast "&b%{_winnerd}%&7 defeated &b%{_looser}%&7 in a duel for logging out."
  715. set {message.%{_winnerd}%} to false
  716. set {message.%{_looser}%} to false
  717. wait 1 tick
  718. set {quit.%{_looser}%} to true
  719. wait 5 seconds
  720. delete {ender.%{_winnerd}%}
  721. delete {ender.%{_looser}%}
  722. set {_effects.%{_winnerd}%::*} to all of the active potion effects on {_winnerd}
  723. loop {_effects.%{_winnerd}%::*}:
  724. remove loop-value from {_winnerd}
  725. if {_winnerd} is dead:
  726. force respawn {_winnerd}
  727. if {_looser} is dead:
  728. force respawn {_looser}
  729. heal {_winnerd}
  730. clear {_winnerd}'s inventory
  731. clear {_looser}'s inventory
  732. set {duel.%{_looser}%.ingame} to false
  733. set {duel.%{_looser}%.req} to false
  734. set {duel.%{_winnerd}%.ingame} to false
  735. set {duel.%{_winnerd}%.req} to false
  736. remove {_winnerd} from {stopbackup::*}
  737. remove {_looser} from {stopbackup::*}
  738. clear {duel.%{_winnerd}%::*}
  739. clear {duel.%{_looser}%::*}
  740. set {after.%{_winnerd}%} to false
  741. set {arena.%{option.%{_winnerd}%}%.option} to false
  742. set {arena.%{option.%{_looser}%}%.option} to false
  743. if {lobby.arena} is set:
  744. teleport {_winnerd} to {lobby.arena}
  745. teleport {_looser} to {lobby.arena}
  746. if {lobby.arena} is not set:
  747. teleport {_winnerd} to {lastloc.%{_winnerd}%}
  748. clear {lastloc.%{_winnerd}%}
  749. if {queue.%player%} is true:
  750. set {queue.%player%} to false
  751. loop {dueltype::*}:
  752. remove player from {match.%loop-value%::*}
  753.  
  754. on respawn:
  755. clear player's inventory
  756. if {respawn.lobby} is true:
  757. if {lobby.arena} is set:
  758. teleport player to {lobby.arena}
  759. if {lobby.arena} is not set:
  760. teleport player to {lastloc.%player%}
  761. clear {lastloc.%player%}
  762.  
  763.  
  764. command /createarena <text>:
  765. permission: duel.arena.create
  766. permission message: &cYou don't have permission for that.
  767. usage: &7/createarena &b<arena>
  768. trigger:
  769. if {arenas::%arg 1%} is set:
  770. message "&7<bold>Arena already exists"
  771. else:
  772. set {arenas::%arg 1%} to arg 1
  773. message "&7<bold>Arena &b%arg 1% &7<bold>Created!"
  774. set {arena.%arg-1%.option} to false
  775.  
  776. command /setspawnpoint <text> <integer>:
  777. permission: duel.arena.spawn
  778. permission message: &cYou don't have permission for that.
  779. usage: &7/setspawnpoint &b<arena> <player>
  780. trigger:
  781. if {arenas::%arg 1%} is set:
  782. if arg-2 = 1:
  783. set {arena.%arg 1%.spawn.1} to location of player
  784. send "&7<bold>Arena &b<bold>%arg 1% &7<bold>First spawn set to %location of player%" to player
  785. if arg-2 = 2:
  786. set {arena.%arg 1%.spawn.2} to location of player
  787. send "&7<bold>Arena &b<bold>%arg 1% &7<bold>Second spawn set to %location of player%" to player
  788. if arg-2 > 2:
  789. send "&7<bold>Invalid Spawnpoint."
  790. if arg-2 < 1:
  791. send "&7<bold>Invalid Spawnpoint."
  792. else:
  793. send "&7<bold>Arena &b<bold>%arg 1% &7<bold>doesn't exist" to player
  794.  
  795. command /lobbyarena:
  796. permission: duel.lobby.set
  797. permission message: &cYou don't have permission for that.
  798. trigger:
  799. set {lobby.arena} to location of player
  800. message "&7<bold>Lobby was successfully created."
  801. stop
  802.  
  803. command /lobbyclear:
  804. permission: duel.lobby.clear
  805. permission message: &cYou don't have permission for that.
  806. trigger:
  807. if {lobby.arena} is set:
  808. delete {lobby.arena}
  809. message "&7<bold>Lobby was deleted"
  810. stop
  811. if {lobby.arena} is not set:
  812. message "&7<bold>You have not set a lobby yet."
  813. stop
  814.  
  815.  
  816. command /cleararena <text>:
  817. permission: duel.arena.clear
  818. permission message: &cYou don't have permission for that.
  819. usage: &7/cleararena &b<arena>
  820. trigger:
  821. if size of {arenas::*} > 0:
  822. loop {arenas::*}:
  823. if {arenas::%arg-1%} is set:
  824. delete {arenas::%arg 1%}
  825. remove arg 1 from {arenas::*}
  826. clear {arena.%arg 1%.spawn.1}
  827. clear {arena.%arg 1%.spawn.2}
  828. send "&7<bold>Arena &b<bold>%arg 1% &7<bold>cleared" to player
  829. stop
  830. else:
  831. send "&7<bold>Arena &b<bold>%arg 1% &7<bold>doesn't exist" to player
  832. stop
  833. else:
  834. message "&7<bold>You haven't created any arenas" to player
  835.  
  836. command /clearall:
  837. permission: duel.arena.clearall
  838. permission message: &cYou don't have permission for that.
  839. trigger:
  840. if size of {arenas::*} > 0:
  841. loop {arenas::*}:
  842. delete {arenas::%loop-value%}
  843. delete {arena.%loop-value%.spawn.1}
  844. delete {arena.%loop-value%.spawn.2}
  845. message "&7<bold>All arenas have been cleared"
  846. else:
  847. message "&7<bold>You haven't set any arenas"
  848.  
  849.  
  850. command /listarena:
  851. permission: duel.arena.list
  852. permission message: &cYou don't have permission for that.
  853. trigger:
  854. if size of {arenas::*} = 0:
  855. message "&7<bold>You haven't created any arenas."
  856.  
  857. if size of {arenas::*} > 0:
  858. loop {arenas::*}:
  859. message "&7<bold>Arena - &b%loop-value%"
  860.  
  861. command /tparena <text> <integer>:
  862. permission: duel.arena.tp
  863. permission message: &cYou don't have permission for that.
  864. usage: &7/tparena &b<arena> <player>
  865. trigger:
  866. if {arenas::%arg 1%} is set:
  867. if arg-2 = 1:
  868. if {arena.%arg 1%.spawn.1} is not set:
  869. message "&7<bold>That spawn has not been set."
  870. if {arena.%arg 1%.spawn.1} is set:
  871. teleport player to {arena.%arg 1%.spawn.1}
  872. send "&7<bold>You have been teleported to &b<bold>Arena %arg 1% &7<bold>to &b<bold>Player %arg 2% &7<bold>spawn" to player
  873. if arg-2 = 2:
  874. if {arena.%arg 1%.spawn.2} is not set:
  875. message "&7<bold>That spawn has not been set."
  876. if {arena.%arg 1%.spawn.2} is set:
  877. teleport player to {arena.%arg 1%.spawn.2}
  878. send "&7<bold>You have been teleported to &b<bold>Arena %arg 1% &7<bold>to &7<bold>bPlayer %arg 2% &7<bold>spawn" to player
  879. else:
  880. send "&7<bold>Arena &b<bold>%arg 1% &7<bold>doesn't exist" to player
  881.  
  882. command /custominv <text> <text> [<player>]:
  883. trigger:
  884.  
  885. if arg-1 is "save":
  886.  
  887. if arg-3 is set:
  888.  
  889. if arg-3 is not player:
  890.  
  891. if player has permission "duel.inv.save":
  892.  
  893. if {dueltype::%arg-2%} is set:
  894.  
  895. if arg-3 can't hold 36 wooden swords:
  896.  
  897. delete {inv.%arg-2%::%arg-3%}
  898. set {inv.%arg-2%::%arg-3%} to arg-3
  899. clear {custom.%arg-2%.%arg-3%}
  900. set {custom.%arg-2%.%arg-3%} to arg-3's serialized inventory
  901. set {helm.%arg-2%.%arg-3%} to helmet of arg-3
  902. set {chest.%arg-2%.%arg-3%} to chestplate of arg-3
  903. set {legs.%arg-2%.%arg-3%} to leggings of arg-3
  904. set {boots.%arg-2%.%arg-3%} to boots of arg-3
  905. clear arg-3's helmet
  906. clear arg-3's chestplate
  907. clear arg-3's leggings
  908. clear arg-3's boots
  909. equip player argument with {helm.%arg-2%.%arg-3%}
  910. equip player argument with {chest.%arg-2%.%arg-3%}
  911. equip player argument with {legs.%arg-2%.%arg-3%}
  912. equip player argument with {boots.%arg-2%.%arg-3%}
  913. message "&7<bold>Inventory succesfully saved." to arg-3
  914. stop
  915.  
  916. if arg-3 can hold 36 wooden swords:
  917. message "&7<bold>You cannot save the inventory if it is empty"
  918. stop
  919.  
  920. if {dueltype::%arg-1%} is not set:
  921. message "&7<bold>You first need to create that duel type."
  922. stop
  923.  
  924. else:
  925. message "&cYou don't have permission for that."
  926. stop
  927.  
  928. if arg-3 is player:
  929.  
  930. if {dueltype::%arg-2%} is set:
  931.  
  932. arg-3 can't hold 36 wooden swords:
  933.  
  934. delete {inv.%arg-2%::%arg-3%}
  935. set {inv.%arg-2%::%arg-3%} to arg-3
  936. clear {custom.%arg-2%.%arg-3%}
  937. set {custom.%arg-2%.%arg-3%} to arg-3's serialized inventory
  938. set {helm.%arg-2%.%arg-3%} to helmet of arg-3
  939. set {chest.%arg-2%.%arg-3%} to chestplate of arg-3
  940. set {legs.%arg-2%.%arg-3%} to leggings of arg-3
  941. set {boots.%arg-2%.%arg-3%} to boots of arg-3
  942. clear arg-3's helmet
  943. clear arg-3's chestplate
  944. clear arg-3's leggings
  945. clear arg-3's boots
  946. equip player argument with {helm.%arg-2%.%arg-3%}
  947. equip player argument with {chest.%arg-2%.%arg-3%}
  948. equip player argument with {legs.%arg-2%.%arg-3%}
  949. equip player argument with {boots.%arg-2%.%arg-3%}
  950. message "&7<bold>Inventory succesfully saved." to arg-3
  951. stop
  952.  
  953. if arg-3 can hold 36 wooden swords:
  954. message "&7<bold>You cannot save the inventory if it is empty"
  955. stop
  956.  
  957. if {dueltype::%arg-2%} is not set:
  958. message "&7<bold>You first need to create that duel type."
  959. stop
  960.  
  961. if arg-3 is not set:
  962.  
  963. make player execute command "/custominv save %arg-2% %player%"
  964. stop
  965.  
  966. if arg-1 is "delete":
  967.  
  968. if arg-3 is set:
  969.  
  970. if arg-3 is not player:
  971.  
  972. if player has permission "duel.inv.delete":
  973.  
  974. if {dueltype::%arg-2%} is set:
  975.  
  976. delete {inv.%arg-2%::%arg-3%}
  977. delete {custom.%arg-2%.%arg-3%}
  978. delete {helm.%arg-2%.%arg-3%}
  979. delete {chest.%arg-2%.%arg-3%}
  980. delete {legs.%arg-2%.%arg-3%}
  981. delete {boots.%arg-2%.%arg-3%}
  982. message "&7<bold>Current Inventory of %arg-3% Succesfully Deleted" to arg-3
  983. stop
  984.  
  985. if {dueltype::%arg-2%} is not set:
  986. message "&7<bold>You first need to create that duel type."
  987. stop
  988.  
  989. else:
  990. message "&cYou don't have permission for that."
  991. stop
  992.  
  993. if arg-3 is player:
  994.  
  995. if {dueltype::%arg-2%} is set:
  996.  
  997. delete {inv.%arg-2%::%arg-3%}
  998. delete {custom.%arg-2%.%arg-3%}
  999. delete {helm.%arg-2%.%arg-3%}
  1000. delete {chest.%arg-2%.%arg-3%}
  1001. delete {legs.%arg-2%.%arg-3%}
  1002. delete {boots.%arg-2%.%arg-3%}
  1003. message "&7<bold>Current Inventory of %arg-3% Succesfully Deleted" to arg-3
  1004. stop
  1005.  
  1006. if {dueltype::%arg-2%} is not set:
  1007. message "&7<bold>You first need to create that duel type."
  1008. stop
  1009.  
  1010. if arg-3 is not set:
  1011.  
  1012. make player execute command "/custominv delete %arg-2% %player%"
  1013. stop
  1014.  
  1015. if arg-1 is "load":
  1016.  
  1017. if arg-3 is set:
  1018.  
  1019. if arg-3 is not player:
  1020.  
  1021. if player has permission "duel.inv.load":
  1022.  
  1023. if {dueltype::%arg-2%} is set:
  1024.  
  1025. set {_type} to arg-2
  1026. restore inventory of arg-3 from {custom.%arg-2%.%arg-3%}
  1027. equip arg-3 with {boots.%{_type}%.%arg-3%}
  1028. equip arg-3 with {chest.%{_type}%.%arg-3%}
  1029. equip arg-3 with {legs.%{_type}%.%arg-3%}
  1030. equip arg-3 with {helm.%{_type}%.%arg-3%}
  1031. stop
  1032.  
  1033. if {dueltype::%arg-2%} is not set:
  1034. message "&7<bold>You first need to create that duel type."
  1035. stop
  1036.  
  1037. else:
  1038. message "&cYou don't have permission for that."
  1039.  
  1040. if arg-3 is player:
  1041.  
  1042. if {dueltype::%arg-2%} is set:
  1043.  
  1044. set {_type} to arg-2
  1045. restore inventory of arg-3 from {custom.%arg-2%.%arg-3%}
  1046. equip arg-3 with {boots.%{_type}%.%arg-3%}
  1047. equip arg-3 with {chest.%{_type}%.%arg-3%}
  1048. equip arg-3 with {legs.%{_type}%.%arg-3%}
  1049. equip arg-3 with {helm.%{_type}%.%arg-3%}
  1050. stop
  1051.  
  1052. if {dueltype::%arg-2%} is not set:
  1053.  
  1054. message "&7<bold>You first need to create that duel type."
  1055. stop
  1056.  
  1057. if arg-3 is not set:
  1058.  
  1059. make player execute command "/custominv load %arg-2% %player%"
  1060. stop
  1061.  
  1062.  
  1063. command /defaultinv <text> <text>:
  1064. permission: duel.inv.default
  1065. permission message: &cYou don't have permission for that.
  1066. trigger:
  1067. if arg-1 is "save":
  1068. if {dueltype::%arg-2%} is set:
  1069. player can't hold 36 wooden swords:
  1070. clear {default.%arg-2%}
  1071. set {default.%arg-2%} to player's serialized inventory
  1072. set {helmdefault.%arg-2%} to helmet of the player
  1073. set {chestdefault.%arg-2%} to chestplate of the player
  1074. set {legsdefault.%arg-2%} to leggings of the player
  1075. set {bootsdefault.%arg-2%} to boots of the player
  1076. clear player's helmet
  1077. clear player's chestplate
  1078. clear player's leggings
  1079. clear player's boots
  1080. equip player with {helmdefault.%arg-2%}
  1081. equip player with {chestdefault.%arg-2%}
  1082. equip player with {legsdefault.%arg-2%}
  1083. equip player with {bootsdefault.%arg-2%}
  1084. message "&7<bold>Default inventory succesfully saved."
  1085. player can hold 36 wooden swords:
  1086. message "&7<bold>You cannot save your inventory if it is empty"
  1087. stop
  1088. if {dueltype::%arg-2%} is not set:
  1089. message "&7<bold>You first need to create that duel type."
  1090. stop
  1091. if arg-1 is "load":
  1092. if {dueltype::%arg-2%} is set:
  1093. set {_type} to arg-2
  1094. restore inventory of player from {default.%{_type}%}
  1095. equip player with {bootsdefault.%{_type}%}
  1096. equip player with {chestdefault.%{_type}%}
  1097. equip player with {legsdefault.%{_type}%}
  1098. equip player with {helmdefault.%{_type}%}
  1099. stop
  1100. if {dueltype::%arg-2%} is not set:
  1101. message "&7<bold>You first need to create that duel type."
  1102. stop
  1103. if arg-1 is "delete":
  1104. if {dueltype::%arg-2%} is set:
  1105. delete {default.%arg-2%}
  1106. delete {helmdefault.%arg-2%}
  1107. delete {chestdefault.%arg-2%}
  1108. delete {legsdefault.%arg-2%}
  1109. delete {bootsdefault.%arg-2%}
  1110. message "&7<bold>Current Default Inventory Succesfully Deleted"
  1111. stop
  1112. if {dueltype::%arg-1%} is not set:
  1113. message "&7<bold>You first need to create that duel type."
  1114. stop
  1115.  
  1116.  
  1117.  
  1118. on join:
  1119. if {quit.%player%} is true:
  1120. set {_effects.%player%::*} to all of the active potion effects on player
  1121. loop {_effects.%player%::*}:
  1122. remove loop-value from player
  1123. clear player's inventory
  1124. heal player
  1125. if {lobby.arena} is set:
  1126. teleport player to {lobby.arena}
  1127. if {lobby.arena} is not set:
  1128. teleport player to {lastloc.%player%}
  1129. clear {lastloc.%player%}
  1130. set {quit.%player%} to false
  1131. if {backup.%player%} is true:
  1132. clear player's inventory
  1133. set {backup.%player%} to false
  1134. if {lobby.arena} is set:
  1135. teleport player to {lobby.arena}
  1136. if {lobby.arena} is not set:
  1137. teleport player to {lastloc.%player%}
  1138. set {duel.%player%.ingame} to false
  1139. set {duel.%player%.req} to false
  1140. set {after.%player%} to false
  1141. clear {reqs.%player%::*}
  1142. set {queue.%player%} to false
  1143. stop
  1144.  
  1145.  
  1146.  
  1147.  
  1148. on skript stop:
  1149. if size of {arenas::*} > 0:
  1150. set {list::*} to {arenas::*}
  1151. loop {list::*}:
  1152. set {_onstop} to size of {arenas::*}
  1153. loop {_onstop} times:
  1154. set {_onstopa} to random element of {list::*}
  1155. set {arena.%{_onstopa}%.option} to false
  1156. remove {_onstopa} from {list::*}
  1157. delete {list::*}
  1158. loop {stopbackup::*}:
  1159. set {_nump} to size of {stopbackup::*}
  1160. loop {_nump} times:
  1161. set {_playerstop} to random element of {stopbackup::*}
  1162. set {backup.%{_playerstop}%} to true
  1163. remove {_playerstop} from {stopbackup::*}
  1164. delete {stopbackup::*}
  1165. loop {dueltype::*}:
  1166. clear {match.%loop-value%::*}
  1167. stop
  1168.  
  1169. on skript start:
  1170. loop {dueltype::*}:
  1171. clear {match.%loop-value%::*}
  1172. stop
  1173.  
  1174. on shoot:
  1175. if {duel.%shooter%.ingame} is true:
  1176. if {ender.%shooter%} is true:
  1177. shooter is a player:
  1178. if projectile is an ender pearl:
  1179. set {_difference} to difference between {pearl.%shooter%.lastused} and now
  1180. if {_difference} is less than {@ECT} seconds:
  1181. cancel event
  1182. give 1 ender pearl with lore "&cKit" to shooter
  1183. set {_difference} to difference between {_difference} and {@ECT} seconds
  1184. message "&b%{_difference}% &7<bold>seconds left" to shooter
  1185. stop
  1186. set {pearl.%shooter%.lastused} to now
  1187.  
  1188.  
  1189. command /dueltype <text>:
  1190. permission: duel.type
  1191. permission message: &cYou don't have permission for that.
  1192. trigger:
  1193. if {dueltype::%arg-1%} is set:
  1194. message "&b%arg-1% &7<bold>duel type has already been set."
  1195. stop
  1196.  
  1197. if {dueltype::%arg-1%} is not set:
  1198. set {dueltype::%arg-1%} to arg-1
  1199. message "&7<bold>You set &b%arg-1% &7<bold>duel type."
  1200.  
  1201. command /dueltypeinv <text> <integer> <item>:
  1202. permission: duel.type.inv
  1203. permission message: &cYou don't have permission for that.
  1204. trigger:
  1205. if {dueltype::%arg-1%} is set:
  1206. if arg-2 <= 8:
  1207. set {_slot} to arg-2
  1208. clear {slot.%{_slot}%.name}
  1209. clear {slot.%{_slot}%.item}
  1210. loop {duel.%arg-1%::*}:
  1211. set {_slotdelinv} to loop-value
  1212. delete {typeset::%{_slotdelinv}%}
  1213. clear {slot.%{_slotdelinv}%.item}
  1214. clear {slot.%{_slotdelinv}%.name}
  1215. wait 1 tick
  1216. set {slot.%{_slot}%.name} to arg-1
  1217. set {slot.%{_slot}%.item} to arg-3
  1218. set {typeset::%arg-2%} to arg-2
  1219. clear {duel.%arg-1%::*}
  1220. wait 1 tick
  1221. add arg-2 to {duel.%arg-1%::*}
  1222. message "&7<bold>Item &b%arg-3% &7<bold>will be displayed in slot &b%{_slot}% &7<bold>for &b%arg-1% &7<bold>duel type."
  1223. if arg-2 > 8:
  1224. message "&7<bold>Invalid Slot"
  1225. if {dueltype::%arg-1%} is not set:
  1226. message "&7<bold>You first need to create that duel type."
  1227.  
  1228. command /dueltypedel <text>:
  1229. permission: duel.type.del
  1230. permission message: &cYou don't have permission for that.
  1231. trigger:
  1232. if {dueltype::%arg-1%} is set:
  1233. delete {dueltype::%arg-1%}
  1234. message "&b%arg-1% &7<bold>duel type deleted."
  1235. set {_slotdel} to 0
  1236. loop 36 times:
  1237. delete {slot.%{_slotdel}%.%arg-1%}
  1238. add 1 to {_slotdel}
  1239. clear {_slotdel}
  1240. loop {inv.%arg-1%::*}:
  1241. delete {custom.%arg-1%.%loop-value%}
  1242. delete {helm.%arg-1%.%loop-value%}
  1243. delete {chest.%arg-1%.%loop-value%}
  1244. delete {legs.%arg-1%.%loop-value%}
  1245. delete {boots.%arg-1%.%loop-value%}
  1246. delete {inv::*}
  1247. loop {duel.%arg-1%::*}:
  1248. set {_slotdelinv} to loop-value
  1249. delete {typeset::%{_slotdelinv}%}
  1250. clear {slot.%{_slotdelinv}%.item}
  1251. clear {slot.%{_slotdelinv}%.name}
  1252. stop
  1253. if {dueltype::%arg-1%} is not set:
  1254. message "&7<bold>You first need to create that duel type."
  1255. stop
  1256.  
  1257.  
  1258. command /dueltypelist:
  1259. permission: duel.type.list
  1260. permission message: &cYou don't have permission for that.
  1261. trigger:
  1262. loop {dueltype::*}:
  1263. message "&7Duel Type - %loop-value%"
  1264.  
  1265.  
  1266. command /clearslot <integer>:
  1267. permission: duel.type.slot
  1268. permission message: &cYou don't have permission for that.
  1269. trigger:
  1270. delete {typeset::%arg-1%}
  1271. clear {slot.%arg-1%.item}
  1272. clear {slot.%arg-1%.name}
  1273.  
  1274.  
  1275. on right click with a {@I}:
  1276. if name of player's tool is "{@IN}":
  1277. wait 1 tick
  1278. make player execute command "/match"
  1279. stop
  1280.  
  1281. command /matchitem:
  1282. permission: duel.match.item
  1283. permission message: &cYou don't have permission for that.
  1284. trigger:
  1285. give player 1 {@I} named "{@IN}"
  1286. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement