HallowedS

Untitled

Feb 6th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.82 KB | None | 0 0
  1. # Creator: minouis55
  2. # Edit: hallowed
  3. # Version: 2.0
  4.  
  5. options:
  6. permission-message: &cVocê não tem permissão de utilizar este comando.
  7. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  8. # Update
  9. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  10. on script load:
  11. if file "plugins/Skript/scripts/Update 1.sk" exists:
  12. df "plugins/Skript/scripts/Update 1.sk"
  13. wait 10 ticks
  14. set {_Ver} to text from "http://pastebin.com/QdhYpbSR"
  15. if {_ver} is not "2.0":
  16. send "&c[Update] Você está rodando a versão antiga do Faction" to console
  17. download from "http://pastebin.com/raw/T6gKy00j" to "plugins/Skript/scripts/Updates/updates"
  18. send "&c[Update] Atualize-o ou tera grandes problemas!" to console
  19. stop
  20.  
  21. command /aYT:
  22. trigger:
  23. broadcast "1ere version"
  24. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  25. # ?
  26. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  27. on join:
  28. if "%{f.list.players::*}%" doesn't contain "%player%":
  29. add player to {f.list.players::*}
  30. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  31. # Comando principal
  32. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  33. command /faction [<text>] [<text>]: #
  34. permission: faction.member
  35. permission message: {@permission-message}
  36. aliases: /f , /fac
  37. description: Comando principal de faction
  38. trigger:
  39. if argument 1 is "criar":
  40. if {f.fac.name.%player%} is set:
  41. send "&cVocê já faz parte de uma facção."
  42. else if arg-2 isn't set:
  43. send "&cUtilize /f criar <nome>."
  44. else if "%{f.list.factions::*}%" contain "%arg-2%":
  45. send "&cOpa Já existe outra facção utilizando o nome '%arg-2%'."
  46. else:
  47. add arg-2 to {f.list.factions::*}
  48. set {f.fac.name.%player%} to arg-2
  49. set {f.fac.grade.%player%} to 3
  50. send "&eYAY! Sua facção foi criada com sucesso!"
  51. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  52. # Funções
  53. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  54.  
  55. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  56. # Comando de dominar área
  57. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  58. else if argument 1 is "dominar":
  59. if {f.fac.name.%player%} isn't set:
  60. send "&cVocê não está em uma facção."
  61. else if {f.fac.grade.%player%} < 2:
  62. send "&cVocê não tem o grau necessário."
  63. else if "%{f.chunk::%chunk at player%}%" is "%{f.fac.name.%player%}%":
  64. send "&aEsta terra já está dominada por sua facção!"
  65. else if {f.chunk::%chunk at player%} is set:
  66. send "&cA facção '%{f.chunk::%chunk at player%}%' já dominou esta terra. Portanto não foi possível dominar esta terra."
  67. else:
  68. add 1 to {f.fac.chunksclaims.%{f.fac.name.%player%}%}
  69. set {f.chunk::%chunk at player%} to {f.fac.name.%player%}
  70. send "&aVocê dominou esta terra com sucesso!"
  71. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  72. # CLAIMS/CHUNK
  73. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  74. else if argument 1 is "surclaim":
  75. if {f.fac.name.%player%} isn't set:
  76. send "&cVous n'avez pas de Faction !"
  77. else if {f.fac.grade.%player%} < 2:
  78. send "&cVous n'avez pas le grade requis !"
  79. else if "%{f.chunk::%chunk at player%}%" is "%{f.fac.name.%player%}%":
  80. send "&cCe Chunk vous appartient !"
  81. else if "%{f.chunk::%chunk at player%}%" is "<none>":
  82. send "&cCe Chunk n'est pas occupé, dans ce cas la faite: &f/f surclaim %{f.fac.name.%player%}%"
  83. else if FactionPower("%{f.chunk::%chunk at player%}%") >= {f.fac.chunksclaims.%{f.chunk::%chunk at player%}%}:
  84. send "&cLa faction a assez de power pour garder ses chunks !"
  85. else if FactionPower("%{f.fac.name.%player%}%") <= {f.fac.chunksclaims.%{f.fac.name.%player%}%}:
  86. send "&cIl vous faut %{f.fac.chunksclaims.%{f.fac.name.%player%}%} + 1% powers pour claim un autre chunk !"
  87. else:
  88. add 1 to {f.fac.chunksclaims.%{f.fac.name.%player%}%}
  89. subtract 1 from {f.fac.chunksclaims.%{f.chunk::%chunk at player%}%}
  90. set {f.chunk::%chunk at player%} to {f.fac.name.%player%}
  91. send "&cHeey! %player% está tentando claimar a sua terra em %chunk at player%" to {_c}
  92. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  93. # Mapa
  94. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  95. else if argument 1 is "mapa":
  96. if argument 2 is "off":
  97. delete {f.fac.bouclemap::%player%}
  98. loop 150 times:
  99. send " "
  100. send "&aModo mapa desativado com sucesso."
  101. else if argument 2 is "on":
  102. set {f.fac.bouclemap::%player%} to true
  103. send "&aModo mapa ativado com sucesso."
  104. else if argument 2 isn't "auto":
  105. send "&7Faites &f/f map on|off &7pour la rendre permanente."
  106. else:
  107. set {_mapX} to 11
  108. set {_mapY} to 6
  109. set {_m} to ""
  110. loop 13 times:
  111. loop 23 times:
  112. set {_x} to {_mapX} * 16
  113. set {_y} to {_mapY} * 16
  114. set {_chunk} to chunk at block {_y} blocks north {_x} blocks west of player
  115. if {f.chunk::%{_chunk}%} isn't set:
  116. set {_result} to ""
  117. else:
  118. set {_result} to {f.chunk::%{_chunk}%}
  119. if {_chunk} is chunk at player:
  120. set {_m} to "%{_m}%&e█"
  121. else if {_result} is {f.fac.name.%player%}:
  122. set {_m} to "%{_m}%&8█"
  123. else if {_result} is "SAFE":
  124. set {_m} to "%{_m}%&6█"
  125. else if {_result} is "WARZONE":
  126. set {_m} to "%{_m}%&4█"
  127. else if {_result} is "":
  128. set {_m} to "%{_m}%&7█"
  129. else:
  130. set {_m} to "%{_m}%&c█"
  131. add -1 to {_mapX}
  132. send "%{_m}%" to player
  133. set {_m} to ""
  134. add -1 to {_mapY}
  135. set {_mapX} to 11
  136. if arg-2 isn't "auto":
  137. send " "
  138. send "&8█ &fSua facção &e█ &fSua posição &c█ &fInimiga"
  139. send "&6█ &fZona Protegida &7█ &fZona Livre &4█ &fZona de Guerra"
  140. else if arg-2 isn't set:
  141. send " "
  142. send "&8█ &fSua facção &e█ &fSua posição &c█ &fInimiga"
  143. send "&6█ &fZona Protegida &7█ &fZona Livre &4█ &fZona de Guerra"
  144. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  145. # Zonas Protegidas
  146. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  147. else if argument 1 is "setsafe":
  148. if player doesn't have permission "faction.admin":
  149. send "{@permission-message}"
  150. else if {f.chunk::%chunk at player%} is set:
  151. send "&aZona Protegida já está claimado nesta terra."
  152. else:
  153. send "&aVocê dominou esta terra com sucesso!"
  154. set {f.chunk::%chunk at player%} to "SAFE"
  155. else if argument 1 is "remsafe":
  156. if player doesn't have permission "faction.admin":
  157. send "{@permission-message}"
  158. else if {f.chunk::%chunk at player%} isn't "SAFE":
  159. send "&aEsta terra é da facção '%{f.chunk::%chunk at player%}%'!"
  160. else:
  161. send "&aVocê dominou esta terra com sucesso!"
  162. delete {f.chunk::%chunk at player%}
  163. else if argument 1 is "setwarzone":
  164. if player doesn't have permission "faction.admin":
  165. send "{@permission-message}"
  166. else if {f.chunk::%chunk at player%} is set:
  167. send "&aZona de Guerra já está claimado nesta terra."
  168. else:
  169. send "&aVocê dominou esta terra com sucesso!"
  170. set {f.chunk::%chunk at player%} to "WARZONE"
  171. else if argument 1 is "remwarzone":
  172. if player doesn't have permission "faction.admin":
  173. send "{@permission-message}"
  174. else if {f.chunk::%chunk at player%} isn't "WARZONE":
  175. send "&aEsta terra é da facção '%{f.chunk::%chunk at player%}%'!"
  176. else:
  177. send "&aVocê dominou esta terra com sucesso!"
  178. delete {f.chunk::%chunk at player%}
  179. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  180. # Comando de abandonar área
  181. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  182. else if argument 1 is "abandonarc":
  183. if {f.fac.name.%player%} isn't set:
  184. send "&cVocê não está em uma facção."
  185. else if {f.fac.grade.%player%} < 2:
  186. send "&cVocê não tem o grau necessário."
  187. else if {f.chunk::%chunk at player%} isn't set:
  188. send "&cEsta terra não é de sua facção!"
  189. else if {f.chunk::%chunk at player%} isn't {f.fac.name.%player%}:
  190. send "&cEsta terra não é de sua facção!"
  191. else:
  192. subtract 1 from {f.fac.chunksclaims.%{f.fac.name.%player%}%}
  193. delete {f.chunk::%chunk at player%}
  194. send "&aTerra perdida com sucesso."
  195. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  196. # Comando de remover/sair (de) facção
  197. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  198. else if argument 1 is "desfazerc" or "sairc":
  199. if command sender is a player:
  200. if {f.fac.name.%player%} isn't set:
  201. send "&cVocê não está em uma facção."
  202. stop
  203. else if {f.fac.grade.%player%} isn't 3:
  204. send "&cVocê não tem o grau necessário."
  205. stop
  206. else:
  207. set {_faction} to "%{f.fac.name.%player%}%"
  208. else:
  209. if arg-2 isn't set:
  210. stop
  211. set {_faction} to "%arg-2%"
  212. if command sender is a player:
  213. send "&cVocê acaba de desfazer sua facção."
  214. loop {f.list.factions::*}:
  215. if "%{_faction}%" is "%loop-value%":
  216. remove loop-value from {f.list.factions::*}
  217. delete {f.fac.desc.%{_faction}%}
  218. delete {f.fac.powerboost.%{_faction}%}
  219. delete {f.fac.tag.%{_faction}%}
  220. delete {f.fac.lastconnection.%{_faction}%}
  221. delete {f.fac.home.%{_faction}%}
  222. delete {f.fac.invitation.%{_faction}%}
  223. delete {f.fac.chunksclaims.%{_faction}%}
  224. clear {f.fac.ennemy.%{_faction}%::*}
  225. loop {f.fac.ally.%{_faction}%::*}:
  226. loop {f.fac.ally.%loop-value-1%::*}:
  227. if "%loop-value-2%" is "%{_faction}%":
  228. remove loop-value-2 from {f.fac.ennemy.%loop-value-1%::*}
  229. clear {f.fac.ally.%{_faction}%::*}
  230. loop {f.chunk::*}:
  231. if "%loop-value-1%" is "%{_faction}%":
  232. remove loop-value-1 from {f.chunk::*}
  233. loop {f.list.players::*}:
  234. if {f.fac.name.%loop-value-1%} is {_faction}:
  235. delete {f.fac.name.%loop-value-1%}
  236. delete {f.fac.grade.%loop-value-1%}
  237. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  238. # HOME/SETHOME
  239. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  240. else if argument 1 is "definir":
  241. if argument 2 is "base":
  242. if {f.fac.name.%player%} isn't set:
  243. send "&cVocê não está em uma facção."
  244. else if {f.fac.grade.%player%} < 1:
  245. send "&cVocê não tem o grau necessário."
  246. else if {f.chunk::%chunk at player%} isn't set:
  247. send "&cVocê só pode definir bases dentro das terras da sua facção!"
  248. else if {f.chunk::%chunk at player%} isn't {f.fac.name.%player%}:
  249. send "&cVocê só pode definir bases dentro das terras da sua facção!"
  250. else if arg-2 isn't set:
  251. send "&cUtilize /f definir base."
  252. else:
  253. set {f.fac.home.%{f.fac.name.%player%}%} to location of player
  254. send "&aLocalização de base alterada com sucesso."
  255. else if argument 1 is "base":
  256. if {f.fac.name.%player%} isn't set:
  257. send "&cVocê não está em uma facção."
  258. else if {f.fac.home.%{f.fac.name.%player%}%} isn't set:
  259. send "&cHum... Sua facção ainda não está com sua base definida."
  260. else:
  261. teleport player to {f.fac.home.%{f.fac.name.%player%}%}
  262. send "&aTeleportado para a base da sua facção!" # delete {f.fac.home.%{_faction}%}
  263. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  264. # Descrição
  265. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  266. else if argument 1 is "info" or "who" or "show" or "f":
  267. if arg-2 is set:
  268. if player is op:
  269. if {f.fac.chunksclaims.%arg-2%} isn't set:
  270. if {f.fac.name.%arg-2%} isn't set:
  271. send "&cOps! Parece que esta facção não existe!"
  272. stop
  273. else:
  274. set {_faction} to "%{f.fac.name.%arg-2%}%"
  275. else:
  276. set {_faction} to "%arg-2%"
  277. else:
  278. send "{permission-send}"
  279. stop
  280. else:
  281. if {f.fac.name.%player%} isn't set:
  282. send "&cOps! Aparentemente você não possuí nenhuma facção!"
  283. stop
  284. else:
  285. set {_faction} to "%{f.fac.name.%player%}%"
  286. if {_faction} isn't set:
  287. send " &4ERREUR !"
  288. stop
  289. send " "
  290. send " &e%{_faction}% "
  291. # Informations
  292. if {f.fac.invitation.%{_faction}%} is true:
  293. send "&2Terras/&4Poder&2/&4Poder máximo&2: &7%{f.fac.chunksclaims.%{_faction}%}%/%{_p}%"
  294. else:
  295. send "&2Terras/&4Poder&2/&4Poder máximo&2: &7%{f.fac.chunksclaims.%{_faction}%}%/%{_p}%"
  296. set {_dif} to difference between now and {f.fac.lastconnection.%{_faction}%}
  297. if {f.fac.lastconnection.%{_faction}%} is set:
  298. set {_dif_D} to "%difference between 14 days and {_dif}%"
  299. replace all " hours" with "&6h&e" in {_dif_D}
  300. replace all " hour" with "&6h&e" in {_dif_D}
  301. replace all " days" with "&6j&e" in {_dif_D}
  302. replace all " day" with "&6j&e" in {_dif_D}
  303. replace all " minutes" with "&6m&e" in {_dif_D}
  304. replace all " minute" with "&6m&e" in {_dif_D}
  305. replace all " seconds" with "&6s&e" in {_dif_D}
  306. replace all " second" with "&6s&e" in {_dif_D}
  307. replace all " and " with " " in {_dif_D}
  308. send "&7Suppression Auto dans: &e%{_dif_D}%"
  309. set {_p} to FactionPower("%{_faction}%")
  310. # connecté et membres
  311. set {_c} to 0
  312. set {_nbchefs} to 0
  313. loop all players:
  314. if "%{f.fac.name.%loop-player%}%" is "%{_faction}%":
  315. add 1 to {_c}
  316. if {f.fac.grade.%loop-player%} is 3:
  317. if {_m} is set:
  318. set {_m} to "%{_m}%&7, &c%loop-player%"
  319. else:
  320. set {_m} to "&c%loop-player%"
  321. add 1 to {_nbchefs}
  322. else if {f.fac.grade.%loop-player%} is 2:
  323. if {_m} is set:
  324. set {_m} to "%{_m}%&7, &5%loop-player%"
  325. else:
  326. set {_m} to "&5%loop-player%"
  327. add 1 to {_nbchefs}
  328. else:
  329. if {_m} is set:
  330. set {_m} to "%{_m}%&7, &d%loop-player%"
  331. else:
  332. set {_m} to "&d%loop-player%"
  333. if {_m} isn't set:
  334. set {_m} to "&fAucun Joueurs connectés"
  335. loop {f.list.players::*}:
  336. if {f.fac.name.%loop-value%} is {_faction}:
  337. if {_mem} is set:
  338. set {_mem} to "%{_mem}%, %loop-value%"
  339. else:
  340. set {_mem} to "%loop-value%"
  341. if {_mem} isn't set:
  342. set {_mem} to "&fFaction Vide !"
  343. send "&2Líder: &7%{_nbchefs}%"
  344. send "&2Membros: &7%{_c}%"
  345.  
  346. send "&2Membros online: &7%{_c}% %newline% &7%{_m}%"
  347.  
  348. # Allié et Ennemis
  349. loop {f.fac.ennemy.%{f.fac.name.%player%}%::*}:
  350. if {_e} is set:
  351. set {_e} to "%{_e}%&7, &c%loop-value%"
  352. else:
  353. set {_e} to "&c%loop-value%"
  354. loop {f.fac.ally.%{f.fac.name.%player%}%::*}:
  355. if {_a} is set:
  356. set {_a} to "%{_a}%&7, &a%loop-value%"
  357. else:
  358. set {_a} to "&a%loop-value%"
  359. if {_e} isn't set:
  360. set {_e} to "&7Nenhum"
  361. if {_a} isn't set:
  362. set {_a} to "&7Nenhum"
  363. send "&2Aliados: %{_a}%"
  364. send "&2Inimigos: %{_e}%"
  365. send " "
  366. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  367. # menu
  368. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  369. if argument 1 is "menu":
  370. if {f.fac.name.%player%} isn't set:
  371. send "&cVocê não faz parte de uma facção."
  372. else:
  373. open chest with 3 rows named "%{f.fac.name.%player%}%" to player
  374. format slot 10 of player with a paper named "&aRelações" with lore "&7Mostrar relações com outras facções" to close then run [make player execute command "/f sairc"]
  375. format slot 12 of player with wool:10 named "&aMembros" with lore "&7Mostrar membros de sua facção." to run [execute player command "/f invitations"]
  376. format slot 14 of player with a grass named "&aTerras" with lore "&7Mostrar todas as terras dominadas." to close then run [make player execute command "/negar"]
  377. format slot 16 of player with map named "&aPedidos" with lore "&7Mostrar todos os pedidos pendentes." to run [execute player command "/f invitations"]
  378. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  379. # Desfazer
  380. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  381. else if argument 1 is "sair":
  382. if {f.fac.name.%player%} isn't set:
  383. send "&cVocê não faz parte de uma facção."
  384. else if {f.fac.grade.%player%} > 2:
  385. send "&cO líder da facção não pode abandoná-la. Caso queira deletá-la, utilize /f desfazer."
  386. else:
  387. delete {f.fac.name.%player%}
  388. delete {f.fac.grade.%player%}
  389. open chest with 3 rows named "Confirmação" to player
  390. format slot 12 of player with a wool:5 named "&aAceitar (Leia Abaixo)" to close then run [make player execute command "/f sairc"]
  391. format slot 16 of player with a wool:14 named "&cNegar" with lore "&7Cancelar esta operação." to close then run [make player execute command "/negar"]
  392. stop
  393. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  394. # Remover
  395. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  396. else if argument 1 is "desfazerc":
  397. if command sender is a player:
  398. if {f.fac.name.%player%} isn't set:
  399. send "&cVocê não está em uma facção."
  400. stop
  401. else if {f.fac.grade.%player%} isn't 3:
  402. send "&cVocê não tem o grau necessário."
  403. stop
  404. else:
  405. set {_faction} to "%{f.fac.name.%player%}%"
  406. else:
  407. if arg-2 isn't set:
  408. stop
  409. set {_faction} to "%arg-2%"
  410. if command sender is a player:
  411. send "&cVocê acaba de sair da sua facção."
  412. loop {f.list.factions::*}:
  413. if "%{_faction}%" is "%loop-value%":
  414. remove loop-value from {f.list.factions::*}
  415. delete {f.fac.desc.%{_faction}%}
  416. delete {f.fac.powerboost.%{_faction}%}
  417. delete {f.fac.tag.%{_faction}%}
  418. delete {f.fac.lastconnection.%{_faction}%}
  419. delete {f.fac.home.%{_faction}%}
  420. delete {f.fac.invitation.%{_faction}%}
  421. delete {f.fac.chunksclaims.%{_faction}%}
  422. clear {f.fac.ennemy.%{_faction}%::*}
  423. loop {f.fac.ally.%{_faction}%::*}:
  424. loop {f.fac.ally.%loop-value-1%::*}:
  425. if "%loop-value-2%" is "%{_faction}%":
  426. remove loop-value-2 from {f.fac.ennemy.%loop-value-1%::*}
  427. clear {f.fac.ally.%{_faction}%::*}
  428. loop {f.chunk::*}:
  429. if "%loop-value-1%" is "%{_faction}%":
  430. remove loop-value-1 from {f.chunk::*}
  431. loop {f.list.players::*}:
  432. if {f.fac.name.%loop-value-1%} is {_faction}:
  433. delete {f.fac.name.%loop-value-1%}
  434. delete {f.fac.grade.%loop-value-1%}
  435. delete {f.fac.name.%player%}
  436. delete {f.fac.grade.%player%}
  437. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  438. # Desfazer Principal
  439. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  440. else if argument 1 is "desfazer":
  441. if {f.fac.name.%player%} isn't set:
  442. send "&cVocê não faz parte de uma facção."
  443. else:
  444. open chest with 3 rows named "Confirmação" to player
  445. format slot 11 of player with a wool:5 named "&aAceitar (Leia Abaixo)" with lore "&cVocê tem certeza que quer desfazer sua facção?" to close then run [make player execute command "/f desfazerc"]
  446. format slot 15 of player with a wool:14 named "&cNegar" with lore "&7Cancelar esta operação." to close then run [make player execute command "/negar"]
  447. wait 45 seconds
  448. send "&cVocê está sendo monitorado por atividades suspeitas."
  449. stop
  450. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  451. # Abandonar Principal
  452. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  453. else if argument 1 is "abandonar":
  454. if {f.fac.name.%player%} isn't set:
  455. send "&cVocê não faz parte de uma facção."
  456. stop
  457. else if {f.fac.grade.%player%} < 2:
  458. send "&cVocê não tem o grau necessário."
  459. stop
  460. else if {f.chunk::%chunk at player%} isn't set:
  461. send "&cVocê não pode retirar terras de outras facções!"
  462. stop
  463. else if {f.chunk::%chunk at player%} isn't {f.fac.name.%player%}:
  464. send "&cVocê não pode retirar terras de outras facções!"
  465. stop
  466. else:
  467. subtract 1 from {f.fac.chunksclaims.%{f.fac.name.%player%}%}
  468. delete {f.chunk::%chunk at player%}
  469. open chest with 4 rows named "Confirmação" to player
  470. format slot 13 of player with a grass named "Tem certeza que quer abandonar esta terra?" to close then run [make player execute command "/example1"]
  471. format slot 20 of player with a wool:5 named "&aAceitar (Leia Abaixo)" to close then run [make player execute command "/f abandonarc"]
  472. format slot 24 of player with a wool:14 named "&cNegar" with lore "&7Cancelar esta operação." to close then run [make player execute command "/negar"]
  473. add 1 to {f.fac.chunksclaims.%{f.fac.name.%player%}%}
  474. set {f.chunk::%chunk at player%} to {f.fac.name.%player%}
  475. stop
  476. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  477. # QUIT/KICK/PROMOTE
  478. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  479. else if argument 1 is "expulsarc":
  480. if {f.fac.name.%player%} isn't set:
  481. send "&cVocê não está em uma facção."
  482. else if arg-2 isn't set:
  483. send "&cUtilize /f expulsar <jogador>."
  484. else if {f.fac.grade.%player%} < 2:
  485. send "&c&cVocê não tem o grau necessário."
  486. else if {f.fac.name.%arg-2%} isn't {f.fac.name.%player%}:
  487. send "&cOps! O jogador %arg-2% não está em sua facção!"
  488. else if {f.fac.grade.%arg-2%} isn't 1:
  489. send "&cVocê deve rebaixar a classificação do jogador antes de expulsa-lo!"
  490. else:
  491. delete {f.fac.name.%arg-2%}
  492. delete {f.fac.grade.%arg-2%}
  493. send "&aO jogador %player% foi expulso de sua facção!" to {_c}
  494. else if argument 1 is "expulsar":
  495. if {f.fac.name.%player%} isn't set:
  496. send "&cVocê não está em uma facção."
  497. else if arg-2 isn't set:
  498. send "&cUtilize /f expulsar <jogador>."
  499. else if {f.fac.grade.%player%} < 2:
  500. send "&c&cVocê não tem o grau necessário."
  501. else if {f.fac.name.%arg-2%} isn't {f.fac.name.%player%}:
  502. send "&cOps! O jogador %arg-2% não está em sua facção!"
  503. else if {f.fac.grade.%arg-2%} isn't 1:
  504. send "&cVocê deve rebaixar a classificação do jogador antes de expulsa-lo!"
  505. else:
  506. open chest with 3 rows named "Confirmação" to player
  507. format slot 12 of player with a wool:5 named "&aAceitar (Leia Abaixo)" with lore "&cVocê tem certeza que deseja remover este jogador?" to close then run [make player execute command "/f expulsarc %arg-2%"]
  508. format slot 16 of player with a wool:14 named "&cNegar" with lore "&7Cancelar esta operação." to close then run [make player execute command "/negar"]
  509. stop
  510. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  511. # INVITATION/MEMBRE
  512. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  513. else if argument 1 is "invitation" or "invitations":
  514. if arg-2 isn't set:
  515. if {f.fac.name.%player%} isn't set:
  516. set {_objet} to "me"
  517. else:
  518. set {_objet} to "faction"
  519. else if arg-2 isn't "me" or "faction":
  520. send "&cUtilize /f invitation [me/faction]"
  521. stop
  522. else:
  523. set {_objet} to "%arg-2%"
  524. if {_objet} is "me":
  525. open chest with 6 rows named "Convites de si mesmo." to player
  526. else:
  527. open chest with 5 rows named "%{f.fac.name.%player%}% - Pedidos" to player
  528. wait 2 tick
  529. set {_case} to 0
  530. if {_objet} is "me":
  531. loop {f.list.factions::*}:
  532. loop {f.fac.invitations.%loop-value-1%::*}:
  533. if "%loop-value-2%" is "%player%":
  534. format slot {_case} of player with 1 of paper named "&7Facção: &f%loop-value-1%" with lore " ||&7Convite em andamente...|| ||&7Para aceitar: &a/f aceitar %loop-value-1%||&7Para recusar: &c/f recusar %loop-value-1%" to be unstealable
  535. add 1 to {_case}
  536. else:
  537. loop {f.fac.invitations.%{f.fac.name.%player%}%::*}:
  538. format slot {_case} of player with 1 of loop-value's skull named "&7Jogador: &f%loop-value%" with lore " ||&7Convite em andamente...|| ||&cClique para recusar o recrutamento." to run "faction reminvitation|%loop-value% %player%"
  539. add 1 to {_case}
  540. else if argument 1 contains "reminvitation":
  541. if command sender isn't console:
  542. stop
  543. else:
  544. set {_a} to "%arg-1%"
  545. set {_a::*} to {_a} split at "|"
  546. loop {f.fac.invitations.%{f.fac.name.%arg-2%}%::*}:
  547. if "%loop-value%" is "%{_a::2}%":
  548. remove loop-value from {f.fac.invitations.%{f.fac.name.%arg-2%}%::*}
  549. send "&cVocê revogou o convite do jogador %{_a::2}%..." to (arg-2 parsed as player)
  550. execute (arg-2 parsed as player) command "/faction invitations"
  551. else if argument 1 is "toggleinvitation" or "toggleinvite":
  552. if {f.fac.name.%player%} isn't set:
  553. send "&cVocê não está em uma facção."
  554. else if {f.fac.grade.%player%} < 2:
  555. send "&cVocê não tem o grau necessário."
  556. else if {f.fac.invitation.%{f.fac.name.%player%}%} is true:
  557. delete {f.fac.invitation.%{f.fac.name.%player%}%}
  558. clear {f.fac.invitations.%{f.fac.name.%player%}%::*}
  559. send "&cAgora é possível convidar membros! A lista foi limpa."
  560. else if {f.fac.invitation.%{f.fac.name.%player%}%} isn't set:
  561. set {f.fac.invitation.%{f.fac.name.%player%}%} to true
  562. else if argument 1 is "convidar" or "invite":
  563. if {f.fac.name.%player%} isn't set:
  564. send "&cVocê não está em uma facção."
  565. else if {f.fac.invitation.%{f.fac.name.%player%}%} isn't set:
  566. send "&cVocê não pode convidar jogadores. Digite '/f toggleinvite'!"
  567. else if arg-2 isn't set:
  568. send "&cUtilize /f convidar <jogador>"
  569. else if {f.fac.name.%arg-2%} is set:
  570. send "&c%arg-2% já tem uma facção!"
  571. else if "%{f.fac.invitations.%{f.fac.name.%player%}%::*}%" contains "%arg-2%":
  572. send "&cOps! Um convite já está em andamento, espere ele aceitar ou recusar para fazer outro."
  573. else:
  574. set {_p} to (arg-2 parsed as player)
  575. add {_p} to {f.fac.invitations.%{f.fac.name.%player%}%::*}
  576. send "&aVocê convidou '%{_p}%' para sua facção."
  577. send "&a%player% está te convidando para a facção dele! (&b%{f.fac.name.%player%}%&7) !" to {_p}
  578. else if argument 1 is "aceitar":
  579. if {f.fac.name.%player%} is set:
  580. send "&cVocê já está em uma facção!"
  581. else if arg-2 isn't set:
  582. send "&cVocê precisa especificar a facção depois do '%arg-1%'."
  583. else if "%{f.fac.invitations.%arg-2%::*}%" doesn't contain "%player%":
  584. send "&cEsta facção não te convidou para participar."
  585. else:
  586. set {f.fac.name.%player%} to "%arg-2%"
  587. set {f.fac.grade.%player%} to 1
  588. loop {f.fac.invitations.%arg-2%::*}:
  589. if "%loop-value%" is "%player%":
  590. remove loop-value from {f.fac.invitations.%arg-2%::*}
  591. send "&aVocê entrou na facção %arg-2%!"
  592. else if argument 1 is "recusar":
  593. if {f.fac.name.%player%} is set:
  594. send "&cVocê já está em uma facção."
  595. else if arg-2 isn't set:
  596. send "&cVocê precisa especificar uma facção depois do '%arg-1%'."
  597. else if "%{f.fac.invitations.%arg-2%::*}%" doesn't contain "%player%":
  598. send "&cEsta facção não te convidou para participar."
  599. else:
  600. send "&cVocê recusou o pedido da facção '%arg-2%'."
  601. loop {f.fac.invitations.%arg-2%::*}:
  602. if "%loop-value%" is "%player%":
  603. remove loop-value from {f.fac.invitations.%arg-2%::*}
  604. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  605. # Descrição
  606. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  607. if argument 1 is "desc":
  608. if {f.fac.name.%player%} isn't set:
  609. send "&cVocê não está em uma facção."
  610. else if arg-2 isn't set:
  611. send "&cColoque a descrição após o 'desc'."
  612. else if {f.fac.grade.%player%} < 2:
  613. send "&cVocê não tem o grau necessário."
  614. else:
  615. set {f.fac.desc.%{f.fac.name.%player%}%} to arg-2
  616. send "&aVocê definiu a descrição da facção para '%arg-2%'."
  617. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  618. # Ajuda
  619. #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
  620. else if argument 1 is "ajuda":
  621. send "&a/f info <facção> &8- &7Utilize para ver as informações sobre uma facção."
  622. send "&a/f sair &8- &7Utilize para sair de sua facção."
  623. send "&a/f dominar &8- &7Utilize para dominar uma terra."
  624. send "&a/f abandonar &8- &7Utilize abandonar uma terra de sua facção."
  625. send "&a/f base &8- &7Utilize para ir até a base de sua facção."
  626. send "&a/f definir base &8- &7Definir localização da base.."
  627. send "&a/f expulsar <jogador> &8- &7Utilize para expulsar algum jogador de sua facção."
  628. send "&a/f desfazer &8- &7Utilize para caso for lider exclua a sua facção."
  629. send "&a/f criar <nome> &8- &7Utilize para criar sua facção."
  630. send "&a/f desc <descrição> &8- &7Utilize para definir a descrição."
  631. send "&a/f mapa [on/off] &8- &7Utilize para ver o mapa."
  632. send "&a/f menu &8- &7Utilize para ver o menu da facção."
  633. send "&a/f convidar <jogador> &8- &7Utilize para convidar um jogador para uma facção."
Advertisement
Add Comment
Please, Sign In to add comment