Jump to content

C&N - land protection mod


KenigVovan
 Share

Recommended Posts

Mod divides world map to plots with size 16x16xWorldHeight.
For this plot can be set rights for groups of players.
There are 3 types of right toward plot: build/destroy, use and damage against protected
animals(changable in config).
Besides this there are pvp, firespread and blast flags which turn on/off results
of corresponding events. Also by default falling block(sand, gravel...) won't fall to claimed
plot from not claimed. Same way for water flow.

There are 4 groups for which can be set right:
citizen, ally, stranger, friend
There are 3 main "structure" in the mod: VILLAGE, CITY, ALLIANCE.

Village is just 1 protected plot with lower price of creation but
without possibility for pvp, firespread and blast to be turned off.
Village will also be deleted after specified amount of time(default 1 real week).

City: can have more plots. The number of possible plots depends
on amount of citizens in the town. For plots in the city can be turned on/off
pvp, firespread, blasts. For every plot every real day will be taken payment.

Alliance: structure which contains cities(at least 1 city) which can declare wars to
other alliancies.

Link to DB     Discord

Test server: 176.102.66.120:42420  (Claims mod testing server)

General Info

Spoiler

Mod serves for territory protection and configure access to it. Main parts are plots, city, village.
Plot is just a area 16x16x(height of the world) of the map (/plot borders on/off) that can be claimed.
Plots can be claimed using village or city. A village can have only one claimed plot but it costs less than city.
For a city amount of plots depends on its population.

For each plot you can change access permissions for groups(friend/citizen/ally/stranger) build/use/attack animals.
There are different types of plots which are described in another part of topic.

Firstly you need to create a village or a city. The village is cheaper by default. But it will exist only limited time - 1 real week, and can be created by
player only if he is playing his first week on the server. During all the time village exists you don't pay anything for it.

For creation of a city you can have payment item in your inventory the same way as with village. But every real day you
city and it's citizens will pay fee. Citizens for every plot they have(mayor can set fee for plot or plotsgroup), and city for every plot.
If city doesn't pay fee it's dept will increase and after threashold it will be deleted. If citizen doesn't pay he is kicked from the city or 
his plots are taken away(depends on the settings).

ClaimsExt

Spoiler

(There is also additional mod (link) which adds borders of the claimed plots on the map and will have other features in the future)

2022-03-25_15-15-06.thumb.png.c66306605bc881d6ce9d4298bd7c5bbf.png

Simple gui for commands and info about city/alliance/village  -  button "P"

maingui.png.a6774ece5f1f32e878b7a6117755a8d3.png

 

-------------------------------------------------------------------------------------
Plot types

Spoiler

Plots have types and in the city you can change it. There are some types of them:
summon, prison, embassy.
Summon: in the border of this plot can be set point there citizen of the city can
teleport. By default near this summon point should stay other 2 players to let player to
teleport (but you can change it to 0 and have just default teleport point). This teleports
can be turned off in config, set amount of gears which player will pay or set cooldown time
between each teleporation.
Prison: is the plot where will be teleported killed in the border of your city "criminal"
or player of hostile alliance. In one plot can be max. 4 cells (4 points there can be teleported
captured player). Captured player will have to sit there for hours number set in the config,
pay to be freed or run away somehow from plot with prison.
Embassy: other plot types can be bought only by citizens of this city. Embassy plots
can be bought by anybode(even by player without any city).

Tavern: let you make innerclaims in it's borders. Which have it's own list of members and flags for use/build/attackanimals.

---------------------------------------------------------------------------------------

City plots group

In the city can be created cityplotsgroup which can contain list of the plots. For this
group you can set rights same like for one plot, but group can contain list of the players.
In the group can be added any player, even if player is not member of the cityplotsgroup's city.
---------------------------------------------------------------------------------------

Economy

Spoiler

For creation of village, city, alliance or it's maintenance you will need to pay. By default
rusty gear is set as payment item. For bank creation you will need to place chest and after
that place sign on it. Then you'll write [player]/[city]/[alliance] depends which type of
bank you want to create. After ] you'll need to add your nickname/name of the city/name of the alliance.
If there is't enough space for full name on first line just continue on the next. After that
you need to save content. For city only a mayor can create bank, for alliance only a leader.
Also chest should be placed in city's plots for city/alliance. Player's bank can not be created
by another player. After you got message that bank was created you can destroy the sign.

For every plot player owns he'll pay every real day. Also for there is can be fee for membership in cityplotsgroup. 
Every city also has default fee and fee from every plot depends on the type of the plot.

2022-04-07_18-10-29.thumb.png.0e44d93cf2a0d7c1b786dfd2cd34fea9.png

---------------------------------------------------------------------------------------

An alliance can declare war to another alliance. By default the target alliance should to
agree with war to conflict to start. Alliance is defeated when it's members will die spicified
number of times. After that defeated alliance will pay to the winner every real day some rusty
gears(by default).

---------------------------------------------------------------------------------------

Inner claim

Spoiler

Can be created only in the borders of the tavern plot (/plot set type tavern). For every inner claim you can change flags for use/build/attack(animals), list of players, who has access to this claim. There are max number of claims for one plot (set by config, default - 4). Command for creation and etc below (for /plot innerclaim ...). You should stand in tavern-plot which you want to change/show. 

You select first point with /plot innerclaim start, second /plot innerclaim end and selected area will be highlighted.

 

#####################################################################################

Commands

Spoiler

PERMGROUP = citizen, ally, stranger, friend
PERMTYPE = build, use, attack (attack protected animals)

#####################################################################################
/c summonlist
/c summon #
/c summon set (in summon plot)

/c new NAME
/c delete
/c set name
/c set p PERMGROUP PERMTYPE on/off
/c claim
/c unclaim
/c set invmsg MSG
/c set fee #
/c set open on/off
/c set fee #
/c set pvp/fire/blast on/off

RANKNAME is in bergperms and can be changed
by default it is assistant for city and alliance

/c rank add/remove RANKNAME PLAYERNAME
/c rank list
/c rank list PLAYERNAME

/c plotsgroup list  -  write down all city's plotsgroups
/c plotsgroup listplayers GROUPNAME  -  show members of group
/c plotsgroup create/delete GROUPNAME  - create/delete plotsgroup
/c plotsgroup add/kick GROUPNAME PLAYERNAME  - add/kick player to/from group
/c plotsgroup unadd GROUPNAME PLAYERNAME  -  remove invitation for player to group
/c plotsgroup plotadd/plotremove GROUPNAME  -  add/remove city's plot to/from group
/c plotsgroup set p GROUPNAME PERMGROUP PERMTYPE on/off  -  change permission for plotsgroup

/c invitereceived  -  list of received invitations for city(to alliance)
/c invitesent  - list of sent invitations (from this city to players)
/c invite deny/accept  (CITYNAME) -  a/d invitation to join city
/c criminal add/remove PLAYERNAME  - add player to list of criminals in the city

/c inviteaccept ALLIANCENAME  -  accept invitation to alliance (for city)

/c invite PLAYERNAME
/c uninvite PLAYERNAME
/c kick PLAYERNAME
/c join CITYNAME
/c leave

/c prison addcell (stand on the prison plot)  -  add new spawn point of the prison plot
/c prison removecell # (stand on the prison plot)  -  remove ^^
/c prison list (stay on the prison plot)  -  list all spawn points of the prison plot

/c criminal add/remove PLAYERNAME  -  add player to criminal list of the city. Criminal will be place in the prison, if killed by citizen with "city:militia" permission in the city's borders. [Now only mayor has this perm, i'll add rank for this.]

####################################################################

/plot set p PERMGROUP PERMTYPE on/off
/plot claim  -  command to buy plot with "for sale" state
/plot unclaim  -  return back plot to the city (give up ownership of the plot)
/plot fs #  -  set plot for sale (citizens can buy it) for # payment items. Also if it's a embassy plot then everybody can buy it.
/plot nfs  -  remove "for sale" state
/plot borders on/off  -  turn on/off highlight of plot borders
/plot plotmsgs on/off  - turn on/off msg of current plot 
/plot set name  -  change name of plot, which will be written to player, when he go inside the borders


####################################################################
/citizen set p PERMGROUP PERMTYPE on/off
/citizen feestate
/citizen friend add/remove PLAYERNAME
/citizen prison
/citizen prison payout
/citizen info PLAYERNAME
/citizen invitelist show #
/citizen invitelist

####################################################################

(admin commands)

/cadmin nday/nhour/backup  -  trigger new day/hour/backup

/cadmin gb info/withdraw/deposit  -  for global bank account

/cadmin city new NAME  -  create new city without mayor on plot you stand
/cadmin city NAME claim   -  claim plot you stand on for city with NAME
/cadmin city NAME unclaim  -  unclaim plot you stand on for city with NAME
/cadmin city OLDNAME  set name NEWNAME  -  set new name for the city
/cadmin city CITYNAME set mayor PLAYERNAME  - set mayor of the city player with PLAYERNAME 
#####################################################################
/agree - on city, village, alliance creation

#####################################################################
/accept CITYNAME - for player to join city

#####################################################################
/plotsgroupaccept - show your plotsgroups

#####################################################################
/plotsgroupaccept CITYNAME

#####################################################################
/plotsgroupleave CITYNAME:PLOTSGROUPNAME

#####################################################################
/village new VILLAGENAME
/village delete
/village set name/chief/p/
/village invite PLAYERNAME
/village uninvite PLAYERNAME
/village kick PLAYERNAME
/village info VILLAGENAME
#####################################################################
/a or /alliance
/a new ALLIANCENAME
/a delete
/a set name NEWALLIANCENAME
/a set fee #
/a invite CITYNAME
/a invitelist #

/a conflict declare ALLIANCENAME
/a conflict letterssent #
/a conflict lettersreceived #
/a conflict denystart ALLIANCENAME
/a conflict acceptstart ALLIANCENAME
/a conflict stop ALLIANCENAME
/a conflict acceptstop ALLIANCENAME
/a conflict denystop ALLIANCENAME

##############################################################
Stand in a tavern plot you want to show/change.

/plot innerclaim list  -  show info about all inner claims for the plot

/plot innerclaim show #  - highlight chosen innerclaim

/plot innerclaim start  -  select first point of the inner claim

/plot innerclaim end  -  select second point of the inner claim

/plot innerclaim create  - save new inner claim with chosen points

/plot innerclaim delete #  -  delete innerclaim with # number

/plot innerclaim add # PLAYERNAME  -  add a player to the list of member of # innerclaim

/plot innerclaim kick # PLAYERNAME  -  kick form list

/plot innerclaim set # use/build/attack on/off  -  change flag value for chosen permission type

Configs

Spoiler

There are 3 files in which you can change setting - claims.json, alliance_level_info.json and city_level_info.json

city_level_info:

  • amountOfPlots   -  amount of plots city can claim on specific level
  • outGo  -  amount of payment items city will pay (without price of plots)
  • summonPlots  -  amount of summon plots city can have

claims.json:

There are a lot of different setting, part of them already have comment (other will be added).

Below is part of them:

  • PATH_TO_DB_AND_JSON_FILES  -  path to directory where json file (not claims.json, it will be in ModConfig) will be stored
  • DB_NAME, MANUALLY_BACKUP_FILE_NAME, DAILY_BACKUP_FILE_NAME, HOURLY_BACKUP_FILE_NAME  -  DB files names
  • NEW_CITY_COST, NEW_ALLIANCE_COST, NEW_VILLAGE_COST  and others  -  prices for creation
  • HOUR_NEW_DAY_START  -  real time hour when taxes collected
  • MIN_DISTANCE_FROM_OTHER_CITY_NEW_CITY  -  min distance between cities
  • BLOCKED_COMMANDS_PRISON  -  list of commands which players can not use in prison
  • PROTECTED_MOB_TYPES  -  names of mobs which will be protected in plot
  • AGREE_FOR_CONFLICT  -  both alliancies have to agree on the start of the conflict
  • MAX_LENGTH_CITY_NAME 
  • SUMMON_MIN_PLAYERS  -  count of players which should be near the summon plot to let player to tp (can be 0)
  • SUMMON_HOR_RANGE and SUMMON_VER_RANGE    -   used by summon plot
  • SUMMON_ALLOWED   -  
  • PLOT_BORDERS_COLOR_WILD_PLOT, PLOT_BORDERS_COLOR_ALLY_PLOT, PLOT_BORDERS_COLOR_ENEMY_PLOT  - rgb colors for different state of plot
  • MAX_NUMBER_INNER_CLAIM_PER_TAVERN  -  max count of inner claims for tavern plot
  • NEW_CITY_ONLY_BY_ITEM   -   new city can be  created only by item from claimsExt mod

 

 

Edited by KenigVovan
Link to comment
Share on other sites

I am extremely interested in this mod and seeing how it progresses.  However, I don't seem to be able to create a new town with /t new townName.  It always says I have no funds.  Logically, I created a chest instead to create a town bank.  This did not provide the indicated /confirm dialogue.  Curiosu what I'm doing wrong?

Edit: Ahhh... Must have currency in hand.

However, I still can't make a chest for a town bank.

While I'm here, a few requests:
Dynamically sizeable claims, something other than a 16x16. I'd love the flexibility of the vanilla claim system in this.  Specific desire: Set up a tavern or inn in which I can sell rooms to live in.  Or a marketplace with individual stalls of less than 16x16.  I know you've got a long ways to go with getting this fully functional.

Also -> Can you perhaps implement something that is required to create a town or nation beyond currency?  Preferably something like a charter that can be bought and will be consumed when a town is created.

 

Edited by Vinter Nacht
Link to comment
Share on other sites

As we talked on discord i'll add info messages for unsuccessful attempts of chest-bank creation (and also check why server gets "" instead of the content of the sign text).

I also will think over how dynamically sizeable claims can be added (need to do something with player's plot permissions cache and most likely it'd be claims in the border of the plot). But i understand that for tavern or marketplace it would be a good addition.

I'll add on the list "permission for town creation" (it probably can be made through commands in this mod or added like an item in additional mod to leave main mod server side only.

Link to comment
Share on other sites

I also cant seem to be able to start a town. when i do the command /town new [name] command i get the following error:

berg:default_berg_prefix Object reference not set to an instance of an object.

 

ive created a personal bank without issue. got 1000 gears in it and a 1000 in my inventory. but no matter what when i run the command, thats what i get. Is there something im doing wrong?

edit-
ive since realized this isnt client side 🤡

 

Edited by Blackmare
Link to comment
Share on other sites

  • KenigVovan changed the title to C&N - land protection mod

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.