FrostedWeFall

FactionsSK

Feb 18th, 2018
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 88.45 KB | None | 0 0
  1. #HCFactions by Forbi
  2. # 1.5
  3. #
  4. # - added auto delete inactive factions
  5. # - new function "FactionDisband"
  6. # - changes on how im saving: ally/truce/perms
  7. # - change usege of /f perm:
  8. # "Usage: /f perms AllyName Permission"
  9. # - fixed ally permissions (wans't working, since bad copy/paste)
  10.  
  11. options:
  12. #World where you can claim lands
  13. W: "F" or "insert-another-world-if-you-need"
  14. I: jungle door block or birch door block or dark oak door block or acacia door block or oak door block or acacia fence gate or birch fence gate or jungle fence gate or dark oak fence gate or oak fence gate or spruce fence gate or enchantment table or furnace or brewing stand or beacon or _lever or spruce door block or oak trapdoor or hopper or stone button or wooden button or dispenser or _anvil or trapped_chest
  15. stash: chest or trapped_chest
  16. #Use chat system: true or false
  17. ChatSystem: true
  18. #Factions prefix, yes double quotes
  19. Prefix: ""&6[&9Forbidden HCF&6]""
  20. #
  21. #how much must a player waits beofre they get teleport to the factions home
  22. fhome-delay: 10
  23. #
  24. # DTR STUFF
  25. #
  26. #the max amount of dtr a faction may have
  27. max-dtr: 5.5
  28. #the minimun amount of dtr
  29. min-dtr: -5.5
  30. #how much a player increments the max dtr of a faction
  31. player-dtr: 0.51
  32. #max dtr of a faction with 1 player
  33. solo-faction: 1.01
  34. #dtr freeze in seconds:
  35. dtr-freeze: 3600
  36. #you know..
  37. kick-penalty: 0.51
  38. #you know..
  39. death-dtr: 1.0
  40. #How much a faction wins per minute and per player
  41. minute-dtr: 0.01
  42. #
  43. #LAND STUFF
  44. #
  45. faction-land-max: 36
  46. # How much land a faction gets per member
  47. land-per-player: 6
  48. #should players be able to claim on WG regions? false=no / true=yes
  49. wgchek: false
  50. #
  51. #
  52. ally-fire: false
  53. faction-fire: false
  54. truce-fire: false
  55. #
  56. #
  57. max-ally: 1
  58. #Max-truce
  59. max-truce: 0
  60. #can ally place block in your land?
  61. ally-break: "no"
  62. #can ally break block in your land?
  63. ally-place: "no"
  64. #can interact with your stuff? Chests, pistions, restones stuff, etc?
  65. ally-interact: "no"
  66. #Can an ally sethome in your land?
  67. ally-sethome: "no"
  68. #
  69. ally-chest: "no"
  70. #
  71. #Max amount of player per faction
  72. fac-maxplayers: 30
  73. #
  74. # After how many dyas (default 30 days) of inactivity should a faction be deleted
  75. delete-faction-after: 30
  76.  
  77. function FactionDtr(F: text):
  78. if {x_factions_FAC::factions::%{_F}%::dtr} is less than 0:
  79. set {x_factions_FAC::factions::%{_F}%::dtr.raideable} to true
  80. else:
  81. set {x_factions_FAC::factions::%{_F}%::dtr.raideable} to false
  82.  
  83. function FactionTag(t: text):
  84. make all players see all players's prefix as "&c"
  85. loop all players:
  86. set {_F} to {x_factions_FAC::players::%uuid of loop-player%.faction}
  87. #TAG FACTIONS
  88. if {_F} isn't "wilder":
  89. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  90. make player from uuid loop-value-2 see loop-value-1's prefix as "&2"
  91. if {x_factions_FAC::factions::%{_F}%::ally::*} isn't empty:
  92. loop {x_factions_FAC::factions::%{_F}%::ally::*}:
  93. set {_ally} to loop-value-2
  94. loop {x_factions_FAC::factions::%{_ally}%::players::*}:
  95. make player from uuid loop-value-3 see loop-value-1's prefix as "&d"
  96.  
  97. function FactionDisband(F: text):
  98. #brak ally
  99. if {x_factions_FAC::factions::%{_F}%::ally::*} isn't empty:
  100. loop {x_factions_FAC::factions::%{_F}%::ally::*}:
  101. #remove permissions
  102. delete {x_factions_FAC::factions::%{_F}%::ally::%loop-value-1%::*}
  103. delete {x_factions_FAC::factions::%loop-value-1%::ally::%{_F}%::*}
  104. #delete relation
  105. delete {x_factions_FAC::factions::%{_F}%::ally::%loop-value-1%}
  106. delete {x_factions_FAC::factions::%loop-value-1%::ally::%{_F}%}
  107. #break truce
  108. if {x_factions_FAC::factions::%{_F}%::truce::*} isn't empty:
  109. loop {x_factions_FAC::factions::%{_F}%::truce::*}:
  110. delete {x_factions_FAC::factions::%{_F}%::truce::%loop-value-1%}
  111. delete {x_factions_FAC::factions::%loop-value-1%::truce::%{_F}%}
  112.  
  113. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  114. set {x_factions_FAC::players::%loop-value%.faction} to "wilder" #Make him a wilder
  115. set {x_factions_FAC::players::%loop-value%.chat} to 1 #Force chat channel
  116.  
  117. loop {x_factions_FAC::factions::%{_F}%::lands::*}:
  118. delete {x_factions_FAC::chunks::%loop-value%.owner}
  119. delete {x_factions_FAC::chunks::%loop-value%}
  120. delete {x_factions_FAC::factions::%{_F}%.owner}
  121. delete {x_factions_FAC::factions::%{_F}%::*}
  122. delete {x_factions_FAC::factions::%{_F}%}
  123.  
  124. function FactionShow(F: text, p: player):
  125. set {_owner} to {x_factions_FAC::factions::%{_F}%::owner}
  126. if {x_factions_FAC::nombre::%{_owner}%} is set:
  127. set {_owner} to {x_factions_FAC::nombre::%{_owner}%}
  128. else:
  129. set {_owner} to player from uuid {x_factions_FAC::factions::%{_F}%::owner}
  130. set {_offline} to 0
  131. set {_online} to 0
  132. set {_lands} to 0
  133. set {_players} to 0
  134. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  135. set {_check} to loop-value
  136. set {_check} to player from uuid {_check}
  137. if {x_factions_FAC::nombre::%loop-value%} is set:
  138. if {_check} is online:
  139. set {_online} to {_online}+1
  140. if {_jugadoresonline} isn't set:
  141. set {_jugadoresonline} to "&2%{x_factions_FAC::nombre::%loop-value%}%"
  142. else:
  143. set {_jugadoresonline} to "%{_jugadoresonline}%&f, &2%{x_factions_FAC::nombre::%loop-value%}%"
  144. else:
  145. if {_jugadoresonline} isn't set:
  146. set {_jugadoresonline} to "&c%{x_factions_FAC::nombre::%loop-value%}%"
  147. else:
  148. set {_jugadoresonline} to "%{_jugadoresonline}%&f, &c%{x_factions_FAC::nombre::%loop-value%}%"
  149. else:
  150. set {_check} to player from uuid {_check}
  151. if {_check} is online:
  152. set {_online} to {_online}+1
  153. if {_jugadoresonline} isn't set:
  154. set {_jugadoresonline} to "&2%player from uuid loop-value%"
  155. else:
  156. set {_jugadoresonline} to "&2%{_jugadoresonline}%&f, &2%player from uuid loop-value%"
  157.  
  158. set {_offline} to {_offline}+1
  159. #amount of players
  160. set {_players} to {_players}+1
  161. #dtr stuff
  162. set {_jugadores} to {_jugadores}+1
  163. if {_jugadores} is more than 1:
  164. set {_maxfactiondtr} to ({_jugadores} - 1) * {@player-dtr} + {@solo-faction}
  165. else:
  166. set {_maxfactiondtr} to {@solo-faction}
  167. if {_jugadoresonline} isn't set:
  168. set {_jugadoresonline} to " &cNo hay jugadores online"
  169. if {x_factions_FAC::factions::%{_F}%::home} is set:
  170. set {_home} to {x_factions_FAC::factions::%{_F}%::home}
  171. else:
  172. set {_home} to "No home"
  173.  
  174. set {_dtr} to {x_factions_FAC::factions::%{_F}%::dtr}
  175.  
  176. if {x_factions_FAC::factions::%{_F}%::dtr.freeze} > now:
  177. set {_freeze} to "Yes"
  178. set {_until} to difference between {x_factions_FAC::factions::%{_F}%::dtr.freeze} and now
  179. set {_icono} to ""
  180. else:
  181. set {_freeze} to "no"
  182. set {_icono} to "&2▲"
  183.  
  184. set {_lands} to size of {x_factions_FAC::factions::%{_F}%::lands::*}
  185. set {_maxlands} to {_players}*{@land-per-player}
  186. if {_maxlands} is greater than {@faction-land-max}:
  187. set {_maxlands} to {@faction-land-max}
  188.  
  189. if {x_factions_FAC::factions::%{_F}%::ally::*} isn't empty:
  190. loop {x_factions_FAC::factions::%{_F}%::ally::*}:
  191. if {_ally} isn't set:
  192. set {_ally} to "&2%loop-value-1%"
  193. else:
  194. set {_ally} to "&2%{_ally}%&f, &2%loop-value-1%"
  195. else:
  196. set {_ally} to "None"
  197.  
  198. if {x_factions_FAC::factions::%{_F}%::truce::*} isn't empty:
  199. loop {x_factions_FAC::factions::%{_F}%::truce::*}:
  200. if {_truce} isn't set:
  201. set {_truce} to "&2%loop-value-1%"
  202. else:
  203. set {_truce} to "&2%{_ally}%&f, &2%loop-value-1%"
  204. else:
  205. set {_truce} to "None"
  206.  
  207. send "&6----------&9ForbiddenHCF&6----------" to {_p}
  208. send "&9Faction: &b%{_F}% &9Owner: &c%{_owner}%" to {_p}
  209. #send "" to {_p}
  210. send "&9Players: &a%{_online}% &8/ &c%{_offline}%" to {_p}
  211. send "&9DTR: &2%{_icono}%&a%{_dtr}%&8 / &c%{_maxfactiondtr}%" to {_p}
  212. send "&9Faction Home: &b%{_home}%" to {_p}
  213. send "&9Land: &a%{_lands}% &8/ &c%{_maxlands}%" to {_p}
  214. if {_freeze} is "Yes":
  215. send "&9DTR Freeze: &b%{_until}%" to {_p}
  216. else:
  217. send "&9&lDTR Freeze: &b%{_freeze}%" to {_p}
  218. send "&9Ally: &b%{_ally}%" to {_p}
  219. send "&9Truce: &b%{_truce}%" to {_p}
  220. send "&9Players: &2%{_jugadoresonline}%" to {_p}
  221. send "&6--------------------------------" to {_p}
  222.  
  223. command clear-factions:
  224. permission: skript.factionsk.danger
  225. trigger:
  226. delete {x_factions_FAC::*}
  227. delete {FAC.chatsystem}
  228. broadcast "&4&lDeleted all variables from FactionsSk"
  229.  
  230. command f [<text>] [<text>] [<text>] [<text>]:
  231. trigger:
  232. if arg-1 is "create":
  233. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  234. send "%{@Prefix}% &7You are alredy in a faction"
  235. stop
  236. else:
  237. if arg-2 is set:
  238. set {_l} to length of the arg-2
  239. if {_l} is less than 4:
  240. send "%{@Prefix}% &7The faction name needs at leat 3 characters"
  241. stop
  242. if {_l} is more than 13:
  243. send "%{@Prefix}% &7The faction name can't have more than 13 characters"
  244. stop
  245. else:
  246. if {x_factions_FAC::factions::%arg-2%} is set:
  247. send "%{@Prefix}% &7There is a faction named: &c%arg-2%"
  248. stop
  249. else:
  250. set {x_factions_FAC::factions::%arg-2%} to arg-2 #creo la fction
  251. set {x_factions_FAC::factions::%arg-2%::owner} to uuid of player #due??e la faction
  252. set {x_factions_FAC::factions::%arg-2%::mods::%uuid of player%} to uuid of player #due??e la faction
  253. set {x_factions_FAC::factions::%arg-2%::dtr} to 0 #dtr de la faction
  254. set {x_factions_FAC::factions::%arg-2%::players::%uuid of player%} to uuid of player
  255. set {x_factions_FAC::factions::%arg-2%::dtr.raideable} to false
  256. set {x_factions_FAC::players::%uuid of player%.faction} to arg-2 #faction del jugador
  257. set {x_factions_FAC::factions::%arg-2%::dtr.freeze} to now
  258. subtract 1 second from {x_factions_FAC::factions::%arg-2%::dtr.freeze}
  259. set {x_factions_FAC::factions::%arg-2%::lastactivicty} to now
  260. set {x_factions_FAC::factions::%arg-2%::officer::%uuid of player%} to uuid of player #due??e la faction
  261. add {@delete-faction-after} days to {x_factions_FAC::factions::%arg-2%::lastactivicty}
  262.  
  263. send "%{@Prefix}% &7Faction made: %arg-2%"
  264. broadcast "%{@Prefix}% &c%player%&7 made the faction &c%arg-2%"
  265. FactionTag("call")
  266. stop
  267. else:
  268. send "%{@Prefix}% &7The faction name can't be empty"
  269. stop
  270. #/f invite {player} [invite a player to join your faction]
  271. if arg-1 is "invite":
  272. if {x_factions_FAC::players::%uuid of player%.faction} is "wilder":
  273. send "%{@Prefix}% &7You need a faction to use this command"
  274. stop
  275. else:
  276. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  277. if size of {x_factions_FAC::factions::%{_F}%::players::*} > {@fac-maxplayers}-1:
  278. send "%{@Prefix}% &7Your faction reached the max amount of player per faction"
  279. stop
  280. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  281. if arg-2 is set:
  282. set {_l} to length of the arg-2
  283. if {_l} is more than 16:
  284. send "%{@Prefix}% &7Incorrect player name"
  285. stop
  286. else:
  287. if arg-2 parsed as player is online:
  288. set {_p} to uuid of arg-2 parsed as player
  289. if {x_factions_FAC::players::%{_p}%.faction} isn't "wilder":
  290. send "%{@Prefix}% &c%arg-2% &7is already in a faction"
  291. stop
  292. else:
  293. send "%{@Prefix}% &c%player% &7invites you to join &c%{x_factions_FAC::players::%uuid of player%.faction}%" to player from uuid {_p}
  294. send "%{@Prefix}% &7Use &a/f join &c%player% &7to join " to player from uuid {_p}
  295. set {x_factions_FAC::players::%{_p}%.invitaciones::%{_F}%} to {_F} #guardo listado de que faction fue invitado
  296. send "%{@Prefix}% &7You invited &c%arg-2% &7to join your faction"
  297. stop
  298. else:
  299. send "%{@Prefix}% &7The player must be online"
  300. stop
  301. else:
  302. send "%{@Prefix}% &7You must specify a player"
  303. stop
  304. else:
  305. send "%{@Prefix}% &7Only mods can invite other players to the faction"
  306. stop
  307.  
  308. #/f deinvite {player} [cancel a player request ]
  309. if arg-1 is "deinvite":
  310. if {x_factions_FAC::players::%uuid of player%.faction} isn't set:
  311. send "%{@Prefix}% &7You need a faction to use this command"
  312. stop
  313. else:
  314. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  315. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  316. if arg-2 is set:
  317. set {_l} to length of the arg-2
  318. if {_l} is more than 16:
  319. send "%{@Prefix}% &7Incorrect player name"
  320. stop
  321. else:
  322. if arg-2 parsed as player is online:
  323. set {_p} to uuid of arg-2 parsed as player
  324. if {x_factions_FAC::players::%{_p}%.invitaciones::%{_F}%} is set:
  325. send "%{@Prefix}% &7You deinvited &c%{_p}%" to player
  326. delete {x_factions_FAC::players::%{_p}%.invitaciones::%{_F}%} #guardo listado de que faction fue invitado
  327. stop
  328. else:
  329. send "%{@Prefix}%&c%{_p}% &7wasn't invited to your faction" to player
  330. stop
  331. else:
  332. send "%{@Prefix}% &7The player must be online"
  333. stop
  334. else:
  335. send "%{@Prefix}% &7You must specify a player"
  336. stop
  337. else:
  338. send "%{@Prefix}% &7Only mods can invite other players to the faction"
  339. stop
  340.  
  341. #/f join {factionname} or {request_sender} [join the player to a faction]
  342. if arg-1 is "join":
  343. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  344. send "%{@Prefix}% &7You are already in a faction"
  345. stop
  346. else:
  347. if arg-2 is set:
  348. set {_l} to length of the arg-2
  349. if {_l} is more than 16:
  350. send "%{@Prefix}% &7The name must contain at least 3 characters"
  351. stop
  352. else:
  353. if arg-2 parsed as player is online:
  354. set {_p} to uuid of arg-2 parsed as player
  355. set {_p} to {x_factions_FAC::players::%{_p}%.faction}
  356. else:
  357. set {_p} to arg-2
  358.  
  359. if {x_factions_FAC::players::%uuid of player%.invitaciones::%{_p}%} isn't set:
  360. send "%{@Prefix}% &c%arg-2% &7didn't invted you to &c%{_p}%"
  361. stop
  362. else:
  363. if size of {x_factions_FAC::factions::%{_p}%::players::*} > {@fac-maxplayers}-1:
  364. send "%{@Prefix}% &7That faction reached the max amount of player per faction :("
  365. stop
  366. set {x_factions_FAC::players::%uuid of player%.faction} to {_p} #agrego el usuario a la faction
  367. set {x_factions_FAC::factions::%{_p}%::players::%uuid of player%} to uuid of player
  368. loop {x_factions_FAC::factions::%{_p}%::players::*}:
  369. send "%{@Prefix}% &c%player% &7joined the faction" to player from uuid loop-value
  370. send "%{@Prefix}% &7You are now part of the faction"
  371. delete {x_factions_FAC::players::%uuid of player%.invitaciones::*} #elimino invitaciones pendientes del usuario
  372. FactionTag("call")
  373. stop
  374. else:
  375. send "%{@Prefix}% &7You must specify a player name or a faction"
  376. stop
  377.  
  378. #/f unclaim {deletes a faction chunk}
  379. if arg-1 is "unclaim":
  380. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  381. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  382. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  383. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  384. set {_chunk} to chunk at player's location
  385. if {x_factions_FAC::chunks::%chunk at player's location%.owner} is {_F}:
  386. delete {x_factions_FAC::chunks::%{_chunk}%.owner}
  387. delete {x_factions_FAC::chunks::%{_chunk}%}
  388. delete {x_factions_FAC::factions::%{_F}%::lands::%{_chunk}%}
  389. send "%{@Prefix}% &7You unclaimed this chunk"
  390. stop
  391. else:
  392. send "%{@Prefix}% &7You can only use this command on your land"
  393. stop
  394. else:
  395. send "%{@Prefix}% &7You must be the owner to unclaim"
  396. stop
  397. else:
  398. send "%{@Prefix}% &7You must be a mod to unclaim"
  399. stop
  400. else:
  401. send "%{@Prefix}% &7You must have a faction to use this command "
  402. stop
  403.  
  404. #/F CLAIM {claim a chunk if there is no enemy land aroud and if the chunk is contiguous to the one already claimed by the faction}
  405. if arg-1 is "claim":
  406. if player's world is {@W}:
  407. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  408. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  409. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  410. set {_players} to size of {x_factions_FAC::factions::%{_F}%::players::*}
  411. set {_maxlands} to {_players}*{@land-per-player}
  412. if {_maxlands} is greater than {@faction-land-max}:
  413. set {_maxlands} to {@faction-land-max}
  414. set {_lands} to size of {x_factions_FAC::factions::%{_F}%::lands::*}
  415. if {_lands} is {_maxlands}:
  416. send "%{@Prefix}% &7You can't claim more lands, you may need more players or you reached the max amount of lands per factions"
  417. stop
  418. if {@wgchek} is false:
  419. set {_region} to "%region at player%"
  420. if {_region} isn't "<none>":
  421. send "%{@Prefix}% &7You can't claim on this region!"
  422. stop
  423. #If I found an enemy land to close to the current chunk, I will stop the claim asap.
  424. if {x_factions_FAC::chunks::%chunk at player's location%} isn't set:
  425. #Primero busco enemigos a la redonda
  426. set {_center} to player's location#location you want to loop the chunks around
  427. set {_radius} to 1#radius (in chunks), if it is set to 0 it returns only the chunk at {_center}
  428. set {_pos} to {_center}
  429. loop 2 * {_radius} + 1 times:
  430. set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius} + (loop-number - 1) * 16
  431. set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius}
  432. loop 2 * {_radius} + 1 times:
  433. set {_chunks::%{_pos}%} to chunk at {_pos}
  434. add 16 to z-coordinate of {_pos}
  435. #comienzo buscar enemigos
  436. loop {_chunks::*}:
  437. if {x_factions_FAC::chunks::%loop-value-1%.owner} is "&4WarZone":
  438. send "%{@Prefix}% &7This chunk is too close from the &4WarZone"
  439. stop
  440. if {x_factions_FAC::chunks::%loop-value-1%} is set:
  441. if {x_factions_FAC::chunks::%loop-value-1%.owner} isn't {_F}:
  442. send "%{@Prefix}% &7This chunk is too close to an enemy land"
  443. stop
  444.  
  445. #If the faction owns a land already, I need to virify if the current chunk is contiguous to the other lands
  446. if {x_factions_FAC::factions::%{_F}%::lands::*} is set:
  447. set {_center} to player's location#location you want to loop the chunks around
  448. set {_radius} to 1 #radius (in chunks), if it is set to 0 it returns only the chunk at {_center}
  449. set {_pos} to {_center}
  450. loop 2 * {_radius} + 1 times:
  451. set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius} + (loop-number - 1) * 16
  452. set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius}
  453. loop 2 * {_radius} + 1 times:
  454. set {_x} to x-coordinate of {_center} - x-coordinate of {_pos}
  455. set {_z} to z-coordinate of {_center} - z-coordinate of {_pos}
  456. if ({_x} ^ 2 + {_z} ^ 2) <= ({_radius} * 16) ^ 2:
  457. set {_chunks2::%{_pos}%} to chunk at {_pos}
  458. add 16 to z-coordinate of {_pos}
  459. #Actually checking if the chunk is contiguous:
  460. set {_contiguo} to false
  461. loop {_chunks2::*}:
  462. if {x_factions_FAC::chunks::%loop-value-1%} is set:
  463. if {x_factions_FAC::chunks::%loop-value-1%.owner} is {_F}:
  464. set {_contiguo} to true
  465. else:
  466. #if they don't own any land, I don't care if the land is contiguous
  467. set {_contiguo} to true
  468.  
  469. if {_contiguo} is true:
  470. add the chunk at the player's location to {x_factions_FAC::chunks::%chunk at player's location%} #chunks calimeados
  471. set {x_factions_FAC::chunks::%chunk at player's location%} to chunk at player's location
  472. set {x_factions_FAC::chunks::%chunk at player's location%.owner} to {_F}
  473. add the chunk at the player's location to {x_factions_FAC::factions::%{_F}%::lands::%chunk at player's location%} #chunks de una factions
  474. set {x_factions_FAC::factions::%{_F}%::lands::%chunk at player's location%} to chunk at player's location
  475. send "%{@Prefix}% &7The land is now claimed by your faction!"
  476. stop
  477. else:
  478. send "%{@Prefix}% &7The land must be contiguous to your lands"
  479. stop
  480. else:
  481. send "%{@Prefix}% &7This is alredy claimed"
  482. stop
  483. else:
  484. send "%{@Prefix}% &7Only mods can claim land"
  485. stop
  486. else:
  487. send "%{@Prefix}% &7You must be in a faction to use this command"
  488. stop
  489. else:
  490. send "%{@Prefix}% &7You can't claim in this world"
  491. stop
  492.  
  493. #/f tag {text} [sets the new faction name]
  494. if arg-1 is "tag":
  495. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  496. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  497. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  498. if arg-2 is set:
  499. set {_l} to length of the arg-2
  500. if {_l} is less than 4:
  501. send "%{@Prefix}% &cThe name needs at least 3 characters"
  502. stop
  503. if {_l} is more than 13:
  504. send "%{@Prefix}% &7The faction name can't have more than 13 characters"
  505. stop
  506. else:
  507. if {x_factions_FAC::factions::%arg-2%} is set:
  508. send "%{@Prefix}% &c%arg-2% &7is in use"
  509. stop
  510. else:
  511. #Copy/Paste faction
  512. set {x_factions_FAC::factions::%arg-2%} to arg-2
  513. set {x_factions_FAC::factions::%arg-2%::owner} to {x_factions_FAC::factions::%{_F}%::owner}
  514. set {x_factions_FAC::factions::%arg-2%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}
  515. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  516. set {_p} to loop-value-1
  517. set {x_factions_FAC::factions::%arg-2%::players::%{_p}%} to {_p}
  518. set {x_factions_FAC::players::%{_p}%.faction} to arg-2
  519. loop {x_factions_FAC::factions::%{_F}%::mods::*}:
  520. set {_p} to loop-value-1
  521. set {x_factions_FAC::factions::%arg-2%::mods::%{_p}%} to {_p}
  522. set {x_factions_FAC::factions::%arg-2%::dtr.raideable} to {x_factions_FAC::factions::%{_F}%::dtr.raideable}
  523. set {x_factions_FAC::factions::%arg-2%::lands::*} to {x_factions_FAC::factions::%{_F}%::lands::*}
  524. set {x_factions_FAC::factions::%arg-2%::dtr.freeze} to {x_factions_FAC::factions::%{_F}%::dtr.freeze}
  525. set {x_factions_FAC::factions::%arg-2%::home} to {x_factions_FAC::factions::%{_F}%::home}
  526. # migrate ally
  527. if {x_factions_FAC::factions::%{_F}%::ally::*} isn't empty:
  528. loop {x_factions_FAC::factions::%{_F}%::ally::*}:
  529. set {x_factions_FAC::factions::%arg-2%::ally::%loop-value-1%} to loop-value-1
  530. set {x_factions_FAC::factions::%loop-value-1%::ally::%arg-2%} to arg-2
  531. delete {x_factions_FAC::factions::%loop-value-1%::ally::%{_F}%}
  532. delete {x_factions_FAC::factions::%{_F}%::ally::%loop-value-1%}
  533. # keep truce
  534. if {x_factions_FAC::factions::%{_F}%::truce::*} isn't empty:
  535. loop {x_factions_FAC::factions::%{_F}%::truce::*}:
  536. set {x_factions_FAC::factions::%arg-2%::truce::%loop-value-1%} to loop-value-1
  537. set {x_factions_FAC::factions::%loop-value-1%::truce::%arg-2%} to arg-2
  538. delete {x_factions_FAC::factions::%loop-value-1%::truce::%{_F}%}
  539. delete {x_factions_FAC::factions::%{_F}%::truce::%loop-value-1%}
  540. #Move the players to the new one
  541. loop {x_factions_FAC::factions::%arg-2%::players::*}:
  542. send "%{@Prefix}% &7The name of the faction was changed to: &c%arg-2%" to player from uuid loop-value-1
  543. #Loop value is a chunk
  544. loop {x_factions_FAC::factions::%arg-2%::lands::*}:
  545. if {x_factions_FAC::chunks::%loop-value-1%.owner} is {_F}:
  546. set {x_factions_FAC::chunks::%loop-value-1%.owner} to arg-2
  547. #Delete the old faction
  548. delete {x_factions_FAC::factions::%{_F}%::*}
  549. delete {x_factions_FAC::factions::%{_F}%}
  550. FactionTag("call")
  551. stop
  552. else:
  553. send "%{@Prefix}% &7You need to specify a new name for %{_F}%"
  554. stop
  555. else:
  556. send "%{@Prefix}% &7You must be the owner of %{_F}% to use this command"
  557. stop
  558. else:
  559. send "%{@Prefix}% &7This command is only for faction owners"
  560. stop
  561.  
  562. #/f sethome [set the faction's home ]
  563. if arg-1 is "sethome":
  564. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  565. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  566. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  567. set {_chunk} to chunk at player's location
  568. set {_chunkowner} to {x_factions_FAC::chunks::%chunk at player's location%.owner}
  569. if {_chunkowner} is {_F}:
  570. set {x_factions_FAC::factions::%{_F}%::home} to player's location
  571. send "%{@Prefix}% &7The Home was set"
  572. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  573. send "%{@Prefix}% &7Now you can use &a/F home" to player from uuid loop-value-1
  574. stop
  575. else if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::sethome} is "yes":
  576. set {x_factions_FAC::factions::%{_F}%::home} to player's location
  577. send "%{@Prefix}% &7The Home was set"
  578. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  579. send "%{@Prefix}% &7Now you can use &a/F home" to player from uuid loop-value-1
  580. stop
  581. else:
  582. send "%{@Prefix}% &7You can use this command only in your faction land"
  583. stop
  584. else:
  585. send "%{@Prefix}% &7Only mods can claim lands"
  586. stop
  587. else:
  588. send "%{@Prefix}% &7You must own a faction to use this command"
  589. stop
  590.  
  591. # /F show [leave the faction //owner can't leave if the faction isn't empty]
  592. if arg-1 is "show" or "who":
  593. if arg-2 is set:
  594. set {_l} to length of the arg-2
  595. if {_l} is less than 4:
  596. send "%{@Prefix}% &cThe name needs at least 3 characters"
  597. stop
  598. else:
  599. #Did the sender mean a faction?
  600. if {x_factions_FAC::factions::%arg-2%} is set:
  601. FactionShow(arg-2,player)
  602. stop
  603. #if there is no faction with that name, I will check if there a player
  604. else:
  605. set {_p} to arg-2 parsed as a player
  606. if {_p} is online:
  607. set {_p} to uuid of {_p}
  608. if {x_factions_FAC::players::%{_p}%.faction} isn't "wilder":
  609. FactionShow({x_factions_FAC::players::%{_p}%.faction},player)
  610. stop
  611. else:
  612. send "&6[&2Wilder&6]"
  613. stop
  614. else:
  615. send "The faction %arg-2% does not exist, or the player %arg-2% is offline"
  616. stop
  617. else:
  618. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  619. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  620. FactionShow({_F},player)
  621. stop
  622. else:
  623. send "&6[&2Wilder&6]"
  624. stop
  625.  
  626. #/f home [teleports you to the faction home]
  627. if arg-1 is "home":
  628. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  629. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  630. if {x_factions_FAC::factions::%{_F}%::home} is set:
  631. set {_text} to "%{@Prefix}% &7You will be teleported in {@fhome-delay} seconds. Don't move!"
  632. set {_location} to the player's location
  633. send "%{_text}%" to the player
  634. set {_delay} to {@fhome-delay}
  635. while {_delay} is greater than 0:
  636. if distance between {_location} and the player's location is less than 0.1:
  637. subtract 1 from {_delay}
  638. wait 1 second
  639. else:
  640. send "%{@Prefix}% &7Teleport stoped." to the player
  641. stop
  642. if distance between {_location} and the player's location is less than 0.1:
  643. teleport player to {x_factions_FAC::factions::%{_F}%::home}
  644. stop
  645. else:
  646. send "%{@Prefix}% &7Teleport stoped." to the player
  647. stop
  648. else:
  649. send "%{@Prefix}% &7There is no home set"
  650. stop
  651. else:
  652. send "%{@Prefix}% &7You don't belong to a faction"
  653. stop
  654.  
  655. # /F leave [leave the faction //owner can't leave if the faction isn't empty]
  656. if arg-1 is "leave":
  657. if {x_factions_FAC::players::%uuid of player%.faction} is set:
  658. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  659. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  660. set {_count} to 0
  661. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  662. set {_count} to {_count}+1
  663. if {_count} is more than 1:
  664. send "%{@Prefix}% &7You can't leave the faction if the faction isn't empty, use &2/f disband or &2/f owner"
  665. stop
  666. else:
  667. #if the faction is empty, the owner can leave
  668. #make him to disband the faction
  669. make player execute "f disband"
  670. stop
  671. else:
  672. set {x_factions_FAC::players::%uuid of player%.faction} to "wilder"
  673. delete {x_factions_FAC::factions::%{_F}%::players::%uuid of player%}
  674. if {x_factions_FAC::factions::%{_F}%::players::mods::%uuid of player%} is set:
  675. delete {x_factions_FAC::factions::%{_F}%::players::mods::%uuid of player%}
  676. set {x_factions_FAC::players::%uuid of player%.chat} to 1
  677. send "%{@Prefix}% &7You have left the &c%{_F}%"
  678. FactionTag("call")
  679. stop
  680. else:
  681. send "%{@Prefix}% &7You must be in a faction to use this command"
  682. stop
  683.  
  684. #/f list [shows the factions list]
  685. if arg-1 is "list":
  686. if {x_factions_FAC::factions::*} is set:
  687. set {_cont} to size of {x_factions_FAC::factions::*}
  688. if {_cont} is more than 8:
  689. set {_maxpag} to {_cont}/8
  690. set {_maxpag} to ceil({_maxpag})
  691. else:
  692. set {_maxpag} to 1
  693. if arg-2 is set:
  694. set {_arg2} to arg-2 parsed as a number
  695. if {_arg2} is more than {_maxpag}:
  696. set {_arg2} to {_maxpag}
  697. set {_cont} to 1
  698. set {_cont} to 1
  699. send "--------List %{_arg2}%/ %{_maxpag}%--------"
  700. loop {x_factions_FAC::factions::*}:
  701. if loop-value-1 isn't "&4WarZone":
  702. set {_pag} to {_cont}/8
  703. set {_pag} to ceil({_pag})
  704. if {_pag} is {_arg2}:
  705. set {_F} to loop-value-1
  706. set {_online} to 0
  707. set {_offline} to 0
  708. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  709. set {_check} to loop-value-2
  710. set {_check} to player from uuid {_check}
  711. if {_check} is online:
  712. set {_online} to {_online}+1
  713. set {_offline} to {_offline}+1
  714. send "%{_F}% &a%{_online}%&8 /&c %{_offline}% "
  715. set {_cont} to {_cont}+1
  716. else:
  717. set {_cont} to {_cont}+1
  718. stop
  719. else:
  720. set {_arg2} to 1
  721. if {_arg2} is more than {_maxpag}:
  722. set {_arg2} to {_maxpag}
  723. set {_cont} to 1
  724. set {_cont} to 1
  725. send "--------List %{_arg2}%/ %{_maxpag}%--------"
  726. loop {x_factions_FAC::factions::*}:
  727. if loop-value-1 isn't "&4WarZone":
  728. set {_pag} to {_cont}/8
  729. set {_pag} to ceil({_pag})
  730. if {_pag} is {_arg2}:
  731. set {_F} to loop-value-1
  732. set {_online} to 0
  733. set {_offline} to 0
  734. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  735. set {_check} to loop-value-2
  736. set {_check} to player from uuid {_check}
  737. if {_check} is online:
  738. set {_online} to {_online}+1
  739. set {_offline} to {_offline}+1
  740. send "%{_F}% &a%{_online}%&8 /&c %{_offline}% "
  741. set {_cont} to {_cont}+1
  742. else:
  743. set {_cont} to {_cont}+1
  744. stop
  745. else:
  746. send "There is no factions!"
  747. stop
  748.  
  749. #/f disband [delete a faction]
  750. if arg-1 is "disband":
  751. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  752. set {_F} to {x_factions_FAC::players::%uuid of player%.faction} #que faction es
  753. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  754. if {x_factions_FAC::factions::%{_F}%::dtr.freeze} < now:
  755. FactionDisband("%{_F}%")
  756. FactionTag("call")
  757. broadcast "%{@Prefix}% &7The Faction %{_F}% was disbaned"
  758. stop
  759. else:
  760. send "%{@Prefix}% &7You can't disband with dtr freeze"
  761. stop
  762. else:
  763. send "%{@Prefix}% &7You must be the owner of &2%{_F}%"
  764. stop
  765. else:
  766. send "%{@Prefix}% &7You must own a faction to use this command"
  767. stop
  768.  
  769. #/mod {player} [if the player is a mod, the command will remove the permission, else: the player will become a mod. Only the owner can use the command]
  770. if arg-1 is "mod":
  771. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  772. set {_F} to {x_factions_FAC::players::%uuid of player%.faction} #que faction es
  773. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  774. if arg-2 is set:
  775. set {_l} to length of the arg-2
  776. if {_l} is less than 4:
  777. send "%{@Prefix}% &7The name must contain at least 3 characters"
  778. stop
  779. if arg-2 is player:
  780. send "%{@Prefix}% &7You are a mod already!"
  781. stop
  782. set {_p} to uuid of arg-2 parsed as a player
  783. if {x_factions_FAC::factions::%{_F}%::players::%{_p}%} is set:
  784. if {x_factions_FAC::factions::%{_F}%::mods::%{_p}%} is set:
  785. delete {x_factions_FAC::factions::%{_F}%::mods::%{_p}%}
  786. send "%{@Prefix}% &2%arg-2% &7is no longer a MOD"
  787. send "%{@Prefix}% &7You are no longer a MOD of &2%{_F}%" to player from uuid {_p}
  788. stop
  789. else:
  790. set {x_factions_FAC::factions::%{_F}%::mods::%{_p}%} to {_p}
  791. send "%{@Prefix}% &7You are now a MOD of &2%{_F}%" to player from uuid {_p}
  792. send "%{@Prefix}% &2%arg-2% &7is now a MOD"
  793. stop
  794. else:
  795. send "%{@Prefix}% &c%arg-2% &7is not a member of the faction"
  796. stop
  797. else:
  798. send "%{@Prefix}% &7You need to specify a player"
  799. stop
  800. else:
  801. send "%{@Prefix}% &7You must be the owner of &2%{_F}% &7to use this command"
  802. stop
  803. else:
  804. send "%{@Prefix}% &7You must own a faction to use this command"
  805. stop
  806.  
  807. if arg-1 is "officer":
  808. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  809. set {_F} to {x_factions_FAC::players::%uuid of player%.faction} #que faction es
  810. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  811. if arg-2 is set:
  812. set {_l} to length of the arg-2
  813. if {_l} is less than 3:
  814. send "%{@Prefix}% &7The name must contain at least 3 characters"
  815. stop
  816. set {_p} to uuid of arg-2 parsed as a player
  817. if {x_factions_FAC::factions::%{_F}%::players::%{_p}%} is set:
  818. if {x_factions_FAC::factions::%{_F}%::officer::%{_p}%} is set:
  819. delete {x_factions_FAC::factions::%{_F}%::officer::%{_p}%}
  820. send "%{@Prefix}% &2%arg-2% &7is no longer a OFFICER"
  821. send "%{@Prefix}% &7You are no longer a OFFICER of &2%{_F}%" to player from uuid {_p}
  822. stop
  823. else:
  824. set {x_factions_FAC::factions::%{_F}%::officer::%{_p}%} to {_p}
  825. send "%{@Prefix}% &7You are now a OFFICER of &2%{_F}%" to player from uuid {_p}
  826. send "%{@Prefix}% &2%arg-2% &7is now a OFFICER"
  827. stop
  828. else:
  829. send "%{@Prefix}% &c%arg-2% &7is not a member of the faction"
  830. stop
  831. else:
  832. send "%{@Prefix}% &7You need to specify a player"
  833. stop
  834. else:
  835. send "%{@Prefix}% &7You must be the owner of &2%{_F}% &7to use this command"
  836. stop
  837. else:
  838. send "%{@Prefix}% &7You must own a faction to use this command"
  839. stop
  840.  
  841. # /F kick {FACTION.MEMBER} [KICK A FACTION MEMBER]
  842. if arg-1 is "kick":
  843. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  844. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  845. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  846. if arg-2 is set:
  847. if arg-2 is player:
  848. send "%{@Prefix}% &7You can't kick your self from the faction"
  849. send "%{@Prefix}% &7Use &2/F leave &7or &2/F disband"
  850. stop
  851. set {_l} to length of the arg-2
  852. if {_l} is more than 16:
  853. send "%{@Prefix}% &7The name must contain at least 3 characters"
  854. stop
  855. else:
  856. if {x_factions_FAC::uuid::%arg-2%} is set:
  857. set {_p} to {x_factions_FAC::uuid::%arg-2%}
  858. else:
  859. set {_p} to uuid of arg-2 parsed as a player
  860. if {x_factions_FAC::factions::%{_F}%::owner} is {_p}:
  861. send "%{@Prefix}% &7You can't kick the owner!"
  862. stop
  863. if {x_factions_FAC::factions::%{_F}%::players::%{_p}%} is set:
  864. send "%{@Prefix}% %player from uuid {_p}% was Kicked from %{_F}%"
  865. delete {x_factions_FAC::factions::%{_F}%::players::%{_p}%}
  866. if {x_factions_FAC::factions::%{_F}%::players::mods::%player%} is set:
  867. delete {x_factions_FAC::factions::%{_F}%::players::mods::%{_p}%}
  868. if {x_factions_FAC::factions::%{_F}%::officer::%{_p}%} is set:
  869. delete {x_factions_FAC::factions::%{_F}%::officer::%{_p}%}
  870. set {x_factions_FAC::players::%{_p}%.faction} to "wilder"
  871. set {x_factions_FAC::players.%{_p}%.chat} to 1
  872. set {x_factions_FAC::factions::%{_F}%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}-1
  873. FactionTag("call")
  874. FactionDtr("%{_F}%")
  875. stop
  876. else:
  877. send "%{@Prefix}% %player from uuid {_p}% does not belong to %{_F}%"
  878. stop
  879. else:
  880. send "%{@Prefix}% &7You need to specify a player name"
  881. stop
  882. else:
  883. send "%{@Prefix}% &7Only mods can kick players"
  884. stop
  885. else:
  886. send "%{@Prefix}% &7You don't belong to a faction"
  887. stop
  888.  
  889. # /F OWNER {FACTION.MEMBER} [MAKES A FACTION MEMBER THE NEW OWNER OF THE FACTION]
  890. if arg-1 is "owner":
  891. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  892. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  893. if {x_factions_FAC::factions::%{_F}%::owner} is uuid of player:
  894. if arg-2 is set:
  895. if arg-2 is player:
  896. send "%{@Prefix}% &7You are the owner, silly!"
  897. stop
  898. set {_l} to length of the arg-2
  899. if {_l} is more than 16:
  900. send "%{@Prefix}% &7The name must have at least 3 characters"
  901. stop
  902. else:
  903. if arg-2 parsed as player is online:
  904. set {_P} to uuid of arg-2 parsed as player
  905. if {x_factions_FAC::players::%{_P}%.faction} is {_F}:
  906. set {x_factions_FAC::factions::%{_F}%::owner} to {_P}
  907.  
  908. delete {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%}
  909. set {x_factions_FAC::factions::%{_F}%::mods::%{_P}%} to {_P}
  910.  
  911. delete {x_factions_FAC::factions::%{_F}%::officer::%uuid of player%}
  912. set {x_factions_FAC::factions::%{_F}%::officer::%{_P}%} to {_P}
  913.  
  914. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  915. send "%{@Prefix}% &7The owner of &2%{_F}% &7is now &2%player from uuid {_P}% " to player from uuid loop-value
  916. #remove player from the owner
  917. delete {x_factions_FAC::factions::%{_F}%::owner::%uuid of player%}
  918. send "%{@Prefix}% &7You are no longer a mod. You may ask &2%player from uuid {_P}% &7to give you the mod range "
  919. stop
  920. else:
  921. send "%{@Prefix}% &c%player from uuid {_P}% &7doesn't belong to this faction"
  922. stop
  923. else:
  924. send "%{@Prefix}% &7You must specify a player name"
  925. stop
  926. else:
  927. send "%{@Prefix}% &7This command is only for the owner of the faction"
  928. stop
  929. else:
  930. send "%{@Prefix}% &7You must own a faction to use this command"
  931. stop
  932.  
  933. # /F NEUTRAL {FACTION} [Propouse ally to another faction, if the arg ally uses the same command, the ally is made]
  934. if arg-1 is "ally":
  935. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  936. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  937. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  938. if arg-2 is {_F}:
  939. send "%{@Prefix}% &7You can't ally your self"
  940. stop
  941. if arg-2 is set:
  942. set {_l} to length of the arg-2
  943. if {_l} is more than 16:
  944. send "%{@Prefix}% &7The name must contain at least 3 characters"
  945. stop
  946. if arg-2 parsed as player is online:
  947. set {_p} to uuid of arg-2 parsed as a player
  948. set {_p} to {x_factions_FAC::players::%{_p}%.faction}
  949. else:
  950. set {_p} to arg-2
  951. #lets check that the faction %{_p}% exist
  952. if {x_factions_FAC::Factions::%{_p}%} is set:
  953. #Lets check max-ally
  954. if size of {x_factions_FAC::factions::%{_F}%::ally::*} >= {@max-ally}:
  955. send "%{@Prefix}% &7You can't have any more allies."
  956. stop
  957. #lets check that this factions does not have any type of relation with arg-2
  958. if {x_factions_FAC::factions::%{_F}%::truce::%{_p}%} is set:
  959. send "%{@Prefix}% &7You already have a relation with %{_p}%"
  960. send "%{@Prefix}% &7You must end the relation with this factions first"
  961. send "%{@Prefix}% &7You can use /f neutral %{_p}%"
  962. stop
  963.  
  964. if {x_factions_FAC::factions::%{_F}%::ally::%{_p}%} is set:
  965. send "%{@Prefix}% &7%{_p}% is your ally already"
  966. stop
  967.  
  968. #Lets check if he want to answer a request :
  969. if {x_factions_FAC::factions::%{_F}%::request_ally::%{_p}%} is set:
  970. #
  971. delete {x_factions_FAC::factions::%{_F}%::request_ally::%{_p}%}
  972. delete {x_factions_FAC::factions::%{_p}%::request_ally::%{_F}%}
  973.  
  974. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%} to {_p}
  975. set {x_factions_FAC::factions::%{_p}%::ally::%{_F}%} to {_F}
  976.  
  977. #
  978. #default perms"
  979. #
  980. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::build} to {@ally-place}
  981. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::sethome} to {@ally-sethome}
  982. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::interact} to {@ally-interact}
  983. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::break} to {@ally-break}
  984. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::chest} to {@ally-chest}
  985.  
  986. set {x_factions_FAC::factions::%{_p}%::ally::%{_F}%::perms::build} to {@ally-place}
  987. set {x_factions_FAC::factions::%{_p}%::ally::%{_F}%::perms::sethome} to {@ally-sethome}
  988. set {x_factions_FAC::factions::%{_p}%::ally::%{_F}%::perms::interact} to {@ally-interact}
  989. set {x_factions_FAC::factions::%{_p}%::ally::%{_F}%::perms::break} to {@ally-break}
  990. set {x_factions_FAC::factions::%{_p}%::ally::%{_F}%::perms::chest} to {@ally-chest}
  991.  
  992.  
  993. Broadcast "%{@Prefix}% &c%{x_factions_FAC::players::%uuid of player%.faction}% &6allied with &c%{_p}%"
  994. FactionTag("call")
  995. stop
  996. else:
  997. #lets send a request
  998. send "%{@Prefix}% &c The ally request was sent."
  999. set {x_factions_FAC::factions::%{_p}%::request_ally::%{_F}%} to {_F}
  1000. loop {x_factions_FAC::factions::%{_p}%::players::*}:
  1001. send "%{@Prefix}% &c%{x_factions_FAC::players::%uuid of player%.faction}% &7sent an ally request" to player from uuid loop-value-1
  1002. stop
  1003. else:
  1004. send "%{@Prefix}% &7There is no Faction with that name"
  1005. stop
  1006. else:
  1007. send "%{@Prefix}% &7You must specify a faction name"
  1008. stop
  1009. else:
  1010. send "%{@Prefix}% &7Only mods can send ally request!"
  1011. stop
  1012. else:
  1013. send "%{@Prefix}% &7You must belong to a faction"
  1014. stop
  1015.  
  1016. if arg-1 is "truce":
  1017. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  1018. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  1019. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  1020. if arg-2 is {_F}:
  1021. send "%{@Prefix}% &7You can't make a truce with your self"
  1022. stop
  1023. if arg-2 is set:
  1024. set {_l} to length of the arg-2
  1025. if {_l} is more than 16:
  1026. send "%{@Prefix}% &7The name must contain at least 3 characters"
  1027. stop
  1028. if arg-2 parsed as player is online:
  1029. set {_p} to uuid of arg-2 parsed as a player
  1030. set {_p} to {x_factions_FAC::players::%{_p}%.faction}
  1031. else:
  1032. set {_p} to arg-2
  1033. #lets check that the faction %{_p}% exist
  1034. if {x_factions_FAC::Factions::%{_p}%} is set:
  1035. #Lets check max-ally
  1036. if size of {x_factions_FAC::factions::%{_F}%::truce::*} >= {@max-truce}:
  1037. send "%{@Prefix}% &7You can't have any more truce."
  1038. stop
  1039. #lets check that this factions does not have any type of relation with arg-2
  1040. if {x_factions_FAC::factions::%{_F}%::ally::%{_p}%} is set:
  1041. send "%{@Prefix}% &7You already have a relation with %{_p}%"
  1042. send "%{@Prefix}% &7You must end the relation with this factions first"
  1043. send "%{@Prefix}% &7You can use /f neutral %{_p}%"
  1044. stop
  1045.  
  1046. if {x_factions_FAC::factions::%{_F}%::truce::%{_p}%} is set:
  1047. send "%{@Prefix}% &7%{_p}% is your truce already"
  1048. stop
  1049.  
  1050. #Lets check if he want to answer a request :
  1051. if {x_factions_FAC::factions::%{_F}%::request_truce::%{_p}%} is set:
  1052. #delete the request
  1053. delete {x_factions_FAC::factions::%{_F}%::request_truce::%{_p}%}
  1054. delete {x_factions_FAC::factions::%{_p}%::request_truce::%{_F}%}
  1055. #make the truce
  1056. set {x_factions_FAC::factions::%{_F}%::truce::%{_p}%} to {_p}
  1057. set {x_factions_FAC::factions::%{_p}%::truce::%{_F}%} to {_F}
  1058. Broadcast "%{@Prefix}% &c%{x_factions_FAC::players::%uuid of player%.faction}% &6pacted a truce &c%{_p}%"
  1059. FactionTag("call")
  1060. stop
  1061. else:
  1062. #lets send a request
  1063. send "%{@Prefix}% &c The truce request was sent."
  1064. set {x_factions_FAC::factions::%{_p}%::request_truce::%{_F}%} to {_F}
  1065. loop {x_factions_FAC::factions::%{_p}%::players::*}:
  1066. send "%{@Prefix}% &c%{x_factions_FAC::players::%uuid of player%.faction}% &7sent an truce request" to player from uuid loop-value-1
  1067. stop
  1068. else:
  1069. send "%{@Prefix}% &7There is no Faction with that name"
  1070. stop
  1071. else:
  1072. send "%{@Prefix}% &7You must specify a faction name"
  1073. stop
  1074. else:
  1075. send "%{@Prefix}% &7Only mods can send truce request!"
  1076. stop
  1077. else:
  1078. send "%{@Prefix}% &7You must belong to a faction"
  1079. stop
  1080.  
  1081. if arg-1 is "perms":
  1082. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  1083. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  1084. if {x_factions_FAC::factions::%{_F}%::owner::%uuid of player%} is set:
  1085. if arg-2 is {_F}:
  1086. send "%{@Prefix}% &7You must specify an ally"
  1087. stop
  1088. if arg-2 is set:
  1089. set {_l} to length of the arg-2
  1090. if {_l} is more than 16:
  1091. send "%{@Prefix}% &7The name must contain at least 3 characters"
  1092. stop
  1093. if arg-2 parsed as player is online:
  1094. set {_p} to uuid of arg-2 parsed as a player
  1095. set {_p} to {x_factions_FAC::players::%{_p}%.faction}
  1096. else:
  1097. set {_p} to arg-2
  1098. #lets check that the faction %{_p}% exist
  1099. if {x_factions_FAC::Factions::%{_p}%} is set:
  1100. if {x_factions_FAC::factions::%{_F}%::ally%{_p}%} is set:
  1101. if arg-3 isn't "build" or "sethome" or "interact" or "chest" or "break" or "build":
  1102. send "Usage: /f perms AllyName Permission"
  1103. send "%{@Prefix}% Perms for ally:"
  1104. send " &7build yes/no"
  1105. send " &7sethome yes/no"
  1106. send " &7interact (buttons,door,etc) yes/no"
  1107. send " &7break yes/no"
  1108. send " &7chest yes/no"
  1109. stop
  1110. if arg-3 isn't set:
  1111. send "Usage: /f perms AllyName Permission"
  1112. send "%{@Prefix}% Perms for ally:"
  1113. send " &7build"
  1114. send " &7sethome"
  1115. send " &7interact (buttons,door,etc)"
  1116. send " &7break"
  1117. send " &7chest"
  1118. stop
  1119. if arg-3 is "build":
  1120. if {x_factions_FAC::factions::%{_F}%:::ally::%{_p}%::perms::build} is "yes":
  1121. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::build} to "no"
  1122. send "Permission %arg-3% was set to DENY"
  1123. stop
  1124. else:
  1125. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::build} to "yes"
  1126. send "Permission %arg-3% was set to ALLOW"
  1127. stop
  1128. if arg-3 is "sethome":
  1129. if {x_factions_FAC::factions::%{_F}%:::ally::%{_p}%::perms::sethome} is "yes":
  1130. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::sethome} to "no"
  1131. send "Permission %arg-3% was set to DENY"
  1132. stop
  1133. else:
  1134. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::sethome} to "yes"
  1135. send "Permission %arg-3% was set to ALLOW"
  1136. stop
  1137. if arg-3 is "interact":
  1138. if {x_factions_FAC::factions::%{_F}%:::ally::%{_p}%::perms::interact} is "yes":
  1139. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::interact} to "no"
  1140. send "Permission %arg-3% was set to DENY"
  1141. stop
  1142. else:
  1143. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::interact} to "yes"
  1144. send "Permission %arg-3% was set to ALLOW"
  1145. stop
  1146. if arg-3 is "break":
  1147. if {x_factions_FAC::factions::%{_F}%:::ally::%{_p}%::perms::break} is "yes":
  1148. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::break} to "no"
  1149. send "Permission %arg-3% was set to DENY"
  1150. stop
  1151. else:
  1152. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::break} to "yes"
  1153. send "Permission %arg-3% was set to ALLOW"
  1154. stop
  1155. if arg-3 is "chest":
  1156. if {x_factions_FAC::factions::%{_F}%:::ally::%{_p}%::perms::chest} is "yes":
  1157. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::chest} to "no"
  1158. send "Permission %arg-3% was set to DENY"
  1159. stop
  1160. else:
  1161. set {x_factions_FAC::factions::%{_F}%::ally::%{_p}%::perms::chest} to "yes"
  1162. send "Permission %arg-3% was set to ALLOW"
  1163. stop
  1164. else:
  1165. send "%{@Prefix}% &7%{_p}% is not your ally"
  1166.  
  1167. else:
  1168. send "%{@Prefix}% &7There is no Faction with that name"
  1169. stop
  1170. else:
  1171. send "%{@Prefix}% Perms for ally:"
  1172. send " &7build"
  1173. send " &7sethome"
  1174. send " &7interact (buttons,door,etc)"
  1175. send " &7break"
  1176. send " &7chest"
  1177. stop
  1178. else:
  1179. send "%{@Prefix}% &7Only the owner can change the ally permissions"
  1180. stop
  1181. else:
  1182. send "%{@Prefix}% &7You must belong to a faction"
  1183. stop
  1184.  
  1185. # /F NEUTRAL {FACTION} [CANCEL AN ALLIANCE]
  1186. if arg-1 is "neutral":
  1187. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  1188. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  1189. if {x_factions_FAC::factions::%{_F}%::mods::%uuid of player%} is set:
  1190. if arg-2 is {_F}:
  1191. send "%{@Prefix}% &7You can't make a truce with your self"
  1192. stop
  1193. if arg-2 is set:
  1194. set {_l} to length of the arg-2
  1195. if {_l} is more than 16:
  1196. send "%{@Prefix}% &7The name must contain at least 3 characters"
  1197. stop
  1198. if arg-2 parsed as player is online:
  1199. set {_p} to uuid of arg-2 parsed as a player
  1200. set {_p} to {x_factions_FAC::players::%{_p}%.faction}
  1201. else:
  1202. set {_p} to arg-2
  1203. #lets check that the faction %{_p}% exist
  1204. if {x_factions_FAC::Factions::%{_p}%} is set:
  1205. if {x_factions_FAC::factions::%{_F}%::ally::%arg-2%} isn't set:
  1206. if {x_factions_FAC::factions::%{_F}%::truce::%arg-2%} isn't set:
  1207. send "%{@Prefix}% &7You must have an active ally or truce to use this command"
  1208. stop
  1209. else:
  1210. delete {x_factions_FAC::factions::%{_F}%::truce::%arg-2%}
  1211. delete {x_factions_FAC::factions::%arg-2%::truce::%{_F}%}
  1212. set {_disband} to "truce"
  1213. FactionTag("call")
  1214. else:
  1215. delete {x_factions_FAC::factions::%arg-2%:::ally::%{_F}%::perms::*}
  1216. delete {x_factions_FAC::factions::%{_F}%::ally::%arg-2%::perms::*}
  1217.  
  1218. delete {x_factions_FAC::factions::%{_F}%::ally::%arg-2%}
  1219. delete {x_factions_FAC::factions::%arg-2%::ally::%{_F}%}
  1220. FactionTag("call")
  1221. set {_disband} to "ally"
  1222.  
  1223. loop {x_factions_FAC::factions::%arg-2%::players::*}:
  1224. send "%{@Prefix}% &d%{_F}% &7disbanded the %{_disband}% with %arg-2%" to player from uuid loop-value-1
  1225. #DISABLE ALLY CHAT
  1226. set {x_factions_FAC::players::%loop-value-1%.chat} to 1
  1227. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  1228. send "%{@Prefix}% &d%{_F}% &7disbanded the %{_disband}% with %arg-2%" to player from uuid loop-value-1
  1229. #DISABLE ALLY CHAT
  1230. set {x_factions_FAC::players::%loop-value-1%.chat} to 1
  1231. stop
  1232. else:
  1233. send "%{@Prefix}% &7There is no Faction with that name"
  1234. stop
  1235. else:
  1236. send "%{@Prefix}% &7You need to specify a faction, use &2/F show &7to see the ally or truce name"
  1237. stop
  1238. else:
  1239. send "%{@Prefix}% &7Only mods may cancel an ally pact!"
  1240. stop
  1241. else:
  1242. send "%{@Prefix}% &7Only faction's mods can cancel an ally pact!"
  1243. stop
  1244.  
  1245. # /F C [CHANGE THE CHAT CHANNEL]
  1246. if arg-1 is "c" or "chat":
  1247. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  1248. if {x_factions_FAC::players::%uuid of player%.chat} isn't set:
  1249. set {x_factions_FAC::players::%uuid of player%.chat} to 1
  1250. stop
  1251. if {x_factions_FAC::players::%uuid of player%.chat} is 1: #all
  1252. set {x_factions_FAC::players::%uuid of player%.chat} to 2
  1253. send "%{@Prefix}% &aFaction Channel"
  1254. stop
  1255. if {x_factions_FAC::players::%uuid of player%.chat} is 2: #fac
  1256. set {x_factions_FAC::players::%uuid of player%.chat} to 3
  1257. send "%{@Prefix}% &dAlly Channel"
  1258. stop
  1259. if {x_factions_FAC::players::%uuid of player%.chat} is 3: #ally
  1260. set {x_factions_FAC::players::%uuid of player%.chat} to 1
  1261. send "%{@Prefix}% &cGlobal Channel"
  1262. stop
  1263. else:
  1264. send "%{@Prefix}% &7You must have a faction to use this command"
  1265. stop
  1266. #/F MAP
  1267. if arg-1 is "map":
  1268. set {_center} to player's location#location you want to loop the chunks around
  1269. set {_radius} to 4
  1270. set {_pos} to {_center}
  1271. set {_counter} to 1
  1272. if facing of player is north:
  1273. loop 2 * {_radius} + 1 times:
  1274. set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius} + (loop-number - 1) * 16
  1275. set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius}
  1276. loop 2 * {_radius} + 1 times:
  1277. set {_chunks::%{_counter}%} to chunk at {_pos}
  1278. add 1 to {_counter}
  1279. add 16 to x-coordinate of {_pos}
  1280. else if facing of player is south:
  1281. loop 2 * {_radius} + 1 times:
  1282. set z-coordinate of {_pos} to z-coordinate of {_center} + 16 * {_radius} - (loop-number - 1) * 16
  1283. set x-coordinate of {_pos} to x-coordinate of {_center} + 16 * {_radius}
  1284. loop 2 * {_radius} + 1 times:
  1285. set {_chunks::%{_counter}%} to chunk at {_pos}
  1286. add 1 to {_counter}
  1287. add -16 to x-coordinate of {_pos}
  1288. else if facing of player is west:
  1289. loop 2 * {_radius} + 1 times:
  1290. set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius} + (loop-number - 1) * 16
  1291. set z-coordinate of {_pos} to z-coordinate of {_center} + 16 * {_radius}
  1292. loop 2 * {_radius} + 1 times:
  1293. set {_chunks::%{_counter}%} to chunk at {_pos}
  1294. add 1 to {_counter}
  1295. add -16 to z-coordinate of {_pos}
  1296. else if facing of player is east:
  1297. loop 2 * {_radius} + 1 times:
  1298. set x-coordinate of {_pos} to x-coordinate of {_center} + 16 * {_radius} - (loop-number - 1) * 16
  1299. set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius}
  1300. loop 2 * {_radius} + 1 times:
  1301. set {_chunks::%{_counter}%} to chunk at {_pos}
  1302. add 1 to {_counter}
  1303. add 16 to z-coordinate of {_pos}
  1304.  
  1305. #comienzo buscar enemigos
  1306. #broadcast "%{_chunks::*}%"
  1307. set {_cont} to 0
  1308. set {_l1} to ""
  1309. set {_l2} to ""
  1310. set {_l3} to ""
  1311. set {_l4} to ""
  1312. set {_l5} to ""
  1313. set {_l6} to ""
  1314. set {_l7} to ""
  1315. set {_l8} to ""
  1316. set {_l9} to ""
  1317.  
  1318. set {_1} to "&8*"
  1319. set {_2} to "&8@"
  1320. set {_3} to "&8!"
  1321. set {_4} to "&8@"
  1322. set {_6} to "&8$"
  1323. set {_7} to "&8~"
  1324. set {_8} to "&8^"
  1325. set {_9} to "&8&"
  1326. loop {_chunks::*}:
  1327. if chunk at player's location is loop-value:
  1328. set {_ico} to "&b+&f"
  1329. else if {x_factions_FAC::chunks::%loop-value%} is set:
  1330. if {x_factions_FAC::chunks::%loop-value%.owner} is "&4WarZone":
  1331. set {_ico} to "&4+"
  1332. else:
  1333. set {_F} to {x_factions_FAC::chunks::%loop-value%.owner}
  1334. if {_faction.%{_F}%.icon} isn't set:
  1335. if {_1.used} isn't set:
  1336. set {_ico} to {_1}
  1337. set {_1.used} to {_F}
  1338. set {_faction.%{_F}%.icon} to {_1}
  1339. else if {_2.used} isn't set:
  1340. set {_ico} to {_2}
  1341. set {_2.used} to {_F}
  1342. set {_faction.%{_F}%.icon} to {_2}
  1343.  
  1344. else if {_3.used} isn't set:
  1345. set {_ico} to {_3}
  1346. set {_2.used} to {_F}
  1347. set {_faction.%{_F}%.icon} to {_3}
  1348.  
  1349. else if {_4.used} isn't set:
  1350. set {_ico} to {_4}
  1351. set {_4.used} to {_F}
  1352. set {_faction.%{_F}%.icon} to {_4}
  1353.  
  1354. else if {_5.used} isn't set:
  1355. set {_ico} to {_5}
  1356. set {_5.used} to {_F}
  1357. set {_faction.%{_F}%.icon} to {_5}
  1358.  
  1359. else if {_6.used} isn't set:
  1360. set {_ico} to {_6}
  1361. set {_6.used} to {_F}
  1362. set {_faction.%{_F}%.icon} to {_6}
  1363.  
  1364. else if {_7.used} isn't set:
  1365. set {_ico} to {_7}
  1366. set {_7.used} to {_F}
  1367. set {_faction.%{_F}%.icon} to {_7}
  1368.  
  1369. else if {_8.used} isn't set:
  1370. set {_ico} to {_8}
  1371. set {_8.used} to {_F}
  1372. set {_faction.%{_F}%.icon} to {_8}
  1373.  
  1374. else if {_9.used} isn't set:
  1375. set {_ico} to {_9}
  1376. set {_9.used} to {_F}
  1377. set {_faction.%{_F}%.icon} to {_9}
  1378. else:
  1379. set {_ico} to {_faction.%{_F}%.icon}
  1380. else:
  1381. set {_ico} to "&7-"
  1382. if {_cont} is less than 9:
  1383. set {_l1} to "%{_l1}% %{_ico}%"
  1384. add 1 to {_cont}
  1385. else if {_cont} is less than 18:
  1386. set {_l2} to "%{_l2}% %{_ico}%"
  1387. add 1 to {_cont}
  1388. else if {_cont} is less than 27:
  1389. set {_l3} to "%{_l3}% %{_ico}%"
  1390. add 1 to {_cont}
  1391. else if {_cont} is less than 36:
  1392. set {_l4} to "%{_l4}% %{_ico}%"
  1393. add 1 to {_cont}
  1394. else if {_cont} is less than 45:
  1395. set {_l5} to "%{_l5}% %{_ico}%"
  1396. add 1 to {_cont}
  1397. else if {_cont} is less than 54:
  1398. set {_l6} to "%{_l6}% %{_ico}%"
  1399. add 1 to {_cont}
  1400. else if {_cont} is less than 63:
  1401. set {_l7} to "%{_l7}% %{_ico}%"
  1402. add 1 to {_cont}
  1403. else if {_cont} is less than 72:
  1404. set {_l8} to "%{_l8}% %{_ico}%"
  1405. add 1 to {_cont}
  1406. else if {_cont} is less than 81:
  1407. set {_l9} to "%{_l9}% %{_ico}%"
  1408. add 1 to {_cont}
  1409.  
  1410. set {_n} to "N"
  1411. set {_s} to "S"
  1412. set {_e} to "E"
  1413. set {_w} to "W"
  1414. if facing of player is north:
  1415. set {_n} to "&4N&6"
  1416. else if facing of player is south:
  1417. set {_s} to "&4S&6"
  1418. else if facing of player is west:
  1419. set {_w} to "&4W&6"
  1420. else if facing of player is east:
  1421. set {_e} to "&4E&6"
  1422. set {_owner} to "Land of: %{x_factions_FAC::chunks::%chunk at player's location%.owner}%"
  1423. set {_encabezado} to "&6---------[&2%chunk at player's location%&6 %{_owner}% ]-----------"
  1424. replace "chunk" in {_encabezado} with ""
  1425. replace "of %player's world%" in {_encabezado} with ""
  1426. replace "<none>" in {_encabezado} with "nobody"
  1427. send "%{_encabezado}%"
  1428. send "%{_l1}%"
  1429. send "%{_l2}%"
  1430. send "%{_l3}%"
  1431. send "%{_l4}% &6\%{_n}%/"
  1432. send "%{_l5}% &6%{_w}%+%{_e}%"
  1433. send "%{_l6}% &6/%{_s}%\"
  1434. send "%{_l7}%"
  1435. send "%{_l8}%"
  1436. send "%{_l9}%"
  1437.  
  1438. if {_1.used} is set:
  1439. set {_l10} to "&8%{_1}% &9%{_1.used}%"
  1440.  
  1441. if {_2.used} is set:
  1442. set {_l10} to "%{_l10}% &f,%{_2}% &9%{_2.used}%"
  1443.  
  1444. if {_3.used} is set:
  1445. set {_l10} to "%{_l10}% &f,%{_3}% &9%{_3.used}%"
  1446.  
  1447. if {_4.used} is set:
  1448. set {_l10} to "%{_l10}% &f,%{_4}% &9%{_4.used}%"
  1449.  
  1450. if {_5.used} is set:
  1451. set {_l10} to "%{_l10}% &f,%{_5}% &9%{_5.used}%"
  1452.  
  1453. if {_6.used} is set:
  1454. set {_l10} to "%{_l10}% &f,%{_6}% &9%{_6.used}%"
  1455.  
  1456. if {_7.used} is set:
  1457. set {_l10} to "%{_l10}% &f,%{_7}% &9%{_7.used}%"
  1458.  
  1459. if {_8.used} is set:
  1460. set {_l10} to "%{_l10}% &f,%{_8}% &9%{_8.used}%"
  1461.  
  1462. if {_9.used} is set:
  1463. set {_l10} to "%{_l10}% &f,%{_9}% &9%{_9.used}%"
  1464. if {_l10} is set:
  1465. send "%{_l10}%"
  1466. stop
  1467.  
  1468. if arg-1 isn't set:
  1469. send "&6--------------------------------------------"
  1470. send "&9 Forbidden HCF"
  1471. send "&6--------------------------------------------"
  1472. send "&9/f create &2&l>> &7Crea faction"
  1473. send "&9/f show &2&l>> &7Informacion de la faction"
  1474. send "&9/f tag &2&l>> &7Cambia el nombre de la faction"
  1475. send "&9/f list &2&l>> &7Lista de factions"
  1476. send "&9/f sethome &2&l>> &7Crea home de la faction"
  1477. send " "
  1478. send "&6-----------&9/f 2 &7para mas comandos&6-----------"
  1479. stop
  1480.  
  1481. if arg-1 isn't "officer" or "create" or "perms" or "truce" or "invite" or "deinvite" or "join" or "unclaim" or "claim" or "tag" or "sethome" or "show" or "who" or "home" or "leave" or "list" or "disband" or "mod" or "kick" or "owner" or "ally" or "neutral" or "c" or "chat " or "map" or "2" or "3":
  1482. send "&6--------------------------------------------"
  1483. send "&9 Forbidden HCF"
  1484. send "&6--------------------------------------------"
  1485. send "&9/f create &2&l>> &7Crea faction"
  1486. send "&9/f show &2&l>> &7Informacion de la faction"
  1487. send "&9/f tag &2&l>> &7Cambia el nombre de la faction"
  1488. send "&9/f list &2&l>> &7Lista de factions"
  1489. send "&9/f sethome &2&l>> &7Crea home de la faction"
  1490. send " "
  1491. send "&6-----------&9/f 2 &7para mas comandos&6-----------"
  1492. stop
  1493.  
  1494. if arg-1 is "2":
  1495. send "&6--------------------------------------------"
  1496. send "&9 Forbidden HCF"
  1497. send "&6--------------------------------------------"
  1498. send "&9/f home &2&l>> &7Teleport al home de la faction"
  1499. send "&9/f leave &2&l>> &7Sales de la faction"
  1500. send "&9/f invite &2&l>> &7Invita un jugador a la faction"
  1501. send "&9/f deinvite &2&l>> &7Cancela invitacion al jugador"
  1502. send "&9/f claim &2&l>> &7Reclama un chunk"
  1503. send " "
  1504. send "&6-----------&9/f 3 &7para mas comandos&6-----------"
  1505. stop
  1506.  
  1507. if arg-1 is "3":
  1508. send "&6--------------------------------------------"
  1509. send "&9 Forbidden HCF"
  1510. send "&6--------------------------------------------"
  1511. send "&9/f unclaim &2&l>> &7Elimina territorio de faction"
  1512. send "&9/f kick &2&l>> &7Quita un jugador de la faction"
  1513. send "&9/f mod &2&l>> &7Da a un miembro rango de MOD"
  1514. send "&9/f chat &2&l>> &7Cambias de chat"
  1515. send "&9/f owner &2&l>> &7Cambias de chat"
  1516. send "&9/f officer &2&l>> &7Permite que un usuario acceda a tus cofres protegidos"
  1517. stop
  1518.  
  1519. command f-admin [<text>] [<text>] [<text>]:
  1520. permission: skript.faction.admin
  1521. trigger:
  1522. if arg-1 is "disband":
  1523. if arg-2 is set:
  1524. if {x_factions_FAC::factions::%arg-2%} is set:
  1525. set {_F} to arg-2
  1526. if {x_factions_FAC::factions::%{_F}%::ally::*} isn't empty:
  1527. loop {x_factions_FAC::factions::%{_F}%::ally::*}:
  1528. delete {x_factions_FAC::factions::%{_F}%::ally::%loop-value-1%}
  1529. delete {x_factions_FAC::factions::%loop-value-1%::ally::%{_F}%}
  1530. delete {x_factions_FAC::factions::%{_F}%::ally::%loop-value-1%::*}
  1531. delete {x_factions_FAC::factions::%loop-value-1%::ally::%{_F}%::*}
  1532.  
  1533. if {x_factions_FAC::factions::%{_F}%::truce::*} isn't empty:
  1534. loop {x_factions_FAC::factions::%{_F}%::truce::*}:
  1535. delete {x_factions_FAC::factions::%{_F}%::truce::%loop-value-1%}
  1536. delete {x_factions_FAC::factions::%loop-value-1%::truce::%{_F}%}
  1537. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  1538. send "%{@Prefix}% &8Faction deleted by an admin" to player from uuid loop-value-1
  1539. set {x_factions_FAC::players::%loop-value-1%.faction} to "wilder" #Make him a wilder
  1540. set {x_factions_FAC::players::%loop-value-1%.chat} to 1 #Force chat channel
  1541. loop {x_factions_FAC::factions::%{_F}%::lands::*}:
  1542. delete {x_factions_FAC::chunks::%loop-value-1%.owner}
  1543. delete {x_factions_FAC::chunks::%loop-value-1%}
  1544. delete {x_factions_FAC::factions::%{_F}%::*}
  1545. delete {x_factions_FAC::factions::%{_F}%}
  1546. delete {x_factions_FAC::factions::%{_F}%.owner}
  1547. delete {x_factions_FAC::factions::%{_F}%::lands::*}
  1548. delete {x_factions_FAC::factions::%{_F}%::mods::*}
  1549. delete {x_factions_FAC::factions::%{_F}%::players::*}
  1550. send "%{@Prefix}% &8Faction deleted"
  1551. stop
  1552. else:
  1553. send "%{@Prefix}% &8 That faction does not exist"
  1554. stop
  1555.  
  1556. if arg-1 is "kick":
  1557. if arg-2 is set:
  1558. set {_p} to uuid of arg-2 parsed as a player
  1559. if {x_factions_FAC::players::%{_p}%.faction} isn't "wilder":
  1560. set {_F} to {x_factions_FAC::players::%{_p}%.faction}
  1561. if {x_factions_FAC::factions::%{_F}%::owner} is {_p}:
  1562. send "%{@Prefix}%&8 Thans the owner, you can't kick him, use /f-admin disband"
  1563. stop
  1564. send "%{@Prefix}%&8 %player from uuid {_p}% was Kicked from %{_F}%"
  1565. delete {x_factions_FAC::factions::%{_F}%::players::%{_p}%}
  1566. if {x_factions_FAC::factions::%{_F}%::players::mods::%player%} is set:
  1567. delete {x_factions_FAC::factions::%{_F}%::players::mods::%{_p}%}
  1568. set {x_factions_FAC::players::%{_p}%.faction} to "wilder"
  1569. set {x_factions_FAC::players.%{_p}%.chat} to 1
  1570. stop
  1571. else:
  1572. send "%{@Prefix}%&8 %arg-2% is a wilder"
  1573. stop
  1574.  
  1575. if arg-1 is "givedtr":
  1576. if arg-2 is set:
  1577. if arg-3 is set:
  1578. if {x_factions_FAC::factions::%arg-2%} is set:
  1579. set {_F} to arg-2
  1580. set {x_factions_FAC::factions::%{_F}%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}+3
  1581. send "%{@Prefix}% &8 Added %arg-3% dtr to %{_F}%"
  1582. stop
  1583. else:
  1584. send "%{@Prefix}% &8Faction not found"
  1585. stop
  1586. else:
  1587. send "%{@Prefix}% &8 Specify a faction"
  1588. stop
  1589.  
  1590. if arg-1 is "removedtr":
  1591. if arg-2 is set:
  1592. if arg-3 is set:
  1593. if {x_factions_FAC::factions::%arg-2%} is set:
  1594. set {_F} to arg-2
  1595. set {x_factions_FAC::factions::%{_F}%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}-3
  1596. send "%{@Prefix}% &8Removed %arg-3% dtr to %{_F}%"
  1597. stop
  1598. else:
  1599. send "%{@Prefix}% &8Faction not found"
  1600. stop
  1601. else:
  1602. send "%{@Prefix}% &8Specify a faction"
  1603. stop
  1604.  
  1605. if arg-1 is "stopfreeze":
  1606. if arg-2 is set:
  1607. if {x_factions_FAC::factions::%arg-2%} is set:
  1608. set {_F} to arg-2
  1609. set {x_factions_FAC::factions::%{_F}%::dtr.freeze} to now
  1610. subtract 1 second from {x_factions_FAC::factions::%{_F}%::dtr.freeze}
  1611. send "%{@Prefix}% &8Dtr freeze removed from faction %{_F}%"
  1612. stop
  1613. else:
  1614. send "%{@Prefix}% &8Faction not found"
  1615. stop
  1616. else:
  1617. send "%{@Prefix}% &8Specify a faction"
  1618. stop
  1619.  
  1620. if arg-1 is "owner":
  1621. if arg-2 is set:
  1622. if {x_factions_FAC::factions::%arg-2%} is set:
  1623. if arg-3 is set:
  1624. set {_F} to arg-2
  1625. set {_owner} to uuid of arg-3 parsed as a player
  1626. set {x_factions_FAC::factions::%{_F}%::owner} to {_owner}
  1627. set {x_factions_FAC::factions::%{_F}%::mods::%{_owner}%} to {_owner}
  1628. send "%{@Prefix}% &8Owner cambiado? %{_F}%"
  1629. stop
  1630. else:
  1631. send "%{@Prefix}% &8Faction not found"
  1632. stop
  1633. else:
  1634. send "%{@Prefix}% &8Specify a faction"
  1635. stop
  1636.  
  1637.  
  1638. if arg-1 is "fix":
  1639. if arg-2 is set:
  1640. if {x_factions_FAC::factions::%arg-2%} is set:
  1641. if arg-3 is set:
  1642. set {_F} to arg-2
  1643. set {_fixer} to uuid of arg-3 parsed as a player
  1644. set {x_factions_FAC::factions::%{_F}%::mods::%{_fixer}%} to {_fixer}
  1645. set {x_factions_FAC::players::%{_fixer}%.faction} to {_F} #agrego el usuario a la faction
  1646. set {x_factions_FAC::factions::%{_F}%::players::%{_fixer}%} to {_fixer}
  1647. send "%{@Prefix}% &8Fixer creado? %{_F}%"
  1648. stop
  1649. else:
  1650. send "%{@Prefix}% &8Faction not found"
  1651. stop
  1652. else:
  1653. send "%{@Prefix}% &8Specify a faction"
  1654. stop
  1655.  
  1656. if arg-1 is "unfix":
  1657. if arg-2 is set:
  1658. if {x_factions_FAC::factions::%arg-2%} is set:
  1659. if arg-3 is set:
  1660. set {_F} to arg-2
  1661. set {_fixer} to uuid of arg-3 parsed as a player
  1662. delete {x_factions_FAC::factions::%{_F}%::mods::%{_fixer}%}
  1663. delete {x_factions_FAC::players::%{_fixer}%.faction}
  1664. set {x_factions_FAC::players::%{_fixer}%.faction} to "wilder"
  1665. delete {x_factions_FAC::factions::%{_F}%::players::%{_fixer}%}
  1666. send "%{@Prefix}% &8Fixer eliminado? %{_F}%"
  1667. stop
  1668. else:
  1669. send "%{@Prefix}% &8Faction not found"
  1670. stop
  1671. else:
  1672. send "%{@Prefix}% &8Specify a faction"
  1673. stop
  1674.  
  1675.  
  1676. if arg-1 is "deletelands":
  1677. if arg-2 is set:
  1678. if {x_factions_FAC::factions::%arg-2%} is set:
  1679. delete {x_factions_FAC::factions::%arg-2%::lands::*}
  1680. send "%{@Prefix}% &8Lands eliminadas? %arg-2%"
  1681. stop
  1682. else:
  1683. send "%{@Prefix}% &8Faction not found"
  1684. stop
  1685. else:
  1686. send "%{@Prefix}% &8Specify a faction"
  1687. stop
  1688.  
  1689.  
  1690. if arg-1 is "refreshtag":
  1691. FactionTag("call")
  1692. stop
  1693.  
  1694. if arg-1 isn't set:
  1695. send "&6--------------------------------------------"
  1696. send "&9 Forbidden HCF"
  1697. send "&6--------------------------------------------"
  1698. send "&9/f-admin disband &2&l>> &7Disband a faction"
  1699. send "&9/f-admin kick&2&l >> &7kick a player from the faction"
  1700. send "&9/f-admin givedtr &2&l>> &7Give dtr to the faction"
  1701. send "&9/f-admin removedtr &2&l>> &7Takes dtr from the faction"
  1702. send "&9/f-admin stopfreeze &2&l>> &7Remove freeze from the faction"
  1703. send "&9/f-admin refreshtag &2&l>> &7Refresh the players tag"
  1704. send "&6---------------------------------------------------"
  1705. stop
  1706.  
  1707. if arg-1 isn't "disband" or "kick" or "givedtr" or "removedtr" or "stopfreeze" or "refreshtag":
  1708. send "&6--------------------------------------------"
  1709. send "&9 Forbidden HCF"
  1710. send "&6--------------------------------------------"
  1711. send "&9/f-admin disband &2&l>> &7Disband a faction"
  1712. send "&9/f-admin kick&2&l >> &7kick a player from the faction"
  1713. send "&9/f-admin givedtr &2&l>> &7Give dtr to the faction"
  1714. send "&9/f-admin removedtr &2&l>> &7Takes dtr from the faction"
  1715. send "&9/f-admin stopfreeze &2&l>> &7Remove freeze from the faction"
  1716. send "&9/f-admin refreshtag &2&l>> &7Refresh the players tag"
  1717. send "&6----------------------------------------------------"
  1718. stop
  1719.  
  1720. command f-warzone [<integer>]:
  1721. permission: skript.faction.admin
  1722. trigger:
  1723. if arg-1 is set:
  1724. set {_center} to player's location#location you want to loop the chunks around
  1725. set {_radius} to arg-1#radius (in chunks), if it is set to 0 it returns only the chunk at {_center}
  1726. set {_pos} to {_center}
  1727. send ""
  1728. send ""
  1729. send ""
  1730. send "%{@Prefix}% &C&lWAIT UNTIL THE DONE MESSAGE APPEARS!!!!"
  1731. send ""
  1732. send ""
  1733. send ""
  1734. loop 2 * {_radius} + 1 times:
  1735. set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius} + (loop-number - 1) * 16
  1736. set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius}
  1737. loop 2 * {_radius} + 1 times:
  1738. set {_chunks::%{_pos}%} to chunk at {_pos}
  1739. add 16 to z-coordinate of {_pos}
  1740. #If the land is claimed by another faction or the warzone it self, I won't claim it, you will need to use /f-wilderness
  1741. set {_cont} to 0
  1742. loop {_chunks::*}:
  1743. if {x_factions_FAC::chunks::%loop-value-1%} isn't set:
  1744. set {x_factions_FAC::chunks::%loop-value-1%} to loop-value-1
  1745. set {x_factions_FAC::chunks::%loop-value-1%.owner} to "&4WarZone"
  1746. set {x_factions_FAC::factions::%{_F}%::lands::%loop-value-1%} to loop-value-1
  1747. else:
  1748. set {_owner} to {x_factions_FAC::chunks::%loop-value-1%.owner}
  1749. send "%{@Prefix}% &7The chunk %loop-value-1% is claimed by %{_owner}%, use /f-admin unclaim"
  1750. send "%{@Prefix}% &8This one won't be claimed as warzone"
  1751. send ""
  1752. send ""
  1753. send ""
  1754. send "%{@Prefix}% &2&l>>> Done! <<<"
  1755. send ""
  1756. send ""
  1757. send ""
  1758. stop
  1759. else:
  1760. if {x_factions_FAC::chunks::%chunk at player's location%} isn't set:
  1761. set {x_factions_FAC::chunks::%chunk at player's location%} to chunk at player's location
  1762. set {x_factions_FAC::chunks::%chunk at player's location%.owner} to "&4WarZone"
  1763. send "%{@Prefix}% &8This chunk is now a warzone"
  1764. stop
  1765. else:
  1766. send "%{@Prefix}% &8This chunk is claimed by %{x_factions_FAC::chunks::%chunk at player's location%.owner}%"
  1767. stop
  1768.  
  1769. command f-wilderness [<integer>]:
  1770. permission: skript.factions.admin
  1771. trigger:
  1772. if arg-1 is set:
  1773. set {_center} to player's location#location you want to loop the chunks around
  1774. set {_radius} to arg-1#radius (in chunks), if it is set to 0 it returns only the chunk at {_center}
  1775. set {_pos} to {_center}
  1776. loop 2 * {_radius} + 1 times:
  1777. set x-coordinate of {_pos} to x-coordinate of {_center} - 16 * {_radius} + (loop-number - 1) * 16
  1778. set z-coordinate of {_pos} to z-coordinate of {_center} - 16 * {_radius}
  1779. loop 2 * {_radius} + 1 times:
  1780. add 16 to z-coordinate of {_pos}
  1781. #If there are some lands claimed, lets unclaim them
  1782. loop {_chunks::*}:
  1783. if {x_factions_FAC::chunks::%loop-value-1%} is set:
  1784. set {_F} to {x_factions_FAC::chunks::%loop-value-1%.owner}
  1785. delete {x_factions_FAC::chunks::%loop-value-1%}
  1786. delete {x_factions_FAC::chunks::%{_F}%.%loop-value-1%}
  1787. delete {x_factions_FAC::factions::%{_F}%::lands::%loop-value-1%}
  1788. delete {x_factions_FAC::chunks::%loop-value-1%.owner}
  1789. send "%{@Prefix}% &8All the chunks in a radius of %arg-1%, were deleted"
  1790. stop
  1791. else:
  1792. set {_chunk} to chunk at player's location
  1793. if {x_factions_FAC::chunks::%chunk at player's location%} is set:
  1794. set {_F} to {x_factions_FAC::chunks::%chunk at player's location%.owner}
  1795. delete {x_factions_FAC::chunks::%{_chunk}%}
  1796. delete {x_factions_FAC::chunks::%{_F}%.%{_chunk}%}
  1797. delete {x_factions_FAC::factions::%{_F}%::lands::%{_chunk}%}
  1798. delete {x_factions_FAC::chunks::%chunk at player's location%.owner}
  1799. send "%{@Prefix}% &8 You unclaimed this chunk"
  1800. stop
  1801. else:
  1802. send "%{@Prefix}% &8Use this on a claimed land"
  1803. stop
  1804.  
  1805. on script load:
  1806. loop {x_factions_FAC::players::*}:
  1807. if {x_factions_FAC::players::%loop-value%.faction} isn't set:
  1808. set {x_factions_FAC::%loop-value%.faction} to "wilder"
  1809. set {_F} to "&4WarZone"
  1810. if {x_factions_FAC::factions::%{_F}%} isn't set:
  1811. set {x_factions_FAC::factions::%{_F}%} to {_F}
  1812.  
  1813. #CHECK PLAYER'S LOCATION AND NOTIFY IF HE ENTERS TO A CLAIMED LAND
  1814. every 10 tick:
  1815. loop all players:
  1816. set {_chunk} to chunk at loop-player's location
  1817. set {_uuid} to uuid of loop-player
  1818. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  1819. if {x_factions_FAC::players::%{_uuid}%.notificado_entrada} isn't set:
  1820. send "&cEntering &a%{x_factions_FAC::chunks::%chunk at loop-player's location%.owner}%" to loop-player
  1821. set {x_factions_FAC::players::%{_uuid}%.notificado_entrada} to true
  1822. set {x_factions_FAC::players::%{_uuid}%.lastland} to {x_factions_FAC::chunks::%chunk at loop-player's location%.owner}
  1823. delete {x_factions_FAC::players::%{_uuid}%.notificado_salida}
  1824. else:
  1825. if {x_factions_FAC::players::%{_uuid}%.notificado_salida} isn't set:
  1826. delete {x_factions_FAC::players::%{_uuid}%.notificado_entrada}
  1827. if {x_factions_FAC::players::%{_uuid}%.lastland} is set:
  1828. send "&cLeaving &a % {x_factions_FAC::players::%{_uuid}%.lastland}%" to loop-player
  1829. set {x_factions_FAC::players::%{_uuid}%.notificado_salida} to true
  1830.  
  1831. every 1 minute:
  1832. loop {x_factions_FAC::factions::*}:
  1833. set {_F} to loop-value
  1834. set {_p} to 0
  1835. if {x_factions_FAC::factions::%{_F}%::dtr.freeze} < now:
  1836. set {_jugadores} to 0
  1837. set {_jugadores} to size of {x_factions_FAC::factions::%{_F}%::players::*}
  1838. if {_jugadores} is more than 1:
  1839. set {_maxfactiondtr} to ({_jugadores} - 1) * {@player-dtr} + {@solo-faction}
  1840. if {x_factions_FAC::factions::%{_F}%::dtr} is less than {_maxfactiondtr}:
  1841. set {_adddtr} to {_jugadores}*{@minute-dtr}
  1842. set {x_factions_FAC::factions::%{_F}%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}+{_adddtr}
  1843. else:
  1844. set {x_factions_FAC::factions::%{_F}%::dtr} to {_maxfactiondtr}
  1845. else:
  1846. set {_maxfactiondtr} to {@solo-faction}
  1847. if {x_factions_FAC::factions::%{_F}%::dtr} is less than {_maxfactiondtr}:
  1848. set {_adddtr} to {_jugadores}*{@minute-dtr}
  1849. set {x_factions_FAC::factions::%{_F}%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}+{_adddtr}
  1850. else:
  1851. set {x_factions_FAC::factions::%{_F}%::dtr} to {@solo-faction}
  1852. FactionDtr("%{_F}%")
  1853.  
  1854. every 1 hours:
  1855. loop {x_factions_FAC::factions::*}:
  1856. set {_F} to loop-value
  1857. if {x_factions_FAC::factions::%{_F}%::lastactivicty} < now:
  1858. FactionDisband("%{_F}%")
  1859. FactionTag("call")
  1860. stop
  1861.  
  1862. #CANCEL DAMAGE BETWEEN MEMBERS OF FACTION OR ALLY
  1863. on damage of player:
  1864. #bypass damage by enderpearl
  1865. if damage was caused by fall:
  1866. if attacker is victim:
  1867. stop
  1868. if {x_factions_FAC::players::%uuid of attacker%.faction} isn't "wilder":
  1869. if {@faction-fire} is false:
  1870. if {x_factions_FAC::players::%uuid of attacker%.faction} is {x_factions_FAC::players::%uuid of victim%.faction}:
  1871. send "%{@Prefix}% &2%victim% &7is part of your faction" to attacker
  1872. cancel event
  1873. stop
  1874. if {@ally-fire} is false:
  1875. set {_faca} to {x_factions_FAC::players::%uuid of attacker%.faction}
  1876. set {_facv} to {x_factions_FAC::players::%uuid of victim%.faction}
  1877. if {x_factions_FAC::factions::%{_faca}%::ally::%{_facv}%} is set:
  1878. send "%{@Prefix}% &d%victim% &7is part of your ally" to attacker
  1879. cancel event
  1880. stop
  1881. if {@truce-fire} is false:
  1882. set {_faca} to {x_factions_FAC::players::%uuid of attacker%.faction}
  1883. set {_facv} to {x_factions_FAC::players::%uuid of victim%.faction}
  1884. if {x_factions_FAC::factions::%{_faca}%::truce::%{_facv}%} is set:
  1885. send "%{@Prefix}% &d%victim% &7you have a truce with them" to attacker
  1886. cancel event
  1887. stop
  1888.  
  1889. #APPLY DTR FREEZE IF PLAYER HAS NO FACTION
  1890. on death of player:
  1891. if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  1892. set {_F} to {x_factions_FAC::players::%uuid of victim%.faction}
  1893. set {x_factions_FAC::factions::%{_F}%::dtr} to {x_factions_FAC::factions::%{_F}%::dtr}-1
  1894. if {x_factions_FAC::factions::%{_F}%::dtr} is less than -5.5:
  1895. set {x_factions_FAC::factions::%{_F}%::dtr} to -5.5
  1896. set {x_factions_FAC::factions::%{_F}%::dtr.freeze} to now
  1897. add {@dtr-freeze} seconds to {x_factions_FAC::factions::%{_F}%::dtr.freeze}
  1898. FactionDtr("%{_F}%")
  1899.  
  1900. #UPDATE PLAYER'S TAG
  1901. on join:
  1902. wait 1 tick
  1903. if {x_factions_FAC::players::%uuid of player%.faction} isn't set:
  1904. set {x_factions_FAC::players::%uuid of player%.faction} to "wilder"
  1905. else if {x_factions_FAC::players::%uuid of player%.faction} isn't "wilder":
  1906. set {x_factions_FAC::factions::%{_F}%::lastactivicty} to now
  1907. add {@delete-faction-after} days to {x_factions_FAC::factions::%{_F}%::lastactivicty}
  1908. FactionTag("call")
  1909.  
  1910. on right click on {@I}:
  1911. if player is an op:
  1912. stop
  1913. if world of event-location is {@W}:
  1914. set {_chunk} to chunk at event-block's location
  1915. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  1916. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  1917. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  1918. if {_chunkowner} is "&4WarZone":
  1919. if player has permission "sk.factions.admin":
  1920. stop
  1921. else:
  1922. cancel event
  1923. send "%{@Prefix}%&7 You can't do that!"
  1924. stop
  1925. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  1926. if {x_factions_FAC::players::%uuid of player%.faction} isn't {_chunkowner}:
  1927. if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::interact} is "yes":
  1928. stop
  1929. else:
  1930. cancel event
  1931. send "%{@Prefix}%&7 You can't do that!"
  1932. stop
  1933.  
  1934. on right click on {@stash}:
  1935. set {_block} to block at {KOTH::koths::%{KOTH::running::kothname}%::chestloot}
  1936. if event-block is {_block}:
  1937. stop
  1938. if player is an op:
  1939. stop
  1940. if world of event-location is {@W}:
  1941. set {_chunk} to chunk at event-block's location
  1942. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  1943. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  1944. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  1945. if {_chunkowner} is "&4WarZone":
  1946. if player has permission "sk.factions.admin":
  1947. stop
  1948. else:
  1949. cancel event
  1950. send "%{@Prefix}%&7 You can't do that!"
  1951. stop
  1952. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  1953. if {x_factions_FAC::players::%uuid of player%.faction} isn't {_chunkowner}:
  1954. if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::chest} is "yes":
  1955. stop
  1956. else:
  1957. cancel event
  1958. send "%{@Prefix}%&7 You can't do that!"
  1959. stop
  1960. if {x_factions_FAC::factions::%{_F}%::officer::%uuid of player%} isn't set:
  1961. if block in front of event-block is a sign:
  1962. if line 1 of block in front of event-block is "[officer]":
  1963. send "<red>This chest is protected! Only Officers can open it!"
  1964. cancel event
  1965. if line 2 of block in front of event-block is "[officer]":
  1966. send "<red>This chest is protected! Only Officers can open it!"
  1967. cancel event
  1968. if line 3 of block in front of event-block is "[officer]":
  1969. send "<red>This chest is protected! Only Officers can open it!"
  1970. cancel event
  1971.  
  1972. On Break:
  1973. if player is an op:
  1974. stop
  1975. if world of event-location is {@W}:
  1976. set {_chunk} to chunk at event-block's location
  1977. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  1978. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  1979. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  1980. if {_chunkowner} is "&4WarZone":
  1981. if player has permission "sk.factions.admin":
  1982. stop
  1983. else:
  1984. cancel event
  1985. send "%{@Prefix}%&7 You can't do that!"
  1986. stop
  1987. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  1988. if {x_factions_FAC::players::%uuid of player%.faction} isn't {_chunkowner}:
  1989. if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::break} is "yes":
  1990. stop
  1991. else:
  1992. cancel event
  1993. send "%{@Prefix}%&7 You can't do that!"
  1994. stop
  1995. if event-block is a sign:
  1996. if {x_factions_FAC::factions::%{_F}%::owner::%uuid of player%} isn't set:
  1997. if line 1 of event-block is "[officer]":
  1998. send "<red>This chest is protected!"
  1999. cancel event
  2000. if line 2 of event-block is "[officer]":
  2001. send "<red>This chest is protected!"
  2002. cancel event
  2003. if line 3 of event-block is "[officer]":
  2004. send "<red>This chest is protected!"
  2005. cancel event
  2006. if event-block is {@stash}:
  2007. if {x_factions_FAC::factions::%{_F}%::owner::%uuid of player%} isn't set:
  2008. if block in front of event-block is a sign:
  2009. if line 1 of block in front of event-block is "[officer]":
  2010. send "<red>This chest is protected!"
  2011. cancel event
  2012. if line 2 of block in front of event-block is "[officer]":
  2013. send "<red>This chest is protected!"
  2014. cancel event
  2015. if line 3 of block in front of event-block is "[officer]":
  2016. send "<red>This chest is protected!"
  2017. cancel event
  2018. on place:
  2019. if player is an op:
  2020. stop
  2021. if world of event-location is {@W}:
  2022. set {_chunk} to chunk at event-block's location
  2023. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  2024. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  2025. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  2026. if {_chunkowner} is "&4WarZone":
  2027. if player has permission "sk.factions.admin":
  2028. stop
  2029. else:
  2030. cancel event
  2031. send "%{@Prefix}%&7 You can't do that!"
  2032. stop
  2033. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  2034. if {x_factions_FAC::players::%uuid of player%.faction} isn't {_chunkowner}:
  2035. if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::build} is "yes":
  2036. stop
  2037. else:
  2038. cancel event
  2039. send "%{@Prefix}%&7 You can't do that!"
  2040. stop
  2041.  
  2042. #PROTECT PRESSURE PLATE
  2043. on pressure plate:
  2044. if player is an op:
  2045. stop
  2046. if world of event-location is {@W}:
  2047. set {_chunk} to chunk at event-block's location
  2048. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  2049. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  2050. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  2051. if {_chunkowner} is "&4WarZone":
  2052. if player has permission "sk.factions.admin":
  2053. stop
  2054. else:
  2055. cancel event
  2056. send "%{@Prefix}%&7 You can't do that!"
  2057. stop
  2058. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  2059. if {x_factions_FAC::players::%uuid of player%.faction} isn't {_chunkowner}:
  2060. if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::interact} is "yes":
  2061. stop
  2062. else:
  2063. cancel event
  2064. send "%{@Prefix}%&7 You can't do that!"
  2065. stop
  2066.  
  2067. on crop trample:
  2068. if player is an op:
  2069. stop
  2070. if world of event-location is {@W}:
  2071. set {_chunk} to chunk at event-block's location
  2072. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  2073. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  2074. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  2075. if {_chunkowner} is "&4WarZone":
  2076. if player has permission "sk.factions.admin":
  2077. stop
  2078. else:
  2079. cancel event
  2080. send "%{@Prefix}%&7 You can't do that!"
  2081. stop
  2082. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  2083. if {x_factions_FAC::players::%uuid of player%.faction} isn't {_chunkowner}:
  2084. if {x_factions_FAC::factions::%{_chunkowner}%::ally::%{_F}%::perms::break} is "yes":
  2085. stop
  2086. else:
  2087. cancel event
  2088. send "%{@Prefix}%&7 You can't do that!"
  2089. stop
  2090.  
  2091. On Explode:
  2092. if world of event-location is {@W}:
  2093. set {_chunk} to chunk at event-location
  2094. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  2095. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  2096. if {_chunkowner} is "&4WarZone":
  2097. cancel event
  2098. stop
  2099. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  2100. cancel event
  2101. stop
  2102.  
  2103. on enderman pickup:
  2104. if world of event-location is {@W}:
  2105. set {_chunk} to chunk at event-location
  2106. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  2107. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  2108. if {_chunkowner} is "&4WarZone":
  2109. cancel event
  2110. stop
  2111. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  2112. cancel event
  2113. stop
  2114.  
  2115. On zombie breaking a door:
  2116. if world of event-location is {@W}:
  2117. set {_chunk} to chunk at event-location
  2118. if {x_factions_FAC::chunks::%{_chunk}%} is set:
  2119. set {_chunkowner} to {x_factions_FAC::chunks::%{_chunk}%.owner}
  2120. if {_chunkowner} is "&4WarZone":
  2121. cancel event
  2122. stop
  2123. if {x_factions_FAC::factions::%{_chunkowner}%::dtr.raideable} isn't true:
  2124. cancel event
  2125. stop
  2126.  
  2127. #FACTIONS CHAT
  2128. on chat:
  2129. if {@ChatSystem} is true:
  2130. if {x_factions_FAC::players::%uuid of player%.chat} isn't set:
  2131. set {x_factions_FAC::players::%uuid of player%.chat} to 1 #If the player's isnt set, force him to use global
  2132. #Get player's faction
  2133. set {_F} to {x_factions_FAC::players::%uuid of player%.faction}
  2134. if {_F} is "wilder":
  2135. #Just to make sure, if a player is a wilder, he can't be in a faction chat.
  2136. set {_F} to "-"
  2137. set {x_factions_FAC::players::%uuid of player%.chat} to 1
  2138.  
  2139. # GLOBAL CHAT
  2140. if {x_factions_FAC::players::%uuid of player%.chat} is 1:
  2141. # IF YOU NEED SOME VIP OR MOD PREFIX
  2142. # USE THIS SECTION
  2143. #
  2144. # if player has the permission "skript.chat.admin":
  2145. # cancel event
  2146. # broadcast "%{ADMIN}% &4%player%&9~: &c&l%message%"
  2147. # stop
  2148. # if player has the permission "skript.chat.mod":
  2149. # cancel event
  2150. # broadcast "%{MOD}%&9%player%: &3&l%message%"
  2151. # stop
  2152. # if player has the permission "skript.chat.somevip":
  2153. # cancel event
  2154. # broadcast "&6[&c%{_F}%&6] &2%player%&f: %message%"
  2155. # stop
  2156. cancel event
  2157. broadcast "&6[&c%{_F}%&6] &a%player%&f: %message%"
  2158. stop
  2159.  
  2160. #FACTION CHAT
  2161. if {x_factions_FAC::players::%uuid of player%.chat} is 2:
  2162. cancel event
  2163. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  2164. send "&f<&2%{_F}% &2%player%&f>: &a%message%" to player from uuid loop-value
  2165. stop
  2166.  
  2167. # ALLY CHAT
  2168. if {x_factions_FAC::players::%uuid of player%.chat} is 3:
  2169. cancel event
  2170. loop {x_factions_FAC::factions::%{_F}%::ally::*}:
  2171. set {_ally} to loop-value-1
  2172. loop {x_factions_FAC::factions::%{_ally}%::players::*}:
  2173. send "&f<&d%{_F}% &d%player%&f>: &d%message%" to player from uuid loop-value-2
  2174. loop {x_factions_FAC::factions::%{_F}%::players::*}:
  2175. send "&f<&d%{_F}% &d%player%&f>: &d%message%" to player from uuid loop-value-1
  2176. stop
Advertisement
Add Comment
Please, Sign In to add comment