Guest User

Untitled

a guest
Sep 4th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.67 KB | None | 0 0
  1. # Author: Nawo
  2. # contact: [email protected]
  3. # Presentation: xxx
  4. # Launge: Polish
  5.  
  6. options:
  7.  
  8. prefix: &8[&6Castle&8]
  9. czas odliczania: 15
  10.  
  11. coins: 50
  12. vip coins: 100
  13.  
  14. variables:
  15. {castle::gracz::kill::%player%} = 0
  16. {castle::gracz::death::%player%} = 0
  17. {castle::gracz::win::%player%} = 0
  18. {castle::gracz::pkt::%player%} = 0
  19. {castle::gracz::%player%::dolacz} = false
  20. {castle::gracz::buy1::%player%} = 0
  21. {castle::gracz::buy2::%player%} = 0
  22. {castle::gracz::buy3::%player%} = 0
  23. {castle::gracz::buy4::%player%} = 0
  24. {castle::gracz::buy5::%player%} = 0
  25. {castle::gracz::buy6::%player%} = 0
  26. {castle::gracz::buy7::%player%} = 0
  27. {castle::gracz::buy8::%player%} = 0
  28. {castle::gracz::buy9::%player%} = 0
  29. command /castle [<text="info">] [<text>] [<text=integer>]:
  30. trigger:
  31. if arg 1 is "info":
  32. send "&8>======{@prefix}&8======"
  33. send " "
  34. send "&8> &6/castle join &8- &7Dolacza do rozgrywki."
  35. send "&8> &6/castle leave &8- &7opuszcza rozgrywke."
  36. send "&8> &6/castle list &8- &7lista aren."
  37. send "&8> &6/castle top &8- &7Najlepsi gracze."
  38. send "&8> &6/castle stats &8- &7Statystyki gracza."
  39. send "&8> &6/castle gui &8- &7Otwiera menu."
  40. send "&8> &6/castle buy &8- &7Kupuje przedmioty."
  41. send "&8> &6/castle changeteam &8- &7Zmienia team."
  42. send "&8> &6/castle start &8- &7Glosuje na start gry."
  43. if player has permission "castle.*":
  44. send " "
  45. send "&8> &6/castle create &8- &7Tworzy nowa arene."
  46. send "&8> &6/castle remove &8- &7Usuwa arene."
  47. send "&8> &6/castle setspawn &8- &7Ustawia spawny dla graczy."
  48. send "&8> &6/castle debug &8- &7Restartuje arene."
  49. send "&8> &6/castle reload &8- &7Przeladowuje skrypt."
  50. send "&8> &6/castle active &8- &7Aktywuje arene."
  51. send "&8> &6/castle deactive &8- &7Dezaktywuje arene."
  52. send "&8> &6/castle setplayers &8- &7Ustawia liczbe graczy na arenie."
  53. send "&8> &6/castle seteq &8- &7Ustawia domyslny inwentarz."
  54. send "&8> &6/castle seteqvip &8- &7Ustawia vip inwentarz."
  55. send "&8> &6/castle setpkt &8- &7Ustawia punkty graczy."
  56. send " "
  57. send "&8>======{@prefix}&8======"
  58. if arg 1 is "setpkt":
  59. if player has permission "castle.*":
  60. if arg 2 is set:
  61. if arg 2 is "add" or "remove" or "set":
  62. if arg 3 is set:
  63. set {_player} to arg 3 parsed as player
  64. else:
  65. set {_player} to player
  66. if arg-integer is set:
  67. if arg 2 is "add":
  68. add arg-integer to {castle::gracz::pkt::%{_player}%}
  69. send "{@prefix} &7Dodales &6%arg-integer% punktow &7dla gracza &6%{_player}%&7."
  70. if arg 2 is "remove":
  71. remove arg-integer from {castle::gracz::pkt::%{_player}%}
  72. send "{@prefix} &7Zabrales &6%arg-integer% punktow &7dla gracza &6%{_player}%&7."
  73. if arg 2 is "set":
  74. set {castle::gracz::pkt::%{_player}%} to arg-integer
  75. send "{@prefix} &7Ustawiles &6%arg-integer% punktow &7dla gracza &6%{_player}%&7."
  76. else:
  77. send "{@prefix} &7Uzycie: &6/castle setpkt &7<&6ADD&8/&6REMOVE&8/&6SET&7> <&6GRACZ&7> <&6LICZBA&7>"
  78. else:
  79. send "{@prefix} &7Uzycie: &6/castle setpkt &7<&6ADD&8/&6REMOVE&8/&6SET&7> <&6GRACZ&7> <&6LICZBA&7>"
  80. else:
  81. send "{@prefix} &7Uzycie: &6/castle setpkt &7<&6ADD&8/&6REMOVE&8/&6SET&7> <&6GRACZ&7> <&6LICZBA&7>"
  82. else:
  83. send "&cNie posiadasz uprawnien!"
  84. if arg 1 is "buy":
  85. if arg 2 is "1":
  86. if {castle::gracz::pkt::%player%}+1 > 1000:
  87. if {castle::buy::1::%player%} < 1:
  88. add 1 to {castle::buy::1::%player%}
  89. remove 1000 from {castle::gracz::pkt::%player%}
  90. send "{@prefix} &7Kupiles &6diamond helmet &7za &61000 &7punktow."
  91. add diamond helmet of protection 4 and unbreaking 3 to {castle::player::%player%::inventory::*}
  92. else:
  93. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  94. else:
  95. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  96. if arg 2 is "2":
  97. if {castle::gracz::pkt::%player%}+1 > 1000:
  98. if {castle::buy::2::%player%} < 1:
  99. add 1 to {castle::buy::2::%player%}
  100. remove 1000 from {castle::gracz::pkt::%player%}
  101. send "{@prefix} &7Kupiles &6diamond chestplate &7za &61000 &7punktow."
  102. add diamond chestplate of protection 4 and unbreaking 3 to {castle::player::%player%::inventory::*}
  103. else:
  104. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  105. else:
  106. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  107. if arg 2 is "3":
  108. if {castle::gracz::pkt::%player%}+1 > 1000:
  109. if {castle::buy::3::%player%} < 1:
  110. add 1 to {castle::buy::3::%player%}
  111. remove 1000 from {castle::gracz::pkt::%player%}
  112. send "{@prefix} &7Kupiles &6diamond leggings &7za &61000 &7punktow."
  113. add diamond leggings of protection 4 and unbreaking 3 to {castle::player::%player%::inventory::*}
  114. else:
  115. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  116. else:
  117. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  118. if arg 2 is "4":
  119. if {castle::gracz::pkt::%player%}+1 > 1000:
  120. if {castle::buy::4::%player%} < 1:
  121. add 1 to {castle::buy::4::%player%}
  122. remove 1000 from {castle::gracz::pkt::%player%}
  123. send "{@prefix} &7Kupiles &6diamond boots &7za &61000 &7punktow."
  124. add diamond boots of protection 4 and unbreaking 3 to {castle::player::%player%::inventory::*}
  125. else:
  126. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  127. else:
  128. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  129. if arg 2 is "5":
  130. if {castle::gracz::pkt::%player%}+1 > 10000:
  131. if {castle::buy::5::%player%} < 5:
  132. add 1 to {castle::buy::5::%player%}
  133. remove 10000 from {castle::gracz::pkt::%player%}
  134. send "{@prefix} &7Kupiles &6koxa &7za &610000 &7punktow."
  135. add enchanted golden apple to {castle::player::%player%::inventory::*}
  136. else:
  137. send "{@prefix} &7Ten przedmiot mozna kupic tylko &65 &7razy!"
  138. else:
  139. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  140. if arg 2 is "6":
  141. if {castle::gracz::pkt::%player%}+1 > 5000:
  142. if {castle::buy::6::%player%} < 10:
  143. add 1 to {castle::buy::6::%player%}
  144. remove 5000 from {castle::gracz::pkt::%player%}
  145. send "{@prefix} &7Kupiles &6refila &7za &65000 &7punktow."
  146. add golden apple to {castle::player::%player%::inventory::*}
  147. else:
  148. send "{@prefix} &7Ten przedmiot mozna kupic tylko &610 &7razy!"
  149. else:
  150. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  151. if arg 2 is "7":
  152. if {castle::gracz::pkt::%player%}+1 > 2500:
  153. if {castle::buy::7::%player%} < 1:
  154. add 1 to {castle::buy::7::%player%}
  155. remove 2500 from {castle::gracz::pkt::%player%}
  156. send "{@prefix} &7Kupiles &6perle &7za &62500 &7punktow."
  157. add ender pearl to {castle::player::%player%::inventory::*}
  158. else:
  159. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  160. else:
  161. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  162. if arg 2 is "8":
  163. if {castle::gracz::pkt::%player%}+1 > 7500:
  164. if {castle::buy::8::%player%} < 1:
  165. add 1 to {castle::buy::8::%player%}
  166. remove 7500 from {castle::gracz::pkt::%player%}
  167. send "{@prefix} &7Kupiles &6miecz knockback 2 &7za &67500 &7punktow."
  168. add diamond sword of knockback 2 to {castle::player::%player%::inventory::*}
  169. else:
  170. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  171. else:
  172. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  173. if arg 2 is "9":
  174. if {castle::gracz::pkt::%player%}+1 > 7500:
  175. if {castle::buy::9::%player%} < 1:
  176. add 1 to {castle::buy::9::%player%}
  177. remove 7500 from {castle::gracz::pkt::%player%}
  178. send "{@prefix} &7Kupiles &6luk punch 2 &7za &67500 &7punktow."
  179. add bow of punch 2 to {castle::player::%player%::inventory::*}
  180. else:
  181. send "{@prefix} &7Ten przedmiot mozna kupic tylko raz!"
  182. else:
  183. send "{@prefix} &7Nie masz wystarczajaco punktow!"
  184. if arg 1 is "gui":
  185. if {castle::gracz::%player%::dolacz} is true:
  186. open chest with 1 rows named "&6sklep" to player
  187. wait 1 tick
  188. format slot 0 of player with 1 of diamond helmet of protection 4 and unbreaking 3 with lore "&7Cena: &61000 ||&7kupiono: &6%{castle::buy::1::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 1"]
  189. format slot 1 of player with 1 of diamond chestplate of protection 4 and unbreaking 3 with lore "&7Cena: &61000 ||&7kupiono: &6%{castle::buy::2::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 2"]
  190. format slot 2 of player with 1 of diamond leggings of protection 4 and unbreaking 3 with lore "&7Cena: &61000 ||&7kupiono: &6%{castle::buy::3::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 3"]
  191. format slot 3 of player with 1 of diamond boots of protection 4 and unbreaking 3 with lore "&7Cena: &61000 ||&7kupiono: &6%{castle::buy::4::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 4"]
  192. format slot 4 of player with 1 of enchanted golden apple with lore "&7Cena: &610000 ||&7kupiono: &6%{castle::buy::5::%player%}%&8/&65 &7razy" to run [execute player command "/castle buy 5"]
  193. format slot 5 of player with 1 of golden apple with lore "&7Cena: &65000 ||&7kupiono: &6%{castle::buy::6::%player%}%&8/&610 &7razy" to run [execute player command "/castle buy 6"]
  194. format slot 6 of player with 1 of ender pearl with lore "&7Cena: &62500 ||&7kupiono: &6%{castle::buy::7::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 7"]
  195. format slot 7 of player with 1 of diamond sword of knockback 2 with lore "&7Cena: &67500 ||&7kupiono: &6%{castle::buy::8::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 8"]
  196. format slot 8 of player with 1 of bow of punch 2 with lore "&7Cena: &67500 ||&7kupiono: &6%{castle::buy::9::%player%}%&8/&61 &7razy" to run [execute player command "/castle buy 9"]
  197. else:
  198. send "{@prefix} &7Nie jestes na arenie."
  199. if arg 1 is "start":
  200. if {castle::gracz::%player%::dolacz} is true:
  201. if {castle::status::%{castle::gracz::%player%::arena}%} is not "w trakcie" or "odliczanie":
  202. if {castle::gracz::%player%::invite} is false:
  203. set {castle::gracz::%player%::invite} to true
  204. add 1 to {castle::invite::%{castle::gracz::%player%::arena}%}
  205. set {_num} to rounded up ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} / 2)
  206. send "{@prefix} &7Zaglosowales na start gry. &8[&e%{castle::invite::%{castle::gracz::%player%::arena}%}%&8/&6%{_num}%&8]"
  207. if {castle::invite::%{castle::gracz::%player%::arena}%} = {_num}:
  208. set {castle::status::%{castle::gracz::%player%::arena}%} to "odliczanie"
  209. loop {@czas odliczania} times:
  210. if (size of {castle::gracze::%{castle::gracz::%player%::arena}%::*}) = {castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%}:
  211. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  212. play raw sound "note.pling" at loo-value with pitch 1 volume 5
  213. set {_x} to level of loop-value - 1
  214. set level of loop-value to {_x}
  215. wait 1 second
  216. else:
  217. exit loop
  218. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  219. send "{@prefix} &cOdliczanie przerwane." to loop-value
  220. set level of loop-value to 0
  221. set {castle::status::%{castle::gracz::%player%::arena}%} to "oczekuje"
  222. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  223. set {castle::gracz::%loop-value%::invite} to false
  224. add loop-value to {_y::*)
  225. play raw sound "note.pling" at loop-value-1 with pitch 2 volume 5
  226. send "{@prefix} &7Gra wystartowala!" to loop-value
  227. clear loop-value's inventory
  228. if player has permission "castle.vip":
  229. loop {castle::eqvip::*}:
  230. add loop-value-2 to loop-value-1's inventory
  231. else:
  232. loop {castle::eq::*}:
  233. add loop-value-2 to loop-value-1's inventory
  234. loop {castle::player::%loop-value-1%::inventory::*}:
  235. add loop-value-2 to loop-value-1's inventory
  236. set level of loop-value to 0
  237. set {_num} to rounded up ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} / 2)
  238. loop {_num} times:
  239. set {_x%loop-number%} to random element out of {_y::*)
  240. loop {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}:
  241. if loop-value is not {_x%loop-number%}:
  242. add {_x%loop-number%} to {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}
  243. remove {_x%loop-index} from {_y::*)
  244. loop ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} - {_num}) times:
  245. set {_x%loop-number%} to random element out of {_y::*)
  246. loop {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}:
  247. if loop-value is not {_x%loop-number%}:
  248. add {_x%loop-number%} to {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}
  249. remove {_x%loop-index} from {_y::*)
  250. teleport {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*} to {castle::arena::spawnRED::%{castle::gracz::%player%::arena}%}
  251. teleport {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*} to {castle::arena::spawnBLUE::%{castle::gracz::%player%::arena}%}
  252. set {castle::status::%{castle::gracz::%player%::arena}%} to "w trakcie"
  253. loop {castle::gracz::%player%::inventory::*}:
  254. add loop-value to player's inventory
  255. else:
  256. send "{@prefix} &7Juz zaglosowales! &8[&e%{castle::invite::%{castle::gracz::%player%::arena}%}%&8/&6%{_num}%&8]"
  257. else:
  258. send "{@prefix} &7Gra jest w trakcie!"
  259. else:
  260. send "&8> &7Nie jestes na zadnej arenie."
  261. if arg 1 is "changeteam':
  262. if {castle::gracz::%player%::dolacz} is true:
  263. if arg 2 is "BLUE" or "RED":
  264. if arg 1 is "RED":
  265. set {_num} to rounded up ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} / 2)
  266. if (size of {castle::arena::teamRED::%{castle::gracz::%player%::arena}%}) < {_num}:
  267. remove player from {castle::arena::teamRED::%{castle::gracz::%player%::arena}%}
  268. remove player from {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%}
  269. add player to {castle::arena::teamRED::%{castle::gracz::%player%::arena}%}
  270. send "{@prefix} &7Zostales dodany do &cRED"
  271. else:
  272. send "{@prefix} &7Ta druzyna jest pelna!"
  273. if arg 1 is "BLUE":
  274. set {_num} to rounded up ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} / 2)
  275. if (size of {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%}) < {_num}:
  276. remove player from {castle::arena::teamRED::%{castle::gracz::%player%::arena}%}
  277. remove player from {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%}
  278. add player to {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%}
  279. send "{@prefix} &7Zostales dodany do &9BLUE"
  280. else:
  281. send "{@prefix} &7Ta druzyna jest pelna!"
  282. else:
  283. send "{@prefix} &7Uzycie: &6/castle changeteam &7<&6BLUE&8/&6RED&7>"
  284. else:
  285. send "&8> &7Nie jestes na zadnej arenie."
  286. if arg 1 is "seteq":
  287. if player has permission "castle.*":
  288. open chest with 3 rows named "&6Edytujesz zawartosc eq" to player
  289. wait 1 tick
  290. set {_slot} to 0
  291. loop {castle::eq::*}:
  292. set slot {_slot} of current inventory of player to loop-value-1
  293. add 1 to {_slot}
  294. set {castle::player::%player%::openedit} to "standard"
  295. send "{@prefix} &7Edytujesz zawartosc eq."
  296. while inventory name of player is "&6Edytujesz zawartosc eq":
  297. set {castle::player::%player%::openedit} to "standard"
  298. wait 5 tick
  299. stop
  300. else:
  301. send "&cNie posiadasz uprawnien!"
  302. if arg 1 is "seteqvip":
  303. if player has permission "castle.*":
  304. open chest with 3 rows named "&6Edytujesz zawartosc eq vip" to player
  305. wait 1 tick
  306. set {_slot} to 0
  307. loop {castle::eqvip::*}:
  308. set slot {_slot} of current inventory of player to loop-value-1
  309. add 1 to {_slot}
  310. set {castle::player::%player%::openedit} to "vip"
  311. send "{@prefix} &7Edytujesz zawartosc eq."
  312. while inventory name of player is "&6Edytujesz zawartosc eq vip":
  313. set {castle::player::%player%::openedit} to "vip"
  314. wait 5 tick
  315. stop
  316. else:
  317. send "&cNie posiadasz uprawnien!"
  318. if arg 1 is "deective":
  319. if player has permission "castle.*":
  320. if arg 2 is set:
  321. if {castle::arena::id::%arg 2%} is set:
  322. set {castle::status::%arg 2%} to "niedostepna"
  323. send "{@prefix} &7Dezaktywowano arene o ID &6%arg 2%&7."
  324. else:
  325. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  326. else:
  327. send "{@prefix} &7Uzycie: &6/castle deactive &7<&6ID&7>"
  328. else:
  329. send "&cNie posiadasz uprawnien!"
  330. if arg 1 is "active":
  331. if player has permission "castle.*":
  332. if arg 2 is set:
  333. if {castle::arena::id::%arg 2%} is set:
  334. if {castle::arena::spawnLOBBY::%arg 2%} is set:
  335. if {castle::arena::spawnBLUE::%arg 2%} is set:
  336. if {castle::arena::spawnRED::%arg 2%} is set:
  337. set {castle::status::%arg 2%} to "oczekuje"
  338. send "{@prefix} &7Aktywowano arene o ID &6%arg 2%&7."
  339. else:
  340. send "{@prefix} &7Ustaw RED spawn areny, &6/castle setspawn RED &7<&6ID&7>"
  341. else:
  342. send "{@prefix} &7Ustaw BLUE spawn areny, &6/castle setspawn BLUE &7<&6ID&7>"
  343. else:
  344. send "{@prefix} &7Ustaw LOBBY areny, &6/castle setspawn LOBBY &7<&6ID&7>"
  345. else:
  346. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  347. else:
  348. send "{@prefix} &7Uzycie: &6/castle active &7<&6ID&7>"
  349. else:
  350. send "&cNie posiadasz uprawnien!"
  351. if arg 1 is "setplayers":
  352. if player has permission "castle.*":
  353. if arg 2 is set:
  354. if {castle::arena::id::%arg 2%} is set:
  355. if arg 3 is set:
  356. set {castle::arena::minimumplayers::%arg 2%} to arg 3 parsed as integer
  357. send "{@prefix} &7Ustawiono &6%arg 3% &7graczy dla areny o o ID &6%arg 2%&7."
  358. else:
  359. send "{@prefix} &7Uzycie: &6/castle setplayers &7<&6ID&7> <&6liczba&7>"
  360. else:
  361. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  362. else:
  363. send "{@prefix} &7Uzycie: &6/castle setplayers &7<&6ID&7> <&6liczba&7>"
  364. else:
  365. send "&cNie posiadasz uprawnien!"
  366. if arg 1 is "create":
  367. if player has permission "castle.*":
  368. add 1 to {castle::list::*}
  369. set {castle::arena::minimumplayers::%arg 2%} to 16
  370. set {_x} to size of {castle::list::*}
  371. set {castle::arena::id::%{_x}%} to true
  372. send "{@prefix} &7Utworzono arene o ID &6%size of {castle::list::*}%&7."
  373. set {castle::status::%{_x}%} to "niedostepna"
  374. else:
  375. send "&cNie posiadasz uprawnien!"
  376. if arg 1 is "remove":
  377. if player has permission "castle.*":
  378. if arg 2 is set:
  379. if {castle::arena::id::%arg 2%} is set:
  380. remove 1 from {castle::list::*}
  381. delete {castle::status::%arg 2%}
  382. delete {castle::arena::id::%arg 2%}
  383. delete {castle::arena::spawnLOBBY::%arg 2%}
  384. delete {castle::arena::spawnBLUE::%arg 2%}
  385. delete {castle::arena::spawnRED::%arg 2%}
  386. delete {castle::arena::minimumplayers::%arg 2%}
  387. send "{@prefix} &7Usunieto arene o ID &6%arg 2%&7."
  388. else:
  389. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  390. else:
  391. send "{@prefix} &7Uzycie: &6/castle remove &7<&6ID&7>"
  392. else:
  393. send "&cNie posiadasz uprawnien!"
  394. if arg 1 is "list":
  395. send "{@prefix} &7Dostepne areny:"
  396. send " "
  397. if (size of {castle::list::*}) > 0:
  398. loop (size of {castle::list::*}) times:
  399. if {castle::status::%loop-number%} is "w trakcie":
  400. send "&8> &7ID &6%loop-number% &cW trakcie.."
  401. if {castle::status::%loop-number%} is "oczekuje":
  402. send "&8> &7ID &6%loop-number% &aOczekuje!"
  403. if {castle::status::%loop-number%} is "niedostepna":
  404. send "&8> &7ID &6%loop-number% &6Niedostepna."
  405. else:
  406. send "&8> &cBrak."
  407. if arg 1 is "top":
  408. if arg 2 is set:
  409. if arg 2 is "kill" or "death" or "win" or "pkt":
  410. send "&8>====={@prefix}&8====="
  411. send "&8> "
  412. send "&8> &7Top &6%arg 2%"
  413. set {_num} to size of {castle::gracz::%arg 2%::*}
  414. loop {_num} times:
  415. loop {castle::gracz::%arg 2%::*}:
  416. if {_v.%loop-number%} is not set:
  417. set {_v.%loop-number%} to loop-value
  418. set {_n.%loop-number%} to loop-index
  419. if loop-value is greater than {_v.%loop-number%}:
  420. set {_v.%loop-number%} to loop-value
  421. set {_n.%loop-number%} to loop-index
  422. remove {_v.%loop-number%} from {castle::gracz::%arg 2%::*}
  423. loop {_num} times:
  424. if loop-number is less than or equal to 5:
  425. send "&8> %loop-number%. &7%{_n.%loop-number%}% &8- &6%{_v.%loop-number%}%"
  426. set {castle::gracz::%arg 2%::%{_n.%loop-number%}%} to {_v.%loop-number%}
  427. else:
  428. send "{@prefix} &7Uzycie:"
  429. send "&8> &6/castle top kill"
  430. send "&8> &6/castle top death"
  431. send "&8> &6/castle top win"
  432. send "&8> &6/castle top pkt"
  433. else:
  434. send "{@prefix} &7Uzycie:"
  435. send "&8> &6/castle top kill"
  436. send "&8> &6/castle top death"
  437. send "&8> &6/castle top win"
  438. send "&8> &6/castle top pkt"
  439. if arg 1 is "stats":
  440. send "&8>====={@prefix}&8====="
  441. send " &6Twoje statystyki:"
  442. send "&8> &eZabojstwa&8: &c%{castle::gracz::kill::%player%}%"
  443. send "&8> &eSmierci&8: &c%{castle::gracz::death::%player%}%"
  444. send "&8> &eWygrane&8: &c%{castle::gracz::win::%player%}%"
  445. send "&8> &ePunkty&8: &c%{castle::gracz::pkt::%player%}%"
  446. send "&8>====={@prefix}&8====="
  447. if arg 1 is "setspawn":
  448. if player has permission "castle.*":
  449. if arg 2 is set:
  450. if {castle::arena::id::%arg 2%} is set:
  451. if arg 3 is set:
  452. if arg 3 is "BLUE" or "RED" or "LOBBY":
  453. set {castle::arena::spawn%arg 3%::%arg 2%} to location of player
  454. send "{@prefix} &7Ustawiono &6%arg 3% &7spawn dla areny o ID &6%arg 2%&7."
  455. else:
  456. send "{@prefix} &7Uzycie: &6/castle setspawn &7<&6ID&7> <&6BLUE&8/&6RED&8/&6LOBBY&7>"
  457. else:
  458. send "{@prefix} &7Uzycie: &6/castle setspawn &7<&6ID&7> <&6BLUE&8/&6RED&8/&6LOBBY&7>"
  459. else:
  460. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  461. else:
  462. send "{@prefix} &7Uzycie: &6/castle setspawn &7<&6ID&7> <&6BLUE&8/&6RED&8/&6LOBBY&7>"
  463. else:
  464. send "&cNie posiadasz uprawnien!"
  465. if arg 1 is "debug":
  466. if player has permission "castle.*":
  467. if arg 2 is set:
  468. if {castle::arena::id::%arg 2%} is set:
  469. clear {castle::gracze::%arg 2%::*}
  470. loop all players:
  471. if {castle::gracz::%loop-player%::arena} is arg 2:
  472. execute loop-player command "/castle leave"
  473. send "{@prefix} &7Arena zostala zrestartowana." to loop-player
  474. set {castle::status::%arg 2%} to "oczekuje"
  475. send "{@prefix} &7Zrestartowano arene o ID &6%arg 2%&7."
  476. else:
  477. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  478. else:
  479. send "{@prefix} &7Uzycie: &6/castle debug &7<&6ID&7>"
  480. else:
  481. send "&cNie posiadasz uprawnien!"
  482. if arg 1 is "reload":
  483. if player has permission "castle.*":
  484. loop {castle::list::*} times:
  485. clear {castle::gracze::%loop-number%::*}
  486. loop all players:
  487. if {castle::gracz::%loop-player%::arena} is loop-number:
  488. execute loop-player command "/castle leave"
  489. send "{@prefix} &7Arena zostala zrestartowana." to loop-player
  490. set {castle::status::%loop-number%} to "oczekuje"
  491. execute player command "sk reload %script%"
  492. else:
  493. send "&cNie posiadasz uprawnien!"
  494. if arg 1 is "join":
  495. if {castle::gracz::%player%::dolacz} is false:
  496. if arg 2 is set:
  497. if {castle::arena::id::%arg 2%} is set:
  498. if {castle::status::%arg 2%} is "oczekuje":
  499. if (size of {castle::gracz::%arg 2%::*}) < {castle::arena::minimumplayers::%arg 2%}+1:
  500. set {castle::gracz::%player%::eq} to serialized inventory of player
  501. clear player's inventory
  502. set slot 0 of player to diamond named "&6Sklep"
  503. set slot 0 of player to blue wool named "&6Dolacz do &9BLUE"
  504. set slot 0 of player to red wool named "&6Dolacz do &cRED"
  505. set slot 8 of player to bone named "&6Wyjdz"
  506. teleport player to {castle::arena::spawnLOBBY::%arg 2%}
  507. set {castle::gracz::%player%::arena} to arg 2
  508. set {castle::gracz::%player%::dolacz} to true
  509. add player to {castle::gracze::%{castle::gracz::%player%::arena}%::*}
  510. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  511. set level of loop-value to {@czas odliczania}+1
  512. send "{@prefix} &7Gracz &6%player% &7dolaczyl do gry. &8[&e%size of {castle::gracze::%{castle::gracz::%player%::arena}%::*}%&8/&6%{castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%}%&8]" to loop-value
  513. if (size of {castle::gracze::%{castle::gracz::%player%::arena}%::*}) = {castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%}:
  514. set {castle::status::%{castle::gracz::%player%::arena}%} to "odliczanie"
  515. loop {@czas odliczania} times:
  516. if (size of {castle::gracze::%{castle::gracz::%player%::arena}%::*}) = {castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%}:
  517. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  518. play raw sound "note.pling" at loo-value with pitch 1 volume 5
  519. set {_x} to level of loop-value - 1
  520. set level of loop-value to {_x}
  521. wait 1 second
  522. else:
  523. exit loop
  524. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  525. send "{@prefix} &cOdliczanie przerwane." to loop-value
  526. set level of loop-value to 0
  527. set {castle::status::%{castle::gracz::%player%::arena}%} to "oczekuje"
  528. if (size of {castle::gracze::%{castle::gracz::%player%::arena}%::*}) = {castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%}:
  529. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  530. set {castle::gracz::%loop-value%::invite} to false
  531. add loop-value to {_y::*)
  532. play raw sound "note.pling" at loop-value-1 with pitch 2 volume 5
  533. send "{@prefix} &7Gra wystartowala!" to loop-value
  534. clear loop-value's inventory
  535. if player has permission "castle.vip":
  536. loop {castle::eqvip::*}:
  537. add loop-value-2 to loop-value-1's inventory
  538. else:
  539. loop {castle::eq::*}:
  540. add loop-value-2 to loop-value-1's inventory
  541. loop {castle::player::%loop-value-1%::inventory::*}:
  542. add loop-value-2 to loop-value-1's inventory
  543. set level of loop-value to 0
  544. set {_num} to rounded up ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} / 2)
  545. loop {_num} times:
  546. set {_x%loop-number%} to random element out of {_y::*)
  547. loop {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}:
  548. if loop-value is not {_x%loop-number%}:
  549. add {_x%loop-number%} to {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}
  550. remove {_x%loop-index} from {_y::*)
  551. loop ({castle::arena::minimumplayers::%{castle::gracz::%player%::arena}%} - {_num}) times:
  552. set {_x%loop-number%} to random element out of {_y::*)
  553. loop {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}:
  554. if loop-value is not {_x%loop-number%}:
  555. add {_x%loop-number%} to {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}
  556. remove {_x%loop-index} from {_y::*)
  557. teleport {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*} to {castle::arena::spawnRED::%{castle::gracz::%player%::arena}%}
  558. teleport {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*} to {castle::arena::spawnBLUE::%{castle::gracz::%player%::arena}%}
  559. set {castle::status::%{castle::gracz::%player%::arena}%} to "w trakcie"
  560. stop
  561. else:
  562. send "{@prefix} &7Arena o ID &6%arg 2% &7jest pelna."
  563. else if {castle::status::%arg 2%} is "w trakcie":
  564. send "{@prefix} &7Arena o ID &6%arg 2% &7jest w trakcie grania."
  565. else if {castle::status::%arg 2%} is "niedostepna":
  566. send "{@prefix} &7Arena o ID &6%arg 2% &7nie jest dostepna."
  567. else:
  568. send "{@prefix} &7Arena o ID &6%arg 2% &7nie istnieje."
  569. else:
  570. send "{@prefix} &7Uzycie: &6/castle join &7<&6ID&7>"
  571. else:
  572. send "{@prefix} &7Jestes juz na arenie."
  573. if arg 1 is "leave":
  574. if {castle::gracz::%player%::dolacz} is true:
  575. clear player's inventory
  576. restore inventory of player from {castle::gracz::%player%::eq}
  577. set {castle::gracz::%player%::dolacz} to false
  578. teleport player to {spawn}
  579. set level of player to 0
  580. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  581. send "{@prefix} &7Gracz &6%player% &7opuscil gre. &8[&e%size of {castle::gracze::%{castle::gracze::%player%::arena}%::*}%&8/&6%{castle::arena::minimumplayers::%arg 2%}%&8]" to loop-value
  582. loop {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}:
  583. if loop-value is victim:
  584. remove victim from {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}
  585. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  586. if loop-value is victim:
  587. remove victim from {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}
  588. if {castle::status::%arg 2%} is "w trakcie":
  589. if (size of {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}) = 0:
  590. loop {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}:
  591. clear loop-value's inventory
  592. restore inventory of loop-value from {castle::gracz::%victim%::eq}
  593. add 1 to {castle::gracz::win::%loop-value%}
  594. launch flickering trailing ball firework colored green at loop-value timed 1
  595. set level of loop-value to 0
  596. set {castle::gracz::%loop-value%::dolacz} to false
  597. clear {castle::gracz::%loop-value%::arena}
  598. if loop-value has permission "castle.vip":
  599. add {@vip coins} to {castle::gracz::pkt::%loop-value%}
  600. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&6100 pkt&8]" to loop-value
  601. else:
  602. add {@coins} to {castle::gracz::pkt::%loop-value%}
  603. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&650 pkt&8]" to loop-value
  604. wait 5 seconds
  605. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  606. teleport loop-value to {spawn}
  607. set {castle::status::%{castle::gracz::%player%::arena}%} to "niedostepna"
  608. clear {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}
  609. clear {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}
  610. clear {castle::gracze::%{castle::gracz::%loop-value%::arena}%::*}
  611. loop {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}:
  612. set block at loop-value to {castle::rebuild::type::%{castle::gracz::%player%::arena}%::%loop-index%}
  613. wait 2 tick
  614. delete {castle::rebuild::type::%{castle::gracz::%player%::arena}%::*}
  615. delete {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}
  616. set {castle::status::%{castle::gracz::%player%::arena}%} to "oczekuje"
  617. if (size of {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}) = 0:
  618. loop {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}:
  619. clear loop-value's inventory
  620. restore inventory of loop-value from {castle::gracz::%victim%::eq}
  621. add 1 to {castle::gracz::win::%loop-value%}
  622. launch flickering trailing ball firework colored green at loop-value timed 1
  623. set level of loop-value to 0
  624. set {castle::gracz::%loop-value%::dolacz} to false
  625. clear {castle::gracz::%loop-value%::arena}
  626. if loop-value has permission "castle.vip":
  627. add {@vip coins} to {castle::gracz::pkt::%loop-value%}
  628. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&6100 pkt&8]" to loop-value
  629. else:
  630. add {@coins} to {castle::gracz::pkt::%loop-value%}
  631. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&650 pkt&8]" to loop-value
  632. wait 5 seconds
  633. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  634. teleport loop-value to {spawn}
  635. set {castle::status::%{castle::gracz::%player%::arena}%} to "niedostepna"
  636. clear {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}
  637. clear {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}
  638. clear {castle::gracze::%{castle::gracz::%loop-value%::arena}%::*}
  639. loop {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}:
  640. set block at loop-value to {castle::rebuild::type::%{castle::gracz::%player%::arena}%::%loop-index%}
  641. wait 2 tick
  642. delete {castle::rebuild::type::%{castle::gracz::%player%::arena}%::*}
  643. delete {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}
  644. set {castle::status::%{castle::gracz::%player%::arena}%} to "oczekuje"
  645. else:
  646. send "&8> &7Nie jestes na zadnej arenie."
  647. on damage of player:
  648. if attacker is a player:
  649. if {castle::gracz::%attacker%::dolacz} is true:
  650. if {castle::gracz::%victim%::dolacz} is true:
  651. loop {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}:
  652. if loop-value is attacker:
  653. loop {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}:
  654. if loop-value-2 is victim:
  655. cancel event
  656. stop
  657. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  658. if loop-value is attacker:
  659. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  660. if loop-value-2 is victim:
  661. cancel event
  662. stop
  663. on death of player:
  664. if {castle::gracz::%victim%::dolacz} is true:
  665. teleport victim to {spawn}
  666. restore inventory of victim from {castle::gracz::%victim%::eq}
  667. set {castle::gracz::%victim%::dolacz} to false
  668. set level of victim to 0
  669. add 1 to {castle::gracz::death::%victim%}
  670. if attacker is a player:
  671. if {castle::gracz::%attacker%::dolacz} is true:
  672. add 1 to {castle::gracz::kill::%attacker%}
  673. loop {castle::gracze::%{castle::gracz::%victim%::arena}%::*}:
  674. send "{@prefix} &7Gracz &6%victim% &7zostal zabity przez &6%attacker%&7! &8[&e%size of {castle::gracze::%{castle::gracze::%victim%::arena}%::*}%&8/&6%{castle::arena::minimumplayers::%arg 2%}%&8]" to loop-value
  675. loop {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}:
  676. if loop-value is victim:
  677. remove victim from {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}
  678. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  679. if loop-value is victim:
  680. remove victim from {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}
  681. if (size of {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}) = 0:
  682. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  683. clear loop-value's inventory
  684. restore inventory of loop-value from {castle::gracz::%victim%::eq}
  685. add 1 to {castle::gracz::win::%loop-value%}
  686. launch flickering trailing ball firework colored green at loop-value timed 1
  687. set level of loop-value to 0
  688. set {castle::gracz::%loop-value%::dolacz} to false
  689. clear {castle::gracz::%loop-value%::arena}
  690. if loop-value has permission "castle.vip":
  691. add {@vip coins} to {castle::gracz::pkt::%loop-value%}
  692. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&6100 pkt&8]" to loop-value
  693. else:
  694. add {@coins}{@vip coins} to {castle::gracz::pkt::%loop-value%}
  695. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&650 pkt&8]" to loop-value
  696. wait 5 seconds
  697. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  698. teleport loop-value to {spawn}
  699. set {castle::status::%{castle::gracz::%victim%::arena}%} to "niedostepna"
  700. clear {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}
  701. clear {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}
  702. clear {castle::gracze::%{castle::gracz::%loop-value%::arena}%::*}
  703. loop {castle::rebuild::location::%{castle::gracz::%victim%::arena}%::*}:
  704. set block at loop-value to {castle::rebuild::type::%{castle::gracz::%victim%::arena}%::%loop-index%}
  705. wait 2 tick
  706. delete {castle::rebuild::type::%{castle::gracz::%victim%::arena}%::*}
  707. delete {castle::rebuild::location::%{castle::gracz::%victim%::arena}%::*}
  708. set {castle::status::%{castle::gracz::%victim%::arena}%} to "oczekuje"
  709. if (size of {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}) = 0:
  710. loop {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}:
  711. clear loop-value's inventory
  712. restore inventory of loop-value from {castle::gracz::%victim%::eq}
  713. add 1 to {castle::gracz::win::%loop-value%}
  714. launch flickering trailing ball firework colored green at loop-value timed 1
  715. set level of loop-value to 0
  716. set {castle::gracz::%loop-value%::dolacz} to false
  717. clear {castle::gracz::%loop-value%::arena}
  718. if loop-value has permission "castle.vip":
  719. add {@vip coins} to {castle::gracz::pkt::%loop-value%}
  720. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&6100 pkt&8]" to loop-value
  721. else:
  722. add {@coins} to {castle::gracz::pkt::%loop-value%}
  723. send "{@prefix} &7Twoja druzyna wygrala! &8[&7+&650 pkt&8]" to loop-value
  724. wait 5 seconds
  725. loop {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}:
  726. teleport loop-value to {spawn}
  727. set {castle::status::%{castle::gracz::%victim%::arena}%} to "niedostepna"
  728. clear {castle::arena::teamRED::%{castle::gracz::%victim%::arena}%::*}
  729. clear {castle::arena::teamBLUE::%{castle::gracz::%victim%::arena}%::*}
  730. clear {castle::gracze::%{castle::gracz::%loop-value%::arena}%::*}
  731. loop {castle::rebuild::location::%{castle::gracz::%victim%::arena}%::*}:
  732. set block at loop-value to {castle::rebuild::type::%{castle::gracz::%victim%::arena}%::%loop-index%}
  733. wait 2 tick
  734. delete {castle::rebuild::type::%{castle::gracz::%victim%::arena}%::*}
  735. delete {castle::rebuild::location::%{castle::gracz::%victim%::arena}%::*}
  736. set {castle::status::%{castle::gracz::%victim%::arena}%} to "oczekuje"
  737. every 1 seconds:
  738. loop all players:
  739. loop all blocks in radius 10 of loop-player:
  740. if loop-block is sign:
  741. if line 1 of loop-block is "{@prefix}":
  742. if line 2 of loop-block is set:
  743. if {castle::arena::id::%uncolored line 2 of loop-block%} is set:
  744. if {castle::status::%uncolored line 2 of loop-block%} is "oczekuje":
  745. set line 3 of loop-block to "&aOczekuje"
  746. set line 4 of loop-block to "&8[&e%size of {castle::gracze::%uncolored line 2 of loop-block%::*}%&8/&6%{castle::arena::minimumplayers::%uncolored line 2 of loop-block%}%&8]"
  747. else if {castle::status::%uncolored line 2 of loop-block%} is "w trakcie":
  748. set line 3 of loop-block to "&cW trakcie"
  749. set line 4 of loop-block to "&8[&e%size of {castle::gracze::%uncolored line 2 of loop-block%::*}%&8/&6%{castle::arena::minimumplayers::%uncolored line 2 of loop-block%}%&8]"
  750. else if {castle::status::%uncolored line 2 of loop-block%} is "odliczanie":
  751. set line 3 of loop-block to "&eOdliczanie"
  752. set line 4 of loop-block to "&8[&e%size of {castle::gracze::%uncolored line 2 of loop-block%::*}%&8/&6%{castle::arena::minimumplayers::%uncolored line 2 of loop-block%}%&8]"
  753. else if {castle::status::%uncolored line 2 of loop-block%} is "niedostepna":
  754. set line 3 of loop-block to "&6Niedostepna"
  755. set line 4 of loop-block to " "
  756. on inventory close:
  757. if {castle::player::%player%::openedit} is "standard":
  758. clear {castle::eq::*}
  759. loop 27 times:
  760. if slot "%loop-number - 1%" parsed as an integer of current inventory of player is not air:
  761. set {_item} to slot loop-number - 1 of current inventory of player
  762. add {_item} to {castle::eq::*}
  763. clear {castle::player::%player%::openedit}
  764. send "{@prefix} &7Zapisano."
  765. else if {castle::player::%player%::openedit} is "vip":
  766. clear {castle::eqvip::*}
  767. loop 27 times:
  768. if slot "%loop-number - 1%" parsed as an integer of current inventory of player is not air:
  769. set {_item} to slot loop-number - 1 of current inventory of player
  770. add {_item} to {castle::eqvip::*}
  771. clear {castle::player::%player%::openedit}
  772. send "{@prefix} &7Zapisano."
  773. on quit:
  774. if {castle::gracz::%player%::dolacz} is true:
  775. execute player command "castle leave"
  776. on sign change:
  777. if line 1 is "castle":
  778. set line 1 to "{@prefix}"
  779. if line 2 is set:
  780. if {castle::arena::id::%line 2%} is set:
  781. set line 2 to "&l%line 2%"
  782. else:
  783. set line 2 to "&c<none>"
  784. on rightclick:
  785. if event-block is sign:
  786. if line 1 of clicked block is "{@prefix}":
  787. if line 2 of clicked block is set:
  788. if {castle::arena::id::%uncolored line 2 of clicked block%} is set:
  789. execute player command "/castle join %uncolored line 2 of clicked block%"
  790. if player's tool is diamond:
  791. if name of player's tool is "&6Sklep":
  792. execute player command "castle gui"
  793. if player's tool is bone:
  794. if name of player's tool is "&6Wyjdz":
  795. execute player command "castle leave"
  796. if player's tool is red wool:
  797. if name of player's tool is "&6Dolacz do &cRED":
  798. execute player command "castle changeteam RED"
  799. if player's tool is blue wool:
  800. if name of player's tool is "&6Dolacz do &9BLUE":
  801. execute player command "castle changeteam BLUE"
  802. on chat:
  803. if {castle::gracz::%player%::dolacz} is true:
  804. cancel event
  805. if {castle::status::%{castle::gracz::%player%::arena}%} is "oczekuje":
  806. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  807. send "%colored displayname of player%&8: &7%colored message%" to loop-value
  808. if {castle::status::%{castle::gracz::%player%::arena}%} is "w trakcie":
  809. set {_} to first 1 characters of message
  810. if {_} is "!":
  811. loop {castle::gracze::%{castle::gracz::%player%::arena}%::*}:
  812. send "%colored displayname of player%&8: &e%colored message%" to loop-value
  813. else:
  814. loop {castle::arena::teamRED::%{castle::gracz::%player%::arena}%::*}:
  815. if loop-value is player:
  816. send "%colored displayname of player%&8: &a%colored message%" to loop-value
  817. stop
  818. loop {castle::arena::teamBLUE::%{castle::gracz::%player%::arena}%::*}:
  819. if loop-value is player:
  820. send "%colored displayname of player%&8: &a%colored message%" to loop-value
  821. stop
  822. on explode:
  823. wait 1 tick
  824. loop exploded blocks:
  825. add location of loop-block to {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}
  826. add air to {castle::rebuild::type::%{castle::gracz::%player%::arena}%::*}
  827. on place:
  828. if {castle::gracz::%player%::dolacz} is true:
  829. if {castle::status::%{castle::gracz::%player%::arena}%} is "w trakcie":
  830. if region at player is not "castle.%{castle::gracz::%player%::arena}%":
  831. loop {castle::%{castle::gracz::%player%::arena}%::rebuild::location}:
  832. if loop-value is not location of event-block:
  833. add location of loop-block to {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}
  834. add air to {castle::rebuild::type::%{castle::gracz::%player%::arena}%::*}
  835. stop
  836. else:
  837. if event-block is tnt:
  838. if {castle::arena::wait::%{castle::gracz::%player%::arena}%} > 0:
  839. send "{@prefix} &cTNT bedzie mozna stawiac za %{castle::arena::wait::%{castle::gracz::%player%::arena}%}%"
  840. else if {castle::arena::wait::%{castle::gracz::%player%::arena}%} = 0:
  841. set {castle::arena::wait::%{castle::gracz::%player%::arena}%} to 120
  842. on break:
  843. if {castle::gracz::%player%::dolacz} is true:
  844. if {castle::status::%{castle::gracz::%player%::arena}%} is "w trakcie":
  845. if region at player is not "castle.%{castle::gracz::%player%::arena}%":
  846. add location of loop-block to {castle::rebuild::location::%{castle::gracz::%player%::arena}%::*}
  847. add air to {castle::rebuild::type::%{castle::gracz::%player%::arena}%::*}
  848. on command "/setspawn":
  849. set {spawn} to location of player
Advertisement
Add Comment
Please, Sign In to add comment