Procix94

VillagerDefense

Aug 22nd, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.13 KB | None | 0 0
  1. #------------------------------#
  2. # Kongiguracja #
  3. #------------------------------#
  4.  
  5. options:
  6. tag: &aVillager&bDefense &e>&6
  7. graczydorozpoczecia: 2
  8.  
  9. #------------------------------#
  10. # Variables #
  11. #------------------------------#
  12.  
  13. variables:
  14. {VD.fala} = 1
  15. {VD.kasa.%player%} = 0
  16. {VD.gra} = false
  17. {VD.iloscgraczy} = 0
  18.  
  19. #------------------------------#
  20. # Dolaczanie #
  21. #------------------------------#
  22.  
  23. on join:
  24. set {_allplayers} to number of all players
  25. if {_allplayers} is greater than 9:
  26. kick player due to "&aZa duzo graczy!"
  27. stop
  28. if {VD.klasa.%player%} is not set:
  29. set {VD.klasa.%player%} to "rycerz"
  30. stop
  31. if {VD.klasa.%player%} is not "rycerz" or "lucznik" or "wojownik":
  32. set {VD.klasa.%player%} to "rycerz"
  33. stop
  34. if {VD.gra} is not "true":
  35. teleport player to {VD.tp.lobby}
  36. add player to {VD.gracze::*}
  37. set join message to "{@tag} Gracz &a%player% &6dolaczyl do gry &f[%number of all players%/10]"
  38. clear player's inventory
  39. set {_allplayers} to number of all players * 10
  40. wait 1 tick
  41. loop all players:
  42. if {VD.odlicznie} is not true:
  43. if {VD.gra} is not true:
  44. set boss bar of loop-player to "&5[&a%number of all players%&e/&b10&5]"
  45. set bar volume of loop-player to {_allplayers}
  46. stop
  47. stop
  48.  
  49. on quit:
  50. set quit message to "{@tag} Gracz &a%player% &6wyszedl z gry &f[%number of all players%/10]"
  51. remove player from {VD.gracze::*}
  52. stop
  53.  
  54. #------------------------------#
  55. # Sklep - lobby #
  56. #------------------------------#
  57.  
  58. on ping:
  59. set {_villagerowie} to number of all villagers
  60. if {VD.gra} is true:
  61. set motd to "&aVillager&bDefense &eFala: &5%{VD.fala}% &eVillagerow: &d%{_villagerowie}% &eZywych: &d%number of {VD.gracze::*}%"
  62.  
  63. else:
  64. set motd to "&a&lVillager&b&lDefense &e> &cZbieranie graczy..."
  65.  
  66. command /sklepreset:
  67. trigger:
  68. set {VD.sklep.lobby.mieczkamienny.%player%} to "&cnie kupiony!"
  69. stop
  70.  
  71. command /lobbysklep [<text>] [<text>] [<player>]:
  72. description: Zakupuje przez gracza wybrany przedmiot.
  73. usage: /lobbysklep <item> <gracz>
  74. permission: VD.lobby.sklep
  75. permission message: Nie masz permisji!
  76. executable by: console
  77. trigger:
  78. if arg 1 is "mieczkamienny":
  79. if {VD.sklep.lobby.mieczkamienny.%arg 2%} is not "&akupiony!":
  80. if arg-player's balance is greater than 2999:
  81. send "{@tag} Wykupiles staly item: &eKamienny Miecz &6za &a3000 &6monet!" to arg 3
  82. set {VD.sklep.lobby.mieczkamienny.%arg 3%} to "&akupiony!"
  83. execute command "eco take %arg 3% 3000"
  84. stop
  85. else:
  86. send "{@tag} Do kupienia tego przedmiotu potrzeba &e3000 &6kasy!" to arg 3
  87. stop
  88. else:
  89. send "{@tag} Juz wykupiles ten przedmiot!" to arg 3
  90.  
  91. on rightclick on zombie:
  92. if name of entity is "&eRycerz":
  93. if {VD.klasa.%player%} is not "rycerz":
  94. set {VD.klasa.%player%} to "rycerz"
  95. send "{@tag} Wybrales klase &eRycerz&6!"
  96. send "&eSet:&a Zelazna klata"
  97. send "&eMiecz:&a Drewniany"
  98. stop
  99. else:
  100. send "{@tag} &eRycerz&6 juz jest twoja klasa!"
  101. stop
  102. if name of entity is "&eWojownik":
  103. if {VD.klasa.%player%} is not "wojownik":
  104. set {VD.klasa.%player%} to "wojownik"
  105. send "{@tag} Wybrales klase &eWojownik&6!"
  106. send "&eSet:&a Skorzana klata"
  107. send "&eMiecz:&a Kamienny"
  108. stop
  109. else:
  110. send "{@tag} &eWojownik&6 juz jest twoja klasa!"
  111. stop
  112. if name of entity is "&eLucznik":
  113. if {VD.klasa.%player%} is not "lucznik":
  114. set {VD.klasa.%player%} to "lucznik"
  115. send "{@tag} Wybrales klase &eLucznik&6!"
  116. send "&eSet:&c BRAK"
  117. send "&eMiecz:&a Drewniany"
  118. send "&eDodatkowo:&a Luk i 16 strzal"
  119. stop
  120. else:
  121. send "{@tag} &eLucznik&6 juz jest twoja klasa!"
  122. stop
  123.  
  124. #------------------------------#
  125. # Sklep lobby #
  126. #------------------------------#
  127.  
  128. on damage:
  129. if victim is zombie:
  130. if name of victim is set:
  131. cancel event
  132. if name of victim is "&eRycerz":
  133. show "s;14;i;stone sword;n;&bKamienny miecz &a[&63000&a];l;&eStan: ;c;say %attacker%;" with 6 rows named "&a&lItemki stale" to attacker
  134. if name of victim is "&eWojownik":
  135. send "{@tag} Wybrales klase &eWojownik&6!" to attacker
  136. if name of victim is "&eLucznik":
  137. send "{@tag} Wybrales klase &eLucznik&6!" to attacker
  138. if attacker is a zombie:
  139. if name of attacker is "&eRycerz" or "&eLucznik" or "&eWojownik":
  140. cancel event
  141. if attacker is not zombie or player:
  142. if victim is not player:
  143. cancel event
  144. if victim is villager:
  145. if attacker is player:
  146. cancel event
  147. stop
  148.  
  149. #------------------------------#
  150. # Start gry #
  151. #------------------------------#
  152.  
  153. every 5 seconds:
  154. set {_gracze} to number of all players
  155. if {_gracze} is greater than {@graczydorozpoczecia} - 1:
  156. if {VD.fala} is not set:
  157. if {VD.gra} is false:
  158. if {VD.odlicznie} is false:
  159. loop all players:
  160. set {VD.odlicznie} to true
  161. loop all entities:
  162. if type of loop-entity-1 is creature:
  163. if name of loop-entity-1 is not set:
  164. if type of loop-entity-1 is a zombie:
  165. kill loop-entity-1
  166. create timed bar with text "&aStartowanie gry..." to loop-player for 30 seconds
  167. wait 1 second
  168. send "{@tag} Gra rozpocznie sie za 30 sekund!" to all players
  169. wait 20 seconds
  170. if {_gracze} is greater than {@graczydorozpoczecia} - 1:
  171. send "{@tag} Gra rozpocznie sie za 10 sekund!" to all players
  172. else:
  173. send "{@tag} Za malo graczy!" to all players and console
  174. stop
  175. wait 5 seconds
  176. send "{@tag} Gra rozpocznie sie za 5 sekund!" to all players
  177. if loop-player doesn't have a bar: #'
  178. create timed bar with text "&aStartowanie gry..." to loop-player for 5 seconds
  179. wait 2 seconds
  180. send "{@tag} Gra rozpocznie sie za 3 sekundy!" to all players
  181. wait 1 second
  182. send "{@tag} Gra rozpocznie sie za 2 sekundy!" to all players
  183. wait 1 second
  184. send "{@tag} Gra rozpocznie sie za 1 sekunde!" to all players
  185. wait 1 second
  186. clear loop-player's inventory #'
  187. clear {VD.gracze::*}
  188. add all players to {VD.gracze::*}
  189. if {_gracze} is greater than {@graczydorozpoczecia} - 1:
  190. send "{@tag} Gra rozpoczela sie! Nadciaga fala 1!" to all players
  191. kill all villagers
  192. loop all entities:
  193. if type of loop-entity-1 is creature:
  194. if name of loop-entity-1 is not set:
  195. if type of loop-entity-1 is a zombie:
  196. kill loop-entity-1
  197. if {VD.klasa.%loop-player%} is "rycerz":
  198. set chestplate of loop-player to a iron chestplate
  199. give wooden sword of unbreaking 1 to loop-player
  200. if {VD.klasa.%loop-player%} is "wojownik":
  201. set chestplate of loop-player to a leather chestplate
  202. give stone sword to loop-player
  203. if {VD.klasa.%loop-player%} is "lucznik":
  204. give wooden sword to loop-player
  205. give bow of power 5 to loop-player
  206. give 16 arrows to loop-player
  207. heal all players
  208. add 20 to loop-player's hunger bar
  209. loop all entities:
  210. if type of loop-entity-1 is creature:
  211. if name of loop-entity-1 is not set:
  212. if type of loop-entity-1 is a zombie:
  213. kill loop-entity-1
  214. teleport all players to {VD.tp.gra}
  215. spawn 5 villagers at {VD.spawnvillagers}
  216. wait 10 seconds
  217. set {VD.fala} to 1
  218. send "{@tag} 1 fala!" to all players
  219. spawn 2 zombies at {VD.spawnzombie.1}
  220. spawn 2 zombies at {VD.spawnzombie.2}
  221. spawn 2 zombies at {VD.spawnzombie.3}
  222. spawn 2 zombies at {VD.spawnzombie.4}
  223. set {VD.fala} to 1
  224. set {VD.kasa.%loop-player%} to 0
  225. set {VD.gra} to true
  226. set {VD.odlicznie} to false
  227. stop
  228. else:
  229. send "{@tag} &cZa malo graczy!" to all players
  230. set {VD.gra} to false
  231. clear {VD.fala}
  232. stop
  233.  
  234. if number of {VD.gracze::*} is equal to 0:
  235. if {VD.odlicznie} is false:
  236. if {VD.gra} is true:
  237. heal all players
  238. send "{@tag} Gra zostala przegrana po %{VD.fala}% fali!" to all players
  239. clear {VD.fala}
  240. loop entities:
  241. if type of loop-entity-1 is creature:
  242. if name of loop-entity-1 is not set:
  243. if loop-entity-1 is a zombie:
  244. kill loop-entity-1
  245. loop all players:
  246. set {VD.kasa.%loop-player%} to 0
  247. set {VD.gra} to false
  248. set {VD.odlicznie} to true
  249. wait 10 seconds
  250. set {VD.odlicznie} to false
  251. teleport all players to {VD.tp.lobby}
  252. clear {VD.gracze::*}
  253. stop
  254. set {_villagerowie} to number of all villagers
  255. if {_villagerowie} is 0:
  256. if {VD.odlicznie} is false:
  257. if {VD.gra} is true:
  258. heal all players
  259. send "{@tag} Gra zostala przegrana po %{VD.fala}% fali!" to all players
  260. loop all players:
  261. clear loop-player's inventory
  262. clear {VD.fala}
  263. loop entities:
  264. if type of loop-entity-1 is creature:
  265. if name of loop-entity-1 is not set:
  266. if loop-entity-1 is a zombie:
  267. kill loop-entity-1
  268. loop all players:
  269. set {VD.kasa.%loop-player%} to 0
  270. set {VD.gra} to false
  271. set {VD.odlicznie} to true
  272. wait 10 seconds
  273. set {VD.odlicznie} to false
  274. teleport all players to {VD.tp.lobby}
  275. clear {VD.gracze::*}
  276. stop
  277.  
  278. every 5 seconds:
  279. if number of all players is less than {@graczydorozpoczecia} - 1:
  280. if {VD.gra} is false:
  281. if {VD.fala} is not set:
  282. loop entities:
  283. if type of loop-entity-1 is creature:
  284. if name of loop-entity-1 is not set:
  285. if loop-entity-1 is a zombie:
  286. kill loop-entity-1
  287. stop
  288.  
  289.  
  290. on xp spawn:
  291. cancel event
  292. stop
  293.  
  294. at 17:00:
  295. set time to 7:00
  296. stop
  297.  
  298. every 1 second:
  299. set {_allplayers} to number of all players * 10
  300. if {VD.odlicznie} is not true:
  301. if {VD.gra} is not true:
  302. loop all players:
  303. set boss bar of loop-player to "&5[&a%number of all players%&e/&b10&5]"
  304. set bar volume of loop-player to {_allplayers}
  305. stop
  306. loop all players:
  307. if loop-player has emerald:
  308. add 5 to {VD.kasa.%loop-player%}
  309. remove emerald from loop-player's inventory
  310. set {_onlineplayers} to number of all players
  311. if {_onlineplayers} is 0:
  312. clear {VD.gracze::*}
  313. set {VD.gra} to false
  314. clear {VD.fala}
  315. set {VD.odlicznie} to false
  316. stop
  317. loop all players:
  318. if {VD.gra} is true:
  319. set {_zombie} to number of zombies
  320. set {_villagerowie} to number of villagers
  321. set {_gracze} to number of {VD.gracze::*}
  322. display board named "&aVillager&bDefense" to loop-player
  323. make score "&eZombie:" in board of loop-player to {_zombie}
  324. make score "&eVillagerowie:" in board of loop-player to {_villagerowie}
  325. make score "&eFala:" in board of loop-player to {VD.fala}
  326. make score "&eGracze:" in board of loop-player to {_gracze}
  327. make score "&eMonety:" in board of loop-player to {VD.kasa.%loop-player%}
  328. move display of loop-player to "sidebar"
  329. stop
  330. else:
  331. set {_money} to loop-player's balance
  332. display board named "&aVillager&bDefense" to loop-player
  333. make score "&eKasa:" in board of loop-player to {_money}
  334. make score "&e" in board of loop-player to 3
  335. make score "&eKit:" in board of loop-player to 2
  336. make score "&e%{VD.klasa.%loop-player%}%" in board of loop-player to 1
  337. move display of loop-player to "sidebar"
  338. stop
  339. stop
  340.  
  341. on pick up of emerald:
  342. wait 1 tick
  343. remove emerald from player's inventory
  344. add 5 to {VD.kasa.%player%}
  345. stop
  346.  
  347. on death:
  348. if victim is player:
  349. clear drops
  350. wait 1 second
  351. add player to {VD.dednieci::*}
  352. remove victim from {VD.gracze::*}
  353. if {VD.klasa.%player%} is "rycerz":
  354. set chestplate of player to a iron chestplate
  355. give wooden sword to player
  356. if {VD.klasa.%player%} is "wojownik":
  357. set chestplate of player to a leather chestplate
  358. give stone sword to player
  359. if {VD.klasa.%player%} is "lucznik":
  360. give wooden sword to player
  361. give bow of power 5 to player
  362. give 16 arrows to player
  363. if victim is zombie:
  364. if attacker is player:
  365. clear drops
  366. drop 1 emerald at location of victim
  367. stop
  368. else:
  369. clear drops
  370. stop
  371.  
  372. on respawn:
  373. wait 1 tick
  374. teleport player to {VD.tp.death}
  375. stop
  376.  
  377. #FALE!!
  378.  
  379. every 1 minutes:
  380. if {VD.gra} is true:
  381. if {VD.fala} is not empty:
  382. add 1 to {VD.fala}
  383. teleport {VD.dednieci::*} to {VD.tp.gra}
  384. clear {VD.dednieci::*}
  385. clear {VD.gracze::*}
  386. add all players to {VD.gracze::*}
  387. send "{@tag} Rozpoczynam %{VD.fala}% fale!" to all players
  388. loop all players:
  389. apply regeneration 2 to last spawned entity for 8 seconds
  390. if {VD.fala} is 2:
  391. spawn 3 zombies at {VD.spawnzombie.1}
  392. spawn 3 zombies at {VD.spawnzombie.2}
  393. spawn 3 zombies at {VD.spawnzombie.3}
  394. spawn 3 zombies at {VD.spawnzombie.4}
  395. if {VD.fala} is 3:
  396. spawn 4 zombies at {VD.spawnzombie.1}
  397. spawn 4 zombies at {VD.spawnzombie.2}
  398. spawn 4 zombies at {VD.spawnzombie.3}
  399. spawn 4 zombies at {VD.spawnzombie.4}
  400. if {VD.fala} is 4:
  401. spawn 5 zombies at {VD.spawnzombie.1}
  402. spawn 5 zombies at {VD.spawnzombie.2}
  403. spawn 5 zombies at {VD.spawnzombie.3}
  404. spawn 5 zombies at {VD.spawnzombie.4}
  405. stop
  406.  
  407. on quit:
  408. remove player from {VD.gracze::*}
  409. stop
  410.  
  411.  
  412. on rightclick on villager:
  413. cancel event
  414. stop
  415.  
  416. on combust:
  417. cancel event
  418.  
  419. #------------------------------#
  420. # Komendy adma #
  421. #------------------------------#
  422.  
  423. command /villagerdefense [<text>] [<number>]:
  424. permission: VD.commendy
  425. aliases: /vd
  426. trigger:
  427. if arg 1 is "setlobby":
  428. set {VD.tp.lobby} to location of player
  429. send "{@tag} Ustawiles lobby!"
  430. stop
  431. if arg 1 is "setgra":
  432. set {VD.tp.gra} to location of player
  433. send "{@tag} Ustawiles gre!"
  434. stop
  435. if arg 1 is "setobserwowanie" or "death":
  436. set {VD.tp.death} to location of player
  437. send "{@tag} Ustawiles miejsce spawnu dednietych!"
  438. stop
  439. if arg 1 is "spawnzombie":
  440. if arg 2 is 1:
  441. set {VD.spawnzombie.1} to location of player
  442. send "{@tag} Ustawiles spawn zombie nr. %arg 2%!"
  443. stop
  444. if arg 2 is 2:
  445. set {VD.spawnzombie.2} to location of player
  446. send "{@tag} Ustawiles spawn zombie nr. %arg 2%!"
  447. stop
  448. if arg 2 is 3:
  449. set {VD.spawnzombie.3} to location of player
  450. send "{@tag} Ustawiles spawn zombie nr. %arg 2%!"
  451. stop
  452. if arg 2 is 4:
  453. set {VD.spawnzombie.4} to location of player
  454. send "{@tag} Ustawiles spawn zombie nr. %arg 2%!"
  455. stop
  456. if arg 1 is "spawnvillagers" or "spawnvil":
  457. set {VD.spawnvillagers} to location of player
  458. send "{@tag} Ustawiles spawn villagerow!"
  459. stop
  460. if arg 1 is "kit":
  461. if arg 2 is 1:
  462. spawn a zombie
  463. set the name of last spawned entity to "&eRycerz"
  464. set chestplate of last spawned entity to a iron chestplate
  465. set tool of last spawned entity to a wooden sword
  466. apply slowness 100 to last spawned entity for 9999 days
  467. apply regeneration 100 to last spawned entity for 9999 days
  468. stop
  469. if arg 2 is 2:
  470. spawn a zombie
  471. set the name of last spawned entity to "&eWojownik"
  472. set chestplate of last spawned entity to a leather chestplate
  473. set tool of last spawned entity to a stone sword
  474. apply slowness 100 to last spawned entity for 9999 days
  475. apply regeneration 100 to last spawned entity for 9999 days
  476. stop
  477. if arg 2 is 3:
  478. spawn a zombie
  479. set the name of last spawned entity to "&eLucznik"
  480. set tool of last spawned entity to a bow
  481. apply slowness 100 to last spawned entity for 9999 days
  482. apply regeneration 100 to last spawned entity for 9999 days
  483. stop
  484. else:
  485. send "{@tag} Kity: 1-4"
  486. send "1 - rycerz"
  487. send "2 - wojownik"
  488. send "3 - lucznik"
  489. if arg 1 is not set:
  490. send "/vd setlobby or /vd setgra"
  491. stop
  492.  
  493. on spawn:
  494. if spawned entity is not zombie and villager:
  495. cancel event
  496. stop
  497.  
  498. on break:
  499. player has permission "admin":
  500. stop
  501. else:
  502. cancel event
  503. stop
  504.  
  505. command /joinreset:
  506. permission: VD.joinreset
  507. aliases: /jr
  508. trigger:
  509. clear {VD.gracze::*}
  510. stop
  511.  
  512. command /startreset:
  513. permission: VD.startreset
  514. trigger:
  515. set {VD.gra} to false
  516. clear {VD.fala}
  517. send "%{VD.gra}% %{VD.fala}%"
  518. stop
  519.  
  520. command /startinfo:
  521. permission: VD.startreset
  522. trigger:
  523. send "%{VD.gra}% %{VD.fala}% %{VD.gracze::*}% %{VD.dednieci::*}%"
  524. stop
Advertisement
Add Comment
Please, Sign In to add comment