Version: 1.3.0, by Jaxel
Developer Last Online: Sep 2013
Category: Major Additions -
Version: 3.8.x
Rating:
Released: 04-21-2009
Last Update: 04-28-2009
Installs: 211
DB Changes Uses Plugins
Additional Files
No support by the author.
This Conquest System is very similar to the vBarmy system, except it has a few specific fundamental changes. Instead of every player working alone to fight other players, players work together as a single nation to fight other players who are members of different nations. Everything else in the system is pretty much self-explanitory.
That would actually be much better then my original idea. I hope you are willing to release it as an addon =)
Good work!
I fixed it up the ugly way. No plugins since there's no hooks in his add-on whatsoever, so i'm afraid you're gonna have to dig up the php files....
open up conquest.php
replace the whole
PHP Code:
if ($_REQUEST['do'] == 'enlist') { $totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_players AS conquest_players ");
if (!$totals['playerID']) { $totals['playerID'] = 1; } if (!$totals['pGold']) { $totals['pGold'] = 1; } if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID GROUP BY conquest_nations.nationID ");
if ($_REQUEST['do'] == 'enlist') { $totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_players AS conquest_players "); if (!$totals['playerID']) { $totals['playerID'] = 1; } if (!$totals['pGold']) { $totals['pGold'] = 1; } if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID GROUP BY conquest_nations.nationID "); $nationsagain = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID GROUP BY conquest_nations.nationID "); $totaleverything = array(); while($nation2 = $vbulletin->db->fetch_array($nationsagain)) { $totaleverything[] = number_format((($nation2['playerID']) + ($nation2['pTroops'])) / ($totals['playerID'] + $totals['pTroops']) * 100, 2);
I fixed it up the ugly way. No plugins since there's no hooks in his add-on whatsoever, so i'm afraid you're gonna have to dig up the php files....
open up conquest.php
replace the whole
PHP Code:
if ($_REQUEST['do'] == 'enlist')
{
$totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_players AS conquest_players
");
if (!$totals['playerID']) { $totals['playerID'] = 1; }
if (!$totals['pGold']) { $totals['pGold'] = 1; }
if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations
LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID
GROUP BY conquest_nations.nationID
");
if ($_REQUEST['do'] == 'enlist')
{
$totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_players AS conquest_players
");
if (!$totals['playerID']) { $totals['playerID'] = 1; }
if (!$totals['pGold']) { $totals['pGold'] = 1; }
if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations
LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID
GROUP BY conquest_nations.nationID
");
$nationsagain = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations
LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID
GROUP BY conquest_nations.nationID
");
$totaleverything = array();
while($nation2 = $vbulletin->db->fetch_array($nationsagain))
{
$totaleverything[] = number_format((($nation2['playerID']) + ($nation2['pGold']) + ($nation2['pTroops'])) / ($totals['playerID'] + $totals['pGold'] + $totals['pTroops']) * 100, 2);
Once you choose your nation you will see all of the admin rights on the left side for the game. Simply set all of the rights & choose the reset option. Once that's all set configure the usergroups permissions for registered users & any other user groups you may have.
I will give it a shot for now & hopefully Jaxel can work his magic!
Great job none the less!
After testing it out for a day on my forum i decided i made a huge mistake. I shouldn't have added the gold into the calculation. Will remove this later today.
EDIT:
This is the new code :
PHP Code:
if ($_REQUEST['do'] == 'enlist') { $totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_players AS conquest_players "); if (!$totals['playerID']) { $totals['playerID'] = 1; } if (!$totals['pGold']) { $totals['pGold'] = 1; } if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID GROUP BY conquest_nations.nationID "); $nationsagain = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID GROUP BY conquest_nations.nationID "); $totaleverything = array(); while($nation2 = $vbulletin->db->fetch_array($nationsagain)) { $totaleverything[] = number_format((($nation2['playerID']) + ($nation2['pTroops'])) / ($totals['playerID'] + $totals['pTroops']) * 100, 2);
Sorry for double post but i wanted to ask if someone was interested in the code modification i made where it makes it impossible for people under 250 troops to be attacked? (Some kind of newbie / raid protection)
This would add a feature much like your already added "Invest Work Force to Generate Income" feature but more complex & rewarding.
Instead of just pumping stats into defence & waiting for your cycles to gain more gold & in turn adding even MORE defence, this system should allow for a more strategic & exciting system that will get players involved.
If this is possible & could be done, I am willing to start donating to the project.
Each mission or tasks will require a player to have X amount of admin specified items (X amount of soldiers, gold, attack items, defence items, etc).
So an example mission would be:
Title: Rob a bank Requirements: 50 soldiers & 50 Swords Required Turns: 50 Reward: 500 Gold
So if the member attempting to do this mission has 49 soldiers it would throw an error stating you do not meet the requirements.
If you were able to reward certain items instead of just gold that would make the system even better! Then an admin can create mission only items!
I mean the ideas for this would be never ending.
You can hide missions until members have X amount of soldiers. You can have missions that award you spies. Like I said, the ideas just keep coming!
It is something that I feel could REALLY give more than just attack a person & log off the forum. It gives depth & pretty much could make this an addicting games.
If anyone has a better idea I won't be offended at all! I hope this is something we could look forward to in the future!