Commit 42f90de3 authored by Atsukio's avatar Atsukio 🐬

limit claim size to value based in options

parent ebcc4c6f
......@@ -29,8 +29,9 @@ variables:
# return economy response with amount modified event-number, new balance {peco.money::%event-offlineplayer%}, response type success, and error message "none"
options:
chunk_price: 5000
chunk_price: 100
chunks_per_purchase: 5
max_chunk_per_town: 300
command /potatotown <text="help"> [<text>]:
aliases: ptown
......@@ -750,7 +751,11 @@ command /potatotown <text="help"> [<text>]:
message "[&6PTown&f] Land must be connected"
stop
set {_town} to "%{ptown.%player%}%"
if {ptown.%{_town}%.size} is more than or equal to {ptown.%{_town}%.maxsize}:
if {ptown.%{_town}%.maxsize} is more than or equal to {@max_chunk_per_town}:
set {_max_size} to {@max_chunk_per_town}
else:
set {_max_size} to {ptown.%{_town}%.maxsize}
if {ptown.%{_town}%.size} is more than or equal to {_max_size}:
if {language.%player%} is "chinese":
message "[&6PTown&f] 超过最大容量"
if {language.%player%} is "english":
......@@ -836,8 +841,11 @@ command /potatotown <text="help"> [<text>]:
message "[&6PTown&f] You are not in a town"
stop
set {_town} to {ptown.%player%}
if {ptown.%{_town}%.maxsize} is more than or equal to {@max_chunk_per_town}:
message "Failed to buy more, your town is already at the max size of {@max_chunk_per_town}"
stop
if "%{ptown.%{_town}%.owner}%" is player's name:
# add ({@chunks_per_purchase} * {@chunk_price}) to {ptown.money::%{_town}%}
# add ({@chunks_per_purchase} * {@chunk_price}) to {ptown.money::%{_town}%} # Use this to buy a chunk at no cost
if {ptown.money::%{_town}%} is more than or equal to {@chunk_price}:
add {@chunks_per_purchase} to {ptown.%{_town}%.maxsize}
message "Successfully bought {@chunks_per_purchase} chunks for %{@chunks_per_purchase} * {@chunk_price}%"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment