Entities

Untitled

Aug 14th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 135.72 KB | None | 0 0
  1. options:
  2. # ___________________ ____ ____ ________ _____ _____________________ ___ ____ ___
  3. # / \ | | / \ | \ | | / \ | | | | | |
  4. # / ______________ / | | / \ | \ | | / ______________ \ | |___| |___| |
  5. # / / \_/ | | / \ | \ | | / / \_____\ | |
  6. # / / | | / /\ \ | |\ \ | | | |______________ | ____ |
  7. # | | | | / / \ \ | | \ \ | | \ \ | | | |
  8. # | | | | / / \ \ | | \ \ | | \_____________ \ | |____| |
  9. # | | | | / /------\ \ | | \ \ | | \ \ | |
  10. # \ \ | | / /________\ \ | | \ \ | | \ \ | ____ |
  11. # \ \ _ | | / / \ \ | | \ \| | _____ / / | | | |
  12. # \ \_____________/ \ | |_________________ / / \ \ | | \ | \ \_____________/ / | | | |
  13. # \ \ | | / / \ \ | | \ | \ / | | | |
  14. # \__________________/ |______________________| /____/ \____\ |____| \_________| \____________________/ |_______|____|_______|
  15. #
  16. # Original Factions Project, By UGCGames Ilya K (C).
  17.  
  18. # By using this software you agree with our ToS: https://www.spigotmc.org/resources/flans-factions-skript-uuid-support-1-8-1-9-x-support.21708/
  19.  
  20. #Here can be downloaded more Addons for this skript:
  21. #COMING SOON!
  22.  
  23. #====================================================
  24. # Software Version:
  25. version: v2.3A Release #Only DEV! Don't touch this!
  26. #====================================================
  27.  
  28. #PLEASE NOTE: Changing the options here are in your risk!
  29.  
  30. #===================
  31. # Global Settings
  32. #===================
  33. #These are misc options. We recommend you to not touch them until you know what are you doing.
  34. #We won't give support if you change the options below.
  35. #They're in your own risk!
  36.  
  37. #The rest of the options can be configured at (yourserver)/plugins/Factions/config.yml.
  38.  
  39. options:
  40. #This will be the keyword for every displayed message/title/score/gui or any others..
  41. p: Clan #By default, you may change it only to 'Faction' or keep it as 'Faction', as you like, but don't put the 's' suffix after this because it will make some grammar mistakes. So beware with it ;)
  42.  
  43. #This will be the world that clans will work ONLY ON!
  44. world: world #By default it is 'world', don't set here any other world that doesn't exist in your server database or it'll be error and it won't run the skript correctly. You've warned!!
  45.  
  46. #This will be the command:
  47. command: c #This is the main command. Please don't put here any other symbols like: /,"'\;:|`~#@!%$^&1234567890*()-_+=?><][{} ONLY LETTERS!
  48.  
  49. #These will be the ally commands that executable:
  50. cmd-additions: /f, /fac, /faction, /factions, /flan, /flans, /clan, /c, /clans #You can add more command allies here to the list, as you like. BUT NOT THE COMMAND itself, to not repeat that...
  51.  
  52. #This will be the permission message:
  53. noperm: &8[&9Permission&8] &7You don't have permission to execute this command!
  54.  
  55. #Should the death messages be enabled?
  56. death_messages: true #Set 'false' to disable it.
  57.  
  58. #===================
  59. #Permissions Options
  60. #===================
  61. #This will be the Admin's perm.
  62. perm1: clan.admin #Please don't change it!
  63.  
  64. #=======================================================
  65. # Support Service
  66. #
  67. # The skript shouldn't have more issues, but if you do
  68. # create a ticket at:
  69. # https://docs.google.com/forms/d/1kgn8_p71zRySpkvw0pa8S06f5mle_9G7x2vqAm139EI/viewform
  70. #=======================================================
  71.  
  72. #End of config
  73.  
  74. #===============================================================================================================================
  75. #Please take a note!
  76. #NOTE 1: Don't edit the code please, unless you know what're you doing. Changing the code in the skript is in YOUR own risk! We won't give support if you have changed something. You've warned!
  77. #NOTE 2: The code is advanced, and any little wrong thing that you will change, might break some of the skript operations and functions! You've warned!
  78. #===============================================================================================================================
  79. #CODE
  80.  
  81. function UpdateScoreBoard(p: player):
  82. wait 0.5 second
  83. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_p}%.yml"
  84. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_p}%.yml"
  85. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of {_p}%.yml"
  86. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  87. set {_e} to {_e} parsed as number
  88. if {_e} > 1:
  89. set {_energy} to "&b%{_e}% Days"
  90. if {_e} = 1:
  91. set {_energy} to "&b%{_e}% Day"
  92. if {_e} < 1:
  93. if {_e} > 0:
  94. set {_energy} to "&c%{_e}% Day"
  95. else:
  96. set {_energy} to "&cNo Energy"
  97. if {_e} is not set:
  98. set {_energy} to "&cNo Energy"
  99. set {_energy} to coloured {_energy}
  100. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  101. if {_t} is set:
  102. if {_t} is equal to {_c}:
  103. set {_t} to "&b%{_t}%"
  104. else:
  105. if {_a::*} contains "%{_t}%":
  106. set {_t} to "&a%{_t}%"
  107. else:
  108. if {_t} is "(Safe) Spawn":
  109. set {_t} to "&f(&bSafe&f) &bSpawn"
  110. if {_t} is "(Safe) Shop":
  111. set {_t} to "&f(&bSafe&f) &bShop"
  112. if {_t} isn't "(Safe) Shop" or "(Safe) Spawn":
  113. set {_t} to "&6%{_t}%"
  114. else:
  115. set {_t} to "&7Wilderness"
  116. set {_t} to coloured {_t}
  117. set {_bal} to "%{_p}'s balance%"
  118. replace all "$" with "" in {_bal}
  119. set {_title} to yaml value "scoreboard.title" from "../../Factions/config.yml"
  120. replace all "@" with "&" in {_title}
  121. set {_title} to coloured {_title}
  122. if {_c} is set:
  123. wipe {_p}'s sidebar
  124. set name of sidebar of {_p} to "%{_title}%"
  125. set {_count} to 14
  126. set {_lines::*} to yaml list "scoreboard.clan" from "../../Factions/config.yml"
  127. loop {_lines::*}:
  128. remove 1 from {_count}
  129. set {_line} to loop-value
  130. if {_line} contains "<energy>":
  131. replace all "<energy>" with "%{_energy}%" in {_line}
  132. if {_line} contains "<faction>":
  133. replace all "<faction>" with "%{_c}%" in {_line}
  134. if {_line} contains "<rank>":
  135. replace all "<rank>" with "%{_r}%" in {_line}
  136. if {_line} contains "<coins>":
  137. replace all "<coins>" with "%{_bal}%" in {_line}
  138. if {_line} contains "<territory>":
  139. replace all "<territory>" with "%{_t}%" in {_line}
  140. replace all "@" with "&" in {_line}
  141. set {_line} to coloured {_line}
  142. set score "%{_line}%" in sidebar of {_p} to {_count}
  143. else:
  144. wipe {_p}'s sidebar
  145. set name of sidebar of {_p} to "%{_title}%"
  146. set {_count} to 8
  147. set {_lines2::*} to yaml list "scoreboard.noclan" from "../../Factions/config.yml"
  148. loop {_lines2::*}:
  149. remove 1 from {_count}
  150. set {_line} to loop-value
  151. if {_line} contains "<rank>":
  152. replace all "<rank>" with "%{_r}%" in {_line}
  153. if {_line} contains "<coins>":
  154. replace all "<coins>" with "%{_bal}%" in {_line}
  155. if {_line} contains "<territory>":
  156. replace all "<territory>" with "%{_t}%" in {_line}
  157. replace all "@" with "&" in {_line}
  158. set {_line} to coloured {_line}
  159. set score "%{_line}%" in sidebar of {_p} to {_count}
  160.  
  161. on join:
  162. wait 1.5 seconds
  163. loop all players:
  164. UpdateScoreBoard(loop-player)
  165.  
  166. function PurchaseEnergy(p: player, c: text, e: number, g: number):
  167. add {_g} to {_e}
  168. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to {_e}
  169. if {_g} = 1:
  170. send "&8[&9Energy&8] &7Successfully Purchased 1 Day for your {@p}." to {_p}
  171. if {_g} > 1:
  172. send "&8[&9Energy&8] &7Successfully Purchased %{_g}% Days for your {@p}." to {_p}
  173. if {_g} < 1:
  174. send "&8&9Energy&8] &7Successfully Purchased 2.4 Hours for your {@p}." to {_p}
  175. loop all players:
  176. UpdateScoreBoard(loop-player)
  177.  
  178. on load:
  179. set {_load} to false
  180. if yaml value "version" from "../../Factions/config.yml" is not set:
  181. set {_load} to true
  182. if yaml value "prefix" from "../../Factions/config.yml" is not set:
  183. set {_load} to true
  184. if yaml value "settings-prefix" from "../../Factions/config.yml" is not set:
  185. set {_load} to true
  186. if yaml value "scoreboard.title" from "../../Factions/config.yml" is not set:
  187. set {_load} to true
  188. if yaml list "scoreboard.clan" from "../../Factions/config.yml" is not set:
  189. set {_load} to true
  190. if yaml list "scoreboard.noclan" from "../../Factions/config.yml" is not set:
  191. set {_load} to true
  192. if yaml value "countdown-home" from "../../Factions/config.yml" is not set:
  193. set {_load} to true
  194. if yaml value "prefix" from "../../Factions/config.yml" is not set:
  195. set {_load} to true
  196. if yaml value "maxplayers" from "../../Factions/config.yml" is not set:
  197. set {_load} to true
  198. if yaml value "maxterritories" from "../../Factions/config.yml" is not set:
  199. set {_load} to true
  200. if yaml value "maxallies" from "../../Factions/config.yml" is not set:
  201. set {_load} to true
  202. if yaml value "territory-costs" from "../../Factions/config.yml" is not set:
  203. set {_load} to true
  204. if yaml value "updater" from "../../Factions/config.yml" is not set:
  205. set {_load} to true
  206. if {_load} is true:
  207. send "&8[&bCLANS&8] &bUh oh! config.yml has missing setting(s)!" to console
  208. send "&8[&bCLANS&8] &bWe'll repair it for you." to console
  209. wf "## ___________________ ____ ____ ________ _____ _____________________ ___ ____ ___" to "plugins/Factions/config.yml"
  210. wf "## / \ | | / \ | \ | | / \ | | | | | |" to "plugins/Factions/config.yml"
  211. wf "## / ______________ / | | / \ | \ | | / ______________ \ | |___| |___| |" to "plugins/Factions/config.yml"
  212. wf "## / / \_/ | | / \ | \ | | / / \_____\ | |" to "plugins/Factions/config.yml"
  213. wf "## / / | | / /\ \ | |\ \ | | | |______________ | ____ |" to "plugins/Factions/config.yml"
  214. wf "## | | | | / / \ \ | | \ \ | | \ \ | | | |" to "plugins/Factions/config.yml"
  215. wf "## | | | | / / \ \ | | \ \ | | \_____________ \ | |____| |" to "plugins/Factions/config.yml"
  216. wf "## | | | | / /------\ \ | | \ \ | | \ \ | |" to "plugins/Factions/config.yml"
  217. wf "## \ \ | | / /________\ \ | | \ \ | | \ \ | ____ |" to "plugins/Factions/config.yml"
  218. wf "## \ \ _ | | / / \ \ | | \ \| | _____ / / | | | |" to "plugins/Factions/config.yml"
  219. wf "## \ \_____________/ \ | |_________________ / / \ \ | | \ | \ \_____________/ / | | | |" to "plugins/Factions/config.yml"
  220. wf "## \ \ | | / / \ \ | | \ | \ / | | | |" to "plugins/Factions/config.yml"
  221. wf "## \__________________/ |______________________| /____/ \____\ |____| \_________| \____________________/ |_______|____|_______|" to "plugins/Factions/config.yml"
  222. wf "##" to "plugins/Factions/config.yml"
  223. wf "## Original Factions Project, By UGCGames Ilya K (C)." to "plugins/Factions/config.yml"
  224. wf "##" to "plugins/Factions/config.yml"
  225. wf "## By using this software you agree with our ToS: https://www.spigotmc.org/resources/flans-factions-skript-uuid-support-1-8-1-9-x-support.21708/" to "plugins/Factions/config.yml"
  226. wf "##" to "plugins/Skript/scripts/Factions/config.yml"
  227. wf "version: {@version}" to "plugins/Factions/config.yml"
  228. wf "##" to "plugins/Skript/scripts/Factions/config.yml"
  229. wf "##===================" to "plugins/Factions/config.yml"
  230. wf "## Global Settings" to "plugins/Factions/config.yml"
  231. wf "##===================" to "plugins/Factions/config.yml"
  232. wf "" to "plugins/Factions/config.yml"
  233. wf "## PLEASE NOTE!" to "plugins/Factions/config.yml"
  234. wf "## Due to unknown situation while config is being created colour codes are bugged. However, the colour codes work in general, but not in the file's creation." to "plugins/Factions/config.yml"
  235. wf "## Optional: You can use '@' as colour code too." to "plugins/Factions/config.yml"
  236. wf "" to "plugins/Factions/config.yml"
  237. wf "## Set the global prefix of the plugin." to "plugins/Factions/config.yml"
  238. wf "prefix: '@9Factions>'" to "plugins/Factions/config.yml"
  239. wf "" to "plugins/Factions/config.yml"
  240. wf "## Set the admin settings prefix of the plugin." to "plugins/Factions/config.yml"
  241. wf "settings-prefix: '@9Factions Admin>'" to "plugins/Factions/config.yml"
  242. wf "" to "plugins/Factions/config.yml"
  243. wf "## Manage your scoreboard." to "plugins/Factions/config.yml"
  244. wf "## Variables:" to "plugins/Factions/config.yml"
  245. wf "## <coins> = Player's Coins" to "plugins/Factions/config.yml"
  246. wf "## <faction> = Player's Faction." to "plugins/Factions/config.yml"
  247. wf "## <coins> = Player's Coins" to "plugins/Factions/config.yml"
  248. wf "## <territory> = Player's current Territory." to "plugins/Factions/config.yml"
  249. wf "## <rank> = Player's Faction Rank" to "plugins/Factions/config.yml"
  250. wf "## <energy> = Faction's Energy." to "plugins/Factions/config.yml"
  251. wf "" to "plugins/Factions/config.yml"
  252. wf "scoreboard:" to "plugins/Factions/config.yml"
  253. wf " title: '@6@lCLANS'" to "plugins/Factions/config.yml"
  254. wf " clan:" to "plugins/Factions/config.yml"
  255. wf " - ""@eMoney""" to "plugins/Factions/config.yml"
  256. wf " - ""<coins>""" to "plugins/Factions/config.yml"
  257. wf " - ""@a""" to "plugins/Factions/config.yml"
  258. wf " - ""@e{@p}""" to "plugins/Factions/config.yml"
  259. wf " - ""<faction>""" to "plugins/Factions/config.yml"
  260. wf " - ""@b""" to "plugins/Factions/config.yml"
  261. wf " - ""@e{@p} Energy""" to "plugins/Factions/config.yml"
  262. wf " - ""<energy>""" to "plugins/Factions/config.yml"
  263. wf " - ""@c""" to "plugins/Factions/config.yml"
  264. wf " - ""@e{@p} Rank""" to "plugins/Factions/config.yml"
  265. wf " - ""@6<rank>""" to "plugins/Factions/config.yml"
  266. wf " - ""@d""" to "plugins/Factions/config.yml"
  267. wf " - ""@eTerritory""" to "plugins/Factions/config.yml"
  268. wf " - ""<territory>""" to "plugins/Factions/config.yml"
  269. wf " noclan:" to "plugins/Factions/config.yml"
  270. wf " - ""@eMoney""" to "plugins/Factions/config.yml"
  271. wf " - ""<coins>""" to "plugins/Factions/config.yml"
  272. wf " - ""@a""" to "plugins/Factions/config.yml"
  273. wf " - ""@e{@p}""" to "plugins/Factions/config.yml"
  274. wf " - ""@cNo {@p}""" to "plugins/Factions/config.yml"
  275. wf " - ""@b""" to "plugins/Factions/config.yml"
  276. wf " - ""@eTerritory""" to "plugins/Factions/config.yml"
  277. wf " - ""<territory>""" to "plugins/Factions/config.yml"
  278. wf "" to "plugins/Factions/config.yml"
  279. wf "## How long time players need to wait until they get teleported to their homes?" to "plugins/Factions/config.yml"
  280. wf "countdown-home: 5 ##IN SECONDS!!" to "plugins/Factions/config.yml"
  281. wf "" to "plugins/Factions/config.yml"
  282. wf "## How many players should be in people's clans?" to "plugins/Factions/config.yml"
  283. wf "maxplayers: 20 ##We recommend 20 players per clan." to "plugins/Factions/config.yml"
  284. wf "" to "plugins/Factions/config.yml"
  285. wf "## How many players should be in people's clans?" to "plugins/Factions/config.yml"
  286. wf "maxterritories: 10 ##We recommend 10 chunks 16x16 for a clan." to "plugins/Factions/config.yml"
  287. wf "" to "plugins/Factions/config.yml"
  288. wf "## How many allies should a clan have?" to "plugins/Factions/config.yml"
  289. wf "maxallies: 5 ##We recommend up to 5 allies per clan." to "plugins/Factions/config.yml"
  290. wf "" to "plugins/Factions/config.yml"
  291. wf "## This is the price that will be taken from clan players for a 1 chunk of territory." to "plugins/Factions/config.yml"
  292. wf "territory-costs: 500" to "plugins/Factions/config.yml"
  293. wf "" to "plugins/Skript/scripts/Factions/config.yml"
  294. wf "##===================" to "plugins/Factions/config.yml"
  295. wf "## Updater Options" to "plugins/Factions/config.yml"
  296. wf "##===================" to "plugins/Factions/config.yml"
  297. wf "" to "plugins/Factions/config.yml"
  298. wf "## Should the updater be enabled or disabled? Set 'true' or 'false'." to "plugins/Factions/config.yml"
  299. wf "updater: true" to "plugins/Factions/config.yml"
  300. wf "" to "plugins/Factions/config.yml"
  301. wf "##===================" to "plugins/Factions/config.yml"
  302. wf "## Support Service" to "plugins/Factions/config.yml"
  303. wf "##" to "plugins/Factions/config.yml"
  304. wf "## The skript shouldn't have more issues, but if you do create a ticket at:" to "plugins/Factions/config.yml"
  305. wf "## https://docs.google.com/forms/d/1kgn8_p71zRySpkvw0pa8S06f5mle_9G7x2vqAm139EI/viewform" to "plugins/Factions/config.yml"
  306. wf "##===================" to "plugins/Factions/config.yml"
  307. send "&8[&bCLANS&8] &bSuccessfully repaired config.yml" to console
  308. wait 0.5 second
  309. loop all players:
  310. UpdateScoreBoard(loop-player)
  311.  
  312. function Invite(p: player):
  313. if {_p} has permission "clan.use.*" or "{@perm1}" or "clan.invite":
  314. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_p}%.yml"
  315. if {_c} is set:
  316. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_p}%.yml"
  317. if {_r} is "Leader" or "Officer":
  318. wait 3 tick
  319. open chest with 6 rows named "Select a player to invite!" to {_p}
  320. format slot 0 of {_p} with arrow named "&6<&m--&6 &6Go Back" to close then run [make {_p} execute command "/{@command}"]
  321. set {_number} to 9
  322. loop all players:
  323. set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  324. if {_c.%loop-player%} isn't set:
  325. set {_player} to loop-player
  326. format slot {_number} of {_p} with skull of {_player} named "&6%{_player}%" with lore "&7Click to invite %{_player}%." to close then run [make {_p} execute command "/{@command} invite %{_player}%"]
  327. add 1 to {_number}
  328.  
  329. function ManagePlayer(p: player, r: text, p2: offlineplayer, r2: text):
  330. if {_p2} is online:
  331. set {_status} to "&aOnline"
  332. else:
  333. set {_status} to "&cOffline"
  334. set {_status} to coloured {_status}
  335. wait 3 ticks
  336. if {_r2} is "Leader":
  337. set {_demote} to "Officer"
  338. if {_r2} is "Officer":
  339. set {_promote} to "Leader"
  340. set {_demote} to "Trusted"
  341. if {_r2} is "Trusted":
  342. set {_promote} to "Officer"
  343. set {_demote} to "Member"
  344. if {_r2} is "Member":
  345. set {_promote} to "Trusted"
  346. open chest with 3 rows named "Manage: %{_p2}%" to {_p}
  347. format slot 0 of {_p} with arrow named "&6Go Back!" to close then run [make {_p} execute command "/{@command}"]
  348. format slot 4 of {_p} with book named "&6%{_p2}%'s Stats" with lore "||&eStatus %{_status}%||&eRank &f%{_r2}%" to be unstealable
  349. if {_p} is equal to {_p2}:
  350. format slot 14 of {_p} with emerald block named "&c&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%.||&e||&cYou can't promote yourself." to be unstealable
  351. format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cYou can't demote yourself." to be unstealable
  352. format slot 8 of {_p} with tnt named "&c&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&cYou can't kick yourself." to be unstealable
  353. stop
  354. if {_r} is "Leader":
  355. if {_r2} is "Leader":
  356. format slot 8 of {_p} with tnt named "&c&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c%{_p2}% can't be kicked from your {@p}." to be unstealable
  357. else:
  358. format slot 8 of {_p} with tnt named "&6&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c&lWARNING! This action can't be undone." to close then run [make {_p} execute command "/{@command} kick %{_p2}%"] -> [execute {_p} command "{@command}"]
  359. if {_r} is "Officer":
  360. if {_r2} is "Leader" or "Officer":
  361. format slot 8 of {_p} with tnt named "&c&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c%{_p2}% can't be kicked from your {@p}." to be unstealable
  362. else:
  363. format slot 8 of {_p} with tnt named "&6&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c&lWARNING! This action can't be undone." to close then run [make {_p} execute command "/{@command} kick %{_p2}%"] -> [execute {_p} command "{@command}"]
  364. if {_r2} is "Leader":
  365. format slot 14 of {_p} with emerald block named "&c&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%.||&e||&cThat player has the highest possible faction rank." to be unstealable
  366. else:
  367. if {_r} is "Officer":
  368. if {_r2} is "Officer" or "Leader":
  369. format slot 14 of {_p} with emerald block named "&c&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%.||&e||&cThat player can't be promoted." to be unstealable
  370. else:
  371. format slot 14 of {_p} with emerald block named "&a&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%||&7from &6%{_r2}% &7to &6%{_promote}%&7." to close then run [execute {_p} command "/{@command} promote %{_p2}%"] -> [execute {_p} command "{@command}"]
  372. if {_r} is "Leader":
  373. format slot 14 of {_p} with emerald block named "&a&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%||&7from &6%{_r2}% &7to &6%{_promote}%&7." to close then run [execute {_p} command "/{@command} promote %{_p2}%"] -> [execute {_p} command "{@command}"]
  374. if {_r} is "Officer":
  375. if {_r2} is "Officer" or "Leader":
  376. format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player can't be demoted." to be unstealable
  377. else:
  378. if {_r2} is "Member":
  379. format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player has the lowest possible faction rank." to be unstealable
  380. else:
  381. format slot 12 of {_p} with redstone block named "&a&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%||&7from &6%{_r2}% &7to &6%{_demote}%&7." to close then run [execute {_p} command "/{@command} demote %{_p2}%"] -> [execute {_p} command "{@command}"]
  382. if {_r} is "Leader":
  383. if {_r2} is "Member":
  384. format slot 12 of {_p} with redstone block named "&a&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player has the lowest possible faction rank." to be unstealable
  385. else:
  386. if {_r2} is "Leader":
  387. format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player can't be demoted." to be unstealable
  388. else:
  389. format slot 12 of {_p} with redstone block named "&a&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%||&7from &6%{_r2}% &7to &6%{_demote}%&7." to close then run [execute {_p} command "/{@command} demote %{_p2}%"] -> [execute {_p} command "{@command}"]
  390.  
  391. on inventory click:
  392. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%player's uuid%.yml"
  393. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%player's uuid%.yml"
  394. if inventory name of player's current inventory is "{@p} Manager - &b%{_c}%":
  395. set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  396. set {_i} to clicked item name
  397. set {_confirm} to false
  398. loop {_u::*}:
  399. set {_name} to yaml value "Userdata.Username" from "../../Factions/Userdata/%loop-value%.yml"
  400. if {_i} is "&a&l%{_name}%" or "&c&l%{_name}%":
  401. set {_confirm} to true
  402. set {_uuid} to loop-value
  403. exit loop
  404. if {_confirm} is true:
  405. set {_name} to uncoloured {_name}
  406. replace all "&a&l" and "&c&l" with "" in {_name}
  407. set {_name} to {_name} parsed as a offlineplayer
  408. set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_uuid}%.yml"
  409. cancel event
  410. close player's inventory
  411. ManagePlayer(player, {_r}, {_name}, {_r2})
  412. stop
  413. if {_confirm} is false:
  414. set {_wins::*} to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
  415. loop {_wins::*}:
  416. if {_i} is "&6&l%loop-value%" or "&c&l%loop-value%":
  417. set {_confirm} to true
  418. exit loop
  419. set {_loses::*} to yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
  420. loop {_loses::*}:
  421. if {_i} is "&6&l%loop-value%":
  422. set {_confirm} to true
  423. exit loop
  424. set {_i} to uncoloured {_i}
  425. replace all "&6&l" with "" in {_i}
  426. close player's inventory
  427. wait 3 ticks
  428. execute player command "{@command} info %{_i}%"
  429.  
  430.  
  431. command /{@command} [<text>] [<offlineplayer>] [<text>] [<text>]:
  432. aliases: {@cmd-additions}
  433. trigger:
  434. loop all players:
  435. UpdateScoreBoard(loop-player)
  436. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  437. set {_padmin} to yaml value "settings-prefix" from "../../Factions/config.yml"
  438. replace all "@" with "&" in {_prefix}
  439. replace all "@" with "&" in {_padmin}
  440. set {_prefix} to coloured {_prefix}
  441. set {_padmin} to coloured {_padmin}
  442. player is in "{@world}"
  443. if player has permission "clan.use":
  444. if arg 1 is not set:
  445. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  446. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  447. if {_c} is not set:
  448. wait 3 ticks
  449. open chest with 6 rows named "{@p} Manager - &cNo {@p}" to player
  450. format slot 13 of player with redstone block named "&cYou have no {@p}!" with lore "&7Use '/c create <{@p} Name>' to get started!" to close then run [make player execute command "/{@command} create"]
  451. loop all players:
  452. if {clan.%loop-player%.invite.%player%} is true:
  453. set {_number} to 36
  454. set {_player} to loop-player
  455. set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  456. format slot {_number} of player with skull of {_player} named "&6%{_c.%loop-player%}%&7's {@p} has invited you!" with lore "||&7Click to join the selected {@p}!" to close then run [make player execute command "/{@command} join %{_player}%"]
  457. add 1 to {_number}
  458. else:
  459. set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  460. set {_ts} to size of {_t::*}
  461. set {_s::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  462. set {_f} to yaml value "Faction.Founder" from "../../Factions/Factions/%{_c}%.yml"
  463. set {_d} to yaml value "Faction.Date" from "../../Factions/Factions/%{_c}%.yml"
  464. if {_d} is not set:
  465. set {_d} to "Unknown"
  466. if {_f} is not set:
  467. set {_f} to "Unknown"
  468. set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
  469. set {_max2} to yaml value "maxterritories" from "../../Factions/config.yml"
  470. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  471. if {_a::*} is not set:
  472. set {_a::*} to "&a"
  473. set {_s} to size of {_s::*}
  474. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  475. set {_e} to {_e} parsed as number
  476. if {_e} is not set:
  477. set {_e} to 0
  478. set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_c}%.yml"
  479. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
  480. wait 3 tick
  481. open chest with 6 rows named "{@p} Manager - &b%{_c}%" to player
  482. if {_r} is "Leader" or "Officer":
  483. format slot 0 of player with book named "&6&l&nInvite a player to your {@p}!" with lore "&7Here you can select easily||&7a player to invite!" to close then run [Invite(player)]
  484. else:
  485. format slot 0 of player with book named "&c&l&nInvite a player to your {@p}!" with lore "&c||&cYou need to be Officer or Leader to do that!||&a||&7Here you can select easily||&7a player to invite!" to be unstealable
  486. if {_h} is set:
  487. set {_x} to x-coordinate of {_h}
  488. set {_x} to {_x} parsed as integer
  489. set {_y} to y-coordinate of {_h}
  490. set {_y} to {_y} parsed as integer
  491. set {_z} to z-coordinate of {_h}
  492. set {_z} to {_z} parsed as integer
  493. format slot 4 of player with paper named "&6%{_c}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &f%{_x}%, %{_y}%, %{_z}%||&eEnergy Left &f%{_e}% Day(s)||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eAllies &a%{_a::*}%" to be unstealable
  494. else:
  495. format slot 4 of player with paper named "&6%{_c}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &cNo Home Set.||&eEnergy Left &f%{_e}% Day(s)||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eAllies &a%{_a::*}%" to be unstealable
  496. format slot 6 of player with compass named "&6Teleport to {@p}'s Home" with lore "&7That will teleport to your {@p}'s Home" to close then run [make player execute command "/{@command} home"]
  497. if {_r} is "Leader" or "Officer":
  498. if {_t} is set:
  499. if {_t} is equal to "%{_c}%":
  500. format slot 2 of player with beacon named "&a&l&nSet your Home!" with lore "&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to close then run [make player execute command "/{@command} sethome"]
  501. else:
  502. format slot 2 of player with beacon named "&c&l&nSet your Home!" with lore "&cHome can't be set in this Territory!||&a||&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to be unstealable
  503. else:
  504. format slot 2 of player with beacon named "&c&l&nSet your Home!" with lore "&cHome can be set only in your Territory!||&a||&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to be unstealable
  505. else:
  506. format slot 2 of player with beacon named "&c&l&nSet your Home!" with lore "&cYou need to be Officer or Leader to do that!||&a||&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to be unstealable
  507. if {_r} is "Leader" or "Officer":
  508. if {_t} is not set:
  509. set {_tcosts} to yaml value "territory-costs" from "../../Factions/config.yml"
  510. if player's balance is greater or equal to {_tcosts}:
  511. format slot 12 of player with emerald block named "&a&l&nClaim this Territory!" with lore "&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to close then run [make player execute command "/{@command} claim"]
  512. if player's balance is less than {_tcosts}:
  513. format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories.||&7||&cYou don't have enough money to purchase this chunk!" to be unstealable
  514. else:
  515. if {_t} is equal to "%{_c}%":
  516. format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&cThat Territory is already owned by your {@p}!||&a||&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
  517. else:
  518. format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&cThat Territory is already owned by &6%{_t}%.||&a||&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
  519. else:
  520. format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&cYou need to be Officer or Leader to do that!||&a||&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
  521. if {_r} is "Leader" or "Officer":
  522. if {_t} is set:
  523. if {_t} is equal to "%{_c}%":
  524. format slot 14 of player with redstone block named "&a&l&nUn-Claim this Territory!" with lore "&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to close then run [make player execute command "/{@command} unclaim"]
  525. else:
  526. format slot 14 of player with redstone block named "&c&l&nUn-Claim this Territory!" with lore "&cThat Territory is already owned by &6%{_t}%.||&a||&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
  527. else:
  528. format slot 14 of player with redstone block named "&c&l&nUn-Claim this Territory!" with lore "&cThat Territory is not claimed by any {@p}!||&a||&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
  529. else:
  530. format slot 14 of player with redstone block named "&c&l&nUn-Claim this Territory!" with lore "&cYou need to be Officer or Leader to do that!||&a||&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
  531. if {_r} is "Leader":
  532. format slot 8 of player with tnt named "&cDisband {@p}" with lore "&c&nWARNING:&7 This will disband your {@p}.||&7This means that all players and all your territories will be ||&7removed, includes your {@p}!||" to close then run [make player execute command "/{@command} disband"]
  533. else:
  534. format slot 8 of player with gunpowder named "&cLeave {@p}" with lore "&7You will leave your {@p}!" to close then run [make player execute command "/{@command} leave"]
  535. set {_number} to 17
  536. set {_count} to 0
  537. set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  538. set {_p} to player
  539. loop {_u::*}:
  540. add 1 to {_number}
  541. set {_u2} to loop-value
  542. set {_p2} to yaml value "Userdata.Username" from "../../Factions/Userdata/%{_u2}%.yml"
  543. set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_u2}%.yml"
  544. add 1 to {_n}
  545. set {_p2} to {_p2} parsed as a player
  546. if {_p2} is online:
  547. set {_name} to "&a&l%{_p2}%"
  548. set {_skull} to {_p2}'s skull
  549. else:
  550. set {_name} to "&c&l%{_p2}%"
  551. set {_skull} to skeleton head
  552. set {_name} to coloured {_name}
  553. if {_r} is "Leader" or "Officer":
  554. set slot {_number} of player's current inventory to {_skull} named "%{_name}%" with lore "&7||&7Rank: &6%{_r2}%||&7||&7Click to manage %{_p2}%'s settings." with no nbt
  555. else:
  556. format slot {_number} of {_p} with {_skull} named "%{_name}%" with lore "&7||&7Rank: &6%{_r2}%" to be unstealable
  557. set {_n3} to 45
  558. set {_n2} to 53
  559. set {_wins::*} to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
  560. loop {_wins::*}:
  561. set {_points} to yaml value "Faction.WarPoints.%loop-value%" from "../../Factions/Factions/%{_c}%.yml"
  562. set {_points} to {_points} parsed as number
  563. set slot {_n2} of player's current inventory to {_points} of diamond sword named "&6&l%loop-value%" with lore "&7||&7Your {@p} has %{_points}% war points against %loop-value%." with no nbt
  564. remove 1 from {_n2}
  565. set {_loses::*} to yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
  566. loop {_loses::*}:
  567. set {_points} to yaml value "Faction.WarPoints.%loop-value%" from "../../Factions/Factions/%{_c}%.yml"
  568. set {_points} to {_points} parsed as number
  569. set slot {_n3} of player's current inventory to {_points} of stone sword named "&c&l%loop-value%" with lore "&7||&7Your {@p} has %{_points}% war points against %loop-value%." with no nbt
  570. add 1 to {_n3}
  571. if arg 1 is not "stats" or "show" or "enemy" or "revoke" or "factions" or "energy" or "neutral" or "chat" or "invite" or "kick" or "join" or "create" or "ally" or "sethome" or "home" or "leave" or "help" or "list" or "admin" or "reload" or "disband" or "info" or "clans" or "promote" or "deinvite" or "demote" or "claim" or "unclaim":
  572. message "%{_prefix}% &7Unknown sub command '&6%arg 1%&7'. Type '/{@command} help' for help."
  573. else:
  574. if arg 1 is "help":
  575. if player has permission "clan.ignore" or "{@perm1}":
  576. send "&e&lClans &6{@version} &aBy UGCGames Ilya K." to player
  577. send "&6/{@command} &eMain Command" to player
  578. send "&6/{@command} sethome &eSet your {@p} Home." to player
  579. send "&6/{@command} home &eTeleport you to your {@p} home." to player
  580. send "&6/{@command} create <{@p} Name> &eCreate your {@p}." to player
  581. send "&6/{@command} invite <player> &eInvite player to your {@p}." to player
  582. send "&6/{@command} leave &eLeave your {@p}." to player
  583. send "&6/{@command} join <player> &eJoin the player's {@p}." to player
  584. send "&6/{@command} kick <player> &eKick player from you {@p}." to player
  585. send "&6/{@command} disband &eClose your {@p}." to player
  586. send "&6/{@command} promote <player> &ePromote the player." to player
  587. send "&6/{@command} demote <player> &eDemote the player." to player
  588. send "&6/{@command} info <player> &ePlayer's {@p} Information." to player
  589. send "&6/{@command} <clans;factions> &eClans List" to player
  590. send "&6/{@command} deinvite <player> &eDeinvite Player" to player
  591. send "&6/{@command} chat &eToggle Chat type: Public, Clan, Ally" to player
  592. message "&6/{@command} claim &eClaim Territory." to player
  593. message "&6/{@command} unclaim &eUn-Claim Territory." to player
  594. send "&6/{@command} energy &eManage your {@p}'s Energy."
  595. message "&6/{@command} ally <invite;accept> <player> &eInvite/Accept Alliance with a {@p}." to player
  596. message "&6/{@command} <neutral;revoke;enemy> <{@p} name> &eRevoke Alliance with a {@p}." to player
  597. if player has permission "{@perm1}":
  598. send "&a/{@command} &aadmin &cManage Admin Commands."
  599. else:
  600. message "{@noperm}"
  601. if arg 1 is "admin":
  602. if player has permission "{@perm1}":
  603. if arg 2 is not set:
  604. send "&e&lClans &6{@version} &bBy UGCGames Ilya K." to player
  605. send "&a/{@command} reload &bReload the skript." to player
  606. send "&a/{@command} admin claim Spawn &bClaim Spawn Territory." to player
  607. send "&a/{@command} admin claim Shop &bClaim Shop Spawn Territory." to player
  608. send "&a/{@command} admin unclaim Spawn &bUn-Claim Spawn Territory." to player
  609. send "&a/{@command} admin unclaim Shop &bUn-Claim Shop Spawn Territory." to player
  610. send "&a/{@command} admin kick <player> &bForce kick a player from their {@p}." to player
  611. send "&a/{@command} admin promote <player> &bForce promote a player in their current {@p}." to player
  612. send "&a/{@command} admin demote <player> &bForce demote a player in their current {@p}." to player
  613. send "&a/{@command} admin join <{@p}> &bForce join a {@p}." to player
  614. send "&a/{@command} admin delete <{@p}> &bDelete specific {@p} from the database." to player
  615. send "&a/{@command} admin reset <all;chunks;(clans;factions);userdata> &bReset specific or all {@p} Data." to player
  616. else:
  617. set {_player} to arg 3
  618. set {_player} to {_player} parsed as an offline player
  619. if arg 2 is set:
  620. if arg 2 is "kick":
  621. if arg 3 is set:
  622. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
  623. if {_c} is set:
  624. remove "%{_player}%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  625. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
  626. message "%{_padmin}% &7You have kicked &6%{_player}% &7from {@p} &6%{_c}%&7."
  627. else:
  628. send "%{_padmin}% &6%{_player}% &7isn't in any {@p}."
  629. else:
  630. send "%{_padmin}% &7Use '/{@command} admin kick <player>' to force kick the player from their {@p}."
  631. if arg 2 is "promote":
  632. if arg 3 is set:
  633. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
  634. if {_c} is set:
  635. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml"
  636. if {_r} is "Member":
  637. set {_r} to "Trusted"
  638. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
  639. message "%{_padmin}% &7You promoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
  640. send "%{_prefix}% &7You were promoted to &6%{_r}%&7." to {_player}
  641. stop
  642. if {_r} is "Trusted":
  643. set {_r} to "Officer"
  644. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
  645. message "%{_padmin}% &7You promoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
  646. send "%{_prefix}% &7You were promoted to &6%{_r}%&7." to {_player}
  647. stop
  648. if {_r} is "Officer":
  649. set {_r} to "Leader"
  650. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
  651. message "%{_padmin}% &7You promoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
  652. send "%{_prefix}% &7You were promoted to &6%{_r}%&7." to {_player}
  653. stop
  654. if {_r} is "Leader":
  655. send "%{_padmin}% &6%{_player}% &7can't be promoted higher than &6Leader&7."
  656. else:
  657. send "%{_padmin}% &6%arg 3% &7isn't in any {@p}."
  658. else:
  659. send "%{_padmin}% &7Use '/{@command} admin promote <player>' to force promote the player in their {@p}."
  660. if arg 2 is "demote":
  661. if arg 3 is set:
  662. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
  663. if {_c} is set:
  664. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml"
  665. if {_r} is "Leader":
  666. set {_r} to "Officer"
  667. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
  668. message "%{_padmin}% &7You demoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
  669. send "%{_prefix}% &7You were demoted to &6%{_r}%&7." to {_player}
  670. stop
  671. if {_r} is "Officer":
  672. set {_r} to "Trusted"
  673. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
  674. message "%{_padmin}% &7You demoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
  675. send "%{_prefix}% &7You were demoted to &6%{_r}%&7." to {_player}
  676. stop
  677. if {_r} is "Trusted":
  678. set {_r} to "Member"
  679. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
  680. message "%{_padmin}% &7You demoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
  681. send "%{_prefix}% &7You were demoted to &6%{_r}%&7." to {_player}
  682. stop
  683. if {_r} is "Member":
  684. send "%{_padmin}% &6%{_player}% &7can't be demoted lower than &6Member&7."
  685. else:
  686. send "%{_padmin}% &6%{_player}% &7isn't in any {@p}."
  687. else:
  688. send "%{_padmin}% &7Use '/{@command} admin demote <player>' to force demote the player in their {@p}."
  689. if arg 2 is "join":
  690. if arg 3 is set:
  691. set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  692. set {_join} to "false"
  693. loop {_c::*}:
  694. if arg 3 is loop-value:
  695. set {_join} to "true"
  696. if {_join} is "true":
  697. set yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml" to "%arg 3%"
  698. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Recruit"
  699. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
  700. message "%{_padmin}% &7You have joined &b%arg 3%."
  701. else:
  702. send "%{_padmin}% &7{@p} &6%arg 3% &7doesn't exist."
  703. else:
  704. send "%{_padmin}% &7Use '/{@command} admin join <{@p}>' to force join a {@p}."
  705. if arg 2 is "delete":
  706. if arg 3 is set:
  707. set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  708. set {_del} to "false"
  709. loop {_c::*}:
  710. if arg 3 is loop-value:
  711. set {_del} to "true"
  712. set {_clan} to loop-value
  713. if {_del} is "true":
  714. set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_clan}%.yml"
  715. set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_clan}%.yml"
  716. set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
  717. loop all players:
  718. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  719. if {_p.%loop-player%} is equal to "%{_clan}%":
  720. send "%{_prefix}% &7Your {@p} &b%{_clan}% &7has been disbanded." to loop-player
  721. loop {_t::*}:
  722. set {_loop} to loop-value
  723. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_loop}%.yml"
  724. loop {_u::*}:
  725. set {_loop2} to loop-value
  726. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%{_loop2}%.yml"
  727. delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_loop2}%.yml"
  728. delete folder "plugins/Factions/Factions/%{_clan}%.yml"
  729. remove "%{_clan}%" from yaml list "Factions" from "../../Factions/Factions.yml"
  730. send "%{_padmin}% &7{@p} &6%{_clan}% &7has been removed!"
  731. else:
  732. send "%{_padmin}% &7{@p} &6%arg 3% &7doesn't exist!"
  733. else:
  734. send "%{_padmin}% &7You didn't input a {@p} to remove. Please use: '/{@command} admin delete <{@p} Name>'."
  735. if arg 2 is "reset":
  736. if arg 3 is "all" or "chunks" or "territories" or "userdata" or "factions" or "clans":
  737. if arg 3 is "all":
  738. send "%{_padmin}% &c&lAll saved database has been deleted."
  739. delete directory "plugins/Factions/Factions"
  740. delete directory "plugins/Factions/Userdata"
  741. delete directory "plugins/Factions/Territories"
  742. delete file "plugins/Factions/Factions.yml"
  743. if arg 3 is "chunks" or "territories":
  744. send "%{_padmin}% &c&lTerritories saved database has been deleted."
  745. delete directory "plugins/Factions/Territories"
  746. if arg 3 is "userdata":
  747. send "%{_padmin}% &c&lUserdata saved database has been deleted."
  748. delete directory "plugins/Factions/Userdata"
  749. if arg 3 is "factions" or "clans":
  750. send "%{_padmin}% &c&lFactions saved database has been deleted."
  751. delete directory "plugins/Factions/Factions"
  752. delete file "plugins/Factions/Factions.yml"
  753. else:
  754. send "%{_padmin}% &7Use '/{@command} admin reset <all;(chunks;territories);userdata;factions' to remove specific or all saved database."
  755. if arg 2 is "claim":
  756. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
  757. if arg 3 is set:
  758. if arg 3 is "Shop":
  759. if {_t} is not set:
  760. set yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml" to "(Safe) Shop"
  761. message "%{_padmin}% &aClaimed Territory &f(&bSafe&f) &bShop Spawn&7."
  762. else:
  763. if {_t} is equal to "(Safe) Shop":
  764. message "%{_padmin}% &7This Territory is already claimed by you!"
  765. else:
  766. message "%{_padmin}% &7This Territory is already claimed!"
  767. if arg 3 is "Spawn":
  768. if {_t} is not set:
  769. set yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml" to "(Safe) Spawn"
  770. message "%{_padmin}% &aClaimed Territory &f(&bSafe&f) &bSpawn&7."
  771. else:
  772. if {_t} is equal to "(Safe) Spawn":
  773. message "%{_padmin}% &7This Territory is already claimed by you!"
  774. else:
  775. message "%{_padmin}% &7This Territory is already claimed!"
  776. if arg 3 is not "Spawn" or "Shop":
  777. message "%{_padmin}% &7Use '/{@command} admin claim &b<Shop;Spawn>&7' &7to claim this territory!"
  778. else:
  779. message "%{_padmin}% &7Use '/{@command} admin claim &b<Shop;Spawn>&7' &7to claim this territory!"
  780. if arg 2 is "unclaim":
  781. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
  782. if arg 3 is set:
  783. if arg 3 is "Shop":
  784. if {_t} is set:
  785. if {_t} is equal to "(Safe) Shop":
  786. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
  787. message "%{_padmin}% &cRemoved Successfully &f(&bSafe&f) &bShop&7."
  788. else:
  789. if {_t} isn't equal to "(Safe) Spawn" or "(Safe) Shop":
  790. message "%{_padmin}% &7This Territory is not claimed by you!"
  791. if {_t} is equal to "(Safe) Spawn" or "(Safe) Shop":
  792. message "&7You must use the correct arguments: '/{@command} admin unclaim &c<Shop;Spawn>'"
  793. else:
  794. message "%{_padmin}% &7This Territory is not claimed!"
  795. if arg 3 is "Spawn":
  796. if {_t} is set:
  797. if {_t} is equal to "(Safe) Spawn":
  798. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
  799. message "%{_padmin}% &cRemoved Successfully &f(&bSafe&f) &bSpawn&7."
  800. else:
  801. if {_t} isn't equal to "(Safe) Spawn" or "(Safe) Shop":
  802. message "%{_padmin}% &7This Territory is not claimed by you!"
  803. if {_t} is equal to "(Safe) Spawn" or "(Safe) Shop":
  804. message "%{_padmin}% &7You must use the correct arguments: '/{@command} admin unclaim &c<Shop;Spawn>'"
  805. else:
  806. message "%{_padmin}% &7This Territory is not claimed!"
  807. if arg 3 is not "Spawn" or "Shop":
  808. message "%{_padmin}% &7Use '/{@command} admin unclaim &b<Shop;Spawn>&7' &7to un-claim this territory!"
  809. else:
  810. message "%{_padmin}% &7Use '/{@command} admin unclaim &b<Shop;Spawn>&7' &7to un-claim this territory!"
  811. else:
  812. message "{@noperm}"
  813. if arg 1 is "reload":
  814. if player has permission "{@perm1}":
  815. send "%{_prefix}% &7Reloading Clans..." to player
  816. wait 1 second
  817. execute console command "/sk reload %script%"
  818. send "%{_prefix}% &aClans has been successfully Reloaded!" to player
  819. else:
  820. message "{@noperm}"
  821. if arg 1 is "invite":
  822. if player has permission "clan.invite" or "{@perm1}" or "clan.use.*":
  823. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  824. if {_c} is set:
  825. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  826. set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  827. if {_r} is "Leader" or "Officer":
  828. if arg 2 is set:
  829. if arg 2 is online:
  830. set {_player} to arg 2
  831. set {_player} to {_player} parsed as offline player
  832. if {_player} is not equal to player:
  833. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  834. if {_c2} isn't set:
  835. set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
  836. if size of {_p::*} is not {_max}:
  837. set {clan.%{_c}%.invite.%arg 2%} to true
  838. send "%{_prefix}% &7%player% is inviting you to join {@p} &6%{_c}%&7." to arg 2
  839. send "%{_prefix}% &7Use /{@command} join &6%{_c}% &7to accept." to arg 2
  840. message "%{_prefix}% &7You invited &6%arg 2% &7to join your {@p}."
  841. loop all players:
  842. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  843. if {_c3.%loop-player%} is equal to "%{_c}%":
  844. send "%{_prefix}% &6%player% &7has invited &6%arg 2% &7to join the {@p}!" to loop-player
  845. wait 1 minute
  846. if {clan.%{_c}%.invite.%arg 2%} is set:
  847. delete {clan.%{_c}%.invite.%arg 2%}
  848. send "%{_prefix}% &6%arg 2% &7didn't respond to your request to join."
  849. send "%{_prefix}% &7You didn't respond to join {@p} &6%{_c}%&7." to arg 2
  850. else:
  851. message "%{_prefix}% &7You can't invite more than &7%{_max}% &7players to your {@p}."
  852. else:
  853. if {_c2} is not equal to {_c}:
  854. message "%{_prefix}% &6%arg 2% &7is already in &6%{_c2}%&7's {@p} and can't be invited."
  855. if {_c2} is equal to {_c}:
  856. message "%{_prefix}% &6%arg 2% &7is already in your {@p}."
  857. else:
  858. message "%{_prefix}% &7Not you!"
  859. else:
  860. message "&8[&9Online Player Search&8] &7No matches found for [&6%arg 2%&7]."
  861. message "%{_prefix}% &6%arg 2% &7is not online! Try again later!"
  862. else:
  863. message "%{_prefix}% &7Use '/{@command} invite <player>' to invite the player to your {@p}."
  864. else:
  865. message "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
  866. else:
  867. message "%{_prefix}% &7You're not in any {@p}."
  868. else:
  869. message "{@noperm}"
  870. if arg 1 is "ally":
  871. if player has permission "clan.ally" or "{@perm1}" or "clan.use.*":
  872. if arg 2 is "invite" or "accept":
  873. if arg 2 is "invite":
  874. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  875. if {_c} is set:
  876. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  877. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  878. if {_r} is "Leader" or "Officer":
  879. if arg 3 is set:
  880. if arg 3 isn't equal to "%{_c}%":
  881. set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  882. set {_confirm1} to false
  883. loop {_clans::*}:
  884. if arg 3 is loop-value:
  885. set {_confirm1} to true
  886. if {_confirm1} is true:
  887. set {_confirm1} to false
  888. loop {_a::*}:
  889. if arg 3 is loop-value:
  890. set {_confirm1} to true
  891. if {_confirm1} is false:
  892. set {_max} to yaml value "maxallies" from "../../Factions/config.yml"
  893. if size of {_a::*} is not {_max}:
  894. if {clan.%{_c}%.ally.%arg 3%} is not set:
  895. set {clan.%{_c}%.ally.%arg 3%} to true
  896. loop all players:
  897. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  898. if {_c3.%loop-player%} is equal to "%{_c}%":
  899. send "%{_prefix}% &7Your {@p} has invited &7{@p} &6%arg 3% &7to ally!" to loop-player
  900. loop all players:
  901. set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  902. if {_c4.%loop-player%} is equal to "%arg 3%":
  903. send "%{_prefix}% &7{@p} &6%{_c}% &7has invited your {@p} to ally! Use '/{@command} ally accept &6%{_c}%&7' to accept." to loop-player
  904. wait 1 minute
  905. if {clan.%{_c}%.ally.%arg 3%} is true:
  906. delete {clan.%{_c}%.ally.%arg 3%}
  907. loop all players:
  908. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  909. if {_c3.%loop-player%} is equal to "%{_c}%":
  910. send "%{_prefix}% &7{@p} &6%arg 3% &7didn't respond to your ally request." to loop-player
  911. loop all players:
  912. set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  913. if {_c4.%loop-player%} is equal to "%arg 3%":
  914. send "%{_prefix}% &7Your {@p} didn't respond to &6%arg 3%&7's {@p} ally request." to loop-player
  915. else:
  916. send "%{_prefix}% &7You can't invite that {@p} for 1 Minute."
  917. else:
  918. message "%{_prefix}% &7Your {@p} can't have more than %{_max}% allies!"
  919. else:
  920. message "%{_prefix}% &7{@p} &a%arg 3% &7is already your ally."
  921. else:
  922. message "%{_prefix}% &6%arg 3% &7couldn't be found. Make sure to specify the {@p}'s name correctly."
  923. else:
  924. send "%{_prefix}% &7You don't ally your {@p}."
  925. else:
  926. send "%{_prefix}% &7Use '/{@command} ally invite <{@p} name>' to send an ally request to a {@p}."
  927. else:
  928. send "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
  929. else:
  930. send "%{_prefix}% &7You're not in any {@p}."
  931. if arg 2 is "accept":
  932. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  933. if {_c} is set:
  934. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  935. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  936. if {_r} is "Leader" or "Officer":
  937. if arg 3 is set:
  938. if arg 3 isn't equal to "%{_c}%":
  939. set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  940. set {_confirm1} to false
  941. loop {_clans::*}:
  942. if arg 3 is loop-value:
  943. set {_confirm1} to true
  944. if {_confirm1} is true:
  945. set {_confirm1} to false
  946. loop {_a::*}:
  947. if arg 3 is loop-value:
  948. set {_confirm1} to true
  949. if {_confirm1} is false:
  950. set {_max} to yaml value "maxallies" from "../../Factions/config.yml"
  951. if size of {_a::*} is not {_max}:
  952. if {clan.%arg 3%.ally.%{_c}%} is true:
  953. delete {clan.%arg 3%.ally.%{_c}%}
  954. loop all players:
  955. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  956. if {_c3.%loop-player%} is equal to "%{_c}%":
  957. send "%{_prefix}% &7Your {@p} has accepted ally with &a%arg 3%&7!" to loop-player
  958. loop all players:
  959. set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  960. if {_c4.%loop-player%} is equal to "%arg 3%":
  961. send "%{_prefix}% &7{@p} &a%{_c}% &7has accepted your ally request!" to loop-player
  962. add "%{_c}%" to yaml list "Faction.Allies" from "../../Factions/Factions/%arg 3%.yml"
  963. add "%arg 3%" to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  964. else:
  965. send "%{_prefix}% &7Your {@p} doesn't have any pending ally request from {@p} &6%arg 3%&7."
  966. else:
  967. message "%{_prefix}% &7Your {@p} can't have more than %{_max}% allies!"
  968. else:
  969. message "%{_prefix}% &7{@p} &a%arg 3% &7is already your ally."
  970. else:
  971. message "%{_prefix}% &6%arg 3% &7couldn't be found. Make sure to specify the {@p}'s name correctly."
  972. else:
  973. send "%{_prefix}% &7You don't ally your {@p}."
  974. else:
  975. send "%{_prefix}% &7Use '/{@command} ally accept <{@p} name>' to accept an ally request from a {@p}."
  976. else:
  977. send "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
  978. else:
  979. send "%{_prefix}% &7You're not in any {@p}."
  980. else:
  981. send "%{_prefix}% &7Use '/{@command} ally <invite;accept> <{@p} name>' to send/accept an ally request to a {@p}."
  982. else:
  983. message "{@noperm}"
  984. if arg 1 is "neutral" or "revoke" or "enemy":
  985. if player has permission "clan.ally" or "{@perm1}" or "clan.use.*":
  986. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  987. if {_c} is set:
  988. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  989. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%"
  990. if {_r} is "Leader" or "Officer":
  991. if arg 2 is set:
  992. if arg 2 isn't a player:
  993. if arg 2 isn't equal to "%{_c}%":
  994. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  995. set {_confirm1} to false
  996. loop {_a::*}:
  997. if arg 2 is loop-value:
  998. set {_confirm1} to true
  999. if {_confirm1} is true:
  1000. loop all players:
  1001. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1002. if {_c3.%loop-player%} is equal to "%{_c}%":
  1003. send "%{_prefix}% &7Your {@p} has revoked ally with &6%arg 2%&7!" to loop-player
  1004. loop all players:
  1005. set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1006. if {_c4.%loop-player%} is equal to "%arg 2%":
  1007. send "%{_prefix}% &7{@p} &6%{_c}% &7has revoked ally with your {@p}!" to loop-player
  1008. remove "%arg 2%" from yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  1009. remove "%{_c}%" from yaml list "Faction.Allies" from "../../Factions/Factions/%arg 2%.yml"
  1010. else:
  1011. message "%{_prefix}% &7{@p} &6%arg 2% &7is not ally with your {@p}."
  1012. else:
  1013. send "%{_prefix}% &7Not your {@p}."
  1014. else:
  1015. message "%{_prefix}% &7Make sure to specify a {@p}'s name, not player's name"
  1016. else:
  1017. send "%{_prefix}% &7Use '/{@command} <neutral;enemy;revoke> <{@p} name>' to revoke ally with a {@p}."
  1018. else:
  1019. send "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
  1020. else:
  1021. send "%{_prefix}% &7You're not in any {@p}."
  1022. else:
  1023. message "{@noperm}"
  1024. if arg 1 is "__invite__":
  1025. if player has permission "clan.use.*" or "{@perm1}" or "clan.invite":
  1026. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1027. if {_c} is set:
  1028. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1029. if {_r} is "Leader" or "Officer":
  1030. wait 3 tick
  1031. open chest with 6 rows named "Select a player to invite!" to player
  1032. format slot 0 of player with arrow named "&6<&m--&6 &6Go Back" to close then run [make player execute command "/{@command}"]
  1033. set {_number} to 9
  1034. loop all players:
  1035. set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1036. if {_c.%loop-player%} isn't set:
  1037. set {_player} to loop-player
  1038. format slot {_number} of player with skull of {_player} named "&6%{_player}%" with lore "&7Click to invite %{_player}%." to close then run [make player execute command "/{@command} invite %{_player}%"]
  1039. add 1 to {_number}
  1040. else:
  1041. message "%{_prefix}% &7You must be the {@p}'s &6Admin &7or &6Leader &7to do that!"
  1042. else:
  1043. message "%{_prefix}% &7You're not in any {@p}."
  1044. else:
  1045. message "{@noperm}"
  1046. if arg 1 is "energy":
  1047. if player has permission "clan.use.*" or "{@perm1}" or "clan.energy":
  1048. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1049. if {_c} is set:
  1050. set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1051. set {_p} to size of {_p::*}
  1052. set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  1053. set {_t} to size of {_t::*}
  1054. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  1055. set {_e} to {_e} parsed as number
  1056. if {_e} is not set:
  1057. set {_e} to 0
  1058. open chest with 2 rows named "Purchase Energy" to player
  1059. format slot 4 of player with iron chestplate named "&7" with lore "&7Coins: &6%player's balance%||&7Energy Left: &6%{_e}% Day(s)" to be unstealable
  1060. set {_bal1} to 0
  1061. set {_bal2} to 0
  1062. set {_bal3} to 0
  1063. loop {_p} times:
  1064. add 250 to {_bal1}
  1065. add 500 to {_bal2}
  1066. add 1000 to {_bal3}
  1067. loop {_t} times:
  1068. add 50 to {_bal1}
  1069. add 100 to {_bal2}
  1070. add 200 to {_bal3}
  1071. set {_el} to 7
  1072. reduce {_el} by {_e}
  1073. if {_e} <= 6.9:
  1074. if player's balance >= {_bal1}:
  1075. format slot 12 of player with iron block named "&aPurchase 2.4 Hours of Energy" with lore "||&7Costs: &6%{_bal1}%$||&c||&7This will add 2.4 Hours of energy for your {@p}!" to close then run [PurchaseEnergy(player, {_c}, {_e}, 0.1)]
  1076. else:
  1077. format slot 12 of player with iron block named "&cPurchase 2.4 Hours of Energy" with lore "&cYou don't have enough money to purchase this!||&7Costs: &6%{_bal1}%$||&c||&7This will add 2.4 Hours of energy for your {@p}!" to be unstealable
  1078. else:
  1079. format slot 12 of player with iron block named "&cPurchase 2.4 Hours of Energy" with lore "&cYour {@p} Energy is full!||&7Costs: &60$||&c||&7This will add 2.4 Hours of energy for your {@p}!" to be unstealable
  1080. if {_e} <= 6:
  1081. if player's balance >= {_bal2}:
  1082. format slot 13 of player with gold block named "&aPurchase 1 Day of Energy" with lore "||&7Costs: &6%{_bal2}%$||&c||&7This will add 1 Day of energy for your {@p}!" to close then run [PurchaseEnergy(player, {_c}, {_e}, 1)]
  1083. else:
  1084. format slot 13 of player with gold block named "&cPurchase 1 Day of Energy" with lore "&cYou don't have enough money to purchase this!||&7Costs: &6%{_bal2}%$||&c||&7This will add 1 Day of energy for your {@p}!" to be unstealable
  1085. else:
  1086. format slot 13 of player with gold block named "&cPurchase 1 Day of Energy" with lore "&cYour {@p} Energy is full!||&7Costs: &60$||&c||&7This will add 1 Day of energy for your {@p}!" to be unstealable
  1087. if {_e} < 7:
  1088. if player's balance >= {_bal3}:
  1089. format slot 14 of player with diamond block named "&aPurchase Full Energy of %{_el}% Day(s)" with lore "||&7Costs: &6%{_bal3}%$||&c||&7This will max out your {@p}'s energy!" to close then run [PurchaseEnergy(player, {_c}, {_e}, {_el})]
  1090. else:
  1091. format slot 14 of player with diamond block named "&cPurchase Full Energy of %{_el}% Day(s)" with lore "&cYou don't have enough money to purchase this!||&7Costs: &6%{_bal3}%$||&c||&7This will max out your {@p}'s energy!" to be unstealable
  1092. else:
  1093. format slot 14 of player with diamond block named "&cPurchase Full Energy of %{_el}% Days(s)" with lore "&cYour {@p} Energy is full!||&7Costs: &60$||&c||&7This will max out your {@p}'s energy!" to be unstealable
  1094. else:
  1095. message "%{_prefix}% &7You're not in any {@p}."
  1096. else:
  1097. message "{@noperm}"
  1098. if arg 1 is "join":
  1099. if player has permission "clan.join" or "{@perm1}" or "clan.use.*":
  1100. if arg 2 is set:
  1101. if arg 2 is not equal to player:
  1102. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1103. if {_c} is not set:
  1104. set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1105. set {_confirm} to false
  1106. loop {_c::*}:
  1107. if arg 2 is loop-value:
  1108. set {_confirm} to true
  1109. set {_c} to loop-value
  1110. if {_confirm} is false:
  1111. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1112. if {_c} is not set:
  1113. send "%{_prefix}% &7No matches found for &6%arg 2%&7."
  1114. stop
  1115. else:
  1116. set {_confirm} to true
  1117. if {_confirm} is true:
  1118. if {clan.%{_c}%.invite.%player%} is true:
  1119. set {_players::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1120. set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
  1121. if size of {_players::*} is not {_max}:
  1122. set player tab name to "&6%{_c}% &e%player%"
  1123. delete {clan.%{_c}%.invite.%player%}
  1124. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1125. delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1126. add "%player%" to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1127. add "%uuid of player%" to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  1128. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Member"
  1129. set yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_c}%"
  1130. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
  1131. set yaml value "Userdata.Username" from "../../Factions/Userdata/%uuid of player%.yml" to "%player%"
  1132. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  1133. set {_e} to {_e} parsed as number
  1134. if {_e} <= 7:
  1135. remove 0.1 from {_e}
  1136. if {_e} <= 0:
  1137. set {_e} to 0
  1138. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
  1139. loop all players:
  1140. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1141. if {_c2.%loop-player%} is equal to "%{_c}%":
  1142. send "%{_prefix}% &6%player% &7has joined your {@p}!" to loop-player
  1143. send "%{_prefix}% &7You have joined {@p} &b%{_c}%&7!"
  1144. else:
  1145. send "%{_prefix}% &7The {@p} is Full. Please try again later."
  1146. else:
  1147. message "%{_prefix}% &7You have no pending request from &6%arg 2%&7."
  1148. else:
  1149. message "%{_prefix}% &7You must leave your {@p} before you join &6%{_c}%&7."
  1150. else:
  1151. send "%{_prefix}% &7Not you!"
  1152. else:
  1153. message "%{_prefix}% &7Use /{@command} join <player> to join the {@p}."
  1154. else:
  1155. message "{@noperm}"
  1156. if arg 1 is "deinvite":
  1157. if player has permission "clan.deinvite" or "{@perm1}" or "clan.use.*":
  1158. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1159. if {_c} is set:
  1160. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1161. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1162. if {_r} is "Leader" or "Officer":
  1163. if arg 2 is set:
  1164. if arg 2 is not player:
  1165. if {clan.%player%.invite.%arg 2%} is true:
  1166. if {_c2} is not set:
  1167. delete {clan.%player%.invite.%arg 2%}
  1168. message "%{_prefix}% &6%arg 2% &7is no longer invited to your {@p}."
  1169. send "%{_prefix}% &7You're no longer invited to &6%{_c}% {@p}." to arg 2
  1170. else:
  1171. if {_c2} is equal to "%{_c}%":
  1172. send "%{_prefix}% &6%arg 2% &7is already in your {@p},"
  1173. else:
  1174. send "%{_prefix}% &6%arg 2% &7is already in another {@p}."
  1175. else:
  1176. send "%{_prefix}% &6%arg 2% &7is not invited to your {@p}."
  1177. else:
  1178. send "%{_prefix}% &7Wanna deinvite yourself from your {@p}?"
  1179. else:
  1180. message "%{_prefix}% &7Use '/{@command} deinvite <player>' to cancel the player's invite."
  1181. else:
  1182. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7to do that!"
  1183. else:
  1184. message "%{_prefix}% &7You're not in any {@p}."
  1185. else:
  1186. message "{@noperm}"
  1187. if arg 1 is "kick":
  1188. if player has permission "clan.kick" or "{@perm1}" or "clan.use.*":
  1189. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1190. if {_c} is set:
  1191. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1192. if {_r} is "Leader" or "Officer":
  1193. if arg 2 is set:
  1194. if arg 2 is not player:
  1195. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1196. set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1197. if {_c2} is equal to {_c}:
  1198. if {_r} is "Leader":
  1199. set player tab name to "&e%player%"
  1200. remove "%arg 2%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1201. remove "%uuid of arg 2%" from yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  1202. send "%{_prefix}% &7You were kicked from &6%{_c}%&7's {@p}." to arg 2
  1203. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%.yml"
  1204. set {_e} to {_e} parsed as number
  1205. if {_e} < 7:
  1206. add 0.1 to {_e}
  1207. if {_e} >= 7:
  1208. set {_e} to 7
  1209. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%.yml" to "%{_e}%"
  1210. delete {_c2}
  1211. delete {_r2}
  1212. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1213. delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1214. message "%{_prefix}% &7You kicked &6%arg 2% &7from your {@p}."
  1215. set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1216. set {_p::*} to {_p}
  1217. loop all players:
  1218. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1219. if {_c2.%loop-player%} is equal to "%{_c}%":
  1220. send "%{_prefix}% &6%arg 2% &7was kicked from the {@p}!" to loop-player
  1221. stop
  1222. if {_r} is "Officer":
  1223. if {_r2} isn't "Leader" or "Officer":
  1224. set player tab name to "&e%player%"
  1225. remove "%arg 2%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1226. remove "%uuid of arg 2%" from yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  1227. send "%{_prefix}% &7You were kicked from &6%{_c}%&7's {@p}." to arg 2
  1228. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%"
  1229. set {_e} to {_e} parsed as number
  1230. if {_e} < 7:
  1231. add 0.1 to {_e}
  1232. if {_e} >= 7:
  1233. set {_e} to 7
  1234. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%" to "%{_e}%"
  1235. delete {_c2}
  1236. delete {_r2}
  1237. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1238. delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1239. message "%{_prefix}% &7You kicked &6%arg 2% &7from your {@p}."
  1240. loop all players:
  1241. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1242. if {_c2.%loop-player%} is equal to "%{_c}%":
  1243. send "%{_prefix}% &6%arg 2% &7was kicked from the {@p}!" to loop-player
  1244. else:
  1245. message "%{_prefix}% &6%arg 2% &7can't be kicked from the {@p}."
  1246. else:
  1247. message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
  1248. else:
  1249. message "%{_prefix}% &7You can't kick yourself from your {@p}."
  1250. else:
  1251. message "%{_prefix}% &7Use '/{@command} kick <player>' to kick the player from your {@p}."
  1252. else:
  1253. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
  1254. else:
  1255. message "%{_prefix}% &7You're not in any {@p}."
  1256. else:
  1257. message "{@noperm}"
  1258. if arg 1 is "leave":
  1259. if player has permission "clan.leave" or "{@perm1}" or "clan.use.*":
  1260. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1261. if {_c} is set:
  1262. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1263. if {_r} is "Leader":
  1264. message "%{_prefix}% &7You can't leave your own {@p}. You must disband it with '/c disband'"
  1265. else:
  1266. message "%{_prefix}% &7You left the {@p}."
  1267. set player tab name to "&e%player%"
  1268. remove "%player%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1269. remove "%uuid of player%" from yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  1270. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  1271. set {_e} to {_e} parsed as number
  1272. if {_e} < 7:
  1273. add 0.1 to {_e}
  1274. if {_e} >= 7:
  1275. set {_e} to 7
  1276. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
  1277. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1278. delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1279. loop all players:
  1280. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1281. if {_c2.%loop-player%} is equal to "%{_c}%":
  1282. send "%{_prefix}% &6%player% &7has left the {@p}!" to loop-player
  1283. else:
  1284. message "%{_prefix}% &7You're not in any {@p}."
  1285. else:
  1286. message "{@noperm}"
  1287. if arg 1 is "disband":
  1288. if player has permission "clan.disband" or "{@perm1}" or "clan.use.*":
  1289. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1290. if {_c} is set:
  1291. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1292. if {_r} is "Leader":
  1293. set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
  1294. set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
  1295. set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  1296. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  1297. loop all players:
  1298. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1299. if {_p.%loop-player%} is equal to "%{_c}%":
  1300. send "%{_prefix}% &7Your {@p} &b%{_c}% &7has been disbanded." to loop-player
  1301. set loop-player tab name to "&e%loop-player%"
  1302. loop {_t::*}:
  1303. set {_loop} to loop-value
  1304. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_loop}%.yml"
  1305. loop {_u::*}:
  1306. set {_loop2} to loop-value
  1307. delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%{_loop2}%.yml"
  1308. delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_loop2}%.yml"
  1309. loop {_a::*}:
  1310. set {_loop3} to loop-value
  1311. remove "%{_c}%" from yaml list "Faction.Allies" from "../../Factions/Factions/%{_loop3}%.yml"
  1312. delete file "plugins/Factions/Factions/%{_c}%.yml"
  1313. remove "%{_c}%" from yaml list "Factions" from "../../Factions/Factions.yml"
  1314. else:
  1315. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7to do that!"
  1316. else:
  1317. message "%{_prefix}% &7You're not in any {@p}."
  1318. else:
  1319. message "{@noperm}"
  1320. if arg 1 is "create":
  1321. if player has permission "clan.create" or "{@perm1}" or "clan.use.*":
  1322. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1323. if {_c} is not set:
  1324. if arg 2 is set:
  1325. set {_new} to false
  1326. set {_f::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1327. loop {_f::*}:
  1328. if arg 2 is loop-value:
  1329. set {_new} to true
  1330. if {_new} is true:
  1331. send "%{_prefix}% &7{@p} name &6%arg 2% &7is already exist. Please try other name!"
  1332. delete {_new}
  1333. stop
  1334. if {_new} is false:
  1335. set {_c2} to arg 2
  1336. set {_c2} to {_c2} parsed as text
  1337. set player tab name to "&6%{_c2}% &e%player%"
  1338. add "%arg 2%" to yaml list "Factions" from "../../Factions/Factions.yml"
  1339. add "%player%" to yaml list "Faction.Players" from "../../Factions/Factions/%{_c2}%.yml"
  1340. add "%uuid of player%" to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c2}%.yml"
  1341. set yaml value "Faction.Founder" from "../../Factions/Factions/%{_c2}%.yml" to "%player%"
  1342. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%.yml" to "1"
  1343. set yaml value "Faction.Date" from "../../Factions/Factions/%{_c2}%.yml" to "%now%"
  1344. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
  1345. set yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_c2}%"
  1346. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Leader"
  1347. set yaml value "Userdata.Username" from "../../Factions/Userdata/%uuid of player%.yml" to "%player%"
  1348. send "%{_prefix}% &7You created &b%arg 2%&7."
  1349. else:
  1350. message "%{_prefix}% &7Use '/{@command} create <{@p} Name>' to create your {@p}." to player
  1351. else:
  1352. message "%{_prefix}% &7You can't create a {@p} while being in another one." to player
  1353. else:
  1354. message "{@noperm}"
  1355. if arg 1 is "info" or "show" or "stats":
  1356. if player has permission "clan.use" or "{@perm1}" or "clan.use.*":
  1357. if arg 2 is set:
  1358. set {_confirm} to false
  1359. if arg 2 is online:
  1360. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1361. set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1362. loop {_clans::*}:
  1363. if {_c} is loop-value:
  1364. set {_confirm} to true
  1365. set {_clan} to loop-value
  1366. send "%{_prefix}% &7Loading info of player &6%arg 2%&7..."
  1367. if arg 2 is offline:
  1368. if {_confirm} is false:
  1369. set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1370. loop {_clans::*}:
  1371. if arg 2 is loop-value:
  1372. set {_confirm} to true
  1373. set {_clan} to loop-value
  1374. send "%{_prefix}% &7Loading info of {@p} &6%arg 2%&7..."
  1375. if {_confirm} is true:
  1376. set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
  1377. set {_ts} to size of {_t::*}
  1378. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
  1379. set {_e} to {_e} parsed as number
  1380. if {_e} is not set:
  1381. set {_e} to 0
  1382. set {_s::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_clan}%.yml"
  1383. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_clan}%.yml"
  1384. if {_a::*} is not set:
  1385. set {_a::*} to "&a"
  1386. set {_f} to yaml value "Faction.Founder" from "../../Factions/Factions/%{_clan}%.yml"
  1387. set {_s} to size of {_s::*}
  1388. set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_clan}%.yml"
  1389. set {_d} to yaml value "Faction.Date" from "../../Factions/Factions/%{_clan}%.yml"
  1390. if {_d} is not set:
  1391. set {_d} to "Unknown"
  1392. if {_f} is not set:
  1393. set {_f} to "Unknown"
  1394. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1395. if {_c} is set:
  1396. set {_wp} to yaml value "Faction.WarPoints.%{_clan}%" from "../../Factions/Factions/%{_c}%.yml"
  1397. if {_clan} is equal to {_c}:
  1398. set {_wp} to "--"
  1399. else:
  1400. if {_wp} is not set:
  1401. set {_wp} to 0
  1402. else:
  1403. set {_wp} to "You're not in any {@p}."
  1404. wait 3 ticks
  1405. open chest with 4 rows named "{@p} Info - %{_clan}%" to player
  1406. set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
  1407. set {_max2} to yaml value "maxterritories" from "../../Factions/config.yml"
  1408. if {_h} is set:
  1409. set {_x} to x-coordinate of {_h}
  1410. set {_y} to y-coordinate of {_h}
  1411. set {_z} to z-coordinate of {_h}
  1412. format slot 4 of player with paper named "&6%{_clan}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &f%{_x}%, %{_y}%, %{_z}%||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eEnergy Left &f%{_e}% Day(s)||&eWar Points &f%{_wp}%||&eAllies &a%{_a::*}%" to be unstealable
  1413. if {_h} isn't set:
  1414. format slot 4 of player with paper named "&6%{_clan}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &cNo Home Set.||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eEnergy Left &f%{_e}% Day(s)||&eWar Points &f%{_wp}%||&eAllies &a%{_a::*}%" to be unstealable
  1415. set {_number} to 18
  1416. loop {_s::*}:
  1417. set {_uuid} to loop-value
  1418. set {_player} to yaml value "Userdata.Username" from "../../Factions/Userdata/%{_uuid}%.yml"
  1419. set {_player} to {_player} parsed as a player
  1420. if {_player} is online:
  1421. set {_name} to "&a&l%{_player}%"
  1422. set {_skull} to {_player}'s skull
  1423. else:
  1424. set {_name} to "&c&l%{_player}%"
  1425. set {_skull} to skeleton head
  1426. set {_name} to coloured {_name}
  1427. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_uuid}%.yml"
  1428. format slot {_number} of player with {_skull} named "%{_name}%" with lore "&a||&7Rank: &6%{_r}%" to be unstealable
  1429. add 1 to {_number}
  1430. else:
  1431. send "%{_prefix}% &7No {@p} or player matches found for [&e%arg 2%&7]. Make sure to specify correct the {@p}'s or player's name."
  1432. stop
  1433. else:
  1434. send "%{_prefix}% &7Use '/c <info;show;stats> <player/{@p}>' to view {@p}'s information."
  1435. else:
  1436. message "{@noperm}"
  1437. if arg 1 is "chat":
  1438. if player has permission "clan.use" or "{@perm1}" or "clan.use.*":
  1439. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1440. if {_c} is set:
  1441. set {_chat} to yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml"
  1442. if {_chat} is not set:
  1443. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
  1444. if {_chat} is "Public":
  1445. message "%{_prefix}% &7Chat: &bFaction Chat&7."
  1446. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Clan"
  1447. stop
  1448. if {_chat} is "Clan":
  1449. message "%{_prefix}% &7Chat: &aAlly Chat&7."
  1450. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Ally"
  1451. stop
  1452. if {_chat} is "Ally":
  1453. message "%{_prefix}% &7Chat: &ePublic Chat&7."
  1454. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
  1455. stop
  1456. else:
  1457. message "%{_prefix}% &7You must have a {@p} to do that!"
  1458. else:
  1459. message "{@noperm}"
  1460. if arg 1 is "clans" or "factions":
  1461. if player has permission "clan.use" or "{@perm1}" or "clan.use.*":
  1462. message "&6&l{@p} List:"
  1463. set {_list::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1464. if {_list::*} is set:
  1465. set {_n} to 0
  1466. loop {_list::*}:
  1467. add 1 to {_n}
  1468. message "&7- &a%{_n}% &b%loop-value%"
  1469. else:
  1470. message "&7There is no {@p}! Use '/{@command} create <name>' to create one."
  1471. else:
  1472. message "{@noperm}"
  1473. if arg 1 is "sethome":
  1474. if player has permission "clan.home" or "{@perm1}" or "clan.use.*":
  1475. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1476. if {_c} is set:
  1477. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1478. if {_r} is "Leader" or "Officer":
  1479. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
  1480. if {_t} is set:
  1481. if {_t} is equal to "%{_c}%":
  1482. teleport player to location of block at player
  1483. set yaml value "Faction.Home" from "../../Factions/Factions/%{_c}%.yml" to location of block at player
  1484. set block at player to bed
  1485. set {_b} to block west player
  1486. if {_b} is bed:
  1487. set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block west block at player
  1488. set {_b} to block east player
  1489. if {_b} is bed:
  1490. set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block east block at player
  1491. set {_b} to block north player
  1492. if {_b} is bed:
  1493. set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block north block at player
  1494. set {_b} to block south player
  1495. if {_b} is bed:
  1496. set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block south block at player
  1497. loop all players:
  1498. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1499. if {_c2.%loop-player%} is equal to "%{_c}%":
  1500. send "%{_prefix}% &6%player% &7has set {@p} Home at &b%x-coordinate of player's location%, %y-coordinate of player's location%, %z-coordinate of player's location%&7. Use '/c home' to warp to your Clan Home!" to loop-player
  1501. send player title "&7Home set!" with subtitle "&aUse /{@command} home to teleport." for 2 seconds
  1502. else:
  1503. send "%{_prefix}% &7You can't set your {@p} home at &6%{_t}%&7's Territory."
  1504. else:
  1505. message "%{_prefix}% &7You must claim this territory first, before you set your home. Please use '/{@command} claim'."
  1506. else:
  1507. message "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
  1508. stop
  1509. else:
  1510. message "%{_prefix}% &7You're not in any {@p}."
  1511. stop
  1512. else:
  1513. message "{@noperm}"
  1514. stop
  1515. if arg 1 is "home":
  1516. if player has permission "clan.home" or "{@perm1}" or "clan.use.*":
  1517. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1518. if {_c} is set:
  1519. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1520. set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_c}%.yml"
  1521. if {_h} is set:
  1522. set {_ct} to yaml value "countdown-home" from "../../Factions/config.yml"
  1523. set {_loc} to the player's location
  1524. while {_ct} > 0:
  1525. if distance between {_loc} and player's location < 0.1:
  1526. if {_ct} doesn't contain .1 or .2 or .3 or .4 or .5 or .6 or .7 or .8 or .9:
  1527. set {_ct} to "%{_ct}%.0"
  1528. set {_ct} to {_ct} parsed as number
  1529. send player title "" with subtitle "Teleporting to {@p} Home in &a%{_ct}% &aSeconds" for 0.2 second with 0 seconds fade in and 0 seconds fade out
  1530. wait 0.1 second
  1531. remove 0.1 from {_ct}
  1532. else:
  1533. send "%{_prefix}% &7Teleport has been cancelled due to your movement."
  1534. stop
  1535. if distance between {_loc} and player's location < 0.1:
  1536. teleport player to {_h}
  1537. send player title "" with subtitle "&aTeleported you to your {@p} Home!" for 1 second
  1538. stop
  1539. else:
  1540. if {_r} is "Leader" or "Officer":
  1541. message "%{_prefix}% &7Home is not set. Use '/{@command} sethome' to set it."
  1542. if {_r} is "Member" or "Trusted":
  1543. message "%{_prefix}% &7Your {@p} doesn't have any Home."
  1544. else:
  1545. message "%{_prefix}% &7You're not in any {@p}."
  1546. stop
  1547. else:
  1548. message "{@noperm}"
  1549. if arg 1 is "promote":
  1550. if player has permission "clan.promote" or "{@perm1}" or "clan.use.*":
  1551. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1552. if {_c} is set:
  1553. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1554. if arg 2 is set:
  1555. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1556. set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1557. if {_r} is "Officer":
  1558. if arg 2 is not player:
  1559. if {_c} is equal to {_c2}:
  1560. if {_r2} is "Member":
  1561. set {_r2} to "Trusted"
  1562. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1563. message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
  1564. send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
  1565. loop all players:
  1566. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1567. if {_c2.%loop-player%} is equal to "%{_c}%":
  1568. send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
  1569. stop
  1570. if {_r2} is "Trusted":
  1571. set {_r2} to "Officer"
  1572. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1573. message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
  1574. send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
  1575. loop all players:
  1576. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1577. if {_c2.%loop-player%} is equal to "%{_c}%":
  1578. send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
  1579. stop
  1580. if {_r2} is "Officer" or "Leader":
  1581. send "%{_prefix}% &7You can't change {@p} ranks to &6%arg 2%&7!"
  1582. else:
  1583. message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
  1584. else:
  1585. message "%{_prefix}% &7You can't promote yourself."
  1586. if {_r} is "Leader":
  1587. if arg 2 is not player:
  1588. if {_c} is equal to {_c2}:
  1589. if {_r2} is "Member":
  1590. set {_r2} to "Trusted"
  1591. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1592. message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
  1593. send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
  1594. loop all players:
  1595. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1596. if {_c2.%loop-player%} is equal to "%{_c}%":
  1597. send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
  1598. stop
  1599. if {_r2} is "Trusted":
  1600. set {_r2} to "Officer"
  1601. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1602. message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
  1603. send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
  1604. loop all players:
  1605. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1606. if {_c2.%loop-player%} is equal to "%{_c}%":
  1607. send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
  1608. stop
  1609. if {_r2} is "Officer":
  1610. set {_r2} to "Leader"
  1611. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1612. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Officer"
  1613. message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
  1614. send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
  1615. send "%{_prefix}% &7You were demoted to &6Officer&7." to player
  1616. loop all players:
  1617. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1618. if {_c2.%loop-player%} is equal to "%{_c}%":
  1619. send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
  1620. stop
  1621. if {_r2} is "Leader":
  1622. send "%{_prefix}% &6%arg 2% &7can't be promoted higher than &6%{_r2}%&7."
  1623. stop
  1624. else:
  1625. message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
  1626. else:
  1627. message "%{_prefix}% &7You can't promote yourself."
  1628. if {_r} is "Member" or "Recruit+" or "Recruit":
  1629. send "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
  1630. else:
  1631. message "%{_prefix}% &7Use '/{@command} promote <player>' to promote the player."
  1632. else:
  1633. message "%{_prefix}% &7You're not in any {@p}."
  1634. else:
  1635. message "{@noperm}"
  1636. if arg 1 is "demote":
  1637. if player has permission "clan.demote" or "{@perm1}" or "clan.use.*":
  1638. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1639. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1640. if {_c} is set:
  1641. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1642. if arg 2 is set:
  1643. set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
  1644. if {_r} is "Leader":
  1645. if arg 2 is not player:
  1646. if {_c} is equal to {_c2}:
  1647. if {_r2} is "Officer":
  1648. set {_r2} to "Trusted"
  1649. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1650. message "%{_prefix}% &7You demoted &6%arg 2% &7to &6%{_r2}%&7."
  1651. send "%{_prefix}% &7You were demoted to &6%{_r2}%&7." to arg 2
  1652. loop all players:
  1653. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1654. if {_c2.%loop-player%} is equal to "%{_c}%":
  1655. send "%{_prefix}% &6%arg 2% &7has been demoted to &6%{_r2}%&7!" to loop-player
  1656. stop
  1657. if {_r2} is "Trusted":
  1658. set {_r2} to "Member"
  1659. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1660. message "%{_prefix}% &7You demoted &6%arg 2% &7to &6%{_r2}%&7."
  1661. send "%{_prefix}% &7You were demoted to &6%{_r2}%&7." to arg 2
  1662. loop all players:
  1663. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1664. if {_c2.%loop-player%} is equal to "%{_c}%":
  1665. send "%{_prefix}% &6%arg 2% &7has been demoted to &6%{_r2}%&7!" to loop-player
  1666. stop
  1667. if {_r2} is "Member":
  1668. send "%{_prefix}% &6%arg 2% &7can't be demoted lower than &6%{_r2}%&7."
  1669. stop
  1670. else:
  1671. message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
  1672. else:
  1673. message "%{_prefix}% &7You can't demote yourself."
  1674. if {_r} is "Officer":
  1675. if arg 2 is not player:
  1676. if {_c} is equal to {_c2}:
  1677. if {_r2} is "Officer" or "Leader":
  1678. send "%{_prefix}% &7You don't change &6%arg 2%&7's rank."
  1679. stop
  1680. if {_r2} is "Trusted":
  1681. set {_r2} to "Member"
  1682. set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
  1683. message "%{_prefix}% &7You demoted &6%arg 2% &7to &6%{_r2}%&7."
  1684. send "%{_prefix}% &7You were demoted to &6%{_r2}%&7." to arg 2
  1685. loop all players:
  1686. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1687. if {_c2.%loop-player%} is equal to "%{_c}%":
  1688. send "%{_prefix}% &6%arg 2% &7has been demoted to &6%{_r2}%&7!" to loop-player
  1689. stop
  1690. if {_r2} is "Member":
  1691. send "%{_prefix}% &6%arg 2% &7can't be demoted lower than &6%{_r2}%&7."
  1692. stop
  1693. else:
  1694. message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
  1695. else:
  1696. message "%{_prefix}% &7You can't demote yourself."
  1697. if {_r} is "Member" or "Officer" or "Trusted":
  1698. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
  1699. else:
  1700. message "%{_prefix}% &7Use '/{@command} demote <player>' to demote the player."
  1701. else:
  1702. message "%{_prefix}% &7You're not in any {@p}."
  1703. else:
  1704. message "{@noperm}"
  1705. if arg 1 is "claim":
  1706. if player has permission "clan.claim" or "{@perm1}" or "clan.use.*":
  1707. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1708. if {_c} is set:
  1709. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1710. if {_r} is "Leader" or "Officer":
  1711. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
  1712. set {_t2::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  1713. set {_max} to yaml value "maxterritories" from "../../Factions/config.yml"
  1714. if size of {_t2::*} is not {_max}:
  1715. set {_tc} to yaml value "territory-costs" from "../../Factions/config.yml"
  1716. if player's balance is greater or equal to {_tc}:
  1717. if {_t} is not set:
  1718. remove {_tc} from player's balance
  1719. set yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml" to "%{_c}%"
  1720. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  1721. set {_e} to {_e} parsed as number
  1722. if {_e} <= 7:
  1723. remove 0.4 from {_e}
  1724. if {_e} <= 0:
  1725. set {_e} to 0
  1726. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
  1727. send "%{_prefix}% &7Claimed Territory at &b%chunk of player%&7."
  1728. add "%player's chunk%" to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  1729. else:
  1730. if {_t} is equal to "%{_c}%":
  1731. message "%{_prefix}% &7This Territory is already owned by your {@p}."
  1732. else:
  1733. message "%{_prefix}% &7This Territory is already owned by &6%{_t}%&7's {@p}."
  1734. else:
  1735. message "%{_prefix}% &7You don't have enough money to claim this territory!"
  1736. else:
  1737. message "%{_prefix}% &7You can't claim more territory."
  1738. else:
  1739. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
  1740. else:
  1741. message "%{_prefix}% &7You're not in any {@p}."
  1742. else:
  1743. message "{@noperm}"
  1744. if arg 1 is "unclaim":
  1745. if player has permission "clan.claim" or "{@perm1}" or "clan.use.*":
  1746. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1747. if {_c} is set:
  1748. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1749. if {_r} is "Leader" or "Officer":
  1750. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
  1751. if {_t} is set:
  1752. if {_t} is equal to "%{_c}%":
  1753. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
  1754. set {_chunk} to chunk of player
  1755. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  1756. set {_e} to {_e} parsed as number
  1757. if {_e} > 0:
  1758. add 0.4 to {_e}
  1759. if {_e} >= 7:
  1760. set {_e} to 7
  1761. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
  1762. remove "%{_chunk}%" from yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  1763. message "%{_prefix}% &7Un-Claimed Territory at &b%chunk of player%&7."
  1764. else:
  1765. message "%{_prefix}% &7This Territory is already owned by &6%{_t}%&7's {@p}."
  1766. else:
  1767. message "%{_prefix}% &7Territory is not claimed by any {@p}."
  1768. else:
  1769. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
  1770. else:
  1771. message "%{_prefix}% &7You're not in any {@p}."
  1772. else:
  1773. message "{@noperm}"
  1774. if arg 1 is "map":
  1775. if player has permission "{@perm1}" or "clan.use":
  1776. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  1777. if {_c} is set:
  1778. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  1779. if {_r} is "Leader" or "Officer":
  1780. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
  1781. if {_t} is set:
  1782. if {_t} is equal to "%{_c}%":
  1783. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
  1784. set {_chunk} to chunk of player
  1785. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
  1786. set {_e} to {_e} parsed as number
  1787. if {_e} > 0:
  1788. add 0.4 to {_e}
  1789. if {_e} >= 7:
  1790. set {_e} to 7
  1791. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
  1792. remove "%{_chunk}%" from yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
  1793. message "%{_prefix}% &7Un-Claimed Territory at &b%chunk of player%&7."
  1794. else:
  1795. message "%{_prefix}% &7This Territory is already owned by &6%{_t}%&7's {@p}."
  1796. else:
  1797. message "%{_prefix}% &7Territory is not claimed by any {@p}."
  1798. else:
  1799. message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
  1800. else:
  1801. message "%{_prefix}% &7You're not in any {@p}."
  1802. else:
  1803. message "{@noperm}"
  1804. else:
  1805. send "{@noperm}"
  1806.  
  1807. every 2.4 hours:
  1808. set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1809. loop {_c::*}:
  1810. set {_clan} to loop-value
  1811. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
  1812. set {_e} to {_e} parsed as number
  1813. remove 0.1 from {_e}
  1814. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml" to "%{_e}%"
  1815. loop all players:
  1816. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1817. if {_c2.%loop-player%} is equal to "%{_clan}%":
  1818. UpdateScoreBoard(loop-player)
  1819.  
  1820. every 30 seconds:
  1821. set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1822. loop {_c::*}:
  1823. set {_clan} to loop-value
  1824. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
  1825. set {_e} to {_e} parsed as number
  1826. if {_e} <= 0:
  1827. set {_e} to 0
  1828. set yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml" to "%{_e}%"
  1829. set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
  1830. loop {_t::*}:
  1831. set {_c2} to loop-value-2
  1832. delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_c2}%.yml"
  1833. delete yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
  1834. loop all players:
  1835. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1836. if {_c2.%loop-player%} is equal to "%{_clan}%":
  1837. UpdateScoreBoard(loop-player)
  1838. every 1.5 hours:
  1839. set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
  1840. loop {_c::*}:
  1841. set {_clan} to loop-value
  1842. set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
  1843. set {_e} to {_e} parsed as number
  1844. if {_e} <= 1.5:
  1845. if {_e} > 0:
  1846. loop all players:
  1847. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1848. if {_c2.%loop-player%} is equal to "%{_clan}%":
  1849. send loop-player title "&6Notice" with subtitle "&f{@p} Energy is running low!" for 7 seconds
  1850. else:
  1851. loop all players:
  1852. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1853. if {_c2.%loop-player%} is equal to "%{_clan}%":
  1854. send loop-player title "&cNotice" with subtitle "&f{@p} Energy is expired!" for 7 seconds
  1855. UpdateScoreBoard(loop-player)
  1856.  
  1857. on damage:
  1858. attacker is a player
  1859. attacker is in "{@world}"
  1860. victim is a player
  1861. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  1862. replace all "@" with "&" in {_prefix}
  1863. set {_prefix} to coloured {_prefix}
  1864. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of attacker%.yml"
  1865. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of victim%.yml"
  1866. if {_c} is equal to {_c2}:
  1867. cancel event
  1868. send "%{_prefix}% &7You can't harm &b%victim%&7." to attacker
  1869. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  1870. if {_a::*} contains "%{_c2}%":
  1871. cancel event
  1872. send "%{_prefix}% &7You can't harm &a%victim%&7." to attacker
  1873.  
  1874. on death:
  1875. attacker is a player
  1876. attacker is in "{@world}"
  1877. victim is a player
  1878. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of attacker%.yml"
  1879. set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of victim%.yml"
  1880. if {_c} is set:
  1881. if {_c2} is set:
  1882. set {_wp} to yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml"
  1883. set {_wp2} to yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml"
  1884. set {_wp} to {_wp} parsed as number
  1885. set {_wp2} to {_wp2} parsed as number
  1886. if {_wp} is not set:
  1887. set {_wp} to 0
  1888. if {_wp2} is not set:
  1889. set {_wp2} to 0
  1890. add 1 to {_wp}
  1891. remove 1 from {_wp2}
  1892. set yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml" to "%{_wp}%"
  1893. set yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml" to "%{_wp2}%"
  1894. if {_wp} = 0:
  1895. remove "%{_c2}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
  1896. remove "%{_c}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c2}%.yml"
  1897. remove "%{_c2}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
  1898. remove "%{_c}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c2}%.yml"
  1899. else:
  1900. set {_confirm} to false
  1901. set {_wins::*} to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
  1902. loop {_wins::*}:
  1903. if loop-value is {_c2}:
  1904. set {_confirm} to true
  1905. if {_confirm} is false:
  1906. add "%{_c2}%" to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
  1907. add "%{_c}%" to yaml list "Faction.Loses" from "../../Factions/Factions/%{_c2}%.yml"
  1908. set {_set} to false
  1909. set {_set2} to false
  1910. if {_wp} >= 5:
  1911. set {_set} to true
  1912. set {_p} to "&7(&d%{_wp}%&7)"
  1913. if {_wp} <= -5:
  1914. set {_p} to "&7(&c%{_wp}%&7)"
  1915. set {_set} to true
  1916. if {_wp2} >= 5:
  1917. set {_p2} to "&7(&d%{_wp2}%&7)"
  1918. set {_set2} to true
  1919. if {_wp2} <= -5:
  1920. set {_p2} to "&7(&c%{_wp2}%&7)"
  1921. set {_set2} to true
  1922. if {_set} is false:
  1923. set {_p} to "&7(&f%{_wp}%&7)"
  1924. if {_set2} is false:
  1925. set {_p2} to "&7(&f%{_wp2}%&7)"
  1926. set {_p} to coloured {_p}
  1927. set {_p2} to coloured {_p2}
  1928. loop all players:
  1929. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1930. if {_c3.%loop-player%} is equal to "%{_c}%":
  1931. send "&8[&9War&8] &7Your {@p} gained 1 war point against &6%{_c2}% %{_p}%." to loop-player
  1932. loop all players:
  1933. set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1934. if {_c4.%loop-player%} is equal to "%{_c2}%":
  1935. send "&8[&9War&8] &7Your {@p} lost 1 war point against &6%{_c}% %{_p2}%." to loop-player
  1936. if {_wp} is 25:
  1937. broadcast "&8[&9War&8] &6%{_c}% &7can now invade &6%{_c2}%&7!"
  1938. set {_wp} to "Invading"
  1939. set {_wp2} to "Invaded"
  1940. set yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml" to "%{_wp}%"
  1941. set yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml" to "%{_wp2}%"
  1942. loop all players:
  1943. set {_i.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1944. if {_i.%loop-player%} is equal to "%{_c2}%":
  1945. send "&8[&9War&8] &7Your {@p} is being invaded by &6%{_c}%&7 &7for &a15 Minutes&7!" to loop-player
  1946. send loop-player title "&cInvaded by &4%{_c}%" with subtitle "" for 10 seconds with 2 seconds fade in and 2 seconds fade out
  1947. loop all players:
  1948. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1949. if {_p.%loop-player%} is equal to "%{_c}%":
  1950. send loop-player title "&6Invading &d%{_c2}%" with subtitle "" for 10 seconds with 2 seconds fade in and 2 seconds fade out
  1951. send "&8[&9War&8] &7Your {@p} can now invade &6%{_c2}% &7for &a15 Minutes&7!" to loop-player
  1952. wait 10 minutes
  1953. loop all players:
  1954. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1955. if {_p.%loop-player%} is equal to "%{_c}%":
  1956. send loop-player title "&6Invading &d%{_c2}%" with subtitle "&c5 Minutes left!" for 5 seconds
  1957. wait 4 minutes
  1958. loop all players:
  1959. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1960. if {_p.%loop-player%} is equal to "%{_c}%":
  1961. send loop-player title "&6Invading &d%{_c2}%" with subtitle "&c1 Minute left!" for 3 seconds
  1962. wait 55 seconds
  1963. loop all players:
  1964. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1965. if {_p.%loop-player%} is equal to "%{_c}%":
  1966. send loop-player title "" with subtitle "&c&l5" for 2 seconds with 0 seconds fade in and 0 seconds fade out
  1967. wait 1 second
  1968. loop all players:
  1969. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1970. if {_p.%loop-player%} is equal to "%{_c}%":
  1971. send loop-player title "" with subtitle "&c&l4" for 2 seconds with 0 seconds fade in and 0 seconds fade out
  1972. wait 1 second
  1973. loop all players:
  1974. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1975. if {_p.%loop-player%} is equal to "%{_c}%":
  1976. send loop-player title "" with subtitle "&c&l3" for 2 seconds with 0 seconds fade in and 0 seconds fade out
  1977. wait 1 second
  1978. loop all players:
  1979. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1980. if {_p.%loop-player%} is equal to "%{_c}%":
  1981. send loop-player title "" with subtitle "&c&l2" for 2 seconds with 0 seconds fade in and 0 seconds fade out
  1982. wait 1 second
  1983. loop all players:
  1984. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1985. if {_p.%loop-player%} is equal to "%{_c}%":
  1986. send loop-player title "" with subtitle "&c&l1" for 2 seconds with 0 seconds fade in and 0 seconds fade out
  1987. wait 1 second
  1988. loop all players:
  1989. set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1990. if {_p.%loop-player%} is equal to "%{_c}%":
  1991. send loop-player title "" with subtitle "&c&lInvasion is over!" for 10 seconds with 2 seconds fade in and 2 seconds fade out
  1992. broadcast "&8[&9War&8] &6%{_c}%&7's invasion against &6%{_c2}% &7is over!"
  1993. loop all players:
  1994. set {_i.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  1995. if {_i.%loop-player%} is equal to "%{_c2}%":
  1996. send "&8[&9War&8] &6%{_c}%&7's invasion against your {@p} is over!" to loop-player
  1997. set {_wp} to {_wp} parsed as number
  1998. set {_wp2} to {_wp2} parsed as number
  1999. set {_wp} to 0
  2000. set {_wp2} to 0
  2001. set yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml" to "%{_wp}%"
  2002. set yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml" to "%{_wp2}%"
  2003. remove "%{_c2}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
  2004. remove "%{_c}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c2}%.yml"
  2005. remove "%{_c2}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
  2006. remove "%{_c}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c2}%.yml"
  2007. on join:
  2008. set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
  2009. set yaml value "Userdata.Username" from "../../Factions/Userdata/%uuid of player%.yml" to "%player%"
  2010. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2011. if {_c} is not set:
  2012. set player tab name to "&e%player%"
  2013. else:
  2014. set player tab name to "&6%{_c}% &e%player%"
  2015.  
  2016. on chat:
  2017. player is in "{@world}"
  2018. cancel event
  2019. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2020. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  2021. if {_c} is set:
  2022. set {_chat} to yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml"
  2023. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2024. if {_chat} is "Ally":
  2025. loop {_a::*}:
  2026. set {_clan} to loop-value
  2027. loop all players:
  2028. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  2029. if {_c2.%loop-player%} is equal to "%{_clan}%":
  2030. send "&2%{_c}% %player% &a%message%" to loop-player
  2031. loop all players:
  2032. set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  2033. if {_c3.%loop-player%} is equal to "%{_c}%":
  2034. send "&2%{_c}% %player% &a%message%" to loop-player
  2035. if {_chat} is "Clan":
  2036. loop all players:
  2037. set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  2038. if {_c2.%loop-player%} is equal to "%{_c}%":
  2039. send "&b%player% &3%message%" to loop-player
  2040. if {_chat} is "Public":
  2041. loop all players:
  2042. loop-player is in "{@world}"
  2043. set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  2044. if {_c.%loop-player%} is "%{_c}%":
  2045. if {_r} is "Leader" or "Officer":
  2046. send "&3%{_c}% &7[&3%{_r}%&7] &b%player% &f%message%" to loop-player
  2047. else:
  2048. send "&3%{_c}% &b%player% &f%message%" to loop-player
  2049. else:
  2050. loop {_a::*}:
  2051. set {_c.%loop-player-1%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player-1%.yml"
  2052. if {_c.%loop-player-1%} is loop-value-2:
  2053. set {_confirm.%loop-player-1%} to true
  2054. if {_r} is "Leader" or "Officer":
  2055. if {_confirm.%loop-player%} is true:
  2056. send "&2%{_c}% &7[&2%{_r}%&7] &a%player% &f%message%" to loop-player-1
  2057. else:
  2058. send "&6%{_c}% &7[&6%{_r}%&7] &e%player% &f%message%" to loop-player-1
  2059. else:
  2060. if {_confirm.%loop-player%} is true:
  2061. send "&2%{_c}% &a%player% &f%message%" to loop-player-1
  2062. else:
  2063. send "&6%{_c}% &e%player% &f%message%" to loop-player-1
  2064. else:
  2065. send "&e%player% &f%message%" to all players in "{@world}"
  2066.  
  2067. on any movement:
  2068. player is in "{@world}"
  2069. set {_chunk} to player's chunk
  2070. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2071. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2072. set {_m} to yaml value "Userdata.Territory" from "../../Factions/Userdata/%uuid of player%.yml"
  2073. if {_c} is set:
  2074. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2075. if {_m} is not set:
  2076. set yaml value "Userdata.Territory" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_t}%"
  2077. if {_t} is not set:
  2078. set {_t} to "Wilderness"
  2079. if {_t} is not {_m}:
  2080. set yaml value "Userdata.Territory" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_t}%"
  2081. if {_t} is equal to {_c}:
  2082. send player title "" with subtitle "&b%{_t}%" for 5 seconds
  2083. send "&8&9Territory&8] &b%{_t}%"
  2084. else:
  2085. if {_t} is not equal to "Wilderness":
  2086. if {_a::*} contains "%{_t}%":
  2087. send player title "" with subtitle "&a%{_t}%" for 5 seconds
  2088. send "&8[&9Territory&8] &a%{_t}%"
  2089. else:
  2090. if {_t} is not equal to "(Safe) Spawn" or "(Safe) Shop":
  2091. send player title "" with subtitle "&6%{_t}%" for 5 seconds
  2092. send "&8[&9Territory&8] &6%{_t}%"
  2093. else:
  2094. if {_t} is "(Safe) Spawn":
  2095. send player title "" with subtitle "&f(&bSafe&f) &bSpawn" for 5 seconds
  2096. send "&8[&9Territory&8] &f(&bSafe&f) &bSpawn"
  2097. if {_t} is "(Safe) Shop":
  2098. send player title "" with subtitle "&f(&bSafe&f) &bShop" for 5 seconds
  2099. send "&8[&9Territory&8] &f(&bSafe&f) &bShop"
  2100. else:
  2101. send player title "" with subtitle "&7Wilderness" for 5 seconds
  2102. send "&8[&9Territory&8] &7Wilderness"
  2103. UpdateScoreBoard(player)
  2104.  
  2105. on break:
  2106. event-block is not bed
  2107. player is in "{@world}"
  2108. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2109. replace all "@" with "&" in {_prefix}
  2110. set {_prefix} to coloured {_prefix}
  2111. set {_chunk} to chunk at event-block's location
  2112. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2113. if {_c} is set:
  2114. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  2115. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2116. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2117. if {_t} is set:
  2118. if {_t} is equal to "%{_c}%":
  2119. if {_r} is "Member":
  2120. cancel event
  2121. send "%{_prefix}% &7You must be &6Member &7or higher role to have access to break blocks."
  2122. if {_r} is "Trusted" or "Officer" or "Leader":
  2123. uncancel event
  2124. else:
  2125. if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
  2126. set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
  2127. if {_wp} is "Invading":
  2128. uncancel event
  2129. else:
  2130. cancel event
  2131. if {_a::*} contains "%{_t}%":
  2132. message "%{_prefix}% &7You can't break blocks at &a%{_t}%&7's Territory!"
  2133. else:
  2134. send "%{_prefix}% &7You can't break blocks at &6%{_t}%&7's Territory!"
  2135. else:
  2136. if player has permission "{@perm1}":
  2137. uncancel event
  2138. else:
  2139. cancel event
  2140.  
  2141. on break of bed:
  2142. player is in "{@world}"
  2143. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2144. replace all "@" with "&" in {_prefix}
  2145. set {_prefix} to coloured {_prefix}
  2146. set {_chunk} to chunk at event-block's location
  2147. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2148. if {_c} is set:
  2149. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  2150. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2151. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2152. if {_t} is set:
  2153. set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_t}%.yml"
  2154. set {_h2} to yaml value "Faction.Home2" from "../../Factions/Factions/%{_t}%.yml"
  2155. if block at {_h}'s location is bed:
  2156. set {_confirm} to true
  2157. if block at {_h2}'s location is bed:
  2158. set {_confirm} to true
  2159. if {_confirm} is true:
  2160. if {_t} is equal to "%{_c}%":
  2161. if {_r} is "Officer" or "Leader":
  2162. uncancel event
  2163. delete yaml value "Faction.Home" from "../../Factions/Factions/%{_t}%.yml"
  2164. delete yaml value "Faction.Home2" from "../../Factions/Factions/%{_t}%.yml"
  2165. send "%{_prefix}% &7You removed your {@p} home bed!"
  2166. else:
  2167. cancel event
  2168. send "%{_prefix}% &7You can't break your {@p} home bed!"
  2169. else:
  2170. if {_a::*} contains "%{_t}%":
  2171. send "%{_prefix}% &7You can't break your ally home bed!"
  2172. cancel event
  2173. else:
  2174. uncancel event
  2175. delete yaml value "Faction.Home" from "../../Factions/Factions/%{_t}%.yml"
  2176. send "%{_prefix}% &7You have destroyed &e%{_t}%&7's {@p} home bed!"
  2177. loop all players:
  2178. set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
  2179. if {_c.%loop-player%} is equal to {_t}:
  2180. send "%{_prefix}% &e%player% &7has destroyed your {@p} home bed!" to loop-player
  2181. on place:
  2182. player is in "{@world}"
  2183. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2184. replace all "@" with "&" in {_prefix}
  2185. set {_prefix} to coloured {_prefix}
  2186. set {_chunk} to chunk at event-block's location
  2187. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2188. if {_c} is set:
  2189. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  2190. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2191. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2192. if {_t} is set:
  2193. if {_t} is equal to "%{_c}%":
  2194. if {_r} is "Member":
  2195. cancel event
  2196. send "%{_prefix}% &7You must be a &6Member &7or higher role to have access to place blocks."
  2197. if {_r} is "Trusted" or "Officer" or "Leader":
  2198. uncancel event
  2199. else:
  2200. if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
  2201. set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
  2202. if {_wp} is "Invading":
  2203. uncancel event
  2204. else:
  2205. cancel event
  2206. if {_a::*} contains "%{_t}%":
  2207. message "%{_prefix}% &7You can't place blocks at &a%{_t}%&7's Territory!"
  2208. else:
  2209. send "%{_prefix}% &7You can't place blocks at &6%{_t}%&7's Territory!"
  2210. else:
  2211. if player has permission "{@perm1}":
  2212. uncancel event
  2213. else:
  2214. cancel event
  2215.  
  2216. on rightclick on door or lever or crafting table or button:
  2217. player is in "{@world}"
  2218. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2219. replace all "@" with "&" in {_prefix}
  2220. set {_prefix} to coloured {_prefix}
  2221. set {_chunk} to chunk at event-block's location
  2222. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2223. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2224. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2225. if {_t} is set:
  2226. if {_t} is equal to "%{_c}%":
  2227. uncancel event
  2228. else:
  2229. if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
  2230. set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
  2231. if {_wp} is "Invading":
  2232. uncancel event
  2233. else:
  2234. cancel event
  2235. if {_a::*} contains "%{_t}%":
  2236. message "%{_prefix}% &7You can't do that at &a%{_t}%&7's Territory!"
  2237. else:
  2238. send "%{_prefix}% &7You can't do that at &6%{_t}%&7's Territory!"
  2239. else:
  2240. if player has permission "{@perm1}":
  2241. uncancel event
  2242. else:
  2243. cancel event
  2244.  
  2245. on rightclick on furnace:
  2246. player is in "{@world}"
  2247. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2248. replace all "@" with "&" in {_prefix}
  2249. set {_prefix} to coloured {_prefix}
  2250. set {_chunk} to chunk at event-block's location
  2251. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2252. if {_c} is set:
  2253. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  2254. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2255. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2256. if {_t} is set:
  2257. if {_t} is equal to "%{_c}%":
  2258. if {_r} is "Member":
  2259. cancel event
  2260. send "%{_prefix}% &7You must be &6Recruit+ &7or higher role to access the furnaces."
  2261. if {_r} is "Trusted" or "Officer" or "Leader":
  2262. uncancel event
  2263. else:
  2264. if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
  2265. set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
  2266. if {_wp} is "Invading":
  2267. uncancel event
  2268. else:
  2269. cancel event
  2270. if {_a::*} contains "%{_t}%":
  2271. message "%{_prefix}% &7You can't break blocks at &a%{_t}%&7's Territory!"
  2272. else:
  2273. send "%{_prefix}% &7You can't break blocks at &6%{_t}%&7's Territory!"
  2274. else:
  2275. if player has permission "{@perm1}":
  2276. uncancel event
  2277. else:
  2278. cancel event
  2279.  
  2280. on rightclick on chest:
  2281. player is in "{@world}"
  2282. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2283. replace all "@" with "&" in {_prefix}
  2284. set {_prefix} to coloured {_prefix}
  2285. set {_chunk} to chunk at event-block's location
  2286. set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
  2287. if {_c} is set:
  2288. set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
  2289. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
  2290. set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
  2291. if {_t} is set:
  2292. if {_t} is equal to "%{_c}%":
  2293. if {_r} is "Member":
  2294. cancel event
  2295. send "%{_prefix}% &7You must be &6Recruit+ &7or higher role to access the chests."
  2296. if {_r} is "Trusted" or "Officer" or "Leader":
  2297. uncancel event
  2298. else:
  2299. if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
  2300. set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
  2301. if {_wp} is "Invading":
  2302. uncancel event
  2303. else:
  2304. cancel event
  2305. if {_a::*} contains "%{_t}%":
  2306. message "%{_prefix}% &7You can't do that at &a%{_t}%&7's Territory!"
  2307. else:
  2308. send "%{_prefix}% &7You can't do that at &6%{_t}%&7's Territory!"
  2309. else:
  2310. if player has permission "{@perm1}":
  2311. uncancel event
  2312. else:
  2313. cancel event
  2314.  
  2315. on damage of a player:
  2316. attacker is a player
  2317. attacker is in "{@world}"
  2318. victim is a player
  2319. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2320. replace all "@" with "&" in {_prefix}
  2321. set {_prefix} to coloured {_prefix}
  2322. set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of attacker%.yml"
  2323. set {_t2} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of victim%.yml"
  2324. if {_t} or {_t2} is equal to "(Safe) Spawn" or "(Safe) Shop Spawn":
  2325. cancel event
  2326. send "%{_prefix}% &7You can't harm &6%victim%&7 at this Territory." to attacker
  2327.  
  2328. on death:
  2329. victim is player
  2330. {@death_messages} is true
  2331. if attacker is set:
  2332. set the death message to "&8[&9Death&8] &e%victim% &7was killed by &e%attacker%&7."
  2333. else:
  2334. set the death message to "&8[&9Death&8] &e%victim% &7died."
  2335.  
  2336. on join:
  2337. player has permission "{@perm1}":
  2338. wait 2 seconds
  2339. set {_updater} to yaml value "updater" from "../../Factions/config.yml"
  2340. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2341. replace all "@" with "&" in {_prefix}
  2342. set {_prefix} to coloured {_prefix}
  2343. if {_updater} is true:
  2344. if text from "http://pastebin.com/raw/w1myAT35" is not equal to "{@version}":
  2345. set {_ver} to text from "http://pastebin.com/raw/w1myAT35"
  2346. send "%{_prefix}% &6Found new version: &a%{_ver}%."
  2347. send "&bCurrent Version: &c{@version}."
  2348. send "&6Please update it in: &bhttp://adf.ly/1aqozz"
  2349. else:
  2350. stop
  2351.  
  2352. on load:
  2353. set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
  2354. replace all "@" with "&" in {_prefix}
  2355. set {_prefix} to coloured {_prefix}
  2356. send "&8[&bCLANS&8] &aClans &e{@version} &ahas been enabled!" to console
  2357. wait 1 second
  2358. set {_updater} to yaml value "updater" from "../../Factions/config.yml"
  2359. if {_updater} is true:
  2360. if text from "http://pastebin.com/raw/w1myAT35" is not equal to "{@version}":
  2361. set {_ver} to text from "http://pastebin.com/raw/w1myAT35"
  2362. send "%{_prefix}% &6Found new version: &a%{_ver}%." to console
  2363. send "&bCurrent Version: &c{@version}." to console
  2364. send "&6Please update it in: &bhttp://adf.ly/1aqozz" to console
  2365. else:
  2366. stop
  2367.  
  2368. every 10 seconds:
  2369. set {_load} to false
  2370. if yaml value "version" from "../../Factions/config.yml" is not set:
  2371. set {_load} to true
  2372. if yaml value "prefix" from "../../Factions/config.yml" is not set:
  2373. set {_load} to true
  2374. if yaml value "settings-prefix" from "../../Factions/config.yml" is not set:
  2375. set {_load} to true
  2376. if yaml value "scoreboard.title" from "../../Factions/config.yml" is not set:
  2377. set {_load} to true
  2378. if yaml list "scoreboard.clan" from "../../Factions/config.yml" is not set:
  2379. set {_load} to true
  2380. if yaml list "scoreboard.noclan" from "../../Factions/config.yml" is not set:
  2381. set {_load} to true
  2382. if yaml value "countdown-home" from "../../Factions/config.yml" is not set:
  2383. set {_load} to true
  2384. if yaml value "prefix" from "../../Factions/config.yml" is not set:
  2385. set {_load} to true
  2386. if yaml value "maxplayers" from "../../Factions/config.yml" is not set:
  2387. set {_load} to true
  2388. if yaml value "maxterritories" from "../../Factions/config.yml" is not set:
  2389. set {_load} to true
  2390. if yaml value "maxallies" from "../../Factions/config.yml" is not set:
  2391. set {_load} to true
  2392. if yaml value "territory-costs" from "../../Factions/config.yml" is not set:
  2393. set {_load} to true
  2394. if yaml value "updater" from "../../Factions/config.yml" is not set:
  2395. set {_load} to true
  2396. if {_load} is true:
  2397. broadcast "&8[&bCLANS&8] &bUh oh! config.yml has missing setting(s)!"
  2398. broadcast "&8[&bCLANS&8] &bWe'll repair it for you."
  2399. execute console command "sk reload %script%"
  2400. broadcast "&8[&bCLANS&8] &bSuccessfully repaired all missing settings."
Add Comment
Please, Sign In to add comment