Commit b547d3c4 authored by Tommy Ang's avatar Tommy Ang 🤣

Merge branch 'feature/town-land-claiming' into 'master'

Town land claiming

See merge request !4
parents 99c01b22 6856f064
......@@ -8,7 +8,12 @@
import:
org.bukkit.event.player.PlayerInteractEvent
options:
ChunkPrice: 100
ChunksPerPurchase: 5
MaxChunksPerTown: 300
command /potatotown <text="help"> [<text>]:
aliases: ptown
description: Potato Town
......@@ -17,7 +22,7 @@ command /potatotown <text="help"> [<text>]:
trigger:
if arg 1 is "help":
if arg 2 is not set:
message "&6-------------------Potato Town (&e1&6/&e4&6)-------------------"
message "&6-------------------Potato Town (&e1&6/&e5&6)-------------------"
message "&e/ptown create <name> - &aCreate a new town at your location"
message "&e/ptown info <townname> - &aCheck the town's statistics"
message "&e/ptown mod <player> - &aPromote/Demote a player"
......@@ -26,7 +31,7 @@ command /potatotown <text="help"> [<text>]:
message "&e/ptown join <townname> - &aJoin the targeted town"
message "&e/ptown help 2 &aFor next page"
if arg 2 is "1":
message "&6-------------------Potato Town (&e1&6/&e4&6)-------------------"
message "&6-------------------Potato Town (&e1&6/&e5&6)-------------------"
message "&e/ptown create <name> - &aCreate a new town at your location"
message "&e/ptown info <townname> - &aCheck the town's statistics"
message "&e/ptown mod <player> - &aPromote/Demote a player"
......@@ -35,7 +40,7 @@ command /potatotown <text="help"> [<text>]:
message "&e/ptown join <townname> - &aJoin the targeted town"
message "&e/ptown help 2 &aFor next page"
if arg 2 is "2":
message "&6-------------------Potato Town (&e2&6/&e4&6)-------------------"
message "&6-------------------Potato Town (&e2&6/&e5&6)-------------------"
message "&e/ptown leave - &aLeave your current town"
message "&e/ptown claim - &aClaim chunk for your town"
message "&e/ptown unclaim - &aUnclaim chunk from your town"
......@@ -44,7 +49,7 @@ command /potatotown <text="help"> [<text>]:
message "&e/ptown where - &aCheck your current location"
message "&e/ptown help 3 &aFor next page"
if arg 2 is "3":
message "&6-------------------Potato Town (&e3&6/&e4&6)-------------------"
message "&6-------------------Potato Town (&e3&6/&e5&6)-------------------"
message "&e/ptown prinvite <player> - &aAdd player from different town as PR"
message "&e/ptown prkick <player> - &aRemove player's PR status"
message "&e/ptown prflag <build/break> - &aFlags to allow PRs interactions"
......@@ -54,14 +59,23 @@ command /potatotown <text="help"> [<text>]:
#message "&e/ptc <text> - &aSends a message to your online members"
message "&e/ptown help 4 &aFor next page"
if arg 2 is "4":
message "&6-------------------Potato Town (&e4&6/&e4&6)-------------------"
message "&6-------------------Potato Town (&e4&6/&e5&6)-------------------"
message "&3&l&oPotatoTown Flag Guide"
message "&e/ptown flag <flag> - &aToggle Flag Option"
message "&e&oAvailable flags - &a&oFire, ff "
message ""
message "&aGreen &e- Protection Enabled"
message "&cRed &e- Protection Disabled"
message "&e/ptown help 4 &aFor Next Page"
message "&e/ptown help 5 &aFor Next Page"
if arg 2 is "5":
message "&6-------------------Potato Town (&e5&6/&e5&6)-------------------"
message "&e/ptown buy chunk - &aBuy {@ChunksPerPurchase} for ({@ChunksPerPurchase} * {@ChunkPrice}) &2RC"
message ""
message ""
message ""
message ""
message ""
message "&6-------------------End of help page--------------------"
#if arg 2 is "4":
# message "&6-------------------Potato Town (&e4&6/&e4&6)-------------------"
# message "&3&l&oPotatoTown Nation Guide"
......@@ -800,12 +814,25 @@ command /potatotown <text="help"> [<text>]:
stop
if arg 1 is "buy":
if arg 2 is "chunk":
if {ptown.%player%} is not set:
if {language.%player%} is "chinese":
message "[&6PTown&f] 您不在镇里"
if {language.%player%} is "english":
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 {@MaxChunksPerTown}:
message "Failed to buy more, your town is already at the max size of {@MaxChunksPerTown}"
stop
if "%{ptown.%{_town}%.owner}%" is player's name:
if {ptown.money::%{_town}%} is more than 14999:
add 5 to {ptown.%{_town}%.maxsize}
message "Successfully bought 5 chunks for 15000"
remove 15000 from {ptown.money::%{_town}%}
# add ({@ChunksPerPurchase} * {@ChunkPrice}) to {ptown.money::%{_town}%} # Use this to buy a chunk at no cost
if {ptown.money::%{_town}%} is more than or equal to {@ChunkPrice}:
add {@ChunksPerPurchase} to {ptown.%{_town}%.maxsize}
message "Successfully bought {@ChunksPerPurchase} chunks for %{@ChunksPerPurchase} * {@ChunkPrice}%"
remove ({@ChunksPerPurchase} * {@ChunkPrice}) from {ptown.money::%{_town}%}
stop
message "Not enough funds"
stop
# if arg 1 is "tax":
# if arg 2 is set:
# set {_number} to arg 2 parsed as number
......@@ -1208,6 +1235,7 @@ command /potatotown <text="help"> [<text>]:
message "Current Location: &2Wilderness"
if {ptownlist.chunk::%chunk at player%} is set:
message "Current Location: &d%{ptownlist.chunk::%chunk at player%}%"
command /potatotownadmin <text> [<text>] [<text>]:
aliases: ptownadmin
......
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