Advertisement
LOUDO

source code de a coudre

Mar 12th, 2021
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.38 KB | None | 0 0
  1. options:
  2.  
  3. version: 1.2
  4.  
  5. NotifUpdate: true
  6.  
  7.  
  8.  
  9. prefix: &aDé à coudre &8»
  10.  
  11.  
  12.  
  13. already_exist: &cCette arène existe déjà
  14.  
  15. not_exist: &cCette arène n'existe pas
  16.  
  17. set_arg2: &cVeuillez ajouter un argurment.
  18.  
  19. tp_to: &fVous venez de rejoindre &a%{_map}%
  20.  
  21.  
  22. # -------------------------- MESSAGE AVANT LANCEMENT -------------------------- #
  23.  
  24. join_lobby: &a%{_p}% &fa rejoint la partie (&a%size of {dac::game::%{_map}%::players::*}%&f/&a%{dac::setup::%{_map}%::maxplayer}%&f)
  25.  
  26. quit_lobby: &a%{_p}% &fa quitté la partie (&a%size of {dac::game::%{_map}%::players::*}%&f/&a%{dac::setup::%{_map}%::maxplayer}%&f)
  27.  
  28. start_in_message: &fLa partie commence dans &a%{_time}% &fseconde%{_pluriel}%
  29.  
  30. quit_game: &a%{_p}% &fa quitté la partie ! Il est donc éliminé.
  31.  
  32. # -------------------------- OPTION AVANT LANCEMENT -------------------------- #
  33.  
  34. timer_before_starting: 30
  35.  
  36. # -------------------------- MESSAGE PENDANT PARTIE -------------------------- #
  37.  
  38.  
  39.  
  40. turn_of_player: &fC'est au tour de &a%{_player}% &fde sauter !
  41.  
  42. player_cheated: &cOh le petit malin... Il a essayé de détourner le jeux mais non ! &a%{_player}% &c! >:)
  43.  
  44. death: &a%victim% &fest mort de dégats de chute !
  45.  
  46. msg_de_a_coudre_life_not_full: &6&lINCROYABLE !!! &a&l%{_player}% &fà fait un &adé à coudre &f! Il gagne donc une vie &6&lSupplémentaire !
  47.  
  48. msg_de_a_coudre_life_full: &6&lINCROYABLE !!! &a&l%{_player}% &fà fait un &adé à coudre &f! Malheureusement ses vies supplémentaire sont &6&lComplet!
  49.  
  50. death_but_revive: &a%victim% &fest mort de dégats de chute ! Mais il revient à la vie grâce à son &6&lDé à Coudre !
  51.  
  52. kick_afk: &a%{_player}% &fvient d'être élimininé pour afk...
  53.  
  54. win_message: &6%{_p}% &fà gagné la partie !!!
  55.  
  56.  
  57. # -------------------------- OPTION PENDANT PARTIE -------------------------- #
  58.  
  59. max_bonus_life: 3
  60.  
  61. detect_afk_on_game: true
  62.  
  63. time_afk: 20 # secondes
  64.  
  65.  
  66. # -------------------------- MESSAGE APRES PARTIE -------------------------- #
  67.  
  68. message_when_get_exp: &b+ [AMOUNT] exp gagné ! ([CAUSE])
  69.  
  70. all_exp_gained: &bExpérience accumulé durant la partie +[AMOUNT]
  71.  
  72. # -------------------------- OPTION APRES PARTIE -------------------------- #
  73.  
  74. secondes_before_return_to_lobby: 10 # secondes
  75.  
  76. exp_gained_jump_succes: 2 #exp
  77.  
  78. exp_gained_jump_succes_de_a_coudre: 10 #exp
  79.  
  80. exp_gained_victoire: 50 #exp
  81.  
  82.  
  83. # -------------------------- MESSAGE -------------------------- #
  84.  
  85. chat_alive: &7[[NIVEAU]] &f%player% &8» &f%message%
  86.  
  87. chat_mainlobby: &7[[NIVEAU]] &f%player% &8» &f%message%
  88.  
  89. chat_dead: &7[MORT] &7[[NIVEAU]] &f%player% &8» &f%message%
  90.  
  91.  
  92.  
  93. # -------------------------- MAINLOBBY OPTION -------------------------- #
  94.  
  95.  
  96. hologram_npc: &e&lCLIQUEZ POUR JOUER;&aDé à coudre;&e&l%{_playeringame}% Joueurs
  97.  
  98.  
  99.  
  100. level_0_to_level_1: 100 #exp
  101.  
  102. level_1_to_level_2: 130 #exp
  103.  
  104. level_2_to_level_3: 150 #exp
  105.  
  106. level_3_to_level_4: 200 #exp
  107.  
  108. level_4_to_every_level: 250 #exp
  109.  
  110.  
  111. # -------------------------- MAINLOBBY SCOREBOARD -------------------------- #
  112.  
  113.  
  114. scoreboard_main_lobby_line_1: Niveau: &7[NIVEAU]
  115.  
  116. scoreboard_main_lobby_line_2: Progrès: &b[PROGRESSMIN]&7/&a[PROGRESSMAX]
  117.  
  118. # POUR MODIFIER LA BARRE DE PROGRESSION ALLEZ SUR CETTE LIGNE ---> 658
  119.  
  120. scoreboard_main_lobby_line_3: Victoires totaux: &a[VICTOIRE]
  121.  
  122. scoreboard_main_lobby_line_4: Défaites totaux: &a[DEFAITE]
  123.  
  124. scoreboard_main_lobby_line_5: Ratio W/L: &a[RATIO]
  125.  
  126. scoreboard_main_lobby_line_6: Mort totaux: &a[MORT]
  127.  
  128. scoreboard_main_lobby_line_7: Dé à coudre totaux: &a[DEACOUDRE]
  129.  
  130. youer_server.fr: &ewww.yourserver.fr
  131.  
  132.  
  133.  
  134.  
  135.  
  136. local effect create hologram[s] at %location% named %objects% [with %-number% distance between lines]:
  137. trigger:
  138. set {_loc} to expression-1
  139. {_loc}.getChunk().load()
  140. if parse mark is 1:
  141. set {_distance} to expression-3
  142. else:
  143. set {_distance} to 0.3
  144. loop expressions 2:
  145. delete {_stand}
  146. set {_msg} to loop-value-1
  147. loop armor stands in radius 0.1 of {_loc}:
  148. set {_stand} to loop-entity
  149. if {_stand} is not set:
  150. spawn an armor stand at {_loc}
  151. set {_stand} to spawned armor stand
  152. add "{Invisible:1b,NoGravity:1b,Marker:1b}" to nbt of {_stand}
  153. if {_msg} is not "" or " ":
  154. add "{CustomName:""%colored {_msg}%"",CustomNameVisible:1b}" to nbt of {_stand}
  155. remove {_distance} from y-coords of {_loc}
  156.  
  157.  
  158.  
  159. on server start:
  160. make console execute command "/dacadm forceupdateleaderboard"
  161. loop {dac::arena::*}:
  162. if {dac::setup::%loop-value%::save} is true:
  163. add size of {dac::game::%loop-value%::players::*} to {_playeringame}
  164. set {_loc} to {dac::setup::mainlobby::hologram}
  165. add 2.3 to y-coordinate of {_loc}
  166. set {_holo} to "{@hologram_npc}"
  167. set {_holo::*} to {_holo} split at ";"
  168. create hologram at {_loc} named {_holo::*}
  169. if {@NotifUpdate} is true:
  170. send "[Dé à coudre] &aRecherche d'une nouvelle version..." to console
  171. set {_text} to text from "https://pastebin.com/raw/2ZkQs8v8"
  172. if {_text} is not "{@version}":
  173. send "[Dé à coudre] &aNouvelle version disponible, la &e%{_text}% &aVous pouvez la télécharger ici &ehttps://skript-mc.fr/forum/files/file/411-dé-à-coudre-multi-arène-100-automatique-npc-mainlobby" to console
  174.  
  175. else:
  176. send "[Dé à coudre] &aVous êtes à la derniere version." to console
  177.  
  178. on server stop:
  179. loop {dac::arena::*}:
  180. if {dac::setup::%loop-value%::save} is true:
  181. dac_reset(loop-value)
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. function dac_next_page(p: player, page: number, c: text):
  190. set {_pageStart} to 28*{_page}
  191. set {_i} to 1
  192. set {_slot} to 10
  193. open chest with 6 rows named "Dé à coudre" to {_p}
  194. format gui slot 0, 1, 2, 3, 5, 6, 7, 8, 17, 26, 35, 44, 53, 52, 51, 50, 49, 48, 47, 46, 45, 36, 27, 18 and 9 of {_p} with purple_stained_glass with no nbt named " " to do nothing
  195. if {_c} is "nospec":
  196. format gui slot 4 of {_p} with gold block named "&fRegarder les &aparties &fen cour !" to run:
  197. dac_next_page({_p}, 0, "spec")
  198. if {_c} is "spec":
  199. format gui slot 4 of {_p} with emerald block named "&fRegarder les &aparties &fdisponible !" to run:
  200. dac_next_page({_p}, 0, "nospec")
  201. wait 2 ticks
  202. loop {dac::arena::*}:
  203. if {dac::setup::%loop-value%::save} is true:
  204. if size of {dac::game::%loop-value%::players::*} != {dac::setup::%loop-value%::maxplayer}:
  205. if {dac::game::%loop-value%::statue} is not set:
  206. add loop-value to {_arena_libre::*}
  207. else:
  208. add loop-value to {_arena_nonlibre::*}
  209. if {_c} is "nospec":
  210. set {_amount} to amount of {_arena_libre::*}
  211. loop {_arena_libre::*}:
  212. (loop-index parsed as integer) > {_pageStart}
  213. if {dac::setup::%loop-value%::save} is true:
  214. if size of {dac::game::%loop-value%::players::*} != {dac::setup::%loop-value%::maxplayer}:
  215. if {dac::game::%loop-value%::statue} is not set:
  216. set {_l} to loop-value
  217. format gui slot {_slot} of {_p} with light green wool named "&8» &a%loop-value%" with lore "||&fJoueurs: &a%size of {dac::game::%loop-value%::players::*}%&f/&a%{dac::setup::%loop-value%::maxplayer}%||||&8»&e Clic pour rejoindre !" to run:
  218. close {_p}'s inventory
  219. if size of {dac::game::%{_l}%::players::*} != {dac::setup::%{_l}%::maxplayer}:
  220. if {dac::game::%{_l}%::statue} is not set:
  221. dac_join_player({_p}, {_l})
  222. else:
  223. send "{@prefix} &cCette arène est en pleine partie" to {_p}
  224. else:
  225. send "{@prefix} &cCette arène est pleine" to {_p}
  226. stop
  227. if {dac::player::%{_p}%::map} is loop-value:
  228. format gui slot {_slot} of {_p} with red wool named "&8» &a%loop-value%" with lore "||&fJoueurs: &a%size of {dac::game::%loop-value%::players::*}%&f/&a%{dac::setup::%loop-value%::maxplayer}%||||&8»&c Vous êtes déjà dans cette partie !" to do nothing
  229. add 1 to {_slot}
  230. if {_slot} = 17:
  231. set {_slot} to 19
  232. if {_slot} = 26:
  233. set {_slot} to 28
  234. if {_slot} = 35:
  235. set {_slot} to 37
  236. if {_slot} = ((44*{_i})):
  237. exit loop
  238.  
  239. if {_c} is "spec":
  240. set {_amount} to amount of {_arena_nonlibre::*}
  241. loop {_arena_nonlibre::*}:
  242. (loop-index parsed as integer) > {_pageStart}
  243. if {dac::game::%loop-value%::statue} is true:
  244. set {_l} to loop-value
  245. format gui slot {_slot} of {_p} with orange wool named "&8» &a%loop-value%" with lore "||&fJoueurs: &a%size of {dac::game::%loop-value%::players.alive::*}%&f/&a%{dac::setup::%loop-value%::maxplayer}%||||&8»&e Clic pour regarder la partie !" to run:
  246. close {_p}'s inventory
  247. dac_spectator({_p}, {_l})
  248. if {dac::player::%{_p}%::map} is loop-value:
  249. format gui slot {_slot} of {_p} with red wool named "&8» &a%loop-value%" with lore "||&fJoueurs: &a%size of {dac::game::%loop-value%::players.alive::*}%&f/&a%{dac::setup::%loop-value%::maxplayer}%||||&8»&c Vous êtes déjà dans cette partie !" to do nothing
  250. add 1 to {_amount}
  251. add 1 to {_slot}
  252. if {_slot} = 17:
  253. set {_slot} to 19
  254. if {_slot} = 26:
  255. set {_slot} to 28
  256. if {_slot} = 35:
  257. set {_slot} to 37
  258. if {_slot} = ((44*{_i})):
  259. exit loop
  260.  
  261. if {_amount} > {_pageStart} + 28:
  262. format gui slot 53 of {_p} with arrow named "&9Page suivante" to run:
  263. dac_next_page({_p}, ({_page} + 1), "%{_c}%")
  264. if {_page} > 0:
  265. format gui slot 45 of {_p} with arrow named "&9Page précédente" to run:
  266. dac_next_page({_p}, ({_page} - 1), "%{_c}%")
  267.  
  268. function dac_convert_time(s: number) :: text:
  269. set {_h} to {_s}/3600
  270. set {_h} to rounded down {_h}
  271. set {_m} to ({_s}-{_h}*3600)/60
  272. set {_m} to rounded down {_m}
  273. set {_s} to ({_s} - {_h} * 3600) - {_m} * 60
  274. set {_s} to rounded down {_s}
  275. if {_h} = 0:
  276. set {_h} to ""
  277. else:
  278. if {_h} < 10:
  279. set {_h} to "0%{_h}%:"
  280. if {_m} < 10:
  281. set {_m} to "0%{_m}%:"
  282. else:
  283. set {_m} to "%{_m}%:"
  284. if {_s} < 10:
  285. set {_s} to "0%{_s}%"
  286. else:
  287. set {_s} to "%{_s}%"
  288. return "%{_h}%%{_m}%%{_s}%"
  289.  
  290.  
  291.  
  292.  
  293. function dac_quit_player(p: player, map: text):
  294. wipe {_p}'s sidebar
  295. clear {_p}'s inventory
  296. set {_puuid} to uuid of {_p}
  297. set {_p}'s flight mode to false
  298. remove {_p} from {dac::game::%{_map}%::players::*}
  299. remove {_p} from {dac::game::%{_map}%::players.spec::*}
  300. if {dac::game::%{_map}%::statue} is true:
  301. if {dac::player::%{_p}%::spectator} is not set:
  302. add 1 to {dac::player::%{_puuid}%::stats::losse}
  303. remove {_p} from {dac::game::%{_map}%::players.alive::*}
  304. loop {dac::game::%{_map}%::players::*}:
  305. edit score id "joueurrestant.%loop-value%" to "&fJoueurs restant: &a%size of {dac::game::%{_map}%::players.alive::*}%" and 3
  306. remove {_p} from {dac::game::%{_map}%::players.nonpasse::*}
  307. clear {dac::player::%{_p}%::saut}
  308. clear {dac::player::%{_p}%::life}
  309. send "{@prefix} {@quit_game}" to {dac::game::%{_map}%::players::*}
  310. if {dac::win::%{_map}%} is not set:
  311. if size of {dac::game::%{_map}%::players.alive::*} <= 1 or 0:
  312. dac_win("%{_map}%")
  313. else:
  314. if {dac::player::%{_p}%::saut} is true:
  315. dac_pick_random_player("%{_map}%")
  316. if size of {dac::game::%{_map}%::players::*} <= 0:
  317. dac_reset({_map})
  318.  
  319. else:
  320. send "{@prefix} {@quit_lobby}" to {dac::game::%{_map}%::players::*}
  321. loop {dac::game::%{_map}%::players::*}:
  322. edit score id "playerlist.%loop-value%" to "&fJoueurs: &a%size of {dac::game::%{_map}%::players::*}%&f/&a%{dac::setup::%{_map}%::maxplayer}%" and 3
  323. clear {dac::player::%{_p}%::map}
  324. clear {dac::player::%{_p}%::spectator}
  325. clear {dac::player:%{_p}%::statue}
  326. clear {dac::player::%{_p}%::saut}
  327. clear {dac::player::%{_p}%::life}
  328. clear {dac::player::%{_p}%::all.exp}
  329. if {c.%{_p}%} is not set:
  330. dac_mainlobby({_p})
  331. clear {c.%{_p}%}
  332. reveal {_p} from all players
  333. reveal all players from {_p}
  334. loop {dac::arena::*}:
  335. if {dac::setup::%loop-value%::save} is true:
  336. hide {dac::game::%loop-value%::players::*} from {_p}
  337. hide {_p} from {dac::game::%loop-value%::players::*}
  338. loop {dac::arena::*}:
  339. if {dac::setup::%loop-value%::save} is true:
  340. add size of {dac::game::%loop-value%::players::*} to {_playeringame}
  341. wait a tick
  342. set {_p}'s gamemode to survival
  343. set {_loc} to {dac::setup::mainlobby::hologram}
  344. add 2.3 to y-coordinate of {_loc}
  345. set {_holo} to "{@hologram_npc}"
  346. set {_holo::*} to {_holo} split at ";"
  347. create hologram at {_loc} named {_holo::*}
  348.  
  349.  
  350. function dac_join_player(p: player, map: text):
  351. if {dac::player:%{_p}%::statue} is true:
  352. set {c.%{_p}%} to true
  353. dac_quit_player({_p}, "%{dac::player::%{_p}%::map}%")
  354. teleport {_p} to {dac::setup::%{_map}%::spawn::waitlobby}
  355. set {_puuid} to uuid of {_p}
  356. if {dac::player::%{_puuid}%::stats::dac} and {dac::player::%{_puuid}%::stats::win} and {dac::player::%{_puuid}%::stats::losse} and {dac::player::%{_puuid}%::stats::mort} and {dac::player::%{_puuid}%::stats::level} and {dac::player::%{_puuid}%::stats::progress.max} and {dac::player::%{_puuid}%::stats::progress} is not set:
  357. set {dac::player::%{_puuid}%::stats::dac} to 0
  358. set {dac::player::%{_puuid}%::stats::win} to 0
  359. set {dac::player::%{_puuid}%::stats::losse} to 0
  360. set {dac::player::%{_puuid}%::stats::mort} to 0
  361. set {dac::player::%{_puuid}%::stats::level} to 0
  362. set {dac::player::%{_puuid}%::stats::progress} to 0
  363. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_0_to_level_1}
  364. set {dac::player::%{_puuid}%::stats::level} to "%{dac::player::%{_puuid}%::stats::level}%" parsed as number
  365. wait 1 tick
  366. set {_p}'s gamemode to survival
  367. clear {_p}'s inventory
  368. if {_p} has permission "dac.forcestart":
  369. set slot 0 of {_p} to feather named "&aForcer la partie à demarrer &7(Clic-droit)"
  370. set slot 8 of {_p} to barrier named "&cQuitter la partie &7(Clic-droit)"
  371. send "{@prefix} {@tp_to}" to {_p}
  372. set {dac::player::%{_p}%::map} to {_map}
  373. set {dac::player:%{_p}%::statue} to true
  374. add {_p} to {dac::game::%{_map}%::players::*}
  375. send "{@prefix} {@join_lobby}" to {dac::game::%{_map}%::players::*}
  376. wipe {_p}'s sidebar
  377. set name of sidebar of {_p} to "&aDé à coudre"
  378. set score " " in sidebar of {_p} to 5
  379. set score "&fMap: &a%{_map}%" in sidebar of {_p} to 4
  380. set id based score "&fJoueurs: &a%size of {dac::game::%{_map}%::players::*}%&f/&a%{dac::setup::%{_map}%::maxplayer}%" in sidebar of {_p} to 3 with id "playerlist.%{_p}%"
  381. set score " " in sidebar of {_p} to 2
  382. set id based score "&cEn attente..." in sidebar of {_p} to 1 with id "time.%{_p}%"
  383. set score " " in sidebar of {_p} to 0
  384. hide {_p} from all players
  385. hide all players from {_p}
  386. reveal {_p} from {dac::game::%{_map}%::players::*}
  387. reveal {dac::game::%{_map}%::players::*} from {_p}
  388. loop {dac::arena::*}:
  389. if {dac::setup::%loop-value%::save} is true:
  390. add size of {dac::game::%loop-value%::players::*} to {_playeringame}
  391. set {_loc} to {dac::setup::mainlobby::hologram}
  392. add 2.3 to y-coordinate of {_loc}
  393. set {_holo} to "{@hologram_npc}"
  394. set {_holo::*} to {_holo} split at ";"
  395. create hologram at {_loc} named {_holo::*}
  396. loop {dac::game::%{_map}%::players::*}:
  397. edit score id "playerlist.%loop-value%" to "&fJoueurs: &a%size of {dac::game::%{_map}%::players::*}%&f/&a%{dac::setup::%{_map}%::maxplayer}%" and 3
  398. if {dac::game::%{_map}%::timer} is not set:
  399. if size of {dac::game::%{_map}%::players::*} >= {dac::setup::%{_map}%::minplayer}:
  400. set {dac::game::%{_map}%::timer} to true
  401. set {_time} to {@timer_before_starting}
  402. while size of {dac::game::%{_map}%::players::*} > 0:
  403. if {dac::game::%{_map}%::timer} is true:
  404. set {_convert} to dac_convert_time({_time})
  405. if size of {dac::game::%{_map}%::players::*} >= {dac::setup::%{_map}%::minplayer}:
  406. loop {dac::game::%{_map}%::players::*}:
  407. edit score id "time.%loop-value%" to "Commence dans &a%{_convert}%" and 1
  408. if {_time} = 120 or 60 or 30 or 15 or 10 or 5 or 4 or 3 or 2 or 1:
  409. set {_pluriel} to "s"
  410. if {_time} = 1:
  411. set {_pluriel} to ""
  412. play sound "NOTE_STICKS" to {dac::game::%{_map}%::players::*} with volume 0.7 and pitch 5
  413. send "{@prefix} {@start_in_message}" to {dac::game::%{_map}%::players::*}
  414. if {_time} = 5 or 4 or 3 or 2 or 1:
  415. send {dac::game::%{_map}%::players::*} title "&e%{_time}%" with 0 second fade in and 0 second fade out
  416. if {_time} = 0:
  417. dac_StartGame("%{_map}%")
  418. clear {dac::game::%{_map}%::timer}
  419. stop
  420. else:
  421. remove 1 from {_time}
  422. wait 1 seconds
  423.  
  424. else:
  425. send {dac::game::%{_map}%::players::*} title "&cAnnulé !" with subtitle "&cPas assez de joueurs..."
  426. clear {dac::game::%{_map}%::timer}
  427. clear {_time}
  428. loop {dac::game::%{_map}%::players::*}:
  429. edit score id "time.%loop-value%" to "&cEn attente..." and 1
  430. stop
  431. else:
  432. stop
  433.  
  434.  
  435. function dac_win(map: text):
  436. set {_p} to first element of {dac::game::%{_map}%::players.alive::*}
  437. dac_add_exp_game({_p}, {@exp_gained_victoire}, "Victoire")
  438. set {_puuid} to uuid of {_p}
  439. add 1 to {dac::player::%{_puuid}%::stats::win}
  440. clear {dac::player::%{_p}%::satut}
  441. set {dac::player::%{_p}%::spectator} to true
  442. add {_p} to {dac::game::%{_map}%::players.spec::*}
  443. set {dac::win::%{_map}%} to true
  444. send "{@prefix} {@win_message}" to {dac::game::%{_map}%::players::*}
  445. teleport {_p} to {dac::setup::%{_map}%::spawn::spawnplayer}
  446. set {_p}'s gamemode to survival
  447. launch "BALL LARGE" firework at location of {_p} timed 0.5 coloured "white"
  448. launch "BALL LARGE" firework at location of {_p}'s location timed 0.5 coloured "red"
  449. launch "STAR" firework at location of {_p}'s location timed 1 coloured "lime"
  450. set slot 8 of {_p} to barrier named "&cQuitter la partie &7(Clic-droit)"
  451. set slot 4 of {_p} to nether star named "&aRelancer une partie &7(Clic-droit)"
  452. loop {dac::game::%{_map}%::players::*}:
  453. if {dac::player::%loop-value%::all.exp} is not set:
  454. set {dac::player::%loop-value%::all.exp} to 0
  455. set {_msg} to "{@all_exp_gained}"
  456. replace all "[AMOUNT]" with "%{dac::player::%loop-value%::all.exp}%" in {_msg}
  457. send "%{_msg}%" to loop-value
  458. set {_time} to {@secondes_before_return_to_lobby}
  459. while size of {dac::game::%{_map}%::players::*} >= 1:
  460. if size of {dac::game::%{_map}%::players::*} >= 1:
  461. if {_time} = 0:
  462. dac_reset("%{_map}%")
  463. stop
  464. remove 1 from {_time}
  465. wait 1 second
  466.  
  467.  
  468.  
  469.  
  470. function dac_StartGame(map: text):
  471. set {dac::game::%{_map}%::statue} to true
  472. clear {dac::game::%{_map}%::timer}
  473. set {_time} to 4
  474. send {dac::game::%{_map}%::players::*} title "&a&lDé à Coudre" with subtitle "&9Atterie dans l'eau !" with 0 second fade in and 1.4 second fade out
  475. loop {dac::game::%{_map}%::players::*}:
  476. clear loop-value's inventory
  477. wipe loop-value's sidebar
  478. set name of sidebar of loop-value to "&aDé à coudre"
  479. set score " " in sidebar of loop-value to 4
  480. set id based score "&fJoueurs restant: &a%size of {dac::game::%{_map}%::players::*}%" in sidebar of loop-value to 3 with id "joueurrestant.%loop-value%"
  481. set score " " in sidebar of loop-value to 2
  482. set id based score "&fJoueur qui saute: &cEn attente..." in sidebar of loop-value to 1 with id "joueurquisaute.%loop-value%"
  483. set score " " in sidebar of loop-value to 0
  484. add loop-value to {dac::game::%{_map}%::players.alive::*}
  485. teleport loop-value to {dac::setup::%{_map}%::spawn::spectator}
  486. set loop-value's gamemode to spectator
  487. add loop-value to {dac::game::%{_map}%::players.nonpasse::*}
  488. set {dac::player::%loop-value%::life} to 0
  489. play sound "LEVEL_UP" to {dac::game::%{_map}%::players::*} with volume 0.7 and pitch 5
  490. while {_time} != 0:
  491. if size of {dac::game::%{_map}%::players.alive::*} != 1 or 0:
  492. set {_pluriel} to "s"
  493. if {_time} = 1 or 0:
  494. set {_pluriel} to ""
  495. if {_time} = 3 or 2 or 1:
  496. play sound "NOTE_STICKS" to {dac::game::%{_map}%::players::*} with volume 0.7 and pitch 5
  497. send "{@prefix} {@start_in_message}" to {dac::game::%{_map}%::players::*}
  498. remove 1 from {_time}
  499. wait 1 second
  500. if {_time} = 0:
  501. dac_pick_random_player("%{_map}%")
  502. else:
  503. stop
  504.  
  505. function dac_pick_random_player(map: text):
  506. set {_player} to first element of {dac::game::%{_map}%::players.nonpasse::*}
  507. loop {dac::game::%{_map}%::players::*}:
  508. edit score id "joueurquisaute.%loop-value%" to "&fJoueur qui saute: &a%{_player}%" and 1
  509. set {_player} to "%{_player}%" parsed as player
  510. remove {_player} from {dac::game::%{_map}%::players.nonpasse::*}
  511. if {dac::game::%{_map}%::players.nonpasse::*} is not set:
  512. loop {dac::game::%{_map}%::players::*}:
  513. if {dac::player::%loop-value%::spectator} is not set:
  514. add loop-value to {dac::game::%{_map}%::players.nonpasse::*}
  515. set {_player}'s gamemode to survival
  516. teleport {_player} to {dac::setup::%{_map}%::spawn::spawnplayer}
  517. send {_player} title "&aA toi de jouer !" with subtitle "&9Te rate pas !"
  518. send "{@prefix} {@turn_of_player}" to {dac::game::%{_map}%::players::*}
  519. dac_detection({_player}, "%{_map}%")
  520.  
  521.  
  522. function dac_add_exp_game(player: player, n: number, cause: text):
  523. set {_puuid} to uuid of {_player}
  524. add {_n} to {dac::player::%{_puuid}%::stats::progress}
  525. add {_n} to {dac::player::%{_player}%::all.exp}
  526. set {_amount} to {_n}
  527. set {_msg} to "{@message_when_get_exp}"
  528. replace all "[AMOUNT]" with "%{_amount}%" in {_msg}
  529. replace all "[CAUSE]" with "%{_cause}%" in {_msg}
  530. send "%{_msg}%" to {_player}
  531.  
  532. function dac_detection(player: player, map: text):
  533. set {dac::player::%{_player}%::saut} to true
  534. set {_puuid} to uuid of {_player}
  535. while {dac::player::%{_player}%::saut} is true:
  536. if {@detect_afk_on_game} is true:
  537. set {_timemax} to {@time_afk}
  538. set {_timemax} to {_timemax} * 20
  539. add 1 to {_time}
  540. if block at {_player} is water:
  541. set {_check::*} to groups 1 of "%{dac::setup::%{_map}%::blocks::*}%" matched to "(\b(%location of block at {_player}%)\b)"
  542. if {_check::*} is set:
  543. if size of {dac::game::%{_map}%::players.alive::*} != 1 or 0:
  544. set {_y} to location of block under {_player}
  545. add 1 to y-coordinate of {_y}
  546. dac_add_exp_game({_player}, {@exp_gained_jump_succes} , "Saut Réussi")
  547. if block in front of {_y} is not water or air:
  548. if block left of {_y} is not water or air:
  549. if block right of {_y} is not water or air:
  550. if block behind {_y} is not water or air:
  551. dac_add_exp_game({_player}, {@exp_gained_jump_succes_de_a_coudre}, "Dé à coudre réussi")
  552. add 1 to {dac::player::%{_puuid}%::stats::dac}
  553. if {dac::player::%{_player}%::life} != {@max_bonus_life}:
  554. add 1 to {dac::player::%{_player}%::life}
  555. send "{@prefix} {@msg_de_a_coudre_life_not_full}" to {dac::game::%{_map}%::players::*}
  556. else:
  557. send "{@prefix} {@msg_de_a_coudre_life_full}" to {dac::game::%{_map}%::players::*}
  558. set action bar of {_player} to "&fIl te reste &a%{dac::player::%{_player}%::life}% &f vies !"
  559. set block at location of {_player} to emerald block
  560. set {_r} to true
  561. play sound "LEVEL_UP" to {dac::game::%{_map}%::players::*} with volume 1 and pitch 5
  562. loop blocks within {dac::setup::%{_map}%::pos1} and {dac::setup::%{_map}%::pos2}:
  563. if loop-block = water:
  564. add 1 to {_test}
  565. if {_r} is not set:
  566. set block at location of {_player} to wool
  567. if {_test} = 1:
  568. set {_length} to (size of {dac::setup::%{_map}%::blocks::*})
  569. set {_number} to random integer between 1 and {_length}
  570. set block at {dac::setup::%{_map}%::blocks::%{_number}%} to water
  571. add location of {_player} to {dac::game::%{_map}%::blocks.clear::*}
  572. set {_player}'s gamemode to spectator
  573. teleport {_player} to {dac::setup::%{_map}%::spawn::spectator}
  574. clear {dac::player::%{_player}%::saut}
  575. dac_pick_random_player("%{_map}%")
  576. clear {_player}
  577. stop
  578. else:
  579. stop
  580. else:
  581. send "{@prefix} {@player_cheated}" to {dac::game::%{_map}%::players::*}
  582. add 1 to {dac::player::%{_puuid}%::stats::losse}
  583. make console execute command "/§deatheffect %{_player}%"
  584. remove {_player} from {dac::game::%{_map}%::players.alive::*}
  585. remove {_player} from {dac::game::%{_map}%::players.nonpasse::*}
  586. dac_spectator({_player}, "%{_map}%")
  587. if size of {dac::game::%{_map}%::players.alive::*} != 1 or 0:
  588. dac_pick_random_player("%{_map}%")
  589. else:
  590. dac_win("%{_map}%")
  591. loop {dac::game::%{_map}%::players::*}:
  592. edit score id "joueurrestant.%loop-value%" to "&fJoueurs restant: &a%size of {dac::game::%{_map}%::players.alive::*}%" and 3
  593. clear {dac::player::%{_player}%::saut}
  594. else if {_time} = {_timemax}:
  595. make console execute command "/§deatheffect %{_player}%"
  596. send "{@prefix} {@kick_afk}" to {dac::game::%{_map}%::players::*}
  597. dac_quit_player({_player}, "%{_map}%")
  598. if size of {dac::game::%{_map}%::players.alive::*} != 1 or 0:
  599. dac_pick_random_player("%{_map}%")
  600. stop
  601. wait 1 tick
  602.  
  603.  
  604. function dac_spectator(p: player, map: text):
  605. clear {_p}'s inventory
  606. set {dac::player::%{_p}%::map} to {_map}
  607. add {_p} to {dac::game::%{_map}%::players.spec::*}
  608. set {dac::player::%{_p}%::spectator} to true
  609. teleport {_p} to {dac::setup::%{_map}%::spawn::spectator}
  610. set {_check::*} to groups 1 of "%{dac::game::%{_map}%::players::*} %" matched to "(\b(%{_p}%)\b)"
  611. if {_check::*} is not set:
  612. add {_p} to {dac::game::%{_map}%::players::*}
  613. wipe {_p}'s sidebar
  614. set name of sidebar of {_p} to "&aDé à coudre"
  615. set score " " in sidebar of {_p} to 4
  616. set id based score "&fJoueurs restant: &a%size of {dac::game::%{_map}%::players.alive::*}%" in sidebar of {_p} to 3 with id "joueurrestant.%{_p}%"
  617. set score " " in sidebar of {_p} to 2
  618. set id based score "&fJoueur qui saute: &cEn attente..." in sidebar of {_p} to 1 with id "joueurquisaute.%{_p}%"
  619. set score " " in sidebar of {_p} to 0
  620. else:
  621. set slot 4 of {_p} to nether star named "&aRelancer une partie &7(Clic-droit)"
  622. hide all players from {_p}
  623. reveal {dac::game::%{_map}%::players::*} from {_p}
  624. hide {_p} from {dac::game::%{_map}%::players.spec::*}
  625. hide {dac::game::%{_map}%::players.spec::*} from {_p}
  626. set {_p}'s gamemode to survival
  627. set slot 8 of {_p} to barrier named "&cQuitter la partie &7(Clic-droit)"
  628. hide {_p} from all players
  629. set {_p}'s flight mode to true
  630. set {dac::player:%{_p}%::statue} to true
  631. force {_p} to start flying
  632. loop {dac::arena::*}:
  633. if {dac::setup::%loop-value%::save} is true:
  634. add size of {dac::game::%loop-value%::players::*} to {_playeringame}
  635. set {_loc} to {dac::setup::mainlobby::hologram}
  636. add 2.3 to y-coordinate of {_loc}
  637. set {_holo} to "{@hologram_npc}"
  638. set {_holo::*} to {_holo} split at ";"
  639. create hologram at {_loc} named {_holo::*}
  640.  
  641.  
  642.  
  643. function dac_reset(map: text):
  644. clear {dac::game::%{_map}%::timer}
  645. loop {dac::game::%{_map}%::blocks.clear::*}:
  646. set block at loop-value to water
  647. clear {dac::game::%{_map}%::blocks::*}
  648. reveal all players from {dac::game::%{_map}%::players::*}
  649. reveal {dac::game::%{_map}%::players::*} from all players
  650. loop {dac::game::%{_map}%::players::*}:
  651. if loop-value is online:
  652. clear loop-value's inventory
  653. set loop-value's flight mode to false
  654. dac_mainlobby(loop-value)
  655. set loop-value's gamemode to survival
  656. loop {dac::arena::*}:
  657. if {dac::setup::%loop-value-2%::save} is true:
  658. hide loop-value-1 from {dac::game::%loop-value-2%::players::*}
  659. hide {dac::game::%loop-value-2%::players::*} from loop-value-1
  660.  
  661. clear {dac::player::%loop-value%::spectator}
  662. clear {dac::player:%loop-value%::statue}
  663. clear {dac::player::%loop-value%::life}
  664. clear {dac::player::%loop-value%::saut}
  665. clear {dac::player::%loop-value%::all.exp}
  666. clear {dac::player::%loop-value%::map}
  667.  
  668.  
  669. reveal {dac::game::%{_map}%::players::*} from {dac::game::%{_map}%::players::*}
  670. clear {dac::game::%{_map}%::statue}
  671. clear {dac::game::%{_map}%::players.alive::*}
  672. clear {dac::game::%{_map}%::timer}
  673. clear {dac::game::%{_map}%::players::*}
  674. clear {dac::game::%{_map}%::players.spec::*}
  675. clear {dac::game::%{_map}%::players.nonpasse::*}
  676. clear {dac::game::%{_map}%::blocks.clear::*}
  677. clear {dac::win::%{_map}%}
  678. loop {dac::arena::*}:
  679. if {dac::setup::%loop-value%::save} is true:
  680. add size of {dac::game::%loop-value%::players::*} to {_playeringame}
  681. set {_loc} to {dac::setup::mainlobby::hologram}
  682. add 2.3 to y-coordinate of {_loc}
  683. set {_holo} to "{@hologram_npc}"
  684. set {_holo::*} to {_holo} split at ";"
  685. create hologram at {_loc} named {_holo::*}
  686. loop "win", "losse", "mort", "level" and "dac":
  687. if {dac::setup::mainlobby::leaderboard::%loop-value%} is set:
  688. set {_loc} to {dac::setup::mainlobby::leaderboard::%loop-value%}
  689. if {dac::setup::mainlobby::leaderboard::%loop-value%} is set:
  690. dac_leaderboard(({_loc}), "%loop-value%")
  691.  
  692. function dac_format(n: number) :: text:
  693. set {_data} to "QT,18|Q,15|T,12|B,9|M,6|k,3"
  694. loop split {_data} at "|":
  695. set {_s::*} to split loop-value at ","
  696. {_n} >= 10 ^ {_s::2} parsed as number
  697. return "%{_n} / 10 ^ {_s::2} parsed as number%%{_s::1}%"
  698. return "%{_n}%"
  699.  
  700. function dac_ProgressBar(p: player, current: number, currentMAX: number):
  701. set {_newvalue} to {_current} * 100 / {_currentMAX}
  702. set {_uuid} to {_p}'s uuid
  703. if {_newvalue} >= 95:
  704. set score "&8[&b■■■■■■■■■■&8]" in sidebar of {_p} to 9
  705. else if {_newvalue} >= 90:
  706. set score "&8[&b■■■■■■■■■&7■&8]" in sidebar of {_p} to 9
  707. else if {_newvalue} >= 80:
  708. set score "&8[&b■■■■■■■■&7■■&8]" in sidebar of {_p} to 9
  709. else if {_newvalue} >= 70:
  710. set score "&8[&b■■■■■■■&7■■■&8]" in sidebar of {_p} to 9
  711. else if {_newvalue} >= 60:
  712. set score "&8[&b■■■■■■&7■■■■&8]" in sidebar of {_p} to 9
  713. else if {_newvalue} >= 50:
  714. set score "&8[&b■■■■■&7■■■■■&8]" in sidebar of {_p} to 9
  715. else if {_newvalue} >= 40:
  716. set score "&8[&b■■■■&7■■■■■■&8]" in sidebar of {_p} to 9
  717. else if {_newvalue} >= 30:
  718. set score "&8[&b■■■&7■■■■■■■&8]" in sidebar of {_p} to 9
  719. else if {_newvalue} >= 20:
  720. set score "&8[&b■■&7■■■■■■■■&8]" in sidebar of {_p} to 9
  721. else if {_newvalue} >= 10:
  722. set score "&8[&b■&7■■■■■■■■■&8]" in sidebar of {_p} to 9
  723. else if {_newvalue} < 10:
  724. set score "&8[&7■■■■■■■■■■&8]" in sidebar of {_p} to 9
  725.  
  726.  
  727.  
  728.  
  729.  
  730. function dac_leaderboard(loc: location, s: text):
  731. add 5 to y-coordinate of {_loc}
  732. loop all offline players:
  733. if {dac::player::%uuid of loop-value%::stats::%{_s}%} is set:
  734. add {dac::player::%uuid of loop-value%::stats::%{_s}%} to {_list::*}
  735. loop {_list::*}:
  736. set {_value} to 1
  737. loop {_results::*}:
  738. loop-value-1 <= loop-value-2
  739. add 1 to {_value}
  740. set {_index} to {_value} + 1
  741. set {_numbers::*} to {_results::*}
  742. loop (size of {_results::*} - {_value} + 1) times:
  743. set {_index.2} to {_index} - 1
  744. set {_results::%{_index}%} to {_numbers::%{_index.2}%}
  745. add 1 to {_index}
  746. set {_results::%{_value}%} to loop-value
  747. loop {_results::*}:
  748. loop all offline players:
  749. if {dac::player::%uuid of loop-value-2%::stats::%{_s}%} is set:
  750. if loop-value-1 is {dac::player::%uuid of loop-value-2%::stats::%{_s}%}:
  751. loop {_players::*}:
  752. if loop-value-2 is loop-value-3:
  753. set {_result} to true
  754. if {_result} is not set:
  755. add loop-value-2 to {_players::*}
  756. loop 10 times:
  757. if {_players::%loop-value%} is not set:
  758. set {_players::%loop-value%} to "&7..."
  759. if {_results::%loop-value%} is not set:
  760. set {_results::%loop-value%} to "&7..."
  761. add "&e%loop-value%. &f%{_players::%loop-value%}% &7- &a%{_results::%loop-value%}%" to {_return::*}
  762. if {_s} is "win":
  763. create hologram at {_loc} named "&a&lVictoire Dé à coudre"
  764. if {_s} is "losse":
  765. create hologram at {_loc} named "&a&lDéfaite Dé à coudre"
  766. if {_s} is "mort":
  767. create hologram at {_loc} named "&a&lMort Totaux Dé à coudre"
  768. if {_s} is "level":
  769. create hologram at {_loc} named "&a&lNiveau Dé à coudre"
  770. if {_s} is "dac":
  771. create hologram at {_loc} named "&a&lDé à coudre totaux Dé à coudre"
  772. remove 1 from y-coordinate of {_loc}
  773. create hologram at {_loc} named {_return::*}
  774.  
  775. function dac_mainlobby(p: player):
  776. set {_puuid} to uuid of {_p}
  777. teleport {_p} to {dac::setup::mainlobby::spawn}
  778. if {dac::player::%{_puuid}%::stats::progress} >= {dac::player::%{_puuid}%::stats::progress.max}:
  779. while {dac::player::%{_puuid}%::stats::progress} >= {dac::player::%{_puuid}%::stats::progress.max}:
  780. add 1 to {_count}
  781. set {dac::player::%{_puuid}%::stats::progress} to {dac::player::%{_puuid}%::stats::progress} - {dac::player::%{_puuid}%::stats::progress.max}
  782. add 1 to {dac::player::%{_puuid}%::stats::level}
  783. send "&7&m--------------------------------" to {_p}
  784. send "&fBravo ! Vous avez passé &7%{_count}%✫ &fniveau !" to {_p}
  785. send "&fVous êtes à présent niveau &7%{dac::player::%{_puuid}%::stats::level}%✫" to {_p}
  786. send "&7&m--------------------------------" to {_p}
  787. play sound "LEVEL_UP" to {_p} with volume 1 and pitch 5
  788. send {_p} title "&a&lLEVEL UP"
  789. set {dac::player::%{_puuid}%::stats::level} to "%{dac::player::%{_puuid}%::stats::level}%" parsed as number
  790. if {dac::player::%{_puuid}%::stats::level} = 0:
  791. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_0_to_level_1}
  792. if {dac::player::%{_puuid}%::stats::level} = 1:
  793. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_1_to_level_2}
  794. if {dac::player::%{_puuid}%::stats::level} = 2:
  795. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_2_to_level_3}
  796. if {dac::player::%{_puuid}%::stats::level} = 3:
  797. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_3_to_level_4}
  798. if {dac::player::%{_puuid}%::stats::level} >= 4:
  799. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_4_to_every_level}
  800. if {dac::player::%{_puuid}%::stats::dac} and {dac::player::%{_puuid}%::stats::win} and {dac::player::%{_puuid}%::stats::losse} and {dac::player::%{_puuid}%::stats::mort} and {dac::player::%{_puuid}%::stats::level} and {dac::player::%{_puuid}%::stats::progress.max} and {dac::player::%{_puuid}%::stats::progress} is not set:
  801. set {dac::player::%{_puuid}%::stats::dac} to 0
  802. set {dac::player::%{_puuid}%::stats::win} to 0
  803. set {dac::player::%{_puuid}%::stats::losse} to 0
  804. set {dac::player::%{_puuid}%::stats::mort} to 0
  805. set {dac::player::%{_puuid}%::stats::level} to 0
  806. set {dac::player::%{_puuid}%::stats::progress} to 0
  807. set {dac::player::%{_puuid}%::stats::progress.max} to {@level_0_to_level_1}
  808. set {dac::player::%{_puuid}%::stats::level} to "%{dac::player::%{_puuid}%::stats::level}%" parsed as number
  809. clear {_p}'s inventory
  810. set {_ratio} to {dac::player::%{_puuid}%::stats::win} / {dac::player::%{_puuid}%::stats::losse}
  811. set {_progress} to dac_format({dac::player::%{_puuid}%::stats::progress})
  812. set {_progressmax} to dac_format({dac::player::%{_puuid}%::stats::progress.max})
  813. wipe {_p}'s sidebar
  814. set {_line1} to "{@scoreboard_main_lobby_line_1}"
  815. replace all "[NIVEAU]" with "%{dac::player::%{_puuid}%::stats::level}%✫" in {_line1}
  816. set {_line2} to "{@scoreboard_main_lobby_line_2}"
  817. replace all "[PROGRESSMIN]" with "%{_progress}%" in {_line2}
  818. replace all "[PROGRESSMAX]" with "%{_progressmax}%" in {_line2}
  819. set {_line3} to "{@scoreboard_main_lobby_line_3}"
  820. set {_line4} to "{@scoreboard_main_lobby_line_4}"
  821. set {_line5} to "{@scoreboard_main_lobby_line_5}"
  822. set {_line6} to "{@scoreboard_main_lobby_line_6}"
  823. set {_line7} to "{@scoreboard_main_lobby_line_7}"
  824. replace all "[VICTOIRE]" with "%{dac::player::%{_puuid}%::stats::win}%" in {_line3}
  825. replace all "[DEFAITE]" with "%{dac::player::%{_puuid}%::stats::losse}%" in {_line4}
  826. replace all "[RATIO]" with "%{_ratio}%" in {_line5}
  827. replace all "[MORT]" with "%{dac::player::%{_puuid}%::stats::mort}%" in {_line6}
  828. replace all "[DEACOUDRE]" with "%{dac::player::%{_puuid}%::stats::dac}%" in {_line7}
  829. set name of sidebar of {_p} to "&a&lDé à Coudre"
  830. set score " " in sidebar of {_p} to 13
  831. set score "%{_line1}%" in sidebar of {_p} to 12
  832. set score " " in sidebar of {_p} to 11
  833. set score "%{_line2}%" in sidebar of {_p} to 10
  834. dac_ProgressBar({_p}, {dac::player::%{_puuid}%::stats::progress}, {dac::player::%{_puuid}%::stats::progress.max})
  835. set score " " in sidebar of {_p} to 8
  836. set score "%{_line3}%" in sidebar of {_p} to 7
  837. set score "%{_line4}%" in sidebar of {_p} to 6
  838. set score "%{_line5}%" in sidebar of {_p} to 5
  839. set score "%{_line6}%" in sidebar of {_p} to 4
  840. set score "%{_line7}%" in sidebar of {_p} to 3
  841. set score " " in sidebar of {_p} to 2
  842. set score "{@youer_server.fr}" in sidebar of {_p} to 1
  843.  
  844.  
  845. command /dacadm [<text=help>] [<text>] [<number>]:
  846. permission: dac.admin
  847. permission message: &cVous n'avez pas la permission d'éxectuter cette commande !
  848. description: Commande pour setup un Dé à coudre
  849. trigger:
  850. if arg 1 is "help":
  851. send "&7&m-----------------------------------------------"
  852. send "&a/dacadm &fcreate <nom> - Créer un arène"
  853. send "&a/dacadm &fdelete <nom> - Supprimer une arène"
  854. send "&a/dacadm &flist - Liste des arènes"
  855. send "&a/dacadm &fsetwaitlobby <nom> - Mettre le lobby d'attente"
  856. send "&a/dacadm &fsetspawnspec <nom> - Mettre le spawn des spectateurs"
  857. send "&a/dacadm &fsetspawnplayers <nom> - Mettre le spawn des joueurs"
  858. send "&a/dacadm &fsetmaxplayers <nom> - Mettre le nombre maximum de joueurs"
  859. send "&a/dacadm &fsetminplayers <nom> - Mettre le nombre minimum de joueurs pour qu'une partie commence"
  860. send "&a/dacadm &fsetmainlobby - Définir le mainlobby"
  861. send "&a/dacadm &fsetleaderboard <nom> - Mettre un classement d'une statistique"
  862. send "&a/dacadm &fdelleaderboard <nom> - Supprimer un classement"
  863. send "&a/dacadm &fforceupdateleaderboard - Forcer les classement à se mettre à jour"
  864. send "&a/dacadm &fsetnpc <nom> - Ajouter le npc"
  865. send "&a/dacadm &fdetnpc <nom> - Supprimer le npc"
  866. send "&a/dacadm &fwand <nom> - Sélectionné 2 points du bassin"
  867. send "&a/dacadm &fsetbassin <nom> - Mettre le bassin"
  868. send "&a/dacadm &fsave <nom> - Activer votre arène"
  869. send "&a/dacadm &funsave <nom> - Désactiver votre arène"
  870. send "&a/dacadm &fdebug - Clear les bugs &c(A utiliser en cas de crash de serveur)"
  871. send "&7&m------------------------------------------------"
  872. stop
  873. if arg 1 is "create":
  874. if arg 2 is set:
  875. if {dac::setup::%arg 2%} is not set:
  876. set {dac::setup::%arg 2%} to arg 2
  877. add arg 2 to {dac::arena::*}
  878. send "{@prefix} &fVous venez de créer l'arène &a%arg 2%&f."
  879. stop
  880. else:
  881. send "{@prefix} {@already_exist}"
  882. stop
  883. else:
  884. send "{@prefix} {@set_arg2}"
  885. stop
  886.  
  887. if arg 1 is "del" or "delete":
  888. if arg 2 is set:
  889. send "%{dac::setup::%arg 2%}%"
  890. if {dac::setup::%arg 2%} is arg 2:
  891. send "{@prefix} &fVous venez de supprimer l'arène &a%{dac::setup::%arg 2%}%&f."
  892. clear {dac::setup::%arg 2%}
  893. clear {dac::setup::%arg 2%::spawn::waitlobby}
  894. clear {dac::setup::%arg 2%::spawn::spectator}
  895. clear {dac::setup::%arg 2%::spawn::spawnplayer}
  896. clear {dac::setup::%arg 2%::maxplayer}
  897. clear {dac::setup::%arg 2%::minplayer}
  898. clear {dac::setup::%arg 2%::pos1}
  899. clear {dac::setup::%arg 2%::pos2}
  900. remove arg 2 from {dac::arena::*}
  901. stop
  902. else:
  903. send "{@prefix} {@not_exist}"
  904. stop
  905. else:
  906. send "{@prefix} {@set_arg2}"
  907. stop
  908. if arg 1 is "list":
  909. if size of {dac::arena::*} != 0:
  910. loop {dac::arena::*}:
  911. if {dac::setup::%loop-value%::save} is true:
  912. add loop-value to {_setup::*}
  913. else:
  914. add loop-value to {_nosetup::*}
  915. loop "setup" and "nosetup":
  916. set {_%loop-value%::*} to "%{_%loop-value%::*}%"
  917. replace all "<none>" with "Aucun" in {_%loop-value%::*}
  918. replace all "and" with "et" in {_%loop-value%::*}
  919. send "&fListe des arènes:"
  920. send " "
  921. send "&a✔ Arène Setup: %{_setup::*}%"
  922. send "&c✖ Non Setup: %{_nosetup::*}%"
  923. else:
  924. send "{@prefix} &fAucune arène existe. Faîtes &a/dacadm create <nom> &fpour créer une arène."
  925.  
  926. if arg 1 is "setwaitlobby":
  927. if arg 2 is set:
  928. if {dac::setup::%arg 2%} is arg 2:
  929. set {dac::setup::%arg 2%::spawn::waitlobby} to player's location
  930. send "{@prefix} &fVous venez de définir le lobby d'attente avec succès."
  931. stop
  932. else:
  933. send "{@prefix} {@not_exist}"
  934. stop
  935. else:
  936. send "{@prefix} {@set_arg2}"
  937. stop
  938.  
  939.  
  940. if arg 1 is "setspawnspec":
  941. if arg 2 is set:
  942. if {dac::setup::%arg 2%} is arg 2:
  943. set {dac::setup::%arg 2%::spawn::spectator} to player's location
  944. send "{@prefix} &fVous venez de définir le point d'apparition pour les spectateurs avec succès."
  945. stop
  946. else:
  947. send "{@prefix} {@not_exist}"
  948. stop
  949. else:
  950. send "{@prefix} {@set_arg2}"
  951. stop
  952.  
  953.  
  954. if arg 1 is "setspawnplayers":
  955. if arg 2 is set:
  956. if {dac::setup::%arg 2%} is arg 2:
  957. set {dac::setup::%arg 2%::spawn::spawnplayer} to player's location
  958. send "{@prefix} &fVous venez de définir le point d'apparition pour les joueurs avec succès."
  959. stop
  960. else:
  961. send "{@prefix} {@not_exist}"
  962. stop
  963. else:
  964. send "{@prefix} {@set_arg2}"
  965. stop
  966.  
  967. if arg 1 is "setmaxplayers":
  968. if arg 2 is set:
  969. if {dac::setup::%arg 2%} is arg 2:
  970. if arg 3 is set:
  971. set {dac::setup::%arg 2%::maxplayer} to arg 3
  972. send "{@prefix} &fVous venez de définir le nombre max de joueurs à &a%arg 3% &favec succès."
  973. stop
  974. else:
  975. send "{@prefix} &cVeuillez mettre un nombre"
  976. else:
  977. send "{@prefix} {@not_exist}"
  978. stop
  979. else:
  980. send "{@prefix} {@set_arg2}"
  981. stop
  982.  
  983. if arg 1 is "setminplayers":
  984. if arg 2 is set:
  985. if {dac::setup::%arg 2%} is arg 2:
  986. if arg 3 is set:
  987. set {dac::setup::%arg 2%::minplayer} to arg 3
  988. send "{@prefix} &fVous venez de définir le nombre minimum de joueurs pour commencer une partie à &a%arg 3% &favec succès."
  989. stop
  990. else:
  991. send "{@prefix} &cVeuillez mettre un nombre"
  992. else:
  993. send "{@prefix} {@not_exist}"
  994. stop
  995. else:
  996. send "{@prefix} {@set_arg2}"
  997. stop
  998.  
  999. if arg 1 is "wand":
  1000. if arg 2 is set:
  1001. if {dac::setup::%arg 2%} is arg 2:
  1002. set {dac::setup::player::%player%} to arg 2
  1003. send "{@prefix} &fUn baton vous a été donné. Quand vous aurez fini, vous pourrez enlever le bâton de votre inventaire."
  1004. give stick named "&aCLIC GAUCHE &f= POS1 &aCLIC DROIT &f= POS2" to player
  1005. stop
  1006.  
  1007. else:
  1008. send "{@prefix} {@not_exist}"
  1009. stop
  1010. else:
  1011. send "{@prefix} {@set_arg2}"
  1012. stop
  1013.  
  1014. if arg 1 is "setbassin":
  1015. if arg 2 is set:
  1016. if {dac::setup::%arg 2%} is arg 2:
  1017. if {dac::setup::%arg 2%::pos1} and {dac::setup::%arg 2%::pos2} is set:
  1018. clear {dac::setup::%arg 2%::blocks::*}
  1019. loop all blocks within {dac::setup::%arg 2%::pos1} and {dac::setup::%arg 2%::pos2}:
  1020. if block at loop-block is water:
  1021. add location of loop-block to {dac::setup::%arg 2%::blocks::*}
  1022. send "{@prefix}&f Le bassin a été défini avec succès."
  1023. else:
  1024. send "{@prefix} &cVous n'avez pas sélectionné de point."
  1025. stop
  1026.  
  1027. else:
  1028. send "{@prefix} {@not_exist}"
  1029. stop
  1030. else:
  1031. send "{@prefix} {@set_arg2}"
  1032. stop
  1033.  
  1034. if arg 1 is "setleaderboard":
  1035. if arg 2 is set:
  1036. if arg 2 is "victoire" or "defaite" or "mort" or "dac" or "deacoudre" or "niveau":
  1037. if arg 2 is "victoire":
  1038. set {_s} to "win"
  1039. if arg 2 is "defaite":
  1040. set {_s} to "losse"
  1041. if arg 2 is "mort":
  1042. set {_s} to "mort"
  1043. if arg 2 is "niveau":
  1044. set {_s} to "level"
  1045. if arg 2 is "dac" or "deacoudre":
  1046. set {_s} to "dac"
  1047. if {dac::setup::mainlobby::leaderboard::%{_s}%} is set:
  1048. set {_loca} to {dac::setup::mainlobby::leaderboard::%{_s}%}
  1049. add 5 to y-coordinate of {_loca}
  1050. loop armor stands in radius 0.1 of {_loca}:
  1051. kill loop-entity
  1052. remove 1 from y-coordinate of {_loca}
  1053. loop 10 times:
  1054. loop armor stands in radius 0.1 of {_loca}:
  1055. kill loop-entity
  1056. remove 0.3 from y-coordinate of {_loca}
  1057. clear {dac::setup::mainlobby::leaderboard::%{_s}%}
  1058. set {dac::setup::mainlobby::leaderboard::%{_s}%} to location of player
  1059. dac_leaderboard(location of player, {_s})
  1060. send "{@prefix} &aLeaderboard &fplacé avec succès." to player
  1061. else:
  1062. send "{@prefix} &fVous devez choisir entre &a[Niveau, Victoire, Defaite, Mort et Dac ou Deacoudre]"
  1063. stop
  1064. else:
  1065. send "{@prefix} &fVous devez choisir entre &a[Niveau, Victoire, Defaite, Mort et Dac ou Deacoudre]"
  1066. stop
  1067.  
  1068.  
  1069. if arg 1 is "delleaderboard":
  1070. if arg 2 is set:
  1071. if arg 2 is "victoire" or "defaite" or "mort" or "dac" or "deacoudre" or "niveau":
  1072. if arg 2 is "victoire":
  1073. set {_s} to "win"
  1074. if arg 2 is "defaite":
  1075. set {_s} to "losse"
  1076. if arg 2 is "mort":
  1077. set {_s} to "mort"
  1078. if arg 2 is "niveau":
  1079. set {_s} to "level"
  1080. if arg 2 is "dac" or "deacoudre":
  1081. set {_s} to "dac"
  1082. if {dac::setup::mainlobby::leaderboard::%{_s}%} is set:
  1083. set {_loca} to {dac::setup::mainlobby::leaderboard::%{_s}%}
  1084. add 5 to y-coordinate of {_loca}
  1085. loop armor stands in radius 0.1 of {_loca}:
  1086. kill loop-entity
  1087. remove 1 from y-coordinate of {_loca}
  1088. loop 10 times:
  1089. loop armor stands in radius 0.1 of {_loca}:
  1090. kill loop-entity
  1091. remove 0.3 from y-coordinate of {_loca}
  1092. clear {dac::setup::mainlobby::leaderboard::%{_s}%}
  1093. send "{@prefix} &aLeaderboard &fsupprimé avec succès."
  1094. else:
  1095. send "{@prefix} &cCe Leaderboard n'a pas encore été placé."
  1096. stop
  1097. else:
  1098. send "{@prefix} &fVous devez choisir entre &a[Niveau, Victoire, Defaite, Mort et Dac ou Deacoudre]"
  1099. stop
  1100.  
  1101. else:
  1102. send "{@prefix} &fVous devez choisir entre &a[Niveau, Victoire, Defaite, Mort et Dac ou Deacoudre]"
  1103. stop
  1104.  
  1105. if arg 1 is "forceupdateleaderboard":
  1106. loop "win", "losse", "mort", "level" and "dac":
  1107. if {dac::setup::mainlobby::leaderboard::%loop-value%} is set:
  1108. set {_loc} to {dac::setup::mainlobby::leaderboard::%loop-value%}
  1109. if {dac::setup::mainlobby::leaderboard::%loop-value%} is set:
  1110. dac_leaderboard(({_loc}), "%loop-value%")
  1111. send "{@prefix} &aLeaderboard &fmis à jour avec succès"
  1112. stop
  1113.  
  1114.  
  1115.  
  1116. if arg 1 is "save":
  1117. if arg 2 is set:
  1118. if {dac::setup::%arg 2%} is arg 2:
  1119. if {dac::setup::%arg 2%::spawn::waitlobby} is set:
  1120. if {dac::setup::%arg 2%::spawn::spectator} is set:
  1121. if {dac::setup::%arg 2%::spawn::spawnplayer} is set:
  1122. if {dac::setup::%arg 2%::maxplayer} is set:
  1123. if {dac::setup::%arg 2%::minplayer} is set:
  1124. if {dac::setup::%arg 2%::pos1} is set:
  1125. if {dac::setup::%arg 2%::pos2} is set:
  1126. set {dac::setup::%arg 2%::save} to true
  1127. send "{@prefix} &a✔ Votre arène à été activé avec succès ! Désormais les joueurs peuvent le rejoindre."
  1128. stop
  1129. else:
  1130. send "{@prefix} &c✖ Il vous manque la position 2 de votre bassin."
  1131. stop
  1132. else:
  1133. send "{@prefix} &c✖ Il vous manque la position 1 de votre bassin."
  1134. stop
  1135. else:
  1136. send "{@prefix} &c✖ Il vous manque le nombre des minimum de joueurs."
  1137. stop
  1138. else:
  1139. send "{@prefix} &c✖ Il vous manque le nombre des maximums de joueurs."
  1140. stop
  1141. else:
  1142. send "{@prefix} &c✖ Il vous manque le spawn des joueurs."
  1143. stop
  1144. else:
  1145. send "{@prefix} &c✖ Il vous manque le spawn des spectateurs."
  1146. stop
  1147. else:
  1148. send "{@prefix} &c✖ Il vous manque le lobby d'attente."
  1149. stop
  1150.  
  1151. else:
  1152. send "{@prefix} {@not_exist}"
  1153. stop
  1154. else:
  1155. send "{@prefix} {@set_arg2}"
  1156. stop
  1157.  
  1158. if arg 1 is "unsave":
  1159. if arg 2 is set:
  1160. if {dac::setup::%arg 2%} is arg 2:
  1161. if {dac::setup::%arg 2%::save} is true:
  1162. clear {dac::setup::%arg 2%::save}
  1163. send "{@prefix} &fArène désactivé avec succès."
  1164. stop
  1165. else:
  1166. send "{@prefix} &cCette arène n'est pas activé."
  1167.  
  1168. else:
  1169. send "{@prefix} {@not_exist}"
  1170. stop
  1171. else:
  1172. send "{@prefix} {@set_arg2}"
  1173. stop
  1174.  
  1175. if arg 1 is "debug":
  1176. loop {dac::arena::*}:
  1177. if {dac::setup::%loop-value%::save} is true:
  1178. dac_reset("%loop-value%")
  1179. send "{@prefix} &fTous les bugs ont été clear."
  1180. stop
  1181.  
  1182.  
  1183. if arg 1 is "setmainlobby":
  1184. set {dac::setup::mainlobby::spawn} to location of player
  1185. set {dac::setup::mainlobby::world} to world of player
  1186. send "{@prefix} &fLe &aMain Lobby&f a été défini avec succès."
  1187.  
  1188. if arg 1 is "setnpc":
  1189. loop {dac::arena::*}:
  1190. if {dac::setup::%loop-value%::save} is true:
  1191. add size of {dac::game::%{_map}%::players::*} to {_playeringame}
  1192. set {dac::setup::mainlobby::hologram} to player's location
  1193. set {_loc} to player's location
  1194. add 2.3 to y-coordinate of {_loc}
  1195. set {_holo} to "{@hologram_npc}"
  1196. set {_holo::*} to {_holo} split at ";"
  1197. create hologram at {_loc} named {_holo::*}
  1198. send "{@prefix} &fVous avez placer le citizen."
  1199. create a citizen named "" at location of player
  1200. make player execute command "/npc select"
  1201. make player execute command "/npc id"
  1202. send player title "&aTapez L'ID de votre NPC" with subtitle "&aDans le chat." with 0.5 seconds fade in and 2 seconds fade out
  1203. set {verifnpc.%player%} to true
  1204.  
  1205. if arg 1 is "delnpc":
  1206. if target entity is a citizen:
  1207. delete holo object "dac.holo"
  1208. make player execute command "/npc select"
  1209. make player execute command "/npc remove"
  1210. set {_loc} to {dac::setup::mainlobby::hologram}
  1211. add 2.3 to y-coordinate of {_loc}
  1212. loop 3 times:
  1213. loop armor stands in radius 0.1 of {_loc}:
  1214. kill loop-entity
  1215. remove 0.3 from y-coordinate of {_loc}
  1216. clear {dac::setup::mainlobby::hologram}
  1217. send "{@prefix} &fVous avez définitivement supprimé le NPC."
  1218. else:
  1219. send "{@prefix} &cVous devez viser un NPC !"
  1220. stop
  1221.  
  1222.  
  1223.  
  1224. command /deacoudre [<text=help>] [<text>]:
  1225. aliases: /dac
  1226. trigger:
  1227. if arg 1 is "help":
  1228. send "&7&m-----------------------------------------------"
  1229. send "&a/dac &fplay - Rejoindre une arène aléatoirement"
  1230. send "&a/dac &fjoin <nom> - Rejoindre une arène prédifini"
  1231. send "&a/dac &fspec <nom> - Regarder une partie en cour"
  1232. send "&a/dac &flist - Liste des arènes disponible"
  1233. send "&a/dac &fquit - Quitter une arène"
  1234. send "&7&m------------------------------------------------"
  1235. stop
  1236. if arg 1 is "join":
  1237. if arg 2 is set:
  1238. if {dac::setup::%arg 2%} is arg 2:
  1239. if {dac::setup::%arg 2%::save} is true:
  1240. if {dac::player::%player%::map} is not arg 2:
  1241. if {dac::game::%arg 2%::statue} is not set:
  1242. if size of {dac::game::%arg 2%::players::*} != {dac::setup::%arg 2%::maxplayer}:
  1243. dac_join_player(player, "%{dac::setup::%arg 2%}%")
  1244. else:
  1245. send "{@prefix} &cArène pleine."
  1246. stop
  1247.  
  1248. else:
  1249. send "{@prefix} &cArène en cours."
  1250. stop
  1251. else:
  1252. send "{@prefix} &cVous êtes déjà dans cette partie."
  1253. stop
  1254. else:
  1255. send "{@prefix} {@not_exist}"
  1256. stop
  1257. else:
  1258. send "{@prefix} {@not_exist}"
  1259. stop
  1260. else:
  1261. send "{@prefix} {@set_arg2}"
  1262. stop
  1263. if arg 1 is "play":
  1264. loop {dac::arena::*}:
  1265. if {dac::setup::%loop-value%::save} is true:
  1266. if {dac::player::%player%::map} is not loop-value:
  1267. if {dac::game::%loop-value%::statue} is not set:
  1268. if size of {dac::game::%loop-value%::players::*} != {dac::setup::%loop-value%::maxplayer}:
  1269. set {_randommap} to loop-value
  1270. stop loop
  1271. if {_randommap} is set:
  1272. dac_join_player(player, "%{_randommap}%")
  1273. else:
  1274. send "{@prefix} &cAucune arène de libre."
  1275. stop
  1276. if arg 1 is "list":
  1277. dac_next_page(player, 0, "nospec")
  1278. if arg 1 is "quit":
  1279. if {dac::player:%player%::statue} is true:
  1280. dac_quit_player(player, "%{dac::player::%player%::map}%")
  1281. else:
  1282. send "{@prefix} &cVous n'avez rejoint aucune arène."
  1283. stop
  1284. if arg 1 is "spec":
  1285. if arg 2 is set:
  1286. if {dac::setup::%arg 2%} is arg 2:
  1287. if {dac::setup::%arg 2%::save} is true:
  1288. if {dac::game::%arg 2%::statue} is true:
  1289. if {dac::setup::%arg 2%} is not {dac::player::%player%::map}:
  1290. if {dac::player:%player%::statue} is true:
  1291. dac_quit_player(player, "%{dac::player::%player%::map}%")
  1292. set {dac::player::%player%::map} to {dac::setup::%arg 2%}
  1293. dac_spectator(player, "%{dac::player::%player%::map}%")
  1294. else:
  1295. send "{@prefix} &cVous êtes déjà dans cette partie"
  1296. else:
  1297. send "{@prefix} &cCette partie n'est pas en cour"
  1298.  
  1299. else:
  1300. send "{@prefix} {@not_exist}"
  1301. stop
  1302. else:
  1303. send "{@prefix} {@not_exist}"
  1304. stop
  1305. else:
  1306. send "{@prefix} {@set_arg2}"
  1307. stop
  1308.  
  1309.  
  1310. on join:
  1311. if player's world is "%{dac::setup::mainlobby::world}%":
  1312. dac_mainlobby(player)
  1313. if {@NotifUpdate} is true:
  1314. set {_text} to text from "https://pastebin.com/raw/2ZkQs8v8"
  1315. if {_text} is not "{@version}":
  1316. send "&e&m---------------------------------------------------"
  1317. send "&a[Dé à coudre] &fUne nouvelle version est disponible ! La &a%{_text}%&f. Pour la télécharger rendez-vous ici &a&nhttps://skript-mc.fr/forum/files/file/411-dé-à-coudre-multi-arène-100-automatique-npc-mainlobby/"
  1318. send "&e&m---------------------------------------------------"
  1319. wait 2.5 ticks
  1320. loop {dac::arena::*}:
  1321. if {dac::setup::%loop-value%::save} is true:
  1322. hide {dac::game::%loop-value%::players::*} from player
  1323. hide player from {dac::game::%loop-value%::players::*}
  1324.  
  1325.  
  1326.  
  1327. on break:
  1328. if {dac::player:%player%::statue} is true:
  1329. cancel event
  1330. if player don't have permission "dac.admin":
  1331. if player's world is "%{dac::setup::mainlobby::world}%":
  1332. cancel event
  1333.  
  1334.  
  1335.  
  1336. on place:
  1337. if {dac::player:%player%::statue} is true:
  1338. cancel event
  1339. if player don't have permission "dac.admin":
  1340. if player's world is "%{dac::setup::mainlobby::world}%":
  1341. cancel event
  1342.  
  1343. on hunger meter change:
  1344. if {dac::player:%player%::statue} is true:
  1345. cancel event
  1346. if player's world is "%{dac::setup::mainlobby::world}%":
  1347. cancel event
  1348.  
  1349.  
  1350. on damage of player:
  1351. if {dac::player:%victim%::statue} is true:
  1352. cancel event
  1353. if damage cause is fall:
  1354. if {dac::game::%{dac::player::%victim%::map}%::statue} is true:
  1355. if {dac::player::%victim%::spectator} is not set:
  1356. clear {dac::player::%victim%::saut}
  1357. add 1 to {dac::player::%victim's uuid%::stats::mort}
  1358. if {dac::player::%victim%::life} = 0:
  1359. add 1 to {dac::player::%victim's uuid%::stats::losse}
  1360. strike lightning effect at the victim
  1361. remove victim from {dac::game::%{dac::player::%victim%::map}%::players.alive::*}
  1362. remove victim from {dac::game::%{dac::player::%victim%::map}%::players.nonpasse::*}
  1363. send "{@prefix} {@death}" to {dac::game::%{dac::player::%victim%::map}%::players::*}
  1364. dac_spectator(victim, "%{dac::player::%victim%::map}%")
  1365. if size of {dac::game::%{dac::player::%victim%::map}%::players.alive::*} != 1 or 0:
  1366. dac_pick_random_player("%{dac::player::%victim%::map}%")
  1367. loop {dac::game::%{dac::player::%victim%::map}%::players::*}:
  1368. edit score id "joueurrestant.%loop-value%" to "&fJoueurs restant: &a%size of {dac::game::%{dac::player::%victim%::map}%::players.alive::*}%" and 3
  1369. else:
  1370. remove 1 from {dac::player::%victim%::life}
  1371. teleport victim to {dac::setup::%{dac::player::%victim%::map}%::spawn::spawnplayer}
  1372. send "{@prefix} {@death_but_revive}" to {dac::game::%{dac::player::%victim%::map}%::players::*}
  1373. wait 2 ticks
  1374. dac_detection(victim, "%{dac::player::%victim%::map}%")
  1375. set action bar of victim to "&fIl te reste &a%{dac::player::%victim%::life}% &fvies !"
  1376. if size of {dac::game::%{dac::player::%victim%::map}%::players.alive::*} <= 1:
  1377. set {_winner} to first element of {dac::game::%{dac::player::%victim%::map}%::players.alive::*}
  1378. dac_win("%{dac::player::%victim%::map}%")
  1379. if victim's world is "%{dac::setup::mainlobby::world}%":
  1380. if damage cause is void:
  1381. teleport victim to {dac::setup::mainlobby::spawn}
  1382. cancel event
  1383.  
  1384. on quit:
  1385. if {dac::setup::player::%player%} is set:
  1386. clear {dac::setup::player::%player%}
  1387. if {dac::player:%player%::statue} is true:
  1388. dac_quit_player(player, "%{dac::player::%player%::map}%")
  1389. clear {verifnpc.%player%}
  1390.  
  1391. on world change:
  1392. if {dac::player:%player%::statue} is true:
  1393. dac_quit_player(player, "%{dac::player::%player%::map}%")
  1394. loop {dac::arena::*}:
  1395. if {dac::setup::%loop-value%::save} is true:
  1396. hide {dac::game::%loop-value%::players::*} from player
  1397. hide player from {dac::game::%loop-value%::players::*}
  1398. if player's world is "%{dac::setup::mainlobby::world}%":
  1399. dac_mainlobby(player)
  1400. else:
  1401. wipe player's sidebar
  1402.  
  1403.  
  1404.  
  1405. on chat:
  1406. set {_msg.alive} to "{@chat_alive}"
  1407. set {_msg.lobby} to "{@chat_mainlobby}"
  1408. set {_msg.dead} to "{@chat_dead}"
  1409. replace all "[NIVEAU]" with "%{dac::player::%player's uuid%::stats::level}%✫" in {_msg.alive}
  1410. replace all "[NIVEAU]" with "%{dac::player::%player's uuid%::stats::level}%✫" in {_msg.lobby}
  1411. replace all "[NIVEAU]" with "%{dac::player::%player's uuid%::stats::level}%✫" in {_msg.dead}
  1412. if {dac::player:%player%::statue} is true:
  1413. cancel event
  1414. if {dac::player::%player%::spectator} is not set:
  1415. send "%{_msg.alive}%" to {dac::game::%{dac::player::%player%::map}%::players::*}
  1416. else:
  1417. send "%{_msg.dead}%" to {dac::game::%{dac::player::%player%::map}%::players.spec::*}
  1418. if player's world is "%{dac::setup::mainlobby::world}%":
  1419. loop all players in world "%{dac::setup::mainlobby::world}%":
  1420. cancel event
  1421. send "%{_msg.lobby}%" to loop-player
  1422. if {verifnpc.%player%} is true:
  1423. cancel event
  1424. set {dac::npcid} to message
  1425. send player title "&aL'ID du NPC (%message%) est mis !" with subtitle "&6Cela ne marche pas ? Faites /verifnpc" with 0.5 seconds fade in and 2 seconds fade out
  1426. clear {verifnpc.%player%}
  1427.  
  1428.  
  1429.  
  1430. on left click with stick:
  1431. if colored name of player's tool is "&aCLIC GAUCHE &f= POS1 &aCLIC DROIT &f= POS2":
  1432. if player has permission "dac.admin":
  1433. set {dac::setup::%{dac::setup::player::%player%}%::pos1} to location of clicked block
  1434. send "{@prefix} &aPosition 1 &fdéfini."
  1435. cancel event
  1436.  
  1437.  
  1438. on right click with stick:
  1439. if colored name of player's tool is "&aCLIC GAUCHE &f= POS1 &aCLIC DROIT &f= POS2":
  1440. if player has permission "dac.admin":
  1441. set {dac::setup::%{dac::setup::player::%player%}%::pos2} to location of clicked block
  1442. send "{@prefix} &aPosition 2 &fdéfini."
  1443. cancel event
  1444.  
  1445.  
  1446.  
  1447. on right click with feather:
  1448. if colored name of player's tool is "&aForcer la partie à demarrer &7(Clic-droit)":
  1449. if player has permission "dac.forcestart":
  1450. if size of {dac::game::%{dac::player::%player%::map}%::players::*} != 1 or 0:
  1451. dac_StartGame("%{dac::player::%player%::map}%")
  1452. else:
  1453. send "{@prefix} &cTu ne peux pas démarrer la partie car il y a qu'un seul joueur"
  1454.  
  1455. on right click with barrier:
  1456. if colored name of player's tool is "&cQuitter la partie &7(Clic-droit)":
  1457. cancel event
  1458. dac_quit_player(player, "%{dac::player::%player%::map}%")
  1459.  
  1460.  
  1461.  
  1462.  
  1463. on inventory click:
  1464. if {dac::player:%player%::statue} is true:
  1465. cancel event
  1466. if player don't have permission "dac.admin":
  1467. if player's world is "%{dac::setup::mainlobby::world}%":
  1468. cancel event
  1469.  
  1470. on drop:
  1471. if {dac::player:%player%::statue} is true:
  1472. cancel event
  1473. if player don't have permission "dac.admin":
  1474. if player's world is "%{dac::setup::mainlobby::world}%":
  1475. cancel event
  1476.  
  1477.  
  1478. on npc right click:
  1479. set {_number} to "%{dac::npcid}%" parsed as number
  1480. if citizen is {_number}:
  1481. cancel event
  1482. open virtual chest with size 4 named "Jouer au Dé à coudre" to player
  1483. wait a tick
  1484. format gui slot 12 of player with feather named "&aDé à coudre" with lore "&7Jouez au Dé à coudre !||||&eCliquez pour jouer !" to run:
  1485. close player's inventory
  1486. make player execute command "/dac play"
  1487. format gui slot 14 of player with sign item named "&aSelecteur de map" with lore "&7Choissisez la map auquel vous voudriez jouer !||||&eCliquez pour choisir !" to run:
  1488. make player execute command "/dac list"
  1489. format gui slot 31 of player with barrier named "&cFermer" to run:
  1490. close player's inventory
  1491.  
  1492. on npc left click:
  1493. set {_number} to "%{dac::npcid}%" parsed as number
  1494. if citizen is {_number}:
  1495. cancel event
  1496. open virtual chest with size 4 named "Jouer au Dé à coudre" to player
  1497. wait a tick
  1498. format gui slot 12 of player with feather named "&aDé à coudre" with lore "&7Jouez au Dé à coudre !||||&eCliquez pour jouer !" to run:
  1499. close player's inventory
  1500. make player execute command "/dac play"
  1501. format gui slot 14 of player with sign item named "&aSelecteur de map" with lore "&7Choissisez la map auquel vous voudriez jouer !||||&eCliquez pour choisir !" to run:
  1502. make player execute command "/dac list"
  1503. format gui slot 31 of player with barrier named "&cFermer" to run:
  1504. close player's inventory
  1505.  
  1506. on right click with nether star:
  1507. if colored name of player's tool is "&aRelancer une partie &7(Clic-droit)":
  1508. make player execute command "/dac play"
  1509.  
  1510. command /verifnpc:
  1511. permission: dac.admin
  1512. permission message: &cVous n'avez pas la permission.
  1513. trigger:
  1514. if target entity is citizen:
  1515. send player title "&aTapez L'ID de votre NPC" with subtitle "&aDans le chat." with 0.5 seconds fade in and 2 seconds fade out
  1516. make player execute command "/npc select"
  1517. make player execute command "/npc id"
  1518. set {verifnpc.%player%} to true
  1519. else:
  1520. send "&cVous devez viser un NPC."
  1521.  
  1522. command /§deatheffect <player>:
  1523. trigger:
  1524. strike lightning effect at the arg
  1525.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement