Files
dreamsmp-alliances.sk
dreamsmp-claims.sk
dreamsmp-core.sk
dreamsmp-elections.sk
dreamsmp-lives.sk
dreamsmp-nations.sk
dreamsmp-prison.sk
dreamsmp-relics.sk
dreamsmp-story.sk
dreamsmp-wars.sk
Code
10 1,343
dreamsmp-nations.sk
options:
prefix: &8[&cNation&8]&r
on load:
if {dsmp::nations::seeded} is not set:
set {dsmp::nations::seeded} to true
set {dsmp::nationdata::dreamsmp::name} to "Dream SMP"
set {dsmp::nationdata::lmanberg::name} to "L'Manberg"
set {dsmp::nationdata::manberg::name} to "Manberg"
set {dsmp::nationdata::pogtopia::name} to "Pogtopia"
set {dsmp::nationdata::snowchester::name} to "Snowchester"
set {dsmp::nationdata::lasnevadas::name} to "Las Nevadas"
set {dsmp::nationdata::kinoko::name} to "Kinoko Kingdom"
set {dsmp::nationdata::badlands::name} to "The Badlands"
set {dsmp::nationdata::elrapids::name} to "El Rapids"
set {dsmp::nationdata::eggpire::name} to "The Eggpire"
set {dsmp::nationdata::syndicate::name} to "The Syndicate"
add "dreamsmp" to {dsmp::nation-ids::*}
add "lmanberg" to {dsmp::nation-ids::*}
add "manberg" to {dsmp::nation-ids::*}
add "pogtopia" to {dsmp::nation-ids::*}
add "snowchester" to {dsmp::nation-ids::*}
add "lasnevadas" to {dsmp::nation-ids::*}
add "kinoko" to {dsmp::nation-ids::*}
add "badlands" to {dsmp::nation-ids::*}
add "elrapids" to {dsmp::nation-ids::*}
add "eggpire" to {dsmp::nation-ids::*}
add "syndicate" to {dsmp::nation-ids::*}
command /nation [<text>] [<text>]:
executable by: players
trigger:
set {_uuid} to "%uuid of player%"
if arg-1 is not set:
send "{@prefix} &e/nation list &7- see nation IDs"
send "{@prefix} &e/nation found <id> &7- lead an unclaimed nation"
send "{@prefix} &e/nation create <id> &7- create a new nation"
send "{@prefix} &e/nation info [id] &7- view a nation"
send "{@prefix} &e/nation invite <player> &7and &e/nation accept"
send "{@prefix} &e/nation leave, kick, transfer, sethome, home"
stop
if arg-1 is "list":
send "{@prefix} &7Nation IDs: &f%{dsmp::nation-ids::*}%"
stop
if arg-1 is "info":
if arg-2 is set:
set {_nation} to lowercase of arg-2
else:
set {_nation} to {dsmp::nation::%{_uuid}%}
if {_nation} is not set:
send "{@prefix} &cSpecify a nation ID."
stop
if {dsmp::nationdata::%{_nation}%::name} is not set:
send "{@prefix} &cThat nation does not exist."
stop
set {_name} to {dsmp::nationdata::%{_nation}%::name}
set {_count} to size of {dsmp::nationdata::%{_nation}%::members::*}
send "{@prefix} &e%{_name}% &7(ID: %{_nation}%)"
if {dsmp::nationdata::%{_nation}%::leader} is set:
set {_leader} to {dsmp::nationdata::%{_nation}%::leader}
set {_leaderName} to {dsmp::names::%{_leader}%}
if {_leaderName} is not set:
set {_leaderName} to {_leader}
send "&7Leader: &f%{_leaderName}%"
else:
send "&7Leader: &funclaimed"
send "&7Members: &f%{_count}%"
stop
if arg-1 is "found":
if arg-2 is not set:
send "{@prefix} &cUsage: /nation found <id>"
stop
if {dsmp::nation::%{_uuid}%} is set:
send "{@prefix} &cYou already belong to a nation."
stop
set {_nation} to lowercase of arg-2
if {dsmp::nationdata::%{_nation}%::name} is not set:
send "{@prefix} &cThat nation does not exist. Use /nation create instead."
stop
if {dsmp::nationdata::%{_nation}%::leader} is set:
send "{@prefix} &cThat nation already has a leader."
stop
set {dsmp::nationdata::%{_nation}%::leader} to {_uuid}
set {dsmp::nation::%{_uuid}%} to {_nation}
add {_uuid} to {dsmp::nationdata::%{_nation}%::members::*}
delete {dsmp::invite::%{_uuid}%}
set {_name} to {dsmp::nationdata::%{_nation}%::name}
broadcast "{@prefix} &e%player% &ffounded &e%{_name}%&f."
stop
if arg-1 is "create":
if arg-2 is not set:
send "{@prefix} &cUsage: /nation create <id>"
stop
if {dsmp::nation::%{_uuid}%} is set:
send "{@prefix} &cYou already belong to a nation."
stop
set {_nation} to lowercase of arg-2
if {_nation} matches "^[a-z0-9_-]{2,20}$":
if {dsmp::nationdata::%{_nation}%::name} is set:
send "{@prefix} &cThat nation ID already exists."
stop
set {dsmp::nationdata::%{_nation}%::name} to arg-2
set {dsmp::nationdata::%{_nation}%::leader} to {_uuid}
set {dsmp::nation::%{_uuid}%} to {_nation}
add {_uuid} to {dsmp::nationdata::%{_nation}%::members::*}
add {_nation} to {dsmp::nation-ids::*}
delete {dsmp::invite::%{_uuid}%}
broadcast "{@prefix} &e%player% &fcreated the nation &e%arg-2%&f."
else:
send "{@prefix} &cIDs must be 2-20 letters, numbers, underscores or hyphens."
stop
if arg-1 is "accept":
if {dsmp::nation::%{_uuid}%} is set:
send "{@prefix} &cYou already belong to a nation."
stop
set {_nation} to {dsmp::invite::%{_uuid}%}
if {_nation} is not set:
send "{@prefix} &cYou have no nation invitation."
stop
if {dsmp::nationdata::%{_nation}%::leader} is not set:
delete {dsmp::invite::%{_uuid}%}
send "{@prefix} &cThat invitation is no longer valid."
stop
set {dsmp::nation::%{_uuid}%} to {_nation}
add {_uuid} to {dsmp::nationdata::%{_nation}%::members::*}
delete {dsmp::invite::%{_uuid}%}
set {_name} to {dsmp::nationdata::%{_nation}%::name}
broadcast "{@prefix} &e%player% &fjoined &e%{_name}%&f."
stop
set {_nation} to {dsmp::nation::%{_uuid}%}
if {_nation} is not set:
send "{@prefix} &cYou are not in a nation. Use /nation list."
stop
if arg-1 is "leave":
if {dsmp::nationdata::%{_nation}%::leader} is {_uuid}:
send "{@prefix} &cTransfer leadership before leaving."
stop
remove {_uuid} from {dsmp::nationdata::%{_nation}%::members::*}
delete {dsmp::nation::%{_uuid}%}
set {_name} to {dsmp::nationdata::%{_nation}%::name}
broadcast "{@prefix} &e%player% &fleft &e%{_name}%&f."
stop
if arg-1 is "home":
if {dsmp::jailed::%{_uuid}%} is true:
send "{@prefix} &cYou cannot use nation home while imprisoned."
stop
if {dsmp::nationdata::%{_nation}%::home} is not set:
send "{@prefix} &cYour leader has not set a nation home."
stop
teleport player to {dsmp::nationdata::%{_nation}%::home}
send "{@prefix} &aTeleported to your nation home."
stop
if arg-1 is "sethome":
if {dsmp::nationdata::%{_nation}%::leader} is not {_uuid}:
send "{@prefix} &cOnly your leader can set the home."
stop
set {_chunk} to "%chunk at location of player%"
if {dsmp::claims::%{_chunk}%} is not set:
send "{@prefix} &cSet your home inside a chunk your nation owns."
stop
if {dsmp::claims::%{_chunk}%} is not {_nation}:
send "{@prefix} &cSet your home inside a chunk your nation owns."
stop
set {dsmp::nationdata::%{_nation}%::home} to location of player
send "{@prefix} &aNation home set."
stop
if arg-1 is "invite":
if {dsmp::nationdata::%{_nation}%::leader} is not {_uuid}:
send "{@prefix} &cOnly your leader can invite players."
stop
if arg-2 is not set:
send "{@prefix} &cUsage: /nation invite <online player>"
stop
set {_target} to arg-2 parsed as player
if {_target} is not set:
send "{@prefix} &cThat player is not online."
stop
set {_targetId} to "%uuid of {_target}%"
if {dsmp::nation::%{_targetId}%} is set:
send "{@prefix} &cThat player already belongs to a nation."
stop
set {dsmp::invite::%{_targetId}%} to {_nation}
set {_name} to {dsmp::nationdata::%{_nation}%::name}
send "{@prefix} &aInvitation sent to %{_target}%."
send "{@prefix} &eYou were invited to %{_name}%. Use &f/nation accept&e." to {_target}
stop
if arg-1 is "kick":
if {dsmp::nationdata::%{_nation}%::leader} is not {_uuid}: