VectronCraft Towny Wars
Description:
Like the land management of Towny but think it's too tame? Like the PvP of Factions but nowhere for your players to build in peace? Introducing Vectron Wars - A Towny Advanced add-on that will bridge the gap between those two plugins and allow your builders to build without running the risk of having their beautiful creations destroyed, while still allowing your towns and nations to participate in the chaotic Factions-like PvP element.
Basic Idea:
When a nation declares war on another nation, PvP is turned on in the towns at war, the nations declare each other as enemies (prevents town spawn travel), and the two nations are given a defense value equal to the number of towns in the nation, and each town within those nations are given a defense value equal to the number of residents * 2 + claimed town chunks (configurable).
If a resident of a nation at war is killed by a member of the enemy nation, a defense point is taken off of the victims town. Once the town defense reaches zero, it gets added to the enemies nation, a defense point is taken off of the victims nation, and the victims nations balance divided by the number of towns in that nation (before the conquer), and added to the victors nations balance. Then assuming you have set up the permissions correctly, conquered towns must remain in the nation that conquered them until such a time as their kicked, or conquered by another nation (I recommend setting up a max tax on towns and nations to prevent abuse). Players may not capture a nations capitol city until all other towns in the enemy nation have been captured.
Commands:
- /twar - Displays TownyWars configuration information (how the point calculation is setup + costs setup).
- /twar help - Displays the TownyWars help page.
- /twar status - Displays a list of ongoing wars.
- /twar status [nation] - Displays a list of the nations towns and their defense points
- /twar declare [nation] - Starts a war with another nation (REQUIRES YOU TO BE A KING/ASSISTANT).
- /twar end - Request from enemy nations staff to end the ongoing war. (REQUIRES YOU TO BE A KING/ASSISTANT).
- /twar neutral [nation] - Makes a certain nation neutral so other cannot declare war on it. Neutral nation members will also not be able to declare war on others. This command requires the townywars.neutral permission.
Admin Commands:
- /twar reload - Reloads the plugin
- /twar astart [nation] [nation] - Forces two nations to go to war.
- /twar aend [nation] [nation] - Forces two nations to stop a war.
Permissions:
- townywars.admin - Grants access to admin commands
- townywars.neutral - Grants the ability to make a nation neutral
Configuration:
- pper-player: 2.0 - Defense Points allocated per resident to the town defense - (this setting is a double)
- pper-plot: 1.0 - Defense Points allocated per owned chunk to the town defense (this setting is a double)
- death-cost: 0.0 - If killed during a war by an enemy town, your town will pay the killers town this amount. (this setting is a double)
- declare-cost: 0.0 - It will cost nations this amount to declare war. (this setting is a double)
- end-cost: 0.0 - It will cost both nations this amount if they decide to end the war peacefully. (this setting is a double)
Dependencies:
- Requires Towny Advanced 0.82.1.6 and up to operate.
Setup:
- Download plugin and drop it into the plugins directory
- Change your permissions so regular Towny residents DO NOT have the permission: towny.command.nation.leave (this makes it so towns cannot leave the nation once they have joined and must be conquered back or kicked)
- Restart!
Contribute
Would you like to help contribute to this project? Please visit our bitbucket (github like service), and help us out by reporting bugs, and even programming new features that you would like to see! We will turn the current code into the plugin and publish it to bukkitdev weekly (if updates exist).
Hello.
I have fixed your plugin. I won't post it to git because I recoded so much badly coded and broken parts that it's hardly the same project anymore. Would you guys be intressted in the fixed version, or is the project archived?
You can contact me on [email protected]
Purely awesome, that's what Towny needed. By the way, can you make a "smaller-scale" war type? I mean, not nations, but cities fight each other, plot by plot, (like in original war, but the plots will be attached to the attacking city) What do you thinK?
@andrewcramer
Just use the Towny integrated war system, it does that and it's already made. This plugin is pretty much the opposite of what you are asking for it seems.
Does a player only get that certain amount of defence points lost when they get killed or can that number keep going down per kill? AKA 1 person joins the enemy town waits till everyone else is offline then allows his friends in another nation to spam kill him to conquer that town.
I have a suggestion could you make it so if a town loses a war there town gets disbanded and open to raiding? but have it off by default just have it in the config file as a option
Is there anyway to can make it turn pvp on for the 2 towns? 2 towns can declare but they can't kill.
I am also experiencing the same permissions issues with ending wars. It also seems that upon reload, the config.yml resets itself to the default values. This plugin looks promising and I hope it gets fixed soon. Using Essentials GroupManager and gringotts
I downloaded the newest version the 1.1.4, /twar start works but i had to problems. /twar end still says "You are not powerful enough...". Also the econ setting death-cost: 1.0 works but the declare is not charging (can't test end perms). PS i'm using gringotts.
Question about the main mechanics of this plugin:
What stops players from just not ever having their town be a part of a nation in the first place?
Sorry guys, been pretty busy with work, didn't have time to work on it.
Thank you VariousArtist for the fix!
If you want to download pre-bukkit-check, here you go: http://dev.bukkit.org/bukkit-plugins/vectron-towny-wars/files/8-towny-wars-v1-1-4-3/
And i think this is the permission trap "not powerful enough":
WarExecuter.java line 284:
if ((!admin) && (!nat.isKing(res)) || (!nat.hasAssistant(res)))
So if youre not admin nor king OR not assistant it doesnt allow you to declare war. King is not assistant so this condition is always met for Kings.
Should be:
if ((!admin) && (!nat.isKing(res)) && (!nat.hasAssistant(res)))
When youre not admin, not king AND also not assistant you shouldnt have the power to declare war.
Edit: Solved the issue. posted to git.
Plugin.yml should be:
commands:
twar:
usage: No permission!
permissions:
twar neutral:
usage: townywars.neutral
Hey, i went to use the plugin, unfortunately it doesn't seem to work the way you say it should, could you fix it as my normal players can't declare war because they don't have enough power to, heck I the owner can't even do it. If you could update this that would be great, especially if it works after the update. It's a great idea
Can you fix the permission's bug?
@DanielYRH
hi Dan thanks for reply - im afraid i get the same "you are not powerful enough in your nation to do that" when i try to declare war - although i'm god emperor
using the last jar file below towny 0.84.0.9 and spigot
I tested the link you sent "t0mmie_owner" and the /twar aend and /twar astart work but /twar declare /end don't for regular people
@t0mmie_owner Hi, thanks for helping look for the issue... That shouldn't be what is causing the problem... but try this jar, let me know if it works
Dear DanielYRH,
The last 2 hours I have been trying things with your code, and the problem is here: if ((!admin) && (!nat.isKing(res)) || (!nat.hasAssistant(res))) { cs.sendMessage(ChatColor.RED + "You are not powerful enough in your nation to do that!"); return true;
When I remove admin and assistance and change king, so like this: if ( (!res.isKing())) { cs.sendMessage(ChatColor.RED + "Only the king of your nation can end war!"); return true; }
With that it does work, I am not good with java but I think because I changed the king part to (!res.isKing())) instead of (!nat.isKing(res)) it works now (or maybe because I removed the assistance and admin part).
Hope I have helped you, I planned a war event on my server for tonight and I really need it working within 1-2 hours..
-Tommie
@doomlordking
Alrighty, hmm... back to being not entirely sure what could have caused this bug... updated the CB and towny version used in the plugin... perhaps this will magically make something work. If not, I'll comb through the code and see what i can find.
Here's a link to the latest jar
Make sure you are using the latest towny (0.84.0.9)
@DanielYRH
i downloaded the .jar you sent but it still didn't work http://imgur.com/uyiNAya,vQgXBHG,8GUqbFF#1 I am king/mayor of my town but it still says i'm not high enough (i uploaded 3 photos)